Commit 7d03a381 authored by multrus's avatar multrus
Browse files

Merge branch '20260304_cleanup' into 'main'

20260304 cleanup

See merge request !2857
parents 908ec9ad 6647a093
Loading
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -1598,27 +1598,17 @@ ivas_error cldfb_save_memory(
    }
    hs->memory_length = cldfb_get_memory_length( hs );
    move16();
#ifdef FIX_2431_AVOID_CALLOC
    hs->memory = (Word16 *) malloc( ( hs->memory_length + CLDFB_MEM_EXPONENTS + 1 ) * sizeof( Word16 ) );
    IF( hs->memory == NULL )
    {
        return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for CLDFB\n" );
    }
#else
    hs->memory = (Word16 *) calloc( hs->memory_length + CLDFB_MEM_EXPONENTS + 1, sizeof( Word16 ) );
#endif

    /* save the memory */
    Copy( hs->FilterStates, hs->memory, hs->memory_length );
    Copy( hs->FilterStates_e, hs->memory + hs->memory_length, CLDFB_MEM_EXPONENTS );
    hs->memory[hs->memory_length + CLDFB_MEM_EXPONENTS] = hs->FilterStates_eg;
    move16();
#ifndef FIX_2431_AVOID_CALLOC
    IF( hs->memory == NULL )
    {
        return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for CLDFB\n" );
    }
#endif

    return IVAS_ERR_OK;
}
+0 −166
Original line number Diff line number Diff line
@@ -169,7 +169,6 @@ Word16 get_codec_mode(
    return codec_mode; /*Q0*/
}

#ifdef FIX_2385_GETTCXONLY
/*-------------------------------------------------------------------*
 * getTcxonly()
 *
@@ -236,171 +235,6 @@ Word16 getTcxonly_fx(

    return tcxonly; /*Q0*/
}
#else
/*-------------------------------------------------------------------*
 * getTcxonly_ivas()
 *
 *
 *-------------------------------------------------------------------*/

Word16 getTcxonly_ivas_fx(
    const Word16 element_mode, /* i  : IVAS element mode                    Q0*/
    const Word32 total_brate,  /* i  : total bitrate                        Q0*/
    const Word16 MCT_flag,     /* i  : hMCT handle allocated (1) or not (0) Q0*/
    const Word16 is_ism_format /* i  : flag indicating ISM format           Q0*/
)
{
    Word16 tcxonly = 0;
    move16();
    Word32 temp_flag;
    if ( MCT_flag )
    {
        temp_flag = IVAS_32k;
        move32();
    }
    else
    {
        temp_flag = IVAS_48k;
        move32();
    }

    SWITCH( element_mode )
    {
        case EVS_MONO:
            if ( GT_32( total_brate, ACELP_32k ) )
            {
                tcxonly = 1;
                move16();
            }
            BREAK;
        case IVAS_SCE:
            if ( is_ism_format )
            {
                if ( GT_32( total_brate, MAX_ACELP_BRATE_ISM ) )
                {
                    tcxonly = 1;
                    move16();
                }
            }
            else
            {
                if ( GT_32( total_brate, MAX_ACELP_BRATE ) )
                {
                    tcxonly = 1;
                    move16();
                }
            }
            BREAK;

        case IVAS_CPE_DFT:
        case IVAS_CPE_TD:
            if ( GT_32( total_brate, MAX_ACELP_BRATE ) )
            {
                tcxonly = 1;
                move16();
            }
            BREAK;
        case IVAS_CPE_MDCT:
            if ( GE_32( total_brate, temp_flag ) )
            {
                tcxonly = 1;
                move16();
            }
            BREAK;
    }

    return tcxonly; /*Q0*/
}
#endif /* FIX_2385_GETTCXONLY */
#ifndef FIX_2385_GETTCXONLY

Word16 getTcxonly(
    const Word32 total_brate /* i  : total bitrate                       */
)
{

    Word16 tcxonly;
    tcxonly = 0;
    move16();
    if ( GT_32( total_brate, 32000 ) )
    {
        tcxonly = 1;
        move16();
    }
    return tcxonly; /*Q0*/
}

