Commit f11560a1 authored by sagnowski's avatar sagnowski
Browse files

Correctly differentiate between ISAR frame size, transport codec frame size...

Correctly differentiate between ISAR frame size, transport codec frame size and the ISAR_post_rend output frame size
parent 8acb9b22
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -3897,9 +3897,17 @@ static ivas_error decodeVoIP(
        }
        else if ( decodedGoodFrame )
        {
#ifdef FIX_1234_SPLIT_REND_LC3PLUS_RECONFIGURE
            srInfo.bitrateKbps = splitRendBits->bits_written * 1000 / splitRendBits->isar_frame_size_ms;
#else
            srInfo.bitrateKbps = splitRendBits->bits_written * 1000 / splitRendBits->codec_frame_size_ms;
#endif
            srInfo.codec = ( splitRendBits->codec == ISAR_SPLIT_REND_CODEC_LC3PLUS ) ? IVAS_SR_TRANSPORT_LC3PLUS : IVAS_SR_TRANSPORT_LCLD;
#ifdef FIX_1234_SPLIT_REND_LC3PLUS_RECONFIGURE
            srInfo.codecFrameSizeMs = (uint32_t) splitRendBits->isar_frame_size_ms;
#else
            srInfo.codecFrameSizeMs = (uint32_t) splitRendBits->codec_frame_size_ms;
#endif

            if ( ( error = IVAS_RTP_WriteNextFrame( &srRtp, splitRendBits->bits_buf, &srInfo, (int16_t) splitRendBits->bits_written, false, false ) ) != IVAS_ERR_OK )
            {
+15 −0
Original line number Diff line number Diff line
@@ -812,6 +812,13 @@ static ivas_error parseSRParamsFile(
                *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_1234_SPLIT_REND_LC3PLUS_RECONFIGURE
                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;
                }
#endif
                break;
            }
        }
@@ -1194,7 +1201,11 @@ int main(
            bitsBuffer.config.bitsRead = 0;
            bitsBuffer.config.bitsWritten = 0;

#ifdef FIX_1234_SPLIT_REND_LC3PLUS_RECONFIGURE
            while ( frameMS < (int16_t) ( args.render_num_subframes * 5 ) )
#else
            while ( frameMS < bitsBuffer.config.isar_frame_size_ms )
#endif
            {
                error = IVAS_RTP_ReadNextFrame( &srRTP, bitBuffer, &auSizeBits, &rtpTimeStamp, &rtpSequenceNumber, &nextPacketRcvTime_ms, &srInfo, &qBit );
                if ( error != IVAS_ERR_OK )
@@ -1220,7 +1231,11 @@ int main(
                bitBuffer += ( auSizeBits + 7 ) / 8;
                bitsBuffer.config.bitsWritten += auSizeBits;
                bitsBuffer.config.codec = srInfo.codec == IVAS_SR_TRANSPORT_LC3PLUS ? ISAR_SPLIT_REND_CODEC_LC3PLUS : ISAR_SPLIT_REND_CODEC_LCLD;
#ifdef FIX_1234_SPLIT_REND_LC3PLUS_RECONFIGURE
                frameMS += bitsBuffer.config.isar_frame_size_ms;
#else
                frameMS += bitsBuffer.config.codec_frame_size_ms;
#endif
            }
        }
        else if ( ( hSplitRendFileReadWrite != NULL ) && splitBinNeedsNewFrame )
+3 −0
Original line number Diff line number Diff line
@@ -354,6 +354,9 @@ ivas_error ISAR_PRE_REND_MultiBinToSplitBinaural(
            available_bits = ( SplitRendBitRate * hSplitBin->hSplitBinLCLDEnc->iNumBlocks * hSplitBin->hSplitBinLCLDEnc->iNumIterations ) / ( 16 * FRAMES_PER_SEC );
            available_bits -= pBits->bits_written;
            pBits->codec_frame_size_ms = codec_frame_size_ms;
#ifdef FIX_1234_SPLIT_REND_LC3PLUS_RECONFIGURE
            pBits->isar_frame_size_ms = isar_frame_size_ms;
#endif
            isar_splitBinLCLDEncProcess( hSplitBin->hSplitBinLCLDEnc, Cldfb_In_BinReal, Cldfb_In_BinImag, available_bits, pBits );
        }
        else