Commit 87d27a41 authored by reutelhuber's avatar reutelhuber
Browse files

set input memory of DFT analysis for BPF to zero for HQ core to avoid a...

set input memory of DFT analysis for BPF to zero for HQ core to avoid a potential issue with PLC and bitrate switching
parent 5fd23c7d
Loading
Loading
Loading
Loading
Loading

lib_com/options.h

100644 → 100755
+1 −0
Original line number Diff line number Diff line
@@ -173,6 +173,7 @@
#define NONBE_FIX_589_JBM_TC_OFFSETS                    /* FhG: issue 589: wrong offset into the TC buffers is used in some rendering paths in the JBM main rendering function */
#define FIX_MEM_REALLOC_IND_LIST                        /* VA: issue 601: failure of the automatic memory re-allocation mechanism when ind_list[] buffer is depleted in MASA mode with 2 TC*/
#define FIX_581_CLANG_OFFSET_TO_NULL                    /* FhG: issue 581: fix CLANG error about applying an offset to a NULL pointer */
#define FIX_586_BPF_DFT_MEM                             /* FhG: issue 586: set input memory of DFT analysis of BPF signal to zero for HQ core to fix issue with PLC and bitrate switching */

/* ################## End BE DEVELOPMENT switches ######################### */

+11 −0
Original line number Diff line number Diff line
@@ -230,10 +230,21 @@ void stereo_dft_dec_core_switching(
            mvr2r( &output[st->L_frame - NS2SA( st->L_frame * FRAMES_PER_SEC, STEREO_DFT32MS_OVL_NS )], hCPE->hStereoDft->buff_LBTCX_mem, NS2SA( st->L_frame * FRAMES_PER_SEC, STEREO_DFT32MS_OVL_NS ) );

            /* BPF */
#ifdef FIX_586_BPF_DFT_MEM
            if ( st->p_bpf_noise_buf && st->core != HQ_CORE )
#else
            if ( st->p_bpf_noise_buf )
#endif
            {
                stereo_dft_dec_analyze( hCPE, st->p_bpf_noise_buf, DFT, 0, st->L_frame, output_frame, DFT_STEREO_DEC_ANA_BPF, 2, 0 );
            }
#ifdef FIX_586_BPF_DFT_MEM
            /* st->p_bpf_noise_buf not updated for HQ core -> skip analysis and set input memory to zero */
            else if ( st->p_bpf_noise_buf && st->core == HQ_CORE )
            {
                set_zero( hCPE->input_mem_BPF[0], STEREO_DFT32MS_OVL_16k );
            }
#endif

            /* TCX */
            stereo_dft_dec_analyze( hCPE, synth, DFT, 0, L_frameTCX, output_frame, DFT_STEREO_DEC_ANA_FB, 0, 0 );