Merge remote branch 'origin/master' into experimental

Conflicts:
	vp8/common/alloccommon.c
	vp8/encoder/rdopt.c

Change-Id: I142167d31d1b9cffe143774f6915bca463df67f0
This commit is contained in:
John Koleszar 2011-04-26 08:28:51 -04:00
Родитель 5227798c57 d5c46bdfc0
Коммит 0a77e59847
27 изменённых файлов: 519 добавлений и 344 удалений

Просмотреть файл

@ -120,7 +120,7 @@ enum mkv
//video //video
Video = 0xE0, Video = 0xE0,
FlagInterlaced = 0x9A, FlagInterlaced = 0x9A,
// StereoMode = 0x53B8, StereoMode = 0x53B8,
PixelWidth = 0xB0, PixelWidth = 0xB0,
PixelHeight = 0xBA, PixelHeight = 0xBA,
PixelCropBottom = 0x54AA, PixelCropBottom = 0x54AA,

Просмотреть файл

@ -138,25 +138,25 @@ void vp8_setup_version(VP8_COMMON *cm)
{ {
case 0: case 0:
cm->no_lpf = 0; cm->no_lpf = 0;
cm->simpler_lpf = 0; cm->filter_type = NORMAL_LOOPFILTER;
cm->use_bilinear_mc_filter = 0; cm->use_bilinear_mc_filter = 0;
cm->full_pixel = 0; cm->full_pixel = 0;
break; break;
case 1: case 1:
cm->no_lpf = 0; cm->no_lpf = 0;
cm->simpler_lpf = 1; cm->filter_type = SIMPLE_LOOPFILTER;
cm->use_bilinear_mc_filter = 1; cm->use_bilinear_mc_filter = 1;
cm->full_pixel = 0; cm->full_pixel = 0;
break; break;
case 2: case 2:
cm->no_lpf = 1; cm->no_lpf = 1;
cm->simpler_lpf = 0; cm->filter_type = NORMAL_LOOPFILTER;
cm->use_bilinear_mc_filter = 1; cm->use_bilinear_mc_filter = 1;
cm->full_pixel = 0; cm->full_pixel = 0;
break; break;
case 3: case 3:
cm->no_lpf = 1; cm->no_lpf = 1;
cm->simpler_lpf = 1; cm->filter_type = SIMPLE_LOOPFILTER;
cm->use_bilinear_mc_filter = 1; cm->use_bilinear_mc_filter = 1;
cm->full_pixel = 1; cm->full_pixel = 1;
break; break;
@ -171,7 +171,7 @@ void vp8_create_common(VP8_COMMON *oci)
oci->mb_no_coeff_skip = 1; oci->mb_no_coeff_skip = 1;
oci->no_lpf = 0; oci->no_lpf = 0;
oci->simpler_lpf = 0; oci->filter_type = NORMAL_LOOPFILTER;
oci->use_bilinear_mc_filter = 0; oci->use_bilinear_mc_filter = 0;
oci->full_pixel = 0; oci->full_pixel = 0;
oci->multi_token_partition = ONE_PARTITION; oci->multi_token_partition = ONE_PARTITION;

Просмотреть файл

@ -38,9 +38,8 @@ extern loop_filter_uvfunction vp8_mbloop_filter_vertical_edge_uv_neon;
/*ARMV6 loopfilter functions*/ /*ARMV6 loopfilter functions*/
/* Horizontal MB filtering */ /* Horizontal MB filtering */
void vp8_loop_filter_mbh_armv6(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, void vp8_loop_filter_mbh_armv6(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
int y_stride, int uv_stride, loop_filter_info *lfi, int simpler_lpf) int y_stride, int uv_stride, loop_filter_info *lfi)
{ {
(void) simpler_lpf;
vp8_mbloop_filter_horizontal_edge_armv6(y_ptr, y_stride, lfi->mbflim, lfi->lim, lfi->thr, 2); vp8_mbloop_filter_horizontal_edge_armv6(y_ptr, y_stride, lfi->mbflim, lfi->lim, lfi->thr, 2);
if (u_ptr) if (u_ptr)
@ -51,20 +50,18 @@ void vp8_loop_filter_mbh_armv6(unsigned char *y_ptr, unsigned char *u_ptr, unsig
} }
void vp8_loop_filter_mbhs_armv6(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, void vp8_loop_filter_mbhs_armv6(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
int y_stride, int uv_stride, loop_filter_info *lfi, int simpler_lpf) int y_stride, int uv_stride, loop_filter_info *lfi)
{ {
(void) u_ptr; (void) u_ptr;
(void) v_ptr; (void) v_ptr;
(void) uv_stride; (void) uv_stride;
(void) simpler_lpf;
vp8_loop_filter_simple_horizontal_edge_armv6(y_ptr, y_stride, lfi->mbflim, lfi->lim, lfi->thr, 2); vp8_loop_filter_simple_horizontal_edge_armv6(y_ptr, y_stride, lfi->mbflim, lfi->lim, lfi->thr, 2);
} }
/* Vertical MB Filtering */ /* Vertical MB Filtering */
void vp8_loop_filter_mbv_armv6(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, void vp8_loop_filter_mbv_armv6(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
int y_stride, int uv_stride, loop_filter_info *lfi, int simpler_lpf) int y_stride, int uv_stride, loop_filter_info *lfi)
{ {
(void) simpler_lpf;
vp8_mbloop_filter_vertical_edge_armv6(y_ptr, y_stride, lfi->mbflim, lfi->lim, lfi->thr, 2); vp8_mbloop_filter_vertical_edge_armv6(y_ptr, y_stride, lfi->mbflim, lfi->lim, lfi->thr, 2);
if (u_ptr) if (u_ptr)
@ -75,20 +72,18 @@ void vp8_loop_filter_mbv_armv6(unsigned char *y_ptr, unsigned char *u_ptr, unsig
} }
void vp8_loop_filter_mbvs_armv6(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, void vp8_loop_filter_mbvs_armv6(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
int y_stride, int uv_stride, loop_filter_info *lfi, int simpler_lpf) int y_stride, int uv_stride, loop_filter_info *lfi)
{ {
(void) u_ptr; (void) u_ptr;
(void) v_ptr; (void) v_ptr;
(void) uv_stride; (void) uv_stride;
(void) simpler_lpf;
vp8_loop_filter_simple_vertical_edge_armv6(y_ptr, y_stride, lfi->mbflim, lfi->lim, lfi->thr, 2); vp8_loop_filter_simple_vertical_edge_armv6(y_ptr, y_stride, lfi->mbflim, lfi->lim, lfi->thr, 2);
} }
/* Horizontal B Filtering */ /* Horizontal B Filtering */
void vp8_loop_filter_bh_armv6(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, void vp8_loop_filter_bh_armv6(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
int y_stride, int uv_stride, loop_filter_info *lfi, int simpler_lpf) int y_stride, int uv_stride, loop_filter_info *lfi)
{ {
(void) simpler_lpf;
vp8_loop_filter_horizontal_edge_armv6(y_ptr + 4 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr, 2); vp8_loop_filter_horizontal_edge_armv6(y_ptr + 4 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr, 2);
vp8_loop_filter_horizontal_edge_armv6(y_ptr + 8 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr, 2); vp8_loop_filter_horizontal_edge_armv6(y_ptr + 8 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr, 2);
vp8_loop_filter_horizontal_edge_armv6(y_ptr + 12 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr, 2); vp8_loop_filter_horizontal_edge_armv6(y_ptr + 12 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr, 2);
@ -101,12 +96,11 @@ void vp8_loop_filter_bh_armv6(unsigned char *y_ptr, unsigned char *u_ptr, unsign
} }
void vp8_loop_filter_bhs_armv6(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, void vp8_loop_filter_bhs_armv6(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
int y_stride, int uv_stride, loop_filter_info *lfi, int simpler_lpf) int y_stride, int uv_stride, loop_filter_info *lfi)
{ {
(void) u_ptr; (void) u_ptr;
(void) v_ptr; (void) v_ptr;
(void) uv_stride; (void) uv_stride;
(void) simpler_lpf;
vp8_loop_filter_simple_horizontal_edge_armv6(y_ptr + 4 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr, 2); vp8_loop_filter_simple_horizontal_edge_armv6(y_ptr + 4 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr, 2);
vp8_loop_filter_simple_horizontal_edge_armv6(y_ptr + 8 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr, 2); vp8_loop_filter_simple_horizontal_edge_armv6(y_ptr + 8 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr, 2);
vp8_loop_filter_simple_horizontal_edge_armv6(y_ptr + 12 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr, 2); vp8_loop_filter_simple_horizontal_edge_armv6(y_ptr + 12 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr, 2);
@ -114,9 +108,8 @@ void vp8_loop_filter_bhs_armv6(unsigned char *y_ptr, unsigned char *u_ptr, unsig
/* Vertical B Filtering */ /* Vertical B Filtering */
void vp8_loop_filter_bv_armv6(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, void vp8_loop_filter_bv_armv6(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
int y_stride, int uv_stride, loop_filter_info *lfi, int simpler_lpf) int y_stride, int uv_stride, loop_filter_info *lfi)
{ {
(void) simpler_lpf;
vp8_loop_filter_vertical_edge_armv6(y_ptr + 4, y_stride, lfi->flim, lfi->lim, lfi->thr, 2); vp8_loop_filter_vertical_edge_armv6(y_ptr + 4, y_stride, lfi->flim, lfi->lim, lfi->thr, 2);
vp8_loop_filter_vertical_edge_armv6(y_ptr + 8, y_stride, lfi->flim, lfi->lim, lfi->thr, 2); vp8_loop_filter_vertical_edge_armv6(y_ptr + 8, y_stride, lfi->flim, lfi->lim, lfi->thr, 2);
vp8_loop_filter_vertical_edge_armv6(y_ptr + 12, y_stride, lfi->flim, lfi->lim, lfi->thr, 2); vp8_loop_filter_vertical_edge_armv6(y_ptr + 12, y_stride, lfi->flim, lfi->lim, lfi->thr, 2);
@ -129,12 +122,11 @@ void vp8_loop_filter_bv_armv6(unsigned char *y_ptr, unsigned char *u_ptr, unsign
} }
void vp8_loop_filter_bvs_armv6(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, void vp8_loop_filter_bvs_armv6(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
int y_stride, int uv_stride, loop_filter_info *lfi, int simpler_lpf) int y_stride, int uv_stride, loop_filter_info *lfi)
{ {
(void) u_ptr; (void) u_ptr;
(void) v_ptr; (void) v_ptr;
(void) uv_stride; (void) uv_stride;
(void) simpler_lpf;
vp8_loop_filter_simple_vertical_edge_armv6(y_ptr + 4, y_stride, lfi->flim, lfi->lim, lfi->thr, 2); vp8_loop_filter_simple_vertical_edge_armv6(y_ptr + 4, y_stride, lfi->flim, lfi->lim, lfi->thr, 2);
vp8_loop_filter_simple_vertical_edge_armv6(y_ptr + 8, y_stride, lfi->flim, lfi->lim, lfi->thr, 2); vp8_loop_filter_simple_vertical_edge_armv6(y_ptr + 8, y_stride, lfi->flim, lfi->lim, lfi->thr, 2);
vp8_loop_filter_simple_vertical_edge_armv6(y_ptr + 12, y_stride, lfi->flim, lfi->lim, lfi->thr, 2); vp8_loop_filter_simple_vertical_edge_armv6(y_ptr + 12, y_stride, lfi->flim, lfi->lim, lfi->thr, 2);
@ -145,9 +137,8 @@ void vp8_loop_filter_bvs_armv6(unsigned char *y_ptr, unsigned char *u_ptr, unsig
/* NEON loopfilter functions */ /* NEON loopfilter functions */
/* Horizontal MB filtering */ /* Horizontal MB filtering */
void vp8_loop_filter_mbh_neon(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, void vp8_loop_filter_mbh_neon(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
int y_stride, int uv_stride, loop_filter_info *lfi, int simpler_lpf) int y_stride, int uv_stride, loop_filter_info *lfi)
{ {
(void) simpler_lpf;
vp8_mbloop_filter_horizontal_edge_y_neon(y_ptr, y_stride, lfi->mbflim, lfi->lim, lfi->thr, 2); vp8_mbloop_filter_horizontal_edge_y_neon(y_ptr, y_stride, lfi->mbflim, lfi->lim, lfi->thr, 2);
if (u_ptr) if (u_ptr)
@ -155,20 +146,18 @@ void vp8_loop_filter_mbh_neon(unsigned char *y_ptr, unsigned char *u_ptr, unsign
} }
void vp8_loop_filter_mbhs_neon(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, void vp8_loop_filter_mbhs_neon(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
int y_stride, int uv_stride, loop_filter_info *lfi, int simpler_lpf) int y_stride, int uv_stride, loop_filter_info *lfi)
{ {
(void) u_ptr; (void) u_ptr;
(void) v_ptr; (void) v_ptr;
(void) uv_stride; (void) uv_stride;
(void) simpler_lpf;
vp8_loop_filter_simple_horizontal_edge_neon(y_ptr, y_stride, lfi->mbflim, lfi->lim, lfi->thr, 2); vp8_loop_filter_simple_horizontal_edge_neon(y_ptr, y_stride, lfi->mbflim, lfi->lim, lfi->thr, 2);
} }
/* Vertical MB Filtering */ /* Vertical MB Filtering */
void vp8_loop_filter_mbv_neon(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, void vp8_loop_filter_mbv_neon(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
int y_stride, int uv_stride, loop_filter_info *lfi, int simpler_lpf) int y_stride, int uv_stride, loop_filter_info *lfi)
{ {
(void) simpler_lpf;
vp8_mbloop_filter_vertical_edge_y_neon(y_ptr, y_stride, lfi->mbflim, lfi->lim, lfi->thr, 2); vp8_mbloop_filter_vertical_edge_y_neon(y_ptr, y_stride, lfi->mbflim, lfi->lim, lfi->thr, 2);
if (u_ptr) if (u_ptr)
@ -176,20 +165,18 @@ void vp8_loop_filter_mbv_neon(unsigned char *y_ptr, unsigned char *u_ptr, unsign
} }
void vp8_loop_filter_mbvs_neon(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, void vp8_loop_filter_mbvs_neon(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
int y_stride, int uv_stride, loop_filter_info *lfi, int simpler_lpf) int y_stride, int uv_stride, loop_filter_info *lfi)
{ {
(void) u_ptr; (void) u_ptr;
(void) v_ptr; (void) v_ptr;
(void) uv_stride; (void) uv_stride;
(void) simpler_lpf;
vp8_loop_filter_simple_vertical_edge_neon(y_ptr, y_stride, lfi->mbflim, lfi->lim, lfi->thr, 2); vp8_loop_filter_simple_vertical_edge_neon(y_ptr, y_stride, lfi->mbflim, lfi->lim, lfi->thr, 2);
} }
/* Horizontal B Filtering */ /* Horizontal B Filtering */
void vp8_loop_filter_bh_neon(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, void vp8_loop_filter_bh_neon(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
int y_stride, int uv_stride, loop_filter_info *lfi, int simpler_lpf) int y_stride, int uv_stride, loop_filter_info *lfi)
{ {
(void) simpler_lpf;
vp8_loop_filter_horizontal_edge_y_neon(y_ptr + 4 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr, 2); vp8_loop_filter_horizontal_edge_y_neon(y_ptr + 4 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr, 2);
vp8_loop_filter_horizontal_edge_y_neon(y_ptr + 8 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr, 2); vp8_loop_filter_horizontal_edge_y_neon(y_ptr + 8 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr, 2);
vp8_loop_filter_horizontal_edge_y_neon(y_ptr + 12 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr, 2); vp8_loop_filter_horizontal_edge_y_neon(y_ptr + 12 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr, 2);
@ -199,12 +186,11 @@ void vp8_loop_filter_bh_neon(unsigned char *y_ptr, unsigned char *u_ptr, unsigne
} }
void vp8_loop_filter_bhs_neon(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, void vp8_loop_filter_bhs_neon(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
int y_stride, int uv_stride, loop_filter_info *lfi, int simpler_lpf) int y_stride, int uv_stride, loop_filter_info *lfi)
{ {
(void) u_ptr; (void) u_ptr;
(void) v_ptr; (void) v_ptr;
(void) uv_stride; (void) uv_stride;
(void) simpler_lpf;
vp8_loop_filter_simple_horizontal_edge_neon(y_ptr + 4 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr, 2); vp8_loop_filter_simple_horizontal_edge_neon(y_ptr + 4 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr, 2);
vp8_loop_filter_simple_horizontal_edge_neon(y_ptr + 8 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr, 2); vp8_loop_filter_simple_horizontal_edge_neon(y_ptr + 8 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr, 2);
vp8_loop_filter_simple_horizontal_edge_neon(y_ptr + 12 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr, 2); vp8_loop_filter_simple_horizontal_edge_neon(y_ptr + 12 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr, 2);
@ -212,9 +198,8 @@ void vp8_loop_filter_bhs_neon(unsigned char *y_ptr, unsigned char *u_ptr, unsign
/* Vertical B Filtering */ /* Vertical B Filtering */
void vp8_loop_filter_bv_neon(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, void vp8_loop_filter_bv_neon(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
int y_stride, int uv_stride, loop_filter_info *lfi, int simpler_lpf) int y_stride, int uv_stride, loop_filter_info *lfi)
{ {
(void) simpler_lpf;
vp8_loop_filter_vertical_edge_y_neon(y_ptr + 4, y_stride, lfi->flim, lfi->lim, lfi->thr, 2); vp8_loop_filter_vertical_edge_y_neon(y_ptr + 4, y_stride, lfi->flim, lfi->lim, lfi->thr, 2);
vp8_loop_filter_vertical_edge_y_neon(y_ptr + 8, y_stride, lfi->flim, lfi->lim, lfi->thr, 2); vp8_loop_filter_vertical_edge_y_neon(y_ptr + 8, y_stride, lfi->flim, lfi->lim, lfi->thr, 2);
vp8_loop_filter_vertical_edge_y_neon(y_ptr + 12, y_stride, lfi->flim, lfi->lim, lfi->thr, 2); vp8_loop_filter_vertical_edge_y_neon(y_ptr + 12, y_stride, lfi->flim, lfi->lim, lfi->thr, 2);
@ -224,12 +209,11 @@ void vp8_loop_filter_bv_neon(unsigned char *y_ptr, unsigned char *u_ptr, unsigne
} }
void vp8_loop_filter_bvs_neon(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, void vp8_loop_filter_bvs_neon(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
int y_stride, int uv_stride, loop_filter_info *lfi, int simpler_lpf) int y_stride, int uv_stride, loop_filter_info *lfi)
{ {
(void) u_ptr; (void) u_ptr;
(void) v_ptr; (void) v_ptr;
(void) uv_stride; (void) uv_stride;
(void) simpler_lpf;
vp8_loop_filter_simple_vertical_edge_neon(y_ptr + 4, y_stride, lfi->flim, lfi->lim, lfi->thr, 2); vp8_loop_filter_simple_vertical_edge_neon(y_ptr + 4, y_stride, lfi->flim, lfi->lim, lfi->thr, 2);
vp8_loop_filter_simple_vertical_edge_neon(y_ptr + 8, y_stride, lfi->flim, lfi->lim, lfi->thr, 2); vp8_loop_filter_simple_vertical_edge_neon(y_ptr + 8, y_stride, lfi->flim, lfi->lim, lfi->thr, 2);
vp8_loop_filter_simple_vertical_edge_neon(y_ptr + 12, y_stride, lfi->flim, lfi->lim, lfi->thr, 2); vp8_loop_filter_simple_vertical_edge_neon(y_ptr + 12, y_stride, lfi->flim, lfi->lim, lfi->thr, 2);

Просмотреть файл

@ -169,9 +169,7 @@ typedef struct
unsigned char partitioning; unsigned char partitioning;
unsigned char mb_skip_coeff; /* does this mb has coefficients at all, 1=no coefficients, 0=need decode tokens */ unsigned char mb_skip_coeff; /* does this mb has coefficients at all, 1=no coefficients, 0=need decode tokens */
unsigned char dc_diff;
unsigned char need_to_clamp_mvs; unsigned char need_to_clamp_mvs;
unsigned char segment_id; /* Which set of segmentation parameters should be used for this MB */ unsigned char segment_id; /* Which set of segmentation parameters should be used for this MB */
} MB_MODE_INFO; } MB_MODE_INFO;

Просмотреть файл

@ -25,9 +25,8 @@ prototype_loopfilter(vp8_loop_filter_simple_vertical_edge_c);
/* Horizontal MB filtering */ /* Horizontal MB filtering */
void vp8_loop_filter_mbh_c(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, void vp8_loop_filter_mbh_c(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
int y_stride, int uv_stride, loop_filter_info *lfi, int simpler_lpf) int y_stride, int uv_stride, loop_filter_info *lfi)
{ {
(void) simpler_lpf;
vp8_mbloop_filter_horizontal_edge_c(y_ptr, y_stride, lfi->mbflim, lfi->lim, lfi->thr, 2); vp8_mbloop_filter_horizontal_edge_c(y_ptr, y_stride, lfi->mbflim, lfi->lim, lfi->thr, 2);
if (u_ptr) if (u_ptr)
@ -38,20 +37,18 @@ void vp8_loop_filter_mbh_c(unsigned char *y_ptr, unsigned char *u_ptr, unsigned
} }
void vp8_loop_filter_mbhs_c(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, void vp8_loop_filter_mbhs_c(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
int y_stride, int uv_stride, loop_filter_info *lfi, int simpler_lpf) int y_stride, int uv_stride, loop_filter_info *lfi)
{ {
(void) u_ptr; (void) u_ptr;
(void) v_ptr; (void) v_ptr;
(void) uv_stride; (void) uv_stride;
(void) simpler_lpf;
vp8_loop_filter_simple_horizontal_edge_c(y_ptr, y_stride, lfi->mbflim, lfi->lim, lfi->thr, 2); vp8_loop_filter_simple_horizontal_edge_c(y_ptr, y_stride, lfi->mbflim, lfi->lim, lfi->thr, 2);
} }
/* Vertical MB Filtering */ /* Vertical MB Filtering */
void vp8_loop_filter_mbv_c(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, void vp8_loop_filter_mbv_c(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
int y_stride, int uv_stride, loop_filter_info *lfi, int simpler_lpf) int y_stride, int uv_stride, loop_filter_info *lfi)
{ {
(void) simpler_lpf;
vp8_mbloop_filter_vertical_edge_c(y_ptr, y_stride, lfi->mbflim, lfi->lim, lfi->thr, 2); vp8_mbloop_filter_vertical_edge_c(y_ptr, y_stride, lfi->mbflim, lfi->lim, lfi->thr, 2);
if (u_ptr) if (u_ptr)
@ -62,20 +59,18 @@ void vp8_loop_filter_mbv_c(unsigned char *y_ptr, unsigned char *u_ptr, unsigned
} }
void vp8_loop_filter_mbvs_c(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, void vp8_loop_filter_mbvs_c(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
int y_stride, int uv_stride, loop_filter_info *lfi, int simpler_lpf) int y_stride, int uv_stride, loop_filter_info *lfi)
{ {
(void) u_ptr; (void) u_ptr;
(void) v_ptr; (void) v_ptr;
(void) uv_stride; (void) uv_stride;
(void) simpler_lpf;
vp8_loop_filter_simple_vertical_edge_c(y_ptr, y_stride, lfi->mbflim, lfi->lim, lfi->thr, 2); vp8_loop_filter_simple_vertical_edge_c(y_ptr, y_stride, lfi->mbflim, lfi->lim, lfi->thr, 2);
} }
/* Horizontal B Filtering */ /* Horizontal B Filtering */
void vp8_loop_filter_bh_c(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, void vp8_loop_filter_bh_c(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
int y_stride, int uv_stride, loop_filter_info *lfi, int simpler_lpf) int y_stride, int uv_stride, loop_filter_info *lfi)
{ {
(void) simpler_lpf;
vp8_loop_filter_horizontal_edge_c(y_ptr + 4 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr, 2); vp8_loop_filter_horizontal_edge_c(y_ptr + 4 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr, 2);
vp8_loop_filter_horizontal_edge_c(y_ptr + 8 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr, 2); vp8_loop_filter_horizontal_edge_c(y_ptr + 8 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr, 2);
vp8_loop_filter_horizontal_edge_c(y_ptr + 12 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr, 2); vp8_loop_filter_horizontal_edge_c(y_ptr + 12 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr, 2);
@ -88,12 +83,11 @@ void vp8_loop_filter_bh_c(unsigned char *y_ptr, unsigned char *u_ptr, unsigned c
} }
void vp8_loop_filter_bhs_c(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, void vp8_loop_filter_bhs_c(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
int y_stride, int uv_stride, loop_filter_info *lfi, int simpler_lpf) int y_stride, int uv_stride, loop_filter_info *lfi)
{ {
(void) u_ptr; (void) u_ptr;
(void) v_ptr; (void) v_ptr;
(void) uv_stride; (void) uv_stride;
(void) simpler_lpf;
vp8_loop_filter_simple_horizontal_edge_c(y_ptr + 4 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr, 2); vp8_loop_filter_simple_horizontal_edge_c(y_ptr + 4 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr, 2);
vp8_loop_filter_simple_horizontal_edge_c(y_ptr + 8 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr, 2); vp8_loop_filter_simple_horizontal_edge_c(y_ptr + 8 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr, 2);
vp8_loop_filter_simple_horizontal_edge_c(y_ptr + 12 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr, 2); vp8_loop_filter_simple_horizontal_edge_c(y_ptr + 12 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr, 2);
@ -101,9 +95,8 @@ void vp8_loop_filter_bhs_c(unsigned char *y_ptr, unsigned char *u_ptr, unsigned
/* Vertical B Filtering */ /* Vertical B Filtering */
void vp8_loop_filter_bv_c(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, void vp8_loop_filter_bv_c(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
int y_stride, int uv_stride, loop_filter_info *lfi, int simpler_lpf) int y_stride, int uv_stride, loop_filter_info *lfi)
{ {
(void) simpler_lpf;
vp8_loop_filter_vertical_edge_c(y_ptr + 4, y_stride, lfi->flim, lfi->lim, lfi->thr, 2); vp8_loop_filter_vertical_edge_c(y_ptr + 4, y_stride, lfi->flim, lfi->lim, lfi->thr, 2);
vp8_loop_filter_vertical_edge_c(y_ptr + 8, y_stride, lfi->flim, lfi->lim, lfi->thr, 2); vp8_loop_filter_vertical_edge_c(y_ptr + 8, y_stride, lfi->flim, lfi->lim, lfi->thr, 2);
vp8_loop_filter_vertical_edge_c(y_ptr + 12, y_stride, lfi->flim, lfi->lim, lfi->thr, 2); vp8_loop_filter_vertical_edge_c(y_ptr + 12, y_stride, lfi->flim, lfi->lim, lfi->thr, 2);
@ -116,12 +109,11 @@ void vp8_loop_filter_bv_c(unsigned char *y_ptr, unsigned char *u_ptr, unsigned c
} }
void vp8_loop_filter_bvs_c(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, void vp8_loop_filter_bvs_c(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
int y_stride, int uv_stride, loop_filter_info *lfi, int simpler_lpf) int y_stride, int uv_stride, loop_filter_info *lfi)
{ {
(void) u_ptr; (void) u_ptr;
(void) v_ptr; (void) v_ptr;
(void) uv_stride; (void) uv_stride;
(void) simpler_lpf;
vp8_loop_filter_simple_vertical_edge_c(y_ptr + 4, y_stride, lfi->flim, lfi->lim, lfi->thr, 2); vp8_loop_filter_simple_vertical_edge_c(y_ptr + 4, y_stride, lfi->flim, lfi->lim, lfi->thr, 2);
vp8_loop_filter_simple_vertical_edge_c(y_ptr + 8, y_stride, lfi->flim, lfi->lim, lfi->thr, 2); vp8_loop_filter_simple_vertical_edge_c(y_ptr + 8, y_stride, lfi->flim, lfi->lim, lfi->thr, 2);
vp8_loop_filter_simple_vertical_edge_c(y_ptr + 12, y_stride, lfi->flim, lfi->lim, lfi->thr, 2); vp8_loop_filter_simple_vertical_edge_c(y_ptr + 12, y_stride, lfi->flim, lfi->lim, lfi->thr, 2);
@ -353,6 +345,9 @@ void vp8_loop_filter_frame
for (mb_col = 0; mb_col < cm->mb_cols; mb_col++) for (mb_col = 0; mb_col < cm->mb_cols; mb_col++)
{ {
int Segment = (alt_flt_enabled) ? mbd->mode_info_context->mbmi.segment_id : 0; int Segment = (alt_flt_enabled) ? mbd->mode_info_context->mbmi.segment_id : 0;
int skip_lf = (mbd->mode_info_context->mbmi.mode != B_PRED &&
mbd->mode_info_context->mbmi.mode != SPLITMV &&
mbd->mode_info_context->mbmi.mb_skip_coeff);
filter_level = baseline_filter_level[Segment]; filter_level = baseline_filter_level[Segment];
@ -365,17 +360,17 @@ void vp8_loop_filter_frame
if (filter_level) if (filter_level)
{ {
if (mb_col > 0) if (mb_col > 0)
cm->lf_mbv(y_ptr, u_ptr, v_ptr, post->y_stride, post->uv_stride, &lfi[filter_level], cm->simpler_lpf); cm->lf_mbv(y_ptr, u_ptr, v_ptr, post->y_stride, post->uv_stride, &lfi[filter_level]);
if (mbd->mode_info_context->mbmi.dc_diff > 0) if (!skip_lf)
cm->lf_bv(y_ptr, u_ptr, v_ptr, post->y_stride, post->uv_stride, &lfi[filter_level], cm->simpler_lpf); cm->lf_bv(y_ptr, u_ptr, v_ptr, post->y_stride, post->uv_stride, &lfi[filter_level]);
/* don't apply across umv border */ /* don't apply across umv border */
if (mb_row > 0) if (mb_row > 0)
cm->lf_mbh(y_ptr, u_ptr, v_ptr, post->y_stride, post->uv_stride, &lfi[filter_level], cm->simpler_lpf); cm->lf_mbh(y_ptr, u_ptr, v_ptr, post->y_stride, post->uv_stride, &lfi[filter_level]);
if (mbd->mode_info_context->mbmi.dc_diff > 0) if (!skip_lf)
cm->lf_bh(y_ptr, u_ptr, v_ptr, post->y_stride, post->uv_stride, &lfi[filter_level], cm->simpler_lpf); cm->lf_bh(y_ptr, u_ptr, v_ptr, post->y_stride, post->uv_stride, &lfi[filter_level]);
} }
y_ptr += 16; y_ptr += 16;
@ -457,6 +452,10 @@ void vp8_loop_filter_frame_yonly
for (mb_col = 0; mb_col < cm->mb_cols; mb_col++) for (mb_col = 0; mb_col < cm->mb_cols; mb_col++)
{ {
int Segment = (alt_flt_enabled) ? mbd->mode_info_context->mbmi.segment_id : 0; int Segment = (alt_flt_enabled) ? mbd->mode_info_context->mbmi.segment_id : 0;
int skip_lf = (mbd->mode_info_context->mbmi.mode != B_PRED &&
mbd->mode_info_context->mbmi.mode != SPLITMV &&
mbd->mode_info_context->mbmi.mb_skip_coeff);
filter_level = baseline_filter_level[Segment]; filter_level = baseline_filter_level[Segment];
/* Apply any context driven MB level adjustment */ /* Apply any context driven MB level adjustment */
@ -465,17 +464,17 @@ void vp8_loop_filter_frame_yonly
if (filter_level) if (filter_level)
{ {
if (mb_col > 0) if (mb_col > 0)
cm->lf_mbv(y_ptr, 0, 0, post->y_stride, 0, &lfi[filter_level], 0); cm->lf_mbv(y_ptr, 0, 0, post->y_stride, 0, &lfi[filter_level]);
if (mbd->mode_info_context->mbmi.dc_diff > 0) if (!skip_lf)
cm->lf_bv(y_ptr, 0, 0, post->y_stride, 0, &lfi[filter_level], 0); cm->lf_bv(y_ptr, 0, 0, post->y_stride, 0, &lfi[filter_level]);
/* don't apply across umv border */ /* don't apply across umv border */
if (mb_row > 0) if (mb_row > 0)
cm->lf_mbh(y_ptr, 0, 0, post->y_stride, 0, &lfi[filter_level], 0); cm->lf_mbh(y_ptr, 0, 0, post->y_stride, 0, &lfi[filter_level]);
if (mbd->mode_info_context->mbmi.dc_diff > 0) if (!skip_lf)
cm->lf_bh(y_ptr, 0, 0, post->y_stride, 0, &lfi[filter_level], 0); cm->lf_bh(y_ptr, 0, 0, post->y_stride, 0, &lfi[filter_level]);
} }
y_ptr += 16; y_ptr += 16;
@ -565,20 +564,24 @@ void vp8_loop_filter_partial_frame
for (mb_col = 0; mb_col < mb_cols; mb_col++) for (mb_col = 0; mb_col < mb_cols; mb_col++)
{ {
int Segment = (alt_flt_enabled) ? mbd->mode_info_context->mbmi.segment_id : 0; int Segment = (alt_flt_enabled) ? mbd->mode_info_context->mbmi.segment_id : 0;
int skip_lf = (mbd->mode_info_context->mbmi.mode != B_PRED &&
mbd->mode_info_context->mbmi.mode != SPLITMV &&
mbd->mode_info_context->mbmi.mb_skip_coeff);
filter_level = baseline_filter_level[Segment]; filter_level = baseline_filter_level[Segment];
if (filter_level) if (filter_level)
{ {
if (mb_col > 0) if (mb_col > 0)
cm->lf_mbv(y_ptr, 0, 0, post->y_stride, 0, &lfi[filter_level], 0); cm->lf_mbv(y_ptr, 0, 0, post->y_stride, 0, &lfi[filter_level]);
if (mbd->mode_info_context->mbmi.dc_diff > 0) if (!skip_lf)
cm->lf_bv(y_ptr, 0, 0, post->y_stride, 0, &lfi[filter_level], 0); cm->lf_bv(y_ptr, 0, 0, post->y_stride, 0, &lfi[filter_level]);
cm->lf_mbh(y_ptr, 0, 0, post->y_stride, 0, &lfi[filter_level], 0); cm->lf_mbh(y_ptr, 0, 0, post->y_stride, 0, &lfi[filter_level]);
if (mbd->mode_info_context->mbmi.dc_diff > 0) if (!skip_lf)
cm->lf_bh(y_ptr, 0, 0, post->y_stride, 0, &lfi[filter_level], 0); cm->lf_bh(y_ptr, 0, 0, post->y_stride, 0, &lfi[filter_level]);
} }
y_ptr += 16; y_ptr += 16;

Просмотреть файл

@ -41,7 +41,7 @@ typedef struct
#define prototype_loopfilter_block(sym) \ #define prototype_loopfilter_block(sym) \
void sym(unsigned char *y, unsigned char *u, unsigned char *v,\ void sym(unsigned char *y, unsigned char *u, unsigned char *v,\
int ystride, int uv_stride, loop_filter_info *lfi, int simpler) int ystride, int uv_stride, loop_filter_info *lfi)
#if ARCH_X86 || ARCH_X86_64 #if ARCH_X86 || ARCH_X86_64
#include "x86/loopfilter_x86.h" #include "x86/loopfilter_x86.h"

Просмотреть файл

@ -109,6 +109,7 @@ extern "C"
int noise_sensitivity; // parameter used for applying pre processing blur: recommendation 0 int noise_sensitivity; // parameter used for applying pre processing blur: recommendation 0
int Sharpness; // parameter used for sharpening output: recommendation 0: int Sharpness; // parameter used for sharpening output: recommendation 0:
int cpu_used; int cpu_used;
unsigned int rc_max_intra_bitrate_pct;
// mode -> // mode ->
//(0)=Realtime/Live Encoding. This mode is optimized for realtim encoding (for example, capturing //(0)=Realtime/Live Encoding. This mode is optimized for realtim encoding (for example, capturing
@ -139,8 +140,9 @@ extern "C"
int end_usage; // vbr or cbr int end_usage; // vbr or cbr
// shoot to keep buffer full at all times by undershooting a bit 95 recommended // buffer targeting aggressiveness
int under_shoot_pct; int under_shoot_pct;
int over_shoot_pct;
// buffering parameters // buffering parameters
int starting_buffer_level; // in seconds int starting_buffer_level; // in seconds

Просмотреть файл

@ -120,7 +120,6 @@ typedef struct VP8Common
int experimental; int experimental;
int mb_no_coeff_skip; int mb_no_coeff_skip;
int no_lpf; int no_lpf;
int simpler_lpf;
int use_bilinear_mc_filter; int use_bilinear_mc_filter;
int full_pixel; int full_pixel;

Просмотреть файл

@ -804,11 +804,14 @@ int vp8_post_proc_frame(VP8_COMMON *oci, YV12_BUFFER_CONFIG *dest, vp8_ppflags_t
for (j = 0; j < mb_cols; j++) for (j = 0; j < mb_cols; j++)
{ {
char zz[4]; char zz[4];
int dc_diff = !(mi[mb_index].mbmi.mode != B_PRED &&
mi[mb_index].mbmi.mode != SPLITMV &&
mi[mb_index].mbmi.mb_skip_coeff));
if (oci->frame_type == KEY_FRAME) if (oci->frame_type == KEY_FRAME)
sprintf(zz, "a"); sprintf(zz, "a");
else else
sprintf(zz, "%c", mi[mb_index].mbmi.dc_diff + '0'); sprintf(zz, "%c", dc_diff + '0');
vp8_blit_text(zz, y_ptr, post->y_stride); vp8_blit_text(zz, y_ptr, post->y_stride);
mb_index ++; mb_index ++;

Просмотреть файл

@ -53,9 +53,8 @@ loop_filter_function_s_ppc loop_filter_simple_vertical_edge_ppc;
// Horizontal MB filtering // Horizontal MB filtering
void loop_filter_mbh_ppc(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, void loop_filter_mbh_ppc(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
int y_stride, int uv_stride, loop_filter_info *lfi, int simpler_lpf) int y_stride, int uv_stride, loop_filter_info *lfi)
{ {
(void)simpler_lpf;
mbloop_filter_horizontal_edge_y_ppc(y_ptr, y_stride, lfi->mbflim, lfi->lim, lfi->thr); mbloop_filter_horizontal_edge_y_ppc(y_ptr, y_stride, lfi->mbflim, lfi->lim, lfi->thr);
if (u_ptr) if (u_ptr)
@ -63,9 +62,8 @@ void loop_filter_mbh_ppc(unsigned char *y_ptr, unsigned char *u_ptr, unsigned ch
} }
void loop_filter_mbhs_ppc(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, void loop_filter_mbhs_ppc(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
int y_stride, int uv_stride, loop_filter_info *lfi, int simpler_lpf) int y_stride, int uv_stride, loop_filter_info *lfi)
{ {
(void)simpler_lpf;
(void)u_ptr; (void)u_ptr;
(void)v_ptr; (void)v_ptr;
(void)uv_stride; (void)uv_stride;
@ -74,9 +72,8 @@ void loop_filter_mbhs_ppc(unsigned char *y_ptr, unsigned char *u_ptr, unsigned c
// Vertical MB Filtering // Vertical MB Filtering
void loop_filter_mbv_ppc(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, void loop_filter_mbv_ppc(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
int y_stride, int uv_stride, loop_filter_info *lfi, int simpler_lpf) int y_stride, int uv_stride, loop_filter_info *lfi)
{ {
(void)simpler_lpf;
mbloop_filter_vertical_edge_y_ppc(y_ptr, y_stride, lfi->mbflim, lfi->lim, lfi->thr); mbloop_filter_vertical_edge_y_ppc(y_ptr, y_stride, lfi->mbflim, lfi->lim, lfi->thr);
if (u_ptr) if (u_ptr)
@ -84,9 +81,8 @@ void loop_filter_mbv_ppc(unsigned char *y_ptr, unsigned char *u_ptr, unsigned ch
} }
void loop_filter_mbvs_ppc(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, void loop_filter_mbvs_ppc(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
int y_stride, int uv_stride, loop_filter_info *lfi, int simpler_lpf) int y_stride, int uv_stride, loop_filter_info *lfi)
{ {
(void)simpler_lpf;
(void)u_ptr; (void)u_ptr;
(void)v_ptr; (void)v_ptr;
(void)uv_stride; (void)uv_stride;
@ -95,9 +91,8 @@ void loop_filter_mbvs_ppc(unsigned char *y_ptr, unsigned char *u_ptr, unsigned c
// Horizontal B Filtering // Horizontal B Filtering
void loop_filter_bh_ppc(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, void loop_filter_bh_ppc(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
int y_stride, int uv_stride, loop_filter_info *lfi, int simpler_lpf) int y_stride, int uv_stride, loop_filter_info *lfi)
{ {
(void)simpler_lpf;
// These should all be done at once with one call, instead of 3 // These should all be done at once with one call, instead of 3
loop_filter_horizontal_edge_y_ppc(y_ptr + 4 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr); loop_filter_horizontal_edge_y_ppc(y_ptr + 4 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr);
loop_filter_horizontal_edge_y_ppc(y_ptr + 8 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr); loop_filter_horizontal_edge_y_ppc(y_ptr + 8 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr);
@ -108,9 +103,8 @@ void loop_filter_bh_ppc(unsigned char *y_ptr, unsigned char *u_ptr, unsigned cha
} }
void loop_filter_bhs_ppc(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, void loop_filter_bhs_ppc(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
int y_stride, int uv_stride, loop_filter_info *lfi, int simpler_lpf) int y_stride, int uv_stride, loop_filter_info *lfi)
{ {
(void)simpler_lpf;
(void)u_ptr; (void)u_ptr;
(void)v_ptr; (void)v_ptr;
(void)uv_stride; (void)uv_stride;
@ -121,9 +115,8 @@ void loop_filter_bhs_ppc(unsigned char *y_ptr, unsigned char *u_ptr, unsigned ch
// Vertical B Filtering // Vertical B Filtering
void loop_filter_bv_ppc(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, void loop_filter_bv_ppc(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
int y_stride, int uv_stride, loop_filter_info *lfi, int simpler_lpf) int y_stride, int uv_stride, loop_filter_info *lfi)
{ {
(void)simpler_lpf;
loop_filter_vertical_edge_y_ppc(y_ptr, y_stride, lfi->flim, lfi->lim, lfi->thr); loop_filter_vertical_edge_y_ppc(y_ptr, y_stride, lfi->flim, lfi->lim, lfi->thr);
if (u_ptr) if (u_ptr)
@ -131,9 +124,8 @@ void loop_filter_bv_ppc(unsigned char *y_ptr, unsigned char *u_ptr, unsigned cha
} }
void loop_filter_bvs_ppc(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, void loop_filter_bvs_ppc(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
int y_stride, int uv_stride, loop_filter_info *lfi, int simpler_lpf) int y_stride, int uv_stride, loop_filter_info *lfi)
{ {
(void)simpler_lpf;
(void)u_ptr; (void)u_ptr;
(void)v_ptr; (void)v_ptr;
(void)uv_stride; (void)uv_stride;

Просмотреть файл

@ -42,9 +42,8 @@ extern loop_filter_uvfunction vp8_mbloop_filter_vertical_edge_uv_sse2;
#if HAVE_MMX #if HAVE_MMX
/* Horizontal MB filtering */ /* Horizontal MB filtering */
void vp8_loop_filter_mbh_mmx(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, void vp8_loop_filter_mbh_mmx(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
int y_stride, int uv_stride, loop_filter_info *lfi, int simpler_lpf) int y_stride, int uv_stride, loop_filter_info *lfi)
{ {
(void) simpler_lpf;
vp8_mbloop_filter_horizontal_edge_mmx(y_ptr, y_stride, lfi->mbflim, lfi->lim, lfi->thr, 2); vp8_mbloop_filter_horizontal_edge_mmx(y_ptr, y_stride, lfi->mbflim, lfi->lim, lfi->thr, 2);
if (u_ptr) if (u_ptr)
@ -56,21 +55,19 @@ void vp8_loop_filter_mbh_mmx(unsigned char *y_ptr, unsigned char *u_ptr, unsigne
void vp8_loop_filter_mbhs_mmx(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, void vp8_loop_filter_mbhs_mmx(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
int y_stride, int uv_stride, loop_filter_info *lfi, int simpler_lpf) int y_stride, int uv_stride, loop_filter_info *lfi)
{ {
(void) u_ptr; (void) u_ptr;
(void) v_ptr; (void) v_ptr;
(void) uv_stride; (void) uv_stride;
(void) simpler_lpf;
vp8_loop_filter_simple_horizontal_edge_mmx(y_ptr, y_stride, lfi->mbflim, lfi->lim, lfi->thr, 2); vp8_loop_filter_simple_horizontal_edge_mmx(y_ptr, y_stride, lfi->mbflim, lfi->lim, lfi->thr, 2);
} }
/* Vertical MB Filtering */ /* Vertical MB Filtering */
void vp8_loop_filter_mbv_mmx(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, void vp8_loop_filter_mbv_mmx(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
int y_stride, int uv_stride, loop_filter_info *lfi, int simpler_lpf) int y_stride, int uv_stride, loop_filter_info *lfi)
{ {
(void) simpler_lpf;
vp8_mbloop_filter_vertical_edge_mmx(y_ptr, y_stride, lfi->mbflim, lfi->lim, lfi->thr, 2); vp8_mbloop_filter_vertical_edge_mmx(y_ptr, y_stride, lfi->mbflim, lfi->lim, lfi->thr, 2);
if (u_ptr) if (u_ptr)
@ -82,21 +79,19 @@ void vp8_loop_filter_mbv_mmx(unsigned char *y_ptr, unsigned char *u_ptr, unsigne
void vp8_loop_filter_mbvs_mmx(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, void vp8_loop_filter_mbvs_mmx(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
int y_stride, int uv_stride, loop_filter_info *lfi, int simpler_lpf) int y_stride, int uv_stride, loop_filter_info *lfi)
{ {
(void) u_ptr; (void) u_ptr;
(void) v_ptr; (void) v_ptr;
(void) uv_stride; (void) uv_stride;
(void) simpler_lpf;
vp8_loop_filter_simple_vertical_edge_mmx(y_ptr, y_stride, lfi->mbflim, lfi->lim, lfi->thr, 2); vp8_loop_filter_simple_vertical_edge_mmx(y_ptr, y_stride, lfi->mbflim, lfi->lim, lfi->thr, 2);
} }
/* Horizontal B Filtering */ /* Horizontal B Filtering */
void vp8_loop_filter_bh_mmx(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, void vp8_loop_filter_bh_mmx(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
int y_stride, int uv_stride, loop_filter_info *lfi, int simpler_lpf) int y_stride, int uv_stride, loop_filter_info *lfi)
{ {
(void) simpler_lpf;
vp8_loop_filter_horizontal_edge_mmx(y_ptr + 4 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr, 2); vp8_loop_filter_horizontal_edge_mmx(y_ptr + 4 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr, 2);
vp8_loop_filter_horizontal_edge_mmx(y_ptr + 8 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr, 2); vp8_loop_filter_horizontal_edge_mmx(y_ptr + 8 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr, 2);
vp8_loop_filter_horizontal_edge_mmx(y_ptr + 12 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr, 2); vp8_loop_filter_horizontal_edge_mmx(y_ptr + 12 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr, 2);
@ -110,12 +105,11 @@ void vp8_loop_filter_bh_mmx(unsigned char *y_ptr, unsigned char *u_ptr, unsigned
void vp8_loop_filter_bhs_mmx(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, void vp8_loop_filter_bhs_mmx(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
int y_stride, int uv_stride, loop_filter_info *lfi, int simpler_lpf) int y_stride, int uv_stride, loop_filter_info *lfi)
{ {
(void) u_ptr; (void) u_ptr;
(void) v_ptr; (void) v_ptr;
(void) uv_stride; (void) uv_stride;
(void) simpler_lpf;
vp8_loop_filter_simple_horizontal_edge_mmx(y_ptr + 4 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr, 2); vp8_loop_filter_simple_horizontal_edge_mmx(y_ptr + 4 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr, 2);
vp8_loop_filter_simple_horizontal_edge_mmx(y_ptr + 8 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr, 2); vp8_loop_filter_simple_horizontal_edge_mmx(y_ptr + 8 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr, 2);
vp8_loop_filter_simple_horizontal_edge_mmx(y_ptr + 12 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr, 2); vp8_loop_filter_simple_horizontal_edge_mmx(y_ptr + 12 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr, 2);
@ -124,9 +118,8 @@ void vp8_loop_filter_bhs_mmx(unsigned char *y_ptr, unsigned char *u_ptr, unsigne
/* Vertical B Filtering */ /* Vertical B Filtering */
void vp8_loop_filter_bv_mmx(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, void vp8_loop_filter_bv_mmx(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
int y_stride, int uv_stride, loop_filter_info *lfi, int simpler_lpf) int y_stride, int uv_stride, loop_filter_info *lfi)
{ {
(void) simpler_lpf;
vp8_loop_filter_vertical_edge_mmx(y_ptr + 4, y_stride, lfi->flim, lfi->lim, lfi->thr, 2); vp8_loop_filter_vertical_edge_mmx(y_ptr + 4, y_stride, lfi->flim, lfi->lim, lfi->thr, 2);
vp8_loop_filter_vertical_edge_mmx(y_ptr + 8, y_stride, lfi->flim, lfi->lim, lfi->thr, 2); vp8_loop_filter_vertical_edge_mmx(y_ptr + 8, y_stride, lfi->flim, lfi->lim, lfi->thr, 2);
vp8_loop_filter_vertical_edge_mmx(y_ptr + 12, y_stride, lfi->flim, lfi->lim, lfi->thr, 2); vp8_loop_filter_vertical_edge_mmx(y_ptr + 12, y_stride, lfi->flim, lfi->lim, lfi->thr, 2);
@ -140,12 +133,11 @@ void vp8_loop_filter_bv_mmx(unsigned char *y_ptr, unsigned char *u_ptr, unsigned
void vp8_loop_filter_bvs_mmx(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, void vp8_loop_filter_bvs_mmx(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
int y_stride, int uv_stride, loop_filter_info *lfi, int simpler_lpf) int y_stride, int uv_stride, loop_filter_info *lfi)
{ {
(void) u_ptr; (void) u_ptr;
(void) v_ptr; (void) v_ptr;
(void) uv_stride; (void) uv_stride;
(void) simpler_lpf;
vp8_loop_filter_simple_vertical_edge_mmx(y_ptr + 4, y_stride, lfi->flim, lfi->lim, lfi->thr, 2); vp8_loop_filter_simple_vertical_edge_mmx(y_ptr + 4, y_stride, lfi->flim, lfi->lim, lfi->thr, 2);
vp8_loop_filter_simple_vertical_edge_mmx(y_ptr + 8, y_stride, lfi->flim, lfi->lim, lfi->thr, 2); vp8_loop_filter_simple_vertical_edge_mmx(y_ptr + 8, y_stride, lfi->flim, lfi->lim, lfi->thr, 2);
vp8_loop_filter_simple_vertical_edge_mmx(y_ptr + 12, y_stride, lfi->flim, lfi->lim, lfi->thr, 2); vp8_loop_filter_simple_vertical_edge_mmx(y_ptr + 12, y_stride, lfi->flim, lfi->lim, lfi->thr, 2);
@ -156,9 +148,8 @@ void vp8_loop_filter_bvs_mmx(unsigned char *y_ptr, unsigned char *u_ptr, unsigne
/* Horizontal MB filtering */ /* Horizontal MB filtering */
#if HAVE_SSE2 #if HAVE_SSE2
void vp8_loop_filter_mbh_sse2(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, void vp8_loop_filter_mbh_sse2(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
int y_stride, int uv_stride, loop_filter_info *lfi, int simpler_lpf) int y_stride, int uv_stride, loop_filter_info *lfi)
{ {
(void) simpler_lpf;
vp8_mbloop_filter_horizontal_edge_sse2(y_ptr, y_stride, lfi->mbflim, lfi->lim, lfi->thr, 2); vp8_mbloop_filter_horizontal_edge_sse2(y_ptr, y_stride, lfi->mbflim, lfi->lim, lfi->thr, 2);
if (u_ptr) if (u_ptr)
@ -167,21 +158,19 @@ void vp8_loop_filter_mbh_sse2(unsigned char *y_ptr, unsigned char *u_ptr, unsign
void vp8_loop_filter_mbhs_sse2(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, void vp8_loop_filter_mbhs_sse2(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
int y_stride, int uv_stride, loop_filter_info *lfi, int simpler_lpf) int y_stride, int uv_stride, loop_filter_info *lfi)
{ {
(void) u_ptr; (void) u_ptr;
(void) v_ptr; (void) v_ptr;
(void) uv_stride; (void) uv_stride;
(void) simpler_lpf;
vp8_loop_filter_simple_horizontal_edge_sse2(y_ptr, y_stride, lfi->mbflim, lfi->lim, lfi->thr, 2); vp8_loop_filter_simple_horizontal_edge_sse2(y_ptr, y_stride, lfi->mbflim, lfi->lim, lfi->thr, 2);
} }
/* Vertical MB Filtering */ /* Vertical MB Filtering */
void vp8_loop_filter_mbv_sse2(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, void vp8_loop_filter_mbv_sse2(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
int y_stride, int uv_stride, loop_filter_info *lfi, int simpler_lpf) int y_stride, int uv_stride, loop_filter_info *lfi)
{ {
(void) simpler_lpf;
vp8_mbloop_filter_vertical_edge_sse2(y_ptr, y_stride, lfi->mbflim, lfi->lim, lfi->thr, 2); vp8_mbloop_filter_vertical_edge_sse2(y_ptr, y_stride, lfi->mbflim, lfi->lim, lfi->thr, 2);
if (u_ptr) if (u_ptr)
@ -190,21 +179,19 @@ void vp8_loop_filter_mbv_sse2(unsigned char *y_ptr, unsigned char *u_ptr, unsign
void vp8_loop_filter_mbvs_sse2(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, void vp8_loop_filter_mbvs_sse2(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
int y_stride, int uv_stride, loop_filter_info *lfi, int simpler_lpf) int y_stride, int uv_stride, loop_filter_info *lfi)
{ {
(void) u_ptr; (void) u_ptr;
(void) v_ptr; (void) v_ptr;
(void) uv_stride; (void) uv_stride;
(void) simpler_lpf;
vp8_loop_filter_simple_vertical_edge_sse2(y_ptr, y_stride, lfi->mbflim, lfi->lim, lfi->thr, 2); vp8_loop_filter_simple_vertical_edge_sse2(y_ptr, y_stride, lfi->mbflim, lfi->lim, lfi->thr, 2);
} }
/* Horizontal B Filtering */ /* Horizontal B Filtering */
void vp8_loop_filter_bh_sse2(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, void vp8_loop_filter_bh_sse2(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
int y_stride, int uv_stride, loop_filter_info *lfi, int simpler_lpf) int y_stride, int uv_stride, loop_filter_info *lfi)
{ {
(void) simpler_lpf;
vp8_loop_filter_horizontal_edge_sse2(y_ptr + 4 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr, 2); vp8_loop_filter_horizontal_edge_sse2(y_ptr + 4 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr, 2);
vp8_loop_filter_horizontal_edge_sse2(y_ptr + 8 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr, 2); vp8_loop_filter_horizontal_edge_sse2(y_ptr + 8 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr, 2);
vp8_loop_filter_horizontal_edge_sse2(y_ptr + 12 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr, 2); vp8_loop_filter_horizontal_edge_sse2(y_ptr + 12 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr, 2);
@ -215,12 +202,11 @@ void vp8_loop_filter_bh_sse2(unsigned char *y_ptr, unsigned char *u_ptr, unsigne
void vp8_loop_filter_bhs_sse2(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, void vp8_loop_filter_bhs_sse2(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
int y_stride, int uv_stride, loop_filter_info *lfi, int simpler_lpf) int y_stride, int uv_stride, loop_filter_info *lfi)
{ {
(void) u_ptr; (void) u_ptr;
(void) v_ptr; (void) v_ptr;
(void) uv_stride; (void) uv_stride;
(void) simpler_lpf;
vp8_loop_filter_simple_horizontal_edge_sse2(y_ptr + 4 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr, 2); vp8_loop_filter_simple_horizontal_edge_sse2(y_ptr + 4 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr, 2);
vp8_loop_filter_simple_horizontal_edge_sse2(y_ptr + 8 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr, 2); vp8_loop_filter_simple_horizontal_edge_sse2(y_ptr + 8 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr, 2);
vp8_loop_filter_simple_horizontal_edge_sse2(y_ptr + 12 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr, 2); vp8_loop_filter_simple_horizontal_edge_sse2(y_ptr + 12 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr, 2);
@ -229,9 +215,8 @@ void vp8_loop_filter_bhs_sse2(unsigned char *y_ptr, unsigned char *u_ptr, unsign
/* Vertical B Filtering */ /* Vertical B Filtering */
void vp8_loop_filter_bv_sse2(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, void vp8_loop_filter_bv_sse2(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
int y_stride, int uv_stride, loop_filter_info *lfi, int simpler_lpf) int y_stride, int uv_stride, loop_filter_info *lfi)
{ {
(void) simpler_lpf;
vp8_loop_filter_vertical_edge_sse2(y_ptr + 4, y_stride, lfi->flim, lfi->lim, lfi->thr, 2); vp8_loop_filter_vertical_edge_sse2(y_ptr + 4, y_stride, lfi->flim, lfi->lim, lfi->thr, 2);
vp8_loop_filter_vertical_edge_sse2(y_ptr + 8, y_stride, lfi->flim, lfi->lim, lfi->thr, 2); vp8_loop_filter_vertical_edge_sse2(y_ptr + 8, y_stride, lfi->flim, lfi->lim, lfi->thr, 2);
vp8_loop_filter_vertical_edge_sse2(y_ptr + 12, y_stride, lfi->flim, lfi->lim, lfi->thr, 2); vp8_loop_filter_vertical_edge_sse2(y_ptr + 12, y_stride, lfi->flim, lfi->lim, lfi->thr, 2);
@ -242,12 +227,11 @@ void vp8_loop_filter_bv_sse2(unsigned char *y_ptr, unsigned char *u_ptr, unsigne
void vp8_loop_filter_bvs_sse2(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, void vp8_loop_filter_bvs_sse2(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr,
int y_stride, int uv_stride, loop_filter_info *lfi, int simpler_lpf) int y_stride, int uv_stride, loop_filter_info *lfi)
{ {
(void) u_ptr; (void) u_ptr;
(void) v_ptr; (void) v_ptr;
(void) uv_stride; (void) uv_stride;
(void) simpler_lpf;
vp8_loop_filter_simple_vertical_edge_sse2(y_ptr + 4, y_stride, lfi->flim, lfi->lim, lfi->thr, 2); vp8_loop_filter_simple_vertical_edge_sse2(y_ptr + 4, y_stride, lfi->flim, lfi->lim, lfi->thr, 2);
vp8_loop_filter_simple_vertical_edge_sse2(y_ptr + 8, y_stride, lfi->flim, lfi->lim, lfi->thr, 2); vp8_loop_filter_simple_vertical_edge_sse2(y_ptr + 8, y_stride, lfi->flim, lfi->lim, lfi->thr, 2);
vp8_loop_filter_simple_vertical_edge_sse2(y_ptr + 12, y_stride, lfi->flim, lfi->lim, lfi->thr, 2); vp8_loop_filter_simple_vertical_edge_sse2(y_ptr + 12, y_stride, lfi->flim, lfi->lim, lfi->thr, 2);

Просмотреть файл

@ -111,9 +111,8 @@ void mb_init_dequantizer(VP8D_COMP *pbi, MACROBLOCKD *xd)
*/ */
static void skip_recon_mb(VP8D_COMP *pbi, MACROBLOCKD *xd) static void skip_recon_mb(VP8D_COMP *pbi, MACROBLOCKD *xd)
{ {
if (xd->frame_type == KEY_FRAME || xd->mode_info_context->mbmi.ref_frame == INTRA_FRAME) if (xd->mode_info_context->mbmi.ref_frame == INTRA_FRAME)
{ {
vp8_build_intra_predictors_mbuv_s(xd); vp8_build_intra_predictors_mbuv_s(xd);
RECON_INVOKE(&pbi->common.rtcd.recon, RECON_INVOKE(&pbi->common.rtcd.recon,
build_intra_predictors_mby_s)(xd); build_intra_predictors_mby_s)(xd);
@ -195,11 +194,10 @@ static void decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd)
clamp_mvs(xd); clamp_mvs(xd);
} }
xd->mode_info_context->mbmi.dc_diff = 1; eobtotal |= (xd->mode_info_context->mbmi.mode == B_PRED ||
xd->mode_info_context->mbmi.mode == SPLITMV);
if (xd->mode_info_context->mbmi.mode != B_PRED && xd->mode_info_context->mbmi.mode != SPLITMV && eobtotal == 0) if (!eobtotal)
{ {
xd->mode_info_context->mbmi.dc_diff = 0;
skip_recon_mb(pbi, xd); skip_recon_mb(pbi, xd);
return; return;
} }
@ -208,7 +206,7 @@ static void decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd)
mb_init_dequantizer(pbi, xd); mb_init_dequantizer(pbi, xd);
/* do prediction */ /* do prediction */
if (xd->frame_type == KEY_FRAME || xd->mode_info_context->mbmi.ref_frame == INTRA_FRAME) if (xd->mode_info_context->mbmi.ref_frame == INTRA_FRAME)
{ {
vp8_build_intra_predictors_mbuv(xd); vp8_build_intra_predictors_mbuv(xd);
@ -255,7 +253,7 @@ static void decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd)
xd->predictor, xd->dst.y_buffer, xd->predictor, xd->dst.y_buffer,
xd->dst.y_stride, xd->eobs, xd->block[24].diff); xd->dst.y_stride, xd->eobs, xd->block[24].diff);
} }
else if ((xd->frame_type == KEY_FRAME || xd->mode_info_context->mbmi.ref_frame == INTRA_FRAME) && xd->mode_info_context->mbmi.mode == B_PRED) else if (xd->mode_info_context->mbmi.mode == B_PRED)
{ {
for (i = 0; i < 16; i++) for (i = 0; i < 16; i++)
{ {

Просмотреть файл

@ -108,12 +108,10 @@ static void decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd, int mb_row, int m
clamp_mvs(xd); clamp_mvs(xd);
} }
xd->mode_info_context->mbmi.dc_diff = 1; eobtotal |= (xd->mode_info_context->mbmi.mode == B_PRED ||
xd->mode_info_context->mbmi.mode == SPLITMV);
if (xd->mode_info_context->mbmi.mode != B_PRED && xd->mode_info_context->mbmi.mode != SPLITMV && eobtotal == 0) if (!eobtotal)
{ {
xd->mode_info_context->mbmi.dc_diff = 0;
/*mt_skip_recon_mb(pbi, xd, mb_row, mb_col);*/ /*mt_skip_recon_mb(pbi, xd, mb_row, mb_col);*/
if (xd->frame_type == KEY_FRAME || xd->mode_info_context->mbmi.ref_frame == INTRA_FRAME) if (xd->frame_type == KEY_FRAME || xd->mode_info_context->mbmi.ref_frame == INTRA_FRAME)
{ {
@ -322,6 +320,7 @@ static THREAD_FUNCTION thread_decoding_proc(void *p_data)
if (pbi->common.filter_level) if (pbi->common.filter_level)
{ {
int skip_lf;
if( mb_row != pc->mb_rows-1 ) if( mb_row != pc->mb_rows-1 )
{ {
/* Save decoded MB last row data for next-row decoding */ /* Save decoded MB last row data for next-row decoding */
@ -349,6 +348,10 @@ static THREAD_FUNCTION thread_decoding_proc(void *p_data)
/* update loopfilter info */ /* update loopfilter info */
Segment = (alt_flt_enabled) ? xd->mode_info_context->mbmi.segment_id : 0; Segment = (alt_flt_enabled) ? xd->mode_info_context->mbmi.segment_id : 0;
skip_lf = (xd->mode_info_context->mbmi.mode != B_PRED &&
xd->mode_info_context->mbmi.mode != SPLITMV &&
xd->mode_info_context->mbmi.mb_skip_coeff);
filter_level = pbi->mt_baseline_filter_level[Segment]; filter_level = pbi->mt_baseline_filter_level[Segment];
/* Distance of Mb to the various image edges. /* Distance of Mb to the various image edges.
* These are specified to 8th pel as they are always compared to values that are in 1/8th pel units * These are specified to 8th pel as they are always compared to values that are in 1/8th pel units
@ -360,17 +363,17 @@ static THREAD_FUNCTION thread_decoding_proc(void *p_data)
if (filter_level) if (filter_level)
{ {
if (mb_col > 0) if (mb_col > 0)
pc->lf_mbv(xd->dst.y_buffer, xd->dst.u_buffer, xd->dst.v_buffer, recon_y_stride, recon_uv_stride, &lfi[filter_level], pc->simpler_lpf); pc->lf_mbv(xd->dst.y_buffer, xd->dst.u_buffer, xd->dst.v_buffer, recon_y_stride, recon_uv_stride, &lfi[filter_level]);
if (xd->mode_info_context->mbmi.dc_diff > 0) if (!skip_lf)
pc->lf_bv(xd->dst.y_buffer, xd->dst.u_buffer, xd->dst.v_buffer, recon_y_stride, recon_uv_stride, &lfi[filter_level], pc->simpler_lpf); pc->lf_bv(xd->dst.y_buffer, xd->dst.u_buffer, xd->dst.v_buffer, recon_y_stride, recon_uv_stride, &lfi[filter_level]);
/* don't apply across umv border */ /* don't apply across umv border */
if (mb_row > 0) if (mb_row > 0)
pc->lf_mbh(xd->dst.y_buffer, xd->dst.u_buffer, xd->dst.v_buffer, recon_y_stride, recon_uv_stride, &lfi[filter_level], pc->simpler_lpf); pc->lf_mbh(xd->dst.y_buffer, xd->dst.u_buffer, xd->dst.v_buffer, recon_y_stride, recon_uv_stride, &lfi[filter_level]);
if (xd->mode_info_context->mbmi.dc_diff > 0) if (!skip_lf)
pc->lf_bh(xd->dst.y_buffer, xd->dst.u_buffer, xd->dst.v_buffer, recon_y_stride, recon_uv_stride, &lfi[filter_level], pc->simpler_lpf); pc->lf_bh(xd->dst.y_buffer, xd->dst.u_buffer, xd->dst.v_buffer, recon_y_stride, recon_uv_stride, &lfi[filter_level]);
} }
} }
@ -810,6 +813,7 @@ void vp8mt_decode_mb_rows( VP8D_COMP *pbi, MACROBLOCKD *xd)
if (pbi->common.filter_level) if (pbi->common.filter_level)
{ {
int skip_lf;
/* Save decoded MB last row data for next-row decoding */ /* Save decoded MB last row data for next-row decoding */
if(mb_row != pc->mb_rows-1) if(mb_row != pc->mb_rows-1)
{ {
@ -837,6 +841,9 @@ void vp8mt_decode_mb_rows( VP8D_COMP *pbi, MACROBLOCKD *xd)
/* update loopfilter info */ /* update loopfilter info */
Segment = (alt_flt_enabled) ? xd->mode_info_context->mbmi.segment_id : 0; Segment = (alt_flt_enabled) ? xd->mode_info_context->mbmi.segment_id : 0;
skip_lf = (xd->mode_info_context->mbmi.mode != B_PRED &&
xd->mode_info_context->mbmi.mode != SPLITMV &&
xd->mode_info_context->mbmi.mb_skip_coeff);
filter_level = pbi->mt_baseline_filter_level[Segment]; filter_level = pbi->mt_baseline_filter_level[Segment];
/* Distance of Mb to the various image edges. /* Distance of Mb to the various image edges.
* These are specified to 8th pel as they are always compared to values that are in 1/8th pel units * These are specified to 8th pel as they are always compared to values that are in 1/8th pel units
@ -848,17 +855,17 @@ void vp8mt_decode_mb_rows( VP8D_COMP *pbi, MACROBLOCKD *xd)
if (filter_level) if (filter_level)
{ {
if (mb_col > 0) if (mb_col > 0)
pc->lf_mbv(xd->dst.y_buffer, xd->dst.u_buffer, xd->dst.v_buffer, recon_y_stride, recon_uv_stride, &lfi[filter_level], pc->simpler_lpf); pc->lf_mbv(xd->dst.y_buffer, xd->dst.u_buffer, xd->dst.v_buffer, recon_y_stride, recon_uv_stride, &lfi[filter_level]);
if (xd->mode_info_context->mbmi.dc_diff > 0) if (!skip_lf)
pc->lf_bv(xd->dst.y_buffer, xd->dst.u_buffer, xd->dst.v_buffer, recon_y_stride, recon_uv_stride, &lfi[filter_level], pc->simpler_lpf); pc->lf_bv(xd->dst.y_buffer, xd->dst.u_buffer, xd->dst.v_buffer, recon_y_stride, recon_uv_stride, &lfi[filter_level]);
/* don't apply across umv border */ /* don't apply across umv border */
if (mb_row > 0) if (mb_row > 0)
pc->lf_mbh(xd->dst.y_buffer, xd->dst.u_buffer, xd->dst.v_buffer, recon_y_stride, recon_uv_stride, &lfi[filter_level], pc->simpler_lpf); pc->lf_mbh(xd->dst.y_buffer, xd->dst.u_buffer, xd->dst.v_buffer, recon_y_stride, recon_uv_stride, &lfi[filter_level]);
if (xd->mode_info_context->mbmi.dc_diff > 0) if (!skip_lf)
pc->lf_bh(xd->dst.y_buffer, xd->dst.u_buffer, xd->dst.v_buffer, recon_y_stride, recon_uv_stride, &lfi[filter_level], pc->simpler_lpf); pc->lf_bh(xd->dst.y_buffer, xd->dst.u_buffer, xd->dst.v_buffer, recon_y_stride, recon_uv_stride, &lfi[filter_level]);
} }
} }

Просмотреть файл

@ -1400,11 +1400,6 @@ int vp8cx_encode_inter_macroblock
{ {
if (cpi->common.mb_no_coeff_skip) if (cpi->common.mb_no_coeff_skip)
{ {
if (xd->mode_info_context->mbmi.mode != B_PRED && xd->mode_info_context->mbmi.mode != SPLITMV)
xd->mode_info_context->mbmi.dc_diff = 0;
else
xd->mode_info_context->mbmi.dc_diff = 1;
xd->mode_info_context->mbmi.mb_skip_coeff = 1; xd->mode_info_context->mbmi.mb_skip_coeff = 1;
cpi->skip_true_count ++; cpi->skip_true_count ++;
vp8_fix_contexts(xd); vp8_fix_contexts(xd);

Просмотреть файл

@ -1528,10 +1528,6 @@ static void init_config(VP8_PTR ptr, VP8_CONFIG *oxcf)
cpi->avg_frame_qindex = cpi->oxcf.worst_allowed_q; cpi->avg_frame_qindex = cpi->oxcf.worst_allowed_q;
// Initialise the starting buffer levels // Initialise the starting buffer levels
cpi->oxcf.starting_buffer_level =
rescale(cpi->oxcf.starting_buffer_level,
cpi->oxcf.target_bandwidth, 1000);
cpi->buffer_level = cpi->oxcf.starting_buffer_level; cpi->buffer_level = cpi->oxcf.starting_buffer_level;
cpi->bits_off_target = cpi->oxcf.starting_buffer_level; cpi->bits_off_target = cpi->oxcf.starting_buffer_level;
@ -1704,6 +1700,10 @@ void vp8_change_config(VP8_PTR ptr, VP8_CONFIG *oxcf)
// Convert target bandwidth from Kbit/s to Bit/s // Convert target bandwidth from Kbit/s to Bit/s
cpi->oxcf.target_bandwidth *= 1000; cpi->oxcf.target_bandwidth *= 1000;
cpi->oxcf.starting_buffer_level =
rescale(cpi->oxcf.starting_buffer_level,
cpi->oxcf.target_bandwidth, 1000);
// Set or reset optimal and maximum buffer levels. // Set or reset optimal and maximum buffer levels.
if (cpi->oxcf.optimal_buffer_level == 0) if (cpi->oxcf.optimal_buffer_level == 0)
cpi->oxcf.optimal_buffer_level = cpi->oxcf.target_bandwidth / 8; cpi->oxcf.optimal_buffer_level = cpi->oxcf.target_bandwidth / 8;
@ -1753,8 +1753,6 @@ void vp8_change_config(VP8_PTR ptr, VP8_CONFIG *oxcf)
// Only allow dropped frames in buffered mode // Only allow dropped frames in buffered mode
cpi->drop_frames_allowed = cpi->oxcf.allow_df && cpi->buffered_mode; cpi->drop_frames_allowed = cpi->oxcf.allow_df && cpi->buffered_mode;
cm->filter_type = (LOOPFILTERTYPE) cpi->filter_type;
if (!cm->use_bilinear_mc_filter) if (!cm->use_bilinear_mc_filter)
cm->mcomp_filter_type = SIXTAP; cm->mcomp_filter_type = SIXTAP;
else else
@ -2730,16 +2728,17 @@ static int pick_frame_size(VP8_COMP *cpi)
if (cpi->pass == 2) if (cpi->pass == 2)
vp8_calc_auto_iframe_target_size(cpi); vp8_calc_auto_iframe_target_size(cpi);
// 1 Pass there is no information on which to base size so use bandwidth per second * fixed fraction
else else
#endif #endif
cpi->this_frame_target = cpi->oxcf.target_bandwidth / 2;
// in error resilient mode the first frame is bigger since it likely contains
// all the static background
if (cpi->oxcf.error_resilient_mode == 1 || (cpi->compressor_speed == 2))
{ {
cpi->this_frame_target *= 3; // 5; /* 1 Pass there is no information on which to base size so use
* bandwidth per second * fraction of the initial buffer
* level
*/
cpi->this_frame_target = cpi->oxcf.starting_buffer_level / 2;
if(cpi->this_frame_target > cpi->oxcf.target_bandwidth * 3 / 2)
cpi->this_frame_target = cpi->oxcf.target_bandwidth * 3 / 2;
} }
// Key frame from VFW/auto-keyframe/first frame // Key frame from VFW/auto-keyframe/first frame
@ -2773,6 +2772,19 @@ static int pick_frame_size(VP8_COMP *cpi)
} }
} }
/* Apply limits on keyframe target.
*
* TODO: move this after consolidating
* vp8_calc_iframe_target_size() and vp8_calc_auto_iframe_target_size()
*/
if (cm->frame_type == KEY_FRAME && cpi->oxcf.rc_max_intra_bitrate_pct)
{
unsigned int max_rate = cpi->av_per_frame_bandwidth
* cpi->oxcf.rc_max_intra_bitrate_pct / 100;
if (cpi->this_frame_target > max_rate)
cpi->this_frame_target = max_rate;
}
return 1; return 1;
} }
@ -5274,35 +5286,6 @@ int vp8_calc_ss_err(YV12_BUFFER_CONFIG *source, YV12_BUFFER_CONFIG *dest, const
} }
static int calc_low_ss_err(YV12_BUFFER_CONFIG *source, YV12_BUFFER_CONFIG *dest, const vp8_variance_rtcd_vtable_t *rtcd)
{
int i, j;
int Total = 0;
unsigned char *src = source->y_buffer;
unsigned char *dst = dest->y_buffer;
(void)rtcd;
// Loop through the Y plane raw and reconstruction data summing (square differences)
for (i = 0; i < source->y_height; i += 16)
{
for (j = 0; j < source->y_width; j += 16)
{
unsigned int sse;
VARIANCE_INVOKE(rtcd, mse16x16)(src + j, source->y_stride, dst + j, dest->y_stride, &sse);
if (sse < 8096)
Total += sse;
}
src += 16 * source->y_stride;
dst += 16 * dest->y_stride;
}
return Total;
}
int vp8_get_quantizer(VP8_PTR c) int vp8_get_quantizer(VP8_PTR c)
{ {
VP8_COMP *cpi = (VP8_COMP *) c; VP8_COMP *cpi = (VP8_COMP *) c;

Просмотреть файл

@ -506,7 +506,6 @@ typedef struct
int auto_adjust_key_quantizer; int auto_adjust_key_quantizer;
int keyquantizer; int keyquantizer;
int auto_worst_q; int auto_worst_q;
int filter_type;
int cpu_used; int cpu_used;
int chroma_boost; int chroma_boost;
int horiz_scale; int horiz_scale;

Просмотреть файл

@ -938,7 +938,6 @@ void vp8_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int re
best_mbmode.uv_mode = 0; best_mbmode.uv_mode = 0;
best_mbmode.mb_skip_coeff = (cpi->common.mb_no_coeff_skip) ? 1 : 0; best_mbmode.mb_skip_coeff = (cpi->common.mb_no_coeff_skip) ? 1 : 0;
best_mbmode.partitioning = 0; best_mbmode.partitioning = 0;
best_mbmode.dc_diff = 0;
vpx_memcpy(&x->e_mbd.mode_info_context->mbmi, &best_mbmode, sizeof(MB_MODE_INFO)); vpx_memcpy(&x->e_mbd.mode_info_context->mbmi, &best_mbmode, sizeof(MB_MODE_INFO));
vpx_memcpy(x->partition_info, &best_partition, sizeof(PARTITION_INFO)); vpx_memcpy(x->partition_info, &best_partition, sizeof(PARTITION_INFO));

Просмотреть файл

@ -707,8 +707,6 @@ void vp8_calc_pframe_target_size(VP8_COMP *cpi)
int min_frame_target; int min_frame_target;
int Adjustment; int Adjustment;
// Set the min frame bandwidth.
//min_frame_target = estimate_min_frame_size( cpi );
min_frame_target = 0; min_frame_target = 0;
if (cpi->pass == 2) if (cpi->pass == 2)
@ -862,11 +860,6 @@ void vp8_calc_pframe_target_size(VP8_COMP *cpi)
} }
} }
// Set a reduced data rate target for our initial Q calculation.
// This should help to save bits during earier sections.
if ((cpi->oxcf.under_shoot_pct > 0) && (cpi->oxcf.under_shoot_pct <= 100))
cpi->this_frame_target = (cpi->this_frame_target * cpi->oxcf.under_shoot_pct) / 100;
// Sanity check that the total sum of adjustments is not above the maximum allowed // Sanity check that the total sum of adjustments is not above the maximum allowed
// That is that having allowed for KF and GF penalties we have not pushed the // That is that having allowed for KF and GF penalties we have not pushed the
// current interframe target to low. If the adjustment we apply here is not capable of recovering // current interframe target to low. If the adjustment we apply here is not capable of recovering
@ -903,11 +896,6 @@ void vp8_calc_pframe_target_size(VP8_COMP *cpi)
percent_low = percent_low =
(cpi->oxcf.optimal_buffer_level - cpi->buffer_level) / (cpi->oxcf.optimal_buffer_level - cpi->buffer_level) /
one_percent_bits; one_percent_bits;
if (percent_low > 100)
percent_low = 100;
else if (percent_low < 0)
percent_low = 0;
} }
// Are we overshooting the long term clip data rate... // Are we overshooting the long term clip data rate...
else if (cpi->bits_off_target < 0) else if (cpi->bits_off_target < 0)
@ -915,16 +903,16 @@ void vp8_calc_pframe_target_size(VP8_COMP *cpi)
// Adjust per frame data target downwards to compensate. // Adjust per frame data target downwards to compensate.
percent_low = (int)(100 * -cpi->bits_off_target / percent_low = (int)(100 * -cpi->bits_off_target /
(cpi->total_byte_count * 8)); (cpi->total_byte_count * 8));
if (percent_low > 100)
percent_low = 100;
else if (percent_low < 0)
percent_low = 0;
} }
if (percent_low > cpi->oxcf.under_shoot_pct)
percent_low = cpi->oxcf.under_shoot_pct;
else if (percent_low < 0)
percent_low = 0;
// lower the target bandwidth for this frame. // lower the target bandwidth for this frame.
cpi->this_frame_target = cpi->this_frame_target -= (cpi->this_frame_target * percent_low)
(cpi->this_frame_target * (100 - (percent_low / 2))) / 100; / 200;
// Are we using allowing control of active_worst_allowed_q // Are we using allowing control of active_worst_allowed_q
// according to buffer level. // according to buffer level.
@ -995,20 +983,29 @@ void vp8_calc_pframe_target_size(VP8_COMP *cpi)
} }
else else
{ {
int percent_high; int percent_high = 0;
if (cpi->bits_off_target > cpi->oxcf.optimal_buffer_level) if ((cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER)
&& (cpi->buffer_level > cpi->oxcf.optimal_buffer_level))
{ {
percent_high = (int)(100 * (cpi->bits_off_target - cpi->oxcf.optimal_buffer_level) / (cpi->total_byte_count * 8)); percent_high = (cpi->buffer_level
- cpi->oxcf.optimal_buffer_level)
if (percent_high > 100) / one_percent_bits;
percent_high = 100;
else if (percent_high < 0)
percent_high = 0;
cpi->this_frame_target = (cpi->this_frame_target * (100 + (percent_high / 2))) / 100;
} }
else if (cpi->bits_off_target > cpi->oxcf.optimal_buffer_level)
{
percent_high = (int)((100 * cpi->bits_off_target)
/ (cpi->total_byte_count * 8));
}
if (percent_high > cpi->oxcf.over_shoot_pct)
percent_high = cpi->oxcf.over_shoot_pct;
else if (percent_high < 0)
percent_high = 0;
cpi->this_frame_target += (cpi->this_frame_target *
percent_high) / 200;
// Are we allowing control of active_worst_allowed_q according to bufferl level. // Are we allowing control of active_worst_allowed_q according to bufferl level.
if (cpi->auto_worst_q) if (cpi->auto_worst_q)
@ -1464,39 +1461,6 @@ int vp8_regulate_q(VP8_COMP *cpi, int target_bits_per_frame)
return Q; return Q;
} }
static int estimate_min_frame_size(VP8_COMP *cpi)
{
double correction_factor;
int bits_per_mb_at_max_q;
// This funtion returns a default value for the first few frames untill the correction factor has had time to adapt.
if (cpi->common.current_video_frame < 10)
{
if (cpi->pass == 2)
return (cpi->min_frame_bandwidth);
else
return cpi->per_frame_bandwidth / 3;
}
/* // Select the appropriate correction factor based upon type of frame.
if ( cpi->common.frame_type == KEY_FRAME )
correction_factor = cpi->key_frame_rate_correction_factor;
else
{
if ( cpi->common.refresh_alt_ref_frame || cpi->common.refresh_golden_frame )
correction_factor = cpi->gf_rate_correction_factor;
else
correction_factor = cpi->rate_correction_factor;
}*/
// We estimate at half the value we get from vp8_bits_per_mb
correction_factor = cpi->rate_correction_factor / 2.0;
bits_per_mb_at_max_q = (int)(.5 + correction_factor * vp8_bits_per_mb[cpi->common.frame_type][MAXQ]);
return (bits_per_mb_at_max_q * cpi->common.MBs) >> BPER_MB_NORMBITS;
}
static int estimate_keyframe_frequency(VP8_COMP *cpi) static int estimate_keyframe_frequency(VP8_COMP *cpi)
{ {
@ -1513,8 +1477,10 @@ static int estimate_keyframe_frequency(VP8_COMP *cpi)
/* Assume a default of 1 kf every 2 seconds, or the max kf interval, /* Assume a default of 1 kf every 2 seconds, or the max kf interval,
* whichever is smaller. * whichever is smaller.
*/ */
int key_freq = cpi->oxcf.key_freq>0 ? cpi->oxcf.key_freq : 1;
av_key_frame_frequency = (int)cpi->output_frame_rate * 2; av_key_frame_frequency = (int)cpi->output_frame_rate * 2;
if (av_key_frame_frequency > cpi->oxcf.key_freq)
if (cpi->oxcf.auto_key && av_key_frame_frequency > key_freq)
av_key_frame_frequency = cpi->oxcf.key_freq; av_key_frame_frequency = cpi->oxcf.key_freq;
cpi->prior_key_frame_distance[KEY_FRAME_CONTEXT - 1] cpi->prior_key_frame_distance[KEY_FRAME_CONTEXT - 1]

Просмотреть файл

@ -298,9 +298,6 @@ void vp8_initialize_rd_consts(VP8_COMP *cpi, int QIndex)
#endif #endif
vp8_set_speed_features(cpi); vp8_set_speed_features(cpi);
if (cpi->common.simpler_lpf)
cpi->common.filter_type = SIMPLE_LOOPFILTER;
q = (int)pow(vp8_dc_quant(QIndex,0), 1.25); q = (int)pow(vp8_dc_quant(QIndex,0), 1.25);
if (q < 8) if (q < 8)
@ -2526,7 +2523,6 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int
best_mbmode.uv_mode = 0; best_mbmode.uv_mode = 0;
best_mbmode.mb_skip_coeff = (cpi->common.mb_no_coeff_skip) ? 1 : 0; best_mbmode.mb_skip_coeff = (cpi->common.mb_no_coeff_skip) ? 1 : 0;
best_mbmode.partitioning = 0; best_mbmode.partitioning = 0;
best_mbmode.dc_diff = 0;
vpx_memcpy(&x->e_mbd.mode_info_context->mbmi, &best_mbmode, sizeof(MB_MODE_INFO)); vpx_memcpy(&x->e_mbd.mode_info_context->mbmi, &best_mbmode, sizeof(MB_MODE_INFO));
vpx_memcpy(x->partition_info, &best_partition, sizeof(PARTITION_INFO)); vpx_memcpy(x->partition_info, &best_partition, sizeof(PARTITION_INFO));

Просмотреть файл

@ -224,18 +224,9 @@ void vp8_tokenize_mb(VP8_COMP *cpi, MACROBLOCKD *x, TOKENEXTRA **t)
int plane_type; int plane_type;
int b; int b;
TOKENEXTRA *start = *t;
TOKENEXTRA *tp = *t;
x->mode_info_context->mbmi.dc_diff = 1;
#if 1
x->mode_info_context->mbmi.mb_skip_coeff = mb_is_skippable(x); x->mode_info_context->mbmi.mb_skip_coeff = mb_is_skippable(x);
if (x->mode_info_context->mbmi.mb_skip_coeff) if (x->mode_info_context->mbmi.mb_skip_coeff)
{ {
cpi->skip_true_count++; cpi->skip_true_count++;
if (!cpi->common.mb_no_coeff_skip) if (!cpi->common.mb_no_coeff_skip)
@ -245,17 +236,11 @@ void vp8_tokenize_mb(VP8_COMP *cpi, MACROBLOCKD *x, TOKENEXTRA **t)
vp8_fix_contexts(x); vp8_fix_contexts(x);
} }
if (x->mode_info_context->mbmi.mode != B_PRED && x->mode_info_context->mbmi.mode != SPLITMV)
x->mode_info_context->mbmi.dc_diff = 0;
else
x->mode_info_context->mbmi.dc_diff = 1;
return; return;
} }
cpi->skip_false_count++; cpi->skip_false_count++;
#endif
#if 0 #if 0
vpx_memcpy(cpi->coef_counts_backup, cpi->coef_counts, sizeof(cpi->coef_counts)); vpx_memcpy(cpi->coef_counts_backup, cpi->coef_counts, sizeof(cpi->coef_counts));
#endif #endif
@ -282,42 +267,6 @@ void vp8_tokenize_mb(VP8_COMP *cpi, MACROBLOCKD *x, TOKENEXTRA **t)
A + vp8_block2above[b], A + vp8_block2above[b],
L + vp8_block2left[b], cpi); L + vp8_block2left[b], cpi);
#if 0
if (cpi->common.mb_no_coeff_skip)
{
int skip = 1;
while ((tp != *t) && skip)
{
skip = (skip && (tp->Token == DCT_EOB_TOKEN));
tp ++;
}
if (skip != x->mbmi.mb_skip_coeff)
skip += 0;
x->mbmi.mb_skip_coeff = skip;
if (x->mbmi.mb_skip_coeff == 1)
{
x->mbmi.dc_diff = 0;
//redo the coutnts
vpx_memcpy(cpi->coef_counts, cpi->coef_counts_backup, sizeof(cpi->coef_counts));
*t = start;
cpi->skip_true_count++;
//skip_true_count++;
}
else
{
cpi->skip_false_count++;
//skip_false_count++;
}
}
#endif
} }
@ -500,13 +449,6 @@ void vp8_stuff_mb(VP8_COMP *cpi, MACROBLOCKD *x, TOKENEXTRA **t)
A + vp8_block2above[24], L + vp8_block2left[24], cpi); A + vp8_block2above[24], L + vp8_block2left[24], cpi);
plane_type = 0; plane_type = 0;
if (x->mode_info_context->mbmi.mode != B_PRED && x->mode_info_context->mbmi.mode != SPLITMV)
x->mode_info_context->mbmi.dc_diff = 0;
else
x->mode_info_context->mbmi.dc_diff = 1;
for (b = 0; b < 16; b++) for (b = 0; b < 16; b++)
stuff1st_order_b(x->block + b, t, plane_type, x->frame_type, stuff1st_order_b(x->block + b, t, plane_type, x->frame_type,
A + vp8_block2above[b], A + vp8_block2above[b],

Просмотреть файл

@ -0,0 +1,254 @@
;
; Copyright (c) 2010 The WebM project authors. All Rights Reserved.
;
; Use of this source code is governed by a BSD-style license and patent
; grant that can be found in the LICENSE file in the root of the source
; tree. All contributing project authors may be found in the AUTHORS
; file in the root of the source tree.
;
%include "vpx_ports/x86_abi_support.asm"
%include "asm_enc_offsets.asm"
; void vp8_regular_quantize_b_sse4 | arg
; (BLOCK *b, | 0
; BLOCKD *d) | 1
global sym(vp8_regular_quantize_b_sse4)
sym(vp8_regular_quantize_b_sse4):
%if ABI_IS_32BIT
push rbp
mov rbp, rsp
GET_GOT rbx
push rdi
push rsi
ALIGN_STACK 16, rax
%define qcoeff 0 ; 32
%define stack_size 32
sub rsp, stack_size
%else
%ifidn __OUTPUT_FORMAT__,x64
SAVE_XMM 8, u
push rdi
push rsi
%endif
%endif
; end prolog
%if ABI_IS_32BIT
mov rdi, arg(0) ; BLOCK *b
mov rsi, arg(1) ; BLOCKD *d
%else
%ifidn __OUTPUT_FORMAT__,x64
mov rdi, rcx ; BLOCK *b
mov rsi, rdx ; BLOCKD *d
%else
;mov rdi, rdi ; BLOCK *b
;mov rsi, rsi ; BLOCKD *d
%endif
%endif
mov rax, [rdi + vp8_block_coeff]
mov rcx, [rdi + vp8_block_zbin]
mov rdx, [rdi + vp8_block_round]
movd xmm7, [rdi + vp8_block_zbin_extra]
; z
movdqa xmm0, [rax]
movdqa xmm1, [rax + 16]
; duplicate zbin_oq_value
pshuflw xmm7, xmm7, 0
punpcklwd xmm7, xmm7
movdqa xmm2, xmm0
movdqa xmm3, xmm1
; sz
psraw xmm0, 15
psraw xmm1, 15
; (z ^ sz)
pxor xmm2, xmm0
pxor xmm3, xmm1
; x = abs(z)
psubw xmm2, xmm0
psubw xmm3, xmm1
; zbin
movdqa xmm4, [rcx]
movdqa xmm5, [rcx + 16]
; *zbin_ptr + zbin_oq_value
paddw xmm4, xmm7
paddw xmm5, xmm7
movdqa xmm6, xmm2
movdqa xmm7, xmm3
; x - (*zbin_ptr + zbin_oq_value)
psubw xmm6, xmm4
psubw xmm7, xmm5
; round
movdqa xmm4, [rdx]
movdqa xmm5, [rdx + 16]
mov rax, [rdi + vp8_block_quant_shift]
mov rcx, [rdi + vp8_block_quant]
mov rdx, [rdi + vp8_block_zrun_zbin_boost]
; x + round
paddw xmm2, xmm4
paddw xmm3, xmm5
; quant
movdqa xmm4, [rcx]
movdqa xmm5, [rcx + 16]
; y = x * quant_ptr >> 16
pmulhw xmm4, xmm2
pmulhw xmm5, xmm3
; y += x
paddw xmm2, xmm4
paddw xmm3, xmm5
pxor xmm4, xmm4
%if ABI_IS_32BIT
movdqa [rsp + qcoeff], xmm4
movdqa [rsp + qcoeff + 16], xmm4
%else
pxor xmm8, xmm8
%endif
; quant_shift
movdqa xmm5, [rax]
; zrun_zbin_boost
mov rax, rdx
%macro ZIGZAG_LOOP 5
; x
pextrw ecx, %4, %2
; if (x >= zbin)
sub cx, WORD PTR[rdx] ; x - zbin
lea rdx, [rdx + 2] ; zbin_boost_ptr++
jl rq_zigzag_loop_%1 ; x < zbin
pextrw edi, %3, %2 ; y
; downshift by quant_shift[rc]
pextrb ecx, xmm5, %1 ; quant_shift[rc]
sar edi, cl ; also sets Z bit
je rq_zigzag_loop_%1 ; !y
%if ABI_IS_32BIT
mov WORD PTR[rsp + qcoeff + %1 *2], di
%else
pinsrw %5, edi, %2 ; qcoeff[rc]
%endif
mov rdx, rax ; reset to b->zrun_zbin_boost
rq_zigzag_loop_%1:
%endmacro
; in vp8_default_zig_zag1d order: see vp8/common/entropy.c
ZIGZAG_LOOP 0, 0, xmm2, xmm6, xmm4
ZIGZAG_LOOP 1, 1, xmm2, xmm6, xmm4
ZIGZAG_LOOP 4, 4, xmm2, xmm6, xmm4
ZIGZAG_LOOP 8, 0, xmm3, xmm7, xmm8
ZIGZAG_LOOP 5, 5, xmm2, xmm6, xmm4
ZIGZAG_LOOP 2, 2, xmm2, xmm6, xmm4
ZIGZAG_LOOP 3, 3, xmm2, xmm6, xmm4
ZIGZAG_LOOP 6, 6, xmm2, xmm6, xmm4
ZIGZAG_LOOP 9, 1, xmm3, xmm7, xmm8
ZIGZAG_LOOP 12, 4, xmm3, xmm7, xmm8
ZIGZAG_LOOP 13, 5, xmm3, xmm7, xmm8
ZIGZAG_LOOP 10, 2, xmm3, xmm7, xmm8
ZIGZAG_LOOP 7, 7, xmm2, xmm6, xmm4
ZIGZAG_LOOP 11, 3, xmm3, xmm7, xmm8
ZIGZAG_LOOP 14, 6, xmm3, xmm7, xmm8
ZIGZAG_LOOP 15, 7, xmm3, xmm7, xmm8
mov rcx, [rsi + vp8_blockd_dequant]
mov rdi, [rsi + vp8_blockd_dqcoeff]
%if ABI_IS_32BIT
movdqa xmm4, [rsp + qcoeff]
movdqa xmm5, [rsp + qcoeff + 16]
%else
%define xmm5 xmm8
%endif
; y ^ sz
pxor xmm4, xmm0
pxor xmm5, xmm1
; x = (y ^ sz) - sz
psubw xmm4, xmm0
psubw xmm5, xmm1
; dequant
movdqa xmm0, [rcx]
movdqa xmm1, [rcx + 16]
mov rcx, [rsi + vp8_blockd_qcoeff]
pmullw xmm0, xmm4
pmullw xmm1, xmm5
; store qcoeff
movdqa [rcx], xmm4
movdqa [rcx + 16], xmm5
; store dqcoeff
movdqa [rdi], xmm0
movdqa [rdi + 16], xmm1
; select the last value (in zig_zag order) for EOB
pxor xmm6, xmm6
pcmpeqw xmm4, xmm6
pcmpeqw xmm5, xmm6
packsswb xmm4, xmm5
pshufb xmm4, [GLOBAL(zig_zag1d)]
pmovmskb edx, xmm4
xor rdi, rdi
mov eax, -1
xor dx, ax
bsr eax, edx
sub edi, edx
sar edi, 31
add eax, 1
and eax, edi
mov [rsi + vp8_blockd_eob], eax
; begin epilog
%if ABI_IS_32BIT
add rsp, stack_size
pop rsp
pop rsi
pop rdi
RESTORE_GOT
pop rbp
%else
%undef xmm5
%ifidn __OUTPUT_FORMAT__,x64
pop rsi
pop rdi
RESTORE_XMM
%endif
%endif
ret
SECTION_RODATA
align 16
; vp8/common/entropy.c: vp8_default_zig_zag1d
zig_zag1d:
db 0, 1, 4, 8, 5, 2, 3, 6, 9, 12, 13, 10, 7, 11, 14, 15

Просмотреть файл

@ -51,4 +51,17 @@ extern prototype_quantize_block(vp8_fast_quantize_b_ssse3);
#endif /* HAVE_SSSE3 */ #endif /* HAVE_SSSE3 */
#if HAVE_SSE4_1
extern prototype_quantize_block(vp8_regular_quantize_b_sse4);
#if !CONFIG_RUNTIME_CPU_DETECT
#undef vp8_quantize_quantb
#define vp8_quantize_quantb vp8_regular_quantize_b_sse4
#endif /* !CONFIG_RUNTIME_CPU_DETECT */
#endif /* HAVE_SSE4_1 */
#endif /* QUANTIZE_X86_H */ #endif /* QUANTIZE_X86_H */

Просмотреть файл

@ -313,6 +313,8 @@ void vp8_arch_x86_encoder_init(VP8_COMP *cpi)
cpi->rtcd.variance.sad8x8x8 = vp8_sad8x8x8_sse4; cpi->rtcd.variance.sad8x8x8 = vp8_sad8x8x8_sse4;
cpi->rtcd.variance.sad4x4x8 = vp8_sad4x4x8_sse4; cpi->rtcd.variance.sad4x4x8 = vp8_sad4x4x8_sse4;
cpi->rtcd.search.full_search = vp8_full_search_sadx8; cpi->rtcd.search.full_search = vp8_full_search_sadx8;
cpi->rtcd.quantize.quantb = vp8_regular_quantize_b_sse4;
} }
#endif #endif

Просмотреть файл

@ -153,7 +153,8 @@ static vpx_codec_err_t validate_config(vpx_codec_alg_priv_t *ctx,
RANGE_CHECK_HI(cfg, g_lag_in_frames, 0); RANGE_CHECK_HI(cfg, g_lag_in_frames, 0);
#endif #endif
RANGE_CHECK(cfg, rc_end_usage, VPX_VBR, VPX_CQ); RANGE_CHECK(cfg, rc_end_usage, VPX_VBR, VPX_CQ);
RANGE_CHECK_HI(cfg, rc_undershoot_pct, 100); RANGE_CHECK_HI(cfg, rc_undershoot_pct, 1000);
RANGE_CHECK_HI(cfg, rc_overshoot_pct, 1000);
RANGE_CHECK_HI(cfg, rc_2pass_vbr_bias_pct, 100); RANGE_CHECK_HI(cfg, rc_2pass_vbr_bias_pct, 100);
RANGE_CHECK(cfg, kf_mode, VPX_KF_DISABLED, VPX_KF_AUTO); RANGE_CHECK(cfg, kf_mode, VPX_KF_DISABLED, VPX_KF_AUTO);
//RANGE_CHECK_BOOL(cfg, g_delete_firstpassfile); //RANGE_CHECK_BOOL(cfg, g_delete_firstpassfile);
@ -307,6 +308,7 @@ static vpx_codec_err_t set_vp8e_config(VP8_CONFIG *oxcf,
} }
oxcf->target_bandwidth = cfg.rc_target_bitrate; oxcf->target_bandwidth = cfg.rc_target_bitrate;
oxcf->rc_max_intra_bitrate_pct = cfg.rc_max_intra_bitrate_pct;
oxcf->best_allowed_q = cfg.rc_min_quantizer; oxcf->best_allowed_q = cfg.rc_min_quantizer;
oxcf->worst_allowed_q = cfg.rc_max_quantizer; oxcf->worst_allowed_q = cfg.rc_max_quantizer;
@ -314,7 +316,7 @@ static vpx_codec_err_t set_vp8e_config(VP8_CONFIG *oxcf,
oxcf->fixed_q = -1; oxcf->fixed_q = -1;
oxcf->under_shoot_pct = cfg.rc_undershoot_pct; oxcf->under_shoot_pct = cfg.rc_undershoot_pct;
//oxcf->over_shoot_pct = cfg.rc_overshoot_pct; oxcf->over_shoot_pct = cfg.rc_overshoot_pct;
oxcf->maximum_buffer_size = cfg.rc_buf_sz; oxcf->maximum_buffer_size = cfg.rc_buf_sz;
oxcf->starting_buffer_level = cfg.rc_buf_initial_sz; oxcf->starting_buffer_level = cfg.rc_buf_initial_sz;
@ -360,6 +362,7 @@ static vpx_codec_err_t set_vp8e_config(VP8_CONFIG *oxcf,
printf("key_freq: %d\n", oxcf->key_freq); printf("key_freq: %d\n", oxcf->key_freq);
printf("end_usage: %d\n", oxcf->end_usage); printf("end_usage: %d\n", oxcf->end_usage);
printf("under_shoot_pct: %d\n", oxcf->under_shoot_pct); printf("under_shoot_pct: %d\n", oxcf->under_shoot_pct);
printf("over_shoot_pct: %d\n", oxcf->over_shoot_pct);
printf("starting_buffer_level: %d\n", oxcf->starting_buffer_level); printf("starting_buffer_level: %d\n", oxcf->starting_buffer_level);
printf("optimal_buffer_level: %d\n", oxcf->optimal_buffer_level); printf("optimal_buffer_level: %d\n", oxcf->optimal_buffer_level);
printf("maximum_buffer_size: %d\n", oxcf->maximum_buffer_size); printf("maximum_buffer_size: %d\n", oxcf->maximum_buffer_size);
@ -1105,11 +1108,11 @@ static vpx_codec_enc_cfg_map_t vp8e_usage_cfg_map[] =
{0}, /* rc_twopass_stats_in */ {0}, /* rc_twopass_stats_in */
#endif #endif
256, /* rc_target_bandwidth */ 256, /* rc_target_bandwidth */
0, /* rc_max_intra_bitrate_pct */
4, /* rc_min_quantizer */ 4, /* rc_min_quantizer */
63, /* rc_max_quantizer */ 63, /* rc_max_quantizer */
95, /* rc_undershoot_pct */ 100, /* rc_undershoot_pct */
200, /* rc_overshoot_pct */ 100, /* rc_overshoot_pct */
6000, /* rc_max_buffer_size */ 6000, /* rc_max_buffer_size */
4000, /* rc_buffer_initial_size; */ 4000, /* rc_buffer_initial_size; */

Просмотреть файл

@ -117,6 +117,7 @@ VP8_CX_SRCS-$(HAVE_SSSE3) += encoder/x86/variance_ssse3.c
VP8_CX_SRCS-$(HAVE_SSSE3) += encoder/x86/variance_impl_ssse3.asm VP8_CX_SRCS-$(HAVE_SSSE3) += encoder/x86/variance_impl_ssse3.asm
VP8_CX_SRCS-$(HAVE_SSSE3) += encoder/x86/quantize_ssse3.asm VP8_CX_SRCS-$(HAVE_SSSE3) += encoder/x86/quantize_ssse3.asm
VP8_CX_SRCS-$(HAVE_SSE4_1) += encoder/x86/sad_sse4.asm VP8_CX_SRCS-$(HAVE_SSE4_1) += encoder/x86/sad_sse4.asm
VP8_CX_SRCS-$(HAVE_SSE4_1) += encoder/x86/quantize_sse4.asm
VP8_CX_SRCS-$(ARCH_X86)$(ARCH_X86_64) += encoder/x86/quantize_mmx.asm VP8_CX_SRCS-$(ARCH_X86)$(ARCH_X86_64) += encoder/x86/quantize_mmx.asm
VP8_CX_SRCS-$(ARCH_X86)$(ARCH_X86_64) += encoder/x86/encodeopt.asm VP8_CX_SRCS-$(ARCH_X86)$(ARCH_X86_64) += encoder/x86/encodeopt.asm
VP8_CX_SRCS-$(ARCH_X86_64) += encoder/x86/ssim_opt.asm VP8_CX_SRCS-$(ARCH_X86_64) += encoder/x86/ssim_opt.asm

Просмотреть файл

@ -398,6 +398,21 @@ extern "C" {
unsigned int rc_target_bitrate; unsigned int rc_target_bitrate;
/*!\brief Max data rate for Intra frames
*
* This value controls additional clamping on the maximum size of a
* keyframe. It is expressed as a percentage of the average
* per-frame bitrate, with the special (and default) value 0 meaning
* unlimited, or no additional clamping beyond the codec's built-in
* algorithm.
*
* For example, to allocate no more than 4.5 frames worth of bitrate
* to a keyframe, set this to 450.
*
*/
unsigned int rc_max_intra_bitrate_pct;
/* /*
* quantizer settings * quantizer settings
*/ */
@ -430,20 +445,28 @@ extern "C" {
*/ */
/*!\brief Rate control undershoot tolerance /*!\brief Rate control adaptation undershoot control
* *
* This value, expressed as a percentage of the target bitrate, describes * This value, expressed as a percentage of the target bitrate,
* the target bitrate for easier frames, allowing bits to be saved for * controls the maximum allowed adaptation speed of the codec.
* harder frames. Set to zero to use the codec default. * This factor controls the maximum amount of bits that can
* be subtracted from the target bitrate in order to compensate
* for prior overshoot.
*
* Valid values in the range 0-1000.
*/ */
unsigned int rc_undershoot_pct; unsigned int rc_undershoot_pct;
/*!\brief Rate control overshoot tolerance /*!\brief Rate control adaptation overshoot control
* *
* This value, expressed as a percentage of the target bitrate, describes * This value, expressed as a percentage of the target bitrate,
* the maximum allowed bitrate for a given frame. Set to zero to use the * controls the maximum allowed adaptation speed of the codec.
* codec default. * This factor controls the maximum amount of bits that can
* be added to the target bitrate in order to compensate for
* prior undershoot.
*
* Valid values in the range 0-1000.
*/ */
unsigned int rc_overshoot_pct; unsigned int rc_overshoot_pct;

Просмотреть файл

@ -256,6 +256,16 @@ vpx_fixed_buf_t stats_get(stats_io_t *stats)
return stats->buf; return stats->buf;
} }
/* Stereo 3D packed frame format */
typedef enum stereo_format
{
STEREO_FORMAT_MONO = 0,
STEREO_FORMAT_LEFT_RIGHT = 1,
STEREO_FORMAT_BOTTOM_TOP = 2,
STEREO_FORMAT_TOP_BOTTOM = 3,
STEREO_FORMAT_RIGHT_LEFT = 11
} stereo_format_t;
enum video_file_type enum video_file_type
{ {
FILE_TYPE_RAW, FILE_TYPE_RAW,
@ -606,7 +616,8 @@ write_webm_seek_info(EbmlGlobal *ebml)
static void static void
write_webm_file_header(EbmlGlobal *glob, write_webm_file_header(EbmlGlobal *glob,
const vpx_codec_enc_cfg_t *cfg, const vpx_codec_enc_cfg_t *cfg,
const struct vpx_rational *fps) const struct vpx_rational *fps,
stereo_format_t stereo_fmt)
{ {
{ {
EbmlLoc start; EbmlLoc start;
@ -650,6 +661,7 @@ write_webm_file_header(EbmlGlobal *glob,
Ebml_StartSubElement(glob, &videoStart, Video); Ebml_StartSubElement(glob, &videoStart, Video);
Ebml_SerializeUnsigned(glob, PixelWidth, pixelWidth); Ebml_SerializeUnsigned(glob, PixelWidth, pixelWidth);
Ebml_SerializeUnsigned(glob, PixelHeight, pixelHeight); Ebml_SerializeUnsigned(glob, PixelHeight, pixelHeight);
Ebml_SerializeUnsigned(glob, StereoMode, stereo_fmt);
Ebml_SerializeFloat(glob, FrameRate, frameRate); Ebml_SerializeFloat(glob, FrameRate, frameRate);
Ebml_EndSubElement(glob, &videoStart); //Video Ebml_EndSubElement(glob, &videoStart); //Video
} }
@ -916,6 +928,16 @@ static const arg_def_t width = ARG_DEF("w", "width", 1,
"Frame width"); "Frame width");
static const arg_def_t height = ARG_DEF("h", "height", 1, static const arg_def_t height = ARG_DEF("h", "height", 1,
"Frame height"); "Frame height");
static const struct arg_enum_list stereo_mode_enum[] = {
{"mono" , STEREO_FORMAT_MONO},
{"left-right", STEREO_FORMAT_LEFT_RIGHT},
{"bottom-top", STEREO_FORMAT_BOTTOM_TOP},
{"top-bottom", STEREO_FORMAT_TOP_BOTTOM},
{"right-left", STEREO_FORMAT_RIGHT_LEFT},
{NULL, 0}
};
static const arg_def_t stereo_mode = ARG_DEF_ENUM(NULL, "stereo-mode", 1,
"Stereo 3D video format", stereo_mode_enum);
static const arg_def_t timebase = ARG_DEF(NULL, "timebase", 1, static const arg_def_t timebase = ARG_DEF(NULL, "timebase", 1,
"Stream timebase (frame duration)"); "Stream timebase (frame duration)");
static const arg_def_t error_resilient = ARG_DEF(NULL, "error-resilient", 1, static const arg_def_t error_resilient = ARG_DEF(NULL, "error-resilient", 1,
@ -926,7 +948,7 @@ static const arg_def_t lag_in_frames = ARG_DEF(NULL, "lag-in-frames", 1,
static const arg_def_t *global_args[] = static const arg_def_t *global_args[] =
{ {
&use_yv12, &use_i420, &usage, &threads, &profile, &use_yv12, &use_i420, &usage, &threads, &profile,
&width, &height, &timebase, &framerate, &error_resilient, &width, &height, &stereo_mode, &timebase, &framerate, &error_resilient,
&lag_in_frames, NULL &lag_in_frames, NULL
}; };
@ -962,11 +984,14 @@ static const arg_def_t buf_initial_sz = ARG_DEF(NULL, "buf-initial-sz", 1,
"Client initial buffer size (ms)"); "Client initial buffer size (ms)");
static const arg_def_t buf_optimal_sz = ARG_DEF(NULL, "buf-optimal-sz", 1, static const arg_def_t buf_optimal_sz = ARG_DEF(NULL, "buf-optimal-sz", 1,
"Client optimal buffer size (ms)"); "Client optimal buffer size (ms)");
static const arg_def_t max_intra_rate_pct = ARG_DEF(NULL, "max-intra-rate", 1,
"Max I-frame bitrate (pct)");
static const arg_def_t *rc_args[] = static const arg_def_t *rc_args[] =
{ {
&dropframe_thresh, &resize_allowed, &resize_up_thresh, &resize_down_thresh, &dropframe_thresh, &resize_allowed, &resize_up_thresh, &resize_down_thresh,
&end_usage, &target_bitrate, &min_quantizer, &max_quantizer, &end_usage, &target_bitrate, &min_quantizer, &max_quantizer,
&undershoot_pct, &overshoot_pct, &buf_sz, &buf_initial_sz, &buf_optimal_sz, &undershoot_pct, &overshoot_pct, &buf_sz, &buf_initial_sz, &buf_optimal_sz,
&max_intra_rate_pct,
NULL NULL
}; };
@ -1084,7 +1109,6 @@ static void usage_exit()
#define ARG_CTRL_CNT_MAX 10 #define ARG_CTRL_CNT_MAX 10
int main(int argc, const char **argv_) int main(int argc, const char **argv_)
{ {
vpx_codec_ctx_t encoder; vpx_codec_ctx_t encoder;
@ -1120,6 +1144,7 @@ int main(int argc, const char **argv_)
uint64_t psnr_samples_total = 0; uint64_t psnr_samples_total = 0;
double psnr_totals[4] = {0, 0, 0, 0}; double psnr_totals[4] = {0, 0, 0, 0};
int psnr_count = 0; int psnr_count = 0;
stereo_format_t stereo_fmt = STEREO_FORMAT_MONO;
exec_name = argv_[0]; exec_name = argv_[0];
ebml.last_pts_ms = -1; ebml.last_pts_ms = -1;
@ -1259,6 +1284,8 @@ int main(int argc, const char **argv_)
cfg.g_w = arg_parse_uint(&arg); cfg.g_w = arg_parse_uint(&arg);
else if (arg_match(&arg, &height, argi)) else if (arg_match(&arg, &height, argi))
cfg.g_h = arg_parse_uint(&arg); cfg.g_h = arg_parse_uint(&arg);
else if (arg_match(&arg, &stereo_mode, argi))
stereo_fmt = arg_parse_enum_or_int(&arg);
else if (arg_match(&arg, &timebase, argi)) else if (arg_match(&arg, &timebase, argi))
cfg.g_timebase = arg_parse_rational(&arg); cfg.g_timebase = arg_parse_rational(&arg);
else if (arg_match(&arg, &error_resilient, argi)) else if (arg_match(&arg, &error_resilient, argi))
@ -1279,6 +1306,8 @@ int main(int argc, const char **argv_)
cfg.rc_end_usage = arg_parse_enum_or_int(&arg); cfg.rc_end_usage = arg_parse_enum_or_int(&arg);
else if (arg_match(&arg, &target_bitrate, argi)) else if (arg_match(&arg, &target_bitrate, argi))
cfg.rc_target_bitrate = arg_parse_uint(&arg); cfg.rc_target_bitrate = arg_parse_uint(&arg);
else if (arg_match(&arg, &max_intra_rate_pct, argi))
cfg.rc_max_intra_bitrate_pct = arg_parse_uint(&arg);
else if (arg_match(&arg, &min_quantizer, argi)) else if (arg_match(&arg, &min_quantizer, argi))
cfg.rc_min_quantizer = arg_parse_uint(&arg); cfg.rc_min_quantizer = arg_parse_uint(&arg);
else if (arg_match(&arg, &max_quantizer, argi)) else if (arg_match(&arg, &max_quantizer, argi))
@ -1557,7 +1586,7 @@ int main(int argc, const char **argv_)
if(write_webm) if(write_webm)
{ {
ebml.stream = outfile; ebml.stream = outfile;
write_webm_file_header(&ebml, &cfg, &arg_framerate); write_webm_file_header(&ebml, &cfg, &arg_framerate, stereo_fmt);
} }
else else
write_ivf_file_header(outfile, &cfg, codec->fourcc, 0); write_ivf_file_header(outfile, &cfg, codec->fourcc, 0);