diff --git a/src/libsac/libsac.cpp b/src/libsac/libsac.cpp index ab16a5b..37747ea 100644 --- a/src/libsac/libsac.cpp +++ b/src/libsac/libsac.cpp @@ -178,12 +178,11 @@ void SetParam(Predictor::tparam ¶m,const SacProfile &profile,bool optimize=f void FrameCoder::CalcRemapError(int ch, int numsamples) { int32_t emax_map=0; - for (int i=0;iemax_map) emax_map=map_es; + int32_t map_ue=MathUtils::S2U(map_e); + s2u_error_map[ch][i]=map_ue; + if (map_ue>emax_map) emax_map=map_ue; } framestats[ch].maxbpn_map=MathUtils::iLog2(emax_map); } @@ -196,27 +195,29 @@ void FrameCoder::PredictFrame(const SacProfile &profile,int from,int numsamples, Predictor pr(param); // predict master channel + const auto *src0=&samples[0][from]; for (int i=0;i