Commit 701486a0 authored by michael's avatar michael

dither lpc cpeffs


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@5727 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 09ea4a61
...@@ -661,7 +661,7 @@ static void quantize_lpc_coefs(double *lpc_in, int order, int precision, ...@@ -661,7 +661,7 @@ static void quantize_lpc_coefs(double *lpc_in, int order, int precision,
int32_t *lpc_out, int *shift) int32_t *lpc_out, int *shift)
{ {
int i; int i;
double cmax; double cmax, error;
int32_t qmax; int32_t qmax;
int sh; int sh;
...@@ -697,8 +697,11 @@ static void quantize_lpc_coefs(double *lpc_in, int order, int precision, ...@@ -697,8 +697,11 @@ static void quantize_lpc_coefs(double *lpc_in, int order, int precision,
} }
/* output quantized coefficients and level shift */ /* output quantized coefficients and level shift */
error=0;
for(i=0; i<order; i++) { for(i=0; i<order; i++) {
lpc_out[i] = (int32_t)(lpc_in[i] * (1 << sh)); error += lpc_in[i] * (1 << sh);
lpc_out[i] = clip(lrintf(error), -qmax, qmax);
error -= lpc_out[i];
} }
*shift = sh; *shift = sh;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment