Changeset 532 in SHVCSoftware for branches/SHM-4.1-dev/source/Lib/TLibDecoder
- Timestamp:
- 2 Jan 2014, 07:21:30 (11 years ago)
- Location:
- branches/SHM-4.1-dev/source/Lib/TLibDecoder
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-4.1-dev/source/Lib/TLibDecoder/NALread.cpp
r313 r532 126 126 else 127 127 { 128 assert( nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_T LA_R128 assert( nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_TSA_R 129 129 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_TSA_N 130 130 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_STSA_R -
branches/SHM-4.1-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp
r531 r532 1938 1938 Int pocLTCurr = rpcSlice->getPOC() - deltaPocMSBCycleLT * maxPicOrderCntLSB 1939 1939 - iPOClsb + pocLsbLt; 1940 1941 1940 rps->setPOC (j, pocLTCurr); 1942 1941 rps->setDeltaPOC(j, - rpcSlice->getPOC() + pocLTCurr); … … 2876 2875 UInt code, sizeId, listId; 2877 2876 Bool scalingListPredModeFlag; 2878 2879 2877 //for each size 2880 2878 for(sizeId = 0; sizeId < SCALING_LIST_SIZE_NUM; sizeId++) … … 2961 2959 return (cnt>0); 2962 2960 } 2961 2963 2962 //! \} 2964 2963 -
branches/SHM-4.1-dev/source/Lib/TLibDecoder/TDecCu.cpp
r524 r532 963 963 964 964 } 965 965 966 //! \} -
branches/SHM-4.1-dev/source/Lib/TLibDecoder/TDecEntropy.h
r494 r532 106 106 virtual Void parseCoeffNxN( TComDataCU* pcCU, TCoeff* pcCoef, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, UInt uiDepth, TextType eTType ) = 0; 107 107 virtual Void parseTransformSkipFlags ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt width, UInt height, UInt uiDepth, TextType eTType) = 0; 108 109 108 virtual Void updateContextTables( SliceType eSliceType, Int iQp ) = 0; 110 109 … … 166 165 Void updateContextTables ( SliceType eSliceType, Int iQp ) { m_pcEntropyDecoderIf->updateContextTables( eSliceType, iQp ); } 167 166 167 168 168 private: 169 169 Void xDecodeTransform ( TComDataCU* pcCU, UInt offsetLuma, UInt offsetChroma, UInt uiAbsPartIdx, UInt uiDepth, UInt width, UInt height, UInt uiTrIdx, Bool& bCodeDQP ); -
branches/SHM-4.1-dev/source/Lib/TLibDecoder/TDecGop.cpp
r442 r532 128 128 //-- For time output for each slice 129 129 long iBeforeTime = clock(); 130 130 #if !HM_CLEANUP_SAO 131 131 UInt uiStartCUAddr = pcSlice->getSliceSegmentCurStartCUAddr(); 132 132 … … 136 136 m_sliceStartCUAddress.push_back(uiSliceStartCuAddr); 137 137 } 138 138 #endif 139 139 m_pcSbacDecoder->init( (TDecBinIf*)m_pcBinCABAC ); 140 140 m_pcEntropyDecoder->setEntropyDecoder (m_pcSbacDecoder); … … 163 163 m_pcEntropyDecoder->setBitstream ( ppcSubstreams[0] ); 164 164 m_pcEntropyDecoder->resetEntropy (pcSlice); 165 165 #if !HM_CLEANUP_SAO 166 166 if(uiSliceStartCuAddr == uiStartCUAddr) 167 167 { 168 168 m_LFCrossSliceBoundaryFlag.push_back( pcSlice->getLFCrossSliceBoundaryFlag()); 169 169 } 170 #endif 170 171 m_pcSbacDecoders[0].load(m_pcSbacDecoder); 171 172 m_pcSliceDecoder->decompressSlice( ppcSubstreams, rpcPic, m_pcSbacDecoder, m_pcSbacDecoders); … … 195 196 m_pcLoopFilter->setCfg(bLFCrossTileBoundary); 196 197 m_pcLoopFilter->loopFilterPic( rpcPic ); 197 198 #if !HM_CLEANUP_SAO 198 199 if(pcSlice->getSPS()->getUseSAO()) 199 200 { … … 201 202 rpcPic->createNonDBFilterInfo(m_sliceStartCUAddress, 0, &m_LFCrossSliceBoundaryFlag, rpcPic->getPicSym()->getNumTiles(), bLFCrossTileBoundary); 202 203 } 203 204 #endif 204 205 if( pcSlice->getSPS()->getUseSAO() ) 205 206 { 207 #if HM_CLEANUP_SAO 208 m_pcSAO->reconstructBlkSAOParams(rpcPic, rpcPic->getPicSym()->getSAOBlkParam()); 209 m_pcSAO->SAOProcess(rpcPic); 210 m_pcSAO->PCMLFDisableProcess(rpcPic); 211 #else 206 212 { 207 213 SAOParam *saoParam = rpcPic->getPicSym()->getSaoParam(); … … 214 220 m_pcSAO->destroyPicSaoInfo(); 215 221 } 216 } 217 222 #endif 223 } 224 #if !HM_CLEANUP_SAO 218 225 if(pcSlice->getSPS()->getUseSAO()) 219 226 { 220 227 rpcPic->destroyNonDBFilterInfo(); 221 228 } 222 229 #endif 223 230 rpcPic->compressMotion(); 224 231 Char c = (pcSlice->isIntra() ? 'I' : pcSlice->isInterP() ? 'P' : 'B'); … … 283 290 rpcPic->setOutputMark(true); 284 291 rpcPic->setReconMark(true); 292 #if !HM_CLEANUP_SAO 285 293 m_sliceStartCUAddress.clear(); 286 294 m_LFCrossSliceBoundaryFlag.clear(); 295 #endif 287 296 } 288 297 -
branches/SHM-4.1-dev/source/Lib/TLibDecoder/TDecGop.h
r313 r532 83 83 Int m_decodedPictureHashSEIEnabled; ///< Checksum(3)/CRC(2)/MD5(1)/disable(0) acting on decoded picture hash SEI message 84 84 85 #if !HM_CLEANUP_SAO 85 86 //! list that contains the CU address of each slice plus the end address 86 87 std::vector<Int> m_sliceStartCUAddress; 87 88 std::vector<Bool> m_LFCrossSliceBoundaryFlag; 88 89 #endif 89 90 #if SVC_EXTENSION 90 91 UInt m_layerId; -
branches/SHM-4.1-dev/source/Lib/TLibDecoder/TDecSbac.cpp
r494 r532 368 368 #if AUXILIARY_PICTURES 369 369 if (format == CHROMA_400) 370 { 370 371 uiSample = uiGrayVal; 372 } 371 373 else 372 374 #endif … … 389 391 #if AUXILIARY_PICTURES 390 392 if (format == CHROMA_400) 393 { 391 394 uiSample = uiGrayVal; 395 } 392 396 else 393 397 #endif … … 1378 1382 if (uiCode == 0) 1379 1383 { 1384 #if HM_CLEANUP_SAO 1385 ruiVal = 1; 1386 #else 1380 1387 ruiVal = 5; 1388 #endif 1381 1389 } 1382 1390 else 1383 1391 { 1392 #if HM_CLEANUP_SAO 1393 ruiVal = 2; 1394 #else 1384 1395 ruiVal = 1; 1385 } 1386 } 1387 } 1396 #endif 1397 } 1398 } 1399 } 1400 1401 #if HM_CLEANUP_SAO 1402 1403 Void TDecSbac::parseSaoSign(UInt& val) 1404 { 1405 m_pcTDecBinIf->decodeBinEP ( val ); 1406 } 1407 1408 Void TDecSbac::parseSAOBlkParam (SAOBlkParam& saoBlkParam 1409 , Bool* sliceEnabled 1410 , Bool leftMergeAvail 1411 , Bool aboveMergeAvail 1412 ) 1413 { 1414 UInt uiSymbol; 1415 1416 Bool isLeftMerge = false; 1417 Bool isAboveMerge= false; 1418 1419 if(leftMergeAvail) 1420 { 1421 parseSaoMerge(uiSymbol); //sao_merge_left_flag 1422 isLeftMerge = (uiSymbol?true:false); 1423 } 1424 1425 if( aboveMergeAvail && !isLeftMerge) 1426 { 1427 parseSaoMerge(uiSymbol); //sao_merge_up_flag 1428 isAboveMerge = (uiSymbol?true:false); 1429 } 1430 1431 if(isLeftMerge || isAboveMerge) //merge mode 1432 { 1433 saoBlkParam[SAO_Y].modeIdc = saoBlkParam[SAO_Cb].modeIdc = saoBlkParam[SAO_Cr].modeIdc = SAO_MODE_MERGE; 1434 saoBlkParam[SAO_Y].typeIdc = saoBlkParam[SAO_Cb].typeIdc = saoBlkParam[SAO_Cr].typeIdc = (isLeftMerge)?SAO_MERGE_LEFT:SAO_MERGE_ABOVE; 1435 } 1436 else //new or off mode 1437 { 1438 for(Int compIdx=0; compIdx < NUM_SAO_COMPONENTS; compIdx++) 1439 { 1440 SAOOffset& ctbParam = saoBlkParam[compIdx]; 1441 1442 if(!sliceEnabled[compIdx]) 1443 { 1444 //off 1445 ctbParam.modeIdc = SAO_MODE_OFF; 1446 continue; 1447 } 1448 1449 //type 1450 if(compIdx == SAO_Y || compIdx == SAO_Cb) 1451 { 1452 parseSaoTypeIdx(uiSymbol); //sao_type_idx_luma or sao_type_idx_chroma 1453 1454 assert(uiSymbol ==0 || uiSymbol ==1 || uiSymbol ==2); 1455 1456 if(uiSymbol ==0) //OFF 1457 { 1458 ctbParam.modeIdc = SAO_MODE_OFF; 1459 } 1460 else if(uiSymbol == 1) //BO 1461 { 1462 ctbParam.modeIdc = SAO_MODE_NEW; 1463 ctbParam.typeIdc = SAO_TYPE_START_BO; 1464 } 1465 else //2, EO 1466 { 1467 ctbParam.modeIdc = SAO_MODE_NEW; 1468 ctbParam.typeIdc = SAO_TYPE_START_EO; 1469 } 1470 1471 } 1472 else //Cr, follow Cb SAO type 1473 { 1474 ctbParam.modeIdc = saoBlkParam[SAO_Cb].modeIdc; 1475 ctbParam.typeIdc = saoBlkParam[SAO_Cb].typeIdc; 1476 } 1477 1478 if(ctbParam.modeIdc == SAO_MODE_NEW) 1479 { 1480 Int offset[4]; 1481 for(Int i=0; i< 4; i++) 1482 { 1483 parseSaoMaxUvlc(uiSymbol, g_saoMaxOffsetQVal[compIdx] ); //sao_offset_abs 1484 offset[i] = (Int)uiSymbol; 1485 } 1486 1487 if(ctbParam.typeIdc == SAO_TYPE_START_BO) 1488 { 1489 for(Int i=0; i< 4; i++) 1490 { 1491 if(offset[i] != 0) 1492 { 1493 parseSaoSign(uiSymbol); //sao_offset_sign 1494 if(uiSymbol) 1495 { 1496 offset[i] = -offset[i]; 1497 } 1498 } 1499 } 1500 parseSaoUflc(NUM_SAO_BO_CLASSES_LOG2, uiSymbol ); //sao_band_position 1501 ctbParam.typeAuxInfo = uiSymbol; 1502 1503 for(Int i=0; i<4; i++) 1504 { 1505 ctbParam.offset[(ctbParam.typeAuxInfo+i)%MAX_NUM_SAO_CLASSES] = offset[i]; 1506 } 1507 1508 } 1509 else //EO 1510 { 1511 ctbParam.typeAuxInfo = 0; 1512 1513 if(compIdx == SAO_Y || compIdx == SAO_Cb) 1514 { 1515 parseSaoUflc(NUM_SAO_EO_TYPES_LOG2, uiSymbol ); //sao_eo_class_luma or sao_eo_class_chroma 1516 ctbParam.typeIdc += uiSymbol; 1517 } 1518 else 1519 { 1520 ctbParam.typeIdc = saoBlkParam[SAO_Cb].typeIdc; 1521 } 1522 ctbParam.offset[SAO_CLASS_EO_FULL_VALLEY] = offset[0]; 1523 ctbParam.offset[SAO_CLASS_EO_HALF_VALLEY] = offset[1]; 1524 ctbParam.offset[SAO_CLASS_EO_PLAIN ] = 0; 1525 ctbParam.offset[SAO_CLASS_EO_HALF_PEAK ] = -offset[2]; 1526 ctbParam.offset[SAO_CLASS_EO_FULL_PEAK ] = -offset[3]; 1527 } 1528 } 1529 } 1530 } 1531 } 1532 1533 #else 1388 1534 1389 1535 inline Void copySaoOneLcuParam(SaoLcuParam* psDst, SaoLcuParam* psSrc) … … 1559 1705 } 1560 1706 1707 #endif 1708 1561 1709 /** 1562 1710 - Initialize our contexts from the nominated source. -
branches/SHM-4.1-dev/source/Lib/TLibDecoder/TDecSbac.h
r494 r532 90 90 Void parseSaoTypeIdx ( UInt& ruiVal ); 91 91 Void parseSaoUflc ( UInt uiLength, UInt& ruiVal ); 92 #if HM_CLEANUP_SAO 93 Void parseSAOBlkParam (SAOBlkParam& saoBlkParam, Bool* sliceEnabled, Bool leftMergeAvail, Bool aboveMergeAvail); 94 Void parseSaoSign(UInt& val); 95 #else 92 96 Void parseSaoOneLcuInterleaving(Int rx, Int ry, SAOParam* pSaoParam, TComDataCU* pcCU, Int iCUAddrInSlice, Int iCUAddrUpInSlice, Int allowMergeLeft, Int allowMergeUp); 93 97 Void parseSaoOffset (SaoLcuParam* psSaoLcuParam, UInt compIdx); 98 #endif 94 99 private: 95 100 Void xReadUnarySymbol ( UInt& ruiSymbol, ContextModel* pcSCModel, Int iOffset ); -
branches/SHM-4.1-dev/source/Lib/TLibDecoder/TDecSlice.cpp
r345 r532 197 197 UInt uiTileLCUX; 198 198 Int iNumSubstreamsPerTile = 1; // if independent. 199 200 199 Bool depSliceSegmentsEnabled = rpcPic->getSlice(rpcPic->getCurrSliceIdx())->getPPS()->getDependentSliceSegmentsEnabledFlag(); 201 200 uiTileStartLCU = rpcPic->getPicSym()->getTComTile(rpcPic->getPicSym()->getTileIdxMap(iStartCUAddr))->getFirstCUAddr(); … … 323 322 g_bJustDoIt = g_bEncDecTraceEnable; 324 323 #endif 324 325 #if HM_CLEANUP_SAO 326 if ( pcSlice->getSPS()->getUseSAO() ) 327 { 328 SAOBlkParam& saoblkParam = (rpcPic->getPicSym()->getSAOBlkParam())[iCUAddr]; 329 if (pcSlice->getSaoEnabledFlag()||pcSlice->getSaoEnabledFlagChroma()) 330 { 331 Bool sliceEnabled[NUM_SAO_COMPONENTS]; 332 sliceEnabled[SAO_Y] = pcSlice->getSaoEnabledFlag(); 333 sliceEnabled[SAO_Cb]= sliceEnabled[SAO_Cr]= pcSlice->getSaoEnabledFlagChroma(); 334 335 Bool leftMergeAvail = false; 336 Bool aboveMergeAvail= false; 337 338 //merge left condition 339 Int rx = (iCUAddr % uiWidthInLCUs); 340 if(rx > 0) 341 { 342 leftMergeAvail = rpcPic->getSAOMergeAvailability(iCUAddr, iCUAddr-1); 343 } 344 //merge up condition 345 Int ry = (iCUAddr / uiWidthInLCUs); 346 if(ry > 0) 347 { 348 aboveMergeAvail = rpcPic->getSAOMergeAvailability(iCUAddr, iCUAddr-uiWidthInLCUs); 349 } 350 351 pcSbacDecoder->parseSAOBlkParam( saoblkParam, sliceEnabled, leftMergeAvail, aboveMergeAvail); 352 } 353 else 354 { 355 saoblkParam[SAO_Y ].modeIdc = SAO_MODE_OFF; 356 saoblkParam[SAO_Cb].modeIdc = SAO_MODE_OFF; 357 saoblkParam[SAO_Cr].modeIdc = SAO_MODE_OFF; 358 } 359 } 360 #else 325 361 if ( pcSlice->getSPS()->getUseSAO() && (pcSlice->getSaoEnabledFlag()||pcSlice->getSaoEnabledFlagChroma()) ) 326 362 { … … 374 410 } 375 411 } 412 #endif 413 376 414 m_pcCuDecoder->decodeCU ( pcCU, uiIsLast ); 377 415 m_pcCuDecoder->decompressCU ( pcCU ); -
branches/SHM-4.1-dev/source/Lib/TLibDecoder/TDecTop.cpp
r531 r532 371 371 #endif 372 372 #endif 373 373 #if !HM_CLEANUP_SAO 374 374 rpcPic->getPicSym()->allocSaoParam(&m_cSAO); 375 #endif 375 376 m_cListPic.pushBack( rpcPic ); 376 377 … … 452 453 #endif 453 454 #endif 455 #if !HM_CLEANUP_SAO 454 456 rpcPic->getPicSym()->allocSaoParam(&m_cSAO); 457 #endif 455 458 } 456 459 … … 747 750 m_cSAO.destroy(); 748 751 #if REPN_FORMAT_IN_VPS 752 #if AUXILIARY_PICTURES 753 #if HM_CLEANUP_SAO 754 m_cSAO.create( m_apcSlicePilot->getPicWidthInLumaSamples(), m_apcSlicePilot->getPicHeightInLumaSamples(), sps->getChromaFormatIdc(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxCUDepth() ); 755 #else 756 m_cSAO.create( m_apcSlicePilot->getPicWidthInLumaSamples(), m_apcSlicePilot->getPicHeightInLumaSamples(), sps->getChromaFormatIdc(), sps->getMaxCUWidth(), sps->getMaxCUHeight() ); 757 #endif 758 #else 759 #if HM_CLEANUP_SAO 760 m_cSAO.create( m_apcSlicePilot->getPicWidthInLumaSamples(), m_apcSlicePilot->getPicHeightInLumaSamples(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxCUDepth() ); 761 #else 749 762 m_cSAO.create( m_apcSlicePilot->getPicWidthInLumaSamples(), m_apcSlicePilot->getPicHeightInLumaSamples(), sps->getMaxCUWidth(), sps->getMaxCUHeight() ); 763 #endif 764 #endif 765 #else 766 #if HM_CLEANUP_SAO 767 m_cSAO.create( sps->getPicWidthInLumaSamples(), sps->getPicHeightInLumaSamples(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxCUDepth() ); 750 768 #else 751 769 m_cSAO.create( sps->getPicWidthInLumaSamples(), sps->getPicHeightInLumaSamples(), sps->getMaxCUWidth(), sps->getMaxCUHeight() ); 770 #endif 752 771 #endif 753 772 m_cLoopFilter.create( sps->getMaxCUDepth() ); … … 969 988 // Check for TSA alignment 970 989 if( m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_TSA_N || 971 m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_T LA_R990 m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_TSA_R 972 991 ) 973 992 { … … 979 998 { 980 999 assert( m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_TSA_N || 981 m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_T LA_R ); // TSA pictures should be aligned among depenedent layers1000 m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_TSA_R ); // TSA pictures should be aligned among depenedent layers 982 1001 } 983 1002 } … … 1275 1294 if (m_layerId == 0) 1276 1295 #endif 1277 #if FIX10711278 1296 pcSlice->setRefPicList( m_cListPic, true ); 1279 #else1280 pcSlice->setRefPicList( m_cListPic );1281 #endif1282 1297 1283 1298 #if SVC_EXTENSION … … 1524 1539 { 1525 1540 pcSlice->setScalingList ( pcSlice->getSPS()->getScalingList() ); 1526 1527 1541 if(pcSlice->getPPS()->getScalingListPresentFlag()) 1528 1542 { … … 1770 1784 case NAL_UNIT_CODED_SLICE_TRAIL_R: 1771 1785 case NAL_UNIT_CODED_SLICE_TRAIL_N: 1772 case NAL_UNIT_CODED_SLICE_T LA_R:1786 case NAL_UNIT_CODED_SLICE_TSA_R: 1773 1787 case NAL_UNIT_CODED_SLICE_TSA_N: 1774 1788 case NAL_UNIT_CODED_SLICE_STSA_R: … … 1790 1804 #endif 1791 1805 break; 1806 1807 case NAL_UNIT_EOS: 1808 m_associatedIRAPType = NAL_UNIT_INVALID; 1809 m_pocCRA = 0; 1810 m_pocRandomAccess = MAX_INT; 1811 m_prevPOC = MAX_INT; 1812 m_bFirstSliceInPicture = true; 1813 m_bFirstSliceInSequence = true; 1814 m_prevSliceSkipped = false; 1815 m_skippedPOC = 0; 1816 return false; 1817 1818 case NAL_UNIT_ACCESS_UNIT_DELIMITER: 1819 // TODO: process AU delimiter 1820 return false; 1821 1822 case NAL_UNIT_EOB: 1823 return false; 1824 1792 1825 default: 1793 assert ( 1);1826 assert (0); 1794 1827 } 1795 1828 -
branches/SHM-4.1-dev/source/Lib/TLibDecoder/TDecTop.h
r531 r532 73 73 TComList<TComPic*> m_cListPic; // Dynamic buffer 74 74 ParameterSetManagerDecoder m_parameterSetManagerDecoder; // storage for parameter sets 75 76 75 TComSlice* m_apcSlicePilot; 77 76
Note: See TracChangeset for help on using the changeset viewer.