comparison h264idct.c @ 3105:2d35fb3cb940 libavcodec

h264: special case dc-only idct. ~1% faster overall
author lorenm
date Fri, 10 Feb 2006 06:55:25 +0000
parents 0b546eab515d
children c8c591fe26f8
comparison
equal deleted inserted replaced
3104:78d6bfc238f3 3105:2d35fb3cb940
137 dst[i + 5*stride] = cm[ dst[i + 5*stride] + ((b4 - b3) >> 6) ]; 137 dst[i + 5*stride] = cm[ dst[i + 5*stride] + ((b4 - b3) >> 6) ];
138 dst[i + 6*stride] = cm[ dst[i + 6*stride] + ((b2 - b5) >> 6) ]; 138 dst[i + 6*stride] = cm[ dst[i + 6*stride] + ((b2 - b5) >> 6) ];
139 dst[i + 7*stride] = cm[ dst[i + 7*stride] + ((b0 - b7) >> 6) ]; 139 dst[i + 7*stride] = cm[ dst[i + 7*stride] + ((b0 - b7) >> 6) ];
140 } 140 }
141 } 141 }
142
143 // assumes all AC coefs are 0
144 void ff_h264_idct_dc_add_c(uint8_t *dst, DCTELEM *block, int stride){
145 int i, j;
146 uint8_t *cm = cropTbl + MAX_NEG_CROP;
147 int dc = (block[0] + 32) >> 6;
148 for( j = 0; j < 4; j++ )
149 {
150 for( i = 0; i < 4; i++ )
151 dst[i] = cm[ dst[i] + dc ];
152 dst += stride;
153 }
154 }
155
156 void ff_h264_idct8_dc_add_c(uint8_t *dst, DCTELEM *block, int stride){
157 int i, j;
158 uint8_t *cm = cropTbl + MAX_NEG_CROP;
159 int dc = (block[0] + 32) >> 6;
160 for( j = 0; j < 8; j++ )
161 {
162 for( i = 0; i < 8; i++ )
163 dst[i] = cm[ dst[i] + dc ];
164 dst += stride;
165 }
166 }