comparison ac3enc.c @ 12262:dde20597f15e libavcodec

Use "const" qualifier for pointers that point to input data of audio encoders. This is purely for clarity/documentation purposes.
author reimar
date Sat, 24 Jul 2010 13:59:49 +0000
parents 8b28e74de2c0
children
comparison
equal deleted inserted replaced
12261:940736055764 12262:dde20597f15e
1179 1179
1180 static int AC3_encode_frame(AVCodecContext *avctx, 1180 static int AC3_encode_frame(AVCodecContext *avctx,
1181 unsigned char *frame, int buf_size, void *data) 1181 unsigned char *frame, int buf_size, void *data)
1182 { 1182 {
1183 AC3EncodeContext *s = avctx->priv_data; 1183 AC3EncodeContext *s = avctx->priv_data;
1184 int16_t *samples = data; 1184 const int16_t *samples = data;
1185 int i, j, k, v, ch; 1185 int i, j, k, v, ch;
1186 int16_t input_samples[N]; 1186 int16_t input_samples[N];
1187 int32_t mdct_coef[NB_BLOCKS][AC3_MAX_CHANNELS][N/2]; 1187 int32_t mdct_coef[NB_BLOCKS][AC3_MAX_CHANNELS][N/2];
1188 uint8_t exp[NB_BLOCKS][AC3_MAX_CHANNELS][N/2]; 1188 uint8_t exp[NB_BLOCKS][AC3_MAX_CHANNELS][N/2];
1189 uint8_t exp_strategy[NB_BLOCKS][AC3_MAX_CHANNELS]; 1189 uint8_t exp_strategy[NB_BLOCKS][AC3_MAX_CHANNELS];
1195 frame_bits = 0; 1195 frame_bits = 0;
1196 for(ch=0;ch<s->nb_all_channels;ch++) { 1196 for(ch=0;ch<s->nb_all_channels;ch++) {
1197 int ich = s->channel_map[ch]; 1197 int ich = s->channel_map[ch];
1198 /* fixed mdct to the six sub blocks & exponent computation */ 1198 /* fixed mdct to the six sub blocks & exponent computation */
1199 for(i=0;i<NB_BLOCKS;i++) { 1199 for(i=0;i<NB_BLOCKS;i++) {
1200 int16_t *sptr; 1200 const int16_t *sptr;
1201 int sinc; 1201 int sinc;
1202 1202
1203 /* compute input samples */ 1203 /* compute input samples */
1204 memcpy(input_samples, s->last_samples[ich], N/2 * sizeof(int16_t)); 1204 memcpy(input_samples, s->last_samples[ich], N/2 * sizeof(int16_t));
1205 sinc = s->nb_all_channels; 1205 sinc = s->nb_all_channels;