From: Jerome Jiang Date: Tue, 6 Nov 2018 01:46:03 +0000 (-0800) Subject: vp8 dec: only compute ref frame buffer pointer for non intra X-Git-Tag: v1.8.0~172^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e674cfcb055a8b69afce697e4419649bcab7523f;p=libvpx vp8 dec: only compute ref frame buffer pointer for non intra When ref frame is INTRA_FRAME, pre buffer shouldn't be used. This CL copies behavior in single thread. That should apply to multithreading case too. BUG=webm:1496 Change-Id: Ibe9ab8ea9dc664151fa7ebac529d5fd1a481b4a3 --- diff --git a/vp8/decoder/threading.c b/vp8/decoder/threading.c index 8cc301d4f..90e0f4d86 100644 --- a/vp8/decoder/threading.c +++ b/vp8/decoder/threading.c @@ -415,13 +415,17 @@ static void mt_decode_mb_rows(VP8D_COMP *pbi, MACROBLOCKD *xd, "Corrupted reference frame"); } - xd->pre.y_buffer = - ref_buffer[xd->mode_info_context->mbmi.ref_frame][0] + recon_yoffset; - xd->pre.u_buffer = - ref_buffer[xd->mode_info_context->mbmi.ref_frame][1] + recon_uvoffset; - xd->pre.v_buffer = - ref_buffer[xd->mode_info_context->mbmi.ref_frame][2] + recon_uvoffset; - + if (xd->mode_info_context->mbmi.ref_frame >= LAST_FRAME) { + const MV_REFERENCE_FRAME ref = xd->mode_info_context->mbmi.ref_frame; + xd->pre.y_buffer = ref_buffer[ref][0] + recon_yoffset; + xd->pre.u_buffer = ref_buffer[ref][1] + recon_uvoffset; + xd->pre.v_buffer = ref_buffer[ref][2] + recon_uvoffset; + } else { + // ref_frame is INTRA_FRAME, pre buffer should not be used. + xd->pre.y_buffer = 0; + xd->pre.u_buffer = 0; + xd->pre.v_buffer = 0; + } mt_decode_macroblock(pbi, xd, 0); xd->left_available = 1;