mirror of
https://github.com/claunia/flac.git
synced 2025-12-16 18:54:26 +00:00
fix from Miroslav on the lpc datapath switching logic
This commit is contained in:
@@ -1738,10 +1738,11 @@ FLAC__bool read_subframe_lpc_(FLAC__StreamDecoder *decoder, unsigned channel, un
|
|||||||
|
|
||||||
/* decode the subframe */
|
/* decode the subframe */
|
||||||
memcpy(decoder->private_->output[channel], subframe->warmup, sizeof(FLAC__int32) * order);
|
memcpy(decoder->private_->output[channel], subframe->warmup, sizeof(FLAC__int32) * order);
|
||||||
if(bps <= 16 && subframe->qlp_coeff_precision <= 16)
|
if(bps + subframe->qlp_coeff_precision + FLAC__bitmath_ilog2(order) <= 32)
|
||||||
decoder->private_->local_lpc_restore_signal_16bit(decoder->private_->residual[channel], decoder->private_->frame.header.blocksize-order, subframe->qlp_coeff, order, subframe->quantization_level, decoder->private_->output[channel]+order);
|
if(bps <= 16 && subframe->qlp_coeff_precision <= 16)
|
||||||
else if(bps + subframe->qlp_coeff_precision + order <= 32)
|
decoder->private_->local_lpc_restore_signal_16bit(decoder->private_->residual[channel], decoder->private_->frame.header.blocksize-order, subframe->qlp_coeff, order, subframe->quantization_level, decoder->private_->output[channel]+order);
|
||||||
decoder->private_->local_lpc_restore_signal(decoder->private_->residual[channel], decoder->private_->frame.header.blocksize-order, subframe->qlp_coeff, order, subframe->quantization_level, decoder->private_->output[channel]+order);
|
else
|
||||||
|
decoder->private_->local_lpc_restore_signal(decoder->private_->residual[channel], decoder->private_->frame.header.blocksize-order, subframe->qlp_coeff, order, subframe->quantization_level, decoder->private_->output[channel]+order);
|
||||||
else
|
else
|
||||||
decoder->private_->local_lpc_restore_signal_64bit(decoder->private_->residual[channel], decoder->private_->frame.header.blocksize-order, subframe->qlp_coeff, order, subframe->quantization_level, decoder->private_->output[channel]+order);
|
decoder->private_->local_lpc_restore_signal_64bit(decoder->private_->residual[channel], decoder->private_->frame.header.blocksize-order, subframe->qlp_coeff, order, subframe->quantization_level, decoder->private_->output[channel]+order);
|
||||||
|
|
||||||
|
|||||||
@@ -2267,10 +2267,11 @@ unsigned evaluate_lpc_subframe_(
|
|||||||
if(ret != 0)
|
if(ret != 0)
|
||||||
return 0; /* this is a hack to indicate to the caller that we can't do lp at this order on this subframe */
|
return 0; /* this is a hack to indicate to the caller that we can't do lp at this order on this subframe */
|
||||||
|
|
||||||
if(subframe_bps <= 16 && qlp_coeff_precision <= 16)
|
if(subframe_bps + qlp_coeff_precision + FLAC__bitmath_ilog2(order) <= 32)
|
||||||
encoder->private_->local_lpc_compute_residual_from_qlp_coefficients_16bit(signal+order, residual_samples, qlp_coeff, order, quantization, residual);
|
if(subframe_bps <= 16 && qlp_coeff_precision <= 16)
|
||||||
else if(subframe_bps + qlp_coeff_precision + order <= 32)
|
encoder->private_->local_lpc_compute_residual_from_qlp_coefficients_16bit(signal+order, residual_samples, qlp_coeff, order, quantization, residual);
|
||||||
encoder->private_->local_lpc_compute_residual_from_qlp_coefficients(signal+order, residual_samples, qlp_coeff, order, quantization, residual);
|
else
|
||||||
|
encoder->private_->local_lpc_compute_residual_from_qlp_coefficients(signal+order, residual_samples, qlp_coeff, order, quantization, residual);
|
||||||
else
|
else
|
||||||
encoder->private_->local_lpc_compute_residual_from_qlp_coefficients_64bit(signal+order, residual_samples, qlp_coeff, order, quantization, residual);
|
encoder->private_->local_lpc_compute_residual_from_qlp_coefficients_64bit(signal+order, residual_samples, qlp_coeff, order, quantization, residual);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user