From 0c917fc9755108887901bc0ea44e1952de8a2c65 Mon Sep 17 00:00:00 2001 From: Deb Mukherjee Date: Wed, 7 Nov 2012 06:50:25 -0800 Subject: Compound inter-intra experiment A patch on compound inter-intra prediction. In compound inter-intra prediction, a new predictor for 16x16 inter coded MBs are obtained by combining a single inter predictor with a 16x16 intra predictor, in a manner that the weight varies with distance from the top/left boundary. The current search strategy is to combine the best inter mode with the best intra mode obtained independently. Results so far: derf +0.31% yt +0.32% std-hd +0.35% hd +0.42% It is conceivable that the results would improve somewhat with a more thorough search strategy where all intra modes are searched given the best mv, or even a joint search for the best mv and the best intra mode. Change-Id: I7951f1ed0d6eb31ca32ac24d120f1585bcd8d79b --- vp9/encoder/encodeframe.c | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'vp9/encoder/encodeframe.c') diff --git a/vp9/encoder/encodeframe.c b/vp9/encoder/encodeframe.c index 98e03d6f7..b91cd04a2 100644 --- a/vp9/encoder/encodeframe.c +++ b/vp9/encoder/encodeframe.c @@ -578,6 +578,20 @@ static void update_state(VP9_COMP *cpi, MACROBLOCK *x, mbmi->best_second_mv.as_int = best_second_mv.as_int; vp9_update_nmv_count(cpi, x, &best_mv, &best_second_mv); } +#if CONFIG_COMP_INTERINTRA_PRED + if (mbmi->mode >= NEARESTMV && mbmi->mode < SPLITMV && + mbmi->second_ref_frame <= INTRA_FRAME) { + if (mbmi->second_ref_frame == INTRA_FRAME) { + ++cpi->interintra_count[1]; + ++cpi->ymode_count[mbmi->interintra_mode]; +#if SEPARATE_INTERINTRA_UV + ++cpi->y_uv_mode_count[mbmi->interintra_mode][mbmi->interintra_uv_mode]; +#endif + } else { + ++cpi->interintra_count[0]; + } + } +#endif cpi->prediction_error += ctx->distortion; cpi->intra_error += ctx->intra_error; @@ -1114,7 +1128,7 @@ static void encode_sb(VP9_COMP *cpi, pred_context = vp9_get_pred_context(cm, xd, PRED_COMP); - if (xd->mode_info_context->mbmi.second_ref_frame == INTRA_FRAME) + if (xd->mode_info_context->mbmi.second_ref_frame <= INTRA_FRAME) cpi->single_pred_count[pred_context]++; else cpi->comp_pred_count[pred_context]++; @@ -1393,6 +1407,10 @@ static void init_encode_frame_mb_context(VP9_COMP *cpi) { vp9_zero(cpi->sb_ymode_count) cpi->sb_count = 0; #endif +#if CONFIG_COMP_INTERINTRA_PRED + vp9_zero(cpi->interintra_count); + vp9_zero(cpi->interintra_select_count); +#endif vpx_memset(cm->above_context, 0, sizeof(ENTROPY_CONTEXT_PLANES) * cm->mb_cols); @@ -2219,7 +2237,7 @@ static void encode_inter_macroblock(VP9_COMP *cpi, MACROBLOCK *x, xd->pre.u_buffer = cpi->common.yv12_fb[ref_fb_idx].u_buffer + recon_uvoffset; xd->pre.v_buffer = cpi->common.yv12_fb[ref_fb_idx].v_buffer + recon_uvoffset; - if (mbmi->second_ref_frame) { + if (mbmi->second_ref_frame > 0) { int second_ref_fb_idx; if (mbmi->second_ref_frame == LAST_FRAME) @@ -2406,7 +2424,7 @@ static void encode_inter_superblock(VP9_COMP *cpi, MACROBLOCK *x, xd->pre.u_buffer = cpi->common.yv12_fb[ref_fb_idx].u_buffer + recon_uvoffset; xd->pre.v_buffer = cpi->common.yv12_fb[ref_fb_idx].v_buffer + recon_uvoffset; - if (xd->mode_info_context->mbmi.second_ref_frame) { + if (xd->mode_info_context->mbmi.second_ref_frame > 0) { int second_ref_fb_idx; if (xd->mode_info_context->mbmi.second_ref_frame == LAST_FRAME) -- cgit v1.2.3