Merge remote branch 'origin/master' into experimental
Conflicts: vp8/encoder/rdopt.c Use new constant (110) from 10ed60dc7 Change-Id: Ic7d8a45ccc8deeeb94a0ab1c58d5d052ef3c27e4
This commit is contained in:
commit
786246ebf1
@ -81,11 +81,14 @@ static int vp8dx_decode_bool(BOOL_DECODER *br, int probability) {
|
||||
int count;
|
||||
unsigned int range;
|
||||
|
||||
split = 1 + (((br->range - 1) * probability) >> 8);
|
||||
|
||||
if(br->count < 0)
|
||||
vp8dx_bool_decoder_fill(br);
|
||||
|
||||
value = br->value;
|
||||
count = br->count;
|
||||
range = br->range;
|
||||
|
||||
split = 1 + (((range - 1) * probability) >> 8);
|
||||
bigsplit = (VP8_BD_VALUE)split << (VP8_BD_VALUE_SIZE - 8);
|
||||
|
||||
range = split;
|
||||
@ -106,8 +109,7 @@ static int vp8dx_decode_bool(BOOL_DECODER *br, int probability) {
|
||||
br->value = value;
|
||||
br->count = count;
|
||||
br->range = range;
|
||||
if(count < 0)
|
||||
vp8dx_bool_decoder_fill(br);
|
||||
|
||||
return bit;
|
||||
}
|
||||
|
||||
|
@ -335,7 +335,8 @@ void vp8_activity_masking(VP8_COMP *cpi, MACROBLOCK *x)
|
||||
{
|
||||
#if USE_ACT_INDEX
|
||||
x->rdmult += *(x->mb_activity_ptr) * (x->rdmult >> 2);
|
||||
x->errorperbit = x->rdmult/x->rddiv;
|
||||
x->errorperbit = x->rdmult * 100 /(110 * x->rddiv);
|
||||
x->errorperbit += (x->errorperbit==0);
|
||||
#else
|
||||
INT64 a;
|
||||
INT64 b;
|
||||
@ -346,8 +347,8 @@ void vp8_activity_masking(VP8_COMP *cpi, MACROBLOCK *x)
|
||||
b = (2*act) + cpi->activity_avg;
|
||||
|
||||
x->rdmult = (unsigned int)(((INT64)x->rdmult*b + (a>>1))/a);
|
||||
x->errorperbit = x->rdmult/x->rddiv;
|
||||
|
||||
x->errorperbit = x->rdmult * 100 /(110 * x->rddiv);
|
||||
x->errorperbit += (x->errorperbit==0);
|
||||
#endif
|
||||
|
||||
// Activity based Zbin adjustment
|
||||
|
@ -317,17 +317,6 @@ int vp8_find_best_sub_pixel_step(MACROBLOCK *x, BLOCK *b, BLOCKD *d,
|
||||
int whichdir ;
|
||||
int thismse;
|
||||
|
||||
|
||||
// Trap uncodable vectors
|
||||
if ((abs((bestmv->as_mv.col << 3) - ref_mv->as_mv.col) > MAX_FULL_PEL_VAL)
|
||||
|| (abs((bestmv->as_mv.row << 3) - ref_mv->as_mv.row) > MAX_FULL_PEL_VAL))
|
||||
{
|
||||
bestmv->as_mv.row <<= 3;
|
||||
bestmv->as_mv.col <<= 3;
|
||||
*distortion = INT_MAX;
|
||||
return INT_MAX;
|
||||
}
|
||||
|
||||
// central mv
|
||||
bestmv->as_mv.row <<= 3;
|
||||
bestmv->as_mv.col <<= 3;
|
||||
@ -628,16 +617,6 @@ int vp8_find_best_half_pixel_step(MACROBLOCK *mb, BLOCK *b, BLOCKD *d,
|
||||
unsigned int sse;
|
||||
int thismse;
|
||||
|
||||
// Trap uncodable vectors
|
||||
if ((abs((bestmv->as_mv.col << 3) - ref_mv->as_mv.col) > MAX_FULL_PEL_VAL)
|
||||
|| (abs((bestmv->as_mv.row << 3) - ref_mv->as_mv.row) > MAX_FULL_PEL_VAL))
|
||||
{
|
||||
bestmv->as_mv.row <<= 3;
|
||||
bestmv->as_mv.col <<= 3;
|
||||
*distortion = INT_MAX;
|
||||
return INT_MAX;
|
||||
}
|
||||
|
||||
// central mv
|
||||
bestmv->as_mv.row <<= 3;
|
||||
bestmv->as_mv.col <<= 3;
|
||||
@ -1055,15 +1034,10 @@ int vp8_diamond_search_sad
|
||||
in_what = (unsigned char *)(*(d->base_pre) + d->pre + (ref_row * (d->pre_stride)) + ref_col);
|
||||
best_address = in_what;
|
||||
|
||||
// We need to check that the starting point for the search (as indicated by ref_mv) is within the buffer limits
|
||||
if ((ref_col > x->mv_col_min) && (ref_col < x->mv_col_max) &&
|
||||
(ref_row > x->mv_row_min) && (ref_row < x->mv_row_max))
|
||||
{
|
||||
// Check the starting position
|
||||
bestsad = fn_ptr->sdf(what, what_stride, in_what,
|
||||
in_what_stride, 0x7fffffff)
|
||||
+ mvsad_err_cost(best_mv, &fcenter_mv, mvsadcost, sad_per_bit);
|
||||
}
|
||||
// Check the starting position
|
||||
bestsad = fn_ptr->sdf(what, what_stride, in_what,
|
||||
in_what_stride, 0x7fffffff)
|
||||
+ mvsad_err_cost(best_mv, &fcenter_mv, mvsadcost, sad_per_bit);
|
||||
|
||||
// search_param determines the length of the initial step and hence the number of iterations
|
||||
// 0 = initial step (MAX_FIRST_STEP) pel : 1 = (MAX_FIRST_STEP/2) pel, 2 = (MAX_FIRST_STEP/4) pel... etc.
|
||||
@ -1178,15 +1152,10 @@ int vp8_diamond_search_sadx4
|
||||
in_what = (unsigned char *)(*(d->base_pre) + d->pre + (ref_row * (d->pre_stride)) + ref_col);
|
||||
best_address = in_what;
|
||||
|
||||
// We need to check that the starting point for the search (as indicated by ref_mv) is within the buffer limits
|
||||
if ((ref_col > x->mv_col_min) && (ref_col < x->mv_col_max) &&
|
||||
(ref_row > x->mv_row_min) && (ref_row < x->mv_row_max))
|
||||
{
|
||||
// Check the starting position
|
||||
bestsad = fn_ptr->sdf(what, what_stride,
|
||||
in_what, in_what_stride, 0x7fffffff)
|
||||
+ mvsad_err_cost(best_mv, &fcenter_mv, mvsadcost, sad_per_bit);
|
||||
}
|
||||
// Check the starting position
|
||||
bestsad = fn_ptr->sdf(what, what_stride,
|
||||
in_what, in_what_stride, 0x7fffffff)
|
||||
+ mvsad_err_cost(best_mv, &fcenter_mv, mvsadcost, sad_per_bit);
|
||||
|
||||
// search_param determines the length of the initial step and hence the number of iterations
|
||||
// 0 = initial step (MAX_FIRST_STEP) pel : 1 = (MAX_FIRST_STEP/2) pel, 2 = (MAX_FIRST_STEP/4) pel... etc.
|
||||
@ -1329,17 +1298,10 @@ int vp8_full_search_sad(MACROBLOCK *x, BLOCK *b, BLOCKD *d, int_mv *ref_mv,
|
||||
best_mv->as_mv.row = ref_row;
|
||||
best_mv->as_mv.col = ref_col;
|
||||
|
||||
// We need to check that the starting point for the search (as indicated by ref_mv) is within the buffer limits
|
||||
if ((ref_col > x->mv_col_min) && (ref_col < x->mv_col_max) &&
|
||||
(ref_row > x->mv_row_min) && (ref_row < x->mv_row_max))
|
||||
{
|
||||
// Baseline value at the centre
|
||||
|
||||
//bestsad = fn_ptr->sf( what,what_stride,bestaddress,in_what_stride) + (int)sqrt(mv_err_cost(ref_mv,ref_mv, mvcost,error_per_bit*14));
|
||||
bestsad = fn_ptr->sdf(what, what_stride, bestaddress,
|
||||
in_what_stride, 0x7fffffff)
|
||||
+ mvsad_err_cost(best_mv, &fcenter_mv, mvsadcost, sad_per_bit);
|
||||
}
|
||||
// Baseline value at the centre
|
||||
bestsad = fn_ptr->sdf(what, what_stride, bestaddress,
|
||||
in_what_stride, 0x7fffffff)
|
||||
+ mvsad_err_cost(best_mv, &fcenter_mv, mvsadcost, sad_per_bit);
|
||||
|
||||
// Apply further limits to prevent us looking using vectors that stretch beyiond the UMV border
|
||||
if (col_min < x->mv_col_min)
|
||||
@ -1430,15 +1392,10 @@ int vp8_full_search_sadx3(MACROBLOCK *x, BLOCK *b, BLOCKD *d, int_mv *ref_mv,
|
||||
best_mv->as_mv.row = ref_row;
|
||||
best_mv->as_mv.col = ref_col;
|
||||
|
||||
// We need to check that the starting point for the search (as indicated by ref_mv) is within the buffer limits
|
||||
if ((ref_col > x->mv_col_min) && (ref_col < x->mv_col_max) &&
|
||||
(ref_row > x->mv_row_min) && (ref_row < x->mv_row_max))
|
||||
{
|
||||
// Baseline value at the centre
|
||||
bestsad = fn_ptr->sdf(what, what_stride,
|
||||
bestaddress, in_what_stride, 0x7fffffff)
|
||||
+ mvsad_err_cost(best_mv, &fcenter_mv, mvsadcost, sad_per_bit);
|
||||
}
|
||||
// Baseline value at the centre
|
||||
bestsad = fn_ptr->sdf(what, what_stride,
|
||||
bestaddress, in_what_stride, 0x7fffffff)
|
||||
+ mvsad_err_cost(best_mv, &fcenter_mv, mvsadcost, sad_per_bit);
|
||||
|
||||
// Apply further limits to prevent us looking using vectors that stretch beyiond the UMV border
|
||||
if (col_min < x->mv_col_min)
|
||||
@ -1566,15 +1523,10 @@ int vp8_full_search_sadx8(MACROBLOCK *x, BLOCK *b, BLOCKD *d, int_mv *ref_mv,
|
||||
best_mv->as_mv.row = ref_row;
|
||||
best_mv->as_mv.col = ref_col;
|
||||
|
||||
// We need to check that the starting point for the search (as indicated by ref_mv) is within the buffer limits
|
||||
if ((ref_col > x->mv_col_min) && (ref_col < x->mv_col_max) &&
|
||||
(ref_row > x->mv_row_min) && (ref_row < x->mv_row_max))
|
||||
{
|
||||
// Baseline value at the centre
|
||||
bestsad = fn_ptr->sdf(what, what_stride,
|
||||
bestaddress, in_what_stride, 0x7fffffff)
|
||||
+ mvsad_err_cost(best_mv, &fcenter_mv, mvsadcost, sad_per_bit);
|
||||
}
|
||||
// Baseline value at the centre
|
||||
bestsad = fn_ptr->sdf(what, what_stride,
|
||||
bestaddress, in_what_stride, 0x7fffffff)
|
||||
+ mvsad_err_cost(best_mv, &fcenter_mv, mvsadcost, sad_per_bit);
|
||||
|
||||
// Apply further limits to prevent us looking using vectors that stretch beyiond the UMV border
|
||||
if (col_min < x->mv_col_min)
|
||||
|
@ -290,7 +290,7 @@ void vp8_initialize_rd_consts(VP8_COMP *cpi, int QIndex)
|
||||
if (cpi->RDMULT < 7)
|
||||
cpi->RDMULT = 7;
|
||||
#endif
|
||||
cpi->mb.errorperbit = (cpi->RDMULT / 100);
|
||||
cpi->mb.errorperbit = (cpi->RDMULT / 110);
|
||||
cpi->mb.errorperbit += (cpi->mb.errorperbit==0);
|
||||
|
||||
#if CONFIG_EXTEND_QRANGE
|
||||
|
Loading…
x
Reference in New Issue
Block a user