comparison h264.c @ 7993:2dfff0e25b47 libavcodec

Mark ff_div6 and ff_rem6 static in h264.c. Patch by Diego Petten
author lu_zero
date Sat, 04 Oct 2008 09:36:35 +0000
parents 2b20ad98e424
children e70975d5ff80
comparison
equal deleted inserted replaced
7992:b5f5257c0c70 7993:2dfff0e25b47
84 #else 84 #else
85 return (a&0xFFFF) + (b<<16); 85 return (a&0xFFFF) + (b<<16);
86 #endif 86 #endif
87 } 87 }
88 88
89 const uint8_t ff_rem6[52]={ 89 static const uint8_t rem6[52]={
90 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, 90 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,
91 }; 91 };
92 92
93 const uint8_t ff_div6[52]={ 93 static const uint8_t div6[52]={
94 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, 94 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,
95 }; 95 };
96 96
97 static const int left_block_options[4][8]={ 97 static const int left_block_options[4][8]={
98 {0,1,2,3,7,10,8,11}, 98 {0,1,2,3,7,10,8,11},
2054 h->dequant8_coeff[1] = h->dequant8_buffer[0]; 2054 h->dequant8_coeff[1] = h->dequant8_buffer[0];
2055 break; 2055 break;
2056 } 2056 }
2057 2057
2058 for(q=0; q<52; q++){ 2058 for(q=0; q<52; q++){
2059 int shift = ff_div6[q]; 2059 int shift = div6[q];
2060 int idx = ff_rem6[q]; 2060 int idx = rem6[q];
2061 for(x=0; x<64; x++) 2061 for(x=0; x<64; x++)
2062 h->dequant8_coeff[i][q][transpose ? (x>>3)|((x&7)<<3) : x] = 2062 h->dequant8_coeff[i][q][transpose ? (x>>3)|((x&7)<<3) : x] =
2063 ((uint32_t)dequant8_coeff_init[idx][ dequant8_coeff_init_scan[((x>>1)&12) | (x&3)] ] * 2063 ((uint32_t)dequant8_coeff_init[idx][ dequant8_coeff_init_scan[((x>>1)&12) | (x&3)] ] *
2064 h->pps.scaling_matrix8[i][x]) << shift; 2064 h->pps.scaling_matrix8[i][x]) << shift;
2065 } 2065 }
2079 } 2079 }
2080 if(j<i) 2080 if(j<i)
2081 continue; 2081 continue;
2082 2082
2083 for(q=0; q<52; q++){ 2083 for(q=0; q<52; q++){
2084 int shift = ff_div6[q] + 2; 2084 int shift = div6[q] + 2;
2085 int idx = ff_rem6[q]; 2085 int idx = rem6[q];
2086 for(x=0; x<16; x++) 2086 for(x=0; x<16; x++)
2087 h->dequant4_coeff[i][q][transpose ? (x>>2)|((x<<2)&0xF) : x] = 2087 h->dequant4_coeff[i][q][transpose ? (x>>2)|((x<<2)&0xF) : x] =
2088 ((uint32_t)dequant4_coeff_init[idx][(x&1) + ((x>>2)&1)] * 2088 ((uint32_t)dequant4_coeff_init[idx][(x&1) + ((x>>2)&1)] *
2089 h->pps.scaling_matrix4[i][x]) << shift; 2089 h->pps.scaling_matrix4[i][x]) << shift;
2090 } 2090 }