Commit a7cb0a0e authored by sagnowski's avatar sagnowski
Browse files

Rename codecFrameSizeMs in IVAS_RTP_SR_INFO to isarFrameSizeMs

The variable is already used as the ISAR frame size - this was changed
in f11560a1. The present commit only adjusts
variable names and comments to reflect this.
parent 8a3d5bc8
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3904,7 +3904,7 @@ static ivas_error decodeVoIP(
#endif
            srInfo.codec = ( splitRendBits->codec == ISAR_SPLIT_REND_CODEC_LC3PLUS ) ? IVAS_SR_TRANSPORT_LC3PLUS : IVAS_SR_TRANSPORT_LCLD;
#ifdef FIX_1515_ISAR_FRAME_SIZES_IN_RTP
            srInfo.codecFrameSizeMs = (uint32_t) splitRendBits->isar_frame_size_ms;
            srInfo.isarFrameSizeMs = (uint32_t) splitRendBits->isar_frame_size_ms;
#else
            srInfo.codecFrameSizeMs = (uint32_t) splitRendBits->codec_frame_size_ms;
#endif
+5 −2
Original line number Diff line number Diff line
@@ -810,14 +810,17 @@ static ivas_error parseSRParamsFile(
            if ( srInfo.valid )
            {
                *codec = ( srInfo.codec == IVAS_SR_TRANSPORT_LCLD ) ? ISAR_SPLIT_REND_CODEC_LCLD : ISAR_SPLIT_REND_CODEC_LC3PLUS;
                *codec_frame_size_ms = (int16_t) srInfo.codecFrameSizeMs;
                *isar_frame_size_ms = *codec_frame_size_ms; /* for rtp force codec framesize as isar renderer frame size */
#ifdef FIX_1515_ISAR_FRAME_SIZES_IN_RTP
                *isar_frame_size_ms = (int16_t) srInfo.isarFrameSizeMs;
                *codec_frame_size_ms = *isar_frame_size_ms; /* for rtp force codec framesize as isar renderer frame size */
                if ( *codec == ISAR_SPLIT_REND_CODEC_LC3PLUS && *isar_frame_size_ms == 20 )
                {
                    /* For LC3plus, the codec frame size is limited to max 10 ms */
                    *codec_frame_size_ms = 10;
                }
#else
                *codec_frame_size_ms = (int16_t) srInfo.codecFrameSizeMs;
                *isar_frame_size_ms = *codec_frame_size_ms; /* for rtp force codec framesize as isar renderer frame size */
#endif
                break;
            }
+4 −0
Original line number Diff line number Diff line
@@ -271,7 +271,11 @@ typedef struct
    bool valid;                  /* Valid Split Rendering Info for/in the ToC */
    bool diegetic;               /* SR content digetic */
    uint32_t bitrateKbps;        /* SR bitrate in kbps */
#ifdef FIX_1515_ISAR_FRAME_SIZES_IN_RTP
    uint32_t isarFrameSizeMs;    /* SR framesize in ms (5/10/20) */
#else
    uint32_t codecFrameSizeMs;   /* SR transport codec framesize in ms (5/10/20) */
#endif
    IVAS_RTP_SR_TRANSPORT codec; /* SR Transport Codec used*/
} IVAS_RTP_SR_INFO;

+20 −0
Original line number Diff line number Diff line
@@ -846,9 +846,15 @@ static ivas_error getSRToCByte(
    uint8_t *tocByte                /* o : toc byte 2           */
)
{
#ifdef FIX_1515_ISAR_FRAME_SIZES_IN_RTP
    uint8_t bitIdx, codecId, digetic, isarFrameSize;

    if ( srInfo->isarFrameSizeMs != 5 && srInfo->isarFrameSizeMs != 10 && srInfo->isarFrameSizeMs != 20 )
#else
    uint8_t bitIdx, codecId, digetic, codecFrameSize;

    if ( srInfo->codecFrameSizeMs != 5 && srInfo->codecFrameSizeMs != 10 && srInfo->codecFrameSizeMs != 20 )
#endif
    {
        return IVAS_ERROR( IVAS_ERR_WRONG_PARAMS, "Unsupported codec framesize for SR provided" );
    }
@@ -862,8 +868,13 @@ static ivas_error getSRToCByte(
    codecId = (uint8_t) srInfo->codec;
    digetic = srInfo->diegetic ? 1 : 0;

#ifdef FIX_1515_ISAR_FRAME_SIZES_IN_RTP
    isarFrameSize = ( srInfo->isarFrameSizeMs == 20 ) ? 3 : (uint8_t) ( srInfo->isarFrameSizeMs / 5 );
    *tocByte = ( digetic << 6 ) | ( codecId << 5 ) | ( bitIdx << 3 ) | ( isarFrameSize << 1 );
#else
    codecFrameSize = ( srInfo->codecFrameSizeMs == 20 ) ? 3 : (uint8_t) ( srInfo->codecFrameSizeMs / 5 );
    *tocByte = ( digetic << 6 ) | ( codecId << 5 ) | ( bitIdx << 3 ) | ( codecFrameSize << 1 );
#endif

    return IVAS_ERR_OK;
}
@@ -1452,7 +1463,11 @@ static ivas_error parseToCByte( const IVAS_DATA_BUFFER *payload, uint32_t *numBy
                if ( nBytes < payload->length )
                {
                    uint8_t SR_BR;
#ifdef FIX_1515_ISAR_FRAME_SIZES_IN_RTP
                    static const uint8_t isarFrameSizeMap[4] = { 0, 5, 10, 20 };
#else
                    static const uint8_t codecFrameSizeMap[4] = { 0, 5, 10, 20 };
#endif

                    byte = payload->buffer[nBytes++];
                    SR_BR = ( byte >> 3 ) & MASK_2BIT;
@@ -1464,8 +1479,13 @@ static ivas_error parseToCByte( const IVAS_DATA_BUFFER *payload, uint32_t *numBy
                    toc->srInfo.diegetic = ( byte >> 6 ) & MASK_1BIT;
                    toc->srInfo.codec = IVAS_SR_TRANSPORT_LCLD + ( ( byte >> 5 ) & MASK_1BIT );
                    toc->srInfo.bitrateKbps = ( SR_BR + 1 ) * 128000u;
#ifdef FIX_1515_ISAR_FRAME_SIZES_IN_RTP
                    toc->srInfo.isarFrameSizeMs = isarFrameSizeMap[( byte >> 1 ) & MASK_2BIT];
                    toc->auNumBits = toc->srInfo.bitrateKbps * toc->srInfo.isarFrameSizeMs / 1000;
#else
                    toc->srInfo.codecFrameSizeMs = codecFrameSizeMap[( byte >> 1 ) & MASK_2BIT];
                    toc->auNumBits = toc->srInfo.bitrateKbps * toc->srInfo.codecFrameSizeMs / 1000;
#endif
                }
                else
                {