# HG changeset patch # User reimar # Date 1279979989 0 # Node ID dde20597f15ee82fc43e03daab82148e641c4b82 # Parent 9407360557643df013204f8fb50c97e54ec9407e Use "const" qualifier for pointers that point to input data of audio encoders. This is purely for clarity/documentation purposes. diff -r 940736055764 -r dde20597f15e ac3enc.c --- a/ac3enc.c Sat Jul 24 04:23:26 2010 +0000 +++ b/ac3enc.c Sat Jul 24 13:59:49 2010 +0000 @@ -1181,7 +1181,7 @@ unsigned char *frame, int buf_size, void *data) { AC3EncodeContext *s = avctx->priv_data; - int16_t *samples = data; + const int16_t *samples = data; int i, j, k, v, ch; int16_t input_samples[N]; int32_t mdct_coef[NB_BLOCKS][AC3_MAX_CHANNELS][N/2]; @@ -1197,7 +1197,7 @@ int ich = s->channel_map[ch]; /* fixed mdct to the six sub blocks & exponent computation */ for(i=0;iavctx->channels;ch++) { - int16_t *sptr = input_samples + ch; + const int16_t *sptr = input_samples + ch; for(i=0;iavctx->frame_size;i++) { s->sample_buf[ch][i] = *sptr; sptr += s->avctx->channels; @@ -482,7 +482,7 @@ if((s->compression_level == 0) || verbatim_flag) { // Verbatim mode - int16_t *samples = data; + const int16_t *samples = data; write_frame_header(s, 1); for(i=0; iframe_size*avctx->channels; i++) { put_sbits(pb, 16, *samples++); diff -r 940736055764 -r dde20597f15e flacenc.c --- a/flacenc.c Sat Jul 24 04:23:26 2010 +0000 +++ b/flacenc.c Sat Jul 24 13:59:49 2010 +0000 @@ -446,7 +446,7 @@ /** * Copy channel-interleaved input samples into separate subframes */ -static void copy_samples(FlacEncodeContext *s, int16_t *samples) +static void copy_samples(FlacEncodeContext *s, const int16_t *samples) { int i, j, ch; FlacFrame *frame; @@ -1204,7 +1204,7 @@ flush_put_bits(&s->pb); } -static void update_md5_sum(FlacEncodeContext *s, int16_t *samples) +static void update_md5_sum(FlacEncodeContext *s, const int16_t *samples) { #if HAVE_BIGENDIAN int i; @@ -1213,7 +1213,7 @@ av_md5_update(s->md5ctx, (uint8_t *)&smp, 2); } #else - av_md5_update(s->md5ctx, (uint8_t *)samples, s->frame.blocksize*s->channels*2); + av_md5_update(s->md5ctx, (const uint8_t *)samples, s->frame.blocksize*s->channels*2); #endif } @@ -1222,7 +1222,7 @@ { int ch; FlacEncodeContext *s; - int16_t *samples = data; + const int16_t *samples = data; int out_bytes; int reencoded=0; diff -r 940736055764 -r dde20597f15e g726.c --- a/g726.c Sat Jul 24 04:23:26 2010 +0000 +++ b/g726.c Sat Jul 24 13:59:49 2010 +0000 @@ -348,7 +348,7 @@ uint8_t *dst, int buf_size, void *data) { G726Context *c = avctx->priv_data; - short *samples = data; + const short *samples = data; PutBitContext pb; init_put_bits(&pb, dst, 1024*1024); diff -r 940736055764 -r dde20597f15e mpegaudioenc.c --- a/mpegaudioenc.c Sat Jul 24 04:23:26 2010 +0000 +++ b/mpegaudioenc.c Sat Jul 24 13:59:49 2010 +0000 @@ -306,7 +306,7 @@ #define WSHIFT (WFRAC_BITS + 15 - FRAC_BITS) -static void filter(MpegAudioContext *s, int ch, short *samples, int incr) +static void filter(MpegAudioContext *s, int ch, const short *samples, int incr) { short *p, *q; int sum, offset, i, j; @@ -752,7 +752,7 @@ unsigned char *frame, int buf_size, void *data) { MpegAudioContext *s = avctx->priv_data; - short *samples = data; + const short *samples = data; short smr[MPA_MAX_CHANNELS][SBLIMIT]; unsigned char bit_alloc[MPA_MAX_CHANNELS][SBLIMIT]; int padding, i; diff -r 940736055764 -r dde20597f15e nellymoserenc.c --- a/nellymoserenc.c Sat Jul 24 04:23:26 2010 +0000 +++ b/nellymoserenc.c Sat Jul 24 13:59:49 2010 +0000 @@ -351,7 +351,7 @@ static int encode_frame(AVCodecContext *avctx, uint8_t *frame, int buf_size, void *data) { NellyMoserEncodeContext *s = avctx->priv_data; - int16_t *samples = data; + const int16_t *samples = data; int i; if (s->last_frame) diff -r 940736055764 -r dde20597f15e pcm.c --- a/pcm.c Sat Jul 24 04:23:26 2010 +0000 +++ b/pcm.c Sat Jul 24 13:59:49 2010 +0000 @@ -81,14 +81,14 @@ unsigned char *frame, int buf_size, void *data) { int n, sample_size, v; - short *samples; + const short *samples; unsigned char *dst; - uint8_t *srcu8; - int16_t *samples_int16_t; - int32_t *samples_int32_t; - int64_t *samples_int64_t; - uint16_t *samples_uint16_t; - uint32_t *samples_uint32_t; + const uint8_t *srcu8; + const int16_t *samples_int16_t; + const int32_t *samples_int32_t; + const int64_t *samples_int64_t; + const uint16_t *samples_uint16_t; + const uint32_t *samples_uint32_t; sample_size = av_get_bits_per_sample(avctx->codec->id)/8; n = buf_size / sample_size; diff -r 940736055764 -r dde20597f15e roqaudioenc.c --- a/roqaudioenc.c Sat Jul 24 04:23:26 2010 +0000 +++ b/roqaudioenc.c Sat Jul 24 13:59:49 2010 +0000 @@ -108,7 +108,7 @@ unsigned char *frame, int buf_size, void *data) { int i, samples, stereo, ch; - short *in; + const short *in; unsigned char *out; ROQDPCMContext *context = avctx->priv_data; diff -r 940736055764 -r dde20597f15e vorbis_enc.c --- a/vorbis_enc.c Sat Jul 24 04:23:26 2010 +0000 +++ b/vorbis_enc.c Sat Jul 24 13:59:49 2010 +0000 @@ -888,7 +888,7 @@ } } -static int apply_window_and_mdct(vorbis_enc_context *venc, signed short *audio, +static int apply_window_and_mdct(vorbis_enc_context *venc, const signed short *audio, int samples) { int i, j, channel; @@ -973,7 +973,7 @@ int buf_size, void *data) { vorbis_enc_context *venc = avccontext->priv_data; - signed short *audio = data; + const signed short *audio = data; int samples = data ? avccontext->frame_size : 0; vorbis_enc_mode *mode; vorbis_enc_mapping *mapping; diff -r 940736055764 -r dde20597f15e wmaenc.c --- a/wmaenc.c Sat Jul 24 04:23:26 2010 +0000 +++ b/wmaenc.c Sat Jul 24 13:59:49 2010 +0000 @@ -74,7 +74,7 @@ } -static void apply_window_and_mdct(AVCodecContext * avctx, signed short * audio, int len) { +static void apply_window_and_mdct(AVCodecContext * avctx, const signed short * audio, int len) { WMACodecContext *s = avctx->priv_data; int window_index= s->frame_len_bits - s->block_len_bits; int i, j, channel; @@ -328,7 +328,7 @@ static int encode_superframe(AVCodecContext *avctx, unsigned char *buf, int buf_size, void *data){ WMACodecContext *s = avctx->priv_data; - short *samples = data; + const short *samples = data; int i, total_gain; s->block_len_bits= s->frame_len_bits; //required by non variable block len