Commit 33a402e5 authored by Vladimir Malenovsky's avatar Vladimir Malenovsky
Browse files

Merge branch 'main' into 892-memory-consumption-in-bytes-instead-of-words

parents 19025811 2fc6b845
Loading
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -138,6 +138,7 @@ stages:
  - mv IVAS_rend_test IVAS_rend

.merge-request-comparison-check: &merge-request-comparison-check
  - echo "--------------- Running merge-request-comparison-check anchor ---------------"
  - if [ $zero_errors != 1 ]; then echo "Run errors encountered!"; exit $EXIT_CODE_FAIL; fi
  - if [ $exit_code -eq 1 ] && [ $non_be_flag == 0 ]; then echo "Non-bitexact cases without non-BE tag encountered!"; exit $EXIT_CODE_FAIL; fi
  - if [ $exit_code -eq 1 ] && [ $non_be_flag != 0 ]; then echo "Non-bitexact cases with non-BE tag encountered"; exit $EXIT_CODE_NON_BE; fi
@@ -1276,6 +1277,7 @@ test-long-self-test:
  stage: test
  tags:
    - sanitizer_test_main
    - ivas-linux-fast
  artifacts:
    name: "$CI_JOB_NAME--main--sha-$CI_COMMIT_SHORT_SHA"
    expire_in: 1 week
+12 −0
Original line number Diff line number Diff line
@@ -1690,6 +1690,13 @@ static bool parseCmdlIVAS_enc(

            i++;
        }
#ifdef FIX_643_PCA_OPTION
        else if ( strcmp( argv_to_upper, "-PCA" ) == 0 )
        {
            arg->pca = 1;
            i++;
        }
#else
        else if ( strcmp( argv_to_upper, "-BYPASS" ) == 0 ) // TODO: should be renamed to "-pca"
        {
            i++;
@@ -1723,6 +1730,7 @@ static bool parseCmdlIVAS_enc(
                return false;
            }
        }
#endif

        /*-----------------------------------------------------------------*
         * Option not recognized
@@ -1919,7 +1927,11 @@ static void usage_enc( void )
    fprintf( stdout, "-mime               : Mime output bitstream file format\n" );
    fprintf( stdout, "                      The encoder produces TS26.445 Annex.2.6 Mime Storage Format, (not RFC4867 Mime Format).\n" );
    fprintf( stdout, "                      default output bitstream file format is G.192\n" );
#ifdef FIX_643_PCA_OPTION
    fprintf( stdout, "-pca                : activate PCA in SBA format FOA at 256 kbps \n" );
#else
    fprintf( stdout, "-bypass mode        : SBA PCA by-pass, mode = (1, 2), 1 = PCA off, 2 = signal adaptive, default is 1\n" );
#endif
    fprintf( stdout, "-level level        : Complexity level, level = (1, 2, 3), will be defined after characterisation. \n" );
    fprintf( stdout, "                      Currently, all values default to level 3 (full functionality).\n" );
#ifdef DEBUGGING
+25 −20
Original line number Diff line number Diff line
@@ -277,11 +277,7 @@ static const CmdLnParser_Option cliOptions[] = {
    {
        .id = CmdLnOptionId_trajFile,
        .match = "trajectory_file",
#ifdef FIX_247_EXTERNAL_RENDERER_COMMAND_LINE
        .matchShort = "T",
#else
        .matchShort = "tf",
#endif
        .description = "Head rotation trajectory file for simulation of head tracking (only for binaural outputs)",
    },
#ifdef SPLIT_REND_WITH_HEAD_ROT
@@ -312,25 +308,14 @@ static const CmdLnParser_Option cliOptions[] = {
    },
    {
        .id = CmdLnOptionId_renderConfigFile,
#ifdef FIX_247_EXTERNAL_RENDERER_COMMAND_LINE
        .match = "render_config_parameters",
        .matchShort = "render_config",
        .description = "Binaural renderer configuration parameters in file (only for binaural outputs)",
#else
        .match = "render_config",
        .matchShort = "rc",
        .description = "Binaural renderer configuration file (only for binaural outputs)",
#endif
    },
    {
        .id = CmdLnOptionId_nonDiegeticPan,
#ifdef FIX_247_EXTERNAL_RENDERER_COMMAND_LINE
        .match = "non_diegetic_panning",
        .matchShort = "non_diegetic_pan",
#else
        .match = "non_diegetic_pan",
        .matchShort = "ndp",
#endif
        .description = "Panning mono non diegetic sound to stereo -90<= pan <= 90\nleft or l or 90->left, right or r or -90->right, center or c or 0 ->middle\n",
    },
    {
@@ -351,13 +336,8 @@ static const CmdLnParser_Option cliOptions[] = {
      .description = "LFE panning matrix. File (CSV table) containing a matrix of dimensions [ num_input_lfe x num_output_channels ] with elements specifying linear routing gain (like --gain, -g). \nIf specified, overrides the output LFE position option and the default behavior which attempts to map input to output LFE channel(s)" },
    {
        .id = CmdLnOptionId_noDelayCmp,
#ifdef FIX_247_EXTERNAL_RENDERER_COMMAND_LINE
        .match = "no_delay_comparison",
        .matchShort = "no_delay_cmp",
#else
        .match = "no_delay_cmp",
        .matchShort = "ndc",
#endif
        .description = "[flag] Turn off delay compensation",
    },
    {
@@ -1815,6 +1795,26 @@ int main(
                exit( -1 );
            }

#ifdef NONBE_FIX_225_MASA_EXT_REND
            if ( isCurrentFrameMultipleOf20ms )
            {
                if ( masaReaders[i] != NULL )
                {
                    /* This will update data in hMasaMetadata[i] */
                    if ( ( error = MasaFileReader_readNextFrame( masaReaders[i] ) ) != IVAS_ERR_OK )
                    {
                        fprintf( stderr, "Error in MASA Metadata File Reading: %s\n", ivas_error_to_string( error ) );
                        exit( -1 );
                    }

                    if ( ( error = IVAS_REND_FeedInputMasaMetadata( hIvasRend, masaIds[i], hMasaMetadata[i] ) ) != IVAS_ERR_OK )
                    {
                        fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) );
                        exit( -1 );
                    }
                }
            }
