diff options
author | Oskar Arvidsson <oskar@irock.se> | 2011-04-10 22:42:36 +0200 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2011-05-10 07:24:17 -0400 |
commit | e39e3abad4ce667f06d41097428695a7aad095fb (patch) | |
tree | fee1f3d4342f18bc992c79fb4b541e08861b632e /libavcodec/h264idct.c | |
parent | dd561441b1e849df7d8681c6f32af82d4088dafd (diff) | |
download | ffmpeg-e39e3abad4ce667f06d41097428695a7aad095fb.tar.gz |
Choose h264 chroma dc dequant function dynamically.
Needed for high bit depth h264 decoding.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
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 ecf669ebd0..790f1883fd 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; } |