};
#define PSY_3GPP_BITS_TO_PE(bits) ((bits) * 1.18f)
+#define PSY_3GPP_PE_TO_BITS(bits) ((bits) / 1.18f)
/* LAME psy model constants */
#define PSY_LAME_FIR_LEN 21 ///< LAME psy model FIR order
desired_pe *= av_clipf(pctx->pe.previous / PSY_3GPP_BITS_TO_PE(ctx->bitres.bits),
0.85f, 1.15f);
pctx->pe.previous = PSY_3GPP_BITS_TO_PE(desired_bits);
+ ctx->bitres.alloc = desired_bits;
if (desired_pe < pe) {
/* 5.6.1.3.4 "First Estimation of the reduction value" */
psy_band->threshold = band->thr;
psy_band->energy = band->energy;
psy_band->spread = band->active_lines * 2.0f / band_sizes[g];
+ psy_band->bits = PSY_3GPP_PE_TO_BITS(band->pe);
}
}