Commit 6b0dcb4b authored by TYAGIRIS's avatar TYAGIRIS
Browse files

isar clean up

parent 335ef7b7
Loading
Loading
Loading
Loading
+0 −71
Original line number Diff line number Diff line
@@ -119,16 +119,12 @@ typedef struct
    OutputConfig outConfig;
    char inMetadataFilePaths[RENDERER_MAX_ISM_INPUTS][POST_REND_MAX_CLI_ARG_LENGTH];
    int16_t numInMetadataFiles;
    char outMetadataFilePath[POST_REND_MAX_CLI_ARG_LENGTH];
    char headRotationFilePath[POST_REND_MAX_CLI_ARG_LENGTH];
    char splitRendBFIFilePath[POST_REND_MAX_CLI_ARG_LENGTH];
    char renderConfigFilePath[POST_REND_MAX_CLI_ARG_LENGTH];
    ISAR_POST_REND_COMPLEXITY_LEVEL complexityLevel;
    bool delayCompensationEnabled;
    bool quietModeEnabled;
    bool sceneDescriptionInput;
    int16_t nonDiegeticPan;
    float nonDiegeticPanGain;
    IVAS_RENDER_FRAMESIZE render_framesize;
} CmdlnArgs;

@@ -139,7 +135,6 @@ typedef enum
    CmdLnOptionId_outputFile,
    CmdLnOptionId_sampleRate,
    CmdLnOptionId_trajFile,
    CmdLnOptionId_renderConfigFile,
    CmdLnOptionId_orientationTracking,
    CmdLnOptionId_complexityLevel,
    CmdLnOptionId_noDelayCmp,
@@ -148,7 +143,6 @@ typedef enum
    CmdLnOptionId_listFormats,
    CmdLnOptionId_SplitRendBFIFile,
    CmdLnOptionId_framing,
    CmdLnOptionId_nonDiegeticPan,
} CmdLnOptionId;

static const CmdLnParser_Option cliOptions[] = {
@@ -224,12 +218,6 @@ static const CmdLnParser_Option cliOptions[] = {
        .matchShort = "fr",
        .description = "Set Render audio framing.",
    },
    {
        .id = CmdLnOptionId_nonDiegeticPan,
        .match = "non_diegetic_panning",
        .matchShort = "non_diegetic_pan",
        .description = "Panning mono non diegetic sound to stereo -90<= pan <= 90\nleft or l or 90->left, right or r or -90->right, center or c or 0 ->middle\n",
    },
};


@@ -355,36 +343,6 @@ static bool parseInConfig(
    return true;
}

static bool parseDiegeticPan(
    char *value,
    float *nonDiegeticPan )
{
    to_upper( value );

    if ( ( strcmp( value, "CENTER" ) == 0 ) || ( strchr( value, 'C' ) != NULL ) )
    {
        *nonDiegeticPan = 0.f;
    }
    else if ( ( strcmp( value, "LEFT" ) == 0 ) || ( strchr( value, 'L' ) != NULL ) )
    {
        *nonDiegeticPan = 1.f;
    }
    else if ( ( strcmp( value, "RIGHT" ) == 0 ) || ( strchr( value, 'R' ) != NULL ) )
    {
        *nonDiegeticPan = -1.f;
    }
    else
    {
        *nonDiegeticPan = (float) atof( value ) / 90.f;

        if ( *nonDiegeticPan > 1.0f || *nonDiegeticPan < -1.0f )
        {
            fprintf( stderr, "Error: Incorrect value for panning option argument specified!\n\n" );
            return false;
        }
    }
    return true;
}

