Commit 5b7d7290 authored by multrus's avatar multrus
Browse files

[cleanup] accept FIX_1527_CMR_BITRATE_IDX

parent 4cb9c948
Loading
Loading
Loading
Loading
Loading
+0 −18
Original line number Diff line number Diff line
@@ -40,9 +40,7 @@
#include "masa_file_reader.h"
#include "rotation_file_reader.h"
#include "ivas_rtp_file.h"
#ifdef FIX_1527_CMR_BITRATE_IDX
#include "requests_file_reader.h"
#endif
#ifdef DEBUGGING
#include "debug.h"
#endif
@@ -160,9 +158,7 @@ typedef struct
    char *sceneOrientationTrajFileName;
    char *deviceOrientationTrajFileName;

#ifdef FIX_1527_CMR_BITRATE_IDX
    char *requestsFileName;
#endif
} EncArguments;


@@ -230,9 +226,7 @@ int main(
    uint8_t au[IVAS_MAX_BITS_PER_FRAME / 8];
    IVAS_RTP ivasRtp = { 0 };

#ifdef FIX_1527_CMR_BITRATE_IDX
    ReqFileReader *requestsFileReader = NULL;
#endif
    /* Ideally ssrc is negotiated via SDP and sequence number is radomized but we
       use fixed seed for random num generator for regression based tests. Any realtime
       application should implement this initialization seperately */
@@ -672,7 +666,6 @@ int main(
        }
    }

#ifdef FIX_1527_CMR_BITRATE_IDX
    /*------------------------------------------------------------------------------------------*
     * Open remote requests file for rtp packing (E-bytes)
     *------------------------------------------------------------------------------------------*/
@@ -684,7 +677,6 @@ int main(
            goto cleanup;
        }
    }
#endif

    /*------------------------------------------------------------------------------------------*
     * Run the encoder
@@ -895,7 +887,6 @@ int main(
                }
            }

#ifdef FIX_1527_CMR_BITRATE_IDX
            if ( requestsFileReader )
            {
                if ( ( error = ReadNextRequests( requestsFileReader, ivasRtp.remoteRequests, &ivasRtp.remoteRequestBitmap ) ) != IVAS_ERR_OK )
@@ -904,7 +895,6 @@ int main(
                    goto cleanup;
                }
            }
#endif

            if ( ( error = IVAS_ENC_EncodeFrameToCompact( hIvasEnc, pcmBuf, pcmBufSize, au, &numBits ) ) != IVAS_ERR_OK )
            {
@@ -1010,12 +1000,10 @@ cleanup:
        fclose( f_bitrateProfile );
    }

#ifdef FIX_1527_CMR_BITRATE_IDX
    if ( requestsFileReader )
    {
        RequestsFileReader_close( &requestsFileReader );
    }
#endif

    if ( sceneOrientationFileReader )
    {
@@ -1078,10 +1066,8 @@ static bool parseCmdlIVAS_enc(
    /*-----------------------------------------------------------------*
     * Set default values
     *-----------------------------------------------------------------*/
#ifdef FIX_1527_CMR_BITRATE_IDX
    // Need less usan/msan or new arg addition
    memset( arg, 0, sizeof( *arg ) );
#endif

    arg->inputWavFilename = NULL;
    arg->outputBitstreamFilename = NULL;
@@ -1962,7 +1948,6 @@ static bool parseCmdlIVAS_enc(
            arg->deviceOrientationTrajFileName = argv[i];
            i++;
        }
