Commit 813a903c authored by vaclav's avatar vaclav
Browse files

- issue 764: output buffers harmonization

- introduce new function for the same code block at four different places; under FIX_764_HARM_CODE
parent 0ede305f
Loading
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -762,6 +762,14 @@ void dtx_read_padding_bits(
    const int16_t num_bits 
);

#ifdef FIX_764_HARM_CODE
void ivas_apply_non_diegetic_panning( 
    float *output_f[],                                          /* i/o: core-coder transport mono channel/stereo output             */
    const float non_diegetic_pan_gain,                          /* i  : non-diegetic panning gain                                   */
    const int16_t output_frame                                  /* i  : output frame length per channel                             */
);
#endif


/*----------------------------------------------------------------------------------*
 * JBM prototypes
+2 −0
Original line number Diff line number Diff line
@@ -158,6 +158,8 @@
#define OSBA_SPLIT_RENDERING
#endif

#define FIX_764_HARM_CODE                               /* A: issue 764: introduce new function for the same code block at four different places */

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


+120 −129

File changed.

Preview size limit exceeded, changes collapsed.

+143 −136

File changed.

Preview size limit exceeded, changes collapsed.

+25 −0
Original line number Diff line number Diff line
@@ -186,3 +186,28 @@ void ivas_mono_stereo_downmix_mcmasa(

    return;
}

#ifdef FIX_764_HARM_CODE
/*-------------------------------------------------------------------------
 * ivas_apply_non_diegetic_panning()
 *
 * Apply non-diegetic panning
 *------------------------------------------------------------------------*/

void ivas_apply_non_diegetic_panning(
    float *output_f[],                 /* i/o: core-coder transport mono channel/stereo output  */
    const float non_diegetic_pan_gain, /* i  : non-diegetic panning gain                        */
    const int16_t output_frame         /* i  : output frame length per channel                  */
)
{
    float pan_left, pan_right;

    pan_left = ( non_diegetic_pan_gain + 1.f ) * 0.5f;
    pan_right = 1.f - pan_left;

    v_multc( output_f[0], pan_right, output_f[1], output_frame );
    v_multc( output_f[0], pan_left, output_f[0], output_frame );

    return;
}
#endif