Lines Matching refs:hCrcInfo
223 static void crcCalc(HANDLE_FDK_CRCINFO hCrcInfo, HANDLE_FDK_BITSTREAM hBs,
228 void FDKcrcInit(HANDLE_FDK_CRCINFO hCrcInfo, const UINT crcPoly, in FDKcrcInit() argument
236 hCrcInfo->crcLen = crcLen; in FDKcrcInit()
237 hCrcInfo->crcPoly = crcPoly; in FDKcrcInit()
238 hCrcInfo->startValue = crcStartValue; in FDKcrcInit()
239 hCrcInfo->crcMask = (crcLen) ? (1 << (crcLen - 1)) : 0; in FDKcrcInit()
241 FDKcrcReset(hCrcInfo); in FDKcrcInit()
243 hCrcInfo->pCrcLookup = in FDKcrcInit()
246 if (hCrcInfo->crcLen == 16) { in FDKcrcInit()
249 hCrcInfo->pCrcLookup = crcLookup_16_15_5_0; in FDKcrcInit()
252 hCrcInfo->pCrcLookup = crcLookup_16_15_2_0; in FDKcrcInit()
255 hCrcInfo->pCrcLookup = crcLookup_16_12_5_0; in FDKcrcInit()
265 void FDKcrcReset(HANDLE_FDK_CRCINFO hCrcInfo) { in FDKcrcReset() argument
268 hCrcInfo->crcValue = hCrcInfo->startValue; in FDKcrcReset()
271 hCrcInfo->crcRegData[i].isActive = 0; in FDKcrcReset()
273 hCrcInfo->regStart = 0; in FDKcrcReset()
274 hCrcInfo->regStop = 0; in FDKcrcReset()
277 INT FDKcrcStartReg(HANDLE_FDK_CRCINFO hCrcInfo, const HANDLE_FDK_BITSTREAM hBs, in FDKcrcStartReg() argument
279 int reg = hCrcInfo->regStart; in FDKcrcStartReg()
281 FDK_ASSERT(hCrcInfo->crcRegData[reg].isActive == 0); in FDKcrcStartReg()
282 hCrcInfo->crcRegData[reg].isActive = 1; in FDKcrcStartReg()
283 hCrcInfo->crcRegData[reg].maxBits = mBits; in FDKcrcStartReg()
284 hCrcInfo->crcRegData[reg].validBits = (INT)FDKgetValidBits(hBs); in FDKcrcStartReg()
285 hCrcInfo->crcRegData[reg].bitBufCntBits = 0; in FDKcrcStartReg()
287 hCrcInfo->regStart = (hCrcInfo->regStart + 1) % MAX_CRC_REGS; in FDKcrcStartReg()
292 INT FDKcrcEndReg(HANDLE_FDK_CRCINFO hCrcInfo, const HANDLE_FDK_BITSTREAM hBs, in FDKcrcEndReg() argument
294 FDK_ASSERT((reg == (INT)hCrcInfo->regStop) && in FDKcrcEndReg()
295 (hCrcInfo->crcRegData[reg].isActive == 1)); in FDKcrcEndReg()
298 hCrcInfo->crcRegData[reg].bitBufCntBits = in FDKcrcEndReg()
299 (INT)FDKgetValidBits(hBs) - hCrcInfo->crcRegData[reg].validBits; in FDKcrcEndReg()
301 hCrcInfo->crcRegData[reg].bitBufCntBits = in FDKcrcEndReg()
302 hCrcInfo->crcRegData[reg].validBits - (INT)FDKgetValidBits(hBs); in FDKcrcEndReg()
305 if (hCrcInfo->crcRegData[reg].maxBits == 0) { in FDKcrcEndReg()
306 hCrcInfo->crcRegData[reg].maxBits = hCrcInfo->crcRegData[reg].bitBufCntBits; in FDKcrcEndReg()
309 crcCalc(hCrcInfo, hBs, reg); in FDKcrcEndReg()
311 hCrcInfo->crcRegData[reg].isActive = 0; in FDKcrcEndReg()
312 hCrcInfo->regStop = (hCrcInfo->regStop + 1) % MAX_CRC_REGS; in FDKcrcEndReg()
317 USHORT FDKcrcGetCRC(const HANDLE_FDK_CRCINFO hCrcInfo) { in FDKcrcGetCRC() argument
318 return (hCrcInfo->crcValue & (((hCrcInfo->crcMask - 1) << 1) + 1)); in FDKcrcGetCRC()
426 static void crcCalc(HANDLE_FDK_CRCINFO hCrcInfo, HANDLE_FDK_BITSTREAM hBs, in crcCalc() argument
428 USHORT crc = hCrcInfo->crcValue; in crcCalc()
429 CCrcRegData *rD = &hCrcInfo->crcRegData[reg]; in crcCalc()
453 if (hCrcInfo->pCrcLookup) { in crcCalc()
454 rBits -= (calcCrc_Bytes(&crc, hCrcInfo->pCrcLookup, &bsReader, words) << 3); in crcCalc()
456 rBits -= calcCrc_Bits(&crc, hCrcInfo->crcMask, hCrcInfo->crcPoly, &bsReader, in crcCalc()
462 rBits -= calcCrc_Bits(&crc, hCrcInfo->crcMask, hCrcInfo->crcPoly, &bsReader, in crcCalc()
468 if ((hCrcInfo->pCrcLookup) && (rBits > 8)) { in crcCalc()
470 (calcCrc_Bytes(&crc, hCrcInfo->pCrcLookup, NULL, rBits >> 3) << 3); in crcCalc()
474 calcCrc_Bits(&crc, hCrcInfo->crcMask, hCrcInfo->crcPoly, NULL, rBits); in crcCalc()
478 hCrcInfo->crcValue = crc; in crcCalc()