Commit 8e31c034 authored by multrus's avatar multrus
Browse files

merge from main

parents 7dcd40c1 a048be5f
Loading
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -1957,6 +1957,9 @@ static ivas_error initOnFirstGoodFrame(
        uint16_t rtpDecSeed = RANDOM_INITSEED_DEC;
        uint32_t ssrc = ( (uint32_t) IVAS_RTP_OwnRandom( &rtpDecSeed ) & 0x0000FFFF ) | ( (uint32_t) IVAS_RTP_OwnRandom( &rtpDecSeed ) << 16 );
        uint16_t seqNumInitVal = IVAS_RTP_OwnRandom( &rtpDecSeed );
#ifdef FIX_1540_EXPOSE_PT_IN_RTP_HEADER_API
        uint8_t payloadType = DEFAULT_IVAS_PAYLOAD_TYPE; /* Dynamic PT are in range [96, 127] */
#endif

        if ( ( error = IVAS_DEC_GetDelay( hIvasDec, delayNumSamples_temp, &delayTimeScale_temp ) ) != IVAS_ERR_OK )
        {
@@ -1993,7 +1996,11 @@ static ivas_error initOnFirstGoodFrame(


            /* Split Rendering RTPDump Output file */
#ifdef FIX_1540_EXPOSE_PT_IN_RTP_HEADER_API
            if ( ( error = IVAS_RTP_WRITER_Init( srRtp, arg.outputWavFilename, 1000 / ( IVAS_NUM_FRAMES_PER_SEC * splitRendCodecFrameSizeMs ), payloadType, ssrc, seqNumInitVal ) ) != IVAS_ERR_OK )
#else
            if ( ( error = IVAS_RTP_WRITER_Init( srRtp, arg.outputWavFilename, 1000 / ( IVAS_NUM_FRAMES_PER_SEC * splitRendCodecFrameSizeMs ), ssrc, seqNumInitVal ) ) != IVAS_ERR_OK )
#endif
            {
                fprintf( stderr, "\nError: Can't open SR output bitstream file for RTP output %s \n\n", arg.outputWavFilename );
                return error;
+7 −0
Original line number Diff line number Diff line
@@ -230,6 +230,9 @@ int main(
    uint16_t rtpEncSeed = RANDOM_INITSEED_ENC;
    uint32_t ssrc = ( (uint32_t) IVAS_RTP_OwnRandom( &rtpEncSeed ) & 0x0000FFFF ) | ( (uint32_t) IVAS_RTP_OwnRandom( &rtpEncSeed ) << 16 );
    uint16_t seqNumInitVal = IVAS_RTP_OwnRandom( &rtpEncSeed );
#ifdef FIX_1540_EXPOSE_PT_IN_RTP_HEADER_API
    uint8_t payloadType = DEFAULT_IVAS_PAYLOAD_TYPE; /* Dynamic PT are in range [96, 127] */
#endif

    /*------------------------------------------------------------------------------------------*
     * Parse command-line arguments
@@ -623,7 +626,11 @@ int main(

    if ( arg.rtpdumpOutput )
    {
#ifdef FIX_1540_EXPOSE_PT_IN_RTP_HEADER_API
        if ( ( error = IVAS_RTP_WRITER_Init( &ivasRtp, arg.outputBitstreamFilename, arg.numFramesPerPacket, payloadType, ssrc, seqNumInitVal ) ) != IVAS_ERR_OK )
#else
        if ( ( error = IVAS_RTP_WRITER_Init( &ivasRtp, arg.outputBitstreamFilename, arg.numFramesPerPacket, ssrc, seqNumInitVal ) ) != IVAS_ERR_OK )
#endif
        {
            fprintf( stderr, "\nError: Can't open output bitstream file for RTP output %s \n\n", arg.outputBitstreamFilename );
            goto cleanup;
+7 −0
Original line number Diff line number Diff line
@@ -340,6 +340,9 @@ int encoder_main(
    uint16_t rtpEncSeed = RANDOM_INITSEED_ENC;
    uint32_t ssrc = ( (uint32_t) IVAS_RTP_OwnRandom( &rtpEncSeed ) & 0x0000FFFF ) | ( (uint32_t) IVAS_RTP_OwnRandom( &rtpEncSeed ) << 16 );
    uint16_t seqNumInitVal = IVAS_RTP_OwnRandom( &rtpEncSeed );
#ifdef FIX_1540_EXPOSE_PT_IN_RTP_HEADER_API
    uint8_t payloadType = DEFAULT_IVAS_PAYLOAD_TYPE; /* Dynamic PT are in range [96, 127] */
#endif

    /*------------------------------------------------------------------------------------------*
     * Parse command-line arguments
@@ -731,7 +734,11 @@ int encoder_main(

    if ( arg.rtpdumpOutput && init_RtpWriter )
    {
#ifdef FIX_1540_EXPOSE_PT_IN_RTP_HEADER_API
        if ( ( error = IVAS_RTP_WRITER_Init( ivasRtp, arg.outputBitstreamFilename, arg.numFramesPerPacket, payloadType, ssrc, seqNumInitVal ) ) != IVAS_ERR_OK )
#else
        if ( ( error = IVAS_RTP_WRITER_Init( ivasRtp, arg.outputBitstreamFilename, arg.numFramesPerPacket, ssrc, seqNumInitVal ) ) != IVAS_ERR_OK )
#endif
        {
            fprintf( stderr, "\nError: Can't open output bitstream file for RTP output %s \n\n", arg.outputBitstreamFilename );
            goto cleanup;
+4 −0
Original line number Diff line number Diff line
@@ -66,6 +66,10 @@
#define IVAS_TIME_SCALE_MIN 50  /* min. time-scaling [%] */
#define IVAS_TIME_SCALE_MAX 150 /* max. time-scaling [%] */

#ifdef FIX_1540_EXPOSE_PT_IN_RTP_HEADER_API
/* RTP constants */
#define DEFAULT_IVAS_PAYLOAD_TYPE ( 96 )
#endif

/*----------------------------------------------------------------------------------*
 * Common API enum for output audio configurations
+10 −0
Original line number Diff line number Diff line
@@ -385,7 +385,17 @@ void ivas_get_dirac_sba_max_md_bits(
        *metadata_max_bits = MAX16B; /* no limit */
    }

#ifdef FIX_FLOAT_1544_SBA_META_IMPRECISION_UNSAFE_MATH
    /*
      original formula was:
      *metadata_max_bits = (int16_t) min( (float) MAX16B, ceilf( (float) *metadata_max_bits * nbands / 5 ) );
      The division by 5 is replaced by a multiplication by 0.2f, since the division is causing problems for
      certain optimizations using -funsafe-math-optimizations
    */
    *metadata_max_bits = (int16_t) min( (float) MAX16B, ceilf( *metadata_max_bits * nbands * 0.2f ) );
#else
    *metadata_max_bits = (int16_t) min( (float) MAX16B, ceilf( (float) *metadata_max_bits * nbands / 5 ) );
#endif
    *qmetadata_max_bit_req = QMETADATA_MAXBIT_REQ_SBA >> 1;

    return;
Loading