comparison pcm.c @ 6218:dfdff1ca78a7 libavcodec

consts I have underestimated this a little, and these are just some ...
author michael
date Fri, 01 Feb 2008 03:26:31 +0000
parents bd7600c7a061
children 48759bfbd073
comparison
equal deleted inserted replaced
6217:f838213ca91b 6218:dfdff1ca78a7
353 * \param src input samples 353 * \param src input samples
354 * \param samples output samples 354 * \param samples output samples
355 * \param src_len number of bytes in src 355 * \param src_len number of bytes in src
356 */ 356 */
357 static inline void decode_to16(int bps, int le, int us, 357 static inline void decode_to16(int bps, int le, int us,
358 uint8_t **src, short **samples, int src_len) 358 const uint8_t **src, short **samples, int src_len)
359 { 359 {
360 int usum = us ? -0x8000 : 0; 360 int usum = us ? -0x8000 : 0;
361 register int n = src_len / bps; 361 register int n = src_len / bps;
362 if (le) *src += bps - 2; 362 if (le) *src += bps - 2;
363 for(;n>0;n--) { 363 for(;n>0;n--) {
371 if (le) *src -= bps - 2; 371 if (le) *src -= bps - 2;
372 } 372 }
373 373
374 static int pcm_decode_frame(AVCodecContext *avctx, 374 static int pcm_decode_frame(AVCodecContext *avctx,
375 void *data, int *data_size, 375 void *data, int *data_size,
376 uint8_t *buf, int buf_size) 376 const uint8_t *buf, int buf_size)
377 { 377 {
378 PCMDecode *s = avctx->priv_data; 378 PCMDecode *s = avctx->priv_data;
379 int c, n; 379 int c, n;
380 short *samples; 380 short *samples;
381 uint8_t *src, *src2[MAX_CHANNELS]; 381 const uint8_t *src, *src2[MAX_CHANNELS];
382 382
383 samples = data; 383 samples = data;
384 src = buf; 384 src = buf;
385 385
386 n= av_get_bits_per_sample(avctx->codec_id)/8; 386 n= av_get_bits_per_sample(avctx->codec_id)/8;