From e39e3abad4ce667f06d41097428695a7aad095fb Mon Sep 17 00:00:00 2001 From: Oskar Arvidsson Date: Sun, 10 Apr 2011 22:42:36 +0200 Subject: Choose h264 chroma dc dequant function dynamically. Needed for high bit depth h264 decoding. Signed-off-by: Ronald S. Bultje --- libavcodec/h264idct.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'libavcodec/h264idct.c') 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; } -- cgit v1.2.3