Commit f674e87e authored by Vladimir Malenovsky's avatar Vladimir Malenovsky
Browse files

Merge branch 'main' into 1422-add-levels-to-26-252-be-conformance-scripts

parents 51465d36 c865e3f0
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3115,7 +3115,7 @@ static ivas_error printBitstreamInfoVoip(
{
    bool previewFailed = true;
    ivas_error error = IVAS_ERR_OK;
    IVAS_RTP ivasRtp;
    IVAS_RTP ivasRtp = { 0 };
    uint8_t au[( IVAS_MAX_BITS_PER_FRAME + 7 ) >> 3];
    int16_t auSizeBits;
    uint8_t *auPtr = NULL;
+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" );

+4 −0
Original line number Diff line number Diff line
@@ -61,6 +61,10 @@
#define IVAS_REVERB_PREDELAY_MAX         20 /* Max input delay for reverb module */
#define IVAS_ER_LIST_HEIGHT              1.6f
#define IVAS_DEFAULT_AEID                65535
#ifdef FIX_BASOP_2023_TDREND_DISTATT_PRECISION
#define IVAS_LISTENER_POSITION_MAX 327.67f
#endif


/* JBM constants for adaptive-playout */
#define IVAS_TIME_SCALE_MIN 50  /* min. time-scaling [%] */
+6 −1
Original line number Diff line number Diff line
@@ -162,16 +162,21 @@
#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 ################################## */

/* #################### Start NON-BE switches ############################ */
/* any switch which is non-be wrt. TS 26.258 V3.0 */

#define USE_RTPDUMP                                     /* FhG: RTPDUMP format (rtptools standard) instead of custom format */
#define FIX_1540_EXPOSE_PT_IN_RTP_HEADER_API            /* Expose Payload Type setting in RTP Header */
#define FIX_BASOP_2023_TDREND_DISTATT_PRECISION         /* Eri: Basop issue 2023: Distance attenuation scaling, synch with BASOP updates and adding clamping of distance att input and listener position  */
#define FIX_1574_EFAP_CODE_LINT                         /* FhG: issue 1574: Code quality fixes in ivas_efap.c */
#define FIX_FLOAT_1569_REND_RENDER_CONFIG_CHECKS        /* Nokia: float issue 1569: fix render config checks in renderer */
#define FIX_1571_BFI_COPY_ARRAY_CORRECT_LEN             /* FhG: issue 1571: use correct channel signal length for copying signal to buffer */
#define FIX_FLOAT_1573_POSITION_UPDATE                  /* Eri: Float issue 1573: For static orientation and listener movement, the PoseUpdated flag is cleared and prevents 5 ms update rate. */
#define FIX_1576_LCLD_CRASH_DIFFERENT_CODEC_ISAR_FRAME_SIZE  /* Dolby: float issue 1576: fix for crash in LCLD mode when codec frame size is less than isar frame size */

/* ##################### End NON-BE switches ########################### */

+59 −0
Original line number Diff line number Diff line
@@ -272,7 +272,12 @@ static int16_t BidagonalDiagonalisation(
)
{
    int16_t kCh, nCh, iCh, jCh, split;
#ifdef FIX_FLOAT_1560_SVD_NO_OPT_MAX_W_SIGN
    volatile float c, s;
    float f1, f2;
#else
    float c, s, f1, f2;
#endif
    float g = 0.0f;
    int16_t convergence, iteration, found_split;
    int16_t error = 0;
@@ -385,9 +390,14 @@ static void ApplyQRTransform(
)
{
    int16_t ch, split;
#ifdef FIX_FLOAT_1560_SVD_NO_OPT_MAX_W_SIGN
    float d = 0.0f, g = 0.0f, r = 0.0f, x_ii = 0.0f, x_split = 0.0f, x_kk = 0.0f, aux = 0.0f;
    volatile float mu = 0.0f, c = 1.0f, s = 1.0f;
#else
    float d = 0.0f, g = 0.0f, r = 0.0f, x_ii = 0.0f, x_split = 0.0f, x_kk = 0.0f, mu = 0.0f, aux = 0.0f;
    float c = 1.0f;
    float s = 1.0f;
#endif

    x_kk = singularValues[currentIndex];
    x_ii = singularValues[startIndex];
@@ -525,10 +535,20 @@ static void biDiagonalReductionLeft(
    float *g )
{
    int16_t iCh, jCh;
#ifdef FIX_FLOAT_1560_SVD_NO_OPT_MAX_W_SIGN
    volatile float norm_x, r;
    volatile float f;
    volatile float g_loc;
#else
    float norm_x, f, r;
#endif

    /* Setting values to 0 */
#ifdef FIX_FLOAT_1560_SVD_NO_OPT_MAX_W_SIGN
    g_loc = 0.0f;
#else
    ( *g ) = 0.0f;
#endif

    if ( currChannel < nChannelsL ) /* i <= m */
    {
@@ -541,9 +561,15 @@ static void biDiagonalReductionLeft(

        if ( ( norm_x ) ) /*(fabsf(*sig_x) > EPSILON * fabsf(*sig_x)) { */
        {
#ifdef FIX_FLOAT_1560_SVD_NO_OPT_MAX_W_SIGN
            g_loc = -( singularVectors[currChannel][currChannel] >= 0 ? 1 : ( -1 ) ) * sqrtf( norm_x );
            r = g_loc * singularVectors[currChannel][currChannel] - norm_x;
            singularVectors[currChannel][currChannel] = ( singularVectors[currChannel][currChannel] - g_loc );
#else
            ( *g ) = -( singularVectors[currChannel][currChannel] >= 0 ? 1 : ( -1 ) ) * sqrtf( norm_x );
            r = ( *g ) * singularVectors[currChannel][currChannel] - norm_x;
            singularVectors[currChannel][currChannel] = ( singularVectors[currChannel][currChannel] - ( *g ) );
#endif

            for ( iCh = currChannel + 1; iCh < nChannelsC; iCh++ ) /* nChannelsC */
            {
@@ -564,6 +590,10 @@ static void biDiagonalReductionLeft(
        }
    }

#ifdef FIX_FLOAT_1560_SVD_NO_OPT_MAX_W_SIGN
    *g = g_loc;
#endif

    return;
}

@@ -582,10 +612,19 @@ static void biDiagonalReductionRight(
    float *g )
{
    int16_t iCh, jCh, idx;
#ifdef FIX_FLOAT_1560_SVD_NO_OPT_MAX_W_SIGN
    volatile float norm_x, r;
    volatile float g_loc;
#else
    float norm_x, r;
#endif

    /* Setting values to 0 */
#ifdef FIX_FLOAT_1560_SVD_NO_OPT_MAX_W_SIGN
    g_loc = 0.0f;
#else
    ( *g ) = 0.0f;
#endif

    if ( currChannel < nChannelsL && currChannel != ( nChannelsC - 1 ) ) /* i <=m && i !=n */
    {
@@ -600,9 +639,15 @@ static void biDiagonalReductionRight(

        if ( norm_x ) /*(fabsf(*sig_x) > EPSILON * fabsf(*sig_x)) { */
        {
#ifdef FIX_FLOAT_1560_SVD_NO_OPT_MAX_W_SIGN
            g_loc = -( singularVectors[currChannel][idx] >= 0 ? 1 : ( -1 ) ) * sqrtf( norm_x );
            r = g_loc * singularVectors[currChannel][idx] - norm_x;
            singularVectors[currChannel][idx] = ( singularVectors[currChannel][idx] - g_loc );
#else
            ( *g ) = -( singularVectors[currChannel][idx] >= 0 ? 1 : ( -1 ) ) * sqrtf( norm_x );
            r = ( *g ) * singularVectors[currChannel][idx] - norm_x;
            singularVectors[currChannel][idx] = ( singularVectors[currChannel][idx] - ( *g ) );
#endif

            for ( iCh = currChannel + 1; iCh < nChannelsL; iCh++ ) /*  nChannelsL */
            {
@@ -620,6 +665,10 @@ static void biDiagonalReductionRight(
        }
    }

#ifdef FIX_FLOAT_1560_SVD_NO_OPT_MAX_W_SIGN
    *g = g_loc;
#endif

    return;
}

@@ -638,7 +687,12 @@ static void singularVectorsAccumulationLeft(
{
    int16_t nCh, iCh, k;
    int16_t nChannels;
#ifdef FIX_FLOAT_1560_SVD_NO_OPT_MAX_W_SIGN
    float norm_y;
    volatile float t_jj, t_ii;
#else
    float norm_y, t_jj, t_ii;
#endif

    /* Processing */
    nChannels = min( nChannelsL, nChannelsC ); /* min(nChannelsL,ChannelsC) */
@@ -706,7 +760,12 @@ static void singularVectorsAccumulationRight(
{
    int16_t nCh, iCh, k;
    int16_t nChannels;
#ifdef FIX_FLOAT_1560_SVD_NO_OPT_MAX_W_SIGN
    float norm_y, t_ii;
    volatile float ratio;
#else
    float norm_y, t_ii, ratio;
#endif

    /* Processing */
    nChannels = nChannelsC; /* nChannelsC */
Loading