Commit d6711912 authored by Archit Tamarapu's avatar Archit Tamarapu
Browse files

Added LC3PLUS_LEA_COMPAT_BITRATES_48_6 flag to treat split-rendering 256kbps...

Added LC3PLUS_LEA_COMPAT_BITRATES_48_6 flag to treat split-rendering 256kbps lc3plus 10ms 0dof bitrate as sentinel value for LEA compatible 48_6 bitrate (124 kbps per channel)
parent 05c5f452
Loading
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -884,7 +884,11 @@ ivas_error check_ind_list_limits(
        }
        else
        {
#ifdef IVAS_ERRORS_FIX_GLOBAL_FRAME
            return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Buffer of indices corrupted! Attempt to overwrite indice ID = %d (value: %d, bits: %d)!\n", hBstr->ind_list[hBstr->nb_ind_tot].id, hBstr->ind_list[hBstr->nb_ind_tot].value, hBstr->ind_list[hBstr->nb_ind_tot].nb_bits );
#else
            return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Buffer of indices corrupted in frame %d! Attempt to overwrite indice ID = %d (value: %d, bits: %d)!\n", frame, hBstr->ind_list[hBstr->nb_ind_tot].id, hBstr->ind_list[hBstr->nb_ind_tot].value, hBstr->ind_list[hBstr->nb_ind_tot].nb_bits );
#endif
        }
    }

