Commit 90e32cf7 authored by fotopoulou's avatar fotopoulou
Browse files

Merge branch 'main' into add-plc-conditions-for-OSBA-in-self-test

parents 76a5b3f0 41336cb0
Loading
Loading
Loading
Loading
Loading
+13 −11
Original line number Diff line number Diff line
@@ -909,6 +909,7 @@ clang-format-check:
      - run: git apply $PATCH_FILE_NAME\n
      - commit new changes"

    - format_problems=0
    - scripts/check-format.sh -af -p 8 || format_problems=$?
    - if [ $format_problems == 0 ] ; then exit 0; fi

@@ -926,7 +927,7 @@ clang-format-check:
    expire_in: 1 day
    paths:
      - tmp-formatting-fix/
    when: always
    when: on_failure
    name: "$ARTIFACT_BASE_NAME"
    expose_as: "formatting patch"

@@ -948,18 +949,19 @@ check-first-frame-is-sid:
    - cmake .
    - make -j

    # TODO: for some MASA modes, we currently do not have testvectors that actually trigger DTX
    # SBA modes are run separately to use shorter part of file
    - exit_code_no_sba=0
    - exit_code_sba=0
    - modes=$(scripts/runIvasCodec.py -l | grep dtx | grep -v MASA | grep -vE "FOA|HOA" )
    - scripts/runIvasCodec.py -z console -p scripts/config/ci_linux_sidstart_test.json -m $modes -s --bs_length 200 -U 0:20 || exit_code_no_sba=$?
    - exit_code_hoa=0
    - exit_code_foa=0

    # run all modes and cut bitstream to start with an SID. Use stereo output to limit runtime, test is only about decoding
    - modes=$(scripts/runIvasCodec.py -l | grep dtx | grep -vE "FOA|HOA" )
    - scripts/runIvasCodec.py -z console -p scripts/config/ci_linux_sidstart_test.json -m $modes -s --bs_length 200 -U 0:20 --oc stereo || exit_code_no_sba=$?
    - modes=$(scripts/runIvasCodec.py -l | grep dtx | grep -E "HOA")
    - scripts/runIvasCodec.py -z console -p scripts/config/ci_linux_sidstart_test.json -m $modes -s --bs_length 100 -U 70:80 || exit_code_sba=$?
    # need to do FOA separately as VAD apparently behaves differently there
    - scripts/runIvasCodec.py -z console -p scripts/config/ci_linux_sidstart_test.json -m $modes -s --bs_length 100 -U 70:80 --oc stereo || exit_code_hoa=$?
    - modes=$(scripts/runIvasCodec.py -l | grep dtx | grep "FOA")
    - scripts/runIvasCodec.py -z console -p scripts/config/ci_linux_sidstart_test.json -m $modes -s --bs_length 100 -U 75:110 || exit_code_sba=$?
    - if [ $exit_code_no_sba -ne 0 ] || [ $exit_code_sba -ne 0 ]; then exit 1; fi
    - scripts/runIvasCodec.py -z console -p scripts/config/ci_linux_sidstart_test.json -m $modes -s --bs_length 100 -U 75:110 --oc stereo || exit_code_foa=$?

    - if [ $exit_code_no_sba -ne 0 ] || [ $exit_code_hoa -ne 0 ] || [ $exit_code_hoa -ne 0 ]; then exit 1; fi
  artifacts:
    paths:
      - out/logs
@@ -1332,7 +1334,7 @@ sanitizer-test-masa:
    - if: $SANITIZER_SCHEDULE_A
      when: delayed
      start_in: 21 hours
  timeout: 3 hours
  timeout: 5 hours
  script:
    - *update-ltv-repo
    - python3 ci/run_scheduled_sanitizer_test.py MASA $OUT_FORMATS_CHANNEL_BASED $OUT_FORMATS_SCENE_BASED $OUT_FORMATS_BINAURAL EXT --tests $SANITIZER_TESTS
+28 −58
Original line number Diff line number Diff line
@@ -145,10 +145,9 @@ typedef struct
#endif
#endif
    uint16_t acousticEnvironmentId;
#ifdef FIX_708_DPID_COMMAND_LINE
    int16_t Opt_dpid_on;
