Commit 11ed5ec0 authored by Jan Brouwer's avatar Jan Brouwer
Browse files

update text_to_binary_payload.py for fixed number of absorption coefficients

parent 51c92cbe
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -2648,8 +2648,6 @@ ivas_error RenderConfigReader_getDirectivity(
    float *directivity                       /* o  : directivity                            */
)
{
    uint16_t n;

    if ( pRenderConfigReader == NULL )
    {
        return IVAS_ERR_UNEXPECTED_NULL_POINTER;
+1 −5
Original line number Diff line number Diff line
@@ -93,7 +93,6 @@ def parse_reverb_text_configuration_and_generate_binary_payload(file):
        assert acousticEnvironmentCount == len(sections['acousticEnvironment'])

    # parse frequency grids
    nr_bands = []
    data = bitarray(
          '1'                                                                       # hasAcEnv (see IVAS acoustic environment payload syntax document)
        + get_count_or_index_code(len(sections['frequencyGrid'])),                  # fgdNrGrids
@@ -101,20 +100,17 @@ def parse_reverb_text_configuration_and_generate_binary_payload(file):
    for _, fg in sections['frequencyGrid'].items():
        method = eval_option(fg['method'])
        if method == 'individualFrequencies':
            nr_bands.append(len(eval_option(fg['frequencies'])))
            data += bitarray(
                  fgdMethod.Individual_Frequencies.value                            # fgdMethod
                + get_count_or_index_code(len(eval_option(fg['frequencies'])))      # fgdNrBands
                + concatenate(get_frequency_code, eval_option(fg['frequencies'])))  # fgdCenterFreq
        elif method == 'startHopAmount':
            nr_bands.append(eval_option(fg['nrBands']))
            data += bitarray(
                  fgdMethod.Start_Hop_Amount.value                                  # fgdMethod
                + get_count_or_index_code(eval_option(fg['nrBands']))               # fgdNrBands
                + get_frequency_code(eval_option(fg['centerFrequency']))            # fgdCenterFreq
                + get_frequency_hop_code(eval_option(fg['hop'])))                   # frequencyHop
        elif method == 'defaultBanding':
            nr_bands.append(get_default_grid_nr_bands(eval_option(fg['defaultGrid'])))
            data += bitarray(
                  fgdMethod.Default_Banding.value                                   # fgdMethod
                + format(eval_option(fg['defaultGrid']), '04b')                     # fgdDefaultGrid
@@ -138,7 +134,7 @@ def parse_reverb_text_configuration_and_generate_binary_payload(file):
            + concatenate(get_dsr_code, eval_option(ae['dsr']))                     # revDSR
            + get_bool_code('earlyReflectionsSize' in ae))                          # hasEarlyReflections
        if 'earlyReflectionsSize' in ae:
            assert len(eval_option(ae['absorptionCoefficients'])) == nr_bands[eval_option(ae['earlyReflectionsfrequencyGridIndex'])] * 6, 'wrong number of absorption coefficients'
            assert len(eval_option(ae['absorptionCoefficients'])) == 6, 'wrong number of absorption coefficients'
            data += bitarray(
                  concatenate(lambda d : get_distance_code(d, True), eval_option(ae['earlyReflectionsSize']))  # erSize
                + get_count_or_index_code(eval_option(ae['earlyReflectionsfrequencyGridIndex']))               # erFreqGridIdx