summaryrefslogtreecommitdiff
path: root/libavcodec/h264idct.c
diff options
context:
space:
mode:
authorLoren Merritt <lorenm@u.washington.edu>2006-02-10 06:55:25 +0000
committerLoren Merritt <lorenm@u.washington.edu>2006-02-10 06:55:25 +0000
commitef9d1d15751c6a2e4c570727c198854ce8b44603 (patch)
treec2ed9fe8f2bf17d05109a494357d40737dd16146 /libavcodec/h264idct.c
parenta283db3962c07f9dfab87dc7553b61cbc4e6efb8 (diff)
h264: special case dc-only idct. ~1% faster overall
Originally committed as revision 4971 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/h264idct.c')
-rw-r--r--libavcodec/h264idct.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/libavcodec/h264idct.c b/libavcodec/h264idct.c
index a4ddf1d51d..3e44385d5e 100644
--- a/libavcodec/h264idct.c
+++ b/libavcodec/h264idct.c
@@ -139,3 +139,28 @@ void ff_h264_idct8_add_c(uint8_t *dst, DCTELEM *block, int stride){
dst[i + 7*stride] = cm[ dst[i + 7*stride] + ((b0 - b7) >> 6) ];
}
}
+
+// assumes all AC coefs are 0
+void ff_h264_idct_dc_add_c(uint8_t *dst, DCTELEM *block, int stride){
+ int i, j;
+ uint8_t *cm = cropTbl + MAX_NEG_CROP;
+ int dc = (block[0] + 32) >> 6;
+ for( j = 0; j < 4; j++ )
+ {
+ for( i = 0; i < 4; i++ )
+ dst[i] = cm[ dst[i] + dc ];
+ dst += stride;
+ }
+}
+
+void ff_h264_idct8_dc_add_c(uint8_t *dst, DCTELEM *block, int stride){
+ int i, j;
+ uint8_t *cm = cropTbl + MAX_NEG_CROP;
+ int dc = (block[0] + 32) >> 6;
+ for( j = 0; j < 8; j++ )
+ {
+ for( i = 0; i < 8; i++ )
+ dst[i] = cm[ dst[i] + dc ];
+ dst += stride;
+ }
+}