Commit 7047e274 authored by Archit Tamarapu's avatar Archit Tamarapu
Browse files

[cleanup] merge SPLIT_REND_LC3PLUS into SPLIT_REND_WITH_HEAD_ROT and remove nested occurences

parent 67280d09
Loading
Loading
Loading
Loading
Loading
+7 −21
Original line number Diff line number Diff line
@@ -79,10 +79,8 @@ static
#define MAX_NUM_OUTPUT_CHANNELS    16
#define MAX_OUTPUT_PCM_BUFFER_SIZE ( MAX_NUM_OUTPUT_CHANNELS * MAX_FRAME_SIZE )
#ifdef SPLIT_REND_WITH_HEAD_ROT
#ifdef SPLIT_REND_LC3PLUS
#ifdef SPLIT_REND_WITH_HEAD_ROT
#define MAX_SPLIT_REND_BITRATE ( 1792000 ) /* TODO tmu: unify with SPLIT_REND_MAX_BRATE ?*/
#else
#define MAX_SPLIT_REND_BITRATE ( 768000 )
#endif
#define MAX_SPLIT_REND_BITS_BUFFER_SIZE_IN_BYTES ( ( ( (int32_t) MAX_SPLIT_REND_BITRATE / NUM_FRAMES_PER_SEC ) + 7 ) >> 3 )
#endif
@@ -1640,12 +1638,8 @@ static ivas_error initOnFirstGoodFrame(
            IVAS_SPLIT_REND_BITS splitRendBitsZero;
            splitRendBitsZero.bits_written = 0;
            splitRendBitsZero.bits_read = 0;
            if ( split_rend_write_bitstream_to_file( *hSplitRendFileReadWrite, splitRendBitsZero.bits_buf, &splitRendBitsZero.bits_read, &splitRendBitsZero.bits_written
#ifdef SPLIT_REND_LC3PLUS
                                                     ,
                                                     -1, IVAS_SPLIT_REND_POSE_CORRECTION_MODE_NONE
#endif
                                                     ) != IVAS_ERR_OK )
            if ( split_rend_write_bitstream_to_file( *hSplitRendFileReadWrite, splitRendBitsZero.bits_buf, &splitRendBitsZero.bits_read, &splitRendBitsZero.bits_written,
                                                     -1, IVAS_SPLIT_REND_POSE_CORRECTION_MODE_NONE ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "\nUnable to write to bitstream file!\n" );
                exit( -1 );
@@ -2035,12 +2029,8 @@ static ivas_error decodeG192(
#ifdef SPLIT_REND_WITH_HEAD_ROT
            if ( ( hSplitRendFileReadWrite != NULL ) && ( arg.outputFormat == IVAS_DEC_OUTPUT_SPLIT_BINAURAL_CODED ) )
            {
                if ( split_rend_write_bitstream_to_file( hSplitRendFileReadWrite, splitRendBits.bits_buf, &splitRendBits.bits_read, &splitRendBits.bits_written
#ifdef SPLIT_REND_LC3PLUS
                                                         ,
                                                         splitRendBits.codec, splitRendBits.pose_correction
#endif
                                                         ) != IVAS_ERR_OK )
                if ( split_rend_write_bitstream_to_file( hSplitRendFileReadWrite, splitRendBits.bits_buf, &splitRendBits.bits_read, &splitRendBits.bits_written,
                                                         splitRendBits.codec, splitRendBits.pose_correction ) != IVAS_ERR_OK )
                {
                    fprintf( stderr, "\nUnable to write to bitstream file!\n" );
                    exit( -1 );
@@ -2052,12 +2042,8 @@ static ivas_error decodeG192(
#ifdef SPLIT_REND_WITH_HEAD_ROT
                if ( ( hSplitRendFileReadWrite != NULL ) && ( arg.outputFormat == IVAS_DEC_OUTPUT_SPLIT_BINAURAL_PCM ) )
                {
                    if ( split_rend_write_bitstream_to_file( hSplitRendFileReadWrite, splitRendBits.bits_buf, &splitRendBits.bits_read, &splitRendBits.bits_written
#ifdef SPLIT_REND_LC3PLUS
                                                             ,
                                                             splitRendBits.codec, splitRendBits.pose_correction
#endif
                                                             ) != IVAS_ERR_OK )
                    if ( split_rend_write_bitstream_to_file( hSplitRendFileReadWrite, splitRendBits.bits_buf, &splitRendBits.bits_read, &splitRendBits.bits_written,
                                                             splitRendBits.codec, splitRendBits.pose_correction ) != IVAS_ERR_OK )
                    {
                        fprintf( stderr, "\nUnable to write to bitstream file!\n" );
                        exit( -1 );
+4 −12
Original line number Diff line number Diff line
@@ -1440,12 +1440,8 @@ int main(
        {
            ivas_error error_tmp;
            numSamplesRead = (int16_t) inBufferSize;
            error_tmp = split_rend_read_bits_from_file( hSplitRendFileReadWrite, bitsBuffer.bits, &bitsBuffer.config.bitsRead, &bitsBuffer.config.bitsWritten
#ifdef SPLIT_REND_LC3PLUS
                                                        ,
                                                        &bitsBuffer.config.codec, &bitsBuffer.config.poseCorrection
#endif
            );
            error_tmp = split_rend_read_bits_from_file( hSplitRendFileReadWrite, bitsBuffer.bits, &bitsBuffer.config.bitsRead, &bitsBuffer.config.bitsWritten,
                                                        &bitsBuffer.config.codec, &bitsBuffer.config.poseCorrection );
            if ( error_tmp != IVAS_ERR_OK )
            {
                if ( error_tmp == IVAS_ERR_END_OF_FILE )
@@ -1773,12 +1769,8 @@ int main(
#ifdef SPLIT_REND_WITH_HEAD_ROT
        if ( ( hSplitRendFileReadWrite != NULL ) && is_split_pre_rend_mode( &args ) )
        {
            if ( split_rend_write_bitstream_to_file( hSplitRendFileReadWrite, bitsBuffer.bits, &bitsBuffer.config.bitsRead, &bitsBuffer.config.bitsWritten
#ifdef SPLIT_REND_LC3PLUS
                                                     ,
                                                     bitsBuffer.config.codec, bitsBuffer.config.poseCorrection
#endif
                                                     ) != IVAS_ERR_OK )
            if ( split_rend_write_bitstream_to_file( hSplitRendFileReadWrite, bitsBuffer.bits, &bitsBuffer.config.bitsRead, &bitsBuffer.config.bitsWritten,
                                                     bitsBuffer.config.codec, bitsBuffer.config.poseCorrection ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "\nUnable to write to bitstream file!\n" );
                exit( -1 );
+0 −8
Original line number Diff line number Diff line
@@ -103,15 +103,12 @@ typedef enum
#endif

#ifdef SPLIT_REND_WITH_HEAD_ROT
#ifdef SPLIT_REND_LC3PLUS
typedef enum
{
    IVAS_SPLIT_REND_POSE_CORRECTION_MODE_NONE,
    IVAS_SPLIT_REND_POSE_CORRECTION_MODE_CLDFB,
} IVAS_SPLIT_REND_POSE_CORRECTION_MODE;
#endif

#ifdef SPLIT_REND_LC3PLUS
typedef enum
{
    IVAS_SPLIT_REND_CODEC_LCLD,
@@ -119,7 +116,6 @@ typedef enum
    IVAS_SPLIT_REND_CODEC_DEFAULT, /* Will use LCLD for CLDFB rendering paths and LC3plus for TD rendering paths */
    IVAS_SPLIT_REND_CODEC_NONE
} IVAS_SPLIT_REND_CODEC;
#endif

typedef struct ivas_split_rend_bits_t
{
@@ -127,10 +123,8 @@ typedef struct ivas_split_rend_bits_t
    int32_t buf_len; /*size of bits_buf in bytes. This field should be set by allocator of bits_buf*/
    int32_t bits_written;
    int32_t bits_read;
#ifdef SPLIT_REND_LC3PLUS
    IVAS_SPLIT_REND_CODEC codec;
    IVAS_SPLIT_REND_POSE_CORRECTION_MODE pose_correction;
#endif
} ivas_split_rend_bits_t, IVAS_SPLIT_REND_BITS, *IVAS_SPLIT_REND_BITS_HANDLE;
#endif
typedef struct
@@ -199,10 +193,8 @@ typedef struct _IVAS_SPLIT_REND_CONFIG
                              3 - (3dof correction. By default YAW, PITCH and ROLL correction)
                              */
    int16_t codec_delay_ms;   /*PLACEHOLDER (currently being ignored) : look ahead delay of the codec that is used to code BIN signal output of pre-renderer*/
#ifdef SPLIT_REND_LC3PLUS
    IVAS_SPLIT_REND_POSE_CORRECTION_MODE poseCorrectionMode;
    IVAS_SPLIT_REND_CODEC codec;
#endif
} IVAS_SPLIT_REND_CONFIG_DATA;
#endif

+7 −24
Original line number Diff line number Diff line
@@ -1528,19 +1528,9 @@ typedef enum
#define SPLIT_REND_MAX_ONE_AXIS_MD_POSES           (2)
#define MAX_EXTRAPOLATION_ANGLE                 (15.0f) /* this means additional 15 degrees can be extrapolated on top of MD probing poses*/

#ifdef SPLIT_REND_LC3PLUS
#define SPLIT_REND_MAX_DOF                      (3)
#endif

#ifdef SPLIT_REND_WITH_HEAD_ROT
#ifdef SPLIT_REND_LC3PLUS
#define MAX_HEAD_ROT_POSES                      (2 + SPLIT_REND_MAX_YAW_ONLY_POSES + SPLIT_REND_MAX_PITCH_ONLY_POSES + SPLIT_REND_MAX_ROLL_ONLY_POSES) /* TODO tmu : revisit for harmonization */
#else
#define MAX_HEAD_ROT_POSES                      (1 + SPLIT_REND_MAX_YAW_ONLY_POSES + SPLIT_REND_MAX_PITCH_ONLY_POSES + SPLIT_REND_MAX_ROLL_ONLY_POSES)
#endif
#else
#define MAX_HEAD_ROT_POSES                      (1 + SPLIT_REND_MAX_YAW_ONLY_POSES)
#endif
#define MAX_SPLIT_REND_MD_BANDS                 (20)
#define MAX_SPLIT_MD_SUBFRAMES                  (1)
#define COMPLEX_MD_BAND_THRESH                  (MAX_SPLIT_REND_MD_BANDS)
@@ -1558,14 +1548,10 @@ typedef enum
#define IVAS_SPLIT_REND_PRED_MAX_VAL    ( 1.0f )
#endif

#ifdef SPLIT_REND_WITH_HEAD_ROT
#define IVAS_SPLIT_REND_PITCH_G_MIN_VAL  (0.5f)
#define IVAS_SPLIT_REND_PITCH_G_MAX_VAL  (1.5f)
#define IVAS_SPLIT_REND_PITCH_G_QUANT_PNTS    ( IVAS_SPLIT_REND_D_QUANT_PNTS )
#define IVAS_SPLIT_REND_D_MIN_VAL       ( 0.0f )
#else
#define IVAS_SPLIT_REND_D_MIN_VAL       ( 0.0f )
#endif
#define IVAS_SPLIT_REND_D_MAX_VAL       ( 1.0f )

#define IVAS_SPLIT_REND_PRED_Q_STEP        (( IVAS_SPLIT_REND_PRED_MAX_VAL - IVAS_SPLIT_REND_PRED_MIN_VAL ) / ( IVAS_SPLIT_REND_PRED_QUANT_PNTS - 1 ))
@@ -1580,7 +1566,7 @@ typedef enum
#define IVAS_SPLIT_REND_DOF_BITS        (2)
#define IVAS_SPLIT_REND_HQ_MODE_BITS    (1)
#define IVAS_SPLIT_REND_ROT_AXIS_BITS    (3)
#endif
#endif /* SPLIT_REND_WITH_HEAD_ROT */

#define HRTF_SH_ORDER                           3
#define HRTF_SH_CHANNELS                        16
@@ -1806,17 +1792,13 @@ typedef enum
#define SPAR_DIRAC_DTX_BANDS                    ( SPAR_DTX_BANDS + DIRAC_DTX_BANDS )
#define CLDFB_PAR_WEIGHT_START_BAND             7

#ifdef SPLIT_REND_WITH_HEAD_ROT
/*----------------------------------------------------------------------------------*
 * Split rendering bitrate constants
 *----------------------------------------------------------------------------------*/

#ifndef SPLIT_REND_LC3PLUS
#define SIZE_SPLIT_REND_BRATE_TBL                     (4)
#endif
#define SPLIT_REND_256k                               256000
#ifdef SPLIT_REND_LC3PLUS
#define SPLIT_REND_320k                               320000
#endif
#define SPLIT_REND_384k                               384000
#define SPLIT_REND_512k                               512000
#define SPLIT_REND_768k                               768000
@@ -1830,6 +1812,7 @@ typedef enum
#define QUANT_STRAT_2                           2


#endif
/*----------------------------------------------------------------------------------*
 * Limiter constants
 *----------------------------------------------------------------------------------*/
+2 −2
Original line number Diff line number Diff line
@@ -135,7 +135,7 @@ typedef enum
    IVAS_ERR_INVALID_INPUT_ID,
    IVAS_ERR_WRONG_NUM_CHANNELS,
    IVAS_ERR_INVALID_BUFFER_SIZE,
#ifdef SPLIT_REND_LC3PLUS
#ifdef SPLIT_REND_WITH_HEAD_ROT
    IVAS_ERR_LC3PLUS_INVALID_BITRATE,
    IVAS_ERR_INVALID_SPLIT_REND_CONFIG,
#endif
@@ -237,7 +237,7 @@ static inline const char *ivas_error_to_string( ivas_error error_code )
            return "Wrong mode";
        case IVAS_ERR_HEAD_ROTATION_NOT_SUPPORTED:
            return "Head rotation not supported";
#ifdef SPLIT_REND_LC3PLUS
#ifdef SPLIT_REND_WITH_HEAD_ROT
        case IVAS_ERR_LC3PLUS_INVALID_BITRATE:
            return "Specified split rendering bit rate is not supported";
        case IVAS_ERR_INVALID_SPLIT_REND_CONFIG:
Loading