@@ -939,7 +943,11 @@ ivas_error push_indice(
    /* check the limits of the list of indices */
    if ( ( error = check_ind_list_limits( hBstr ) ) != IVAS_ERR_OK )
    {
#ifdef IVAS_ERRORS_FIX_GLOBAL_FRAME
        return IVAS_ERROR( error, "Error occured in push_indice() while re-allocating the list of indices!\n" );
#else
        return IVAS_ERROR( error, "Error occured in push_indice() while re-allocating the list of indices (frame %d) !\n", frame );
#endif
    }

    /* find the location in the list of indices based on ID */
@@ -1095,7 +1103,11 @@ ivas_error push_next_bits(
        /* check the limits of the list of indices */
        if ( ( error = check_ind_list_limits( hBstr ) ) != IVAS_ERR_OK )
        {
#ifdef IVAS_ERRORS_FIX_GLOBAL_FRAME
            return IVAS_ERROR( error, "Error occured in push_next_bits() while re-allocating the list of indices!\n" );
#else
            return IVAS_ERROR( error, "Error occured in push_next_bits() while re-allocating the list of indices (frame %d) !\n", frame );
#endif
        }
        ptr = &hBstr->ind_list[hBstr->nb_ind_tot];

@@ -1114,7 +1126,11 @@ ivas_error push_next_bits(
        /* check the limits of the list of indices */
        if ( ( error = check_ind_list_limits( hBstr ) ) != IVAS_ERR_OK )
        {
#ifdef IVAS_ERRORS_FIX_GLOBAL_FRAME
            return IVAS_ERROR( error, "Error occured in push_next_bits() while re-allocating the list of indices!\n" );
#else
            return IVAS_ERROR( error, "Error occured in push_next_bits() while re-allocating the list of indices (frame %d) !\n", frame );
#endif
        }
        ptr = &hBstr->ind_list[hBstr->nb_ind_tot];

+3 −1
Original line number Diff line number Diff line
@@ -157,7 +157,9 @@
#define SPLIT_REND_WITH_HEAD_ROT                        /* Dlb,FhG: Split Rendering contributions 21 and 35 */
#define ISAR_BITSTREAM_UPDATE_LC3PLUS                   /* FhG: Multiple improvements to the ISAR bitstream when LC3plus is used. See MR 1456 for details. */
#define SPLIT_REND_POSE_CORRECTION_UNUSED_BITS

#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
#define LC3PLUS_LEA_COMPAT_BITRATES_48_6                /* FhG: treat split-rendering 256kbps lc3plus 10ms 0dof bitrate as sentinel value for LEA compatible 48_6 bitrate (124 kbps per channel)  */
#endif
#define FIX_NUM_SUBFRAME_UPDATE

#define FIX_1053_REVERB_RECONFIGURATION                 /* Philips: issue 1053: fix for dynamic switching of acoustic environment */
+8 −0
Original line number Diff line number Diff line
@@ -317,6 +317,14 @@ int32_t isar_get_lc3plus_bitrate(
    const int16_t split_prerender_frame_size_ms );
#endif

#ifdef LC3PLUS_LEA_COMPAT_BITRATES_48_6
int32_t isar_get_lc3plus_bitrate(
    const int32_t SplitRendBitRate,
    const ISAR_SPLIT_REND_POSE_CORRECTION_MODE poseCorrectionMode,
    const int32_t nChannels,
    const int32_t codecFrameDurationUs );
#endif

ivas_error isar_split_rend_validate_config(
    const ISAR_SPLIT_REND_CONFIG_DATA *pSplitRendConfig,
    const int16_t pcm_out_flag );
+15 −0
Original line number Diff line number Diff line
@@ -1969,7 +1969,11 @@ ivas_error split_renderer_open_lc3plus(

    if ( ( error = ISAR_LC3PLUS_ENC_Open( config,
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
#ifdef LC3PLUS_LEA_COMPAT_BITRATES_48_6
                                          isar_get_lc3plus_bitrate( pSplitRendConfig->splitRendBitRate, pSplitRendConfig->poseCorrectionMode, config.channels, config.lc3plus_frame_duration_us ),
#else
                                          isar_get_lcld_bitrate( pSplitRendConfig->splitRendBitRate, pSplitRendConfig->poseCorrectionMode ),
#endif
#else
                                          isar_get_lc3plus_bitrate( pSplitRendConfig->splitRendBitRate, pSplitRendConfig->poseCorrectionMode, (int16_t) ( config.isar_frame_duration_us / 1000 ) ),
#endif
@@ -2229,7 +2233,18 @@ ivas_error isar_renderMultiTDBinToSplitBinaural(
        {
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
#ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS
#ifdef LC3PLUS_LEA_COMPAT_BITRATES_48_6
            if ( pBits->pose_correction == ISAR_SPLIT_REND_POSE_CORRECTION_MODE_NONE )
            {
                available_bits = isar_get_lc3plus_bitrate( SplitRendBitRate, hSplitBin->multiBinPoseData.poseCorrectionMode, hSplitBin->hLc3plusEnc->config.channels, hSplitBin->hLc3plusEnc->config.lc3plus_frame_duration_us ) / FRAMES_PER_SEC;
            }
            else
            {
                available_bits = ( SplitRendBitRate / FRAMES_PER_SEC ) - pBits->bits_written;
            }
#else
            available_bits = ( SplitRendBitRate / FRAMES_PER_SEC ) - pBits->bits_written;
#endif
            if ( ( error = splitRendLc3plusEncodeAndWrite( hSplitBin, pBits, available_bits, in ) ) != IVAS_ERR_OK )
#else
            available_bits = ( SplitRendBitRate / FRAMES_PER_SEC ) - pBits->bits_written;
+24 −0
Original line number Diff line number Diff line
@@ -563,6 +563,30 @@ int32_t isar_get_lcld_bitrate(
    return -1;
}

#ifdef LC3PLUS_LEA_COMPAT_BITRATES_48_6
/*-------------------------------------------------------------------------
 * Function isar_get_lc3plus_bitrate()
 *
 *
 *------------------------------------------------------------------------*/

int32_t isar_get_lc3plus_bitrate(
    const int32_t SplitRendBitRate,
    const ISAR_SPLIT_REND_POSE_CORRECTION_MODE poseCorrectionMode,
    const int32_t nChannels,
    const int32_t codecFrameDurationUs )
{
    int32_t bitrate;
    bitrate = isar_get_lcld_bitrate( SplitRendBitRate, poseCorrectionMode );
    /* Check for LC3plus LEA 48_6 LC3 compatibility mode signalling */
    if ( ISAR_SPLIT_REND_POSE_CORRECTION_MODE_NONE == poseCorrectionMode && bitrate == 256000 && nChannels == 2 && codecFrameDurationUs == 10000 )
    {
        bitrate = 2 * 126000;
    }
    return bitrate;
}
#endif


#ifndef ISAR_BITSTREAM_UPDATE_LC3PLUS
/*-------------------------------------------------------------------------
Loading