Commit f32b4cf6 authored by sagnowski's avatar sagnowski
Browse files

Revert "Remove changes under SPLIT_REND_METADATA_SECTION_SIZE"

This reverts commit e20ee047.
parent ade1d844
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -163,6 +163,7 @@
#define SPLIT_REND_EXTEND_ISAR_FILE_HEADER          /* FhG: Adds more fields to ISAR bitstream file header:
                                                              - LC3plus HIRES flag, coding sample rate - required to open LC3plus decoder before decoding first frame.
                                                              - ISAR frame size - fixes 10ms framing in ISAR. */
#define SPLIT_REND_METADATA_SECTION_SIZE            /* FhG: prepends metadata section in the split bitstream frame with size information */

#define FIX_NUM_SUBFRAME_UPDATE

+4 −0
Original line number Diff line number Diff line
@@ -109,6 +109,10 @@ typedef enum
#define ISAR_SPLIT_REND_HQ_MODE_BITS   1
#define ISAR_SPLIT_REND_ROT_AXIS_BITS  3

#ifdef SPLIT_REND_METADATA_SECTION_SIZE
#define IVAS_SPLIT_REND_MD_SIZE_BITS            13  /* Max expected size of the MD section: 256000 kbps / 50 fps = 5120 < 2^13 = 8192 */
#endif

#ifdef LC3PLUS_RTP_PAYLOAD_FORMAT
#define IVAS_LC3PLUS_MAX_NUM_DECODERS 2
#endif
+20 −0
Original line number Diff line number Diff line
@@ -1854,13 +1854,33 @@ static void write_pose_correction_section( SPLIT_REND_WRAPPER *hSplitBin,
                                           const int16_t ro_md_flag )
{
    int32_t available_md_bits;
#ifdef SPLIT_REND_METADATA_SECTION_SIZE
    int32_t md_section_start, md_section_end;

    md_section_start = pBits->bits_written;
#endif
    available_md_bits = isar_get_split_rend_md_target_brate( SplitRendBitRate, pcm_out_flag ) * L_FRAME48k / 48000;

#ifdef SPLIT_REND_METADATA_SECTION_SIZE
    /* Skip first few bits, where the size info of the pose correction metadata section
     * will be written later (it is not yet known at this point) */
    available_md_bits -= IVAS_SPLIT_REND_MD_SIZE_BITS;
    pBits->bits_written += IVAS_SPLIT_REND_MD_SIZE_BITS;
#endif

    /* Write pose correction metadata */
    if ( hSplitBin->multiBinPoseData.poseCorrectionMode == ISAR_SPLIT_REND_POSE_CORRECTION_MODE_CLDFB )
    {
        isar_rend_CldfbSplitPreRendProcess( hSplitBin->hBinHrSplitPreRend, headPosition, &hSplitBin->multiBinPoseData, Cldfb_In_BinReal, Cldfb_In_BinImag, pBits, available_md_bits, low_res_pre_rend_rot, ro_md_flag );
    }

#ifdef SPLIT_REND_METADATA_SECTION_SIZE
    /* Update metadata section size field with the actual number of bits written */
    md_section_end = pBits->bits_written;
    pBits->bits_written = md_section_start; /* Hack to write to the beginning of the metadata section */
    ISAR_SPLIT_REND_BITStream_write_int32( pBits, md_section_end - md_section_start, IVAS_SPLIT_REND_MD_SIZE_BITS );
    pBits->bits_written = md_section_end;
#endif
}
#endif

+14 −0
Original line number Diff line number Diff line
@@ -1399,6 +1399,11 @@ static ivas_error renderSplitBinauralWithPostRot(
    float *readPtr, *writePtr;
    int16_t iNumBlocksPerFrame, iNumLCLDIterationsPerFrame;
    const ISAR_POST_REND_HeadRotData *pHeadRotData;
#ifdef SPLIT_REND_METADATA_SECTION_SIZE
    int16_t split_rend_md_section_size_bits;

    split_rend_md_section_size_bits = 0;
#endif
    isPostRendInputCldfb = 0;
    push_wmops( "renderSplitBinauralWithPostRot" );
    error = IVAS_ERR_OK;
@@ -1437,6 +1442,15 @@ static ivas_error renderSplitBinauralWithPostRot(

    if ( hSplitBin->first_good_frame_received == 1 )
    {
#ifdef SPLIT_REND_METADATA_SECTION_SIZE
        if ( bits.pose_correction != ISAR_SPLIT_REND_POSE_CORRECTION_MODE_NONE )
        {
            // This info is currently unused, but will later be needed e.g. when packing SR bitstream into RTP
            split_rend_md_section_size_bits = (int16_t) ISAR_SPLIT_REND_BITStream_read_int32( &bits, IVAS_SPLIT_REND_MD_SIZE_BITS );
            (void) split_rend_md_section_size_bits;
        }
#endif

        if ( bits.pose_correction == ISAR_SPLIT_REND_POSE_CORRECTION_MODE_CLDFB )
        {
            if ( !SplitRendBFI )
+20 −0
Original line number Diff line number Diff line
@@ -330,13 +330,33 @@ static void write_pose_correction_section( SPLIT_REND_WRAPPER *hSplitBin,
                                           const int16_t ro_md_flag )
{
    int32_t available_md_bits;
#ifdef SPLIT_REND_METADATA_SECTION_SIZE
    int32_t md_section_start, md_section_end;

    md_section_start = pBits->bits_written;
#endif
    available_md_bits = isar_get_split_rend_md_target_brate( SplitRendBitRate, pcm_out_flag ) * L_FRAME48k / 48000;

#ifdef SPLIT_REND_METADATA_SECTION_SIZE
    /* Skip first few bits, where the size info of the pose correction metadata section
     * will be written later (it is not yet known at this point) */
    available_md_bits -= IVAS_SPLIT_REND_MD_SIZE_BITS;
    pBits->bits_written += IVAS_SPLIT_REND_MD_SIZE_BITS;
#endif

    /* Write pose correction metadata */
    if ( hSplitBin->multiBinPoseData.poseCorrectionMode == ISAR_SPLIT_REND_POSE_CORRECTION_MODE_CLDFB )
    {
        isar_rend_CldfbSplitPreRendProcess( hSplitBin->hBinHrSplitPreRend, headPosition, &hSplitBin->multiBinPoseData, Cldfb_In_BinReal, Cldfb_In_BinImag, pBits, available_md_bits, low_res_pre_rend_rot, ro_md_flag );
    }

#ifdef SPLIT_REND_METADATA_SECTION_SIZE
    /* Update metadata section size field with the actual number of bits written */
    md_section_end = pBits->bits_written;
    pBits->bits_written = md_section_start; /* Hack to write to the beginning of the metadata section */
    ISAR_SPLIT_REND_BITStream_write_int32( pBits, md_section_end - md_section_start, IVAS_SPLIT_REND_MD_SIZE_BITS );
    pBits->bits_written = md_section_end;
#endif
}
#endif