Home | History | Annotate | Download | only in src

Lines Matching refs:pHcr

117 static void HcrCalcNumCodeword                    (H_HCR_INFO pHcr);
118 static void HcrSortCodebookAndNumCodewordInSection(H_HCR_INFO pHcr);
119 static void HcrPrepareSegmentationGrid (H_HCR_INFO pHcr);
120 static void HcrExtendedSectionInfo (H_HCR_INFO pHcr);
153 static void DecodePCWs(HANDLE_FDK_BITSTREAM bs, H_HCR_INFO pHcr);
156 H_HCR_INFO pHcr,
164 H_HCR_INFO pHcr,
171 static void errDetectWithinSegmentationFinal(H_HCR_INFO pHcr);
259 void HcrInitRom(H_HCR_INFO pHcr)
261 pHcr->cbPairs.pMinOfCbPair = aMinOfCbPair;
262 pHcr->cbPairs.pMaxOfCbPair = aMaxOfCbPair;
264 pHcr->tableInfo.pMaxCwLength = aMaxCwLen;
265 pHcr->tableInfo.pCbDimension = aDimCb;
266 pHcr->tableInfo.pCbDimShift = aDimCbShift;
267 pHcr->tableInfo.pCbSign = aSignCb;
268 pHcr->tableInfo.pCbPriority = aCbPriority;
269 pHcr->tableInfo.pLargestAbsVal = aLargestAbsoluteValue;
280 UINT HcrInit(H_HCR_INFO pHcr,
293 pHcr->decInOut.lengthOfReorderedSpectralData = pAacDecoderChannelInfo->pDynData->specificTo.aac.lenOfReorderedSpectralData;
294 pHcr->decInOut.lengthOfLongestCodeword = pAacDecoderChannelInfo->pDynData->specificTo.aac.lenOfLongestCodeword;
295 pHcr->decInOut.pQuantizedSpectralCoefficientsBase = pAacDecoderChannelInfo->pSpectralCoefficient;
296 pHcr->decInOut.quantizedSpectralCoefficientsIdx = 0;
297 pHcr->decInOut.pCodebook = pAacDecoderChannelInfo->pDynData->specificTo.aac.aCodeBooks4Hcr;
298 pHcr->decInOut.pNumLineInSect = pAacDecoderChannelInfo->pDynData->specificTo.aac.aNumLineInSec4Hcr;
299 pHcr->decInOut.numSection = pAacDecoderChannelInfo->pDynData->specificTo.aac.numberSection;
300 pHcr->decInOut.errorLog = 0;
301 pHcr->nonPcwSideinfo.pResultBase = SPEC_LONG(pAacDecoderChannelInfo->pSpectralCoefficient);
304 pHcr->decInOut.bitstreamIndex = FDKgetBitCnt(bs);
324 pNumLinesInSec = pHcr->decInOut.pNumLineInSect; /* out */
325 pCodeBk = pHcr->decInOut.pCodebook; /* out */
348 errDetectorInHcrSideinfoShrt(cb,numLine,&pHcr->decInOut.errorLog );
349 if (pHcr->decInOut.errorLog != 0 ) {
350 return ( pHcr->decInOut.errorLog );
371 errDetectorInHcrSideinfoShrt(cb,numLine,&pHcr->decInOut.errorLog );
373 pHcr->decInOut.errorLog |= NUM_SECT_OUT_OF_RANGE_SHORT_BLOCK;
375 errDetectorInHcrLengths(pHcr->decInOut.lengthOfLongestCodeword,
376 pHcr->decInOut.lengthOfReorderedSpectralData,
377 &pHcr->decInOut.errorLog);
378 if (pHcr->decInOut.errorLog != 0 ) {
379 return ( pHcr->decInOut.errorLog );
385 pHcr->decInOut.numSection = numSection;
390 errDetectorInHcrLengths(pHcr->decInOut.lengthOfLongestCodeword,
391 pHcr->decInOut.lengthOfReorderedSpectralData,
392 &pHcr->decInOut.errorLog);
393 numSection = pHcr->decInOut.numSection;
394 pNumLinesInSec = pHcr->decInOut.pNumLineInSect;
395 pCodeBk = pHcr->decInOut.pCodebook;
397 pHcr->decInOut.errorLog |= NUM_SECT_OUT_OF_RANGE_LONG_BLOCK;
406 pHcr->decInOut.errorLog |= CB_OUT_OF_RANGE_LONG_BLOCK;
413 pHcr->decInOut.errorLog |= LINE_IN_SECT_OUT_OF_RANGE_LONG_BLOCK;
416 if (pHcr->decInOut.errorLog != 0 ) {
417 return ( pHcr->decInOut.errorLog );
422 pCodeBk = pHcr->decInOut.pCodebook;
438 return ( pHcr->decInOut.errorLog );
451 UINT HcrDecoder(H_HCR_INFO pHcr,
456 pHcr->decInOut.pQuantizedSpectralCoefficients->Long[i] = FL2FXCONST_DBL(0.0f);
458 pHcr->decInOut.pQuantizedSpectralCoefficients->Long[i] = (FIXP_DBL)HCR_DIRAC;
472 UINT HcrDecoder(H_HCR_INFO pHcr,
485 HcrCalcNumCodeword(pHcr);
487 HcrSortCodebookAndNumCodewordInSection(pHcr);
489 HcrPrepareSegmentationGrid(pHcr);
491 HcrExtendedSectionInfo(pHcr);
493 if (( pHcr->decInOut.errorLog & HCR_FATAL_PCW_ERROR_MASK ) != 0 ) {
494 return ( pHcr->decInOut.errorLog ); /* sideinfo is massively corrupt, return from HCR without having decoded anything */
497 DeriveNumberOfExtendedSortedSectionsInSets(pHcr->segmentInfo.numSegment,
498 pHcr->sectionInfo.pNumExtendedSortedCodewordInSection,
499 pHcr->sectionInfo.numExtendedSortedCodewordInSectionIdx,
500 pHcr->sectionInfo.pNumExtendedSortedSectionsInSets,
501 pHcr->sectionInfo.numExtendedSortedSectionsInSetsIdx);
504 pTmp1 = pHcr->sectionInfo.numExtendedSortedCodewordInSectionIdx;
505 pTmp2 = pHcr->sectionInfo.extendedSortedCodebookIdx;
506 pTmp3 = pHcr->sectionInfo.numExtendedSortedSectionsInSetsIdx;
507 pTmp4 = pHcr->decInOut.quantizedSpectralCoefficientsIdx;
509 pTmp5 = pHcr->sectionInfo.maxLenOfCbInExtSrtSecIdx;
513 DecodePCWs(bs, pHcr);
515 if (( pHcr->decInOut.errorLog & HCR_FATAL_PCW_ERROR_MASK ) == 0 ) {
517 DecodeNonPCWs(bs, pHcr);
522 errDetectWithinSegmentationFinal(pHcr);
526 pHcr->sectionInfo.numExtendedSortedCodewordInSectionIdx = pTmp1;
527 pHcr->sectionInfo.extendedSortedCodebookIdx = pTmp2;
528 pHcr->sectionInfo.numExtendedSortedSectionsInSetsIdx = pTmp3;
529 pHcr->decInOut.quantizedSpectralCoefficientsIdx = pTmp4;
531 pHcr->sectionInfo.maxLenOfCbInExtSrtSecIdx = pTmp5;
534 HcrReorderQuantizedSpectralCoefficients(pHcr, pAacDecoderChannelInfo, pSamplingRateInfo);
542 return ( pHcr->decInOut.errorLog );
562 H_HCR_INFO pHcr, CAacDecoderChannelInfo *pAacDecoderChannelInfo,
573 UINT numSection = pHcr->decInOut.numSection;
574 SPECTRAL_PTR pQuantizedSpectralCoefficientsBase = pHcr->decInOut.pQuantizedSpectralCoefficientsBase;
575 FIXP_DBL *pQuantizedSpectralCoefficients = SPEC_LONG(pHcr->decInOut.pQuantizedSpectralCoefficientsBase);
576 const UCHAR *pCbDimShift = pHcr->tableInfo.pCbDimShift;
577 const USHORT *pLargestAbsVal = pHcr->tableInfo.pLargestAbsVal;
578 UCHAR *pSortedCodebook = pHcr->sectionInfo.pSortedCodebook;
579 USHORT *pNumSortedCodewordInSection = pHcr->sectionInfo.pNumSortedCodewordInSection;
580 USHORT *pReorderOffset = pHcr->sectionInfo.pReorderOffset;
581 FIXP_DBL *pTempValues = pHcr->segmentInfo.pTempValues;
582 FIXP_DBL *pBak = pHcr->segmentInfo.pTempValues;
641 pBak = pHcr->segmentInfo.pTempValues;
695 pHcr->decInOut.errorLog |= LAV_VIOLATION;
716 static void HcrCalcNumCodeword(H_HCR_INFO pHcr)
721 UINT numSection = pHcr->decInOut.numSection;
722 UCHAR *pCodebook = pHcr->decInOut.pCodebook;
723 SHORT *pNumLineInSection = pHcr->decInOut.pNumLineInSect;
724 const UCHAR *pCbDimShift = pHcr->tableInfo.pCbDimShift;
725 USHORT *pNumCodewordInSection = pHcr->sectionInfo.pNumCodewordInSection;
736 pHcr->sectionInfo.numCodeword = numCodeword;
746 static void HcrSortCodebookAndNumCodewordInSection(H_HCR_INFO pHcr)
757 UINT numSection = pHcr->decInOut.numSection;
758 UCHAR *pCodebook = pHcr->decInOut.pCodebook;
759 UCHAR *pSortedCodebook = pHcr->sectionInfo.pSortedCodebook;
760 USHORT *pNumCodewordInSection = pHcr->sectionInfo.pNumCodewordInSection;
761 USHORT *pNumSortedCodewordInSection = pHcr->sectionInfo.pNumSortedCodewordInSection;
762 UCHAR *pCodebookSwitch = pHcr->sectionInfo.pCodebookSwitch;
763 USHORT *pReorderOffset = pHcr->sectionInfo.pReorderOffset;
764 const UCHAR *pCbPriority = pHcr->tableInfo.pCbPriority;
765 const UCHAR *pMinOfCbPair = pHcr->cbPairs.pMinOfCbPair;
766 pHcr->cbPairs.pMaxOfCbPair;
767 const UCHAR *pCbDimShift = pHcr->tableInfo.pCbDimShift;
780 pHcr->sectionInfo.numSortedSection = numSection - numZeroSection; /* numSortedSection contains no zero or intensity section */
781 pCodebook = pHcr->decInOut.pCodebook;
804 pCodebookSwitch = pHcr->sectionInfo.pCodebookSwitch;
838 static void HcrPrepareSegmentationGrid(H_HCR_INFO pHcr)
849 SCHAR lengthOfLongestCodeword = pHcr->decInOut.lengthOfLongestCodeword;
850 SHORT lengthOfReorderedSpectralData = pHcr->decInOut.lengthOfReorderedSpectralData;
851 UINT numSortedSection = pHcr->sectionInfo.numSortedSection;
852 UCHAR *pSortedCodebook = pHcr->sectionInfo.pSortedCodebook;
853 USHORT *pNumSortedCodewordInSection = pHcr->sectionInfo.pNumSortedCodewordInSection;
854 USHORT *pLeftStartOfSegment = pHcr->segmentInfo.pLeftStartOfSegment;
855 USHORT *pRightStartOfSegment = pHcr->segmentInfo.pRightStartOfSegment;
856 SCHAR *pRemainingBitsInSegment = pHcr->segmentInfo.pRemainingBitsInSegment;
857 USHORT bitstreamIndex = pHcr->decInOut.bitstreamIndex;
858 const UCHAR *pMaxCwLength = pHcr->tableInfo.pMaxCwLength;
895 pHcr->segmentInfo.numSegment = numSegment;
909 static void HcrExtendedSectionInfo(H_HCR_INFO pHcr)
916 UINT numSortedSection = pHcr->sectionInfo.numSortedSection;
917 UCHAR *pSortedCodebook = pHcr->sectionInfo.pSortedCodebook;
918 USHORT *pNumSortedCodewordInSection = pHcr->sectionInfo.pNumSortedCodewordInSection;
919 UCHAR *pExtendedSortedCoBo = pHcr->sectionInfo.pExtendedSortedCodebook;
920 USHORT *pNumExtSortCwInSect = pHcr->sectionInfo.pNumExtendedSortedCodewordInSection;
921 UINT numSegment = pHcr->segmentInfo.numSegment;
923 UCHAR *pMaxLenOfCbInExtSrtSec = pHcr->sectionInfo.pMaxLenOfCbInExtSrtSec;
924 SCHAR lengthOfLongestCodeword = pHcr->decInOut.lengthOfLongestCodeword;
925 const UCHAR *pMaxCwLength = pHcr->tableInfo.pMaxCwLength;
969 pHcr->decInOut.errorLog |= EXTENDED_SORTED_COUNTER_OVERFLOW;
1044 static void DecodePCWs(HANDLE_FDK_BITSTREAM bs, H_HCR_INFO pHcr)
1055 USHORT *pNumExtendedSortedCodewordInSection = pHcr->sectionInfo.pNumExtendedSortedCodewordInSection;
1056 int numExtendedSortedCodewordInSectionIdx = pHcr->sectionInfo.numExtendedSortedCodewordInSectionIdx;
1057 UCHAR *pExtendedSortedCodebook = pHcr->sectionInfo.pExtendedSortedCodebook;
1058 int extendedSortedCodebookIdx = pHcr->sectionInfo.extendedSortedCodebookIdx;
1059 USHORT *pNumExtendedSortedSectionsInSets = pHcr->sectionInfo.pNumExtendedSortedSectionsInSets;
1060 int numExtendedSortedSectionsInSetsIdx = pHcr->sectionInfo.numExtendedSortedSectionsInSetsIdx;
1061 FIXP_DBL *pQuantizedSpectralCoefficients = SPEC_LONG(pHcr->decInOut.pQuantizedSpectralCoefficientsBase);
1062 int quantizedSpectralCoefficientsIdx = pHcr->decInOut.quantizedSpectralCoefficientsIdx;
1063 USHORT *pLeftStartOfSegment = pHcr->segmentInfo.pLeftStartOfSegment;
1064 SCHAR *pRemainingBitsInSegment = pHcr->segmentInfo.pRemainingBitsInSegment;
1066 UCHAR *pMaxLenOfCbInExtSrtSec = pHcr->sectionInfo.pMaxLenOfCbInExtSrtSec;
1067 int maxLenOfCbInExtSrtSecIdx = pHcr->sectionInfo.maxLenOfCbInExtSrtSecIdx;
1071 const UCHAR *pCbDimension = pHcr->tableInfo.pCbDimension;
1072 const UCHAR *pCbSign = pHcr->tableInfo.pCbSign;
1129 pHcr->decInOut.errorLog |= TOO_MANY_PCW_BODY_BITS_DECODED;
1134 if (1 == errDetectPcwSegmentation(*pRemainingBitsInSegment-ERROR_PCW_BODY,pHcr,PCW_BODY,pQuantizedSpectralCoefficients+quantizedSpectralCoefficientsIdx-dimension,dimension)) {
1175 pHcr->decInOut.errorLog |= TOO_MANY_PCW_BODY_SIGN_BITS_DECODED;
1180 if (1 == errDetectPcwSegmentation(*pRemainingBitsInSegment-ERROR_PCW_BODY_SIGN,pHcr,PCW_BODY_SIGN, pQuantizedSpectralCoefficients+quantizedSpectralCoefficientsIdx-dimension,dimension)) {
1252 pHcr->decInOut.errorLog |= TOO_MANY_PCW_BODY_SIGN_ESC_BITS_DECODED;
1257 if (1 == errDetectPcwSegmentation(*pRemainingBitsInSegment-ERROR_PCW_BODY_SIGN_ESC,pHcr,PCW_BODY_SIGN_ESC,pQuantizedSpectralCoefficients+quantizedSpectralCoefficientsIdx-DIMENSION_OF_ESCAPE_CODEBOOK,DIMENSION_OF_ESCAPE_CODEBOOK)) {
1280 pHcr->sectionInfo.numExtendedSortedCodewordInSectionIdx = numExtendedSortedCodewordInSectionIdx;
1281 pHcr->sectionInfo.extendedSortedCodebookIdx = extendedSortedCodebookIdx;
1282 pHcr->sectionInfo.numExtendedSortedSectionsInSetsIdx = numExtendedSortedSectionsInSetsIdx;
1283 pHcr->decInOut.quantizedSpectralCoefficientsIdx = quantizedSpectralCoefficientsIdx;
1284 pHcr->sectionInfo.maxLenOfCbInExtSrtSecIdx = maxLenOfCbInExtSrtSecIdx;
1297 H_HCR_INFO pHcr,
1307 pHcr->decInOut.errorLog |= SEGMENT_OVERRIDE_ERR_PCW_BODY;
1310 pHcr->decInOut.errorLog |= SEGMENT_OVERRIDE_ERR_PCW_BODY_SIGN;
1313 pHcr->decInOut.errorLog |= SEGMENT_OVERRIDE_ERR_PCW_BODY_SIGN_ESC;
1332 static void errDetectWithinSegmentationFinal(H_HCR_INFO pHcr)
1336 SCHAR *pRemainingBitsInSegment = pHcr->segmentInfo.pRemainingBitsInSegment;
1337 UINT numSegment = pHcr->segmentInfo.numSegment;
1345 pHcr->decInOut.errorLog |= BIT_IN_SEGMENTATION_ERROR;