diff options
author | Oskar Arvidsson <oskar@irock.se> | 2011-03-29 17:48:46 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-04-10 22:33:41 +0200 |
commit | af0b2d6736a99203fed3014a3e83f8226dade2af (patch) | |
tree | 7a4a3f6aa77129b3497672f87831be72a6256007 /libavcodec/h264idct.c | |
parent | 488efb33a71683a965c99ddd62ee6c32727ecee9 (diff) | |
download | ffmpeg-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/h264idct.c')
-rw-r--r-- | libavcodec/h264idct.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/libavcodec/h264idct.c b/libavcodec/h264idct.c index f5b05ac24f..7c96f424b4 100644 --- a/libavcodec/h264idct.c +++ b/libavcodec/h264idct.c @@ -250,4 +250,26 @@ void ff_h264_luma_dc_dequant_idct_c(DCTELEM *output, DCTELEM *input, int qmul){ output[stride* 4+offset]= ((((z1 - z2)*qmul + 128 ) >> 8)); output[stride* 5+offset]= ((((z0 - z3)*qmul + 128 ) >> 8)); } +#undef stride +} + +void ff_h264_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; } |