#endif
    uint16_t directivityPatternId[IVAS_MAX_NUM_OBJECTS];

} DecArguments;


@@ -197,7 +196,11 @@ int main(
    RotFileReader *refRotReader = NULL;
    Vector3PairFileReader *referenceVectorReader = NULL;
    ivas_error error = IVAS_ERR_UNKNOWN;
#ifdef FIX_847_OUTPUT_PCM_BUFFER
    int16_t *pcmBuf = NULL;
#else
    int16_t pcmBuf[MAX_OUTPUT_PCM_BUFFER_SIZE];
#endif
#ifdef SPLIT_REND_WITH_HEAD_ROT
    uint8_t splitRendBitsBuf[IVAS_MAX_SPLIT_REND_BITS_BUFFER_SIZE_IN_BYTES];
#endif
@@ -434,15 +437,8 @@ int main(
     * Configure the decoder
     *------------------------------------------------------------------------------------------*/

    if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputConfig, arg.tsmEnabled, arg.enable5ms,
                                       arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.enableExternalOrientation, arg.orientation_tracking, arg.renderConfigEnabled, arg.Opt_non_diegetic_pan, arg.non_diegetic_pan_gain,
#ifdef FIX_708_DPID_COMMAND_LINE
                                       arg.Opt_dpid_on,
#endif
#ifdef FIX_708_AEID_COMMAND_LINE
                                       arg.acousticEnvironmentId,
#endif
                                       arg.delayCompensationEnabled ) ) != IVAS_ERR_OK )
    if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputConfig, arg.tsmEnabled, arg.enable5ms, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.enableExternalOrientation,
                                       arg.orientation_tracking, arg.renderConfigEnabled, arg.Opt_non_diegetic_pan, arg.non_diegetic_pan_gain, arg.Opt_dpid_on, arg.acousticEnvironmentId, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK )
    {
        fprintf( stderr, "\nConfigure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
        goto cleanup;
@@ -640,11 +636,7 @@ int main(

        if ( ( error = RenderConfigReader_getDirectivity( renderConfigReader, arg.directivityPatternId, renderConfig.directivity ) ) != IVAS_ERR_OK )
        {
#ifdef FIX_730_DPID_NOT_SET_CORRECTLY
            fprintf( stderr, "Failed to get directivity patterns for one or more of IDs: %d %d %d %d\n\n", arg.directivityPatternId[0], arg.directivityPatternId[1], arg.directivityPatternId[2], arg.directivityPatternId[3] );
#else
            fprintf( stderr, "Failed to get directivity for objects: %d %d %d %d\n\n", arg.directivityPatternId[0], arg.directivityPatternId[1], arg.directivityPatternId[2], arg.directivityPatternId[3] );
#endif
            goto cleanup;
        }

@@ -658,11 +650,7 @@ int main(
                    goto cleanup;
                }
            }
#ifdef FIX_708_AEID_COMMAND_LINE
            else
#else
            else if ( error != IVAS_ERR_ACOUSTIC_ENVIRONMENT_MISSING )
#endif
            {
                fprintf( stderr, "Failed to get acoustic environment with ID: %d\n\n", arg.acousticEnvironmentId );
                goto cleanup;
@@ -759,6 +747,21 @@ int main(
        }
    }

#ifdef FIX_847_OUTPUT_PCM_BUFFER
    /*------------------------------------------------------------------------------------------*
     * Allocate output data buffer
     *------------------------------------------------------------------------------------------*/

    int16_t pcmBufSize;
    if ( ( error = IVAS_DEC_GetOutputBufferSize( hIvasDec, &pcmBufSize ) ) != IVAS_ERR_OK )
    {
        fprintf( stderr, "\nGetOutputBufferSize failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
        goto cleanup;
    }

    pcmBuf = malloc( pcmBufSize * sizeof( int16_t ) );

#endif

    /*-----------------------------------------------------------------*
     * Decoding
@@ -813,10 +816,14 @@ int main(

cleanup:

#ifdef FIX_847_OUTPUT_PCM_BUFFER
    free( pcmBuf );
#endif

#ifdef DEBUG_SBA_AUDIO_DUMP
    IVAS_DEC_GetSbaDebugParams( hIvasDec, &numOutChannels, &numTransportChannels, &pca_ingest_channels );
#endif

#endif
    if ( arg.hrtfReaderEnabled )
    {
        IVAS_DEC_HRTF_HANDLE hHrtfTD = NULL;
@@ -1008,9 +1015,7 @@ static bool parseCmdlIVAS_dec(

    arg->renderConfigEnabled = false;
    arg->renderConfigFilename = NULL;
#ifdef FIX_708_DPID_COMMAND_LINE
    arg->Opt_dpid_on = 0;
#endif

#ifdef SPLIT_REND_WITH_HEAD_ROT
    arg->outputMdFilename = NULL;
@@ -1034,18 +1039,10 @@ static bool parseCmdlIVAS_dec(
    arg->noBadFrameDelay = false;
#endif
#endif
#ifdef FIX_708_AEID_COMMAND_LINE
    arg->acousticEnvironmentId = 65535;
#else
    arg->acousticEnvironmentId = 0;
#endif
    for ( i = 0; i < IVAS_MAX_NUM_OBJECTS; ++i )
    {
#ifdef FIX_730_DPID_NOT_SET_CORRECTLY
        arg->directivityPatternId[i] = 65535;
#else
        arg->directivityPatternId[i] = 0;
#endif
    }

    /*-----------------------------------------------------------------*
@@ -1417,7 +1414,6 @@ static bool parseCmdlIVAS_dec(
        else if ( strcmp( argv_to_upper, "-AEID" ) == 0 )
        {
            ++i;
#ifdef FIX_708_AEID_COMMAND_LINE
            if ( argc - i <= 4 )
            {
                fprintf( stderr, "Error: Acoustic environment ID not specified!\n\n" );
@@ -1431,22 +1427,17 @@ static bool parseCmdlIVAS_dec(
                usage_dec();
                return false;
            }
#endif
            arg->acousticEnvironmentId = (int16_t) atoi( argv[i++] );
        }
        else if ( strcmp( argv_to_upper, "-DPID" ) == 0 )
        {
#ifdef FIX_708_DPID_COMMAND_LINE
            int16_t id;
            int16_t id, tmp;

            arg->Opt_dpid_on = 1;
#endif
            ++i;
            int16_t tmp;
            tmp = 0;
            while ( is_number( argv[i + tmp] ) && tmp < IVAS_MAX_NUM_OBJECTS )
            {
#ifdef FIX_708_DPID_COMMAND_LINE
                id = (int16_t) atoi( argv[i + tmp] );

                if ( !is_digits_only( argv[i + tmp] ) || id < 0 )
@@ -1457,13 +1448,9 @@ static bool parseCmdlIVAS_dec(
                }

                arg->directivityPatternId[tmp] = id;
#else
                arg->directivityPatternId[tmp] = (int16_t) atoi( argv[i + tmp] );
#endif
                ++tmp;
            }

#ifdef FIX_708_DPID_COMMAND_LINE
            if ( tmp == 0 )
            {
                if ( argc - i <= 4 || argv[i][0] == '-' )
@@ -1480,7 +1467,6 @@ static bool parseCmdlIVAS_dec(
                    return false;
                }
            }
#endif

            i += tmp;
        }
@@ -1576,12 +1562,7 @@ static bool parseCmdlIVAS_dec(
        return false;
    }

#ifdef FIX_807_VARIABLE_SPEED_DECODING
    if ( ( !arg->enableHeadRotation ) && ( !arg->enableExternalOrientation ) && ( !arg->tsmEnabled ) )
#else
    if ( ( !arg->enableHeadRotation ) && ( !arg->enableExternalOrientation ) )
#endif

    {
        arg->enable5ms = false;
    }
@@ -1675,15 +1656,11 @@ static void usage_dec( void )
    fprintf( stdout, "-force R            : Force specific binaural rendering mode, R = (TDREND, CLDFBREND),\n" );
#endif
    fprintf( stdout, "-exof File          : External orientation File for external orientation trajectory\n" );
#ifdef FIX_708_DPID_COMMAND_LINE
    fprintf( stdout, "-dpid ID            : Directivity pattern ID(s) = [ID1, ID2, ID3, ID4]. Space-separated list of up\n" );
    fprintf( stdout, "                      to 4 numbers (unsigned integers) can be specified for BINAURAL and BINAURAL_ROOM_REVERB\n" );
    fprintf( stdout, "                      output configuration. ID1, ID2, ID3, ID4 specify the directivity pattern IDs used for\n" );
    fprintf( stdout, "                      ISMs 1,2,3 and 4 respectively. This options needs to be accompanied by a render_config file,\n" );
    fprintf( stdout, "                      otherwise a default directivity pattern is used.\n" );
#else
    fprintf( stdout, "-dpid ID            : Directivity pattern ID(s) (space-separated list of up to 4 numbers can be specified) for binaural output configuration\n" );
#endif
    fprintf( stdout, "-aeid ID            : Acoustic environment ID (number >= 0) for BINAURAL_ROOM_REVERB output configuration\n" );
    fprintf( stdout, "-level level        : Complexity level, level = (1, 2, 3), will be defined after characterisation. \n" );
    fprintf( stdout, "                      Currently, all values default to level 3 (full functionality).\n" );
@@ -2481,18 +2458,11 @@ static ivas_error decodeG192(
        {
            // update_mem(); TODO: verify this
            update_wmops();
#ifdef FIX_RAM_COUNTING_5MS_RENDERING
            update_mem();
#ifdef MEM_COUNT_DETAILS
            export_mem( "mem_analysis.csv" );
#endif
#endif
        }
#ifndef FIX_RAM_COUNTING_5MS_RENDERING
#ifdef MEM_COUNT_DETAILS
        export_mem( "mem_analysis.csv" );
#endif
#endif
#endif
    }

+8 −22
Original line number Diff line number Diff line
@@ -100,7 +100,7 @@ typedef struct
    uint16_t numObjects;
    IsmFileReader *ismReaders[RENDERER_MAX_ISM_INPUTS];
    uint32_t numPositions[RENDERER_MAX_ISM_INPUTS];
    IVAS_REND_AudioObjectPosition *positions[RENDERER_MAX_ISM_INPUTS]; /* size: [RENDERER_MAX_ISM_INPUTS][numPositions[object_index]] */
    IVAS_ISM_METADATA *positions[RENDERER_MAX_ISM_INPUTS]; /* size: [RENDERER_MAX_ISM_INPUTS][numPositions[object_index]] */
    uint16_t *positionDurations[RENDERER_MAX_ISM_INPUTS];  /* size: [RENDERER_MAX_ISM_INPUTS][numPositions[object_index]] */
    uint32_t currentPositionIdxs[RENDERER_MAX_ISM_INPUTS]; /* Index of current position as listed in the metadata file */
    uint16_t durationCounters[RENDERER_MAX_ISM_INPUTS];    /* Number of frames spent at current position */
@@ -123,7 +123,7 @@ typedef struct

typedef struct
{
    IVAS_REND_AudioObjectPosition positions[RENDERER_MAX_ISM_INPUTS];
    IVAS_ISM_METADATA positions[RENDERER_MAX_ISM_INPUTS];
    int16_t numObjects;
} ObjectPositionBuffer;

@@ -384,11 +384,7 @@ static const CmdLnParser_Option cliOptions[] = {
        .id = CmdLnOptionId_directivityPatternId,
        .match = "ism_directivity_pattern_id",
        .matchShort = "dpid",
#ifdef FIX_708_DPID_COMMAND_LINE
        .description = "Directivity pattern ID(s) = [ID1, ID2, ID3, ID4]. Space-separated list of up to 4 numbers (unsigned integers) can be specified for BINAURAL and BINAURAL_ROOM_REVERB output configuration.\nID1, ID2, ID3, ID4 specify the directivity pattern IDs used for ISMs 1,2,3 and 4 respectively.\nThis options needs to be accompanied by a render_config file, otherwise a default directivity pattern is used.",
#else
        .description = "Directivity pattern ID(s) (space-separated list of up to 4 numbers can be specified) for binaural output configuration",
#endif
    },
    {
        .id = CmdLnOptionId_acousticEnvironmentId,
@@ -437,7 +433,7 @@ static int8_t parseUint32( const char *line, uint32_t *ret );

static int8_t parseInt32( const char *line, int32_t *ret );

static void parseObjectPosition( char *line, IVAS_REND_AudioObjectPosition *position, uint16_t *positionDuration );
static void parseObjectPosition( char *line, IVAS_ISM_METADATA *position, uint16_t *positionDuration );

static void parseMetadata( char *metadataString, char *inDir, InputConfig *inConfig, IsmPositionProvider *positionProvider, MasaFileReader **masaReaders, LfeRoutingConfig **lfeRoutingConfigs );

@@ -2640,18 +2636,10 @@ static CmdlnArgs defaultArgs(

    for ( int32_t i = 0; i < RENDERER_MAX_ISM_INPUTS; ++i )
    {
#ifdef FIX_730_DPID_NOT_SET_CORRECTLY
        args.directivityPatternId[i] = 65535;
#else
        args.directivityPatternId[i] = 0;
#endif
    }

#ifdef FIX_708_AEID_COMMAND_LINE
    args.acousticEnvironmentId = 65535;
#else
    args.acousticEnvironmentId = 0;
#endif

    return args;
}
@@ -2819,13 +2807,11 @@ static void parseOption(
            break;
        case CmdLnOptionId_acousticEnvironmentId:
            assert( numOptionValues == 1 );
#ifdef FIX_708_AEID_COMMAND_LINE
            if ( !is_digits_only( optionValues[0] ) )
            {
                fprintf( stderr, "Invalid acousting environment ID specified: %s\n", optionValues[0] );
                exit( -1 );
            }
#endif
            args->acousticEnvironmentId = (int16_t) strtol( optionValues[0], NULL, 10 );
            break;
        case CmdLnOptionId_syncMdDelay:
@@ -3297,7 +3283,7 @@ static void parseOptionalInputValues(

static void parseObjectPosition(
    char *line,
    IVAS_REND_AudioObjectPosition *position,
    IVAS_ISM_METADATA *position,
    uint16_t *positionDuration )
{
    char *endptr;
@@ -3346,7 +3332,7 @@ static void parseIsm(
    if ( parseUint32( line, &numberOfObjectPositionsToRead ) == 0 )
    {
        positionProvider->numPositions[idx] = numberOfObjectPositionsToRead;
        positionProvider->positions[idx] = malloc( numberOfObjectPositionsToRead * sizeof( IVAS_REND_AudioObjectPosition ) );
        positionProvider->positions[idx] = malloc( numberOfObjectPositionsToRead * sizeof( IVAS_ISM_METADATA ) );
        positionProvider->positionDurations[idx] = malloc( numberOfObjectPositionsToRead * sizeof( uint16_t ) );

        for ( i = 0; i < numberOfObjectPositionsToRead; ++i )
+1 −1
Original line number Diff line number Diff line
@@ -60,7 +60,7 @@ if [ $BUILD -eq 1 ];then
fi

# Configuration
modes=('SBA_b128_wb_cbr' 'MC_7_1_b96_fb_cbr' 'ISM2_b48_fb_cbr')
modes=('HOA3_b128_wb_cbr' 'MC_7_1_b96_fb_cbr' 'ISM2_b48_fb_cbr')
output_formats=('STEREO' 'FOA' '7_1' 'HOA3')
limit_input_to_x_seconds=30
verbosity_cmd="-z console"
+0 −4
Original line number Diff line number Diff line
@@ -476,10 +476,8 @@ static ivas_error acelp_FCB_allocator(
        }

        /* try to increase the FCB of the first subframe in cases when the next step is lower than the current step */
#ifdef NONBE_FIX_694_OMASA_ACELP
        if ( fixed_cdk_index[sfr] < ACELP_FIXED_CDK_NB - 1 )
        {
#endif
            step = fcb_table( fixed_cdk_index[sfr] + 1, L_subfr ) - fcb_table( fixed_cdk_index[sfr], L_subfr );
            if ( *nBits >= step && cdbk >= 0 )
            {
@@ -493,9 +491,7 @@ static ivas_error acelp_FCB_allocator(
                    *nBits -= step;
                }
            }
#ifdef NONBE_FIX_694_OMASA_ACELP
        }
#endif
    }
    /* TRANSITION coding: allocate highest FCBQ bit-budget to the subframe with the glottal-shape codebook */
    if ( tc_subfr >= L_SUBFR )
Loading