Commit fb14d4c4 authored by emerit's avatar emerit
Browse files

command line non diegetic pan gain between -90 and 90

parent 2985271b
Loading
Loading
Loading
Loading
+3 −21
Original line number Diff line number Diff line
@@ -1033,24 +1033,6 @@ static bool parseCmdlIVAS_dec(
        {
            i++;
#ifdef NON_DIEGETIC_PAN
            if ( argv[i][0] == '-' ) /* negative value or error*/
            {
                if ( strlen( argv[i] ) > 1 )
                {
                    if ( ( argv[i][1] != '0' ) && ( argv[i][1] != '1' ) )
                    {
                        fprintf( stderr, "Error: Argument for panning option not specified!\n\n" );
                        usage_dec();
                        return false;
                    }
                }
                else
                {
                    fprintf( stderr, "Error: Argument for panning option not specified!\n\n" );
                    usage_dec();
                    return false;
                }
            }
            arg->Opt_non_diegetic_pan = 1;
#else
            if ( argc - i <= 4 || ( argv[i][0] == '-' ) )
@@ -1089,7 +1071,7 @@ static bool parseCmdlIVAS_dec(
            else
            {
#ifdef NON_DIEGETIC_PAN
                arg->non_diegetic_pan_gain = (float) atof( argv_to_upper );
                arg->non_diegetic_pan_gain = (float) atof( argv_to_upper ) / 90.f;

                if ( arg->non_diegetic_pan_gain > 1.0f || arg->non_diegetic_pan_gain < -1.0f )
#else
@@ -1259,8 +1241,8 @@ static void usage_dec( void )
    fprintf( stdout, "-rvf File           : Reference vector specified by external trajectory file\n" );
    fprintf( stdout, "                      works only in combination with '-otr ref_vec' and 'ref_vec_lev' modes\n" );
    fprintf( stdout, "-render_config File : Renderer configuration File\n" );
    fprintf( stdout, "-non_diegetic_pan    : panning mono non-diegetic sound to stereo -1<= pan <=1,\n" );
    fprintf( stdout, "                      left or l or 1->left, right or r or -1->right, center or c or  0->middle\n" );
    fprintf( stdout, "-non_diegetic_pan    : panning mono non-diegetic sound to stereo -90<= pan <=90,\n" );
    fprintf( stdout, "                      left or l or 90->left, right or r or -90->right, center or c or  0->middle\n" );
    fprintf( stdout, "-q                  : Quiet mode, no frame counter\n" );
    fprintf( stdout, "                      default is deactivated\n" );
#ifdef DEBUGGING
+3 −3
Original line number Diff line number Diff line
@@ -242,7 +242,7 @@ static const CmdLnParser_Option cliOptions[] = {
        .id = CmdLnOptionId_noDiegeticPan,
        .match = "non_diegetic_pan",
        .matchShort = "ndp",
        .description = "Panning mono non diegetic sound to stereo -1<= pan <= 1\nleft or l or 1->left, right or r or -1->right, center or c or 0 ->middle\n(todo: implementation)",
        .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(todo: implementation)",
    },
    {
        .id = CmdLnOptionId_orientationTracking,
@@ -1376,7 +1376,7 @@ static bool parseDiegeticPan(
    }
    else
    {
        *nonDiegeticPan = (float) atof( value );
        *nonDiegeticPan = (float) atof( value ) / 90.f;

        if ( *nonDiegeticPan > 1.0f || *nonDiegeticPan < -1.0f )
        {
@@ -1670,7 +1670,7 @@ static CmdlnArgs defaultArgs(

    args.orientationTracking = IVAS_ORIENT_TRK_NONE;
#ifdef NON_DIEGETIC_PAN
    args.nonDiegeticPan = 0; /* intialize with a value such as abs(value) > 1 */
    args.nonDiegeticPan = 0;
    args.nonDiegeticPanGain = 0.f;
#else
    args.noDiegeticPan = 0.0f;
+2 −2
Original line number Diff line number Diff line
@@ -346,7 +346,7 @@ void ivas_ism_reset_metadata(
    hIsmMeta->yaw = 0.0f;
    hIsmMeta->pitch = 0.0f;
    hIsmMeta->radius = 1.0f;
#ifdef NON_DIEGETIC_PAN
#ifdef ISM_NON_DIEGETIC_PAN
    hIsmMeta->ism_metadata_flag = 0;
    hIsmMeta->non_diegetic_flag = 0;
#endif
@@ -365,7 +365,7 @@ void ivas_ism_reset_metadata_API(
    ISM_METADATA_HANDLE hIsmMeta /* i/o: ISM metadata handle     */
)
{
#ifndef ivas_ism_reset_metadata
#ifndef ISM_NON_DIEGETIC_PAN
    hIsmMeta->ism_metadata_flag = 0;
#endif
    ivas_ism_reset_metadata( hIsmMeta );