diff --git a/openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_mPass.h b/openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_mPass.h index f3431eba24..3c1d9e3605 100644 --- a/openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_mPass.h +++ b/openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_mPass.h @@ -34,6 +34,26 @@ #include #include "nrLDPC_defs.h" +/** + \brief Circular memcpy + (src) str2 = |xxxxxxxxxxxxxxxxxxxx\--------| + \ + (dst) str1 = |--------xxxxxxxxxxxxxxxxxxxxx| + \param str1 Pointer to the start of the destination buffer + \param str2 Pointer to the source buffer + \param Z Lifting size + \param cshift Cyclic shift +*/ +static inline void *nrLDPC_circ_memcpy(int8_t *str1, const int8_t *str2, uint16_t Z, uint16_t cshift) +{ + uint16_t rem = Z - cshift; + memcpy(str1+cshift, str2 , rem); + memcpy(str1 , str2+rem, cshift); + + //mexPrintf("memcpy(%p,%p,%d) | memcpy(%p,%p,%d) | rem = %d, cshift = %d\n", str1+cshift, str2, rem, str1,str2+rem,cshift,rem,cshift); + return(str1); +} + /** \brief Copies the input LLRs to their corresponding place in the LLR processing buffer. \param p_lut Pointer to decoder LUTs @@ -275,14 +295,21 @@ static inline void nrLDPC_cn2bnProcBuf_BG1(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf M = lut_numCnInCnGroups[0]*Z; bitOffsetInGroup = lut_numCnInCnGroups_BG1_R13[0]*NR_LDPC_ZMAX; + const uint32_t startAddrBnProcBuf_CNG3[3] = {111360, 100224, 0}; + const uint16_t cyclicShiftValues_Z384_CNG3[3] = {332, 181, 0}; + for (j=0; j<3; j++) { p_cnProcBufRes = &cnProcBufRes[lut_startAddrCnGroups[0] + j*bitOffsetInGroup]; + /* for (i=0; i