Mercurial > libavcodec.hg
comparison atrac3.c @ 5523:c2ab2ac31edb libavcodec
use av_clip_int16() where it makes sense
author | aurel |
---|---|
date | Sat, 11 Aug 2007 22:48:55 +0000 |
parents | 9f8219a3b86f |
children | d155d4915e1c |
comparison
equal
deleted
inserted
replaced
5522:acaaff7b6fb8 | 5523:c2ab2ac31edb |
---|---|
893 } | 893 } |
894 | 894 |
895 if (q->channels == 1) { | 895 if (q->channels == 1) { |
896 /* mono */ | 896 /* mono */ |
897 for (i = 0; i<1024; i++) | 897 for (i = 0; i<1024; i++) |
898 samples[i] = av_clip(round(q->outSamples[i]), -32768, 32767); | 898 samples[i] = av_clip_int16(round(q->outSamples[i])); |
899 *data_size = 1024 * sizeof(int16_t); | 899 *data_size = 1024 * sizeof(int16_t); |
900 } else { | 900 } else { |
901 /* stereo */ | 901 /* stereo */ |
902 for (i = 0; i < 1024; i++) { | 902 for (i = 0; i < 1024; i++) { |
903 samples[i*2] = av_clip(round(q->outSamples[i]), -32768, 32767); | 903 samples[i*2] = av_clip_int16(round(q->outSamples[i])); |
904 samples[i*2+1] = av_clip(round(q->outSamples[1024+i]), -32768, 32767); | 904 samples[i*2+1] = av_clip_int16(round(q->outSamples[1024+i])); |
905 } | 905 } |
906 *data_size = 2048 * sizeof(int16_t); | 906 *data_size = 2048 * sizeof(int16_t); |
907 } | 907 } |
908 | 908 |
909 return avctx->block_align; | 909 return avctx->block_align; |