Mercurial > libavcodec.hg
comparison atrac3.c @ 6228:d155d4915e1c libavcodec
const
author | michael |
---|---|
date | Fri, 01 Feb 2008 03:54:08 +0000 |
parents | c2ab2ac31edb |
children | a4104482ceef |
comparison
equal
deleted
inserted
replaced
6227:21121fd413fa | 6228:d155d4915e1c |
---|---|
223 * @param in pointer to 8 bit array of indata | 223 * @param in pointer to 8 bit array of indata |
224 * @param bits amount of bits | 224 * @param bits amount of bits |
225 * @param out pointer to 8 bit array of outdata | 225 * @param out pointer to 8 bit array of outdata |
226 */ | 226 */ |
227 | 227 |
228 static int decode_bytes(uint8_t* inbuffer, uint8_t* out, int bytes){ | 228 static int decode_bytes(const uint8_t* inbuffer, uint8_t* out, int bytes){ |
229 int i, off; | 229 int i, off; |
230 uint32_t c; | 230 uint32_t c; |
231 uint32_t* buf; | 231 const uint32_t* buf; |
232 uint32_t* obuf = (uint32_t*) out; | 232 uint32_t* obuf = (uint32_t*) out; |
233 | 233 |
234 off = (int)((long)inbuffer & 3); | 234 off = (int)((long)inbuffer & 3); |
235 buf = (uint32_t*) (inbuffer - off); | 235 buf = (const uint32_t*) (inbuffer - off); |
236 c = be2me_32((0x537F6103 >> (off*8)) | (0x537F6103 << (32-(off*8)))); | 236 c = be2me_32((0x537F6103 >> (off*8)) | (0x537F6103 << (32-(off*8)))); |
237 bytes += 3 + off; | 237 bytes += 3 + off; |
238 for (i = 0; i < bytes/4; i++) | 238 for (i = 0; i < bytes/4; i++) |
239 obuf[i] = c ^ buf[i]; | 239 obuf[i] = c ^ buf[i]; |
240 | 240 |
866 * @param avctx pointer to the AVCodecContext | 866 * @param avctx pointer to the AVCodecContext |
867 */ | 867 */ |
868 | 868 |
869 static int atrac3_decode_frame(AVCodecContext *avctx, | 869 static int atrac3_decode_frame(AVCodecContext *avctx, |
870 void *data, int *data_size, | 870 void *data, int *data_size, |
871 uint8_t *buf, int buf_size) { | 871 const uint8_t *buf, int buf_size) { |
872 ATRAC3Context *q = avctx->priv_data; | 872 ATRAC3Context *q = avctx->priv_data; |
873 int result = 0, i; | 873 int result = 0, i; |
874 uint8_t* databuf; | 874 uint8_t* databuf; |
875 int16_t* samples = data; | 875 int16_t* samples = data; |
876 | 876 |
917 */ | 917 */ |
918 | 918 |
919 static int atrac3_decode_init(AVCodecContext *avctx) | 919 static int atrac3_decode_init(AVCodecContext *avctx) |
920 { | 920 { |
921 int i; | 921 int i; |
922 uint8_t *edata_ptr = avctx->extradata; | 922 const uint8_t *edata_ptr = avctx->extradata; |
923 ATRAC3Context *q = avctx->priv_data; | 923 ATRAC3Context *q = avctx->priv_data; |
924 | 924 |
925 /* Take data from the AVCodecContext (RM container). */ | 925 /* Take data from the AVCodecContext (RM container). */ |
926 q->sample_rate = avctx->sample_rate; | 926 q->sample_rate = avctx->sample_rate; |
927 q->channels = avctx->channels; | 927 q->channels = avctx->channels; |