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

Merge branch 'main' into isar_lcld_crash_codec_fr_LT_isar_fr

parents cf2795b4 aecf0f5e
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" );

+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 [%] */
+2 −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 ################################## */
@@ -172,9 +171,11 @@

#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 ########################### */
+14 −0
Original line number Diff line number Diff line
@@ -49,6 +49,14 @@
#endif
#include "wmc_auto.h"

#ifndef min
#define min( x, y ) ( ( x ) < ( y ) ? ( x ) : ( y ) )
#endif

#ifndef max
#define max( x, y ) ( ( x ) > ( y ) ? ( x ) : ( y ) )
#endif

/*---------------------------------------------------------------------*
 * Local structs
 *---------------------------------------------------------------------*/
@@ -2601,9 +2609,15 @@ ivas_error IVAS_DEC_FeedHeadTrackData(
        return error;
    }

#ifdef FIX_BASOP_2023_TDREND_DISTATT_PRECISION
    hHeadTrackData->Pos[subframe_idx].x = max( min( IVAS_LISTENER_POSITION_MAX, Pos.x ), -IVAS_LISTENER_POSITION_MAX );
    hHeadTrackData->Pos[subframe_idx].y = max( min( IVAS_LISTENER_POSITION_MAX, Pos.y ), -IVAS_LISTENER_POSITION_MAX );
    hHeadTrackData->Pos[subframe_idx].z = max( min( IVAS_LISTENER_POSITION_MAX, Pos.z ), -IVAS_LISTENER_POSITION_MAX );
#else
    hHeadTrackData->Pos[subframe_idx].x = Pos.x;
    hHeadTrackData->Pos[subframe_idx].y = Pos.y;
    hHeadTrackData->Pos[subframe_idx].z = Pos.z;
#endif

    hHeadTrackData->sr_pose_pred_axis = rot_axis;
    hIvasDec->updateOrientation = true;
+9 −0
Original line number Diff line number Diff line
@@ -107,8 +107,14 @@ ivas_error TDREND_MIX_LIST_SetOrient(
    /* Get listener */
    List_p = hBinRendererTd->Listener_p;

#ifdef FIX_FLOAT_1573_POSITION_UPDATE
    /* Evaluate the normalized orientation vectors and set pose update flag */
    /* Use OR since the position may have been updated in TDREND_MIX_LIST_SetPos */
    List_p->PoseUpdated |= TDREND_SPATIAL_EvalOrthonormOrient( List_p->Front, List_p->Up, List_p->Right, FrontVec_p, UpVec_p );
#else
    /* Evaluate the normalized orientation vectors and set pose update flag */
    List_p->PoseUpdated = TDREND_SPATIAL_EvalOrthonormOrient( List_p->Front, List_p->Up, List_p->Right, FrontVec_p, UpVec_p );
#endif

    return IVAS_ERR_OK;
}
@@ -195,6 +201,9 @@ ivas_error TDREND_MIX_Init(
    TDREND_SPATIAL_VecInit( hBinRendererTd->Listener_p->Front, 0.0f, 0.0f, -1.0f );
    TDREND_SPATIAL_VecInit( hBinRendererTd->Listener_p->Up, 0.0f, 1.0f, 0.0f );
    TDREND_SPATIAL_VecInit( hBinRendererTd->Listener_p->Right, 1.0f, 0.0f, 0.0f );
#ifdef FIX_FLOAT_1573_POSITION_UPDATE
    hBinRendererTd->Listener_p->PoseUpdated = FALSE;
#endif

    /* Init HR filter set */
    if ( *hHrtfTD == NULL )
Loading