summaryrefslogtreecommitdiff
path: root/libavcodec/h264.c
diff options
context:
space:
mode:
authorJason Garrett-Glaser <darkshikari@gmail.com>2011-01-14 21:36:16 +0000
committerJason Garrett-Glaser <darkshikari@gmail.com>2011-01-14 21:36:16 +0000
commit5657d14094e0b9d3f277322e49442592973bbdac (patch)
treeded1893e7e77e5b0d645013bac8b8cb10eab0138 /libavcodec/h264.c
parent19fb234e4af1ff9f58ff2fdd604ac6f6bb87ad6b (diff)
H.264: switch to x264-style tracking of luma/chroma DC NNZ
Useful so that we don't have to run the hierarchical DC iDCT if there aren't any coefficients. Opens up some future opportunities for optimization as well. Originally committed as revision 26337 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/h264.c')
-rw-r--r--libavcodec/h264.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index f3470474ea..a819ee80a2 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -1203,6 +1203,7 @@ static av_always_inline void hl_decode_mb_internal(H264Context *h, int simple){
}
}else{
h->hpc.pred16x16[ h->intra16x16_pred_mode ](dest_y , linesize);
+ if(h->non_zero_count_cache[ scan8[LUMA_DC_BLOCK_INDEX] ]){
if(is_h264){
if(!transform_bypass)
h->h264dsp.h264_luma_dc_dequant_idct(h->mb, h->mb_luma_dc, h->dequant4_coeff[0][s->qscale][0]);
@@ -1214,6 +1215,7 @@ static av_always_inline void hl_decode_mb_internal(H264Context *h, int simple){
}
}else
ff_svq3_luma_dc_dequant_idct_c(h->mb, h->mb_luma_dc, s->qscale);
+ }
}
if(h->deblocking_filter)
xchg_mb_border(h, dest_y, dest_cb, dest_cr, linesize, uvlinesize, 0, simple);
@@ -1281,8 +1283,10 @@ static av_always_inline void hl_decode_mb_internal(H264Context *h, int simple){
}
}
}else{
- chroma_dc_dequant_idct_c(h->mb + 16*16, h->chroma_qp[0], h->dequant4_coeff[IS_INTRA(mb_type) ? 1:4][h->chroma_qp[0]][0]);
- chroma_dc_dequant_idct_c(h->mb + 16*16+4*16, h->chroma_qp[1], h->dequant4_coeff[IS_INTRA(mb_type) ? 2:5][h->chroma_qp[1]][0]);
+ if(h->non_zero_count_cache[ scan8[CHROMA_DC_BLOCK_INDEX+0] ])
+ chroma_dc_dequant_idct_c(h->mb + 16*16 , h->chroma_qp[0], h->dequant4_coeff[IS_INTRA(mb_type) ? 1:4][h->chroma_qp[0]][0]);
+ if(h->non_zero_count_cache[ scan8[CHROMA_DC_BLOCK_INDEX+1] ])
+ chroma_dc_dequant_idct_c(h->mb + 16*16+4*16, h->chroma_qp[1], h->dequant4_coeff[IS_INTRA(mb_type) ? 2:5][h->chroma_qp[1]][0]);
if(is_h264){
h->h264dsp.h264_idct_add8(dest, block_offset,
h->mb, uvlinesize,