Skip to content

HP20 filtering bug in SBA/OSBA bitrate switching

In the case of bitrate switching in SBA or OSBA format which involves a change of the number of analysis channels, the use of HP20 filtering at the encoder is wrong. The issue comes from the order of operations in ivas_enc(), see below for simplified signal flow:

n = getNumChanAnalysis( st_ivas );  // <- 'n' is based on the last frame set-up
for ( i = 0; i < n; i++ )
{
    hp20( data_f[HOA_keep_ind[st_ivas->hSpar->hMdEnc->HOA_md_ind[i]]], input_frame, st_ivas->mem_hp20_in[i], input_Fs );
}

if ( ivas_format == SBA_FORMAT )
{
   ivas_sba_enc_reconfigure( st_ivas ) ;  // <- new set-up is done here (st_ivas->sba_analysis_order might change), and the number of st_ivas->mem_hp20_in[] handles might change as well
}

In other words, ivas_sba_enc_reconfigure() should be called before hp20(), otherwise the hp20 filter handle reconfiguration is done only at the second frame after the bitrate switching, and some channels of the first frame after the bitrate switching are thus not hp20-filtered.

I will take care of this issue as part of another update consisting of the introduction of a common reconfiguration function (details will come).

Edited by vaclav