Mercurial > libavcodec.hg
comparison wnv1.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 | 8a137661f31e |
children | 8a4984c5cacc |
comparison
equal
deleted
inserted
replaced
10500:6d653bb57c58 | 10501:bdf4a9ca162a |
---|---|
24 * Winnov WNV1 codec. | 24 * Winnov WNV1 codec. |
25 */ | 25 */ |
26 | 26 |
27 #include "avcodec.h" | 27 #include "avcodec.h" |
28 #include "get_bits.h" | 28 #include "get_bits.h" |
29 #include "libavutil/common.h" | |
29 | 30 |
30 | 31 |
31 typedef struct WNV1Context{ | 32 typedef struct WNV1Context{ |
32 AVCodecContext *avctx; | 33 AVCodecContext *avctx; |
33 AVFrame pic; | 34 AVFrame pic; |
49 static inline int wnv1_get_code(WNV1Context *w, int base_value) | 50 static inline int wnv1_get_code(WNV1Context *w, int base_value) |
50 { | 51 { |
51 int v = get_vlc2(&w->gb, code_vlc.table, CODE_VLC_BITS, 1); | 52 int v = get_vlc2(&w->gb, code_vlc.table, CODE_VLC_BITS, 1); |
52 | 53 |
53 if(v==15) | 54 if(v==15) |
54 return ff_reverse[ get_bits(&w->gb, 8 - w->shift) ]; | 55 return av_reverse[ get_bits(&w->gb, 8 - w->shift) ]; |
55 else | 56 else |
56 return base_value + ((v - 7)<<w->shift); | 57 return base_value + ((v - 7)<<w->shift); |
57 } | 58 } |
58 | 59 |
59 static int decode_frame(AVCodecContext *avctx, | 60 static int decode_frame(AVCodecContext *avctx, |
85 return -1; | 86 return -1; |
86 } | 87 } |
87 p->key_frame = 1; | 88 p->key_frame = 1; |
88 | 89 |
89 for(i=8; i<buf_size; i++) | 90 for(i=8; i<buf_size; i++) |
90 rbuf[i]= ff_reverse[ buf[i] ]; | 91 rbuf[i]= av_reverse[ buf[i] ]; |
91 init_get_bits(&l->gb, rbuf+8, (buf_size-8)*8); | 92 init_get_bits(&l->gb, rbuf+8, (buf_size-8)*8); |
92 | 93 |
93 if (buf[2] >> 4 == 6) | 94 if (buf[2] >> 4 == 6) |
94 l->shift = 2; | 95 l->shift = 2; |
95 else { | 96 else { |