Commit f61c8965 authored by Jan Kiene's avatar Jan Kiene
Browse files

implement DTX @ 5.2kbps for MDCT-Stereo

parent 5c260121
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -2975,4 +2975,16 @@ void evs_dec_previewFrame(
}


#ifdef ALIGN_SID_SIZE
void dtx_read_padding_bits(
    DEC_CORE_HANDLE st,
    int16_t num_bits )
{
    /* TODO: temporary hack, need to decide what to do with core-coder bitrate */
    st->total_brate = 3200;
    get_next_indice(st, num_bits);
    st->total_brate = 2400;
}
#endif

#undef WMC_TOOL_MAN
+7 −0
Original line number Diff line number Diff line
@@ -5449,4 +5449,11 @@ float rand_triangular_signed(

/* clang-format on */

#ifdef ALIGN_SID_SIZE
void dtx_read_padding_bits(
    DEC_CORE_HANDLE st,
    int16_t num_bits
);
#endif

#endif /* IVAS_PROT_H */
+4 −0
Original line number Diff line number Diff line
@@ -2099,6 +2099,10 @@ void FdCngDecodeMDCTStereoSID(
        msvq_dec( cdk_37bits_ivas, NULL, NULL, stages, N, FD_CNG_maxN_37bits, indices, ms_ptr[ch], NULL );
    }

#ifdef ALIGN_SID_SIZE
    dtx_read_padding_bits( sts[1], ( IVAS_SID_5k2 - 4400 ) / FRAMES_PER_SEC );
#endif

    if ( sts[0]->hFdCngDec->hFdCngCom->no_side_flag )
    {
        set_zero( ms_ptr[1], NPART );
+1 −1
Original line number Diff line number Diff line
@@ -666,7 +666,7 @@ void applyDmxMdctStereo(
#ifdef ALIGN_SID_SIZE
    else if ( hCPE->element_brate <= IVAS_SID_5k2 && hCPE->last_element_brate > IVAS_SID_5k2 )
#else
    if ( hCPE->last_element_brate <= IVAS_SID_4k4 )
    else if ( hCPE->element_brate <= IVAS_SID_4k4 && hCPE->last_element_brate > IVAS_SID_4k4 )
#endif
    {
        crossfade_len = output_frame / 4;
+5 −0
Original line number Diff line number Diff line
@@ -1128,6 +1128,11 @@ void FdCngEncodeMDCTStereoSID(
        push_indice( sts[ch]->hBstr, IND_ENERGY, gain_idx[ch], 7 );
    }

#ifdef ALIGN_SID_SIZE
    /* pad with zeros to reach common SID frame size */
    push_indice( sts[1]->hBstr, IND_ENERGY, 0, ( IVAS_SID_5k2 - 4400 ) / FRAMES_PER_SEC );
#endif

    return;
}