Commit 433c2e2f authored by vaclav's avatar vaclav
Browse files

- updates within OMASA_BRATE_TD

- remove the encoder hack within OMASA_BRATE_TD
parent fc2c6e4c
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -133,7 +133,7 @@ void tdm_configure_dec(
    /* Get few parameters needed to decode the bitrate allocated to each channel */
    /* Get the coder_type of the secondary channel (last parameter on 2 bits) */
#ifdef OMASA_BRATE_TD
    sts[1]->coder_type = get_indice_st( sts[0], element_brate_adapt, bstr_last_pos - nb_bits_metadata - TDM_SECONDARY_SIGNALLING, TDM_SECONDARY_SIGNALLING );
    sts[1]->coder_type = get_indice_st( sts[0], element_brate_adapt, bstr_last_pos - TDM_SECONDARY_SIGNALLING, TDM_SECONDARY_SIGNALLING );
#else
    sts[1]->coder_type = get_indice_st( sts[0], hCPE->element_brate, (int16_t) ( ( hCPE->element_brate / FRAMES_PER_SEC ) - nb_bits_metadata - TDM_SECONDARY_SIGNALLING ), TDM_SECONDARY_SIGNALLING );
#endif
@@ -245,7 +245,7 @@ void tdm_configure_dec(
        if ( hStereoTD->tdm_LRTD_flag == 0 )
        {
#ifdef OMASA_BRATE_TD
            tmpS = get_indice_st( sts[0], element_brate_adapt, (int16_t) ( ( hCPE->element_brate / FRAMES_PER_SEC ) - nb_bits_metadata - TDM_SIGNAL_BITS_READ_FROM_THE_END_OF_BS + STEREO_BITS_TCA_CHAN + STEREO_BITS_TCA_CORRSTATS ), STEREO_BITS_TCA_GD );
            tmpS = get_indice_st( sts[0], element_brate_adapt, bstr_last_pos - TDM_SIGNAL_BITS_READ_FROM_THE_END_OF_BS + STEREO_BITS_TCA_CHAN + STEREO_BITS_TCA_CORRSTATS, STEREO_BITS_TCA_GD );
#else
            tmpS = get_indice_st( sts[0], hCPE->element_brate, (int16_t) ( ( hCPE->element_brate / FRAMES_PER_SEC ) - nb_bits_metadata - TDM_SIGNAL_BITS_READ_FROM_THE_END_OF_BS + STEREO_BITS_TCA_CHAN + STEREO_BITS_TCA_CORRSTATS ), STEREO_BITS_TCA_GD );
#endif
@@ -285,7 +285,11 @@ void tdm_configure_dec(
#endif

    /* set the BW of the secondary channel */
#ifdef OMASA_BRATE_TD
    if ( hStereoTD->tdm_LRTD_flag && sts[1]->bits_frame_channel > IVAS_16k4 / FRAMES_PER_SEC )
#else
    if ( hStereoTD->tdm_LRTD_flag && hCPE->element_brate > IVAS_13k2 )
#endif
    {
        /* set BW of the secondary channel in LRTD stereo mode as the BW of the primary channel at higher bitrates */
        sts[1]->bwidth = sts[0]->bwidth;
+0 −9
Original line number Diff line number Diff line
@@ -166,15 +166,6 @@ ivas_error ivas_cpe_enc(

    if ( sts[0]->ini_frame > 0 && st_ivas->hMCT == NULL )
    {

#ifdef OMASA_BRATE_TD // VE: !!!!! temp hack only
        if ( st_ivas->hEncoderConfig->ivas_format == MASA_ISM_FORMAT )
        {
            hCPE->stereo_mode_cmdl = IVAS_CPE_DFT;
            //hCPE->stereo_mode_cmdl = IVAS_CPE_TD;
        }
#endif

        hCPE->element_mode = select_stereo_mode( hCPE, ivas_format, ivas_total_brate );
    }

+19 −0
Original line number Diff line number Diff line
@@ -419,6 +419,23 @@ void tdm_configure_enc(
        sts[1]->coder_type = GENERIC;
    }

#ifdef OMASA_BRATE_TD
    if ( hCPE->element_brate - nb_bits_metadata * FRAMES_PER_SEC + hCPE->brate_surplus < 12600 )
    {
        sts[1]->coder_type = INACTIVE;
        hStereoTD->tdm_Pitch_reuse_flag = 0;
        hStereoTD->tdm_lp_reuse_flag = 1;
    }

    if ( hCPE->element_brate - nb_bits_metadata * FRAMES_PER_SEC + hCPE->brate_surplus < 14700 )
    {
        if ( sts[0]->coder_type == TRANSITION )
        {
            sts[0]->coder_type = GENERIC;
        }
    }
#endif

    mod_ct = AUDIO;
    if ( hCPE->element_brate < IVAS_24k4 )
    {
@@ -830,4 +847,6 @@ void stereo_tdm_prep_dwnmx(
            }
        }
    }

    return;
}