Commit 6af6d0f9 authored by multrus's avatar multrus
Browse files

Merge branch 'main' into...

Merge branch 'main' into basop-2521-probable-porting-bug-in-ivas_sba_dirac_stereo_compute_td_stefi_nrgs
parents f0ed4cb9 11cd64e9
Loading
Loading
Loading
Loading
Loading
+0 −18
Original line number Diff line number Diff line
@@ -45,9 +45,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
#include "wmc_auto.h"


@@ -168,9 +166,7 @@ typedef struct
    char *sceneOrientationTrajFileName;
    char *deviceOrientationTrajFileName;

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


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

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

    /*------------------------------------------------------------------------------------------*
     * Run the encoder
@@ -890,7 +882,6 @@ int main(
                }
            }

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

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

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

    if ( sceneOrientationFileReader )
    {
@@ -1049,9 +1037,7 @@ 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;
@@ -1918,7 +1904,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++;
@@ -1931,7 +1916,6 @@ static bool parseCmdlIVAS_enc(
            arg->requestsFileName = argv[i];
            i++;
        }
#endif

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

+1 −27
Original line number Diff line number Diff line
@@ -27,9 +27,6 @@ void fine_gain_pred_fx(
    Word16 *xq,              /* i/o: Quantized vector /quantized vector with finegain adj Q15*/
    Word16 *y,               /* i/o: Quantized vector (int)      Q0  */
    Word16 *fg_pred,         /* o  : Predicted fine gains        Q12 */
#ifndef FIX_BASOP_2486_HQ_FINE_GAIN_ALIGNMENT
    const Word16 element_mode, /* i  : element mode                    */
#endif
    const Word16 core        /* i  : Core                            */
)
{
@@ -76,7 +73,6 @@ void fine_gain_pred_fx(
                exp = sub( 31, add( exp, sub( 30, shl( shift, 1 ) ) ) );
                L_tmp = Isqrt_lc( L_tmp, &exp ); /*31 - exp */

#ifdef FIX_BASOP_2486_HQ_FINE_GAIN_ALIGNMENT
                IF( EQ_16( sfm_size[0], 10 ) ) /* If sfm_size[0] is 10, it means the extended ACELP->HQ transition frame is used. See hq_configure_fx(). */
                {
                    bw_idx = band_len_idx_ext[shr( bw, 3 )];
@@ -86,28 +82,6 @@ void fine_gain_pred_fx(
                {
                    tmp1 = fine_gain_pred_sqrt_bw[bw_idx];
                }
#else
                IF( element_mode == EVS_MONO )
                {
                    tmp1 = fine_gain_pred_sqrt_bw[bw_idx];
                }
                ELSE
                {
                    IF( EQ_16( sfm_size[0], 10 ) ) /* If sfm_size[0] is 10, it means the extended ACELP->HQ transition frame is used. See hq_configure_fx(). */
                    {
                        bw_idx = band_len_idx_ext[shr( bw, 3 )];
                        tmp1 = fine_gain_pred_sqrt_bw_ext[bw_idx];
                    }
                    ELSE
                    {
                        tmp1 = fine_gain_pred_sqrt_bw[bw_idx];
                        if ( EQ_16( bw_idx, 0 ) )
                        {
                            tmp1--; /* Lookup table uses rounding while calculations use truncation */
                        }
                    }
                }
#endif
                Mpy_32_16_ss( L_tmp, tmp1, &L_tmp, &lsb );              /*31-exp+11-15=27-exp */
                gp = round_fx_sat( L_shl_sat( L_tmp, add( 1, exp ) ) ); /*27-exp+1+exp-16=12 */
                test();
+0 −11
Original line number Diff line number Diff line
@@ -91,27 +91,16 @@
#define NONBE_FIX_ISSUE_2206_AVOID_OVERFLOW_SWB_fenv_fx2 /* FhG: Avoid overflow of SWB_fenv_fx in SWB_BWE_encoding_fx because of very small energies. */
#define NONBE_FIX_ISSUE_2206_AVOID_OVERFLOW_MSVQ_Interpol_Tran_fx /* FhG: Fix saturation crash in MSVQ_Interpol_Tran_fx() */
#define NONBE_FIX_ISSUE_2206_SWB_EXPERIMENT_FIX_2527    /* Fix crash from issue #2527 */
#define FIX_2452_HQ_CORE_PEAQ_AVR_RATIO_HARM            /* Eri: Basop issue 2453: Fix alignment of peak_avrg_ratio_fx */
#define FIX_FLOAT_1539_G192_FORMAT_SWITCH               /* VA/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 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 */
#define HARMONIZE_2499_CONFIGUREFDCNGDEC                /* FhG: basop issue 2499: harmonoize configureFdCngDec */
#define FIX_BASOP_2530_IVAS_DECISION_MAT                /* VA: Fix ambiguous usage of extract_l() */


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

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

#define FIX_BASOP_2486_HQ_FINE_GAIN_ALIGNMENT           /* Eri: Basop issue 2486: IVAS BASOP used calculations with truncation, EVS BASOP used rounding. This aligns the use of a table lookup. */
#define FIX_1540_EXPOSE_PT_IN_RTP_HEADER_API            /* Expose Payload Type setting in RTP Header */
#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 */
#define FIX_BASOP_2516_REND_CUSTOM_LAYOUT_PORT_BUG      /* Nokia: BASOP issue 2516: Fix porting bug in setting planar state for custom layout in renderer */
#define USE_RTPDUMP                                     /* FhG: RTPDUMP format (rtptools standard) instead of custom format */
#define FIX_FLOAT_1569_REND_RENDER_CONFIG_CHECKS        /* Nokia: float issue 1569: fix render config checks in renderer */
#define FIX_BASOP_2526_SPAR_MASA_PARAM_MAP_Q_BUG        /* Nokia: BASOP issue 2526: Fix wrong Q variable in SPAR to MASA param mapping */
+3 −21
Original line number Diff line number Diff line
@@ -4426,9 +4426,6 @@ void fine_gain_pred_fx(
    Word16 *xq,              /* i/o: Quantized vector /quantized vector with finegain adj Q15*/
    Word16 *y,               /* i/o: Quantized vector (int)          */
    Word16 *fg_pred,         /* o  : Predicted fine gains        Q12 */
#ifndef FIX_BASOP_2486_HQ_FINE_GAIN_ALIGNMENT
    const Word16 element_mode, /* i  : element mode                    */
#endif
    const Word16 core        /* i  : Core                            */
);

@@ -6574,14 +6571,8 @@ 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            */
@@ -7218,12 +7209,8 @@ 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(
@@ -9530,11 +9517,6 @@ 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          */
+0 −12
Original line number Diff line number Diff line
@@ -166,11 +166,7 @@ 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,21 +659,13 @@ 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