Commit 1715cefd authored by Mohammadreza Naghibzadeh's avatar Mohammadreza Naghibzadeh
Browse files

Merge remote-tracking branch 'origin/main' into 1793-fix-decoder-mc-to-mono-output-scaling

parents a0b60fbc 3fe45f3a
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -178,6 +178,15 @@ void ivas_omasa_render_objects_from_mix_fx(
    Word16 *output_q                                            /* i/o: output Q value                          */
);

#ifdef NONBE_FIX_1305_OMASA_OBJ_EDIT_EXT
void ivas_omasa_gain_masa_tc_fx(
    Word32 *output_fx[],                                       /* i/o: output synthesis signal                  */
    const Word16 gainMasa_fx,                                  /* i  : gain for MASA transport channels         */
    const Word16 nchan_transport_ism,                          /* i  : number of ISM TCs                        */
    const Word16 output_frame                                  /* i  : output frame length per channel          */
);
#endif

ivas_error ivas_omasa_ism_metadata_dec_fx(
    Decoder_Struct *st_ivas,                                    /* i/o: IVAS decoder structure                  */
    const Word32 ism_total_brate,                               /* i  : ISM total bitrate                       */
+2 −0
Original line number Diff line number Diff line
@@ -130,6 +130,8 @@
#define NONBE_FIX_1255_OBJ_EDIT_JBM                     /* VA: issue 1255: restore object editing in JBM */
#define FIX_1372_OSBA_OBJECT_EDITING                    /* VA: issue 1372: Fix OSBA object-editing in BINAURAL_ROOM_IR */
#define FIX_2140_OBJECT_EDITING_SANITIZER_ISSUES        /* Nokia: Issue 2140, fixes three different sanitizer issues persisting in object editing code. */
#define NONBE_FIX_1305_OMASA_OBJ_EDIT_EXT               /* Nokia: issue 1305: Fix OMASA ext output in case of object editing */
#define NONBE_FIX_1172_OBJ_EDIT_JBM                     /* VA: issue 1172: fix OMASA object editing in JBM */

/* #################### End BASOP porting switches ############################ */

+22 −0
Original line number Diff line number Diff line
@@ -4424,6 +4424,16 @@ void ivas_dec_prepare_renderer_fx(
        {
            ivas_jbm_masa_sf_to_slot_map( st_ivas, n_render_timeslots );
        }
#ifdef NONBE_FIX_1305_OMASA_OBJ_EDIT_EXT
        /* MASA transport gaining for edited disc OMASA EXT. For ISMs, only metadata is modified */
        test();
        test();
        test();
        IF( EQ_32( st_ivas->ivas_format, MASA_ISM_FORMAT ) && EQ_32( st_ivas->ism_mode, ISM_MASA_MODE_DISC ) && EQ_32( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) && EQ_16( st_ivas->hMasaIsmData->masa_gain_is_edited, 1 ) )
        {
            ivas_omasa_gain_masa_tc_fx( st_ivas->hTcBuffer->tc_fx, st_ivas->hMasaIsmData->gain_masa_edited_fx, st_ivas->nchan_ism, st_ivas->hTcBuffer->n_samples_available );
        }
#endif
    }
    ELSE IF( EQ_16( st_ivas->ivas_format, STEREO_FORMAT ) )
    {
@@ -4547,6 +4557,18 @@ void ivas_dec_prepare_renderer_fx(
            {
                ivas_jbm_masa_sf_to_slot_map( st_ivas, n_render_timeslots );
            }
#ifdef NONBE_FIX_1305_OMASA_OBJ_EDIT_EXT
            /* MASA transport gaining for edited param_one OMASA EXT. For ISMs, only metadata is modified.  */
            test();
            IF( EQ_32( st_ivas->ism_mode, ISM_MASA_MODE_PARAM_ONE_OBJ ) && EQ_16( st_ivas->hMasaIsmData->masa_gain_is_edited, 1 ) )
            {
                FOR( n = 0; n < CPE_CHANNELS; n++ )
                {
                    v_multc_fx_16( st_ivas->hTcBuffer->tc_fx[n], st_ivas->hMasaIsmData->gain_masa_edited_fx, st_ivas->hTcBuffer->tc_fx[n], st_ivas->hTcBuffer->n_samples_available ); // Q8
                    Scale_sig32( st_ivas->hTcBuffer->tc_fx[n], st_ivas->hTcBuffer->n_samples_available, Q3 );                                                                         // Q8 -> Q11
                }
            }
#endif
        }
        ELSE
        {
+19 −0
Original line number Diff line number Diff line
@@ -214,7 +214,12 @@ ivas_error ivas_td_binaural_renderer_sf_fx(
        IF( EQ_16( subframe_idx, ism_md_subframe_update_jbm ) )
        {
            test();
#ifdef NONBE_FIX_1305_OMASA_OBJ_EDIT_EXT
            test();
            IF( EQ_32( st_ivas->ivas_format, ISM_FORMAT ) || EQ_32( st_ivas->ivas_format, SBA_ISM_FORMAT ) || EQ_32( st_ivas->ivas_format, MASA_ISM_FORMAT ) )
#else
            IF( EQ_16( st_ivas->ivas_format, ISM_FORMAT ) || EQ_16( st_ivas->ivas_format, SBA_ISM_FORMAT ) )
#endif
            {
                ISM_METADATA_FRAME ismMetaData[MAX_NUM_OBJECTS];
                ISM_METADATA_HANDLE hIsmMetaData[MAX_NUM_OBJECTS];
@@ -232,8 +237,22 @@ ivas_error ivas_td_binaural_renderer_sf_fx(
                    move32();
                    ismMetaData[nS].non_diegetic_flag = st_ivas->hIsmMetaData[nS]->non_diegetic_flag;
                    move16();
#ifdef NONBE_FIX_1305_OMASA_OBJ_EDIT_EXT
                    IF( EQ_32( st_ivas->ivas_format, MASA_ISM_FORMAT ) )
                    {
                        /* DISC OMASA ISM gaining with TDREND is done in ivas_dec_prepare_renderer()*/
                        ismMetaData[nS].gain_fx = ONE_IN_Q29;
                        move32();
                    }
                    ELSE
                    {
                        ismMetaData[nS].gain_fx = st_ivas->hIsmMetaData[nS]->edited_gain_fx;
                        move32();
                    }
#else
                    ismMetaData[nS].gain_fx = st_ivas->hIsmMetaData[nS]->edited_gain_fx;
                    move32();
#endif
                    hIsmMetaData[nS] = &ismMetaData[nS];
                }

+26 −0
Original line number Diff line number Diff line
@@ -2158,3 +2158,29 @@ void ivas_omasa_render_objects_from_mix_fx(

    return;
}

#ifdef NONBE_FIX_1305_OMASA_OBJ_EDIT_EXT
/*--------------------------------------------------------------------------*
 * ivas_omasa_gain_masa_tc_fx()
 *
 * in case of external rendering with object editing, MASA transport channels
 * need to be gained
 *--------------------------------------------------------------------------*/

void ivas_omasa_gain_masa_tc_fx(
    Word32 *output_fx[],              /* i/o: output synthesis signal, Q11    */
    const Word16 gainMasa_fx,         /* i  : gain, Q12                       */
    const Word16 nchan_transport_ism, /* i  : number of ISM TCs               */
    const Word16 output_frame         /* i  : output frame length per channel */
)
{
    /* Edited OMASA EXT MASA transport gaining */
    FOR( Word16 ch = 0; ch < 2; ch++ )
    {
        v_multc_fx_16( output_fx[nchan_transport_ism + ch], gainMasa_fx, output_fx[nchan_transport_ism + ch], output_frame ); // Q8
        Scale_sig32( output_fx[nchan_transport_ism + ch], output_frame, Q3 );                                                 // Q8 -> Q11
    }

    return;
}
#endif
Loading