Lines Matching defs:pHcr

126 static void HcrCalcNumCodeword(H_HCR_INFO pHcr);
127 static void HcrSortCodebookAndNumCodewordInSection(H_HCR_INFO pHcr);
128 static void HcrPrepareSegmentationGrid(H_HCR_INFO pHcr);
129 static void HcrExtendedSectionInfo(H_HCR_INFO pHcr);
154 static void DecodePCWs(HANDLE_FDK_BITSTREAM bs, H_HCR_INFO pHcr);
157 H_HCR_INFO pHcr, CAacDecoderChannelInfo *pAacDecoderChannelInfo,
161 H_HCR_INFO pHcr, PCW_TYPE kind,
165 static void errDetectWithinSegmentationFinal(H_HCR_INFO pHcr);
264 UINT HcrInit(H_HCR_INFO pHcr, CAacDecoderChannelInfo *pAacDecoderChannelInfo,
275 pHcr->decInOut.lengthOfReorderedSpectralData =
278 pHcr->decInOut.lengthOfLongestCodeword =
280 pHcr->decInOut.pQuantizedSpectralCoefficientsBase =
282 pHcr->decInOut.quantizedSpectralCoefficientsIdx = 0;
283 pHcr->decInOut.pCodebook =
285 pHcr->decInOut.pNumLineInSect =
287 pHcr->decInOut.numSection =
289 pHcr->decInOut.errorLog = 0;
290 pHcr->nonPcwSideinfo.pResultBase =
294 pHcr->decInOut.bitstreamIndex = FDKgetBitCnt(bs);
313 pNumLinesInSec = pHcr->decInOut.pNumLineInSect; /* out */
314 pCodeBk = pHcr->decInOut.pCodebook; /* out */
344 &pHcr->decInOut.errorLog);
345 if (pHcr->decInOut.errorLog != 0) {
346 return (pHcr->decInOut.errorLog);
364 errDetectorInHcrSideinfoShrt(cb, numLine, &pHcr->decInOut.errorLog);
366 pHcr->decInOut.errorLog |= NUM_SECT_OUT_OF_RANGE_SHORT_BLOCK;
368 errDetectorInHcrLengths(pHcr->decInOut.lengthOfLongestCodeword,
369 pHcr->decInOut.lengthOfReorderedSpectralData,
370 &pHcr->decInOut.errorLog);
371 if (pHcr->decInOut.errorLog != 0) {
372 return (pHcr->decInOut.errorLog);
377 pHcr->decInOut.numSection = numSection;
381 errDetectorInHcrLengths(pHcr->decInOut.lengthOfLongestCodeword,
382 pHcr->decInOut.lengthOfReorderedSpectralData,
383 &pHcr->decInOut.errorLog);
384 numSection = pHcr->decInOut.numSection;
385 pNumLinesInSec = pHcr->decInOut.pNumLineInSect;
386 pCodeBk = pHcr->decInOut.pCodebook;
388 pHcr->decInOut.errorLog |= NUM_SECT_OUT_OF_RANGE_LONG_BLOCK;
396 pHcr->decInOut.errorLog |= CB_OUT_OF_RANGE_LONG_BLOCK;
403 pHcr->decInOut.errorLog |= LINE_IN_SECT_OUT_OF_RANGE_LONG_BLOCK;
406 if (pHcr->decInOut.errorLog != 0) {
407 return (pHcr->decInOut.errorLog);
411 pCodeBk = pHcr->decInOut.pCodebook;
422 return (pHcr->decInOut.errorLog);
432 UINT HcrDecoder(H_HCR_INFO pHcr, CAacDecoderChannelInfo *pAacDecoderChannelInfo,
441 HcrCalcNumCodeword(pHcr);
443 HcrSortCodebookAndNumCodewordInSection(pHcr);
445 HcrPrepareSegmentationGrid(pHcr);
447 HcrExtendedSectionInfo(pHcr);
449 if ((pHcr->decInOut.errorLog & HCR_FATAL_PCW_ERROR_MASK) != 0) {
450 return (pHcr->decInOut.errorLog); /* sideinfo is massively corrupt, return
456 pHcr->segmentInfo.numSegment,
457 pHcr->sectionInfo.pNumExtendedSortedCodewordInSection,
458 pHcr->sectionInfo.numExtendedSortedCodewordInSectionIdx,
459 pHcr->sectionInfo.pNumExtendedSortedSectionsInSets,
460 pHcr->sectionInfo.numExtendedSortedSectionsInSetsIdx);
463 pTmp1 = pHcr->sectionInfo.numExtendedSortedCodewordInSectionIdx;
464 pTmp2 = pHcr->sectionInfo.extendedSortedCodebookIdx;
465 pTmp3 = pHcr->sectionInfo.numExtendedSortedSectionsInSetsIdx;
466 pTmp4 = pHcr->decInOut.quantizedSpectralCoefficientsIdx;
467 pTmp5 = pHcr->sectionInfo.maxLenOfCbInExtSrtSecIdx;
470 DecodePCWs(bs, pHcr);
472 if ((pHcr->decInOut.errorLog & HCR_FATAL_PCW_ERROR_MASK) == 0) {
474 DecodeNonPCWs(bs, pHcr);
477 errDetectWithinSegmentationFinal(pHcr);
480 pHcr->sectionInfo.numExtendedSortedCodewordInSectionIdx = pTmp1;
481 pHcr->sectionInfo.extendedSortedCodebookIdx = pTmp2;
482 pHcr->sectionInfo.numExtendedSortedSectionsInSetsIdx = pTmp3;
483 pHcr->decInOut.quantizedSpectralCoefficientsIdx = pTmp4;
484 pHcr->sectionInfo.maxLenOfCbInExtSrtSecIdx = pTmp5;
486 HcrReorderQuantizedSpectralCoefficients(pHcr, pAacDecoderChannelInfo,
495 return (pHcr->decInOut.errorLog);
510 H_HCR_INFO pHcr, CAacDecoderChannelInfo *pAacDecoderChannelInfo,
519 UINT numSection = pHcr->decInOut.numSection;
521 pHcr->decInOut.pQuantizedSpectralCoefficientsBase;
523 SPEC_LONG(pHcr->decInOut.pQuantizedSpectralCoefficientsBase);
526 UCHAR *pSortedCodebook = pHcr->sectionInfo.pSortedCodebook;
528 pHcr->sectionInfo.pNumSortedCodewordInSection;
529 USHORT *pReorderOffset = pHcr->sectionInfo.pReorderOffset;
649 pHcr->decInOut.errorLog |= LAV_VIOLATION;
668 static void HcrCalcNumCodeword(H_HCR_INFO pHcr) {
672 UINT numSection = pHcr->decInOut.numSection;
673 UCHAR *pCodebook = pHcr->decInOut.pCodebook;
674 SHORT *pNumLineInSection = pHcr->decInOut.pNumLineInSect;
677 USHORT *pNumCodewordInSection = pHcr->sectionInfo.pNumCodewordInSection;
688 pHcr->sectionInfo.numCodeword = numCodeword;
698 static void HcrSortCodebookAndNumCodewordInSection(H_HCR_INFO pHcr) {
707 UINT numSection = pHcr->decInOut.numSection;
708 UCHAR *pCodebook = pHcr->decInOut.pCodebook;
709 UCHAR *pSortedCodebook = pHcr->sectionInfo.pSortedCodebook;
710 USHORT *pNumCodewordInSection = pHcr->sectionInfo.pNumCodewordInSection;
712 pHcr->sectionInfo.pNumSortedCodewordInSection;
713 UCHAR *pCodebookSwitch = pHcr->sectionInfo.pCodebookSwitch;
714 USHORT *pReorderOffset = pHcr->sectionInfo.pReorderOffset;
732 pHcr->sectionInfo.numSortedSection =
735 pCodebook = pHcr->decInOut.pCodebook;
758 pCodebookSwitch = pHcr->sectionInfo.pCodebookSwitch;
798 static void HcrPrepareSegmentationGrid(H_HCR_INFO pHcr) {
808 SCHAR lengthOfLongestCodeword = pHcr->decInOut.lengthOfLongestCodeword;
810 pHcr->decInOut.lengthOfReorderedSpectralData;
811 UINT numSortedSection = pHcr->sectionInfo.numSortedSection;
812 UCHAR *pSortedCodebook = pHcr->sectionInfo.pSortedCodebook;
814 pHcr->sectionInfo.pNumSortedCodewordInSection;
815 INT *pLeftStartOfSegment = pHcr->segmentInfo.pLeftStartOfSegment;
816 INT *pRightStartOfSegment = pHcr->segmentInfo.pRightStartOfSegment;
817 SCHAR *pRemainingBitsInSegment = pHcr->segmentInfo.pRemainingBitsInSegment;
818 INT bitstreamIndex = pHcr->decInOut.bitstreamIndex;
859 pHcr->segmentInfo.numSegment = numSegment;
873 static void HcrExtendedSectionInfo(H_HCR_INFO pHcr) {
879 UINT numSortedSection = pHcr->sectionInfo.numSortedSection;
880 UCHAR *pSortedCodebook = pHcr->sectionInfo.pSortedCodebook;
882 pHcr->sectionInfo.pNumSortedCodewordInSection;
883 UCHAR *pExtendedSortedCoBo = pHcr->sectionInfo.pExtendedSortedCodebook;
885 pHcr->sectionInfo.pNumExtendedSortedCodewordInSection;
886 UINT numSegment = pHcr->segmentInfo.numSegment;
887 UCHAR *pMaxLenOfCbInExtSrtSec = pHcr->sectionInfo.pMaxLenOfCbInExtSrtSec;
888 SCHAR lengthOfLongestCodeword = pHcr->decInOut.lengthOfLongestCodeword;
927 pHcr->decInOut.errorLog |= EXTENDED_SORTED_COUNTER_OVERFLOW;
998 static void DecodePCWs(HANDLE_FDK_BITSTREAM bs, H_HCR_INFO pHcr) {
1009 pHcr->sectionInfo.pNumExtendedSortedCodewordInSection;
1011 pHcr->sectionInfo.numExtendedSortedCodewordInSectionIdx;
1012 UCHAR *pExtendedSortedCodebook = pHcr->sectionInfo.pExtendedSortedCodebook;
1013 int extendedSortedCodebookIdx = pHcr->sectionInfo.extendedSortedCodebookIdx;
1015 pHcr->sectionInfo.pNumExtendedSortedSectionsInSets;
1017 pHcr->sectionInfo.numExtendedSortedSectionsInSetsIdx;
1019 SPEC_LONG(pHcr->decInOut.pQuantizedSpectralCoefficientsBase);
1021 pHcr->decInOut.quantizedSpectralCoefficientsIdx;
1022 INT *pLeftStartOfSegment = pHcr->segmentInfo.pLeftStartOfSegment;
1023 SCHAR *pRemainingBitsInSegment = pHcr->segmentInfo.pRemainingBitsInSegment;
1024 UCHAR *pMaxLenOfCbInExtSrtSec = pHcr->sectionInfo.pMaxLenOfCbInExtSrtSec;
1025 int maxLenOfCbInExtSrtSecIdx = pHcr->sectionInfo.maxLenOfCbInExtSrtSecIdx;
1092 pHcr->decInOut.errorLog |= TOO_MANY_PCW_BODY_BITS_DECODED;
1096 *pRemainingBitsInSegment - ERROR_PCW_BODY, pHcr, PCW_BODY,
1132 pHcr->decInOut.errorLog |= TOO_MANY_PCW_BODY_SIGN_BITS_DECODED;
1136 *pRemainingBitsInSegment - ERROR_PCW_BODY_SIGN, pHcr,
1211 pHcr->decInOut.errorLog |= TOO_MANY_PCW_BODY_SIGN_ESC_BITS_DECODED;
1215 *pRemainingBitsInSegment - ERROR_PCW_BODY_SIGN_ESC, pHcr,
1242 pHcr->sectionInfo.numExtendedSortedCodewordInSectionIdx =
1244 pHcr->sectionInfo.extendedSortedCodebookIdx = extendedSortedCodebookIdx;
1245 pHcr->sectionInfo.numExtendedSortedSectionsInSetsIdx =
1247 pHcr->decInOut.quantizedSpectralCoefficientsIdx =
1249 pHcr->sectionInfo.maxLenOfCbInExtSrtSecIdx = maxLenOfCbInExtSrtSecIdx;
1262 H_HCR_INFO pHcr, PCW_TYPE kind,
1270 pHcr->decInOut.errorLog |= SEGMENT_OVERRIDE_ERR_PCW_BODY;
1273 pHcr->decInOut.errorLog |= SEGMENT_OVERRIDE_ERR_PCW_BODY_SIGN;
1276 pHcr->decInOut.errorLog |= SEGMENT_OVERRIDE_ERR_PCW_BODY_SIGN_ESC;
1294 static void errDetectWithinSegmentationFinal(H_HCR_INFO pHcr) {
1297 SCHAR *pRemainingBitsInSegment = pHcr->segmentInfo.pRemainingBitsInSegment;
1298 UINT numSegment = pHcr->segmentInfo.numSegment;
1306 pHcr->decInOut.errorLog |= BIT_IN_SEGMENTATION_ERROR;