lvqcl
2015-Apr-22 20:45 UTC
[flac-dev] "keep qlp coeff precision such that only 32-bit math is required"
Martijn van Beurden wrote:> Yes, but that MAX value is used to loop over the > qlp_coeff_precision values between MIN and MAX. So, if the > qlp_coeff_precision value is limited in the loop but MAX is not > limited, the loop does the exact same thing multiple times: a > waste of time. Therefore, only the MAX should be limited. > > I don't think the logic is needed directly after >> min_qlp_coeff_precision = max_qlp_coeff_precision = encoder->protected_->qlp_coeff_precision; > because that value is either chosen by the encoder (it is a > lookup value, and is always small enough not to trigger this, > set in stream_encoder.c around line 700) or it is set through > the encoder, in which case it should probably not be overriden > without notice.Currently evaluate_lpc_subframe_() automatically adjusts qlp_coeff_precision when a user sets non-standard order value (via -l option). I don't think that it's incorrect behavior. Why not? (And my initial point was that the current limit of qlp_coeff_precision is not enough, and 32-bit datapath is *not* ensured for 16-bit input audio).
Martijn van Beurden
2015-Apr-22 21:40 UTC
[flac-dev] "keep qlp coeff precision such that only 32-bit math is required"
Op 22-04-15 om 22:45 schreef lvqcl:> Currently evaluate_lpc_subframe_() automatically adjusts > qlp_coeff_precision when a user sets non-standard order value > (via -l option). I don't think that it's incorrect behavior. > Why not?Because what is the point in setting a non-standard value if it not used anyway?> (And my initial point was that the current limit of > qlp_coeff_precision is not enough, and 32-bit datapath is > *not* ensured for 16-bit input audio).Yes, the code should be used for 17-bit audio as well. That's no reason to duplicate the code though.
lvqcl
2015-Apr-23 18:53 UTC
[flac-dev] "keep qlp coeff precision such that only 32-bit math is required"
Martijn van Beurden wrote:> Op 22-04-15 om 22:45 schreef lvqcl: >> Currently evaluate_lpc_subframe_() automatically adjusts >> qlp_coeff_precision when a user sets non-standard order value >> (via -l option). I don't think that it's incorrect behavior. >> Why not? > > Because what is the point in setting a non-standard value if it > not used anyway?I think that the comment in the code ("try to keep qlp coeff precision such that only 32-bit math is required for decode of <=16bps streams") explains it: flac overrides the value of qlp_coeff_precision in order to increase decoding speed. 64-bit additions, multiplications and shifts are relatively slow on 32-bit CPUs, and 32-bit operations are preferable.