Commit ebfd0a22 authored by bayers's avatar bayers
Browse files

fix copying of cna to corresponding subframes, copy pointers were not updated correctly

parent 6b17a174
Loading
Loading
Loading
Loading
Loading
+7 −9
Original line number Diff line number Diff line
@@ -1952,22 +1952,20 @@ void generate_masking_noise_lb_dirac(
            int16_t cur_subframe_start_cngfs;
            int16_t slot_size_cng;

            cur_subframe_start_outfs = 0;
            cur_subframe_start_cngfs = 0;

            slot_size_cng = hFdCngCom->frameSize / DEFAULT_JBM_CLDFB_TIMESLOTS;
            /* move start indices forward to the last subframe */
            for ( cur_subframe = 0; cur_subframe < hSpatParamRendCom->nb_subframes - 1; cur_subframe++ )
            {
                cur_subframe_start_outfs += hSpatParamRendCom->subframe_nbslots[cur_subframe] * hSpatParamRendCom->slot_size;
                cur_subframe_start_cngfs += hSpatParamRendCom->subframe_nbslots[cur_subframe] * slot_size_cng;
            }
            /* move start indices forward to the end of the last subframe */
            cur_subframe_start_outfs = nCldfbTs * hSpatParamRendCom->slot_size;
            cur_subframe_start_cngfs = nCldfbTs * slot_size_cng;

            /* go from the last subframe back and move the LB noise */
            for ( cur_subframe = cur_subframe < hSpatParamRendCom->nb_subframes; cur_subframe >= 0; cur_subframe-- )
            for ( cur_subframe = hSpatParamRendCom->nb_subframes - 1; cur_subframe >= 0; cur_subframe-- )
            {
                int16_t move_size, subframe_size_outfs;
                move_size = slot_size_cng * hSpatParamRendCom->subframe_nbslots[cur_subframe];
                subframe_size_outfs = hSpatParamRendCom->subframe_nbslots[cur_subframe] * hSpatParamRendCom->slot_size;
                cur_subframe_start_outfs -= hSpatParamRendCom->subframe_nbslots[cur_subframe] * hSpatParamRendCom->slot_size;
                cur_subframe_start_cngfs -= hSpatParamRendCom->subframe_nbslots[cur_subframe] * slot_size_cng;
                /* move cna */
                mvr2r( tdBuffer + cur_subframe_start_cngfs, tdBuffer + cur_subframe_start_outfs, move_size );
                /* set everything else to zero */