Changeset 1246 in SHVCSoftware for branches/SHM-dev/source/Lib/TLibDecoder
- Timestamp:
- 14 Jul 2015, 00:26:07 (10 years ago)
- Location:
- branches/SHM-dev/source/Lib/TLibDecoder
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/Lib/TLibDecoder/AnnexBread.h
r1029 r1246 89 89 assert(n <= 4); 90 90 if (m_NumFutureBytes >= n) 91 { 91 92 return false; 93 } 92 94 93 95 n -= m_NumFutureBytes; … … 153 155 uint32_t val = 0; 154 156 for (UInt i = 0; i < n; i++) 157 { 155 158 val = (val << 8) | readByte(); 159 } 156 160 return val; 157 161 } -
branches/SHM-dev/source/Lib/TLibDecoder/SEIread.cpp
r1235 r1246 66 66 { 67 67 READ_CODE(uiLength, ruiCode, pSymbolName); 68 if (pOS) (*pOS) << " " << std::setw(55) << pSymbolName << ": " << ruiCode << "\n"; 68 if (pOS) 69 { 70 (*pOS) << " " << std::setw(55) << pSymbolName << ": " << ruiCode << "\n"; 71 } 69 72 } 70 73 … … 72 75 { 73 76 READ_UVLC(ruiCode, pSymbolName); 74 if (pOS) (*pOS) << " " << std::setw(55) << pSymbolName << ": " << ruiCode << "\n"; 77 if (pOS) 78 { 79 (*pOS) << " " << std::setw(55) << pSymbolName << ": " << ruiCode << "\n"; 80 } 75 81 } 76 82 … … 78 84 { 79 85 READ_SVLC(ruiCode, pSymbolName); 80 if (pOS) (*pOS) << " " << std::setw(55) << pSymbolName << ": " << ruiCode << "\n"; 86 if (pOS) 87 { 88 (*pOS) << " " << std::setw(55) << pSymbolName << ": " << ruiCode << "\n"; 89 } 81 90 } 82 91 … … 84 93 { 85 94 READ_FLAG(ruiCode, pSymbolName); 86 if (pOS) (*pOS) << " " << std::setw(55) << pSymbolName << ": " << (ruiCode?1:0) << "\n"; 95 if (pOS) 96 { 97 (*pOS) << " " << std::setw(55) << pSymbolName << ": " << (ruiCode?1:0) << "\n"; 98 } 87 99 } 88 100 … … 124 136 * in the parsing if bitstream not byte-aligned */ 125 137 assert(!m_pcBitstream->getNumBitsUntilByteAligned()); 126 } while (m_pcBitstream->getNumBitsLeft() > 8); 138 } 139 while (m_pcBitstream->getNumBitsLeft() > 8); 127 140 128 141 UInt rbspTrailingBits; … … 490 503 for (UInt i = 0; i < sei.userDataLength; i++) 491 504 { 492 sei_read_code( pDecodedMessageOutputStream, 8, val, "user_data" );505 sei_read_code( NULL, 8, val, "user_data_payload_byte" ); 493 506 sei.userData[i] = val; 507 } 508 if (pDecodedMessageOutputStream) 509 { 510 (*pDecodedMessageOutputStream) << " User data payload size: " << sei.userDataLength << "\n"; 494 511 } 495 512 } … … 517 534 } 518 535 519 if (pDecodedMessageOutputStream) (*pDecodedMessageOutputStream) << " " << std::setw(55) << traceString << ": " << std::hex << std::setfill('0'); 536 if (pDecodedMessageOutputStream) 537 { 538 (*pDecodedMessageOutputStream) << " " << std::setw(55) << traceString << ": " << std::hex << std::setfill('0'); 539 } 520 540 521 541 sei.m_digest.hash.clear(); … … 524 544 sei_read_code( NULL, 8, val, traceString); 525 545 sei.m_digest.hash.push_back((UChar)val); 526 if (pDecodedMessageOutputStream) (*pDecodedMessageOutputStream) << std::setw(2) << val; 527 } 528 529 if (pDecodedMessageOutputStream) (*pDecodedMessageOutputStream) << std::dec << std::setfill(' ') << "\n"; 546 if (pDecodedMessageOutputStream) 547 { 548 (*pDecodedMessageOutputStream) << std::setw(2) << val; 549 } 550 } 551 552 if (pDecodedMessageOutputStream) 553 { 554 (*pDecodedMessageOutputStream) << std::dec << std::setfill(' ') << "\n"; 555 } 530 556 } 531 557 … … 1106 1132 1107 1133 // read nested SEI messages 1108 do { 1134 do 1135 { 1109 1136 #if O0164_MULTI_LAYER_HRD 1110 1137 #if LAYERS_NOT_PRESENT_SEI … … 1122 1149 } while (m_pcBitstream->getNumBitsLeft() > 8); 1123 1150 1124 if (pDecodedMessageOutputStream) (*pDecodedMessageOutputStream) << "End of scalable nesting SEI message\n"; 1151 if (pDecodedMessageOutputStream) 1152 { 1153 (*pDecodedMessageOutputStream) << "End of scalable nesting SEI message\n"; 1154 } 1125 1155 } 1126 1156 … … 1216 1246 sei_read_flag( pDecodedMessageOutputStream, code, "hours_flag"); currentTimeSet.hoursFlag = code; 1217 1247 if(currentTimeSet.hoursFlag) 1248 { 1218 1249 sei_read_code( pDecodedMessageOutputStream, 5, code, "hours_value"); currentTimeSet.hoursValue = code; 1250 } 1219 1251 } 1220 1252 } -
branches/SHM-dev/source/Lib/TLibDecoder/SyntaxElementParser.cpp
r1042 r1246 63 63 else 64 64 { 65 fprintf( g_hTrace, "%-50s u(%d) : %u\n", pSymbolName, length, rValue ); 65 fprintf( g_hTrace, "%-50s u(%d) : %u\n", pSymbolName, length, rValue ); 66 66 } 67 67 fflush ( g_hTrace ); -
branches/SHM-dev/source/Lib/TLibDecoder/TDecBinCoderCABAC.cpp
r1029 r1246 163 163 #ifdef DEBUG_CABAC_BINS 164 164 if ((g_debugCounter + debugCabacBinWindow) >= debugCabacBinTargetLine) 165 { 165 166 std::cout << g_debugCounter << ": coding bin value " << ruiBin << ", range = [" << startingRange << "->" << m_uiRange << "]\n"; 167 } 166 168 167 169 if (g_debugCounter >= debugCabacBinTargetLine) … … 170 172 breakPointThis = 7; 171 173 } 172 if (g_debugCounter >= (debugCabacBinTargetLine + debugCabacBinWindow)) exit(0); 174 if (g_debugCounter >= (debugCabacBinTargetLine + debugCabacBinWindow)) 175 { 176 exit(0); 177 } 173 178 g_debugCounter++; 174 179 #endif -
branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp
r1237 r1246 1825 1825 READ_FLAG(uiCode, "slice_chroma_qp_adjustment_enabled_flag"); pcSlice->setUseChromaQpAdj(uiCode != 0); 1826 1826 } 1827 else pcSlice->setUseChromaQpAdj(false); 1827 else 1828 { 1829 pcSlice->setUseChromaQpAdj(false); 1830 } 1828 1831 1829 1832 if (pps->getDeblockingFilterControlPresentFlag()) … … 2534 2537 2535 2538 if (sizeId==SCALING_LIST_32x32) 2539 { 2536 2540 code*=(SCALING_LIST_NUM/NUMBER_OF_PREDICTION_MODES); // Adjust the decoded code for this size, to cope with the missing 32x32 chroma entries. 2541 } 2537 2542 2538 2543 scalingList->setRefMatrixId (sizeId,listId,(UInt)((Int)(listId)-(code))); -
branches/SHM-dev/source/Lib/TLibDecoder/TDecCu.cpp
r1235 r1246 485 485 #ifdef DEBUG_STRING 486 486 const Int debugPredModeMask=DebugStringGetPredModeMask(MODE_INTER); 487 if (DebugOptionList::DebugString_Pred.getInt()&debugPredModeMask) printBlockToStream(std::cout, "###inter-pred: ", *(m_ppcYuvReco[uiDepth])); 487 if (DebugOptionList::DebugString_Pred.getInt()&debugPredModeMask) 488 { 489 printBlockToStream(std::cout, "###inter-pred: ", *(m_ppcYuvReco[uiDepth])); 490 } 488 491 #endif 489 492 … … 492 495 493 496 #ifdef DEBUG_STRING 494 if (DebugOptionList::DebugString_Resi.getInt()&debugPredModeMask) printBlockToStream(std::cout, "###inter-resi: ", *(m_ppcYuvResi[uiDepth])); 497 if (DebugOptionList::DebugString_Resi.getInt()&debugPredModeMask) 498 { 499 printBlockToStream(std::cout, "###inter-resi: ", *(m_ppcYuvResi[uiDepth])); 500 } 495 501 #endif 496 502 … … 505 511 } 506 512 #ifdef DEBUG_STRING 507 if (DebugOptionList::DebugString_Reco.getInt()&debugPredModeMask) printBlockToStream(std::cout, "###inter-reco: ", *(m_ppcYuvReco[uiDepth])); 513 if (DebugOptionList::DebugString_Reco.getInt()&debugPredModeMask) 514 { 515 printBlockToStream(std::cout, "###inter-reco: ", *(m_ppcYuvReco[uiDepth])); 516 } 508 517 #endif 509 518 … … 518 527 TComTU &rTu) 519 528 { 520 if (!rTu.ProcessComponentSection(compID)) return; 529 if (!rTu.ProcessComponentSection(compID)) 530 { 531 return; 532 } 521 533 const Bool bIsLuma = isLuma(compID); 522 534 … … 544 556 { 545 557 xIntraRecBlk(pcRecoYuv, pcPredYuv, pcResiYuv, compID, subTURecurse); 546 } 547 while (subTURecurse.nextSection(rTu)); 558 } while (subTURecurse.nextSection(rTu)); 548 559 549 560 //------------------------------------------------ … … 598 609 { 599 610 for (UInt y = 0; y < uiHeight; y++) 611 { 600 612 for (UInt x = 0; x < uiWidth; x++) 601 613 { 602 614 piResi[(y * uiStride) + x] = 0; 603 615 } 616 } 604 617 } 605 618 606 619 #ifdef DEBUG_STRING 607 620 if (psDebug) 621 { 608 622 ss << (*psDebug); 623 } 609 624 #endif 610 625 … … 627 642 const Bool bDebugReco=((DebugOptionList::DebugString_Reco.getInt()&debugPredModeMask) && DEBUG_STRING_CHANNEL_CONDITION(compID)); 628 643 if (bDebugPred || bDebugResi || bDebugReco) 644 { 629 645 ss << "###: " << "CompID: " << compID << " pred mode (ch/fin): " << uiChPredMode << "/" << uiChFinalMode << " absPartIdx: " << rTu.GetAbsPartIdxTU() << std::endl; 646 } 630 647 #endif 631 648 … … 643 660 { 644 661 #ifdef DEBUG_STRING 645 if (bDebugPred || bDebugResi || bDebugReco) ss << "###: "; 662 if (bDebugPred || bDebugResi || bDebugReco) 663 { 664 ss << "###: "; 665 } 646 666 647 667 if (bDebugPred) … … 653 673 } 654 674 } 655 if (bDebugResi) ss << " - resi: "; 675 if (bDebugResi) 676 { 677 ss << " - resi: "; 678 } 656 679 #endif 657 680 … … 660 683 #ifdef DEBUG_STRING 661 684 if (bDebugResi) 685 { 662 686 ss << pResi[ uiX ] << ", "; 687 } 663 688 #endif 664 689 #if O0043_BEST_EFFORT_DECODING … … 680 705 681 706 if (bDebugPred || bDebugResi || bDebugReco) 707 { 682 708 ss << "\n"; 709 } 683 710 #endif 684 711 pPred += uiStride; … … 742 769 { 743 770 if (isLuma(chType)) 771 { 744 772 xIntraRecBlk( pcRecoYuv, pcPredYuv, pcResiYuv, COMPONENT_Y, rTu ); 773 } 745 774 else 746 775 { -
branches/SHM-dev/source/Lib/TLibDecoder/TDecEntropy.cpp
r1029 r1246 165 165 { 166 166 UInt cdir=pcCU->getIntraDir(CHANNEL_TYPE_CHROMA, uiAbsPartIdx); 167 if (cdir==36) cdir=pcCU->getIntraDir(CHANNEL_TYPE_LUMA, uiAbsPartIdx); 167 if (cdir==36) 168 { 169 cdir=pcCU->getIntraDir(CHANNEL_TYPE_LUMA, uiAbsPartIdx); 170 } 168 171 printf("coding chroma Intra dir: %d, uiAbsPartIdx: %d, luma dir: %d\n", cdir, uiAbsPartIdx, pcCU->getIntraDir(CHANNEL_TYPE_LUMA, uiAbsPartIdx)); 169 172 } … … 451 454 uiYUVCbf[ch] |= pcCU->getCbf(childTUAbsPartIdx , ComponentID(ch), uiTrDepth+1 ); 452 455 } 453 454 456 } while (tuRecurseChild.nextSection(rTu) ); 455 457 … … 508 510 { 509 511 validCbf = true; 510 if (isChroma(compID)) validChromaCbf = true; 512 if (isChroma(compID)) 513 { 514 validChromaCbf = true; 515 } 511 516 } 512 517 } … … 544 549 { 545 550 #if ENVIRONMENT_VARIABLE_DEBUG_AND_TEST 546 if (bDebugRQT) printf("Call NxN for chan %d width=%d height=%d cbf=%d\n", compID, rTu.getRect(compID).width, rTu.getRect(compID).height, 1); 551 if (bDebugRQT) 552 { 553 printf("Call NxN for chan %d width=%d height=%d cbf=%d\n", compID, rTu.getRect(compID).width, rTu.getRect(compID).height, 1); 554 } 547 555 #endif 548 556 … … 559 567 { 560 568 #if ENVIRONMENT_VARIABLE_DEBUG_AND_TEST 561 if (bDebugRQT) printf("Call NxN for chan %d width=%d height=%d cbf=%d\n", compID, subTUIterator.getRect(compID).width, subTUIterator.getRect(compID).height, 1); 569 if (bDebugRQT) 570 { 571 printf("Call NxN for chan %d width=%d height=%d cbf=%d\n", compID, subTUIterator.getRect(compID).width, subTUIterator.getRect(compID).height, 1); 572 } 562 573 #endif 563 574 m_pcEntropyDecoderIf->parseCoeffNxN( subTUIterator, compID ); 564 575 } 565 } 566 while (subTUIterator.nextSection(rTu)); 576 } while (subTUIterator.nextSection(rTu)); 567 577 } 568 578 else … … 636 646 #if ENVIRONMENT_VARIABLE_DEBUG_AND_TEST 637 647 if (bDebugRQT) 648 { 638 649 printf("..codeCoeff: uiAbsPartIdx=%d, PU format=%d, 2Nx2N=%d, NxN=%d\n", uiAbsPartIdx, pcCU->getPartitionSize(uiAbsPartIdx), SIZE_2Nx2N, SIZE_NxN); 650 } 639 651 #endif 640 652 -
branches/SHM-dev/source/Lib/TLibDecoder/TDecGop.cpp
r1230 r1246 182 182 pcPic->compressMotion(); 183 183 Char c = (pcSlice->isIntra() ? 'I' : pcSlice->isInterP() ? 'P' : 'B'); 184 if (!pcSlice->isReferenced()) c += 32; 184 if (!pcSlice->isReferenced()) 185 { 186 c += 32; 187 } 185 188 186 189 //-- For time output for each slice -
branches/SHM-dev/source/Lib/TLibDecoder/TDecSbac.cpp
r1244 r1246 230 230 m_pcTDecBinIf->decodeBin( uiCont, pcSCModel[ iOffset ] RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(whichStat) ); 231 231 uiSymbol++; 232 } 233 while( uiCont && ( uiSymbol < uiMaxSymbol - 1 ) ); 232 } while( uiCont && ( uiSymbol < uiMaxSymbol - 1 ) ); 234 233 235 234 if( uiCont && ( uiSymbol == uiMaxSymbol - 1 ) ) … … 286 285 m_pcTDecBinIf->decodeBin( uiCont, pcSCModel[ iOffset ] RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(whichStat)); 287 286 uiSymbol++; 288 } 289 while( uiCont ); 287 } while( uiCont ); 290 288 291 289 ruiSymbol = uiSymbol; … … 315 313 prefix++; 316 314 m_pcTDecBinIf->decodeBinEP( codeWord RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(whichStat) ); 317 } 318 while((codeWord != 0) && (prefix < longestPossiblePrefix)); 315 } while((codeWord != 0) && (prefix < longestPossiblePrefix)); 319 316 } 320 317 else … … 324 321 prefix++; 325 322 m_pcTDecBinIf->decodeBinEP( codeWord RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(whichStat) ); 326 } 327 while( codeWord); 323 } while( codeWord); 328 324 } 329 325 … … 848 844 TComDataCU *pcCU = rTu.getCU(); 849 845 850 if( isLuma(compID) || !pcCU->getSlice()->getPPS()->getUseCrossComponentPrediction() ) return; 846 if( isLuma(compID) || !pcCU->getSlice()->getPPS()->getUseCrossComponentPrediction() ) 847 { 848 return; 849 } 851 850 852 851 const UInt uiAbsPartIdx = rTu.GetAbsPartIdxTU(); … … 982 981 m_pcTDecBinIf->decodeBin( symbol, m_ChromaQpAdjFlagSCModel.get( 0, 0, 0 ) RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(ctype) ); 983 982 984 if (symbol && tableSize > 1) { 983 if (symbol && tableSize > 1) 984 { 985 985 /* cu_chroma_qp_adjustment_idc */ 986 986 xReadUnaryMaxSymbol( symbol, &m_ChromaQpAdjIdcSCModel.get( 0, 0, 0 ), 0, tableSize - 1 RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(ctype) ); … … 1294 1294 beValid = false; 1295 1295 if((!pcCU->isIntra(uiAbsPartIdx)) && pcCU->isRDPCMEnabled(uiAbsPartIdx)) 1296 { 1296 1297 parseExplicitRdpcmMode(rTu, compID); 1298 } 1297 1299 } 1298 1300 else … … 1463 1465 Int absCoeff[1 << MLS_CG_SIZE]; 1464 1466 1465 for ( Int i = 0; i < numNonZero; i++) absCoeff[i] = 1; 1467 for ( Int i = 0; i < numNonZero; i++) 1468 { 1469 absCoeff[i] = 1; 1470 } 1466 1471 Int numC1Flag = min(numNonZero, C1FLAG_NUMBER); 1467 1472 Int firstC2FlagIdx = -1; … … 1582 1587 { 1583 1588 // Infer sign of 1st element. 1584 if (absSum&0x1) pcCoef[ blkPos ] = -pcCoef[ blkPos ]; 1589 if (absSum&0x1) 1590 { 1591 pcCoef[ blkPos ] = -pcCoef[ blkPos ]; 1592 } 1585 1593 } 1586 1594 else -
branches/SHM-dev/source/Lib/TLibDecoder/TDecSlice.cpp
r1245 r1246 187 187 ComponentID compId=ComponentID(comp); 188 188 sliceEnabled[compId] = pcSlice->getSaoEnabledFlag(toChannelType(compId)) && (comp < pcPic->getNumberValidComponents()); 189 if (sliceEnabled[compId]) bIsSAOSliceEnabled=true; 189 if (sliceEnabled[compId]) 190 { 191 bIsSAOSliceEnabled=true; 192 } 190 193 saoblkParam[compId].modeIdc = SAO_MODE_OFF; 191 194 } -
branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp
r1241 r1246 342 342 Void TDecTop::checkNoOutputPriorPics (TComList<TComPic*>* pcListPic) 343 343 { 344 if (!pcListPic || !m_isNoOutputPriorPics) return; 344 if (!pcListPic || !m_isNoOutputPriorPics) 345 { 346 return; 347 } 345 348 346 349 TComList<TComPic*>::iterator iterPic = pcListPic->begin();
Note: See TracChangeset for help on using the changeset viewer.