comparison asv1.c @ 2578:91e094c9dcdc libavcodec

make reverse[] non static
author michael
date Sat, 26 Mar 2005 23:50:14 +0000
parents f67b63ed036d
children eaa57c3336fc
comparison
equal deleted inserted replaced
2577:7d9997a69158 2578:91e094c9dcdc
61 0x32,0x3A,0x33,0x3B,0x26,0x2E,0x27,0x2F, 61 0x32,0x3A,0x33,0x3B,0x26,0x2E,0x27,0x2F,
62 0x34,0x3C,0x35,0x3D,0x36,0x3E,0x37,0x3F, 62 0x34,0x3C,0x35,0x3D,0x36,0x3E,0x37,0x3F,
63 }; 63 };
64 64
65 65
66 static const uint8_t reverse[256]={ 66 const uint8_t ff_reverse[256]={
67 0x00,0x80,0x40,0xC0,0x20,0xA0,0x60,0xE0,0x10,0x90,0x50,0xD0,0x30,0xB0,0x70,0xF0, 67 0x00,0x80,0x40,0xC0,0x20,0xA0,0x60,0xE0,0x10,0x90,0x50,0xD0,0x30,0xB0,0x70,0xF0,
68 0x08,0x88,0x48,0xC8,0x28,0xA8,0x68,0xE8,0x18,0x98,0x58,0xD8,0x38,0xB8,0x78,0xF8, 68 0x08,0x88,0x48,0xC8,0x28,0xA8,0x68,0xE8,0x18,0x98,0x58,0xD8,0x38,0xB8,0x78,0xF8,
69 0x04,0x84,0x44,0xC4,0x24,0xA4,0x64,0xE4,0x14,0x94,0x54,0xD4,0x34,0xB4,0x74,0xF4, 69 0x04,0x84,0x44,0xC4,0x24,0xA4,0x64,0xE4,0x14,0x94,0x54,0xD4,0x34,0xB4,0x74,0xF4,
70 0x0C,0x8C,0x4C,0xCC,0x2C,0xAC,0x6C,0xEC,0x1C,0x9C,0x5C,0xDC,0x3C,0xBC,0x7C,0xFC, 70 0x0C,0x8C,0x4C,0xCC,0x2C,0xAC,0x6C,0xEC,0x1C,0x9C,0x5C,0xDC,0x3C,0xBC,0x7C,0xFC,
71 0x02,0x82,0x42,0xC2,0x22,0xA2,0x62,0xE2,0x12,0x92,0x52,0xD2,0x32,0xB2,0x72,0xF2, 71 0x02,0x82,0x42,0xC2,0x22,0xA2,0x62,0xE2,0x12,0x92,0x52,0xD2,0x32,0xB2,0x72,0xF2,
153 } 153 }
154 } 154 }
155 155
156 //FIXME write a reversed bitstream reader to avoid the double reverse 156 //FIXME write a reversed bitstream reader to avoid the double reverse
157 static inline int asv2_get_bits(GetBitContext *gb, int n){ 157 static inline int asv2_get_bits(GetBitContext *gb, int n){
158 return reverse[ get_bits(gb, n) << (8-n) ]; 158 return ff_reverse[ get_bits(gb, n) << (8-n) ];
159 } 159 }
160 160
161 static inline void asv2_put_bits(PutBitContext *pb, int n, int v){ 161 static inline void asv2_put_bits(PutBitContext *pb, int n, int v){
162 put_bits(pb, n, reverse[ v << (8-n) ]); 162 put_bits(pb, n, ff_reverse[ v << (8-n) ]);
163 } 163 }
164 164
165 static inline int asv1_get_level(GetBitContext *gb){ 165 static inline int asv1_get_level(GetBitContext *gb){
166 int code= get_vlc2(gb, level_vlc.table, VLC_BITS, 1); 166 int code= get_vlc2(gb, level_vlc.table, VLC_BITS, 1);
167 167
425 if(avctx->codec_id == CODEC_ID_ASV1) 425 if(avctx->codec_id == CODEC_ID_ASV1)
426 a->dsp.bswap_buf((uint32_t*)a->bitstream_buffer, (uint32_t*)buf, buf_size/4); 426 a->dsp.bswap_buf((uint32_t*)a->bitstream_buffer, (uint32_t*)buf, buf_size/4);
427 else{ 427 else{
428 int i; 428 int i;
429 for(i=0; i<buf_size; i++) 429 for(i=0; i<buf_size; i++)
430 a->bitstream_buffer[i]= reverse[ buf[i] ]; 430 a->bitstream_buffer[i]= ff_reverse[ buf[i] ];
431 } 431 }
432 432
433 init_get_bits(&a->gb, a->bitstream_buffer, buf_size*8); 433 init_get_bits(&a->gb, a->bitstream_buffer, buf_size*8);
434 434
435 for(mb_y=0; mb_y<a->mb_height2; mb_y++){ 435 for(mb_y=0; mb_y<a->mb_height2; mb_y++){
526 if(avctx->codec_id == CODEC_ID_ASV1) 526 if(avctx->codec_id == CODEC_ID_ASV1)
527 a->dsp.bswap_buf((uint32_t*)buf, (uint32_t*)buf, size); 527 a->dsp.bswap_buf((uint32_t*)buf, (uint32_t*)buf, size);
528 else{ 528 else{
529 int i; 529 int i;
530 for(i=0; i<4*size; i++) 530 for(i=0; i<4*size; i++)
531 buf[i]= reverse[ buf[i] ]; 531 buf[i]= ff_reverse[ buf[i] ];
532 } 532 }
533 533
534 return size*4; 534 return size*4;
535 } 535 }
536 536