summaryrefslogtreecommitdiff
path: root/libavcodec/alacenc.c
diff options
context:
space:
mode:
authorBenoit Fouet <benoit.fouet@free.fr>2009-03-03 13:11:10 +0000
committerBenoit Fouet <benoit.fouet@free.fr>2009-03-03 13:11:10 +0000
commit4f46099b9054f5a1cb7f1609a267f6e0e286cfd1 (patch)
tree9314ea046b423cf6995ac93e5b0d40d2aa6f1d18 /libavcodec/alacenc.c
parentc7509fff57e72366562e14ea05b4776f9ef93486 (diff)
Use sign_extend().
On behalf of Jai. Originally committed as revision 17759 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/alacenc.c')
-rw-r--r--libavcodec/alacenc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavcodec/alacenc.c b/libavcodec/alacenc.c
index 9fd5064514..886b6c68ba 100644
--- a/libavcodec/alacenc.c
+++ b/libavcodec/alacenc.c
@@ -23,6 +23,7 @@
#include "bitstream.h"
#include "dsputil.h"
#include "lpc.h"
+#include "mathops.h"
#define DEFAULT_FRAME_SIZE 4096
#define DEFAULT_SAMPLE_SIZE 16
@@ -253,8 +254,8 @@ static void alac_linear_predictor(AlacEncodeContext *s, int ch)
sum >>= lpc.lpc_quant;
sum += samples[0];
- residual[i] = (samples[lpc.lpc_order+1] - sum) << (32 - s->write_sample_size) >>
- (32 - s->write_sample_size);
+ residual[i] = sign_extend(samples[lpc.lpc_order+1] - sum,
+ s->write_sample_size);
res_val = residual[i];
if(res_val) {