/** Places SBR in pure upsampling mode. */
static void sbr_turnoff(SpectralBandReplication *sbr) {
sbr->start = 0;
+ sbr->ready_for_dequant = 0;
// Init defults used in pure upsampling mode
sbr->kx[1] = 32; //Typo in spec, kx' inits to 32
sbr->m[1] = 0;
SpectrumParameters old_spectrum_params;
sbr->start = 1;
+ sbr->ready_for_dequant = 0;
// Save last spectrum parameters variables to compare to new ones
memcpy(&old_spectrum_params, &sbr->spectrum_params, sizeof(SpectrumParameters));
unsigned int cnt = get_bits_count(gb);
sbr->id_aac = id_aac;
+ sbr->ready_for_dequant = 1;
if (id_aac == TYPE_SCE || id_aac == TYPE_CCE) {
if (read_sbr_single_channel_element(ac, sbr, gb)) {
sbr_turnoff(sbr);
}
+ if (sbr->start && !sbr->ready_for_dequant) {
+ av_log(ac->avctx, AV_LOG_ERROR,
+ "No quantized data read for sbr_dequant.\n");
+ sbr_turnoff(sbr);
+ }
+
if (!sbr->kx_and_m_pushed) {
sbr->kx[0] = sbr->kx[1];
sbr->m[0] = sbr->m[1];
if (sbr->start) {
sbr_dequant(sbr, id_aac);
+ sbr->ready_for_dequant = 0;
}
for (ch = 0; ch < nch; ch++) {
/* decode channel */