Commit ac1d72bf authored by vaclav's avatar vaclav
Browse files

Merge branch 'main' into 211-ism-metadata-file-reader-does-not-report-errors-in-invalid-files

parents 656ca9c0 f9075692
Loading
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -31,7 +31,6 @@
*******************************************************************************************************/

#include "options.h"
#include "debug.h"
#include "audio_file_reader.h"
#include "audio_file_writer.h"
#include "cmdl_tools.h"
@@ -49,6 +48,9 @@
#include "PROM_Size_lib_rend.h"
#include "wmops.h"
#endif
#ifdef DEBUGGING
#include "debug.h"
#endif
#ifdef RAM_COUNTING_TOOL
#include "mem_count.h"
#endif
+3 −0
Original line number Diff line number Diff line
@@ -205,6 +205,9 @@ ivas_error pre_proc_front_ivas(
    const int16_t front_vad_flag,                               /* i  : front-VAD flag to overwrite VAD decision   */
    const int16_t force_front_vad,                              /* i  : flag to force VAD decision                 */
    const int16_t front_vad_dtx_flag                            /* i  : front-VAD DTX flag to overwrite VAD decision*/
#ifdef FIX_DTX_RANGE
   ,const int32_t ivas_total_brate                             /* i  : IVAS total bitrate                       */
#endif
);

ivas_error pre_proc_ivas(
+2 −0
Original line number Diff line number Diff line
@@ -168,6 +168,8 @@
#define CLEANUP_185_NO_AGC_EXCEPTION                    /* Issue 185: Cleanup AGC EXCEPTION code */
#endif
#define FIX_I220_PARAMMC_CPROTO                         /* Issue 220: sanitizer error in the svd due to NaNs coming from negative energies in Cproto */
#define FIX_221_BR_SWITCH_STEREO                        /* Issue 221: Fix missing initialization when switchin from TD to MDCT stereo*/
#define FIX_DTX_RANGE                                   /* Issue 118: fix the DTX usage: default DTX up to 64 kbps, otherwise only in silence */
#define FIX_ISM_METADATA_READER                         /* Issue 211: make ISM metadata file reader robust against invalid files */


+4 −1
Original line number Diff line number Diff line
@@ -3890,6 +3890,9 @@ void td_cng_enc_init(

void dtx(
    Encoder_State *st, /* i/o: encoder state structure                     */
#ifdef FIX_DTX_RANGE
    const int32_t ivas_total_brate, /* i  : IVAS total bitrate                */
#endif
    const int16_t vad,   /* i  : VAD flag for DTX                            */
    const float speech[] /* i  : Pointer to the speech frame                 */
);
+19 −3
Original line number Diff line number Diff line
@@ -1424,7 +1424,6 @@ void stereo_switching_dec(

            sts[0]->tilt_code = 0.0f;
            sts[0]->gc_threshold = 0.0f;
            /*init_gp_clip( sts[1]->clip_var );*/

            set_f( sts[0]->mem_syn1, 0, M );
            set_f( sts[0]->mem_syn2, 0, M );
@@ -1454,7 +1453,6 @@ void stereo_switching_dec(

        sts[1]->tilt_code = 0.0f;
        sts[1]->gc_threshold = 0.0f;
        /*init_gp_clip( sts[1]->clip_var );*/

        set_f( sts[1]->mem_syn1, 0, M );
        set_f( sts[1]->mem_syn2, 0, M );
@@ -1467,25 +1465,28 @@ void stereo_switching_dec(
        mvr2r( sts[0]->old_exc, sts[1]->old_exc, L_EXC_MEM_DEC );
        mvr2r( sts[0]->lsf_old, sts[1]->lsf_old, M );
        mvr2r( sts[0]->lsp_old, sts[1]->lsp_old, M );

        if ( hCPE->element_mode == IVAS_CPE_MDCT )
        {
            sts[1]->last_core = sts[0]->last_core;
            sts[1]->last_coder_type = sts[0]->last_coder_type;
#ifndef FIX_221_BR_SWITCH_STEREO
            sts[1]->hTcxCfg->last_aldo = sts[0]->hTcxCfg->last_aldo;
            sts[1]->hTcxCfg->tcx_curr_overlap_mode = sts[0]->hTcxCfg->tcx_curr_overlap_mode;
#endif

            mvr2r( sts[0]->hHQ_core->old_out, sts[1]->hHQ_core->old_out, L_FRAME48k );
            mvr2r( sts[0]->delay_buf_out, sts[1]->delay_buf_out, HQ_DELTA_MAX * HQ_DELAY_COMP );
            mvr2r( sts[0]->hTcxDec->old_syn_Overl, sts[1]->hTcxDec->old_syn_Overl, 256 );
            /* Todo: apply panning to buffers instead of simply using dmx in left and right channel */

#ifndef FIX_221_BR_SWITCH_STEREO
            sts[1]->fscale = sts[0]->fscale;
            sts[1]->hTcxCfg->tcx_mdct_window_length = sts[0]->hTcxCfg->tcx_mdct_window_length;
            sts[1]->pit_res_max = sts[0]->pit_res_max;
            sts[1]->pit_res_max_past = sts[0]->pit_res_max_past;
            sts[1]->hTcxDec->L_frameTCX = sts[0]->hTcxDec->L_frameTCX;
            sts[1]->hTcxDec->conceal_eof_gain = sts[0]->hTcxDec->conceal_eof_gain;
#endif
        }
    }
    else if ( hCPE->element_mode == IVAS_CPE_TD && hCPE->last_element_mode == IVAS_CPE_MDCT )
@@ -1494,6 +1495,21 @@ void stereo_switching_dec(
        set_f( sts[1]->old_exc, 0.0f, L_EXC_MEM_DEC );
    }

#ifdef FIX_221_BR_SWITCH_STEREO
    /* TD/DFT -> MDCT stereo switching (there is no TCX in the TD stereo secondary channel, or DFT stereo) */
    if ( hCPE->element_mode == IVAS_CPE_MDCT && hCPE->last_element_mode != IVAS_CPE_MDCT )
    {
        sts[1]->hTcxCfg->last_aldo = sts[0]->hTcxCfg->last_aldo;
        sts[1]->hTcxCfg->tcx_curr_overlap_mode = sts[0]->hTcxCfg->tcx_curr_overlap_mode;
        sts[1]->fscale = sts[0]->fscale;
        sts[1]->hTcxCfg->tcx_mdct_window_length = sts[0]->hTcxCfg->tcx_mdct_window_length;
        sts[1]->pit_res_max = sts[0]->pit_res_max;
        sts[1]->pit_res_max_past = sts[0]->pit_res_max_past;
        sts[1]->hTcxDec->L_frameTCX = sts[0]->hTcxDec->L_frameTCX;
        sts[1]->hTcxDec->conceal_eof_gain = sts[0]->hTcxDec->conceal_eof_gain;
    }
#endif

    return;
}

Loading