Commit 5af7a33a authored by Tapani Pihlajakuja's avatar Tapani Pihlajakuja
Browse files

Merge remote-tracking branch 'origin/main' into...

Merge remote-tracking branch 'origin/main' into basop-2514-porting-error-in-efap-function-add_vertex_to_convex_hull_fx
parents 0a27028b 32c9b48e
Loading
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -129,6 +129,7 @@
    <ClCompile Include="..\lib_util\obj_edit_file_reader.c" />
    <ClCompile Include="..\lib_util\render_config_reader.c" />
    <ClCompile Include="..\lib_util\rotation_file_reader.c" />
    <ClCompile Include="..\lib_util\requests_file_reader.c" />
    <ClCompile Include="..\lib_util\rtpdump.c" />
    <ClCompile Include="..\lib_util\split_render_file_read_write.c" />
    <ClCompile Include="..\lib_util\split_rend_bfi_file_reader.c" />
@@ -164,6 +165,7 @@
    <ClInclude Include="..\lib_util\masa_file_writer.h" />
    <ClInclude Include="..\lib_util\render_config_reader.h" />
    <ClInclude Include="..\lib_util\rotation_file_reader.h" />
    <ClInclude Include="..\lib_util\requests_file_reader.h" />
    <ClInclude Include="..\lib_util\rtpdump.h" />
    <ClInclude Include="..\lib_util\tinywavein_c.h" />
    <ClInclude Include="..\lib_util\tinywaveout_c.h" />
+62 −0
Original line number Diff line number Diff line
@@ -45,6 +45,9 @@
#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
#include "wmc_auto.h"


@@ -165,6 +168,9 @@ typedef struct
    char *sceneOrientationTrajFileName;
    char *deviceOrientationTrajFileName;

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


@@ -221,6 +227,9 @@ 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 */
@@ -658,6 +667,20 @@ int main(
        }
    }

#ifdef FIX_1527_CMR_BITRATE_IDX
    /*------------------------------------------------------------------------------------------*
     * Open remote requests file for rtp packing (E-bytes)
     *------------------------------------------------------------------------------------------*/
    if ( arg.requestsFileName != NULL )
    {
        if ( ( error = RequestsFileReader_open( arg.requestsFileName, &requestsFileReader ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "\nError: Can't open requests file %s \n\n", arg.requestsFileName );
            goto cleanup;
        }
    }
#endif

    /*------------------------------------------------------------------------------------------*
     * Run the encoder
     *------------------------------------------------------------------------------------------*/
@@ -867,6 +890,17 @@ int main(
                }
            }

#ifdef FIX_1527_CMR_BITRATE_IDX
            if ( requestsFileReader )
            {
                if ( ( error = ReadNextRequests( requestsFileReader, ivasRtp.remoteRequests, &ivasRtp.remoteRequestBitmap ) ) != IVAS_ERR_OK )
                {
                    fprintf( stderr, "\nError %s while reading requests from %s\n", IVAS_ENC_GetErrorMessage( error ), RequestsFileReader_getFilePath( requestsFileReader ) );
                    goto cleanup;
                }
            }
