Commit 3619e8e7 authored by emerit's avatar emerit
Browse files

Merge branch 'orange/no-diegetic-pan-with-radius' of...

Merge branch 'orange/no-diegetic-pan-with-radius' of forge.3gpp.org:ivas-codec-pc/ivas-codec into orange/no-diegetic-pan-with-radius
parents 0f2348ad 963003b2
Loading
Loading
Loading
Loading
+14 −8
Original line number Diff line number Diff line
@@ -165,7 +165,7 @@ typedef enum
    CmdLnOptionId_refRotFile,
    CmdLnOptionId_customHrtfFile,
    CmdLnOptionId_renderConfigFile,
    CmdLnOptionId_noDiegeticPan,
    CmdLnOptionId_nonDiegeticPan,
    CmdLnOptionId_orientationTracking,
    CmdlnOptionId_lfePosition,
    CmdlnOptionId_lfeMatrix,
@@ -239,7 +239,7 @@ static const CmdLnParser_Option cliOptions[] = {
        .description = "Binaural renderer configuration file (only for BINAURAL and BINAURAL_ROOM outputs)",
    },
    {
        .id = CmdLnOptionId_noDiegeticPan,
        .id = CmdLnOptionId_nonDiegeticPan,
        .match = "non_diegetic_pan",
        .matchShort = "ndp",
        .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)",
@@ -557,14 +557,17 @@ int main(
    CmdlnArgs args = parseCmdlnArgs( argc, argv );

#ifdef NON_DIEGETIC_PAN
    if ( ( args.nonDiegeticPan ) && ( args.inConfig.multiChannelBuses[0].audioConfig != IVAS_REND_AUDIO_CONFIG_MONO ) && ( args.inConfig.numAudioObjects != 1 ) )
    if ( args.nonDiegeticPan && !( ( args.inConfig.numAudioObjects == 0 && args.inConfig.multiChannelBuses[0].audioConfig == IVAS_REND_AUDIO_CONFIG_MONO ) ||
                                   ( args.inConfig.numAudioObjects > 0 && args.inConfig.audioObjects[0].audioConfig == IVAS_REND_AUDIO_CONFIG_OBJECT && args.inConfig.numAudioObjects == 1 ) ) )
    {
        fprintf( stderr, "invalid configuration - non-diegetic panning requires mono input" );
        fprintf( stderr, "\ninvalid configuration - non-diegetic panning requires mono or ISM1 input\n" );
        exit( -1 );
    }
    if ( args.nonDiegeticPan )

    if ( args.nonDiegeticPan && args.outConfig.audioConfig != IVAS_REND_AUDIO_CONFIG_STEREO )
    {
        args.outConfig.audioConfig = IVAS_REND_AUDIO_CONFIG_STEREO;
        fprintf( stderr, "\ninvalid configuration - non-diegetic panning requires stereo output\n" );
        exit( -1 );
    }
#endif

@@ -1764,7 +1767,7 @@ static void parseOption(
            assert( numOptionValues == 1 );
            strncpy( args->renderConfigFilePath, optionValues[0], RENDERER_MAX_CLI_ARG_LENGTH - 1 );
            break;
        case CmdLnOptionId_noDiegeticPan:
        case CmdLnOptionId_nonDiegeticPan:
            assert( numOptionValues == 1 );
#ifdef NON_DIEGETIC_PAN
            if ( !parseDiegeticPan( optionValues[0], &args->nonDiegeticPanGain ) )
@@ -1948,6 +1951,9 @@ static void IsmPositionProvider_getNextFrame(
            objectMetadataBuffer->positions[objIdx].radius = 1.0f;
            objectMetadataBuffer->positions[objIdx].yaw = 0.0f;
            objectMetadataBuffer->positions[objIdx].pitch = 0.0f;
#ifdef ISM_NON_DIEGETIC_PAN
            objectMetadataBuffer->positions[objIdx].non_diegetic_flag = 0;
#endif
        }

        /* Wrap azimuth to lie within (-180, 180] range */
+4 −5
Original line number Diff line number Diff line
@@ -2171,8 +2171,7 @@ static ivas_error evs_dec_main(
    DEC_CORE_HANDLE *hCoreCoder;
#ifdef NON_DIEGETIC_PAN
    float output[MAX_OUTPUT_CHANNELS_IN_DIEGETIC_PAN][L_FRAME48k];
    float mixer_left;
    float mixer_rigth;     
    float mixer_left, mixer_rigth;
#else
    float output[L_FRAME48k];
#endif
+2 −1
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@
*******************************************************************************************************/

#include "cmdln_parser.h"
#include "cmdl_tools.h"
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
@@ -120,7 +121,7 @@ static int8_t stringLooksLikeOption(
    const char *str )
{
#ifdef NON_DIEGETIC_PAN
    while ( ( str[0] == '-' ) && ( ( str[1] != '0' ) && ( str[1] != '1' ) ) )
    if ( ( str[0] == '-' ) && is_number( str ) == false )
#else
    if ( str[0] == '-' )
#endif
+2 −2
Original line number Diff line number Diff line
@@ -265,7 +265,7 @@ Options:
-rvf File           : Reference vector specified by external trajectory file
                      works only in combination with '-otr ref_vec' and 'ref_vec_lev' modes
-render_config File : Renderer configuration option File
-non_diegetic_pan   : panning mono non-diegetic sound to stereo -90<= pan <=90,
-non_diegetic_pan P : panning mono non-diegetic sound to stereo -90<= P <=90,
                      left or l or 90->left, right or r or -90->right, center or c or  0->middle
-q                  : Quiet mode, no frame counter
                      default is deactivated
@@ -407,7 +407,7 @@ with the following meaning:
|                                    | if Flag is set to 1, panning gain is specified by azimuth.
|                                    | Value between [-90,90], 90 left, -90 right, 0 center
---------------------------------------------------------------------------------------------------
*Read as float value for convenience, but used as flag internally.
*Read as float value for convenience, but used as an integer flag internally.

The metadata reader accepts 1-8 values specified per line. If a value is not specified, the default
value is assumed.
+2 −2
Original line number Diff line number Diff line
@@ -448,13 +448,13 @@ def test_metadata(test_info, in_fmt, out_fmt):

@pytest.mark.parametrize("out_fmt", ["STEREO"])
@pytest.mark.parametrize("in_fmt", ["MONO"])
@pytest.mark.parametrize("non_diegetic_pan", ["0", "-0.2", "0.5", "1", "-1"])
@pytest.mark.parametrize("non_diegetic_pan", ["0", "-30", "45", "90", "-90"])
def test_non_diegetic_pan_static(test_info, in_fmt, out_fmt, non_diegetic_pan):
    run_renderer(in_fmt, out_fmt, non_diegetic_pan=non_diegetic_pan)


@pytest.mark.parametrize("out_fmt", ["STEREO"])
@pytest.mark.parametrize("in_fmt", ["ISM1"])
@pytest.mark.parametrize("non_diegetic_pan", ["0", "-0.2", "0.5", "1", "-1"])
@pytest.mark.parametrize("non_diegetic_pan", ["0", "-30", "45", "90", "-90"])
def test_non_diegetic_pan_ism_static(test_info, in_fmt, out_fmt, non_diegetic_pan):
    run_renderer(in_fmt, out_fmt, non_diegetic_pan=non_diegetic_pan)
+1 −1

File changed.

Contains only whitespace changes.

Loading