Commit 9c88ac1f authored by advasila's avatar advasila
Browse files

Merge branch 'nokia/contribution-omasa-combined-format-refactor-merge' of...

Merge branch 'nokia/contribution-omasa-combined-format-refactor-merge' of https://forge.3gpp.org/rep/ivas-codec-pc/ivas-codec into nokia/contribution-omasa-combined-format-refactor-merge
parents 24966dbc f84b1fba
Loading
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -1564,7 +1564,7 @@ static bool parseCmdlIVAS_enc(
                        arg->inputFormatConfig.masa_ism.masaVariant = IVAS_ENC_MASA_2CH;
                        break;
                    default:
                        fprintf( stderr, "Error: MASA channels must for the moment be 1 or 2.\n\n" );
                        fprintf( stderr, "Error: MASA channels must be 1 or 2.\n\n" );
                        usage_enc();
                        break;
                }
@@ -1812,14 +1812,14 @@ static void usage_enc( void )
    fprintf( stdout, "                      where Order specifies the Ambisionics order (1-3),\n" );
    fprintf( stdout, "                      where positive (+) means full 3D and negative (-) only 2D/planar components to be coded\n" );
    fprintf( stdout, "-masa Ch File       : MASA format \n" );
    fprintf( stdout, "                      where Ch specifies the number of input/transport channels (1 or 2): \n" );
    fprintf( stdout, "                      where Ch specifies the number of MASA input/transport channels (1 or 2): \n" );
    fprintf( stdout, "                      and File specifies input file containing parametric MASA metadata \n" );
#ifdef MASA_AND_OBJECTS
    fprintf( stdout, "-ism_masa IsmChannels MasaChannels IsmFiles MasaFile : MASA and objects format \n" );
    fprintf( stdout, "                      where IsmChannels specifies the number of ISms (1-4)\n" );
    fprintf( stdout, "                      and MasaChannels specifies the number of MASA input/transport channels (1 or 2) \n" );
    fprintf( stdout, "                      and IsmFiles specify input files containing metadata, one file per object \n" );
    fprintf( stdout, "                      and MasaFile specifies MASA input file containing parametric metadata \n" );
    fprintf( stdout, "-ism_masa IsmCh MasaCh IsmFiles MasaFile : MASA and ISM format \n" );
    fprintf( stdout, "                      where IsmCh specifies the number of ISMs (1-4),\n" );
    fprintf( stdout, "                      MasaCh specifies the number of MASA input/transport channels (1-2), \n" );
    fprintf( stdout, "                      IsmFiles specify input files containing metadata, one file per object, \n" );
    fprintf( stdout, "                      and MasaFile specifies input file containing parametric MASA metadata \n" );
#endif
    fprintf( stdout, "-mc InputConf       : Multi-channel format\n" );
    fprintf( stdout, "                      where InputConf specifies the channel configuration: 5_1, 7_1, 5_1_2, 5_1_4, 7_1_4\n" );
+9 −2
Original line number Diff line number Diff line
@@ -1464,9 +1464,7 @@ typedef enum
#define PARAM_MC_ENER_LIMIT_INTRAFRAME          (1.5f)
#define PARAM_MC_ENER_LIMIT_INTERFRAME          (2.0f)
#define PARAM_MC_ENER_LIMIT_MAX_DELTA_FAC       (15.0f)
#ifdef FIX_580_PARAMMC_ENER_BURSTS
#define PARAM_MC_NUM_ATTACK_ILD_THRESH          (3)
#endif
#define PARAM_MC_LFE_ON_THRESH                  (8000.0f)
#define PARAM_MC_BAND_TO_MDCT_BAND_RATIO        16                          /* Ratio of resolution of CLDFB Bands to MDCT Bands */
#define PARAM_MC_SLOT_ENC_NS                    2500000L
@@ -1674,13 +1672,22 @@ typedef enum
typedef enum
{
    TDREND_POSTYPE_ABSOLUTE,                                                /* The source position is in absolute coordinates  */
#ifdef FIX_550_FIRST_FRAME_ACCESS_ALT
    TDREND_POSTYPE_NON_DIEGETIC                                             /* The source position is non-diegetic */
#else
    TDREND_POSTYPE_RELATIVE_TO_LISTENER                                     /* The source position is relative to the listener */
#endif
} TDREND_PosType_t;

typedef enum
{
    TDREND_PLAYSTATUS_INITIAL,
#ifndef FIX_550_FIRST_FRAME_ACCESS_ALT
    TDREND_PLAYSTATUS_PLAYING,
    TDREND_PLAYSTATUS_PLAYING_NON_DIEGETIC
#else
    TDREND_PLAYSTATUS_PLAYING
#endif
} TDREND_PlayStatus_t;

typedef enum
+4 −0
Original line number Diff line number Diff line
@@ -385,7 +385,11 @@ void ivas_get_dirac_sba_max_md_bits(
        *bits_frame_nominal = (int16_t) ( sba_total_brate / FRAMES_PER_SEC );
        *metadata_max_bits = MAX16B; /* no limit */
    }
#ifdef FIX_629_UBSAN_MD_MAX_BITS
    *metadata_max_bits = (int16_t) min( (float) MAX16B, ceilf( (float) *metadata_max_bits * nbands / 5 ) );
#else
    *metadata_max_bits = (int16_t) ceilf( (float) *metadata_max_bits * nbands / 5 );
#endif
    *qmetadata_max_bit_req = QMETADATA_MAXBIT_REQ_SBA >> 1;

    return;