#endif

            if ( ( error = IVAS_ENC_EncodeFrameToCompact( hIvasEnc, pcmBuf, pcmBufSize, au, &numBits ) ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "\nencodeFrame failed: %s\n\n", IVAS_ENC_GetErrorMessage( error ) );
@@ -962,6 +996,13 @@ cleanup:
        fclose( f_bitrateProfile );
    }

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

    if ( sceneOrientationFileReader )
    {
        RotationFileReader_close( &sceneOrientationFileReader );
@@ -1008,6 +1049,9 @@ static bool parseCmdlIVAS_enc(
    /*-----------------------------------------------------------------*
     * Set default values
     *-----------------------------------------------------------------*/
#ifdef FIX_1527_CMR_BITRATE_IDX
    memset( arg, 0, sizeof( *arg ) );
#endif

    arg->inputWavFilename = NULL;
    arg->outputBitstreamFilename = NULL;
@@ -1874,6 +1918,20 @@ static bool parseCmdlIVAS_enc(
            arg->deviceOrientationTrajFileName = argv[i];
            i++;
        }
#ifdef FIX_1527_CMR_BITRATE_IDX
        else if ( strcmp( argv_to_upper, "-REQUESTS" ) == 0 )
        {
            i++;
            if ( argc - i <= 4 || argv[i][0] == '-' )
            {
                fprintf( stderr, "Error: Remote requests file name not specified!\n\n" );
                usage_enc();
                return false;
            }
            arg->requestsFileName = argv[i];
            i++;
        }
#endif

        /*-----------------------------------------------------------------*
         * Option not recognized
@@ -2093,6 +2151,10 @@ 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" );

    return;
+5 −0
Original line number Diff line number Diff line
@@ -103,6 +103,8 @@
#define HARMONIZE_DCT                                   /* VA: removal of duplicated DCT functions */
#define FIX_2489_HARMONIZE_FdCng_encodeSID              /* FhG: harmonize FdCng_encodeSID_fx() and FdCng_encodeSID_ivas_fx()  */
#define FIX_1527_CMR_BITRATE_IDX                        /* Fix for incorrect bitrate idx packed in rtp CMR E-byte */
#define HARMONIZE_2494_FdCng_decodeSID_fx               /* FhG: harmonize FdCng_decodeSID_fx with _ivas_ version */
#define FIX_BASOP_2509_EVS_CONCEAL_UNINIT_MEM           /* FhG: BASOP 2509: st->hTcxCfg->psychParamsCurrent is not initialized */

/* #################### End BE switches ################################## */

@@ -122,6 +124,9 @@
#define FIX_BASOP_2497_MCMASA_LFE_WRONG_SF_INDEX        /* Nokia: BASOP 2497: Fix wrong subframe index in McMASA LFE synth. */
#define FIX_BASOP_2496_OMASA_OBJ_EDIT_WRONG_ASSIGN      /* Nokia: BASOP 2496: Fix wrong assignment in OMASA object edit code */
#define FIX_2495_Q_ALIGN_OSBA_RENDERER                  /* FhG: Basop issue #2495: Corrected exponent scaling of outAudio.data_fx before buffer accumulation in renderSbaToBinaural(). */
#define FIX_BASOP_2511_PROTO_REF_POWER_FIX              /* FhG: BASOP 2511; Fix reference power computation in protoSignalComputation_shd_fx() */
#define FIX_BASOP_2512_WRONG_SHIFT_IN_DIRAC_CONFIG      /* Nokia: BASOP 2512: Fix wrong division by shift */
#define FIX_BASOP_2513_EXTRA_RETURN_REND_OPEN           /* Nokia: BASOP issue 2513: Removes extra return block */
#define FIX_BASOP_2514_EFAP_PORTING_ERROR               /* Nokia: BASOP issue 2514: Fix wrongly ported line */

/* ##################### End NON-BE switches ########################### */
+13 −1
Original line number Diff line number Diff line
@@ -6651,9 +6651,14 @@ void perform_noise_estimation_dec_ivas_fx(
);

/* Decode the CLDFB-CNG bitstream */
#ifdef HARMONIZE_2494_FdCng_decodeSID_fx
void FdCng_decodeSID_fx(
    Decoder_State *st ); /* i/o: decoder state structure */
#else
void FdCng_decodeSID_fx(
    HANDLE_FD_CNG_COM st,    /* i/o: FD_CNG structure containing all buffers and variables */
    Decoder_State *corest ); /* i/o: decoder state structure */
#endif

void noisy_speech_detection_fx(
    HANDLE_FD_CNG_DEC hFdCngDec, /* i/o: FD_CNG structure            */
@@ -7290,7 +7295,12 @@ ivas_error ppp_quarter_decoder_fx(
void open_decoder_LPD_fx(
    Decoder_State *st,
    const Word32 total_brate, /* Q0 */
#ifndef FIX_BASOP_2509_EVS_CONCEAL_UNINIT_MEM
    const Word16 bwidth /* Q0 */
#else
    const Word16 bwidth, /* Q0 */
    const Word16 is_init /* i  : indicate call during initialization    */
#endif
);

void open_decoder_LPD_ivas_fx(
@@ -9595,9 +9605,11 @@ void SynthesisSTFT_fx(
    const Word16 nchan_out       /* i  : number of output channels */
);

#ifndef HARMONIZE_2494_FdCng_decodeSID_fx
void FdCng_decodeSID_ivas_fx(
    Decoder_State *st /* i/o: decoder state structure */
);
#endif

void cldfb_restore_memory_ivas_fx(
    HANDLE_CLDFB_FILTER_BANK hs /* i/o: filter bank handle          */
+12 −1
Original line number Diff line number Diff line
@@ -166,7 +166,11 @@ ivas_error acelp_core_dec_fx(
            /* Only run parameter decoding in SID frames */
            IF( EQ_32( st->core_brate, SID_2k40 ) )
            {
#ifndef HARMONIZE_2494_FdCng_decodeSID_fx
                FdCng_decodeSID_ivas_fx( st );
#else
                FdCng_decodeSID_fx( st );
#endif

                Word16 n1, n2;
                n1 = L_norm_arr( st->hFdCngDec->hFdCngCom->sidNoiseEst, NPART );
@@ -663,14 +667,21 @@ ivas_error acelp_core_dec_fx(
                {
                    IF( EQ_16( st->element_mode, EVS_MONO ) )
                    {
#ifndef HARMONIZE_2494_FdCng_decodeSID_fx
                        FdCng_decodeSID_fx( st->hFdCngDec->hFdCngCom, st );
#else
                        FdCng_decodeSID_fx( st );
#endif
                    }
                    ELSE
                    {
                        Word16 old_NoiseEstExp = st->hFdCngDec->hFdCngCom->sidNoiseEstExp;
                        move16();

#ifndef HARMONIZE_2494_FdCng_decodeSID_fx
                        FdCng_decodeSID_ivas_fx( st );
#else
                        FdCng_decodeSID_fx( st );
#endif

                        Scale_sig32( st->hFdCngDec->hFdCngCom->sidNoiseEstLp, NPART, sub( old_NoiseEstExp, st->hFdCngDec->hFdCngCom->sidNoiseEstExp ) );
                        Scale_sig( st->hFdCngDec->hFdCngCom->A_cng, M + 1, sub( norm_s( st->hFdCngDec->hFdCngCom->A_cng[0] ), Q2 ) ); // Qx
Loading