Commit abbdcb8c authored by Andrea Genovese's avatar Andrea Genovese
Browse files

Merge branch 'main' into qualcomm/contribution-43-early-reflections-draft

parents 12183dba f4f6b60f
Loading
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -219,10 +219,12 @@
#define FIX_618_STEREO_SW_DIV_BY_ZERO                   /* VA: fix issue 618 - UBSAN: division-by-zero in stereo bitrate switching */
#define FIX_625_IDX_OOB                                 /* FhG: Fix index out-of-bounds UBSAN error (issue 625) */
#define FIX_613_DIRAC_NULL_PTR_USAN                     /* Nokia: Issue #613: USAN in DirAC decoder setup */
#define FIX_647_SILENT_W_PARAMBIN                       /* Nokia: Issue #647: Fix silent W SH inputs in parametric binauralizer */

#define MASA_AND_OBJECTS                                /* Nokia: Combination of MASA and objects */
#define FIX_653_BUG_IN_SKIP_MATRIX                      /* Dlb: fix for issue #653, bug in the ivas_spar_get_skip_mat function*/
#define FIX_663_PARAM_ISM_EXT                           /* FhG: Issue 663: ParamISM EXT output improvement */
#define FIX_673_OMASA_OBJ_MD_SYNC                       /* Nokia: Fix issue 673 by updating metadata in the third subframe to account for audio delay. */


/* ################## End BE DEVELOPMENT switches ######################### */
+4 −0
Original line number Diff line number Diff line
@@ -110,7 +110,11 @@ ivas_error ivas_td_binaural_renderer(
#ifdef MASA_AND_OBJECTS
    if ( st_ivas->ivas_format == MASA_ISM_FORMAT )
    {
#ifdef FIX_673_OMASA_OBJ_MD_SYNC
        ism_md_subframe_update = 2;
#else
        ism_md_subframe_update = 0; // ToDo (for Mikko-Ville): verify whether it should not be 2
#endif
    }
#endif

+21 −0
Original line number Diff line number Diff line
@@ -55,6 +55,9 @@
#define CLDFB_HALF_BIN_FREQUENCY_OFFSET         0.5f
#define IVAS_TDET_DUCK_MULT_FAC_PARA_BIN        ( 2.0f )
#define IVAS_TDET_DUCK_MULT_FAC_PARA_BIN_LOW_BR ( 3.0f )
#ifdef FIX_647_SILENT_W_PARAMBIN
#define SBA_CARDI_TARGET_ENERGY_GAIN 0.5f
#endif

#ifdef MASA_AND_OBJECTS
#define STEREO_PREPROCESS_IIR_FACTOR ( 0.9f )
@@ -1231,18 +1234,36 @@ static void ivas_dirac_dec_binaural_formulate_input_covariance_matrices(
    if ( ivas_format == SBA_FORMAT && nchan_transport == 2 )
    {
        float tempRe, tempIm;
#ifdef FIX_647_SILENT_W_PARAMBIN
        float subFrameSumEne[CLDFB_NO_CHANNELS_MAX];

        v_multc( subFrameTotalEne, SBA_CARDI_TARGET_ENERGY_GAIN, subFrameTotalEne, nBins );

        set_zero( subFrameSumEne, CLDFB_NO_CHANNELS_MAX );
#else
        set_zero( subFrameTotalEne, CLDFB_NO_CHANNELS_MAX );

#endif
        for ( slot = 0; slot < hSpatParamRendCom->subframe_nbslots[subframe]; slot++ )
        {
            for ( bin = 0; bin < nBins; bin++ )
            {
                tempRe = inRe[0][slot][bin] + inRe[1][slot][bin];
                tempIm = inIm[0][slot][bin] + inIm[1][slot][bin];
#ifdef FIX_647_SILENT_W_PARAMBIN
                subFrameSumEne[bin] += tempRe * tempRe + tempIm * tempIm;
#else
                subFrameTotalEne[bin] += tempRe * tempRe + tempIm * tempIm;
#endif
            }
        }

#ifdef FIX_647_SILENT_W_PARAMBIN
        for ( bin = 0; bin < nBins; bin++ )
        {
            subFrameTotalEne[bin] = max( subFrameTotalEne[bin], subFrameSumEne[bin] );
        }
#endif
    }

    /* Temporal IIR-type smoothing of covariance matrices. Also apply encoding quality based smoothing factor. */
+26 −6
Original line number Diff line number Diff line
@@ -1112,7 +1112,7 @@ static int16_t read_txt_vector(

static int16_t read_vector(
    char *pLine,          /* i  : String to read from                */
    const int32_t length, /* i  : Number of expected vector elements */
    const int16_t length, /* i  : Number of expected vector elements */
    float *pTarget        /* o  : Output vector pointer              */
)
{
@@ -1220,11 +1220,11 @@ static int32_t errorHandler(
            break;
        case ERROR_ITEM_UNKNOWN:
            numErrors++;
            fprintf( stderr, "Unexpected variable %s in renderer configuration file.\n\n", badStr );
            fprintf( stderr, "Unknown variable %s in renderer configuration file.\n\n", badStr );
            break;
        case ERROR_VALUE_INVALID:
            numErrors++;
            fprintf( stderr, "Unexpected value %s in renderer configuration file.\n\n", badStr );
            fprintf( stderr, "Invalid value %s in renderer configuration file.\n\n", badStr );
            break;
        default:
            numErrors++;
@@ -2740,7 +2740,6 @@ ivas_error RenderConfigReader_read(
                    }
                    else if ( strcmp( item, "DOF" ) == 0 )
                    {
#ifdef SPLIT_REND_WITH_HEAD_ROT
                        dofProvided = true;
                        if ( !sscanf( pValue, "%hd", &hRenderConfig->split_rend_config.dof ) )
                        {
@@ -2788,8 +2787,29 @@ ivas_error RenderConfigReader_read(
                            errorHandler( pValue, ERROR_VALUE_INVALID );
                        }
                    }
#endif

                    else if ( strcmp( item, "RENDERER" ) == 0 )
                    {
                        if ( strcmp( pValue, "CREND" ) == 0 )
                        {
                            hRenderConfig->split_rend_config.rendererSelection = IVAS_SPLIT_REND_RENDERER_SELECTION_CREND;
                        }
                        else if ( strcmp( pValue, "FASTCONV" ) == 0 )
                        {
                            hRenderConfig->split_rend_config.rendererSelection = IVAS_SPLIT_REND_RENDERER_SELECTION_FASTCONV;
                        }
                        else if ( strcmp( pValue, "PARAMBIN" ) == 0 )
                        {
                            hRenderConfig->split_rend_config.rendererSelection = IVAS_SPLIT_REND_RENDERER_SELECTION_PARAMBIN;
                        }
                        else if ( strcmp( pValue, "TDREND" ) == 0 )
                        {
                            hRenderConfig->split_rend_config.rendererSelection = IVAS_SPLIT_REND_RENDERER_SELECTION_TDREND;
                        }
                        else
                        {
                            errorHandler( pValue, ERROR_VALUE_INVALID );
                        }
                    }
#ifdef DEBUGGING
                    else
                    {