Commit 3a5e0463 authored by Sandesh Venkatesh's avatar Sandesh Venkatesh Committed by Manuel Jander
Browse files

Fix for 3GPP issue 1341: Usage of open/deleteCldfb() functions - multiple variants

Link #1341
parent 0a0705bf
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -1365,7 +1365,7 @@ ivas_error openCldfb_ivas_fx(
    CLDFB_TYPE type,                   /* i  : analysis or synthesis             */
    const Word32 sampling_rate,        /* i  : sampling rate                     */
    CLDFB_PROTOTYPE prototype,         /* i  : CLDFB version (1.25ms/5ms delay)  */
    const Word16 enc_dec )             /* i  : encoder/decoder flag            */
    CODE_TYPE code_type )
{
    HANDLE_CLDFB_FILTER_BANK hs;
    Word16 buf_len;
@@ -1379,17 +1379,14 @@ ivas_error openCldfb_ivas_fx(
    move32();
    hs->prototype = prototype;
    move32();
    IF( enc_dec == ENC )
    IF( code_type == IVAS_ENC )
    {
        configureCldfb_ivas_enc_fx( hs, sampling_rate );
        hs->Q_cldfb_state = 0;
    }
    ELSE
    {
        configureCldfb_ivas_fx( hs, sampling_rate );
        hs->Q_cldfb_state = Q11;
    }
    move16();
    hs->memory32 = NULL;
    hs->FilterStates = NULL;
    hs->memory_length = 0;
@@ -1415,7 +1412,8 @@ ivas_error openCldfb_ivas_fx(
    hs->cldfb_size = buf_len; /*for having original size at intermediatery conversion, will be removed on removing conversion*/
    move16();
    set32_fx( hs->cldfb_state_fx, 0, buf_len );

    hs->Q_cldfb_state = Q11;
    move16();
    *h_cldfb = hs;
    move16();

+5 −1
Original line number Diff line number Diff line
@@ -806,7 +806,11 @@ typedef enum
    CLDFB_ANALYSIS,
    CLDFB_SYNTHESIS
} CLDFB_TYPE;

typedef enum
{
    IVAS_ENC,
    IVAS_DEC_REND
} CODE_TYPE;
typedef enum
{
    CLDFB_PROTOTYPE_1_25MS,
+1 −12
Original line number Diff line number Diff line
@@ -9804,7 +9804,7 @@ ivas_error openCldfb_ivas_fx(
    CLDFB_TYPE type,                   /* i  : analysis or synthesis             */
    const Word32 sampling_rate,        /* i  : sampling rate                     */
    CLDFB_PROTOTYPE prototype,         /* i  : CLDFB version (1.25ms/5ms delay)  */
    const Word16 enc_dec );            /* i  : encoder/decoder flag            */
    CODE_TYPE code_type );
Word32 rand_gauss_fx(
    Word32 *x,
@@ -11944,13 +11944,6 @@ ivas_error openCldfb_ivas(
    CLDFB_PROTOTYPE prototype          /* i  : CLDFB version (1.25ms/5ms delay) */
);
ivas_error openCldfb_ivas_enc(
    HANDLE_CLDFB_FILTER_BANK *h_cldfb, /* i/o: filter bank handle               */
    CLDFB_TYPE type,                   /* i  : analysis or synthesis            */
    const Word32 sampling_rate,        /* i  : sampling rate                    */
    CLDFB_PROTOTYPE prototype          /* i  : CLDFB version (1.25ms/5ms delay) */
);
void resampleCldfb_ivas(
    HANDLE_CLDFB_FILTER_BANK hs, /* i/o: filter bank handle          */
    const Word32 newSamplerate   /* i  : new samplerate to operate   */
@@ -11960,10 +11953,6 @@ ivas_error cldfb_save_memory_ivas(
    HANDLE_CLDFB_FILTER_BANK hs /* i/o: filter bank handle          */
);
void deleteCldfb_ivas(
    HANDLE_CLDFB_FILTER_BANK *h_cldfb /* i/o: filter bank handle          */
);
/*! r: flag indicating a valid bitrate */
Word16 is_EVS_bitrate(
    const Word32 ivas_total_brate, /* i  : EVS total bitrate  */
+3 −3
Original line number Diff line number Diff line
@@ -1447,13 +1447,13 @@ ivas_error init_decoder_ivas_fx(
    IF( ( idchan == 0 && NE_16( st_fx->element_mode, IVAS_CPE_MDCT ) ) || EQ_16( st_fx->element_mode, IVAS_CPE_TD ) )
    {
        /* open analysis for max. SR 48kHz */
        IF( NE_32( ( error = openCldfb_ivas_fx( &st_fx->cldfbAna, CLDFB_ANALYSIS, 48000, CLDFB_PROTOTYPE_1_25MS, DEC ) ), IVAS_ERR_OK ) )
        IF( NE_32( ( error = openCldfb_ivas_fx( &st_fx->cldfbAna, CLDFB_ANALYSIS, 48000, CLDFB_PROTOTYPE_1_25MS, IVAS_DEC_REND ) ), IVAS_ERR_OK ) )
        {
            return error;
        }

        /* open analysis BPF for max. SR 16kHz */
        IF( NE_32( ( error = openCldfb_ivas_fx( &st_fx->cldfbBPF, CLDFB_ANALYSIS, 16000, CLDFB_PROTOTYPE_1_25MS, DEC ) ), IVAS_ERR_OK ) )
        IF( NE_32( ( error = openCldfb_ivas_fx( &st_fx->cldfbBPF, CLDFB_ANALYSIS, 16000, CLDFB_PROTOTYPE_1_25MS, IVAS_DEC_REND ) ), IVAS_ERR_OK ) )
        {
            return error;
        }
@@ -1465,7 +1465,7 @@ ivas_error init_decoder_ivas_fx(
    }

    /* open synthesis for output SR */
    IF( NE_32( ( error = openCldfb_ivas_fx( &st_fx->cldfbSyn, CLDFB_SYNTHESIS, st_fx->output_Fs, CLDFB_PROTOTYPE_1_25MS, DEC ) ), IVAS_ERR_OK ) )
    IF( NE_32( ( error = openCldfb_ivas_fx( &st_fx->cldfbSyn, CLDFB_SYNTHESIS, st_fx->output_Fs, CLDFB_PROTOTYPE_1_25MS, IVAS_DEC_REND ) ), IVAS_ERR_OK ) )
    {
        return error;
    }
+2 −2
Original line number Diff line number Diff line
@@ -602,7 +602,7 @@ ivas_error ivas_cldfb_dec_reconfig_fx(
        /* create additional CLDFB synthesis instances */
        FOR( i = numCldfbAnalyses_old; i < numCldfbAnalyses; i++ )
        {
            IF( NE_32( ( error = openCldfb_ivas_fx( &( st_ivas->cldfbAnaDec[i] ), CLDFB_ANALYSIS, hDecoderConfig->output_Fs, CLDFB_PROTOTYPE_5_00MS, DEC ) ), IVAS_ERR_OK ) )
            IF( NE_32( ( error = openCldfb_ivas_fx( &( st_ivas->cldfbAnaDec[i] ), CLDFB_ANALYSIS, hDecoderConfig->output_Fs, CLDFB_PROTOTYPE_5_00MS, IVAS_DEC_REND ) ), IVAS_ERR_OK ) )
            {
                return error;
            }
@@ -622,7 +622,7 @@ ivas_error ivas_cldfb_dec_reconfig_fx(
        /* create additional CLDFB synthesis instances */
        FOR( i = numCldfbSyntheses_old; i < numCldfbSyntheses; i++ )
        {
            IF( NE_32( ( error = openCldfb_ivas_fx( &( st_ivas->cldfbSynDec[i] ), CLDFB_SYNTHESIS, hDecoderConfig->output_Fs, CLDFB_PROTOTYPE_5_00MS, DEC ) ), IVAS_ERR_OK ) )
            IF( NE_32( ( error = openCldfb_ivas_fx( &( st_ivas->cldfbSynDec[i] ), CLDFB_SYNTHESIS, hDecoderConfig->output_Fs, CLDFB_PROTOTYPE_5_00MS, IVAS_DEC_REND ) ), IVAS_ERR_OK ) )
            {
                return error;
            }
Loading