summaryrefslogtreecommitdiffstats
path: root/libavcodec/h264.c
diff options
context:
space:
mode:
authorOskar Arvidsson <oskar@irock.se>2011-03-29 17:48:46 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-04-10 22:33:41 +0200
commitaf0b2d6736a99203fed3014a3e83f8226dade2af (patch)
tree7a4a3f6aa77129b3497672f87831be72a6256007 /libavcodec/h264.c
parent488efb33a71683a965c99ddd62ee6c32727ecee9 (diff)
downloadffmpeg-streaming-af0b2d6736a99203fed3014a3e83f8226dade2af.zip
ffmpeg-streaming-af0b2d6736a99203fed3014a3e83f8226dade2af.tar.gz
Choose h264 chroma dc dequant function dynamically.
Needed for high bit depth h264 decoding. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/h264.c')
-rw-r--r--libavcodec/h264.c29
1 files changed, 4 insertions, 25 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index ca33c9a..aa31037 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -428,27 +428,6 @@ static void h264_luma_dc_dct_c(DCTELEM *block/*, int qp*/){
#undef xStride
#undef stride
-static void chroma_dc_dequant_idct_c(DCTELEM *block, int qmul){
- const int stride= 16*2;
- const int xStride= 16;
- int a,b,c,d,e;
-
- a= block[stride*0 + xStride*0];
- b= block[stride*0 + xStride*1];
- c= block[stride*1 + xStride*0];
- d= block[stride*1 + xStride*1];
-
- e= a-b;
- a= a+b;
- b= c-d;
- c= c+d;
-
- block[stride*0 + xStride*0]= ((a+c)*qmul) >> 7;
- block[stride*0 + xStride*1]= ((e+b)*qmul) >> 7;
- block[stride*1 + xStride*0]= ((a-c)*qmul) >> 7;
- block[stride*1 + xStride*1]= ((e-b)*qmul) >> 7;
-}
-
#if 0
static void chroma_dc_dct_c(DCTELEM *block){
const int stride= 16*2;
@@ -1712,17 +1691,17 @@ static av_always_inline void hl_decode_mb_internal(H264Context *h, int simple){
}else{
if(is_h264){
if(h->non_zero_count_cache[ scan8[CHROMA_DC_BLOCK_INDEX+0] ])
- chroma_dc_dequant_idct_c(h->mb + 16*16 , h->dequant4_coeff[IS_INTRA(mb_type) ? 1:4][h->chroma_qp[0]][0]);
+ h->h264dsp.h264_chroma_dc_dequant_idct(h->mb + 16*16 , 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->dequant4_coeff[IS_INTRA(mb_type) ? 2:5][h->chroma_qp[1]][0]);
+ h->h264dsp.h264_chroma_dc_dequant_idct(h->mb + 16*16+4*16, h->dequant4_coeff[IS_INTRA(mb_type) ? 2:5][h->chroma_qp[1]][0]);
h->h264dsp.h264_idct_add8(dest, block_offset,
h->mb, uvlinesize,
h->non_zero_count_cache);
}
#if CONFIG_SVQ3_DECODER
else{
- chroma_dc_dequant_idct_c(h->mb + 16*16 , 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->dequant4_coeff[IS_INTRA(mb_type) ? 2:5][h->chroma_qp[1]][0]);
+ h->h264dsp.h264_chroma_dc_dequant_idct(h->mb + 16*16 , h->dequant4_coeff[IS_INTRA(mb_type) ? 1:4][h->chroma_qp[0]][0]);
+ h->h264dsp.h264_chroma_dc_dequant_idct(h->mb + 16*16+4*16, h->dequant4_coeff[IS_INTRA(mb_type) ? 2:5][h->chroma_qp[1]][0]);
for(i=16; i<16+8; i++){
if(h->non_zero_count_cache[ scan8[i] ] || h->mb[i*16]){
uint8_t * const ptr= dest[(i&4)>>2] + block_offset[i];
OpenPOWER on IntegriCloud