From 14d75ca8bd3dab72d2ebed84fa96a82aa398f874 Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 24 Jun 2024 10:18:43 +0200 Subject: [PATCH] issue 1121: Define 'ivasmasaFormatDescriptor' at one common place; under FIX_1121_MASA_DESCRIPTOR --- lib_com/ivas_rom_com.c | 7 +++++++ lib_com/ivas_rom_com.h | 4 ++++ lib_com/options.h | 1 + lib_dec/ivas_masa_dec.c | 2 ++ lib_rend/ivas_mcmasa_ana.c | 2 ++ lib_util/masa_file_reader.c | 5 +++++ 6 files changed, 21 insertions(+) diff --git a/lib_com/ivas_rom_com.c b/lib_com/ivas_rom_com.c index ffd5d578de..2c4ab2f661 100644 --- a/lib_com/ivas_rom_com.c +++ b/lib_com/ivas_rom_com.c @@ -2471,6 +2471,13 @@ const uint16_t ivas_param_mc_sym_freq_ild_delta_combined_48_16bits[2 * PARAM_MC_ * MASA ROM tables *----------------------------------------------------------------------------------*/ +#ifdef FIX_1121_MASA_DESCRIPTOR +const uint8_t ivasmasaFormatDescriptor[8] = +{ + 0x49, 0x56, 0x41, 0x53, 0x4D, 0x41, 0x53, 0x41 /* "IVASMASA" */ +}; + +#endif const float diffuseness_reconstructions_hr[HR_MASA_ER_LEVELS] = { 0.00f, diff --git a/lib_com/ivas_rom_com.h b/lib_com/ivas_rom_com.h index 5983062648..18f2062d7f 100644 --- a/lib_com/ivas_rom_com.h +++ b/lib_com/ivas_rom_com.h @@ -264,6 +264,10 @@ extern const uint16_t ivas_param_mc_sym_freq_icc_delta_combined_48_16bits[2 * PA * MASA ROM tables *----------------------------------------------------------------------------------*/ +#ifdef FIX_1121_MASA_DESCRIPTOR +extern const uint8_t ivasmasaFormatDescriptor[8]; /* "IVASMASA" */ + +#endif extern const int16_t bits_direction_masa[DIRAC_DIFFUSE_LEVELS]; extern const int16_t no_theta_masa[NO_SPHERICAL_GRIDS - 2]; extern const int16_t no_phi_masa[NO_SPHERICAL_GRIDS][MAX_NO_THETA]; diff --git a/lib_com/options.h b/lib_com/options.h index 8e314ba4f1..4a5160e523 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -164,6 +164,7 @@ #define FIX_1099_JBM_MD_HANDLE_ALLOC /* VA: issue 1099: Limit the allocation of `hJbmMetadata` handle to MASA and OMASA only */ #define FIX_1111_TDM_LSP_BUFFER /* VA: issue 1111: remove unused buffer `tdm_lspQ_PCh[]' */ #define FIX_1101_CLEANING_JBM_CALL /* VA: issue 1101: remove obsolete call of ivas_jbm_dec_tc_buffer_open() */ +#define FIX_1121_MASA_DESCRIPTOR /* VA: issue 1121: Define 'ivasmasaFormatDescriptor' at one common place */ /* #################### End BE switches ################################## */ diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index 79f3c046a1..121cb3df43 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -1835,7 +1835,9 @@ static void create_masa_ext_out_meta( IVAS_QMETADATA_HANDLE hQMetaData, const int16_t nchan_transport ) { +#ifndef FIX_1121_MASA_DESCRIPTOR const uint8_t ivasmasaFormatDescriptor[8] = { 0x49, 0x56, 0x41, 0x53, 0x4D, 0x41, 0x53, 0x41 }; /* "IVASMASA" */ +#endif int16_t i, sf, b_old, b_new, dir; MASA_DECRIPTIVE_META *descMeta; int16_t *bandMap; diff --git a/lib_rend/ivas_mcmasa_ana.c b/lib_rend/ivas_mcmasa_ana.c index 8ca05a1197..49e7d00eec 100644 --- a/lib_rend/ivas_mcmasa_ana.c +++ b/lib_rend/ivas_mcmasa_ana.c @@ -1069,7 +1069,9 @@ void ivas_create_masa_out_meta( float surroundingCoherence[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS] /* i : Estimated surround coherence */ ) { +#ifndef FIX_1121_MASA_DESCRIPTOR const uint8_t ivasmasaFormatDescriptor[8] = { 0x49, 0x56, 0x41, 0x53, 0x4D, 0x41, 0x53, 0x41 }; /* "IVASMASA" */ +#endif int16_t i, sf, band; uint8_t numFrequencyBands; uint8_t numDirections; diff --git a/lib_util/masa_file_reader.c b/lib_util/masa_file_reader.c index f59f514d7f..bc75b0bdbd 100644 --- a/lib_util/masa_file_reader.c +++ b/lib_util/masa_file_reader.c @@ -33,6 +33,9 @@ #include "masa_file_reader.h" #include "ivas_prot.h" #include "ivas_stat_com.h" +#ifdef FIX_1121_MASA_DESCRIPTOR +#include "ivas_rom_com.h" /* load 'ivasmasaFormatDescriptor[8]' */ +#endif #include #include @@ -111,7 +114,9 @@ ivas_error MasaFileReader_readNextFrame( return IVAS_ERR_UNEXPECTED_NULL_POINTER; } +#ifndef FIX_1121_MASA_DESCRIPTOR const uint8_t ivasmasaFormatDescriptor[8] = { 0x49, 0x56, 0x41, 0x53, 0x4D, 0x41, 0x53, 0x41 }; /* "IVASMASA" */ +#endif uint16_t twoByteBuffer = 0; int16_t i, j, b; IVAS_MASA_METADATA_HANDLE hMeta; -- GitLab