Mercurial > libavcodec.hg
comparison indeo2.c @ 2664:f20c1cdfce76 libavcodec
support the LE reader, so it can be tested a little
author | michael |
---|---|
date | Wed, 11 May 2005 01:50:46 +0000 |
parents | 0a55e35d3e5e |
children | 7a411f408d74 |
comparison
equal
deleted
inserted
replaced
2663:b33be8b00488 | 2664:f20c1cdfce76 |
---|---|
20 | 20 |
21 /** | 21 /** |
22 * @file indeo2.c | 22 * @file indeo2.c |
23 * Intel Indeo 2 decoder. | 23 * Intel Indeo 2 decoder. |
24 */ | 24 */ |
25 | 25 #define ALT_BITSTREAM_READER_LE |
26 #include "avcodec.h" | 26 #include "avcodec.h" |
27 #include "bitstream.h" | 27 #include "bitstream.h" |
28 #include "indeo2data.h" | 28 #include "indeo2data.h" |
29 | 29 |
30 typedef struct Ir2Context{ | 30 typedef struct Ir2Context{ |
154 } | 154 } |
155 | 155 |
156 s->decode_delta = buf[18]; | 156 s->decode_delta = buf[18]; |
157 | 157 |
158 /* decide whether frame uses deltas or not */ | 158 /* decide whether frame uses deltas or not */ |
159 | 159 #ifndef ALT_BITSTREAM_READER_LE |
160 for (i = 0; i < buf_size; i++) | 160 for (i = 0; i < buf_size; i++) |
161 buf[i] = ff_reverse[buf[i]]; | 161 buf[i] = ff_reverse[buf[i]]; |
162 | 162 #endif |
163 start = 48; /* hardcoded for now */ | 163 start = 48; /* hardcoded for now */ |
164 | 164 |
165 init_get_bits(&s->gb, buf + start, buf_size - start); | 165 init_get_bits(&s->gb, buf + start, buf_size - start); |
166 | 166 |
167 if (s->decode_delta) { /* intraframe */ | 167 if (s->decode_delta) { /* intraframe */ |
196 avctx->pix_fmt= PIX_FMT_YUV410P; | 196 avctx->pix_fmt= PIX_FMT_YUV410P; |
197 | 197 |
198 if (!ir2_vlc.table) | 198 if (!ir2_vlc.table) |
199 init_vlc(&ir2_vlc, CODE_VLC_BITS, IR2_CODES, | 199 init_vlc(&ir2_vlc, CODE_VLC_BITS, IR2_CODES, |
200 &ir2_codes[0][1], 4, 2, | 200 &ir2_codes[0][1], 4, 2, |
201 &ir2_codes[0][0], 4, 2, 1); | 201 #ifdef ALT_BITSTREAM_READER_LE |
202 | 202 &ir2_codes[0][0], 4, 2, INIT_VLC_USE_STATIC | INIT_VLC_LE); |
203 #else | |
204 &ir2_codes[0][0], 4, 2, INIT_VLC_USE_STATIC); | |
205 #endif | |
206 | |
203 return 0; | 207 return 0; |
204 } | 208 } |
205 | 209 |
206 AVCodec indeo2_decoder = { | 210 AVCodec indeo2_decoder = { |
207 "indeo2", | 211 "indeo2", |