Commit f6a1bc21 authored by sagnowski's avatar sagnowski
Browse files

Fix split rendering with frame sizes other than 20 ms

parent 1571d77d
Loading
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -1935,7 +1935,7 @@ static ivas_error isar_generate_metadata_and_bitstream(
    int16_t td_input;
    int16_t ro_md_flag;
    IVAS_QUATERNION Quaternion;
    int16_t i, j, num_poses;
    int16_t i, j, num_poses, num_cldfb_slots;
    float *p_Cldfb_RealBuffer_Binaural[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS][CLDFB_NO_COL_MAX];
    float *p_Cldfb_ImagBuffer_Binaural[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS][CLDFB_NO_COL_MAX];

@@ -1952,10 +1952,11 @@ static ivas_error isar_generate_metadata_and_bitstream(
    if ( !td_input )
    {
        num_poses = hSplitBinRend->splitrend.multiBinPoseData.num_poses;
        num_cldfb_slots = hIvasDec->st_ivas->hDecoderConfig->render_framesize * JBM_CLDFB_SLOTS_IN_SUBFRAME;

        for ( i = 0; i < (int16_t) ( BINAURAL_CHANNELS * num_poses ); ++i )
        {
            for ( j = 0; j < CLDFB_NO_COL_MAX; ++j )
            for ( j = 0; j < num_cldfb_slots; ++j )
            {
                /* Save pointers to first CLDFB column in the ring buffer. Allows us to save
                 * significant amounts of memory by not copying CLDFB values into a separate buffer. */
+5 −3
Original line number Diff line number Diff line
@@ -381,20 +381,22 @@ ivas_error ISAR_PRE_REND_MultiBinToSplitBinaural(
    }
    else
    {
        int16_t ch, slot_idx;
        int16_t ch, slot_idx, num_slots;
        num_slots = isar_frame_size_ms * 1000000 / CLDFB_SLOT_NS;

        /* CLDFB synthesis of main pose */
        for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ )
        {
            float *Cldfb_In_BinReal_p[CLDFB_NO_COL_MAX];
            float *Cldfb_In_BinImag_p[CLDFB_NO_COL_MAX];

            for ( slot_idx = 0; slot_idx < CLDFB_NO_COL_MAX; slot_idx++ )
            for ( slot_idx = 0; slot_idx < num_slots; slot_idx++ )
            {
                Cldfb_In_BinReal_p[slot_idx] = Cldfb_In_BinReal[ch][slot_idx];
                Cldfb_In_BinImag_p[slot_idx] = Cldfb_In_BinImag[ch][slot_idx];
            }

            cldfbSynthesis( Cldfb_In_BinReal_p, Cldfb_In_BinImag_p, output[ch], hSplitBin->hCldfbHandles->cldfbSyn[0]->no_channels * CLDFB_NO_COL_MAX, hSplitBin->hCldfbHandles->cldfbSyn[ch] );
            cldfbSynthesis( Cldfb_In_BinReal_p, Cldfb_In_BinImag_p, output[ch], hSplitBin->hCldfbHandles->cldfbSyn[0]->no_channels * num_slots, hSplitBin->hCldfbHandles->cldfbSyn[ch] );
        }

        pBits->pose_correction = hSplitBin->multiBinPoseData.poseCorrectionMode;