Commit b4912c8d authored by vaclav's avatar vaclav
Browse files

introduce "hodirac_flag" in functions with multiple calls of ivas_get_hodirac_flag()

parent cda54e71
Loading
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -295,7 +295,6 @@ ivas_error ivas_dirac_dec_config(
    hodirac_flag = ivas_get_hodirac_flag( ivas_total_brate, st_ivas->sba_analysis_order );
#endif


    if ( flag_config == DIRAC_RECONFIGURE )
    {
        hDirAC = st_ivas->hDirAC;
@@ -528,7 +527,7 @@ ivas_error ivas_dirac_dec_config(

    if ( nchan_transport_orig > 2 && hDirAC->hOutSetup.is_loudspeaker_setup && st_ivas->renderer_type == RENDERER_DIRAC
#ifdef FIX_DIRAC_LS_SYNTHESIS_CONFIG
         && !ivas_get_hodirac_flag( ivas_total_brate, st_ivas->sba_analysis_order )
         && !hodirac_flag
#endif
    )
    {
+8 −2
Original line number Diff line number Diff line
@@ -69,6 +69,9 @@ ivas_error ivas_jbm_dec_tc(
    Decoder_State *st;                                                                                                             /* used for bitstream handling */
    float output[MAX_TRANSPORT_CHANNELS][L_FRAME48k]; /* 'float' buffer for transport channels, MAX_TRANSPORT_CHANNELS channels */ /* IVAS_fmToDo: buffer can be allocated dynamically based on the actual number of output channels */
    int16_t nchan_remapped;
#ifdef HODIRAC
    int16_t hodirac_flag;
#endif
    float output_lfe_ch[L_FRAME48k];
    int16_t nb_bits_metadata[MAX_SCE];
    int32_t output_Fs, ivas_total_brate;
@@ -88,6 +91,9 @@ ivas_error ivas_jbm_dec_tc(
    nchan_out = st_ivas->hTcBuffer->nchan_transport_jbm;
    output_config = st_ivas->hDecoderConfig->output_config;
    ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate;
#ifdef HODIRAC
    hodirac_flag = ivas_get_hodirac_flag( ivas_total_brate, st_ivas->sba_analysis_order );
#endif

    output_frame = (int16_t) ( output_Fs / FRAMES_PER_SEC );

@@ -192,7 +198,7 @@ ivas_error ivas_jbm_dec_tc(
            {
                ivas_dirac_dec_read_BS( ivas_total_brate, st, st_ivas->hDirAC, st_ivas->hQMetaData, &nb_bits_metadata[0], st_ivas->sba_mode,
#ifdef HODIRAC
                                        ivas_get_hodirac_flag( ivas_total_brate, st_ivas->sba_analysis_order ),
                                        hodirac_flag,
#endif
                                        0 );
            }
@@ -217,7 +223,7 @@ ivas_error ivas_jbm_dec_tc(
                    &nb_bits_metadata[0],
                    st_ivas->sba_mode,
#ifdef HODIRAC
                    ivas_get_hodirac_flag( ivas_total_brate, st_ivas->sba_analysis_order ),
                    hodirac_flag,
#endif
                    st_ivas->hSpar->dirac_to_spar_md_bands );
            }
+10 −5
Original line number Diff line number Diff line
@@ -429,10 +429,11 @@ static ivas_error ivas_spar_enc_process(
    float pcm_tmp[IVAS_SPAR_MAX_CH][L_FRAME48k * 2];
    float *p_pcm_tmp[IVAS_SPAR_MAX_CH];
#endif

    int16_t i, j, b, i_ts, input_frame, dtx_vad;
    int16_t transient_det[2];

#ifdef HODIRAC
    int16_t hodirac_flag;
#endif
    int32_t ivas_total_brate, input_Fs;
    float *cov_real[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH];
    float *cov_dtx_real[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH];
@@ -605,12 +606,16 @@ static ivas_error ivas_spar_enc_process(
    /*-----------------------------------------------------------------------------------------*
     * DirAC encoding
     *-----------------------------------------------------------------------------------------*/

    /*tyagiri: TODO: HODIRAC should be disabled for 256 kbps and outputs should be BE w.r.t baseline*/
#ifdef HODIRAC
    hodirac_flag = ivas_get_hodirac_flag( ivas_total_brate, st_ivas->sba_analysis_order );
#endif

    ivas_dirac_param_est_enc( st_ivas->hDirAC, hQMetaData->q_direction, hQMetaData->useLowerRes, data_f, ppIn_FR_real, ppIn_FR_imag, input_frame, st_ivas->sba_mode
#ifdef HODIRAC
                              ,
                              ivas_get_hodirac_flag( ivas_total_brate, st_ivas->sba_analysis_order ),
                              ivas_get_hodirac_flag( ivas_total_brate, st_ivas->sba_analysis_order ) ? HOA2_CHANNELS : FOA_CHANNELS
                              hodirac_flag, hodirac_flag ? HOA2_CHANNELS : FOA_CHANNELS
#endif
    );

@@ -626,7 +631,7 @@ static ivas_error ivas_spar_enc_process(
            ivas_qmetadata_enc_encode( hMetaData, hQMetaData
#ifdef HODIRAC
                                       ,
                                       ivas_get_hodirac_flag( ivas_total_brate, st_ivas->sba_analysis_order )
                                       hodirac_flag
#endif
            );
        }