Commit 98d1d581 authored by Tapani Pihlajakuja's avatar Tapani Pihlajakuja
Browse files

Add support to JBM EXT out for MASA bitstream with varying 1dir and 2dir content.

parent 7448184e
Loading
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -1964,6 +1964,8 @@ static void ivas_jbm_dec_copy_masa_meta_to_buffer(
            hJbmMetadata->diffuseToTotalRatioBuffer[write_idx][band] = extOutMeta->diffuseToTotalRatio[sf][band];
            hJbmMetadata->surroundCoherenceBuffer[write_idx][band] = extOutMeta->surroundCoherence[sf][band];
        }

        hJbmMetadata->numberOfDirections[write_idx] = extOutMeta->descriptiveMeta.numberOfDirections;
    }
}

@@ -2019,6 +2021,7 @@ void ivas_jbm_masa_sf_to_sf_map(
    int16_t slot_read_idx, sf_read_idx;
    int16_t sf_idx;
    int16_t dir, band;
    uint8_t numberOfDirections;

    /* Set values */
    hJbmMetadata = st_ivas->hJbmMetadata;
@@ -2053,5 +2056,19 @@ void ivas_jbm_masa_sf_to_sf_map(
            extOutMeta->surroundCoherence[sf_idx][band] = hJbmMetadata->surroundCoherenceBuffer[sf_read_idx][band];
        }
    }

    /* Determine the number of directions for the frame to be written */
    numberOfDirections = 0;
    for ( sf_idx = 0; sf_idx < MAX_PARAM_SPATIAL_SUBFRAMES; sf_idx++ )
    {
        sf_read_idx = sf_to_sf_map[sf_idx];

        if ( hJbmMetadata->numberOfDirections[sf_read_idx] == 1 )
        {
            numberOfDirections = 1;
            break;
        }
    }
    extOutMeta->descriptiveMeta.numberOfDirections = numberOfDirections;
}
#endif
+1 −0
Original line number Diff line number Diff line
@@ -1233,6 +1233,7 @@ typedef struct jbm_metadata_structure
    uint8_t spreadCoherenceBuffer[MASA_MAXIMUM_DIRECTIONS][MAX_PARAM_SPATIAL_SUBFRAMES * MASA_JBM_RINGBUFFER_FRAMES][MASA_FREQUENCY_BANDS];
    uint8_t surroundCoherenceBuffer[MAX_PARAM_SPATIAL_SUBFRAMES * MASA_JBM_RINGBUFFER_FRAMES][MASA_FREQUENCY_BANDS];
    uint8_t diffuseToTotalRatioBuffer[MAX_PARAM_SPATIAL_SUBFRAMES * MASA_JBM_RINGBUFFER_FRAMES][MASA_FREQUENCY_BANDS];
    uint8_t numberOfDirections[MAX_PARAM_SPATIAL_SUBFRAMES * MASA_JBM_RINGBUFFER_FRAMES]; /* Descriptive metadata, value is 0 or 1 */

    int16_t slot_read_idx;
    int16_t slot_write_idx;