static bool parseRenderFramesize(
    char *value,
@@ -505,12 +463,7 @@ static CmdlnArgs defaultArgs(
    args.numInMetadataFiles = 0;

    clearString( args.headRotationFilePath );
    clearString( args.outMetadataFilePath );
    clearString( args.splitRendBFIFilePath );
    clearString( args.renderConfigFilePath );

    args.nonDiegeticPan = 0;
    args.nonDiegeticPanGain = 0.f;

    args.delayCompensationEnabled = true;
    args.quietModeEnabled = false;
@@ -575,10 +528,6 @@ static void parseOption(
            assert( numOptionValues == 1 );
            strncpy( args->splitRendBFIFilePath, optionValues[0], POST_REND_MAX_CLI_ARG_LENGTH - 1 );
            break;
        case CmdLnOptionId_renderConfigFile:
            assert( numOptionValues == 1 );
            strncpy( args->renderConfigFilePath, optionValues[0], POST_REND_MAX_CLI_ARG_LENGTH - 1 );
            break;
        case CmdLnOptionId_complexityLevel:
            assert( numOptionValues == 1 );
            args->complexityLevel = (int32_t) ( strtol( optionValues[0], NULL, 10 ) );
@@ -608,15 +557,6 @@ static void parseOption(
                exit( -1 );
            }

            break;
        case CmdLnOptionId_nonDiegeticPan:
            assert( numOptionValues == 1 );
            if ( !parseDiegeticPan( optionValues[0], &args->nonDiegeticPanGain ) )
            {
                fprintf( stderr, "Unknown option for diegetic panning: %s\n", optionValues[0] );
                exit( -1 );
            }
            args->nonDiegeticPan = 1;
            break;
        default:
            assert( 0 && "This should be unreachable - all command line options should be explicitly handled." );
@@ -854,7 +794,6 @@ int main(
    IVAS_CLDFB_FILTER_BANK_HANDLE cldfbSyn[IVAS_MAX_INPUT_CHANNELS];
    int16_t cldfb_in_flag, CLDFBframeSize_smpls;
    SplitRendBFIFileReader *splitRendBFIReader = NULL;
    RenderConfigReader *renderConfigReader = NULL;
    AudioFileReader *audioReader = NULL;
    AudioFileWriter *audioWriter;
    int32_t inBufferSize;
@@ -918,15 +857,6 @@ int main(
        SplitRendBFIFileReader_open( args.splitRendBFIFilePath, &splitRendBFIReader );
    }

    if ( !isEmptyString( args.renderConfigFilePath ) )
    {
        if ( RenderConfigReader_open( args.renderConfigFilePath, &renderConfigReader ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "Error opening file: %s\n", args.renderConfigFilePath );
            exit( -1 );
        }
    }

    strncpy( audioFilePath, args.inputFilePath, FILENAME_MAX - 1 );
    hSplitRendFileReadWrite = NULL;
    if ( ( args.inConfig.numBinBuses > 0 ) && ( args.inConfig.binBuses[0].audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) )
@@ -1386,7 +1316,6 @@ int main(
    RotationFileReader_close( &externalOrientationFileReader );

    ISAR_POST_REND_Close( &hIsarPostRend );
    RenderConfigReader_close( &renderConfigReader );

#ifdef DEBUGGING
    dbgclose();
+0 −4
Original line number Diff line number Diff line
@@ -1085,11 +1085,7 @@ Word32 Sqrt_l(
        return L_deposit_l( 0 );
    }

#if 0 /* original version creates an overflow warning */
    e = s_and(norm_l(L_x), 0xFFFE);  /* get next lower EVEN norm. exp  */
#else
    e = s_and( norm_l( L_x ), 0x7FFE ); /* get next lower EVEN norm. exp  */
#endif
    L_x = L_shl( L_x, e ); /* L_x is normalized to [0.25..1) */
    *exp = e;
    move16(); /* return 2*exponent (or Q1)      */
+1 −7
Original line number Diff line number Diff line
@@ -155,12 +155,6 @@

/*#define FIX_I4_OL_PITCH*/                             /* fix open-loop pitch used for EVS core switching */
#define SPLIT_REND_WITH_HEAD_ROT                        /* Dlb,FhG: Split Rendering contributions 21 and 35 */
#ifdef SPLIT_REND_WITH_HEAD_ROT
#define SPLIT_REBD_FIX_SBA_PRE_ROT
#define LCLD_PLC_IMPROVEMENT
#define LCLD_CLEAN_UPS
#define FIX_766_OMASA_SPLIT_REND                        /* Nokia: issue #766: split-rendering support for OMASA */
#endif

#define FIX_NUM_SUBFRAME_UPDATE

+3 −20
Original line number Diff line number Diff line
@@ -1945,10 +1945,8 @@ void ivas_binRenderer(
    int16_t chIdx, k;
#ifdef SPLIT_REND_WITH_HEAD_ROT
    int16_t pos_idx, num_poses;
#ifdef SPLIT_REBD_FIX_SBA_PRE_ROT
    float RealBuffer_local[MAX_OUTPUT_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX];
    float ImagBuffer_local[MAX_OUTPUT_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX];
#endif
#endif

    push_wmops( "fastconv_binaural_rendering" );
@@ -1970,7 +1968,7 @@ void ivas_binRenderer(
            }
        }
    }
#ifdef SPLIT_REBD_FIX_SBA_PRE_ROT

    for ( chIdx = 0; chIdx < hBinRenderer->hInputSetup->nchan_out_woLFE; chIdx++ )
    {
        for ( k = 0; k < numTimeSlots; k++ )
@@ -1979,7 +1977,6 @@ void ivas_binRenderer(
            mvr2r( ImagBuffer[chIdx][k], ImagBuffer_local[chIdx][k], CLDFB_NO_CHANNELS_MAX );
        }
    }
#endif
#else
    for ( chIdx = 0; chIdx < BINAURAL_CHANNELS; chIdx++ )
    {
@@ -2038,7 +2035,7 @@ void ivas_binRenderer(
                Quaternions_ref = &hCombinedOrientationData->Quaternions[0];
                Quaternions_rel.w = -3.0f; /*euler*/
                Quaternions_abs.w = -3.0f;
#ifdef SPLIT_REBD_FIX_SBA_PRE_ROT

                if ( hCombinedOrientationData->shd_rot_max_order == 0 )
                {
                    /*HOA signal already rotated by DirAC*/
@@ -2051,12 +2048,9 @@ void ivas_binRenderer(
                    /*euler*/
                    Quat2EulerDegree( *Quaternions_ref, &Quaternions_abs.z, &Quaternions_abs.y, &Quaternions_abs.x ); /*order in Quat2Euler seems to be reversed ?*/
                }
#else
                Quat2EulerDegree( *Quaternions_ref, &Quaternions_abs.z, &Quaternions_abs.y, &Quaternions_abs.x ); /*order in Quat2Euler seems to be reversed ?*/
#endif

                for ( pos_idx = 1; pos_idx < pMultiBinPoseData->num_poses; pos_idx++ )
                {
#ifdef SPLIT_REBD_FIX_SBA_PRE_ROT
                    for ( chIdx = 0; chIdx < hBinRenderer->hInputSetup->nchan_out_woLFE; chIdx++ )
                    {
                        for ( k = 0; k < numTimeSlots; k++ )
@@ -2073,17 +2067,6 @@ void ivas_binRenderer(
                    Quaternions_abs.z = Quaternions_abs.z + Quaternions_rel.z;

                    QuatToRotMat( Quaternions_abs, Rmat_local );
#else
                    Quaternions_rel.x = pMultiBinPoseData->relative_head_poses[pos_idx][0] - pMultiBinPoseData->relative_head_poses[pos_idx - 1][0];
                    Quaternions_rel.y = pMultiBinPoseData->relative_head_poses[pos_idx][1] - pMultiBinPoseData->relative_head_poses[pos_idx - 1][1];
                    Quaternions_rel.z = pMultiBinPoseData->relative_head_poses[pos_idx][2] - pMultiBinPoseData->relative_head_poses[pos_idx - 1][2];
                    Quaternions_abs.x = Quaternions_abs.x + Quaternions_rel.x;
                    Quaternions_abs.y = Quaternions_abs.y + Quaternions_rel.y;
                    Quaternions_abs.z = Quaternions_abs.z + Quaternions_rel.z;

                    QuatToRotMat( Quaternions_rel, Rmat_local );
#endif


                    if ( hBinRenderer->hInputSetup->is_loudspeaker_setup )
                    {
+0 −13
Original line number Diff line number Diff line
@@ -98,12 +98,8 @@ static ivas_error ivas_dec_reconfig_split_rend(
#ifndef SPLIT_REND_WITH_HEAD_ROT
    cldfbMode = CLDFB_ANALYSIS;
#else
#ifdef FIX_766_OMASA_SPLIT_REND
    if ( ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV && st_ivas->ivas_format == SBA_ISM_FORMAT ) ||
         ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC && st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode == ISM_MASA_MODE_DISC ) )
#else
    if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV && st_ivas->ivas_format == SBA_ISM_FORMAT )
#endif
    {
        cldfb_in_flag = 0;
    }
@@ -204,14 +200,9 @@ static ivas_error ivas_dec_reconfig_split_rend(
    }

#ifdef SPLIT_REND_WITH_HEAD_ROT
#ifdef FIX_766_OMASA_SPLIT_REND
    if ( ( st_ivas->renderer_type != RENDERER_BINAURAL_OBJECTS_TD ) &&
         ( st_ivas->renderer_type != RENDERER_BINAURAL_FASTCONV || st_ivas->ivas_format != SBA_ISM_FORMAT ) &&
         !( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC && st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode == ISM_MASA_MODE_DISC ) ) /* td-rend not needed? */
#else
    if ( ( st_ivas->renderer_type != RENDERER_BINAURAL_OBJECTS_TD ) &&
         ( st_ivas->renderer_type != RENDERER_BINAURAL_FASTCONV || st_ivas->ivas_format != SBA_ISM_FORMAT ) )
#endif
#else
    if ( st_ivas->renderer_type != RENDERER_BINAURAL_OBJECTS_TD )
#endif
@@ -270,12 +261,8 @@ static ivas_error ivas_dec_init_split_rend(
    }

#ifdef SPLIT_REND_WITH_HEAD_ROT
#ifdef FIX_766_OMASA_SPLIT_REND
    if ( ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV && st_ivas->ivas_format == SBA_ISM_FORMAT ) ||
         ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC && st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode == ISM_MASA_MODE_DISC ) )
#else
    if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV && st_ivas->ivas_format == SBA_ISM_FORMAT )
#endif
    {
        cldfb_in_flag = 0;
    }
Loading