Commit 794dd47a authored by bayers's avatar bayers
Browse files

fix #833, ensure the discrete object gains are computed correctly in OSBA JBM decoding

parent 87c1c752
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -221,7 +221,7 @@
#define NONBE_FIX_806_OMASA_ONE_SEP_TRANSPORT_MIX             /* Nokia: issue 806: fix one separated object mode transport mix of the separated object */
#define NONBE_FIX_809_EXTERNAL_TARGET_INTERPOLATION           /* FhG: issue 809: unify external target interpolation inter and intra frame behaviour */
#define NONBE_FIX_775_OSBA_BR_SWITCHING_CRASH                 /* FhG: issue 775: fix crash in OSBA with bitrate switching and output order lower than input order */

#define NONBE_FIX_833_OSBA_JBM_OBJECT_GAINS                   /* Fhg: issue #833: Resolve "JBM OSBA: the gains for the discrete objects are not computed" */
#define JBM_FOR_OSBA                                          /* FhG: implement OSBA format in the JBM path */

#ifdef JBM_FOR_OSBA
+20 −3
Original line number Diff line number Diff line
@@ -2594,6 +2594,11 @@ void ivas_ism_dec_digest_tc(
         st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC ||
         st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV ||
         st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ||
#ifdef NONBE_FIX_833_OSBA_JBM_OBJECT_GAINS
         st_ivas->renderer_type == RENDERER_OSBA_AMBI ||
         st_ivas->renderer_type == RENDERER_OSBA_LS ||
         st_ivas->renderer_type == RENDERER_OSBA_STEREO ||
#endif
         ( st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM && st_ivas->hDecoderConfig->Opt_Headrotation == 0 ) )
    {
        int16_t i, num_objects;
@@ -2604,7 +2609,11 @@ void ivas_ism_dec_digest_tc(
        if ( ( st_ivas->hDecoderConfig->output_Fs / FRAMES_PER_SEC ) == st_ivas->hTcBuffer->n_samples_available )
        {
            int16_t interpolator_length = (int16_t) ( st_ivas->hDecoderConfig->output_Fs / FRAMES_PER_SEC );
            if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV )
            if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC ||
#ifdef NONBE_FIX_833_OSBA_JBM_OBJECT_GAINS
                 st_ivas->renderer_type == RENDERER_OSBA_AMBI ||
#endif
                 st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV )
            {
                st_ivas->hIsmRendererData->interpolator[0] = 0.0f;
                for ( i = 1; i < interpolator_length; i++ )
@@ -2641,7 +2650,11 @@ void ivas_ism_dec_digest_tc(
                azimuth = (int16_t) floorf( st_ivas->hIsmMetaData[i]->azimuth + 0.5f );
                elevation = (int16_t) floorf( st_ivas->hIsmMetaData[i]->elevation + 0.5f );

                if ( ( st_ivas->renderer_type == RENDERER_TD_PANNING || st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM ) &&
                if ( ( st_ivas->renderer_type == RENDERER_TD_PANNING ||
#ifdef NONBE_FIX_833_OSBA_JBM_OBJECT_GAINS
                       st_ivas->renderer_type == RENDERER_OSBA_LS ||
#endif
                       st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM ) &&
                     st_ivas->hCombinedOrientationData == NULL )
                {
                    if ( st_ivas->hIntSetup.is_planar_setup )
@@ -2655,7 +2668,11 @@ void ivas_ism_dec_digest_tc(
                        efap_determine_gains( st_ivas->hEFAPdata, st_ivas->hIsmRendererData->gains[i], azimuth, elevation, EFAP_MODE_EFAP );
                    }
                }
                else if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV )
                else if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC ||
#ifdef NONBE_FIX_833_OSBA_JBM_OBJECT_GAINS
                          st_ivas->renderer_type == RENDERER_OSBA_AMBI ||
#endif
                          st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV )
                {
                    /*get HOA gets for direction (ACN/SN3D)*/
                    ivas_dirac_dec_get_response( azimuth, elevation, st_ivas->hIsmRendererData->gains[i], st_ivas->hIntSetup.ambisonics_order );