Commit 77151658 authored by vaclav's avatar vaclav
Browse files

Merge branch '747-ism-todos' into 'main'

Resolve "ISM ToDos"

See merge request !1032
parents aaa35bcb 2a710248
Loading
Loading
Loading
Loading
Loading
+17 −6
Original line number Diff line number Diff line
@@ -153,7 +153,11 @@ typedef enum
#define MAX_SCE                                 MAX_NUM_OBJECTS             /* max. number of SCEs */
#define MAX_CPE                                 ( MAX_TRANSPORT_CHANNELS / CPE_CHANNELS )    /* max. number of CPEs */

#ifdef FIX_747_ISM_TODOS
#define MAX_BITS_METADATA                       2500                        /* max. bit-budget of metadata */
#else
#define MAX_BITS_METADATA                       2640                        /* max. bit-budget of metadata, one channel */ /* IVAS_fmToDo: to be confirmed for final value once mature */
#endif
#define MIN_NUM_IND                             10                          /* minimum number of indices in the core coder */
#define MAX_NUM_IND_LFE                         100                         /* maximum number of indices in the LFE encoder */
#define MAX_NUM_IND_TEMP_LIST                   10                          /* maximum number of indices in the temporary list */
@@ -360,8 +364,9 @@ typedef enum
#define ISM_Q_STEP_LOW                          (ISM_Q_STEP * 2)
#define ISM_Q_STEP_BORDER_LOW                   (ISM_Q_STEP_BORDER * 2)

#ifndef FIX_747_ISM_TODOS
#define BRATE_ISM_INACTIVE                      2450 /* CoreCoder bitrate in ISM inactive frames */

#endif
typedef enum 
{
    ISM_MODE_NONE,
@@ -396,10 +401,16 @@ enum
    IND_ISM_ELEVATION = TAG_ISM_LOOP_START,
    IND_ISM_RADIUS_DIFF_FLAG = TAG_ISM_LOOP_START,
    IND_ISM_RADIUS = TAG_ISM_LOOP_START,
#ifdef FIX_747_ISM_TODOS
    TAG_ISM_LOOP_END = TAG_ISM_LOOP_START
#else
    TAG_ISM_LOOP_END = TAG_ISM_LOOP_START + 100, /* IVAS_fmToDo: to be reviewed once the final metadata are defined */
#endif
    /* --------- end of loop for objects ----------- */

#ifndef FIX_747_ISM_TODOS
    ISM_MAX_NUM_INDICES
#endif

};


+9 −0
Original line number Diff line number Diff line
@@ -61,7 +61,9 @@ typedef enum
    IVAS_ERR_INVALID_MASA_CONFIG,
    IVAS_ERR_TOO_MANY_INPUTS,
    IVAS_ERR_MISSING_METADATA,
#ifndef FIX_747_ISM_TODOS
    IVAS_ERR_INDEX_OUT_OF_BOUNDS,
#endif
    IVAS_ERR_RECONFIGURE_NOT_SUPPORTED,
    IVAS_ERR_INVALID_FEC_CONFIG,
    IVAS_ERR_INVALID_FEC_OFFSET,
@@ -84,7 +86,12 @@ typedef enum
#endif
    IVAS_ERR_INVALID_HRTF,
    IVAS_ERR_INVALID_INPUT_FORMAT,
#ifdef FIX_747_ISM_TODOS
    IVAS_ERR_INVALID_INDEX,

#else
    IVAS_ERR_INVALID_INDEX, /* ToDo: should be merged with IVAS_ERR_INDEX_OUT_OF_BOUNDS */
#endif
    IVAS_ERR_NOT_SUPPORTED_OPTION,
    IVAS_ERR_NOT_IMPLEMENTED,
    IVAS_ERR_WAITING_FOR_BITSTREAM,
@@ -215,8 +222,10 @@ static inline const char *ivas_error_to_string( ivas_error error_code )
            return "Invalid MASA config";
        case IVAS_ERR_TOO_MANY_INPUTS:
            return "Too many object inputs provided";
#ifndef FIX_747_ISM_TODOS
        case IVAS_ERR_INDEX_OUT_OF_BOUNDS:
            return "Index out of bounds";
#endif
        case IVAS_ERR_RECONFIGURE_NOT_SUPPORTED:
            return "Reconfigure not supported";
        case IVAS_ERR_INVALID_FEC_OFFSET:
+3 −3
Original line number Diff line number Diff line
@@ -159,10 +159,8 @@
#define ROM_TO_RAM                                     /*Dlb : ROM optimization in SR mode*/     
#define FIX_712_713_SPLIT_REND_MASA_MC                 /*Dlb : Fix for issue 712 and 713*/
#endif
#define FIX_705_REND_CONF_FALSE_WARNING                 /* Eri: Bug in MSVC ftell() for UNIX-style line endings trigger false warning messages in renderer configuration. */

/* #################### End BE switches ################################## */