Word16 getTcxonly_fx(
    const Word16 element_mode, /* i  : IVAS element mode                    Q0*/
    const Word32 total_brate,  /* i  : total bitrate                        Q0*/
    const Word16 MCT_flag,     /* i  : hMCT handle allocated (1) or not (0) Q0*/
    const Word16 is_ism_format /* i  : flag indicating ISM format           Q0*/
)
{
    Word16 tcxonly;
    tcxonly = 0;
    move16();

    SWITCH( element_mode )
    {
        case EVS_MONO:
            if ( GT_32( total_brate, ACELP_32k ) )
            {
                tcxonly = 1;
                move16();
            }
            BREAK;
        case IVAS_SCE:
            IF( is_ism_format )
            {
                if ( GT_32( total_brate, MAX_ACELP_BRATE_ISM ) )
                {
                    tcxonly = 1;
                    move16();
                }
            }
            ELSE
            {
                if ( GT_32( total_brate, MAX_ACELP_BRATE ) )
                {
                    tcxonly = 1;
                    move16();
                }
            }
            BREAK;

        case IVAS_CPE_DFT:
        case IVAS_CPE_TD:
            if ( GT_32( total_brate, MAX_ACELP_BRATE ) )
            {
                tcxonly = 1;
                move16();
            }
            BREAK;
        case IVAS_CPE_MDCT:
            IF( MCT_flag )
            {

                if ( GE_32( total_brate, IVAS_32k ) )
                {
                    tcxonly = 1;
                    move16();
                }
            }
            ELSE
            {
                if ( GE_32( total_brate, IVAS_48k ) )
                {
                    tcxonly = 1;
                    move16();
                }
            }
            BREAK;
    }

    return tcxonly; /*Q0*/
}
#endif /* FIX_2385_GETTCXONLY */

/*-------------------------------------------------------------------*
 * getCtxHm()
+0 −2
Original line number Diff line number Diff line
@@ -1575,9 +1575,7 @@ typedef enum
#define DEG_360_IN_Q22                          ( 360 << Q22 )              /* Q22 */
#define DEG_180_IN_Q22                          ( 180 << Q22 )              /* Q22 */
#define DEG_90_IN_Q22                           ( 90 << Q22 )               /* Q22 */
#ifdef FIX_2235_TD_RENDERER_WORD16
#define DEG_90_IN_Q8                            ( 90 << Q8 )                /* Q8  */
#endif
#define ONE_BY_360_Q31                          ( 5965232 )                 /* Q31 */
#define ONE_BY_360_Q15                          ( 91 )                      /* Q15 */
#define ONE_BY_180_Q31                          ( 11930465 )                /* Q31 */
+0 −34
Original line number Diff line number Diff line
@@ -1839,20 +1839,6 @@ void stereoFdCngCoherence_fx(
    Word16 fft_exp 
);

