Commit 3944278e authored by vaclav's avatar vaclav
Browse files

- port No. 223 (with parts from No. 221) and No. 331

- Merge remote-tracking branch 'remotes/origin/ivas-float-update' into 1850-ref-PortFloatMr1527
parents b6fa92dd b165ae4d
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -291,7 +291,7 @@ int main(
    if ( arg.hrtfReaderEnabled )
    {
        /* sanity check */
        if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
        if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
        {
            arg.hrtfReaderEnabled = false;
            fprintf( stderr, "\nError: HRTF binary file cannot be used in this output configuration.\n\n" );
+10 −4
Original line number Diff line number Diff line
@@ -552,7 +552,9 @@ ivas_error config_acelp1(
    const int16_t tdm_lp_reuse_flag,        /* i  : LPC reuse flag (can be 1 only with secondary channel */
    const int16_t tdm_low_rate_mode,        /* i  : secondary channel low rate mode flag */
    const int16_t idchan,                   /* i  : stereo channel ID               */
#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC
    const int16_t active_cnt, /* i  : Active frame counter            */
#endif
    const int16_t tdm_Pitch_reuse_flag, /* i  : primary channel pitch reuse flag*/
    const int16_t tdm_LRTD_flag,        /* i  : LRTD stereo mode flag           */
    const int16_t GSC_IVAS_mode         /* i  : GSC IVAS mode                   */
@@ -770,7 +772,11 @@ ivas_error config_acelp1(

            bits -= acelp_cfg->mid_lsf_bits;
        }
#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC
        else if ( tdm_lp_reuse_flag == 1 && idchan == 1 )
#else
        else if ( tdm_lp_reuse_flag == 1 && idchan == 1 && active_cnt != 1 )
#endif
        {
            bits -= TDM_IC_LSF_PRED_BITS;
        }
+0 −4
Original line number Diff line number Diff line
@@ -346,11 +346,7 @@ void ivas_get_dirac_sba_max_md_bits(
        /* OSBA needs an additional 2-bits safety margin to avoid acelp crashes */
        if ( ivas_format == SBA_ISM_FORMAT )
        {
#ifdef NONBE_FIX_SBA_SIGNALING_BITS_B
            ( *metadata_max_bits ) -= 7;
#else
            ( *metadata_max_bits ) -= 3;
#endif
        }
    }
    else if ( sba_total_brate <= IVAS_32k )
+19 −1
Original line number Diff line number Diff line
@@ -2116,7 +2116,9 @@ void td_stereo_param_updt(
    const float lsp_old_PCh[],                                  /* i  : primary channel old LSPs                */
    const float lsf_old_PCh[],                                  /* i  : primary channel old LSFs                */
    const float pitch_buf_PCh[],                                /* i  : primary channel pitch buffer            */
#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC
    float tdm_lspQ_PCh[],                                       /* o  : Q LSPs for primary channel              */
#endif
    float tdm_lsfQ_PCh[],                                       /* o  : Q LSFs for primary channel              */
    float tdm_Pri_pitch_buf[],                                  /* o  : pitch values for primary channel        */
    const int16_t flag_ACELP16k,                                /* i  : ACELP@16kHz flag                        */
@@ -3225,6 +3227,9 @@ void ivas_qmetadata_enc_sid_encode(
    BSTR_ENC_HANDLE hMetaData,                                  /* i/o: metadata bitstream handle               */
    IVAS_QMETADATA *q_metadata,                                 /* i/o: metadata handle                         */
    const int16_t masa_sid_descriptor,                          /* i  : description of MASA SID coding structure*/	
#ifdef NONBE_FIX_1052_SBA_EXT
    const int16_t nchan_transport, /* i  : number of transport channels                             */
#endif
    const int16_t ivas_format                                   /* i  : ivas format                             */
);

@@ -3528,6 +3533,13 @@ int16_t ivas_sba_get_nchan_metadata(
    const int32_t ivas_total_brate                              /* i  : IVAS total bitrate                      */
);

#ifdef NONBE_FIX_1052_SBA_EXT
/*! r: number of bits in SPAR SID frame */
int16_t ivas_sba_spar_sid_bitlen(
    const int16_t nchan_transport /* i  : number of transport channels            */
);
#endif

void ivas_sba_get_spar_hoa_ch_ind(
    const int16_t num_md_chs,                                   /* i  : number of MD channels                   */
    const int32_t ivas_total_brate,                             /* i  : IVAS total bitrate                      */
@@ -3629,6 +3641,9 @@ ivas_error ivas_dirac_enc(
    const int16_t input_frame,                                  /* i  : input frame length                      */
    const int16_t dtx_vad,                                      /* i  : DTX vad flag                            */
    const IVAS_FORMAT ivas_format,                              /* i  : ivas format                             */
#ifdef NONBE_FIX_1052_SBA_EXT
    const int16_t nchan_transport,                              /* i  : number of transport channels                             */
#endif
    const int16_t hodirac_flag                                  /* i  : hodirac flag                            */
);

@@ -3686,6 +3701,9 @@ void ivas_dirac_dec_read_BS(
    int16_t *nb_bits,                                           /* o  : number of bits read                     */
    const int16_t last_bit_pos,                                 /* i  : last read bitstream position            */
    const int16_t hodirac_flag,                                 /* i  : flag to indicate HO-DirAC mode          */
#ifdef NONBE_FIX_1052_SBA_EXT
    const int16_t nchan_transport,                              /* i  : number of transport channels                             */
#endif
    int16_t *dirac_to_spar_md_bands                             /* o  : DirAC->SPAR MD bands                    */
);

+24 −0
Original line number Diff line number Diff line
@@ -159,6 +159,30 @@ int16_t ivas_sba_get_nchan(
}


#ifdef NONBE_FIX_1052_SBA_EXT
/*-------------------------------------------------------------------*
 * ivas_sba_spar_sid_bitlen()
 *
 * Get number of bits in SPAR SID frame
 *-------------------------------------------------------------------*/

/*! r: number of bits in SPAR SID frame */
int16_t ivas_sba_spar_sid_bitlen(
    const int16_t nchan_transport /* i  : number of transport channels            */
)
{
    int16_t num_bits;

    num_bits = SPAR_DTX_BANDS * SPAR_SID_BITS_TAR_PER_BAND;
    if ( nchan_transport > 1 )
    {
        num_bits -= 2;
    }

    return num_bits;
}
#endif

/*-------------------------------------------------------------------*
 * ivas_sba_get_nchan_metadata()
 *
Loading