# HG changeset patch # User Mychaela Falconia # Date 1772741490 0 # Node ID e6e9d5104503a93ac0e14fed42e7a8d6cb994000 # Parent ff5857556c4442cc9fb2f0258f1426038660741e libgsmhr1: integrate DTX encoder function lpcCorrQntz() diff -r ff5857556c44 -r e6e9d5104503 libgsmhr1/dtx_enc.c --- a/libgsmhr1/dtx_enc.c Thu Mar 05 19:48:10 2026 +0000 +++ b/libgsmhr1/dtx_enc.c Thu Mar 05 20:11:30 2026 +0000 @@ -22,6 +22,7 @@ #include "dtx_const.h" #include "dtx_enc.h" #include "dtx_rxfe.h" +#include "sp_frm.h" /*________________________________________________________________________ | | @@ -240,7 +241,7 @@ /* Quantize the averaged correlation */ /* --------------------------------- */ - lpcCorrQntz(pL_RefCorr, + lpcCorrQntz(st, pL_RefCorr, pswFinalRc, cn_st->piRefVqCodewds); @@ -455,10 +456,8 @@ * *************************************************************************/ -#if 0 -void lpcCorrQntz(Longword pL_CorrelSeq[], - Shortword pswFinalRc[], - int piVQCodewds[]) +void lpcCorrQntz(struct gsmhr_encoder_state *st, Longword pL_CorrelSeq[], + Shortword pswFinalRc[], int piVQCodewds[]) { /*_________________________________________________________________________ @@ -538,25 +537,25 @@ /* do aflat for all vectors in the list */ /*--------------------------------------*/ - setupPreQ(iSeg, quantList.iRCIndex); /* set up vector ptrs */ + setupPreQ(st, iSeg, quantList.iRCIndex); /* set up vector ptrs */ for (iCnt = 0; iCnt < quantList.iNum; iCnt++) { /* get a vector */ /*--------------*/ - getNextVec(pswRc); + getNextVec(st, pswRc); /* clear the limiter flag */ /*------------------------*/ - iLimit = 0; + st->iLimit = 0; /* find the error values for each vector */ /*---------------------------------------*/ quantList.pswPredErr[iCnt] = - aflatRecursion(&pswRc[psvqIndex[iSeg - 1].l], + aflatRecursion(st, &pswRc[psvqIndex[iSeg - 1].l], pswPBar, pswVBar, ppswPAddrs, ppswVAddrs, psvqIndex[iSeg - 1].len); @@ -564,7 +563,7 @@ /* check the limiter flag */ /*------------------------*/ - if (iLimit) + if (st->iLimit) quantList.pswPredErr[iCnt] = 0x7fff; /* set error to bad value */ } /* done list loop */ @@ -583,7 +582,7 @@ quantList.iNum = psrQuantSz[iSeg - 1]; quantList.iRCIndex = bestPql[iVec].iRCIndex * psrQuantSz[iSeg - 1]; - setupQuant(iSeg, quantList.iRCIndex); /* set up vector ptrs */ + setupQuant(st, iSeg, quantList.iRCIndex); /* set up vector ptrs */ /* do aflat recursion on each element of list */ /*--------------------------------------------*/ @@ -593,18 +592,18 @@ /* get a vector */ /*--------------*/ - getNextVec(pswRc); + getNextVec(st, pswRc); /* clear the limiter flag */ /*------------------------*/ - iLimit = 0; + st->iLimit = 0; /* find the error values for each vector */ /*---------------------------------------*/ quantList.pswPredErr[iCnt] = - aflatRecursion(&pswRc[psvqIndex[iSeg - 1].l], + aflatRecursion(st, &pswRc[psvqIndex[iSeg - 1].l], pswPBar, pswVBar, ppswPAddrs, ppswVAddrs, psvqIndex[iSeg - 1].len); @@ -612,7 +611,7 @@ /* check the limiter flag */ /*------------------------*/ - if (iLimit) + if (st->iLimit) quantList.pswPredErr[iCnt] = 0x7fff; /* set error to the worst * value */ @@ -632,8 +631,8 @@ /* find the quantized reflection coefficients */ /*--------------------------------------------*/ - setupQuant(iSeg, bestQl[iSeg].iRCIndex); /* set up vector ptrs */ - getNextVec((Shortword *) (pswFinalRc - 1)); + setupQuant(st, iSeg, bestQl[iSeg].iRCIndex); /* set up vector ptrs */ + getNextVec(st, (Shortword *) (pswFinalRc - 1)); /* Update pBarFull and vBarFull for the next Rc-VQ segment, and */ @@ -653,4 +652,3 @@ piVQCodewds[iSeg - 1] = bestQl[iSeg].iRCIndex; } -#endif diff -r ff5857556c44 -r e6e9d5104503 libgsmhr1/dtx_enc.h --- a/libgsmhr1/dtx_enc.h Thu Mar 05 19:48:10 2026 +0000 +++ b/libgsmhr1/dtx_enc.h Thu Mar 05 20:11:30 2026 +0000 @@ -21,8 +21,7 @@ Longword *pL_UnqntzdCorr, Longword pL_R0Hist[], Longword ppL_CorrHist[OVERHANG][NP + 1]); -void lpcCorrQntz(Longword pL_CorrelSeq[], - Shortword pswFinalRc[], - int piVQCodewds[]); +void lpcCorrQntz(struct gsmhr_encoder_state *st, Longword pL_CorrelSeq[], + Shortword pswFinalRc[], int piVQCodewds[]); #endif