Mercurial > libavcodec.hg
comparison flacenc.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 | e59926e2c50c |
children | c13e3c23d093 |
comparison
equal
deleted
inserted
replaced
12261:940736055764 | 12262:dde20597f15e |
---|---|
444 } | 444 } |
445 | 445 |
446 /** | 446 /** |
447 * Copy channel-interleaved input samples into separate subframes | 447 * Copy channel-interleaved input samples into separate subframes |
448 */ | 448 */ |
449 static void copy_samples(FlacEncodeContext *s, int16_t *samples) | 449 static void copy_samples(FlacEncodeContext *s, const int16_t *samples) |
450 { | 450 { |
451 int i, j, ch; | 451 int i, j, ch; |
452 FlacFrame *frame; | 452 FlacFrame *frame; |
453 | 453 |
454 frame = &s->frame; | 454 frame = &s->frame; |
1202 s->pb.buf, put_bits_count(&s->pb)>>3)); | 1202 s->pb.buf, put_bits_count(&s->pb)>>3)); |
1203 put_bits(&s->pb, 16, crc); | 1203 put_bits(&s->pb, 16, crc); |
1204 flush_put_bits(&s->pb); | 1204 flush_put_bits(&s->pb); |
1205 } | 1205 } |
1206 | 1206 |
1207 static void update_md5_sum(FlacEncodeContext *s, int16_t *samples) | 1207 static void update_md5_sum(FlacEncodeContext *s, const int16_t *samples) |
1208 { | 1208 { |
1209 #if HAVE_BIGENDIAN | 1209 #if HAVE_BIGENDIAN |
1210 int i; | 1210 int i; |
1211 for(i = 0; i < s->frame.blocksize*s->channels; i++) { | 1211 for(i = 0; i < s->frame.blocksize*s->channels; i++) { |
1212 int16_t smp = av_le2ne16(samples[i]); | 1212 int16_t smp = av_le2ne16(samples[i]); |
1213 av_md5_update(s->md5ctx, (uint8_t *)&smp, 2); | 1213 av_md5_update(s->md5ctx, (uint8_t *)&smp, 2); |
1214 } | 1214 } |
1215 #else | 1215 #else |
1216 av_md5_update(s->md5ctx, (uint8_t *)samples, s->frame.blocksize*s->channels*2); | 1216 av_md5_update(s->md5ctx, (const uint8_t *)samples, s->frame.blocksize*s->channels*2); |
1217 #endif | 1217 #endif |
1218 } | 1218 } |
1219 | 1219 |
1220 static int flac_encode_frame(AVCodecContext *avctx, uint8_t *frame, | 1220 static int flac_encode_frame(AVCodecContext *avctx, uint8_t *frame, |
1221 int buf_size, void *data) | 1221 int buf_size, void *data) |
1222 { | 1222 { |
1223 int ch; | 1223 int ch; |
1224 FlacEncodeContext *s; | 1224 FlacEncodeContext *s; |
1225 int16_t *samples = data; | 1225 const int16_t *samples = data; |
1226 int out_bytes; | 1226 int out_bytes; |
1227 int reencoded=0; | 1227 int reencoded=0; |
1228 | 1228 |
1229 s = avctx->priv_data; | 1229 s = avctx->priv_data; |
1230 | 1230 |