mirror of
https://github.com/xenia-project/FFmpeg.git
synced 2024-11-28 14:01:27 +00:00
dither lpc cpeffs
Originally committed as revision 5727 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
ebd7617ba7
commit
1484a46753
@ -661,7 +661,7 @@ static void quantize_lpc_coefs(double *lpc_in, int order, int precision,
|
||||
int32_t *lpc_out, int *shift)
|
||||
{
|
||||
int i;
|
||||
double cmax;
|
||||
double cmax, error;
|
||||
int32_t qmax;
|
||||
int sh;
|
||||
|
||||
@ -697,8 +697,11 @@ static void quantize_lpc_coefs(double *lpc_in, int order, int precision,
|
||||
}
|
||||
|
||||
/* output quantized coefficients and level shift */
|
||||
error=0;
|
||||
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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user