comparison h264.c @ 4277:113f3b395bac libavcodec

Making rem6 and div6 globally visible and thus adding prefixes.
author takis
date Thu, 07 Dec 2006 09:59:05 +0000
parents f82a57e78220
children d6f83e2f8804
comparison
equal deleted inserted replaced
4276:f82a57e78220 4277:113f3b395bac
405 return (b&0xFFFF) + (a<<16); 405 return (b&0xFFFF) + (a<<16);
406 #else 406 #else
407 return (a&0xFFFF) + (b<<16); 407 return (a&0xFFFF) + (b<<16);
408 #endif 408 #endif
409 } 409 }
410
411 const uint8_t ff_rem6[52]={
412 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3,
413 };
414
415 const uint8_t ff_div6[52]={
416 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8,
417 };
418
410 419
411 /** 420 /**
412 * fill a rectangle. 421 * fill a rectangle.
413 * @param h height of the rectangle, should be a constant 422 * @param h height of the rectangle, should be a constant
414 * @param w width of the rectangle, should be a constant 423 * @param w width of the rectangle, should be a constant
3142 h->dequant8_coeff[1] = h->dequant8_buffer[0]; 3151 h->dequant8_coeff[1] = h->dequant8_buffer[0];
3143 break; 3152 break;
3144 } 3153 }
3145 3154
3146 for(q=0; q<52; q++){ 3155 for(q=0; q<52; q++){
3147 int shift = div6[q]; 3156 int shift = ff_div6[q];
3148 int idx = rem6[q]; 3157 int idx = ff_rem6[q];
3149 for(x=0; x<64; x++) 3158 for(x=0; x<64; x++)
3150 h->dequant8_coeff[i][q][transpose ? (x>>3)|((x&7)<<3) : x] = 3159 h->dequant8_coeff[i][q][transpose ? (x>>3)|((x&7)<<3) : x] =
3151 ((uint32_t)dequant8_coeff_init[idx][ dequant8_coeff_init_scan[((x>>1)&12) | (x&3)] ] * 3160 ((uint32_t)dequant8_coeff_init[idx][ dequant8_coeff_init_scan[((x>>1)&12) | (x&3)] ] *
3152 h->pps.scaling_matrix8[i][x]) << shift; 3161 h->pps.scaling_matrix8[i][x]) << shift;
3153 } 3162 }
3167 } 3176 }
3168 if(j<i) 3177 if(j<i)
3169 continue; 3178 continue;
3170 3179
3171 for(q=0; q<52; q++){ 3180 for(q=0; q<52; q++){
3172 int shift = div6[q] + 2; 3181 int shift = ff_div6[q] + 2;
3173 int idx = rem6[q]; 3182 int idx = ff_rem6[q];
3174 for(x=0; x<16; x++) 3183 for(x=0; x<16; x++)
3175 h->dequant4_coeff[i][q][transpose ? (x>>2)|((x<<2)&0xF) : x] = 3184 h->dequant4_coeff[i][q][transpose ? (x>>2)|((x<<2)&0xF) : x] =
3176 ((uint32_t)dequant4_coeff_init[idx][(x&1) + ((x>>2)&1)] * 3185 ((uint32_t)dequant4_coeff_init[idx][(x&1) + ((x>>2)&1)] *
3177 h->pps.scaling_matrix4[i][x]) << shift; 3186 h->pps.scaling_matrix4[i][x]) << shift;
3178 } 3187 }