Mercurial > libavcodec.hg
comparison truemotion2.c @ 6258:6412f1a039ba libavcodec
const
author | michael |
---|---|
date | Fri, 01 Feb 2008 14:30:35 +0000 |
parents | 2b72f9bc4f06 |
children | 48759bfbd073 |
comparison
equal
deleted
inserted
replaced
6257:68d4853b5fae | 6258:6412f1a039ba |
---|---|
196 int val; | 196 int val; |
197 val = get_vlc2(gb, code->vlc.table, code->bits, 1); | 197 val = get_vlc2(gb, code->vlc.table, code->bits, 1); |
198 return code->recode[val]; | 198 return code->recode[val]; |
199 } | 199 } |
200 | 200 |
201 static inline int tm2_read_header(TM2Context *ctx, uint8_t *buf) | 201 static inline int tm2_read_header(TM2Context *ctx, const uint8_t *buf) |
202 { | 202 { |
203 uint32_t magic; | 203 uint32_t magic; |
204 uint8_t *obuf; | 204 const uint8_t *obuf; |
205 int length; | 205 int length; |
206 | 206 |
207 obuf = buf; | 207 obuf = buf; |
208 | 208 |
209 magic = AV_RL32(buf); | 209 magic = AV_RL32(buf); |
258 ctx->deltas[stream_id][i] = 0; | 258 ctx->deltas[stream_id][i] = 0; |
259 | 259 |
260 return 0; | 260 return 0; |
261 } | 261 } |
262 | 262 |
263 static int tm2_read_stream(TM2Context *ctx, uint8_t *buf, int stream_id) { | 263 static int tm2_read_stream(TM2Context *ctx, const uint8_t *buf, int stream_id) { |
264 int i; | 264 int i; |
265 int cur = 0; | 265 int cur = 0; |
266 int skip = 0; | 266 int skip = 0; |
267 int len, toks; | 267 int len, toks; |
268 TM2Codes codes; | 268 TM2Codes codes; |
757 return keyframe; | 757 return keyframe; |
758 } | 758 } |
759 | 759 |
760 static int decode_frame(AVCodecContext *avctx, | 760 static int decode_frame(AVCodecContext *avctx, |
761 void *data, int *data_size, | 761 void *data, int *data_size, |
762 uint8_t *buf, int buf_size) | 762 const uint8_t *buf, int buf_size) |
763 { | 763 { |
764 TM2Context * const l = avctx->priv_data; | 764 TM2Context * const l = avctx->priv_data; |
765 AVFrame * const p= (AVFrame*)&l->pic; | 765 AVFrame * const p= (AVFrame*)&l->pic; |
766 int skip, t; | 766 int skip, t; |
767 | 767 |
770 if(avctx->reget_buffer(avctx, p) < 0){ | 770 if(avctx->reget_buffer(avctx, p) < 0){ |
771 av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); | 771 av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); |
772 return -1; | 772 return -1; |
773 } | 773 } |
774 | 774 |
775 l->dsp.bswap_buf((uint32_t*)buf, (uint32_t*)buf, buf_size >> 2); | 775 l->dsp.bswap_buf((uint32_t*)buf, (const uint32_t*)buf, buf_size >> 2); //FIXME SERIOUS BUG |
776 skip = tm2_read_header(l, buf); | 776 skip = tm2_read_header(l, buf); |
777 | 777 |
778 if(skip == -1) | 778 if(skip == -1) |
779 return -1; | 779 return -1; |
780 | 780 |