Commit 623e87b6 authored by vaclav's avatar vaclav
Browse files

issue 747 - address ISM ToDos; under FIX_747_ISM_TODOS

parent 980391a1
Loading
Loading
Loading
Loading
Loading
+17 −6
Original line number Diff line number Diff line
@@ -162,7 +162,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 */
@@ -369,8 +373,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,
@@ -405,10 +410,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,
@@ -78,7 +80,12 @@ typedef enum
    IVAS_ERR_EXT_ORIENTATION_NOT_SUPPORTED,
    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,
@@ -211,8 +218,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:
+1 −0
Original line number Diff line number Diff line
@@ -167,6 +167,7 @@

#define FIX_718_JBM_MD_UDPATE                           /* Fhg: fix issue #718, wrong setting of the update flag in the TD obj renderer in the JBM path */
#define FIX_719_CRASH_IN_CLEANUP                        /* VA: issue 719: fix Decoder crash after call to goto to cleanup */
#define FIX_747_ISM_TODOS                               /* VA: issue 747 - address ISM ToDos */


/* ################## End BE DEVELOPMENT switches ######################### */
+2 −4
Original line number Diff line number Diff line
@@ -238,16 +238,14 @@ ivas_error ivas_dec(
        }
        else if ( st_ivas->ism_mode == ISM_MODE_PARAM )
        {
            if ( ( error = ivas_ism_metadata_dec( ivas_total_brate, st_ivas->nchan_ism, &( st_ivas->nchan_transport ), st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->bfi, nb_bits_metadata, st_ivas->ism_mode, st_ivas->hISMDTX, st_ivas->hDirAC->hParamIsm, &st_ivas->ism_extmeta_active, &st_ivas->ism_extmeta_cnt,
                                                  st_ivas->hSCE[0]->hCoreCoder[0] ) ) != IVAS_ERR_OK )
            if ( ( error = ivas_ism_metadata_dec( ivas_total_brate, st_ivas->nchan_ism, &( st_ivas->nchan_transport ), st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->bfi, nb_bits_metadata, st_ivas->ism_mode, st_ivas->hISMDTX, st_ivas->hDirAC->hParamIsm, &st_ivas->ism_extmeta_active, &st_ivas->ism_extmeta_cnt, st_ivas->hSCE[0]->hCoreCoder[0] ) ) != IVAS_ERR_OK )
            {
                return error;
            }
        }
        else /* ISM_MODE_DISC */
        {
            if ( ( error = ivas_ism_metadata_dec( ivas_total_brate, st_ivas->nchan_ism, &( st_ivas->nchan_transport ), 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 )
            if ( ( error = ivas_ism_metadata_dec( ivas_total_brate, st_ivas->nchan_ism, &( st_ivas->nchan_transport ), 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 )
            {
                return error;
            }
+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];
    }
Loading