#else
            if ( masaReaders[i] != NULL )
            {
                /* This will update data in hMasaMetadata[i] */
@@ -1826,6 +1826,7 @@ int main(
                    exit( -1 );
                }
            }
#endif
        }


@@ -2530,9 +2531,13 @@ static IVAS_AUDIO_CONFIG parseAudioConfig(
        switch ( charBuf[4] )
        {
            case '1':
#ifdef NONBE_FIX_225_MASA_EXT_REND
                return IVAS_AUDIO_CONFIG_MASA1;
#else
                fprintf( stderr, "1TC MASA support is not functional and is pending on DirAC renderer refactoring.\n" );
                exit( EXIT_FAILURE );
                /*return IVAS_AUDIO_CONFIG_MASA1;*/ // ToDo: temporarily disabled to avoid compilation warnings
#endif
            case '2':
                return IVAS_AUDIO_CONFIG_MASA2;
            default:
+0 −54
Original line number Diff line number Diff line
@@ -189,17 +189,10 @@ ivas_error pre_proc_front_ivas(
    const float tdm_lsp_new_PCh[M],                             /* i  : unq. LSPs of primary channel               */
    const float currFlatness,                                   /* i  : flatness parameter                         */
    const int16_t tdm_ratio_idx,                                /* i  : Current Ratio_L index                      */ 
#ifdef BE_FIX_887_GCC_WARNING_ARRAY_SIZE
    float fr_bands_LR[][2 * NB_BANDS],                          /* i  : energy in frequency bands                  */
    const float Etot_LR[],                                      /* i  : total energy Left & Right channel          */
    float lf_E_LR[][2 * VOIC_BINS],                             /* i  : per bin spectrum energy in lf, LR channels */
    const int16_t localVAD_HE_SAD_LR[],                         /* i  : HE-SAD flag without hangover, LR channels  */
#else
    float fr_bands_LR[CPE_CHANNELS][2 * NB_BANDS],              /* i  : energy in frequency bands                  */
    const float Etot_LR[CPE_CHANNELS],                          /* i  : total energy Left & Right channel          */
    float lf_E_LR[CPE_CHANNELS][2 * VOIC_BINS],                 /* i  : per bin spectrum energy in lf, LR channels */
    const int16_t localVAD_HE_SAD_LR[CPE_CHANNELS],             /* i  : HE-SAD flag without hangover, LR channels  */
#endif
    float band_energies_LR[2 * NB_BANDS],                       /* o  : energy in critical bands without minimum noise floor E_MIN      */
    const int16_t flag_16k_smc,                                 /* i  : flag to indicate if the OL SMC is run at 16 kHz */
    const int16_t front_vad_flag,                               /* i  : front-VAD flag to overwrite VAD decision   */
@@ -997,11 +990,7 @@ ivas_error ivas_ism_metadata_dec_create(

ivas_error ivas_ism_enc(
    Encoder_Struct *st_ivas,                                    /* i/o: IVAS encoder structure                      */
#ifdef BE_FIX_887_GCC_WARNING_ARRAY_SIZE
    float *data[],                                             /* i  : input signal [channels][samples]            */
#else
    float *data[MAX_NUM_OBJECTS],                               /* i  : input signal                                */
#endif
    const int16_t input_frame,                                  /* i  : input frame length per channel              */
    int16_t *nb_bits_metadata,                                  /* i  : number of metadata bits                     */
    const int16_t flag_omasa_ener_brate                         /* i  : less bitrate for objects in OMASA flag      */
@@ -3725,17 +3714,6 @@ void ivas_dirac_dec_render_sf(
    float *pppQMfFrame_ts_im[IVAS_MAX_FB_MIXER_IN_CH][CLDFB_NO_COL_MAX]
);

#ifndef FIX_865_MOVE_TD_DECORR
ivas_error ivas_td_decorr_reconfig_dec(
    const IVAS_FORMAT ivas_format,                              /* i  : IVAS format                             */
    const int32_t ivas_total_brate,                             /* i  : total IVAS bitrate                      */
    const int16_t nchan_transport,                              /* i  : number of transport channels            */
    const int32_t output_Fs,                                    /* i  : output sampling rate                    */
    ivas_td_decorr_state_t **hTdDecorr,                         /* i/o: TD decorrelator handle                  */
    uint16_t *useTdDecorr                                       /* i/o: TD decorrelator flag                    */
);

#endif
void computeDiffuseness_mdft(
    float **buffer_intensity[DIRAC_NUM_DIMS],
    const float *buffer_energy,
@@ -4668,33 +4646,6 @@ void ivas_td_decorr_get_ducking_gains(
    const int16_t tdet_flag 
);

#ifndef FIX_865_MOVE_TD_DECORR
ivas_error ivas_td_decorr_dec_open(
    ivas_td_decorr_state_t **hTdDecorr,                         /* i/o: TD decorrelator handle                  */
    const int32_t output_Fs,                                    /* i  : output sampling rate                    */
    const int16_t nchan_internal,                               /* i  : number of internal channels             */
    const int16_t ducking_flag                                  /* i  : ducking flag                            */
);

void ivas_td_decorr_dec_close(
    ivas_td_decorr_state_t **hTdDecorr                          /* i/o: TD decorrelator handle                  */
);

void ivas_td_decorr_process( 
    ivas_td_decorr_state_t *hTdDecorr,                          /* i/o: SPAR Covar. decoder handle              */
    float *pcm_in[],                                            /* i  : input audio channels                    */
    float **ppOut_pcm,                                          /* o  : output audio channels                   */
    const int16_t output_frame                                  /* i  : output frame length                     */
);

void ivas_td_decorr_APD_iir_filter(
    ivas_td_decorr_APD_filt_state_t *filter_state,
    float *pIn_out,
    const int16_t num_APD_sections,
    const int16_t length
);

#endif
#define IVAS_CMULT_FLOAT( in1_re, in1_im, in2_re, in2_im, out1_re, out1_im ) \
    out1_re = ( in1_re * in2_re ) - ( in1_im * in2_im ); MAC(1); MULT(1);    \
    out1_im = ( in1_re * in2_im ) + ( in2_re * in1_im ); MAC(1); MULT(1);
@@ -5532,13 +5483,8 @@ void lls_interp_n(

void computeReferencePower_enc(
    const int16_t *band_grouping,                               /* i  : Band grouping for estimation                    */
#ifdef FIX_888_INTERFACE_UNIFICATION
    float Cldfb_RealBuffer[][DIRAC_NO_FB_BANDS_MAX], /* i  : Real part of input signal               */
    float Cldfb_ImagBuffer[][DIRAC_NO_FB_BANDS_MAX], /* i  : Imag part of input signal               */
#else
    float Cldfb_RealBuffer[DIRAC_MAX_ANA_CHANS][DIRAC_NO_FB_BANDS_MAX], /* i  : Real part of input signal               */
    float Cldfb_ImagBuffer[DIRAC_MAX_ANA_CHANS][DIRAC_NO_FB_BANDS_MAX], /* i  : Imag part of input signal               */
#endif
    float *reference_power,                                     /* o  : Estimated power                                 */
    const int16_t enc_param_start_band,                         /* i  : first band to process                           */
    const int16_t num_freq_bands,                               /* i  : Number of frequency bands                       */
+0 −31
Original line number Diff line number Diff line
@@ -672,37 +672,6 @@ typedef struct ivas_trans_det_state_t
} ivas_trans_det_state_t;


#ifndef FIX_865_MOVE_TD_DECORR

/*----------------------------------------------------------------------------------*
 * Time domain decorrelator
 *----------------------------------------------------------------------------------*/

typedef struct ivas_td_decorr_APD_filt_state_t
{
    int16_t order[IVAS_MAX_DECORR_APD_SECTIONS];
    int16_t idx[IVAS_MAX_DECORR_APD_SECTIONS];
    float coeffs[IVAS_MAX_DECORR_APD_SECTIONS];
    float *state[IVAS_MAX_DECORR_APD_SECTIONS];

} ivas_td_decorr_APD_filt_state_t;

typedef struct ivas_td_decorr_state_t
{
    ivas_trans_det_state_t *pTrans_det;
    float *look_ahead_buf;
    ivas_td_decorr_APD_filt_state_t APD_filt_state[IVAS_MAX_DECORR_CHS];

    int16_t num_apd_outputs;
    int16_t num_apd_sections;
    int16_t ducking_flag;

    int16_t offset;

} ivas_td_decorr_state_t;

#endif

/*----------------------------------------------------------------------------------*
 * Filter Bank (FB) structures
 *----------------------------------------------------------------------------------*/
Loading