Commit b8794ae3 authored by Marek Szczerba's avatar Marek Szczerba
Browse files

Merge branch 'main' into 1019-socket-interface-for-pose-and-audio

parents 9b7b3290 0cd7d42d
Loading
Loading
Loading
Loading
Loading
+9 −2746

File changed.

Preview size limit exceeded, changes collapsed.

.gitlab-ci/variables.yml

deleted100644 → 0
+0 −35
Original line number Diff line number Diff line
variables:
  EVS_BE_TEST_DIR: "/usr/local/be_2_evs_test"
  EVS_BE_WIN_TEST_DIR: "C:/Users/gitlab-runner/testvec"
  PROCESSING_SCRIPTS_BIN_DIR: "/test-bin"
  SANITIZER_TESTS: "CLANG1 CLANG2 CLANG3"
  OUT_FORMATS_CHANNEL_BASED: "stereo mono 5_1 5_1_2 5_1_4 7_1 7_1_4"
  OUT_FORMATS_SCENE_BASED: "FOA HOA2 HOA3"
  OUT_FORMATS_BINAURAL: "BINAURAL BINAURAL_ROOM_IR BINAURAL_ROOM_REVERB"
  OUT_FORMATS_ALL: "$OUT_FORMATS_CHANNEL_BASED $OUT_FORMATS_SCENE_BASED $OUT_FORMATS_BINAURAL EXT"
  MANUAL_PIPELINE_TYPE:
    description: "Type for the manual pipeline run. Use 'test-be-release' to run BE test against release codec."
    value: 'default'
    options:
      - 'default'
      - 'test-be-release'
      - 'test-long-self-test'
      - 'ivas-conformance'
      - 'ivas-conformance-linux'
      - 'check-clipping'
      - 'test-branch-vs-input-passthrough'
      - 'coverage'

  PYTEST_ARGS: ""
  LONG_TEST_SUITE: "tests/codec_be_on_mr_nonselection tests/renderer --param_file scripts/config/self_test_ltv.prm --use_ltv"
  LONG_TEST_SUITE_NO_RENDERER: "tests/codec_be_on_mr_nonselection --param_file scripts/config/self_test_ltv.prm --use_ltv"
  SHORT_TEST_SUITE: "tests/codec_be_on_mr_nonselection"
  SHORT_TEST_SUITE_ENCODER: "tests/codec_be_on_mr_nonselection/test_param_file.py --param_file scripts/config/self_test_basop_encoder.prm"
  LONG_TEST_SUITE_ENCODER: "tests/codec_be_on_mr_nonselection/test_param_file.py --param_file scripts/config/self_test_ltv_basop_encoder.prm"
  TEST_SUITE: ""
  # note: currently overwrites default value from ci repo
  TESTCASE_TIMEOUT_STV_SANITIZERS: 240
  COVERAGE_OUTPUT_FILE_STV: "coverage-stv.info"
  COVERAGE_OUTPUT_FILE_LTV: "coverage-ltv.info"
  COVERAGE_OUTPUT_FILE_CONFORMANCE: "coverage-conformance.info"
  COVERAGE_OUTPUT_FILE_MERGED: "coverage-merged.info"
+84 −437

File changed.

Preview size limit exceeded, changes collapsed.

+14 −48
Original line number Diff line number Diff line
@@ -38,10 +38,8 @@
#include "ism_file_reader.h"
#include "jbm_file_reader.h"
#include "masa_file_reader.h"
#ifdef IVAS_RTPDUMP
#include "rotation_file_reader.h"
#include "ivas_rtp_file.h"
#endif
#ifdef DEBUGGING
#include "debug.h"
#endif
@@ -50,10 +48,6 @@
#include "flp_debug.h"
#endif

#ifdef FIXED_RTP_SEQUENCE_NUM
#define RANDOM_INITSEED_ENC ( 0xFEEDDEAF )
#endif

#define WMC_TOOL_SKIP

/*------------------------------------------------------------------------------------------*
@@ -65,6 +59,8 @@ static
#endif
    int32_t frame = 0; /* Counter of frames */

#define RANDOM_INITSEED_ENC ( 0xDEAF )

#define DEFAULT_FIXED_SID_RATE 8 /* DTX SID rate */

