From f69574cf7aca4fe4d57a2155e925f37fc863474d Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sat, 17 Jan 2015 22:28:46 +0100 Subject: h264: move non_zero_count_cache into the per-slice context --- libavcodec/h264_mb_template.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'libavcodec/h264_mb_template.c') diff --git a/libavcodec/h264_mb_template.c b/libavcodec/h264_mb_template.c index 4dd543a5a2..fcd17e843c 100644 --- a/libavcodec/h264_mb_template.c +++ b/libavcodec/h264_mb_template.c @@ -212,14 +212,14 @@ static av_noinline void FUNC(hl_decode_mb)(H264Context *h, H264SliceContext *sl) idct_add = h->h264dsp.h264_add_pixels4_clear; for (j = 1; j < 3; j++) { for (i = j * 16; i < j * 16 + 4; i++) - if (h->non_zero_count_cache[scan8[i]] || + if (sl->non_zero_count_cache[scan8[i]] || dctcoef_get(h->mb, PIXEL_SHIFT, i * 16)) idct_add(dest[j - 1] + block_offset[i], h->mb + (i * 16 << PIXEL_SHIFT), uvlinesize); if (chroma422) { for (i = j * 16 + 4; i < j * 16 + 8; i++) - if (h->non_zero_count_cache[scan8[i + 4]] || + if (sl->non_zero_count_cache[scan8[i + 4]] || dctcoef_get(h->mb, PIXEL_SHIFT, i * 16)) idct_add(dest[j - 1] + block_offset[i + 4], h->mb + (i * 16 << PIXEL_SHIFT), @@ -237,15 +237,15 @@ static av_noinline void FUNC(hl_decode_mb)(H264Context *h, H264SliceContext *sl) qp[0] = sl->chroma_qp[0]; qp[1] = sl->chroma_qp[1]; } - if (h->non_zero_count_cache[scan8[CHROMA_DC_BLOCK_INDEX + 0]]) + if (sl->non_zero_count_cache[scan8[CHROMA_DC_BLOCK_INDEX + 0]]) h->h264dsp.h264_chroma_dc_dequant_idct(h->mb + (16 * 16 * 1 << PIXEL_SHIFT), h->dequant4_coeff[IS_INTRA(mb_type) ? 1 : 4][qp[0]][0]); - if (h->non_zero_count_cache[scan8[CHROMA_DC_BLOCK_INDEX + 1]]) + if (sl->non_zero_count_cache[scan8[CHROMA_DC_BLOCK_INDEX + 1]]) h->h264dsp.h264_chroma_dc_dequant_idct(h->mb + (16 * 16 * 2 << PIXEL_SHIFT), h->dequant4_coeff[IS_INTRA(mb_type) ? 2 : 5][qp[1]][0]); h->h264dsp.h264_idct_add8(dest, block_offset, h->mb, uvlinesize, - h->non_zero_count_cache); + sl->non_zero_count_cache); } else if (CONFIG_SVQ3_DECODER) { h->h264dsp.h264_chroma_dc_dequant_idct(h->mb + 16 * 16 * 1, h->dequant4_coeff[IS_INTRA(mb_type) ? 1 : 4][sl->chroma_qp[0]][0]); @@ -253,7 +253,7 @@ static av_noinline void FUNC(hl_decode_mb)(H264Context *h, H264SliceContext *sl) h->dequant4_coeff[IS_INTRA(mb_type) ? 2 : 5][sl->chroma_qp[1]][0]); for (j = 1; j < 3; j++) { for (i = j * 16; i < j * 16 + 4; i++) - if (h->non_zero_count_cache[scan8[i]] || h->mb[i * 16]) { + if (sl->non_zero_count_cache[scan8[i]] || h->mb[i * 16]) { uint8_t *const ptr = dest[j - 1] + block_offset[i]; ff_svq3_add_idct_c(ptr, h->mb + i * 16, uvlinesize, -- cgit v1.2.3