comparison h264idct.c @ 11926:43e39953f4f9 libavcodec

Improve some uses of ff_cropTbl with constant offset
author mru
date Tue, 22 Jun 2010 23:12:48 +0000
parents 7dd2a45249a9
children
comparison
equal deleted inserted replaced
11925:c5e03082fd94 11926:43e39953f4f9
141 } 141 }
142 142
143 // assumes all AC coefs are 0 143 // assumes all AC coefs are 0
144 void ff_h264_idct_dc_add_c(uint8_t *dst, DCTELEM *block, int stride){ 144 void ff_h264_idct_dc_add_c(uint8_t *dst, DCTELEM *block, int stride){
145 int i, j; 145 int i, j;
146 uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
147 int dc = (block[0] + 32) >> 6; 146 int dc = (block[0] + 32) >> 6;
147 uint8_t *cm = ff_cropTbl + MAX_NEG_CROP + dc;
148 for( j = 0; j < 4; j++ ) 148 for( j = 0; j < 4; j++ )
149 { 149 {
150 for( i = 0; i < 4; i++ ) 150 for( i = 0; i < 4; i++ )
151 dst[i] = cm[ dst[i] + dc ]; 151 dst[i] = cm[ dst[i] ];
152 dst += stride; 152 dst += stride;
153 } 153 }
154 } 154 }
155 155
156 void ff_h264_idct8_dc_add_c(uint8_t *dst, DCTELEM *block, int stride){ 156 void ff_h264_idct8_dc_add_c(uint8_t *dst, DCTELEM *block, int stride){
157 int i, j; 157 int i, j;
158 uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
159 int dc = (block[0] + 32) >> 6; 158 int dc = (block[0] + 32) >> 6;
159 uint8_t *cm = ff_cropTbl + MAX_NEG_CROP + dc;
160 for( j = 0; j < 8; j++ ) 160 for( j = 0; j < 8; j++ )
161 { 161 {
162 for( i = 0; i < 8; i++ ) 162 for( i = 0; i < 8; i++ )
163 dst[i] = cm[ dst[i] + dc ]; 163 dst[i] = cm[ dst[i] ];
164 dst += stride; 164 dst += stride;
165 } 165 }
166 } 166 }
167 167
168 //FIXME this table is a duplicate from h264data.h, and will be removed once the tables from, h264 have been split 168 //FIXME this table is a duplicate from h264data.h, and will be removed once the tables from, h264 have been split