#define FIX_705_REND_CONF_FALSE_WARNING                 /* Eri: Bug in MSVC ftell() for UNIX-style line endings trigger false warning messages in renderer configuration. */
#define IGF_MEMORY_ALLOC_OPT                            /* FhG: Issue 157: allocate IGF encoder structure only when needed */
#define FIX_732_PLANAR_SBA_OSBA                         /* Dlb : issue 732: fix for crash in planar mode in OSBA format*/
#define FIX_708_DPID_COMMAND_LINE                       /* issue 708: sanity checks for '-dpid' command-line */
@@ -174,8 +172,10 @@
#define FIX_708_AEID_COMMAND_LINE                       /* VA: issue 708: improve AEID command-line robustness */
#define FIX_518_ISM_BRIR_EXTREND                        /* FhG: fix issue #518, cleanup ISM to BINAURAL_ROOM_IR rendering in the external renderer */
#define FIX_764_HARM_CODE                               /* VA: issue 764: introduce new function for the same code block at four different places */
#define FIX_747_ISM_TODOS                               /* VA: issue 747 - address ISM ToDos */


/* #################### End BE switches ################################## */

/* #################### Start NON-BE switches ############################ */
/* any switch which is non-be wrt selection floating point code */
+16 −0
Original line number Diff line number Diff line
@@ -62,6 +62,10 @@ static int16_t decode_radius( DEC_CORE_HANDLE st0, int16_t *last_radius_idx, int
#define CNG_MD_MAX_DIFF_AZIMUTH   5
#define CNG_MD_MAX_DIFF_ELEVATION 5

#ifdef FIX_747_ISM_TODOS
#define MAX_BITS_ISM_METADATA ( 2 * ISM_EXTENDED_METADATA_BITS + MAX_NUM_OBJECTS * ( 1 /*number of objects*/ + ISM_METADATA_MD_FLAG_BITS + 2 * ISM_METADATA_FLAG_BITS + ISM_METADATA_IS_NDP_BITS + 1 /*abs.flag*/ + ISM_AZIMUTH_NBITS + ISM_ELEVATION_NBITS + 1 /*abs.flag*/ + ISM_RADIUS_NBITS + 1 /*abs.flag*/ + ISM_AZIMUTH_NBITS + ISM_ELEVATION_NBITS ) + 10 /* margin */ ) /* max. bit-budget of ISM metadata */
#endif


/*-------------------------------------------------------------------*
 * ism_metadata_smooth()
@@ -165,7 +169,11 @@ ivas_error ivas_ism_metadata_dec(
    int16_t idx_angle1;
    int16_t idx_angle2;
    int16_t next_bit_pos_orig;
#ifdef FIX_747_ISM_TODOS
    uint16_t i, bstr_meta[MAX_BITS_ISM_METADATA], *bstr_orig;
#else
    uint16_t i, bstr_meta[MAX_BITS_METADATA], *bstr_orig;
#endif
    ISM_METADATA_HANDLE hIsmMetaData;
    int16_t nchan_transport_prev, ism_metadata_flag_global;
    int16_t null_metadata_flag[MAX_NUM_OBJECTS];
@@ -191,7 +199,11 @@ ivas_error ivas_ism_metadata_dec(
    set_s( lowrate_metadata_flag, 0, nchan_ism );

    /* reverse the bitstream for easier reading of indices */
#ifdef FIX_747_ISM_TODOS
    for ( i = 0; i < min( MAX_BITS_ISM_METADATA, last_bit_pos ); i++ )
#else
    for ( i = 0; i < min( MAX_BITS_METADATA, last_bit_pos ); i++ )
#endif
    {
        bstr_meta[i] = st0->bit_stream[last_bit_pos - i];
    }
@@ -967,7 +979,11 @@ void ivas_ism_metadata_sid_dec(
    st0->next_bit_pos = 0;

    /* reverse the bitstream for easier reading of indices */
#ifdef FIX_747_ISM_TODOS
    for ( i = 0; i < min( MAX_BITS_ISM_METADATA, last_bit_pos ); i++ )
#else
    for ( i = 0; i < min( MAX_BITS_METADATA, last_bit_pos ); i++ )
#endif
    {
        bstr_meta[i] = st0->bit_stream[last_bit_pos - i];
    }
+1 −2
Original line number Diff line number Diff line
@@ -562,8 +562,7 @@ ivas_error ivas_omasa_ism_metadata_dec(
    {
        /* decode ISM metadata */
        if ( ( error = ivas_ism_metadata_dec( ism_total_brate, *nchan_ism, nchan_transport_ism, st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->bfi,
                                              nb_bits_metadata, st_ivas->ism_mode, st_ivas->hISMDTX, NULL, &st_ivas->ism_extmeta_active, &st_ivas->ism_extmeta_cnt,
                                              st_ivas->hSCE[0]->hCoreCoder[0] ) ) != IVAS_ERR_OK )
                                              nb_bits_metadata, st_ivas->ism_mode, st_ivas->hISMDTX, NULL, &st_ivas->ism_extmeta_active, &st_ivas->ism_extmeta_cnt, st_ivas->hSCE[0]->hCoreCoder[0] ) ) != IVAS_ERR_OK )
        {
            return error;
        }
Loading