#ifdef FIX_1527_CMR_BITRATE_IDX
        else if ( strcmp( argv_to_upper, "-REQUESTS" ) == 0 )
        {
            i++;
@@ -1975,7 +1960,6 @@ static bool parseCmdlIVAS_enc(
            arg->requestsFileName = argv[i];
            i++;
        }
#endif

        /*-----------------------------------------------------------------*
         * Option not recognized
@@ -2214,9 +2198,7 @@ static void usage_enc( void )
    fprintf( stdout, "                      EVS RTP Payload Format is used. Optional N represents number of frames per RTP packet\n" );
    fprintf( stdout, "-scene_orientation  : Scene orientation trajectory file. Only used with rtpdump output.\n" );
    fprintf( stdout, "-device_orientation : Device orientation trajectory file. Only used with rtpdump output.\n" );
#ifdef FIX_1527_CMR_BITRATE_IDX
    fprintf( stdout, "-requests           : Remote requests file, Only used with rtpdump output.\n" );
#endif

    fprintf( stdout, "\n" );

+0 −1
Original line number Diff line number Diff line
@@ -162,7 +162,6 @@
#define TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR      /* FhG: Temporary workaround for incorrect implementation of decoder flush with split rendering */
#define NONBE_1122_KEEP_EVS_MODE_UNCHANGED              /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR.  */
#define FIX_FLOAT_1539_G192_FORMAT_SWITCH               /* Nokia: reintroduce format switching for g192 bitstreams */
#define FIX_1527_CMR_BITRATE_IDX                        /* Fix for incorrect bitrate idx packed in rtp CMR E-byte */
#define FIX_FLOAT_1560_SVD_NO_OPT_MAX_W_SIGN            /* FhG: float issue 1560: Avoid optimizing the division on the result of maxWithSign() with -funsafe-math-optimizations */ 

/* #################### End BE switches ################################## */
+0 −2
Original line number Diff line number Diff line
@@ -1037,7 +1037,6 @@ ivas_error IVAS_RTP_WriteNextFrame(
        rtp->nWrittenPiData--;
    }

#ifdef FIX_1527_CMR_BITRATE_IDX
    for ( IVAS_RTP_REQUEST_TYPE req = 0; req < IVAS_REQUEST_MAX; req++ )
    {
        if ( rtp->remoteRequestBitmap & ( 1u << req ) )
@@ -1049,7 +1048,6 @@ ivas_error IVAS_RTP_WriteNextFrame(
            }
        }
    }
#endif

    if ( forcePacket || IVAS_RTP_PACK_GetNumFrames( rtp->hPack ) == rtp->packCfg.maxFramesPerPacket )
    {
+0 −2
Original line number Diff line number Diff line
@@ -44,9 +44,7 @@ typedef struct
    uint8_t packet[NOMINAL_BUFFER_SIZE( IVAS_MAX_FRAMES_PER_RTP_PACKET )];
    IVAS_PIDATA_TS piData[IVAS_PI_MAX_ID * IVAS_MAX_FRAMES_PER_RTP_PACKET];

#ifdef FIX_1527_CMR_BITRATE_IDX
    IVAS_RTP_REQUEST_VALUE remoteRequests[IVAS_REQUEST_MAX];
#endif
    IVAS_RTP_FILE_HANDLE hRtpFile;
    FILE *f_piDataOut;
    FILE *f_piExtOut;
+0 −12
Original line number Diff line number Diff line
@@ -658,11 +658,7 @@ static uint32_t getBitrateIdx( const uint32_t *table, uint32_t tableLen, uint32_

    for ( n = 0; n < tableLen; n++ )
    {
#ifdef FIX_1527_CMR_BITRATE_IDX
        if ( bitrate >= ( table[n] * IVAS_NUM_FRAMES_PER_SEC ) )
#else
        if ( bitrate > ( table[n] * IVAS_NUM_FRAMES_PER_SEC ) )
#endif
        {
            idx = n;
        }
@@ -728,11 +724,7 @@ static void packEBytes(
            /* EVS Modes */
            bitrate = ( bitrate > 128000 ) ? 128000 : bitrate;
            bitrate = ( bitrate < 5900 ) ? 5900 : bitrate;
#ifdef FIX_1527_CMR_BITRATE_IDX
            bitrateIdx = getBitrateIdx( evsFrameSizeInBits, ( sizeof( evsFrameSizeInBits ) / sizeof( evsFrameSizeInBits[0] ) ) - 1, bitrate );
#else
            bitrateIdx = getBitrateIdx( evsFrameSizeInBits, sizeof( evsFrameSizeInBits ) / sizeof( evsFrameSizeInBits[0] ), bitrate );
#endif
            BR = (uint8_t) bitrateIdx & MASK_4BIT;

            /* If a bandwidth choice cannot be signalled for a given bitrate
@@ -796,11 +788,7 @@ static void packEBytes(
            /* Initial E-Byte */
            bitrate = ( bitrate > 512000 ) ? 512000 : bitrate;
            bitrate = ( bitrate < 13200 ) ? 13200 : bitrate;
#ifdef FIX_1527_CMR_BITRATE_IDX
            bitrateIdx = getBitrateIdx( ivasFrameSizeInBits, ( sizeof( ivasFrameSizeInBits ) / sizeof( ivasFrameSizeInBits[0] ) ) - 2, bitrate );
#else
            bitrateIdx = getBitrateIdx( ivasFrameSizeInBits, sizeof( ivasFrameSizeInBits ) / sizeof( ivasFrameSizeInBits[0] ), bitrate );
#endif
            BR = (uint8_t) bitrateIdx & MASK_4BIT;
            if ( nByte < maxNumEBytes )
            {