Use sign_extend().

On behalf of Jai.

Originally committed as revision 17759 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Benoit Fouet 2009-03-03 13:11:10 +00:00
parent c7509fff57
commit 4f46099b90
1 changed files with 3 additions and 2 deletions

View File

@ -23,6 +23,7 @@
#include "bitstream.h" #include "bitstream.h"
#include "dsputil.h" #include "dsputil.h"
#include "lpc.h" #include "lpc.h"
#include "mathops.h"
#define DEFAULT_FRAME_SIZE 4096 #define DEFAULT_FRAME_SIZE 4096
#define DEFAULT_SAMPLE_SIZE 16 #define DEFAULT_SAMPLE_SIZE 16
@ -253,8 +254,8 @@ static void alac_linear_predictor(AlacEncodeContext *s, int ch)
sum >>= lpc.lpc_quant; sum >>= lpc.lpc_quant;
sum += samples[0]; sum += samples[0];
residual[i] = (samples[lpc.lpc_order+1] - sum) << (32 - s->write_sample_size) >> residual[i] = sign_extend(samples[lpc.lpc_order+1] - sum,
(32 - s->write_sample_size); s->write_sample_size);
res_val = residual[i]; res_val = residual[i];
if(res_val) { if(res_val) {