/* Additional config info for each input format */
@@ -156,12 +152,10 @@ typedef struct
#endif
    bool pca;
    bool ism_extended_metadata;
#ifdef IVAS_RTPDUMP
    bool rtpdumpOutput;
    uint32_t numFramesPerPacket;
    char *sceneOrientationTrajFileName;
    char *deviceOrientationTrajFileName;
#endif

} EncArguments;

@@ -205,10 +199,8 @@ int main(
    MasaFileReader *masaReader = NULL;
    IsmFileReader *ismReaders[IVAS_MAX_NUM_OBJECTS] = { NULL, NULL, NULL, NULL };
    int16_t *pcmBuf = NULL;
#ifdef IVAS_RTPDUMP
    RotFileReader *sceneOrientationFileReader = NULL;
    RotFileReader *deviceOrientationFileReader = NULL;
#endif
#ifdef DEBUGGING
    FILE *f_forcedModeProfile = NULL;
#ifdef DEBUG_SBA
@@ -229,19 +221,15 @@ int main(
    enable_float_exception_trap( FLE_MASK_DENORM | FLE_MASK_UNDERFLOW );
#endif

#ifdef IVAS_RTPDUMP
    uint8_t au[IVAS_MAX_BITS_PER_FRAME / 8];
    IVAS_RTP ivasRtp = { 0 };
#endif

#ifdef FIXED_RTP_SEQUENCE_NUM
    /* 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 */
    srand( RANDOM_INITSEED_ENC );
    uint32_t ssrc = ( (uint32_t) rand() & 0x0000FFFF ) | ( (uint32_t) rand() << 16 );
    uint16_t seqNumInitVal = (uint16_t) ( rand() & 0xFFFF );
#endif
    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 );

    /*------------------------------------------------------------------------------------------*
     * Parse command-line arguments
@@ -271,11 +259,7 @@ int main(

    const BS_WRITER_FORMAT bsWriterFormat = arg.mimeOutput ? BS_WRITER_FORMAT_MIME : BS_WRITER_FORMAT_G192;

#ifdef IVAS_RTPDUMP
    if ( !arg.rtpdumpOutput && BS_Writer_Open_filename( &hBsWriter, arg.outputBitstreamFilename, bsWriterFormat ) != IVAS_ERR_OK )
#else
    if ( BS_Writer_Open_filename( &hBsWriter, arg.outputBitstreamFilename, bsWriterFormat ) != IVAS_ERR_OK )
#endif
    {
        fprintf( stderr, "\nCan't open %s\n\n", arg.outputBitstreamFilename );
        goto cleanup;
@@ -474,14 +458,14 @@ int main(
            if ( ( error = IVAS_ENC_ConfigureForSBAObjects( hIvasEnc, arg.inputFs, totalBitrate, bandwidth, arg.dtxConfig, arg.inputFormatConfig.sba_ism.numObjects, arg.inputFormatConfig.sba_ism.order, arg.inputFormatConfig.sba_ism.isPlanar, arg.pca ) ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "\nIVAS_ENC_ConfigureForSBAObjects failed: %s\n\n", IVAS_ENC_GetErrorMessage( error ) );
                exit( -1 );
                goto cleanup;
            }
            break;
        case IVAS_ENC_INPUT_MASA_ISM:
            if ( ( error = IVAS_ENC_ConfigureForMASAObjects( hIvasEnc, arg.inputFs, totalBitrate, bandwidth, arg.dtxConfig, arg.inputFormatConfig.masa_ism.numObjects, arg.inputFormatConfig.masa_ism.masaVariant ) ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "\nIVAS_ENC_ConfigureForMASAObjects failed: %s\n\n", IVAS_ENC_GetErrorMessage( error ) );
                exit( -1 );
                goto cleanup;
            }
            break;
        default:
@@ -633,18 +617,13 @@ int main(
        }
    }

#ifdef IVAS_RTPDUMP
    /*------------------------------------------------------------------------------------------*
     * RTPDump
     *------------------------------------------------------------------------------------------*/

    if ( arg.rtpdumpOutput )
    {
#ifdef FIXED_RTP_SEQUENCE_NUM
        if ( ( error = IVAS_RTP_WRITER_Init( &ivasRtp, arg.outputBitstreamFilename, arg.numFramesPerPacket, ssrc, seqNumInitVal ) ) != IVAS_ERR_OK )
#else
        if ( ( error = IVAS_RTP_WRITER_Init( &ivasRtp, arg.outputBitstreamFilename, arg.numFramesPerPacket ) ) != IVAS_ERR_OK )
#endif
        {
            fprintf( stderr, "\nError: Can't open output bitstream file for RTP output %s \n\n", arg.outputBitstreamFilename );
            goto cleanup;
@@ -676,7 +655,10 @@ int main(
            goto cleanup;
        }
    }
#endif

    /*------------------------------------------------------------------------------------------*
     * Run the encoder
     *------------------------------------------------------------------------------------------*/

    int16_t numSamplesRead = 0;
    uint16_t bitStream[IVAS_MAX_BITS_PER_FRAME];
@@ -842,7 +824,6 @@ int main(
        }

        /* *** Encode one frame *** */
#ifdef IVAS_RTPDUMP
        if ( ivasRtp.hPack )
        {
            bool isMono = ( arg.inputFormat == IVAS_ENC_INPUT_MONO );
@@ -890,11 +871,7 @@ int main(
                goto cleanup;
            }

#ifdef RTP_S4_251135_CR26253_0016_REV1
            if ( ( error = IVAS_RTP_WriteNextFrame( &ivasRtp, au, NULL, numBits, isMono, forcePacket ) ) != IVAS_ERR_OK )
#else
            if ( ( error = IVAS_RTP_WriteNextFrame( &ivasRtp, au, numBits, isMono, forcePacket ) ) != IVAS_ERR_OK )
#endif
            {
                fprintf( stderr, "\nError %s while pushing audio frame to RTP pack\n", IVAS_ENC_GetErrorMessage( error ) );
                goto cleanup;
@@ -902,7 +879,6 @@ int main(
        }
        else
        {
#endif
            if ( ( error = IVAS_ENC_EncodeFrameToSerial( hIvasEnc, pcmBuf, pcmBufSize, bitStream, &numBits ) ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "\nencodeFrame failed: %s\n\n", IVAS_ENC_GetErrorMessage( error ) );
@@ -915,9 +891,7 @@ int main(
                fprintf( stderr, "\nBS_Writer_WriteFrame_short failed, error code %d\n\n", error );
                goto cleanup;
            }
#ifdef IVAS_RTPDUMP
        }
#endif

        frame++;
        if ( !arg.quietModeEnabled )
@@ -995,7 +969,6 @@ cleanup:
        fclose( f_bitrateProfile );
    }

#ifdef IVAS_RTPDUMP
    if ( sceneOrientationFileReader )
    {
        RotationFileReader_close( &sceneOrientationFileReader );
@@ -1007,7 +980,6 @@ cleanup:
    }

    IVAS_RTP_Term( &ivasRtp );
#endif

    IVAS_ENC_Close( &hIvasEnc );

@@ -1079,12 +1051,9 @@ static bool parseCmdlIVAS_enc(
    arg->mimeOutput = false;
    arg->ism_extended_metadata = false;
    arg->complexityLevel = IVAS_ENC_COMPLEXITY_LEVEL_THREE;
#ifdef IVAS_RTPDUMP
    arg->rtpdumpOutput = false;
    arg->sceneOrientationTrajFileName = NULL;
    arg->deviceOrientationTrajFileName = NULL;
#endif

#ifdef DEBUGGING
    arg->forcedMode = IVAS_ENC_FORCE_UNFORCED;
    arg->forcedModeFile = NULL;
@@ -1878,7 +1847,6 @@ static bool parseCmdlIVAS_enc(
            i++;
        }

#ifdef IVAS_RTPDUMP
        /*-----------------------------------------------------------------*
         * RTPDump output
         *-----------------------------------------------------------------*/
@@ -1887,6 +1855,7 @@ static bool parseCmdlIVAS_enc(
        {
            i++;
            arg->rtpdumpOutput = true;

            if ( i < argc - 4 )
            {
                if ( !is_digits_only( argv[i] ) )
@@ -1903,6 +1872,7 @@ static bool parseCmdlIVAS_enc(
                    }
                }
            }

            fprintf( stdout, "Output format: RTPDump using %d frames/packet \n", arg->numFramesPerPacket );
        }

@@ -1942,7 +1912,6 @@ static bool parseCmdlIVAS_enc(
            i++;
        }

#endif
        /*-----------------------------------------------------------------*
         * Option not recognized
         *-----------------------------------------------------------------*/
@@ -1954,13 +1923,13 @@ static bool parseCmdlIVAS_enc(
        }
    } /* end of while  */

#ifdef IVAS_RTPDUMP
    if ( arg->sceneOrientationTrajFileName != NULL && arg->rtpdumpOutput == false )
    {
        fprintf( stderr, "Error: Scene orientations are only enabled with rtpdump output!\n\n" );
        usage_enc();
        return false;
    }

    if ( arg->deviceOrientationTrajFileName != NULL && arg->rtpdumpOutput == false )
    {
        fprintf( stderr, "Error: Device orientations are only enabled with rtpdump output!\n\n" );
@@ -1968,7 +1937,6 @@ static bool parseCmdlIVAS_enc(
        return false;
    }

#endif
    /*-----------------------------------------------------------------*
     * Mandatory input arguments
     *-----------------------------------------------------------------*/
@@ -2175,14 +2143,12 @@ static void usage_enc( void )
#endif
    fprintf( stdout, "-q                  : Quiet mode, no frame counters\n" );
    fprintf( stdout, "                      default is deactivated\n" );
#ifdef IVAS_RTPDUMP
    fprintf( stdout, "-rtpdump <N>        : RTPDump output, hf_only=1 by default. The encoder will packetize the \n" );
    fprintf( stdout, "                      bitstream frames into TS26.253 Annex A IVAS RTP Payload Format packets and \n" );
    fprintf( stdout, "                      writes those to the output file. In EVS mono operating mode, TS26.445 Annex A.2.2 \n" );
    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" );
#endif
    fprintf( stdout, "\n" );

    return;
+40 −71
Original line number Diff line number Diff line
@@ -38,10 +38,8 @@
#include "ism_file_reader.h"
#include "jbm_file_reader.h"
#include "masa_file_reader.h"
#ifdef IVAS_RTPDUMP
#include "rotation_file_reader.h"
#include "ivas_rtp_file.h"
#endif
#ifdef DEBUGGING
#include "debug.h"
#endif
@@ -50,10 +48,6 @@
#include "flp_debug.h"
#endif

#ifdef FIXED_RTP_SEQUENCE_NUM
#define RANDOM_INITSEED_ENC ( 0xFEEDDEAF )
#endif

#define WMC_TOOL_SKIP

/*------------------------------------------------------------------------------------------*
@@ -68,6 +62,8 @@ static
#endif
    int32_t frame = 0; /* Counter of frames */

#define RANDOM_INITSEED_ENC ( 0xDEAF )

#define DEFAULT_FIXED_SID_RATE 8 /* DTX SID rate */

/* Additional config info for each input format */
@@ -159,12 +155,10 @@ typedef struct
#endif
    bool pca;
    bool ism_extended_metadata;
#ifdef IVAS_RTPDUMP
    bool rtpdumpOutput;
    uint32_t numFramesPerPacket;
    char *sceneOrientationTrajFileName;
    char *deviceOrientationTrajFileName;
#endif

} EncArguments;

@@ -182,34 +176,28 @@ static ivas_error readForcedMode( FILE *file, IVAS_ENC_FORCED_MODE *forcedMode,
static IVAS_ENC_FORCED_MODE parseForcedMode( char *forcedModeChar );
#endif
static void str2arg( char *str, int *argc_local, char *argv_local[] );
#ifdef IVAS_RTPDUMP
static int encoder_main( int argc, char *argv[], IVAS_RTP *ivasRtp, int init_RtpWriter );
#else
static int encoder_main( int argc, char *argv[] );
#endif


/*------------------------------------------------------------------------------------------*
 * main()
 *
 * Main IVAS encoder function for command-line interface
 * supporting format switching
 * supporting IVAS format switching
 *------------------------------------------------------------------------------------------*/


int main(
    int argc,
    char *argv[] )
{
    bool mainFailed = true; /* Assume main failed until cleanup is reached without errors */
    FILE *FmtSWFile = NULL;
    char line[2048];
    int argc_local = 0;
    char *argv_local[MAX_ARGV] = { 0 };
#ifdef IVAS_RTPDUMP
    IVAS_RTP ivasRtp = { 0 };
    char prev_outputBitstreamFilename[2048] = { 0 };
    int rtp_term = 0;
#endif

    IVAS_ENC_PrintDisclaimer();

@@ -217,14 +205,14 @@ int main(
    {
        fprintf( stdout, "Usage: IVAS_cod_fmtsw.exe format_switching_file\n\n" );
        fprintf( stdout, "where format_switching_file is a text file containg a valid encoder command line in each line\n\n" );
        exit( 0 );
        goto cleanup;
    }
    fprintf( stdout, "Input format switching file: %s\n", argv[1] );

    if ( ( FmtSWFile = fopen( argv[1], "r" ) ) == NULL )
    {
        fprintf( stdout, "error: cannot open format switching file %s\n", argv[1] );
        exit( 0 );
        goto cleanup;
    }

    while ( fgets( line, sizeof( line ), FmtSWFile ) )
@@ -233,11 +221,13 @@ int main(
        line[strcspn( line, "\r\n" )] = 0;
        printf( "Processing format switching commandline: %s\n", line );
        str2arg( line, &argc_local, argv_local );
#ifdef IVAS_RTPDUMP
        if ( strcmp( argv_local[argc_local - 1], (char *) prev_outputBitstreamFilename ) == 0 )
        {
            /* append to last Rtp file */
            encoder_main( argc_local, argv_local, &ivasRtp, 0 );
            if ( encoder_main( argc_local, argv_local, &ivasRtp, 0 ) != 0 )
            {
                goto cleanup;
            }
        }
        else
        {
@@ -245,20 +235,33 @@ int main(
            {
                IVAS_RTP_Term( &ivasRtp );
            }

            /* write in separate Rtp file */
            encoder_main( argc_local, argv_local, &ivasRtp, 1 );
            if ( encoder_main( argc_local, argv_local, &ivasRtp, 1 ) != 0 )
            {
                goto cleanup;
            }

            rtp_term = 1;
        }
        strcpy( (char *) prev_outputBitstreamFilename, argv_local[argc_local - 1] );
#else
        encoder_main( argc_local, argv_local );
#endif
    }
#ifdef IVAS_RTPDUMP

    /*------------------------------------------------------------------------------------------*
     * Close files and deallocate resources
     *------------------------------------------------------------------------------------------*/

    mainFailed = false; /* This will stay set to true if cleanup is reached via a goto due to an error */

cleanup:

    IVAS_RTP_Term( &ivasRtp );
#endif
    if ( FmtSWFile )
    {
        fclose( FmtSWFile );
    exit( 0 );
    }

    return mainFailed ? -1 : 0;
}


@@ -286,13 +289,9 @@ void str2arg(

int encoder_main(
    int argc,
#ifdef IVAS_RTPDUMP
    char *argv[],
    IVAS_RTP *ivasRtp,
    int init_RtpWriter )
#else
    char *argv[] )
#endif
{
    bool mainFailed = true; /* Assume main failed until cleanup is reached without errors */
    EncArguments arg;
@@ -309,10 +308,8 @@ int encoder_main(
    MasaFileReader *masaReader = NULL;
    IsmFileReader *ismReaders[IVAS_MAX_NUM_OBJECTS] = { NULL, NULL, NULL, NULL };
    int16_t *pcmBuf = NULL;
#ifdef IVAS_RTPDUMP
    RotFileReader *sceneOrientationFileReader = NULL;
    RotFileReader *deviceOrientationFileReader = NULL;
#endif
#ifdef DEBUGGING
    FILE *f_forcedModeProfile = NULL;
#ifdef DEBUG_SBA
@@ -333,19 +330,15 @@ int encoder_main(
    enable_float_exception_trap( FLE_MASK_DENORM | FLE_MASK_UNDERFLOW );
#endif

#ifdef IVAS_RTPDUMP
    uint8_t au[IVAS_MAX_BITS_PER_FRAME / 8];
    /* IVAS_RTP ivasRtp = { 0 }; */
#endif

#ifdef FIXED_RTP_SEQUENCE_NUM
    /* 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 */
    srand( RANDOM_INITSEED_ENC );
    uint32_t ssrc = ( (uint32_t) rand() & 0x0000FFFF ) | ( (uint32_t) rand() << 16 );
    uint16_t seqNumInitVal = (uint16_t) ( rand() & 0xFFFF );
#endif
    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 );

    /*------------------------------------------------------------------------------------------*
     * Parse command-line arguments
@@ -373,11 +366,7 @@ int encoder_main(
     *------------------------------------------------------------------------------------------*/
    const BS_WRITER_FORMAT bsWriterFormat = arg.mimeOutput ? BS_WRITER_FORMAT_MIME : BS_WRITER_FORMAT_G192;

#ifdef IVAS_RTPDUMP
    if ( !arg.rtpdumpOutput && BS_Writer_Open_filename( &hBsWriter, arg.outputBitstreamFilename, bsWriterFormat ) != IVAS_ERR_OK )
#else
    if ( BS_Writer_Open_filename( &hBsWriter, arg.outputBitstreamFilename, bsWriterFormat ) != IVAS_ERR_OK )
#endif
    {
        fprintf( stderr, "\nCan't open %s\n\n", arg.outputBitstreamFilename );
        goto cleanup;
@@ -576,14 +565,14 @@ int encoder_main(
            if ( ( error = IVAS_ENC_ConfigureForSBAObjects( hIvasEnc, arg.inputFs, totalBitrate, bandwidth, arg.dtxConfig, arg.inputFormatConfig.sba_ism.numObjects, arg.inputFormatConfig.sba_ism.order, arg.inputFormatConfig.sba_ism.isPlanar, arg.pca ) ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "\nIVAS_ENC_ConfigureForSBAObjects failed: %s\n\n", IVAS_ENC_GetErrorMessage( error ) );
                exit( -1 );
                goto cleanup;
            }
            break;
        case IVAS_ENC_INPUT_MASA_ISM:
            if ( ( error = IVAS_ENC_ConfigureForMASAObjects( hIvasEnc, arg.inputFs, totalBitrate, bandwidth, arg.dtxConfig, arg.inputFormatConfig.masa_ism.numObjects, arg.inputFormatConfig.masa_ism.masaVariant ) ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "\nIVAS_ENC_ConfigureForMASAObjects failed: %s\n\n", IVAS_ENC_GetErrorMessage( error ) );
                exit( -1 );
                goto cleanup;
            }
            break;
        default:
@@ -735,18 +724,13 @@ int encoder_main(
        }
    }

#ifdef IVAS_RTPDUMP
    /*------------------------------------------------------------------------------------------*
     * RTPDump
     *------------------------------------------------------------------------------------------*/

    if ( arg.rtpdumpOutput && init_RtpWriter )
    {
#ifdef FIXED_RTP_SEQUENCE_NUM
        if ( ( error = IVAS_RTP_WRITER_Init( ivasRtp, arg.outputBitstreamFilename, arg.numFramesPerPacket, ssrc, seqNumInitVal ) ) != IVAS_ERR_OK )
#else
        if ( ( error = IVAS_RTP_WRITER_Init( ivasRtp, arg.outputBitstreamFilename, arg.numFramesPerPacket ) ) != IVAS_ERR_OK )
#endif
        {
            fprintf( stderr, "\nError: Can't open output bitstream file for RTP output %s \n\n", arg.outputBitstreamFilename );
            goto cleanup;
@@ -778,7 +762,10 @@ int encoder_main(
            goto cleanup;
        }
    }
#endif

    /*------------------------------------------------------------------------------------------*
     * Run the encoder
     *------------------------------------------------------------------------------------------*/

    int16_t numSamplesRead = 0;
    uint16_t bitStream[IVAS_MAX_BITS_PER_FRAME];
@@ -944,7 +931,6 @@ int encoder_main(
        }

        /* *** Encode one frame *** */
#ifdef IVAS_RTPDUMP
        if ( ivasRtp->hPack )
        {
            bool isMono = ( arg.inputFormat == IVAS_ENC_INPUT_MONO );
@@ -992,11 +978,7 @@ int encoder_main(
                goto cleanup;
            }

#ifdef RTP_S4_251135_CR26253_0016_REV1
            if ( ( error = IVAS_RTP_WriteNextFrame( ivasRtp, au, NULL, numBits, isMono, forcePacket ) ) != IVAS_ERR_OK )
#else
            if ( ( error = IVAS_RTP_WriteNextFrame( ivasRtp, au, numBits, isMono, forcePacket ) ) != IVAS_ERR_OK )
#endif
            {
                fprintf( stderr, "\nError %s while pushing audio frame to RTP pack\n", IVAS_ENC_GetErrorMessage( error ) );
                goto cleanup;
@@ -1004,7 +986,6 @@ int encoder_main(
        }
        else
        {
#endif
            if ( ( error = IVAS_ENC_EncodeFrameToSerial( hIvasEnc, pcmBuf, pcmBufSize, bitStream, &numBits ) ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "\nencodeFrame failed: %s\n\n", IVAS_ENC_GetErrorMessage( error ) );
@@ -1017,9 +998,7 @@ int encoder_main(
                fprintf( stderr, "\nBS_Writer_WriteFrame_short failed, error code %d\n\n", error );
                goto cleanup;
            }
#ifdef IVAS_RTPDUMP
        }
#endif

        frame++;
        if ( !arg.quietModeEnabled )
@@ -1097,7 +1076,6 @@ cleanup:
        fclose( f_bitrateProfile );
    }

#ifdef IVAS_RTPDUMP
    if ( sceneOrientationFileReader )
    {
        RotationFileReader_close( &sceneOrientationFileReader );
@@ -1109,7 +1087,6 @@ cleanup:
    }

    /* IVAS_RTP_Term( &ivasRtp ); */
#endif

    IVAS_ENC_Close( &hIvasEnc );

@@ -1176,11 +1153,9 @@ static bool parseCmdlIVAS_enc(
    arg->mimeOutput = false;
    arg->ism_extended_metadata = false;
    arg->complexityLevel = IVAS_ENC_COMPLEXITY_LEVEL_THREE;
#ifdef IVAS_RTPDUMP
    arg->rtpdumpOutput = false;
    arg->sceneOrientationTrajFileName = NULL;
    arg->deviceOrientationTrajFileName = NULL;
#endif

#ifdef DEBUGGING
    arg->forcedMode = IVAS_ENC_FORCE_UNFORCED;
@@ -1975,7 +1950,6 @@ static bool parseCmdlIVAS_enc(
            i++;
        }

#ifdef IVAS_RTPDUMP
        /*-----------------------------------------------------------------*
         * RTPDump output
         *-----------------------------------------------------------------*/
@@ -2039,7 +2013,6 @@ static bool parseCmdlIVAS_enc(
            i++;
        }

#endif
        /*-----------------------------------------------------------------*
         * Option not recognized
         *-----------------------------------------------------------------*/
@@ -2051,7 +2024,6 @@ static bool parseCmdlIVAS_enc(
        }
    } /* end of while  */

#ifdef IVAS_RTPDUMP
    if ( arg->sceneOrientationTrajFileName != NULL && arg->rtpdumpOutput == false )
    {
        fprintf( stderr, "Error: Scene orientations are only enabled with rtpdump output!\n\n" );
@@ -2065,7 +2037,6 @@ static bool parseCmdlIVAS_enc(
        return false;
    }

#endif
    /*-----------------------------------------------------------------*
     * Mandatory input arguments
     *-----------------------------------------------------------------*/
@@ -2272,14 +2243,12 @@ static void usage_enc( void )
#endif
    fprintf( stdout, "-q                  : Quiet mode, no frame counters\n" );
    fprintf( stdout, "                      default is deactivated\n" );
#ifdef IVAS_RTPDUMP
    fprintf( stdout, "-rtpdump <N>        : RTPDump output, hf_only=1 by default. The encoder will packetize the \n" );
    fprintf( stdout, "                      bitstream frames into TS26.253 Annex A IVAS RTP Payload Format packets and \n" );
    fprintf( stdout, "                      writes those to the output file. In EVS mono operating mode, TS26.445 Annex A.2.2 \n" );
    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" );
#endif
    fprintf( stdout, "\n" );

    return;
Loading