#ifndef HARM_FD_BWE
/* o : Q_syn_hb*/
Word16 ivas_wb_bwe_dec_fx(
    Decoder_State *st_fx,                                       /* i/o: decoder state structure                 */
    Word32 output_fx32[],                                       /* o  : synthesis @internal Fs               Q11*/
    Word16 *synth_fx,                                           /* i/o: ACELP core synthesis/final synthesis   Q0/Qpost */
    Word16 *hb_synth_fx,                                        /* o  : SHB synthesis/final synthesis          Q_syn_hb */
    const Word16 use_cldfb_for_dft,                             /* i  : flag to use of CLDFB for DFT Stereo     */
    const Word16 output_frame,                                  /* i  : frame length                            */
    Word16 *voice_factors_fx,                                   /* i  : voicing factors                     Q15 */
    const Word16 pitch_buf_fx[],                                /* i  : pitch buffer                         Q6 */
    Word16 *Qpost 
);
#endif
void ivas_param_ism_config_fx(
    PARAM_ISM_CONFIG_HANDLE hParamIsm,                          /* i/o: IVAS Param ISM Config Structure         */
    const Word16 nchan_obj                                      /* i  : number of ISM channels                  */
@@ -1890,11 +1876,6 @@ void TonalMDCTConceal_Detect_ivas_fx(
    Word16 element_mode 
);

#ifndef HARMONIZE_2427_GETPLC
Word16 GetPLCModeDecision_ivas_fx(
    Decoder_State *st                                           /* i/o:    decoder memory state pointer         */
);
#endif // !HARMONIZE_2427_GETPLC

void ivas_DetectTonalComponents_fx(
    Word16 indexOfTonalPeak[],
@@ -3774,16 +3755,9 @@ ivas_error ivas_osba_render_sf_fx(
void ivas_osba_stereo_add_channels_fx(
    Word32 *tc_fx[],                                            /* i  : transport channels                          */
    Word32 *output_fx[],                                        /* i/o: output channels                             */
#ifdef FIX_2196_UNREACHABLE_CODE_IN_OSBA_STEREO_OUTPUT
    const Word32 gain,                                          /* i  : gain bed value Q11                          */
#else
    const Word32 gain_bed_fx,                                   /* i  : gain bed value Q11                          */
#endif
    const Word16 nchan_out,                                     /* i  : number of output channels                   */
    const Word16 nchan_ism,                                     /* i  : number of ISM channels                      */
#ifndef FIX_2196_UNREACHABLE_CODE_IN_OSBA_STEREO_OUTPUT
    const Word16 ism_mode,                                      /* i  : ISM mode                                    */
#endif
    const UWord16 n_samples_to_render                           /* i  : output frame length per channel             */
);

@@ -4109,17 +4083,9 @@ ivas_error ivas_param_ism_dec_open_fx(
    Decoder_Struct *st_ivas                                     /* i/o: IVAS decoder structure                      */
);

#ifdef FIX_FLOAT_1526_DIRAC_MEM_LEAK
void ivas_param_ism_dec_close_fx(
    PARAM_ISM_DEC_HANDLE *hParamIsmDec                          /* i/o: decoder ParamISM handle                     */
);
#else
void ivas_param_ism_dec_close_fx(
    PARAM_ISM_DEC_HANDLE *hParamIsmDec,                         /* i/o: decoder ParamISM handle                     */
    SPAT_PARAM_REND_COMMON_DATA_HANDLE *hSpatParamRendCom_out,  /* i/o: common spatial renderer data                */
    const AUDIO_CONFIG output_config                            /* i  : output audio configuration                  */
);
#endif

void ivas_ism_dec_digest_tc_fx(
    Decoder_Struct *st_ivas                                     /* i/o: IVAS decoder structure                      */
+0 −10
Original line number Diff line number Diff line
@@ -366,11 +366,7 @@ Word16 modify_Fs_intcub3m_sup_fx(
    const Word16( *cu )[3] = 0;
    Word16 *sigin_sr, *sigOutptr, *cptr;
    const Word16 *uptr, *ctptr;
#ifdef FIX_2431_AVOID_CALLOC
    Word16 sigin_sr_tab[NS2SA( 16000, DELAY_CLDFB_NS ) + 2];
#else
    Word16 *sigin_sr_tab;
#endif
    Word16 lim, inc, lim2, lim3;
    Word32 vv32;
#define QSR 2 /* right shift to avoid overflow, 2 is OK */
@@ -396,9 +392,6 @@ Word16 modify_Fs_intcub3m_sup_fx(
    }
    ELSE
    {
#ifndef FIX_2431_AVOID_CALLOC
        sigin_sr_tab = (Word16 *) calloc( lg + 2, sizeof( *sigin_sr ) ); /*shift right*/
#endif
        sigin_sr = sigin_sr_tab + 2;
        FOR( i = -2; i < lg; i++ )
        {
@@ -636,9 +629,6 @@ Word16 modify_Fs_intcub3m_sup_fx(
        }
    }

#ifndef FIX_2431_AVOID_CALLOC
    free( sigin_sr_tab );
#endif
    return lg_out;
}

Loading