Mercurial > libavcodec.hg
comparison asv1.c @ 10501:bdf4a9ca162a libavcodec
Move ff_reverse in libavcodec to av_reverse in libavutil.
Patch by Francesco Lavra, francescolavra interfree it
author | cehoyos |
---|---|
date | Mon, 09 Nov 2009 09:11:35 +0000 |
parents | 825c7f57cfac |
children | 34a65026fa06 |
comparison
equal
deleted
inserted
replaced
10500:6d653bb57c58 | 10501:bdf4a9ca162a |
---|---|
23 * @file libavcodec/asv1.c | 23 * @file libavcodec/asv1.c |
24 * ASUS V1/V2 codec. | 24 * ASUS V1/V2 codec. |
25 */ | 25 */ |
26 | 26 |
27 #include "avcodec.h" | 27 #include "avcodec.h" |
28 #include "get_bits.h" | 28 #include "libavutil/common.h" |
29 #include "put_bits.h" | 29 #include "put_bits.h" |
30 #include "dsputil.h" | 30 #include "dsputil.h" |
31 #include "mpeg12data.h" | 31 #include "mpeg12data.h" |
32 | 32 |
33 //#undef NDEBUG | 33 //#undef NDEBUG |
138 } | 138 } |
139 } | 139 } |
140 | 140 |
141 //FIXME write a reversed bitstream reader to avoid the double reverse | 141 //FIXME write a reversed bitstream reader to avoid the double reverse |
142 static inline int asv2_get_bits(GetBitContext *gb, int n){ | 142 static inline int asv2_get_bits(GetBitContext *gb, int n){ |
143 return ff_reverse[ get_bits(gb, n) << (8-n) ]; | 143 return av_reverse[ get_bits(gb, n) << (8-n) ]; |
144 } | 144 } |
145 | 145 |
146 static inline void asv2_put_bits(PutBitContext *pb, int n, int v){ | 146 static inline void asv2_put_bits(PutBitContext *pb, int n, int v){ |
147 put_bits(pb, n, ff_reverse[ v << (8-n) ]); | 147 put_bits(pb, n, av_reverse[ v << (8-n) ]); |
148 } | 148 } |
149 | 149 |
150 static inline int asv1_get_level(GetBitContext *gb){ | 150 static inline int asv1_get_level(GetBitContext *gb){ |
151 int code= get_vlc2(gb, level_vlc.table, VLC_BITS, 1); | 151 int code= get_vlc2(gb, level_vlc.table, VLC_BITS, 1); |
152 | 152 |
415 if(avctx->codec_id == CODEC_ID_ASV1) | 415 if(avctx->codec_id == CODEC_ID_ASV1) |
416 a->dsp.bswap_buf((uint32_t*)a->bitstream_buffer, (const uint32_t*)buf, buf_size/4); | 416 a->dsp.bswap_buf((uint32_t*)a->bitstream_buffer, (const uint32_t*)buf, buf_size/4); |
417 else{ | 417 else{ |
418 int i; | 418 int i; |
419 for(i=0; i<buf_size; i++) | 419 for(i=0; i<buf_size; i++) |
420 a->bitstream_buffer[i]= ff_reverse[ buf[i] ]; | 420 a->bitstream_buffer[i]= av_reverse[ buf[i] ]; |
421 } | 421 } |
422 | 422 |
423 init_get_bits(&a->gb, a->bitstream_buffer, buf_size*8); | 423 init_get_bits(&a->gb, a->bitstream_buffer, buf_size*8); |
424 | 424 |
425 for(mb_y=0; mb_y<a->mb_height2; mb_y++){ | 425 for(mb_y=0; mb_y<a->mb_height2; mb_y++){ |
517 if(avctx->codec_id == CODEC_ID_ASV1) | 517 if(avctx->codec_id == CODEC_ID_ASV1) |
518 a->dsp.bswap_buf((uint32_t*)buf, (uint32_t*)buf, size); | 518 a->dsp.bswap_buf((uint32_t*)buf, (uint32_t*)buf, size); |
519 else{ | 519 else{ |
520 int i; | 520 int i; |
521 for(i=0; i<4*size; i++) | 521 for(i=0; i<4*size; i++) |
522 buf[i]= ff_reverse[ buf[i] ]; | 522 buf[i]= av_reverse[ buf[i] ]; |
523 } | 523 } |
524 | 524 |
525 return size*4; | 525 return size*4; |
526 } | 526 } |
527 #endif /* CONFIG_ASV1_ENCODER || CONFIG_ASV2_ENCODER */ | 527 #endif /* CONFIG_ASV1_ENCODER || CONFIG_ASV2_ENCODER */ |