comparison h264idct.c @ 8375:de2509cf3c44 libavcodec

H.264 idct functions that include the chroma, inter luma and intra16 luma loops thus avoiding the calling overhead. New functions are not yet used.
author michael
date Thu, 18 Dec 2008 02:36:48 +0000
parents 2b72f9bc4f06
children fa07932f2c89
comparison
equal deleted inserted replaced
8374:9000fd7c166e 8375:de2509cf3c44
163 for( i = 0; i < 8; i++ ) 163 for( i = 0; i < 8; i++ )
164 dst[i] = cm[ dst[i] + dc ]; 164 dst[i] = cm[ dst[i] + dc ];
165 dst += stride; 165 dst += stride;
166 } 166 }
167 } 167 }
168
169 //FIXME this table is a duplicate from h264data.h, and will be removed once the tables from, h264 have been split
170 static const uint8_t scan8[16 + 2*4]={
171 4+1*8, 5+1*8, 4+2*8, 5+2*8,
172 6+1*8, 7+1*8, 6+2*8, 7+2*8,
173 4+3*8, 5+3*8, 4+4*8, 5+4*8,
174 6+3*8, 7+3*8, 6+4*8, 7+4*8,
175 1+1*8, 2+1*8,
176 1+2*8, 2+2*8,
177 1+4*8, 2+4*8,
178 1+5*8, 2+5*8,
179 };
180
181 void ff_h264_idct_add16_c(uint8_t *dst, const int *block_offset, DCTELEM *block, int stride, const uint8_t nnzc[6*8]){
182 int i;
183 for(i=0; i<16; i++){
184 int nnz = nnzc[ scan8[i] ];
185 if(nnz){
186 if(nnz==1 && block[i*16]) ff_h264_idct_dc_add_c(dst + block_offset[i], block + i*16, stride);
187 else idct_internal (dst + block_offset[i], block + i*16, stride, 4, 6, 1);
188 }
189 }
190 }
191
192 void ff_h264_idct_add16intra_c(uint8_t *dst, const int *block_offset, DCTELEM *block, int stride, const uint8_t nnzc[6*8]){
193 int i;
194 for(i=0; i<16; i++){
195 if(nnzc[ scan8[i] ]) idct_internal (dst + block_offset[i], block + i*16, stride, 4, 6, 1);
196 else if(block[i*16]) ff_h264_idct_dc_add_c(dst + block_offset[i], block + i*16, stride);
197 }
198 }
199
200 void ff_h264_idct8_add4_c(uint8_t *dst, const int *block_offset, DCTELEM *block, int stride, const uint8_t nnzc[6*8]){
201 int i;
202 for(i=0; i<16; i+=4){
203 int nnz = nnzc[ scan8[i] ];
204 if(nnz){
205 if(nnz==1 && block[i*16]) ff_h264_idct8_dc_add_c(dst + block_offset[i], block + i*16, stride);
206 else ff_h264_idct8_add_c (dst + block_offset[i], block + i*16, stride);
207 }
208 }
209 }
210
211 void ff_h264_idct_add8_c(uint8_t **dest, const int *block_offset, DCTELEM *block, int stride, const uint8_t nnzc[6*8]){
212 int i;
213 for(i=16; i<16+8; i++){
214 if(nnzc[ scan8[i] ])
215 ff_h264_idct_add_c (dest[(i&4)>>2] + block_offset[i], block + i*16, stride);
216 else if(block[i*16])
217 ff_h264_idct_dc_add_c(dest[(i&4)>>2] + block_offset[i], block + i*16, stride);
218 }
219 }