Merge remote branch 'origin/master' into experimental
Change-Id: I1e7ce466bc01e380eb392b964ba677f0bb8cd13b
This commit is contained in:
@@ -2016,13 +2016,13 @@ VP8_PTR vp8_create_compressor(VP8_CONFIG *oxcf)
|
|||||||
cpi->total_ssimg_all = 0;
|
cpi->total_ssimg_all = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef LLONG_MAX
|
#ifndef LLONG_MAX
|
||||||
#define LLONG_MAX 9223372036854775807LL
|
#define LLONG_MAX 9223372036854775807LL
|
||||||
#endif
|
#endif
|
||||||
cpi->first_time_stamp_ever = LLONG_MAX;
|
cpi->first_time_stamp_ever = LLONG_MAX;
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
cpi->frames_till_gf_update_due = 0;
|
cpi->frames_till_gf_update_due = 0;
|
||||||
cpi->key_frame_count = 1;
|
cpi->key_frame_count = 1;
|
||||||
|
|
||||||
|
|||||||
@@ -71,7 +71,10 @@ int vp8_skip_fractional_mv_step(MACROBLOCK *mb, BLOCK *b, BLOCKD *d,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int get_inter_mbpred_error(MACROBLOCK *mb, const vp8_variance_fn_ptr_t *vfp, unsigned int *sse)
|
static int get_inter_mbpred_error(MACROBLOCK *mb,
|
||||||
|
const vp8_variance_fn_ptr_t *vfp,
|
||||||
|
unsigned int *sse,
|
||||||
|
int_mv this_mv)
|
||||||
{
|
{
|
||||||
|
|
||||||
BLOCK *b = &mb->block[0];
|
BLOCK *b = &mb->block[0];
|
||||||
@@ -80,10 +83,10 @@ static int get_inter_mbpred_error(MACROBLOCK *mb, const vp8_variance_fn_ptr_t *v
|
|||||||
int what_stride = b->src_stride;
|
int what_stride = b->src_stride;
|
||||||
unsigned char *in_what = *(d->base_pre) + d->pre ;
|
unsigned char *in_what = *(d->base_pre) + d->pre ;
|
||||||
int in_what_stride = d->pre_stride;
|
int in_what_stride = d->pre_stride;
|
||||||
int xoffset = d->bmi.mv.as_mv.col & 7;
|
int xoffset = this_mv.as_mv.col & 7;
|
||||||
int yoffset = d->bmi.mv.as_mv.row & 7;
|
int yoffset = this_mv.as_mv.row & 7;
|
||||||
|
|
||||||
in_what += (d->bmi.mv.as_mv.row >> 3) * d->pre_stride + (d->bmi.mv.as_mv.col >> 3);
|
in_what += (this_mv.as_mv.row >> 3) * d->pre_stride + (this_mv.as_mv.col >> 3);
|
||||||
|
|
||||||
if (xoffset | yoffset)
|
if (xoffset | yoffset)
|
||||||
{
|
{
|
||||||
@@ -833,13 +836,14 @@ void vp8_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset,
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
rate2 += vp8_cost_mv_ref(this_mode, mdcounts);
|
rate2 += vp8_cost_mv_ref(this_mode, mdcounts);
|
||||||
x->e_mbd.mode_info_context->mbmi.mode = this_mode;
|
x->e_mbd.mode_info_context->mbmi.mv.as_int =
|
||||||
x->e_mbd.mode_info_context->mbmi.mv.as_mv = mode_mv[this_mode].as_mv;
|
mode_mv[this_mode].as_int;
|
||||||
x->e_mbd.block[0].bmi.mode = this_mode;
|
|
||||||
x->e_mbd.block[0].bmi.mv.as_int = x->e_mbd.mode_info_context->mbmi.mv.as_int;
|
|
||||||
|
|
||||||
if((this_mode != NEWMV) || !(have_subp_search) || cpi->common.full_pixel==1)
|
if((this_mode != NEWMV) ||
|
||||||
distortion2 = get_inter_mbpred_error(x, &cpi->fn_ptr[BLOCK_16X16], &sse);
|
!(have_subp_search) || cpi->common.full_pixel==1)
|
||||||
|
distortion2 = get_inter_mbpred_error(x,
|
||||||
|
&cpi->fn_ptr[BLOCK_16X16],
|
||||||
|
&sse, mode_mv[this_mode]);
|
||||||
|
|
||||||
this_rd = RDCOST(x->rdmult, x->rddiv, rate2, distortion2);
|
this_rd = RDCOST(x->rdmult, x->rddiv, rate2, distortion2);
|
||||||
|
|
||||||
@@ -883,10 +887,6 @@ void vp8_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset,
|
|||||||
{
|
{
|
||||||
vpx_memcpy(&best_bmodes[i], &x->e_mbd.block[i].bmi, sizeof(B_MODE_INFO));
|
vpx_memcpy(&best_bmodes[i], &x->e_mbd.block[i].bmi, sizeof(B_MODE_INFO));
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
best_bmodes[0].mv = x->e_mbd.block[0].bmi.mv;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Testing this mode gave rise to an improvement in best error score. Lower threshold a bit for next time
|
// Testing this mode gave rise to an improvement in best error score. Lower threshold a bit for next time
|
||||||
cpi->rd_thresh_mult[mode_index] = (cpi->rd_thresh_mult[mode_index] >= (MIN_THRESHMULT + 2)) ? cpi->rd_thresh_mult[mode_index] - 2 : MIN_THRESHMULT;
|
cpi->rd_thresh_mult[mode_index] = (cpi->rd_thresh_mult[mode_index] >= (MIN_THRESHMULT + 2)) ? cpi->rd_thresh_mult[mode_index] - 2 : MIN_THRESHMULT;
|
||||||
@@ -917,13 +917,6 @@ void vp8_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset,
|
|||||||
cpi->rd_threshes[best_mode_index] = (cpi->rd_baseline_thresh[best_mode_index] >> 7) * cpi->rd_thresh_mult[best_mode_index];
|
cpi->rd_threshes[best_mode_index] = (cpi->rd_baseline_thresh[best_mode_index] >> 7) * cpi->rd_thresh_mult[best_mode_index];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (best_mbmode.mode <= B_PRED)
|
|
||||||
{
|
|
||||||
x->e_mbd.mode_info_context->mbmi.ref_frame = INTRA_FRAME;
|
|
||||||
vp8_pick_intra_mbuv_mode(x);
|
|
||||||
best_mbmode.uv_mode = x->e_mbd.mode_info_context->mbmi.uv_mode;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
int this_rdbin = (*returndistortion >> 7);
|
int this_rdbin = (*returndistortion >> 7);
|
||||||
@@ -936,40 +929,34 @@ void vp8_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset,
|
|||||||
cpi->error_bins[this_rdbin] ++;
|
cpi->error_bins[this_rdbin] ++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (cpi->is_src_frame_alt_ref &&
|
||||||
if (cpi->is_src_frame_alt_ref && (best_mbmode.mode != ZEROMV || best_mbmode.ref_frame != ALTREF_FRAME))
|
(best_mbmode.mode != ZEROMV || best_mbmode.ref_frame != ALTREF_FRAME))
|
||||||
{
|
{
|
||||||
best_mbmode.mode = ZEROMV;
|
x->e_mbd.mode_info_context->mbmi.mode = ZEROMV;
|
||||||
best_mbmode.ref_frame = ALTREF_FRAME;
|
x->e_mbd.mode_info_context->mbmi.ref_frame = ALTREF_FRAME;
|
||||||
best_mbmode.mv.as_int = 0;
|
|
||||||
best_mbmode.uv_mode = 0;
|
|
||||||
best_mbmode.mb_skip_coeff = (cpi->common.mb_no_coeff_skip) ? 1 : 0;
|
|
||||||
best_mbmode.partitioning = 0;
|
|
||||||
|
|
||||||
vpx_memcpy(&x->e_mbd.mode_info_context->mbmi, &best_mbmode, sizeof(MB_MODE_INFO));
|
|
||||||
|
|
||||||
for (i = 0; i < 16; i++)
|
|
||||||
{
|
|
||||||
vpx_memset(&x->e_mbd.block[i].bmi, 0, sizeof(B_MODE_INFO));
|
|
||||||
}
|
|
||||||
|
|
||||||
x->e_mbd.mode_info_context->mbmi.mv.as_int = 0;
|
x->e_mbd.mode_info_context->mbmi.mv.as_int = 0;
|
||||||
|
x->e_mbd.mode_info_context->mbmi.uv_mode = DC_PRED;
|
||||||
|
x->e_mbd.mode_info_context->mbmi.mb_skip_coeff =
|
||||||
|
(cpi->common.mb_no_coeff_skip) ? 1 : 0;
|
||||||
|
x->e_mbd.mode_info_context->mbmi.partitioning = 0;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// macroblock modes
|
/* set to the best mb mode */
|
||||||
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));
|
||||||
|
|
||||||
|
if (best_mbmode.mode <= B_PRED)
|
||||||
|
{
|
||||||
|
/* set mode_info_context->mbmi.uv_mode */
|
||||||
|
vp8_pick_intra_mbuv_mode(x);
|
||||||
|
}
|
||||||
|
|
||||||
if (x->e_mbd.mode_info_context->mbmi.mode <= B_PRED)
|
if (x->e_mbd.mode_info_context->mbmi.mode == B_PRED)
|
||||||
for (i = 0; i < 16; i++)
|
for (i = 0; i < 16; i++)
|
||||||
{
|
{
|
||||||
x->e_mbd.block[i].bmi.mode = best_bmodes[i].mode;
|
x->e_mbd.block[i].bmi.mode = best_bmodes[i].mode;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
vp8_set_mbmode_and_mvs(x, x->e_mbd.mode_info_context->mbmi.mode, &best_bmodes[0].mv);
|
|
||||||
}
|
|
||||||
|
|
||||||
update_mvcount(cpi, &x->e_mbd, &frame_best_ref_mv[xd->mode_info_context->mbmi.ref_frame]);
|
update_mvcount(cpi, &x->e_mbd, &frame_best_ref_mv[xd->mode_info_context->mbmi.ref_frame]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2440,27 +2440,21 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int
|
|||||||
cpi->mode_chosen_counts[best_mode_index] ++;
|
cpi->mode_chosen_counts[best_mode_index] ++;
|
||||||
|
|
||||||
|
|
||||||
if (cpi->is_src_frame_alt_ref && (best_mbmode.mode != ZEROMV || best_mbmode.ref_frame != ALTREF_FRAME))
|
if (cpi->is_src_frame_alt_ref &&
|
||||||
|
(best_mbmode.mode != ZEROMV || best_mbmode.ref_frame != ALTREF_FRAME))
|
||||||
{
|
{
|
||||||
best_mbmode.mode = ZEROMV;
|
x->e_mbd.mode_info_context->mbmi.mode = ZEROMV;
|
||||||
best_mbmode.ref_frame = ALTREF_FRAME;
|
x->e_mbd.mode_info_context->mbmi.ref_frame = ALTREF_FRAME;
|
||||||
best_mbmode.mv.as_int = 0;
|
|
||||||
best_mbmode.uv_mode = 0;
|
|
||||||
best_mbmode.mb_skip_coeff = (cpi->common.mb_no_coeff_skip) ? 1 : 0;
|
|
||||||
best_mbmode.partitioning = 0;
|
|
||||||
|
|
||||||
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));
|
|
||||||
|
|
||||||
for (i = 0; i < 16; i++)
|
|
||||||
{
|
|
||||||
vpx_memset(&x->e_mbd.block[i].bmi, 0, sizeof(B_MODE_INFO));
|
|
||||||
}
|
|
||||||
|
|
||||||
x->e_mbd.mode_info_context->mbmi.mv.as_int = 0;
|
x->e_mbd.mode_info_context->mbmi.mv.as_int = 0;
|
||||||
|
x->e_mbd.mode_info_context->mbmi.uv_mode = DC_PRED;
|
||||||
|
x->e_mbd.mode_info_context->mbmi.mb_skip_coeff =
|
||||||
|
(cpi->common.mb_no_coeff_skip) ? 1 : 0;
|
||||||
|
x->e_mbd.mode_info_context->mbmi.partitioning = 0;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// macroblock modes
|
// macroblock modes
|
||||||
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));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user