Mercurial > libavcodec.hg
comparison apedec.c @ 6223:f07ad27251e5 libavcodec
const
author | michael |
---|---|
date | Fri, 01 Feb 2008 03:46:11 +0000 |
parents | c82299110182 |
children | 28e45bf84973 |
comparison
equal
deleted
inserted
replaced
6222:01e909d2a435 | 6223:f07ad27251e5 |
---|---|
152 APERice riceY; ///< rice code parameters for the first channel | 152 APERice riceY; ///< rice code parameters for the first channel |
153 APEFilter filters[APE_FILTER_LEVELS][2]; ///< filters used for reconstruction | 153 APEFilter filters[APE_FILTER_LEVELS][2]; ///< filters used for reconstruction |
154 | 154 |
155 uint8_t *data; ///< current frame data | 155 uint8_t *data; ///< current frame data |
156 uint8_t *data_end; ///< frame data end | 156 uint8_t *data_end; ///< frame data end |
157 uint8_t *ptr; ///< current position in frame data | 157 const uint8_t *ptr; ///< current position in frame data |
158 uint8_t *last_ptr; ///< position where last 4608-sample block ended | 158 const uint8_t *last_ptr; ///< position where last 4608-sample block ended |
159 } APEContext; | 159 } APEContext; |
160 | 160 |
161 // TODO: dsputilize | 161 // TODO: dsputilize |
162 static inline void vector_add(int16_t * v1, int16_t * v2, int order) | 162 static inline void vector_add(int16_t * v1, int16_t * v2, int order) |
163 { | 163 { |
832 } | 832 } |
833 } | 833 } |
834 | 834 |
835 static int ape_decode_frame(AVCodecContext * avctx, | 835 static int ape_decode_frame(AVCodecContext * avctx, |
836 void *data, int *data_size, | 836 void *data, int *data_size, |
837 uint8_t * buf, int buf_size) | 837 const uint8_t * buf, int buf_size) |
838 { | 838 { |
839 APEContext *s = avctx->priv_data; | 839 APEContext *s = avctx->priv_data; |
840 int16_t *samples = data; | 840 int16_t *samples = data; |
841 int nblocks; | 841 int nblocks; |
842 int i, n; | 842 int i, n; |
854 return -1; | 854 return -1; |
855 } | 855 } |
856 | 856 |
857 if(!s->samples){ | 857 if(!s->samples){ |
858 s->data = av_realloc(s->data, (buf_size + 3) & ~3); | 858 s->data = av_realloc(s->data, (buf_size + 3) & ~3); |
859 s->dsp.bswap_buf((uint32_t*)s->data, (uint32_t*)buf, buf_size >> 2); | 859 s->dsp.bswap_buf((uint32_t*)s->data, (const uint32_t*)buf, buf_size >> 2); |
860 s->ptr = s->last_ptr = s->data; | 860 s->ptr = s->last_ptr = s->data; |
861 s->data_end = s->data + buf_size; | 861 s->data_end = s->data + buf_size; |
862 | 862 |
863 nblocks = s->samples = bytestream_get_be32(&s->ptr); | 863 nblocks = s->samples = bytestream_get_be32(&s->ptr); |
864 n = bytestream_get_be32(&s->ptr); | 864 n = bytestream_get_be32(&s->ptr); |