+13 −5
Original line number Diff line number Diff line
@@ -159,9 +159,12 @@
#define FIX_571_REVERB_NOT_ACTIVATED_ISM                /* Philips: Issue 571: Reverb not activated for discrete and parametric ISM */
#define FIX_QMETA_SID_5k2                               /* Nokia: Issue 137: enable using full 5.2k bitrate in MASA SID */


#define FIX_488_SYNC_DELAY                             /* Eri: Issue 488: Waveform and MD desynchronized in external renderer */

#define FIX_580_PARAMMC_ENER_BURSTS                     /* FhG: issue 580: energy bursts due to ILD holding when energy relations change too much */
#define FIX_550_FIRST_FRAME_ACCESS                      /* Eri: Issue 550: TD Object renderer: first frame accesses wrong transport channel offsets */
#define FIX_550_FIRST_FRAME_ACCESS_ALT                  /* Eri: Issue 550: Should be merged with FIX_550_FIRST_FRAME_ACCESS above, or accepted at the same time */
#define FIX_569_TD_FILTER_LENGTH                        /* Eri: Issue 569: If an HRTF binary file exceeds the SFX_SPAT_BIN_MAX_FILTER_LENGTH the decoder crashes. This truncates the filter when generated from the model.  */

#define FIX_595_SHL_NOGLOB                              /* FhG: Issue 595: compilation with BASOP_NOGLOB disabled */
#define UPDATE_FASTCONV_SBA_FILTER                      /* Dlb: Issue 584: Update SBA CLDFB-Domain HRTFs */
@@ -192,18 +195,23 @@
#define FIX_622_SILENCE_USAN_WARNING                    /* FhG: silenceusan warning in ifft code */

#define FIX_615_UBSAN_SPAR_TO_DIRAC                     /*Dlb : Fix for UBSAN issue 615*/

#define FIX_624_PLANAR_SBA_WB                           /*Dlb : Fix for unintialised value issue 624 */
#define FIX_629_UBSAN_MD_MAX_BITS                       /*Dlb : Fix for UBSAN issue 629 for MD MAX bits calculation*/

#define FIX_626_VARIABLE_TYPE_MDCT_CONC                 /* FhG: trivial fix to fix USAN error */
#define FIX_616_DIV_ZERO_MCT                            /*FhG : Fix UBSAN division by zero error of issue 616*/

#define FIX_616_DIV_ZERO_MCT                            /*FhG : Fix UBSAN division by zero error of issue 616*/
#define FIX617_UBSAN_DIVBYZERO_STEREOCNG                /* Eri: Issue 617: Decoder UBSAN: division by zero in stereo cng when inut is 16kHz and output is 32kHz */
#define FIX_279_CODE_COVERAGE                           /* Dlb : issue 279 , clean up unused function */
#define FIX_549_PARAM_ISM_BIN_GAIN                      /* FhG: Issue 549 : fix too quiet binaural output in ParamISM */

/* OMASA */
#define MASA_AND_OBJECTS                                /* Nokia: Combination of MASA and objects */
#ifdef MASA_AND_OBJECTS
#define MASAISM_EDIT_OBJECTS                            /* Nokia: Temporary command line editing of object directions in the decoder */
#define FIX_356_ISM_METADATA_SYNC_OMASA // temp. fix
#define OMASA_BRSW_MONO_FIX                             /* Nokia: fix renderer config under rateswitching and MONO output */
#endif


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

/* #################### Start NON-BE CR switches ########################## */
+17 −0
Original line number Diff line number Diff line
@@ -737,9 +737,15 @@ static void shb_CNG_decod(
        ener = hTdCngDec->shb_cng_ener;
    }


    gain = (float) sqrt( pow( 10, 0.1f * ener ) * L_FRAME16k / ener_excSHB );

    st->hTdCngDec->shb_cng_gain = ener;
#ifdef FIX617_UBSAN_DIVBYZERO_STEREOCNG
#ifdef DEBUGGING
    /* note: state shb_cng_gain is actually an energy value in dB */
#endif
#endif

    for ( i = 0; i < L_FRAME16k; i++ )
    {
@@ -783,6 +789,15 @@ void td_cng_dec_init(
    mvr2r( st->lsp_old, st->lspCNG, M );
    hTdCngDec->last_allow_cn_step = 0;
    hTdCngDec->shb_cng_ener = -6.02f;
#ifdef FIX617_UBSAN_DIVBYZERO_STEREOCNG
    if ( st->element_mode != EVS_MONO )
    {
        set_f( hTdCngDec->shb_lpcCNG, 0.0f, LPC_SHB_ORDER + 1 );
        hTdCngDec->shb_lpcCNG[0] = 1.0f;
        hTdCngDec->shb_cng_gain = -82.0; /* a  dB value approximately corresponding to  shb  index 0(used as index -15)   */
    }
#endif

    hTdCngDec->wb_cng_ener = -6.02f;
    hTdCngDec->last_wb_cng_ener = -6.02f;
    hTdCngDec->last_shb_cng_ener = -6.02f;
@@ -825,8 +840,10 @@ void td_cng_dec_init(
    hTdCngDec->shb_dtx_count = 0;
    hTdCngDec->trans_cnt = 0;
    hTdCngDec->burst_cnt = 0;

    hTdCngDec->last_shb_ener = 0.001f;


    set_f( hTdCngDec->interpol_3_2_cng_dec, 0.0f, INTERP_3_2_MEM_LEN );

    return;
Loading