diff options
author | Jason Garrett-Glaser <darkshikari@gmail.com> | 2011-01-15 01:10:46 +0000 |
---|---|---|
committer | Jason Garrett-Glaser <darkshikari@gmail.com> | 2011-01-15 01:10:46 +0000 |
commit | 2a1f431d38ea9c05abb215d70c7dc09cdb6888ab (patch) | |
tree | c6e5f1d0b7a3fd2eee950dbb915ef27625644232 /libavcodec/h264idct.c | |
parent | 290fabc684244b86d47527008020b0b2eb62f836 (diff) | |
download | ffmpeg-2a1f431d38ea9c05abb215d70c7dc09cdb6888ab.tar.gz |
H.264/SVQ3: make chroma DC work the same way as luma DC
No speed improvement, but necessary for some future stuff.
Also opens up the possibility of asm chroma dc idct/dequant.
Originally committed as revision 26349 to svn://svn.ffmpeg.org/ffmpeg/trunk
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..53e70a22df 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_chroma_dc_dequant_idct_c(DCTELEM *output, DCTELEM *input, int qmul){ + const int stride= 16*2; + const int xStride= 16; + int a,b,c,d,e; + + a= input[0]; + b= input[1]; + c= input[2]; + d= input[3]; + + e= a-b; + a= a+b; + b= c-d; + c= c+d; + + output[stride*0 + xStride*0]= ((a+c)*qmul) >> 7; + output[stride*0 + xStride*1]= ((e+b)*qmul) >> 7; + output[stride*1 + xStride*0]= ((a-c)*qmul) >> 7; + output[stride*1 + xStride*1]= ((e-b)*qmul) >> 7; } |