vp8e - static threshold play
Realized no need for new assembly code sum is already calculated. Change-Id: Ie2d94feb4b7c1f77c5359bca29b66228e41638c9
This commit is contained in:
parent
d283d9bb30
commit
718c19711a
@ -324,8 +324,15 @@ void vp8_dealloc_compressor_data(VP8_COMP *cpi)
|
|||||||
|
|
||||||
cpi->mb.pip = 0;
|
cpi->mb.pip = 0;
|
||||||
|
|
||||||
|
if(cpi->total_stats)
|
||||||
vpx_free(cpi->total_stats);
|
vpx_free(cpi->total_stats);
|
||||||
|
|
||||||
|
cpi->total_stats = 0;
|
||||||
|
|
||||||
|
if(cpi->this_frame_stats)
|
||||||
vpx_free(cpi->this_frame_stats);
|
vpx_free(cpi->this_frame_stats);
|
||||||
|
|
||||||
|
cpi->this_frame_stats = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void enable_segmentation(VP8_PTR ptr)
|
static void enable_segmentation(VP8_PTR ptr)
|
||||||
@ -1326,6 +1333,9 @@ static void alloc_raw_frame_buffers(VP8_COMP *cpi)
|
|||||||
|
|
||||||
static int vp8_alloc_partition_data(VP8_COMP *cpi)
|
static int vp8_alloc_partition_data(VP8_COMP *cpi)
|
||||||
{
|
{
|
||||||
|
if(cpi->mb.pip)
|
||||||
|
vpx_free(cpi->mb.pip);
|
||||||
|
|
||||||
cpi->mb.pip = vpx_calloc((cpi->common.mb_cols + 1) *
|
cpi->mb.pip = vpx_calloc((cpi->common.mb_cols + 1) *
|
||||||
(cpi->common.mb_rows + 1),
|
(cpi->common.mb_rows + 1),
|
||||||
sizeof(PARTITION_INFO));
|
sizeof(PARTITION_INFO));
|
||||||
@ -1393,8 +1403,16 @@ void vp8_alloc_compressor_data(VP8_COMP *cpi)
|
|||||||
|
|
||||||
cpi->gf_active_count = cm->mb_rows * cm->mb_cols;
|
cpi->gf_active_count = cm->mb_rows * cm->mb_cols;
|
||||||
|
|
||||||
|
if(cpi->total_stats)
|
||||||
|
vpx_free(cpi->total_stats);
|
||||||
|
|
||||||
cpi->total_stats = vpx_calloc(1, vp8_firstpass_stats_sz(cpi->common.MBs));
|
cpi->total_stats = vpx_calloc(1, vp8_firstpass_stats_sz(cpi->common.MBs));
|
||||||
|
|
||||||
|
if(cpi->this_frame_stats)
|
||||||
|
vpx_free(cpi->this_frame_stats);
|
||||||
|
|
||||||
cpi->this_frame_stats = vpx_calloc(1, vp8_firstpass_stats_sz(cpi->common.MBs));
|
cpi->this_frame_stats = vpx_calloc(1, vp8_firstpass_stats_sz(cpi->common.MBs));
|
||||||
|
|
||||||
if(!cpi->total_stats || !cpi->this_frame_stats)
|
if(!cpi->total_stats || !cpi->this_frame_stats)
|
||||||
vpx_internal_error(&cpi->common.error, VPX_CODEC_MEM_ERROR,
|
vpx_internal_error(&cpi->common.error, VPX_CODEC_MEM_ERROR,
|
||||||
"Failed to allocate firstpass stats");
|
"Failed to allocate firstpass stats");
|
||||||
|
@ -2200,8 +2200,7 @@ int vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int
|
|||||||
vp8_build_inter_predictors_mby(&x->e_mbd);
|
vp8_build_inter_predictors_mby(&x->e_mbd);
|
||||||
VARIANCE_INVOKE(&cpi->rtcd.variance, get16x16var)(x->src.y_buffer, x->src.y_stride, x->e_mbd.predictor, 16, (unsigned int *)(&sse), &sum);
|
VARIANCE_INVOKE(&cpi->rtcd.variance, get16x16var)(x->src.y_buffer, x->src.y_stride, x->e_mbd.predictor, 16, (unsigned int *)(&sse), &sum);
|
||||||
|
|
||||||
if (cpi->active_map_enabled && x->active_ptr[0] == 0)
|
if (cpi->active_map_enabled && x->active_ptr[0] == 0) {
|
||||||
{
|
|
||||||
x->skip = 1;
|
x->skip = 1;
|
||||||
}
|
}
|
||||||
else if (sse < x->encode_breakout)
|
else if (sse < x->encode_breakout)
|
||||||
@ -2209,6 +2208,9 @@ int vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int
|
|||||||
// Check u and v to make sure skip is ok
|
// Check u and v to make sure skip is ok
|
||||||
int sse2 = 0;
|
int sse2 = 0;
|
||||||
|
|
||||||
|
// add dc check
|
||||||
|
if (abs(sum) < (cpi->common.Y2dequant[0][0] << 2))
|
||||||
|
{
|
||||||
sse2 = VP8_UVSSE(x, IF_RTCD(&cpi->rtcd.variance));
|
sse2 = VP8_UVSSE(x, IF_RTCD(&cpi->rtcd.variance));
|
||||||
|
|
||||||
if (sse2 * 2 < x->encode_breakout)
|
if (sse2 * 2 < x->encode_breakout)
|
||||||
@ -2216,14 +2218,13 @@ int vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int
|
|||||||
x->skip = 1;
|
x->skip = 1;
|
||||||
distortion2 = sse;
|
distortion2 = sse;
|
||||||
rate2 = 500;
|
rate2 = 500;
|
||||||
|
disable_skip = 1;
|
||||||
|
this_rd = RDFUNC(x->rdmult, x->rddiv, rate2,
|
||||||
|
distortion2, cpi->target_bits_per_mb);
|
||||||
|
|
||||||
disable_skip = 1; // We have no real rate data so trying to adjust for rate_y and rate_uv below will cause problems.
|
break;
|
||||||
this_rd = RDFUNC(x->rdmult, x->rddiv, rate2, distortion2, cpi->target_bits_per_mb);
|
}
|
||||||
|
|
||||||
break; // (PGW) Move break here from below - for now at least
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
x->skip = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//intermodecost[mode_index] = vp8_cost_mv_ref(this_mode, mdcounts); // Experimental debug code
|
//intermodecost[mode_index] = vp8_cost_mv_ref(this_mode, mdcounts); // Experimental debug code
|
||||||
|
Loading…
Reference in New Issue
Block a user