Commit 17e581b0 authored by Archit Tamarapu's avatar Archit Tamarapu
Browse files

[fix] IVAS LC3plus unit test; add new helper function to translate integer...

[fix] IVAS LC3plus unit test; add new helper function to translate integer framesize to newly introduced enum
parent 80a94777
Loading
Loading
Loading
Loading
Loading
+30 −0
Original line number Diff line number Diff line
@@ -92,3 +92,33 @@ ivas_error IVAS_LC3PLUS_LC3plusRtpErrToIvasErr(

    return IVAS_ERR_UNKNOWN;
}

/*-----------------------------------------------------------------------------------------*
 * Function IVAS_LC3PLUS_UsToLC3plusFrameDuration()
 *
 *
 *-----------------------------------------------------------------------------------------*/

LC3PLUS_FrameDuration IVAS_LC3PLUS_UsToLC3plusFrameDuration(
    const int16_t lc3PlusFrameDurationUs )
{
    switch ( lc3PlusFrameDurationUs )
    {
#ifdef CR9_C_ADD_1p25MS /* TODO LC3plus: verify switch stripping on update */
        case 1250:
            return LC3PLUS_FRAME_DURATION_1p25MS;
#endif
        case 2500:
            return LC3PLUS_FRAME_DURATION_2p5MS;
        case 5000:
            return LC3PLUS_FRAME_DURATION_5MS;
        case 7500:
            return LC3PLUS_FRAME_DURATION_7p5MS;
        case 10000:
            return LC3PLUS_FRAME_DURATION_10MS;
        default:
            break;
    }

    return LC3PLUS_FRAME_DURATION_UNDEFINED;
}
+3 −0
Original line number Diff line number Diff line
@@ -61,4 +61,7 @@ ivas_error ISAR_LC3PLUS_LC3plusErrToIvasErr( const LC3PLUS_Error lc3PlusError );
/*! utility function to convert LC3PLUS_Errors to the suitable ivas_error */
ivas_error IVAS_LC3PLUS_LC3plusRtpErrToIvasErr( const LC3PLUS_RTP_ERR lc3PlusRtpError );

/*! utility function to convert a value in microseconds to an LC3PLUS_FrameDuration */
LC3PLUS_FrameDuration IVAS_LC3PLUS_UsToLC3plusFrameDuration( const int16_t lc3PlusFrameDuration );

#endif /* ISAR_LC3PLUS_COM_H */
+1 −1
Original line number Diff line number Diff line
@@ -135,7 +135,7 @@ ivas_error ISAR_LC3PLUS_DEC_Open(
            return IVAS_ERROR( ISAR_LC3PLUS_LC3plusErrToIvasErr( err ), "lc3plus_dec_init failed\n" );
        }

        err = lc3plus_dec_set_frame_dms( ( *handle )->handles[iCh], config.lc3plus_frame_duration_us / 100 );
        err = lc3plus_dec_set_frame_dms( ( *handle )->handles[iCh], IVAS_LC3PLUS_UsToLC3plusFrameDuration( config.lc3plus_frame_duration_us ) );
        if ( LC3PLUS_OK != err )
        {
            ISAR_LC3PLUS_DEC_Close( handle );
+1 −1
Original line number Diff line number Diff line
@@ -168,7 +168,7 @@ ivas_error ISAR_LC3PLUS_ENC_Open(
            return IVAS_ERROR( ISAR_LC3PLUS_LC3plusErrToIvasErr( err ), "lc3plus_enc_init failed\n" );
        }

        err = lc3plus_enc_set_frame_dms( ( *handle )->handles[iCh], config.lc3plus_frame_duration_us / 100 );
        err = lc3plus_enc_set_frame_dms( ( *handle )->handles[iCh], IVAS_LC3PLUS_UsToLC3plusFrameDuration( config.lc3plus_frame_duration_us ) );
        if ( err != LC3PLUS_OK )
        {
            ISAR_LC3PLUS_ENC_Close( handle );
+28 −28

File changed.

Contains only whitespace changes.

+19 −19

File changed.

Contains only whitespace changes.

Loading