changeset 9110:ac31a0265eb9 libavcodec

Use sign_extend(). On behalf of Jai.
author benoit
date Tue, 03 Mar 2009 13:11:10 +0000
parents 8053722e1c7f
children 5f04afc7af53
files alacenc.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/alacenc.c	Tue Mar 03 05:53:38 2009 +0000
+++ b/alacenc.c	Tue Mar 03 13:11:10 2009 +0000
@@ -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 @@
 
             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) {