Commit 8cc9d0ca authored by vaclav's avatar vaclav
Browse files

update within FIX_79_MASA2TC_BITRATE_SWITCHING: deallocate 'hStereoTCA' when...

update within FIX_79_MASA2TC_BITRATE_SWITCHING: deallocate 'hStereoTCA' when the handle is not employed
parent fd53c8fc
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -108,7 +108,6 @@ ivas_error ivas_cpe_dec(
        return error;
    }


    /*------------------------------------------------------------------*
     * Initialization
     *-----------------------------------------------------------------*/
@@ -399,7 +398,6 @@ ivas_error ivas_cpe_dec(
            return error;
        }


        /* DFT Stereo residual decoding */
        if ( hCPE->hStereoDft->res_cod_band_max > 0 && !st_ivas->bfi )
        {
@@ -583,7 +581,6 @@ ivas_error create_cpe_dec(
    hCPE->hStereoMdct = NULL;
    hCPE->hStereoTCA = NULL;
    hCPE->hStereoICBWE = NULL;

    hCPE->hStereoCng = NULL;

    hCPE->stereo_switching_counter = 10;
@@ -789,6 +786,7 @@ ivas_error create_cpe_dec(
        {
            return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Stereo MDCT\n" ) );
        }

        if ( st_ivas->ivas_format == STEREO_FORMAT && hCPE->element_brate <= MAX_MDCT_ITD_BRATE )
        {
            hCPE->hStereoMdct->use_itd = 1;
@@ -797,6 +795,7 @@ ivas_error create_cpe_dec(
        {
            hCPE->hStereoMdct->use_itd = 0;
        }

        hCPE->hStereoMdct->reverse_dmx = 0;
        hCPE->hStereoMdct->smooth_ratio = 1.f;
        set_s( hCPE->hStereoMdct->prev_ms_mask[0], 0, MAX_SFB );
+13 −0
Original line number Diff line number Diff line
@@ -893,6 +893,12 @@ ivas_error stereo_memory_dec(
            }
#ifdef FIX_79_MASA2TC_BITRATE_SWITCHING
            
            if ( hCPE->hStereoTCA != NULL )
            {
                count_free( hCPE->hStereoTCA );
                hCPE->hStereoTCA = NULL;
            }

            if ( hCPE->hStereoICBWE != NULL )
            {
                count_free( hCPE->hStereoICBWE );
@@ -938,6 +944,13 @@ ivas_error stereo_memory_dec(

                stereo_tca_init_dec( hCPE->hStereoTCA );
            }

            if ( hCPE->hStereoTCA != NULL && hCPE->element_mode == IVAS_CPE_MDCT )
            {
                /* note: in MASA, hCPE->hStereoMdct->itd = 0 */
                count_free( hCPE->hStereoTCA );
                hCPE->hStereoTCA = NULL;
            }
#endif
        }
    }