Changeset 414 in SHVCSoftware for branches/SHM-3.1-dev/source/Lib/TLibDecoder
- Timestamp:
- 8 Oct 2013, 11:25:37 (12 years ago)
- Location:
- branches/SHM-3.1-dev/source/Lib/TLibDecoder
- Files:
-
- 4 edited
-
TDecCAVLC.cpp (modified) (9 diffs)
-
TDecCAVLC.h (modified) (1 diff)
-
TDecTop.cpp (modified) (5 diffs)
-
TDecTop.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-3.1-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp
r411 r414 291 291 } 292 292 READ_FLAG( uiCode, "pps_scaling_list_data_present_flag" ); pcPPS->setScalingListPresentFlag( uiCode ? true : false ); 293 294 #if IL_SL_SIGNALLING_N0371 295 pcPPS->setPPS( pcPPS->getLayerId(), pcPPS ); 296 #endif 297 293 298 if(pcPPS->getScalingListPresentFlag ()) 294 299 { 300 #if IL_SL_SIGNALLING_N0371 301 pcPPS->getScalingList()->setLayerId( pcPPS->getLayerId() ); 302 303 if( pcPPS->getLayerId() > 0 ) 304 { 305 READ_FLAG( uiCode, "pps_pred_scaling_list_flag" ); pcPPS->setPredScalingListFlag( uiCode ? true : false ); 306 pcPPS->getScalingList()->setPredScalingListFlag( pcPPS->getPredScalingListFlag() ); 307 308 if( pcPPS->getPredScalingListFlag() ) 309 { 310 READ_UVLC ( uiCode, "scaling_list_pps_ref_layer_id" ); pcPPS->setScalingListRefLayerId( uiCode ); 311 312 // The value of pps_scaling_list_ref_layer_id shall be in the range of 0 to 62, inclusive 313 assert( pcPPS->getScalingListRefLayerId() >= 0 && pcPPS->getScalingListRefLayerId() <= 62 ); 314 315 // When avc_base_layer_flag is equal to 1, it is a requirement of bitstream conformance that the value of pps_scaling_list_ref_layer_id shall be greater than 0 316 if( pcPPS->getSPS()->getVPS()->getAvcBaseLayerFlag() ) 317 { 318 assert( pcPPS->getScalingListRefLayerId() > 0 ); 319 } 320 321 // It is a requirement of bitstream conformance that, when a PPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB and 322 // pps_infer_scaling_list_flag in the PPS is equal to 1, pps_infer_scaling_list_flag shall be equal to 0 for the PPS that is active for the layer with nuh_layer_id equal to pps_scaling_list_ref_layer_id 323 assert( pcPPS->getPPS( pcPPS->getScalingListRefLayerId() )->getPredScalingListFlag() == false ); 324 325 // It is a requirement of bitstream conformance that, when a PPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB, 326 // the layer with nuh_layer_id equal to pps_scaling_list_ref_layer_id shall be a direct or indirect reference layer of the layer with nuh_layer_id equal to nuhLayerIdB 327 assert( pcPPS->getSPS()->getVPS()->getScalingListLayerDependency( pcPPS->getLayerId(), pcPPS->getScalingListRefLayerId() ) == true ); 328 329 pcPPS->getScalingList()->setScalingListRefLayerId( pcPPS->getScalingListRefLayerId() ); 330 parseScalingList( pcPPS->getScalingList() ); 331 } 332 else 333 { 334 parseScalingList( pcPPS->getScalingList() ); 335 } 336 } 337 else 338 { 339 parseScalingList( pcPPS->getScalingList() ); 340 } 341 #else 295 342 parseScalingList( pcPPS->getScalingList() ); 343 #endif 296 344 } 297 345 … … 522 570 } 523 571 #endif 572 #if IL_SL_SIGNALLING_N0371 573 pcSPS->setVPS( parameterSetManager->getPrefetchedVPS(pcSPS->getVPSId()) ); 574 pcSPS->setSPS( pcSPS->getLayerId(), pcSPS ); 575 #endif 524 576 if ( pcSPS->getMaxTLayers() == 1 ) 525 577 { … … 647 699 Int addCuDepth = max (0, log2MinCUSize - (Int)pcSPS->getQuadtreeTULog2MinSize() ); 648 700 pcSPS->setMaxCUDepth( maxCUDepthDelta + addCuDepth ); 649 650 701 READ_FLAG( uiCode, "scaling_list_enabled_flag" ); pcSPS->setScalingListFlag ( uiCode ); 702 651 703 if(pcSPS->getScalingListFlag()) 652 704 { … … 654 706 if(pcSPS->getScalingListPresentFlag ()) 655 707 { 708 709 #if IL_SL_SIGNALLING_N0371 710 pcSPS->getScalingList()->setLayerId( pcSPS->getLayerId() ); 711 712 if( pcSPS->getLayerId() > 0 ) 713 { 714 READ_FLAG( uiCode, "sps_pred_scaling_list_flag" ); pcSPS->setPredScalingListFlag ( uiCode ); 715 pcSPS->getScalingList()->setPredScalingListFlag( pcSPS->getPredScalingListFlag() ); 716 717 if( pcSPS->getPredScalingListFlag() ) 718 { 719 READ_UVLC( uiCode, "scaling_list_sps_ref_layer_id" ); pcSPS->setScalingListRefLayerId( uiCode ); 720 721 // The value of sps_scaling_list_ref_layer_id shall be in the range of 0 to 62, inclusive 722 assert( pcSPS->getScalingListRefLayerId() >= 0 && pcSPS->getScalingListRefLayerId() <= 62 ); 723 724 // When avc_base_layer_flag is equal to 1, it is a requirement of bitstream conformance that the value of sps_scaling_list_ref_layer_id shall be greater than 0 725 if( pcSPS->getVPS()->getAvcBaseLayerFlag() ) 726 { 727 assert( pcSPS->getScalingListRefLayerId() > 0 ); 728 } 729 730 // It is a requirement of bitstream conformance that, when an SPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB and 731 // sps_infer_scaling_list_flag in the SPS is equal to 1, sps_infer_scaling_list_flag shall be equal to 0 for the SPS that is active for the layer with nuh_layer_id equal to sps_scaling_list_ref_layer_id 732 assert( pcSPS->getSPS( pcSPS->getScalingListRefLayerId() )->getPredScalingListFlag() == false ); 733 734 // It is a requirement of bitstream conformance that, when an SPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB, 735 // the layer with nuh_layer_id equal to sps_scaling_list_ref_layer_id shall be a direct or indirect reference layer of the layer with nuh_layer_id equal to nuhLayerIdB 736 assert( pcSPS->getVPS()->getScalingListLayerDependency( pcSPS->getLayerId(), pcSPS->getScalingListRefLayerId() ) == true ); 737 738 pcSPS->getScalingList()->setScalingListRefLayerId( pcSPS->getScalingListRefLayerId() ); 739 parseScalingList( pcSPS->getScalingList() ); 740 } 741 else 742 { 743 parseScalingList( pcSPS->getScalingList() ); 744 } 745 } 746 else 747 { 748 parseScalingList( pcSPS->getScalingList() ); 749 } 750 #else 656 751 parseScalingList( pcSPS->getScalingList() ); 752 #endif 753 657 754 } 658 755 } … … 1243 1340 } 1244 1341 } 1245 #endif 1342 1343 #endif 1344 1345 #if IL_SL_SIGNALLING_N0371 1346 for(i = 1; i < vps->getMaxLayers(); i++) 1347 { 1348 for(j = 0; j < i; j++) 1349 { 1350 vps->setScalingListLayerDependency( i, j, vps->checkLayerDependency( i,j ) ); 1351 } 1352 } 1353 #endif 1354 1246 1355 #if M0040_ADAPTIVE_RESOLUTION_CHANGE 1247 1356 READ_FLAG(uiCode, "single_layer_for_non_irap_flag" ); vps->setSingleLayerForNonIrapFlag(uiCode == 1 ? true : false); … … 2447 2556 UInt code, sizeId, listId; 2448 2557 Bool scalingListPredModeFlag; 2558 2449 2559 //for each size 2450 2560 for(sizeId = 0; sizeId < SCALING_LIST_SIZE_NUM; sizeId++) … … 2452 2562 for(listId = 0; listId < g_scalingListNum[sizeId]; listId++) 2453 2563 { 2564 #if IL_SL_SIGNALLING_N0371 2565 if ( scalingList->getLayerId() > 0 && scalingList->getPredScalingListFlag() ) 2566 { 2567 READ_FLAG( code, "scaling_list_pred_mode_flag"); 2568 scalingListPredModeFlag = (code) ? true : false; 2569 if(!scalingListPredModeFlag) //Copy Mode 2570 { 2571 READ_UVLC( code, "scaling_list_pred_matrix_id_delta"); 2572 scalingList->setRefMatrixId (sizeId,listId,(UInt)((Int)(listId)-(code))); 2573 if( sizeId > SCALING_LIST_8x8 ) 2574 { 2575 scalingList->setScalingListDC(sizeId,listId,((listId == scalingList->getRefMatrixId (sizeId,listId))? 16 :scalingList->getScalingListDC(sizeId, scalingList->getRefMatrixId (sizeId,listId)))); 2576 } 2577 scalingList->processRefMatrix( sizeId, listId, scalingList->getRefMatrixId (sizeId,listId)); 2578 2579 } 2580 else //DPCM Mode 2581 { 2582 xDecodeScalingList(scalingList, sizeId, listId); 2583 } 2584 } 2585 else 2586 { 2587 READ_FLAG( code, "scaling_list_pred_mode_flag"); 2588 scalingListPredModeFlag = (code) ? true : false; 2589 if(!scalingListPredModeFlag) //Copy Mode 2590 { 2591 READ_UVLC( code, "scaling_list_pred_matrix_id_delta"); 2592 scalingList->setRefMatrixId (sizeId,listId,(UInt)((Int)(listId)-(code))); 2593 if( sizeId > SCALING_LIST_8x8 ) 2594 { 2595 scalingList->setScalingListDC(sizeId,listId,((listId == scalingList->getRefMatrixId (sizeId,listId))? 16 :scalingList->getScalingListDC(sizeId, scalingList->getRefMatrixId (sizeId,listId)))); 2596 } 2597 scalingList->processRefMatrix( sizeId, listId, scalingList->getRefMatrixId (sizeId,listId)); 2598 2599 } 2600 else //DPCM Mode 2601 { 2602 xDecodeScalingList(scalingList, sizeId, listId); 2603 } 2604 } 2605 #else 2454 2606 READ_FLAG( code, "scaling_list_pred_mode_flag"); 2455 2607 scalingListPredModeFlag = (code) ? true : false; … … 2469 2621 xDecodeScalingList(scalingList, sizeId, listId); 2470 2622 } 2623 #endif 2471 2624 } 2472 2625 } … … 2490 2643 if( sizeId > SCALING_LIST_8x8 ) 2491 2644 { 2645 #if IL_SL_SIGNALLING_N0371 2646 if( scalingList->getLayerId() > 0 && scalingList->getPredScalingListFlag() ) 2647 { 2648 ref_scalingListDC[scalingList->getLayerId()][sizeId][listId] = scalingList->getScalingListDC(sizeId,listId); 2649 scalingList->setScalingListDC(sizeId,listId,ref_scalingListDC[scalingList->getScalingListRefLayerId()][sizeId][listId]); 2650 } 2651 else 2652 { 2653 READ_SVLC( scalingListDcCoefMinus8, "scaling_list_dc_coef_minus8"); 2654 scalingList->setScalingListDC(sizeId,listId,scalingListDcCoefMinus8 + 8); 2655 nextCoef = scalingList->getScalingListDC(sizeId,listId); 2656 ref_scalingListDC[scalingList->getLayerId()][sizeId][listId] = scalingList->getScalingListDC(sizeId,listId); 2657 } 2658 #else 2492 2659 READ_SVLC( scalingListDcCoefMinus8, "scaling_list_dc_coef_minus8"); 2493 2660 scalingList->setScalingListDC(sizeId,listId,scalingListDcCoefMinus8 + 8); 2494 2661 nextCoef = scalingList->getScalingListDC(sizeId,listId); 2662 #endif 2495 2663 } 2496 2664 2497 2665 for(i = 0; i < coefNum; i++) 2498 2666 { 2667 #if IL_SL_SIGNALLING_N0371 2668 if( scalingList->getLayerId() > 0 && scalingList->getPredScalingListFlag() ) 2669 { 2670 ref_scalingListCoef[scalingList->getLayerId()][sizeId][listId][i] = dst[scan[i]]; 2671 dst[scan[i]] = ref_scalingListCoef[scalingList->getScalingListRefLayerId()][sizeId][listId][i]; 2672 } 2673 else 2674 { 2675 READ_SVLC( data, "scaling_list_delta_coef"); 2676 nextCoef = (nextCoef + data + 256 ) % 256; 2677 dst[scan[i]] = nextCoef; 2678 ref_scalingListCoef[scalingList->getLayerId()][sizeId][listId][i] = dst[scan[i]]; 2679 } 2680 #else 2499 2681 READ_SVLC( data, "scaling_list_delta_coef"); 2500 2682 nextCoef = (nextCoef + data + 256 ) % 256; 2501 2683 dst[scan[i]] = nextCoef; 2684 #endif 2502 2685 } 2503 2686 } -
branches/SHM-3.1-dev/source/Lib/TLibDecoder/TDecCAVLC.h
r389 r414 75 75 Void parseVPSExtension ( TComVPS* pcVPS ); 76 76 #endif 77 77 78 #if VPS_VUI 78 79 Void parseVPSVUI ( TComVPS* pcVPS ); -
branches/SHM-3.1-dev/source/Lib/TLibDecoder/TDecTop.cpp
r412 r414 1232 1232 if(pcSlice->getSPS()->getScalingListFlag()) 1233 1233 { 1234 #if IL_SL_SIGNALLING_N0371 1235 pcSlice->getSPS()->getScalingList()->setLayerId( m_layerId ); 1236 #endif 1237 1234 1238 pcSlice->setScalingList ( pcSlice->getSPS()->getScalingList() ); 1239 1235 1240 if(pcSlice->getPPS()->getScalingListPresentFlag()) 1236 1241 { 1242 #if IL_SL_SIGNALLING_N0371 1243 pcSlice->getPPS()->getScalingList()->setLayerId( m_layerId ); 1244 #endif 1245 1237 1246 pcSlice->setScalingList ( pcSlice->getPPS()->getScalingList() ); 1238 1247 } … … 1240 1249 if(!pcSlice->getPPS()->getScalingListPresentFlag() && !pcSlice->getSPS()->getScalingListPresentFlag()) 1241 1250 { 1251 #if IL_SL_SIGNALLING_N0371 1252 pcSlice->setDefaultScalingList( m_layerId ); 1253 #else 1242 1254 pcSlice->setDefaultScalingList(); 1255 #endif 1243 1256 } 1244 1257 m_cTrQuant.setScalingListDec(pcSlice->getScalingList()); … … 1247 1260 else 1248 1261 { 1262 #if IL_SL_SIGNALLING_N0371 1263 m_cTrQuant.setFlatScalingList( m_layerId ); 1264 #else 1249 1265 m_cTrQuant.setFlatScalingList(); 1266 #endif 1250 1267 m_cTrQuant.setUseScalingList(false); 1251 1268 } … … 1278 1295 sps->setLayerId(m_layerId); 1279 1296 #endif 1297 1280 1298 #if SPS_SUB_LAYER_INFO 1281 1299 m_cEntropyDecoder.decodeSPS( sps, &m_parameterSetManagerDecoder[0] ); … … 1301 1319 { 1302 1320 TComPPS* pps = new TComPPS(); 1321 1322 #if IL_SL_SIGNALLING_N0371 1323 pps->setLayerId(m_layerId); 1324 #endif 1325 1303 1326 m_cEntropyDecoder.decodePPS( pps ); 1304 1327 #if SVC_EXTENSION -
branches/SHM-3.1-dev/source/Lib/TLibDecoder/TDecTop.h
r411 r414 79 79 80 80 TComSlice* m_apcSlicePilot; 81 81 82 82 SEIMessages m_SEIs; ///< List of SEI messages that have been received before the first slice and between slices 83 83
Note: See TracChangeset for help on using the changeset viewer.