diff options
author | Martijn van Beurden <mvanb1@gmail.com> | 2014-07-28 13:04:56 +0200 |
---|---|---|
committer | Erik de Castro Lopo <erikd@mega-nerd.com> | 2014-07-28 21:40:00 +1000 |
commit | 27846708fe6271e5e3965a4bbad99baa1ca24c49 (patch) | |
tree | f426ec6f4a8c66b6830f95da44d160d499751bcb /src | |
parent | 6a28facd7cd70f7ad0c6bc37e3a661dbfd850b45 (diff) | |
download | flac-27846708fe6271e5e3965a4bbad99baa1ca24c49.tar.gz |
Fix bug when using -p switch during compression
When using the -p switch during encoding, the encoder should try
different qlp predictor precision steps. However, some faulty code
was too severely restricting the possible steps. This patch lifts
the restriction to match a restriction coded a little further in
the process. This doesn't make using -p worth your while, but at
least it doesn't create larger files now
Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/libFLAC/stream_encoder.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libFLAC/stream_encoder.c b/src/libFLAC/stream_encoder.c index 9dfb0c53..8d4cfcca 100644 --- a/src/libFLAC/stream_encoder.c +++ b/src/libFLAC/stream_encoder.c @@ -3428,9 +3428,9 @@ FLAC__bool process_subframe_( } if(encoder->protected_->do_qlp_coeff_prec_search) { min_qlp_coeff_precision = FLAC__MIN_QLP_COEFF_PRECISION; - /* try to ensure a 32-bit datapath throughout for 16bps(+1bps for side channel) or less */ - if(subframe_bps <= 17) { - max_qlp_coeff_precision = flac_min(32 - subframe_bps - lpc_order, FLAC__MAX_QLP_COEFF_PRECISION); + /* try to keep qlp coeff precision such that only 32-bit math is required for decode of <=16bps streams */ + if(subframe_bps <= 16) { + max_qlp_coeff_precision = flac_min(32 - subframe_bps - FLAC__bitmath_ilog2(lpc_order), FLAC__MAX_QLP_COEFF_PRECISION); max_qlp_coeff_precision = flac_max(max_qlp_coeff_precision, min_qlp_coeff_precision); } else |