Changeset 529 in SHVCSoftware
- Timestamp:
- 25 Dec 2013, 05:53:40 (11 years ago)
- Location:
- branches/SHM-4.1-dev/source
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-4.1-dev/source/App/TAppEncoder/TAppEncTop.cpp
r527 r529 1318 1318 } 1319 1319 #endif 1320 #if IL_SL_SIGNALLING_N03711321 for(i = 1; i < vps->getMaxLayers(); i++)1322 {1323 for(Int j = 0; j < i; j++)1324 {1325 vps->setScalingListLayerDependency( i, j, vps->checkLayerDependency( i,j ) );1326 }1327 }1328 #endif1329 1320 #endif 1330 1321 #if JCTVC_M0458_INTERLAYER_RPS_SIG -
branches/SHM-4.1-dev/source/Lib/TLibCommon/TComRom.cpp
r494 r529 541 541 Int g_mvScalingFactor [MAX_LAYERS][2] = {{0,0}, {0,0}}; 542 542 Int g_posScalingFactor [MAX_LAYERS][2] = {{0,0}, {0,0}}; 543 544 #if IL_SL_SIGNALLING_N0371545 Int ref_scalingListDC [MAX_LAYERS][SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM];546 Int ref_scalingListCoef [MAX_LAYERS][SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM][MAX_MATRIX_COEF_NUM];547 Int activeRefPPSId [MAX_LAYERS];548 Int activeRefSPSId [MAX_LAYERS];549 #endif550 543 #endif 551 544 -
branches/SHM-4.1-dev/source/Lib/TLibCommon/TComRom.h
r494 r529 291 291 #if SVC_EXTENSION 292 292 extern Int g_mvScalingFactor [MAX_LAYERS][2]; 293 extern Int g_posScalingFactor [MAX_LAYERS][2]; 294 295 #if IL_SL_SIGNALLING_N0371 296 extern Int ref_scalingListDC [MAX_LAYERS][SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; 297 extern Int ref_scalingListCoef [MAX_LAYERS][SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM][MAX_MATRIX_COEF_NUM]; 298 extern Int activeRefPPSId [MAX_LAYERS]; 299 extern Int activeRefSPSId [MAX_LAYERS]; 300 #endif 293 extern Int g_posScalingFactor [MAX_LAYERS][2]; 301 294 #endif 302 295 -
branches/SHM-4.1-dev/source/Lib/TLibCommon/TComSlice.cpp
r528 r529 48 48 ParameterSetMap<TComVPS> ParameterSetManager::m_vpsMap(MAX_NUM_VPS); 49 49 Int ParameterSetManager::m_activeVPSId = -1; 50 #if IL_SL_SIGNALLING_N037151 TComSPS* TComSPS::m_pcSPS[MAX_LAYERS];52 TComPPS* TComPPS::m_pcPPS[MAX_LAYERS];53 #endif54 50 #endif 55 51 … … 2233 2229 setNumSubDpbs( i, getNumLayersInIdList( getOutputLayerSetIdx(i)) ); 2234 2230 } 2235 }2236 #endif2237 2238 #if IL_SL_SIGNALLING_N03712239 Bool TComVPS::checkLayerDependency(UInt i, UInt j)2240 {2241 if( this->getDirectDependencyFlag(i, j) == true )2242 {2243 return true;2244 }2245 else2246 {2247 for(UInt k=i-1; k>j; k--)2248 {2249 if( this->getDirectDependencyFlag(i, k) == true )2250 {2251 checkLayerDependency( k,j );2252 }2253 }2254 }2255 return false;2256 2231 } 2257 2232 #endif … … 2822 2797 /** set default quantization matrix to array 2823 2798 */ 2824 #if IL_SL_SIGNALLING_N03712825 Void TComSlice::setDefaultScalingList( UInt layerId )2826 #else2827 2799 Void TComSlice::setDefaultScalingList() 2828 #endif2829 2800 { 2830 2801 for(UInt sizeId = 0; sizeId < SCALING_LIST_SIZE_NUM; sizeId++) … … 2832 2803 for(UInt listId=0;listId<g_scalingListNum[sizeId];listId++) 2833 2804 { 2834 #if IL_SL_SIGNALLING_N03712835 getScalingList()->processDefaultMarix(sizeId, listId, layerId);2836 #else2837 2805 getScalingList()->processDefaultMarix(sizeId, listId); 2838 #endif2839 2806 } 2840 2807 } … … 3011 2978 * \param Index of input matrix 3012 2979 */ 3013 #if IL_SL_SIGNALLING_N03713014 Void TComScalingList::processDefaultMarix(UInt sizeId, UInt listId, UInt layerId)3015 #else3016 2980 Void TComScalingList::processDefaultMarix(UInt sizeId, UInt listId) 3017 #endif 3018 { 3019 #if IL_SL_SIGNALLING_N0371 3020 Int i,coefNum = min(MAX_MATRIX_COEF_NUM,(Int)g_scalingListSize[sizeId]); 3021 UInt* scan = (sizeId == 0) ? g_auiSigLastScan [ SCAN_DIAG ] [ 1 ] : g_sigLastScanCG32x32; 3022 Int *src = getScalingListDefaultAddress(sizeId, listId); 3023 #endif 3024 2981 { 3025 2982 ::memcpy(getScalingListAddress(sizeId, listId),getScalingListDefaultAddress(sizeId,listId),sizeof(Int)*min(MAX_MATRIX_COEF_NUM,(Int)g_scalingListSize[sizeId])); 3026 3027 #if IL_SL_SIGNALLING_N03713028 for(i = 0; i < coefNum; i++)3029 {3030 ref_scalingListCoef[layerId][sizeId][listId][i] = src[scan[i]];3031 }3032 #endif3033 3034 2983 setScalingListDC(sizeId,listId,SCALING_LIST_DC); 3035 #if IL_SL_SIGNALLING_N03713036 ref_scalingListDC[layerId][sizeId][listId] = SCALING_LIST_DC;3037 #endif3038 2984 } 3039 2985 3040 2986 /** check DC value of matrix for default matrix signaling 3041 2987 */ 3042 #if IL_SL_SIGNALLING_N03713043 Void TComScalingList::checkDcOfMatrix( UInt layerId )3044 #else3045 2988 Void TComScalingList::checkDcOfMatrix() 3046 #endif3047 2989 { 3048 2990 for(UInt sizeId = 0; sizeId < SCALING_LIST_SIZE_NUM; sizeId++) … … 3053 2995 if(getScalingListDC(sizeId,listId) == 0) 3054 2996 { 3055 #if IL_SL_SIGNALLING_N03713056 processDefaultMarix(sizeId, listId, layerId);3057 #else3058 2997 processDefaultMarix(sizeId, listId); 3059 #endif3060 2998 } 3061 2999 } … … 3138 3076 m_activeVPSId = vpsId; 3139 3077 m_activeSPSId = spsId; 3140 3141 #if IL_SL_SIGNALLING_N03713142 activeRefPPSId[ sps->getLayerId() ] = ppsId;3143 activeRefSPSId[ sps->getLayerId() ] = spsId;3144 #endif3145 3078 3146 3079 return true; -
branches/SHM-4.1-dev/source/Lib/TLibCommon/TComSlice.h
r528 r529 157 157 Bool getScalingListPresentFlag () { return m_scalingListPresentFlag; } 158 158 159 #if IL_SL_SIGNALLING_N0371160 UInt m_layerId;161 162 Void setPredScalingListFlag (Bool b) { m_predScalingListFlag = b; }163 Bool getPredScalingListFlag () { return m_predScalingListFlag; }164 Void setScalingListRefLayerId (UInt b) { m_scalingListRefLayerId = b; }165 UInt getScalingListRefLayerId () { return m_scalingListRefLayerId; }166 #endif167 168 159 Int* getScalingListAddress (UInt sizeId, UInt listId) { return m_scalingListCoef[sizeId][listId]; } //!< get matrix coefficient 169 160 Bool checkPredMode (UInt sizeId, UInt listId); … … 171 162 UInt getRefMatrixId (UInt sizeId, UInt listId) { return m_refMatrixId[sizeId][listId]; } //!< get reference matrix ID 172 163 Int* getScalingListDefaultAddress (UInt sizeId, UInt listId); //!< get default matrix coefficient 173 174 #if IL_SL_SIGNALLING_N0371175 Void processDefaultMarix (UInt sizeId, UInt listId, UInt layerId );176 #else177 164 Void processDefaultMarix (UInt sizeId, UInt listId); 178 #endif179 180 165 Void setScalingListDC (UInt sizeId, UInt listId, UInt u) { m_scalingListDC[sizeId][listId] = u; } //!< set DC value 181 182 166 Int getScalingListDC (UInt sizeId, UInt listId) { return m_scalingListDC[sizeId][listId]; } //!< get DC value 183 184 #if IL_SL_SIGNALLING_N0371185 Void setLayerId(UInt layerId) { m_layerId = layerId; }186 UInt getLayerId() { return m_layerId; }187 Void checkDcOfMatrix ( UInt m_layerId );188 #else189 167 Void checkDcOfMatrix (); 190 #endif191 192 168 Void processRefMatrix (UInt sizeId, UInt listId , UInt refListId ); 193 169 Bool xParseScalingList (Char* pchFile); … … 200 176 UInt m_refMatrixId [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< RefMatrixID 201 177 Bool m_scalingListPresentFlag; //!< flag for using default matrix 202 203 #if IL_SL_SIGNALLING_N0371204 Bool m_predScalingListFlag; //!< flag for inter-layer scaling-list prediction205 UInt m_scalingListRefLayerId; //!< scaling_list_ref_layer_id206 #endif207 208 178 UInt m_predMatrixId [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< reference list index 209 179 Int *m_scalingListCoef [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< quantization matrix … … 512 482 Int m_layerSetLayerIdList[MAX_VPS_LAYER_SETS_PLUS1][MAX_VPS_LAYER_ID_PLUS1]; 513 483 Int m_numLayerInIdList[MAX_VPS_LAYER_SETS_PLUS1]; 514 #endif515 #if IL_SL_SIGNALLING_N0371516 Bool m_scalingListLayerDependency[MAX_LAYERS][MAX_LAYERS]; // layer dependency for scaling list517 484 #endif 518 485 #if VPS_EXTN_OFFSET … … 730 697 #if VPS_DPB_SIZE_TABLE 731 698 Void deriveNumberOfSubDpbs(); 732 #endif733 #if IL_SL_SIGNALLING_N0371734 Bool checkLayerDependency(UInt i, UInt j);735 Bool getScalingListLayerDependency ( UInt layerId, UInt refLayerId ) { return m_scalingListLayerDependency[layerId][refLayerId]; }736 Void setScalingListLayerDependency ( UInt layerId, UInt refLayerId, Bool val ) { m_scalingListLayerDependency[layerId][refLayerId] = val; }737 699 #endif 738 700 … … 1293 1255 1294 1256 UInt m_layerId; 1295 1296 #if IL_SL_SIGNALLING_N03711297 TComVPS* m_pVPS;1298 static TComSPS* m_pcSPS[MAX_LAYERS];1299 Bool m_predScalingListFlag;1300 UInt m_scalingListRefLayerId;1301 #endif1302 1257 1303 1258 #if REF_IDX_MFM … … 1441 1396 Void setScalingListPresentFlag( Bool b ) { m_scalingListPresentFlag = b; } 1442 1397 1443 #if IL_SL_SIGNALLING_N03711444 Bool getPredScalingListFlag() { return m_predScalingListFlag; }1445 Void setPredScalingListFlag( Bool b ) { m_predScalingListFlag = b; }1446 UInt getScalingListRefLayerId() { return m_scalingListRefLayerId; }1447 Void setScalingListRefLayerId( UInt b ) { m_scalingListRefLayerId = b; }1448 1449 TComVPS* getVPS() { return m_pVPS; }1450 Void setVPS( TComVPS* vps ) { m_pVPS = vps; }1451 static TComSPS* getSPS(UInt layerId) { return m_pcSPS[layerId]; }1452 static Void setSPS(UInt layerId, TComSPS* sps) { m_pcSPS[layerId] = sps; }1453 #endif1454 1455 1398 #if SCALINGLIST_INFERRING 1456 1399 Void setScalingList( TComScalingList *scalingList ) { m_scalingList = scalingList; } … … 1607 1550 Bool m_scalingListPresentFlag; 1608 1551 1609 #if SVC_EXTENSION1610 UInt m_layerId;1611 1612 #if IL_SL_SIGNALLING_N03711613 static TComPPS* m_pcPPS[MAX_LAYERS];1614 Bool m_predScalingListFlag;1615 UInt m_scalingListRefLayerId;1616 #endif1617 1618 #endif1619 1620 1552 TComScalingList* m_scalingList; //!< ScalingList class pointer 1621 1553 … … 1624 1556 Int m_numExtraSliceHeaderBits; 1625 1557 1558 #if SVC_EXTENSION 1626 1559 #if SCALINGLIST_INFERRING 1560 UInt m_layerId; 1627 1561 Bool m_inferScalingListFlag; 1628 1562 UInt m_scalingListRefLayerId; 1563 #endif 1629 1564 #endif 1630 1565 … … 1746 1681 Void setInferScalingListFlag( Bool flag ) { m_inferScalingListFlag = flag; } 1747 1682 Void setScalingListRefLayerId( UInt layerId ) { m_scalingListRefLayerId = layerId; } 1748 #endif1749 #if IL_SL_SIGNALLING_N03711750 Void setLayerId(UInt layerId) { m_layerId = layerId; }1751 UInt getLayerId() { return m_layerId; }1752 1753 Bool getPredScalingListFlag() { return m_predScalingListFlag; }1754 Void setPredScalingListFlag( Bool b ) { m_predScalingListFlag = b; }1755 UInt getScalingListRefLayerId() { return m_scalingListRefLayerId; }1756 Void setScalingListRefLayerId( UInt b ) { m_scalingListRefLayerId = b; }1757 1758 static TComPPS* getPPS(UInt layerId) { return m_pcPPS[layerId]; }1759 static Void setPPS(UInt layerId, TComPPS* pps) { m_pcPPS[layerId] = pps; }1760 1683 #endif 1761 1684 … … 2159 2082 Void setScalingList ( TComScalingList* scalingList ) { m_scalingList = scalingList; } 2160 2083 TComScalingList* getScalingList () { return m_scalingList; } 2161 2162 #if IL_SL_SIGNALLING_N03712163 Void setDefaultScalingList ( UInt m_layerId );2164 #else2165 2084 Void setDefaultScalingList (); 2166 #endif2167 2168 2085 Bool checkDefaultScalingList (); 2169 2086 Void setCabacInitFlag ( Bool val ) { m_cabacInitFlag = val; } //!< set CABAC initial flag -
branches/SHM-4.1-dev/source/Lib/TLibCommon/TComTrQuant.cpp
r442 r529 2494 2494 /** set flat matrix value to quantized coefficient 2495 2495 */ 2496 #if IL_SL_SIGNALLING_N03712497 Void TComTrQuant::setFlatScalingList( UInt m_layerId )2498 #else2499 2496 Void TComTrQuant::setFlatScalingList() 2500 #endif2501 2497 { 2502 2498 UInt size,list; … … 2507 2503 for(list = 0; list < g_scalingListNum[size]; list++) 2508 2504 { 2509 #if IL_SL_SIGNALLING_N03712510 ref_scalingListDC[m_layerId][size][list] = SCALING_LIST_DC;2511 for(UInt i=0; i<MAX_MATRIX_COEF_NUM; i++)2512 {2513 ref_scalingListCoef[m_layerId][size][list][i] = SCALING_LIST_DC;2514 }2515 #endif2516 2517 2505 for(qp=0;qp<SCALING_LIST_REM_NUM;qp++) 2518 2506 { -
branches/SHM-4.1-dev/source/Lib/TLibCommon/TComTrQuant.h
r442 r529 181 181 Void setUseScalingList ( Bool bUseScalingList){ m_scalingListEnabledFlag = bUseScalingList; }; 182 182 Bool getUseScalingList (){ return m_scalingListEnabledFlag; }; 183 184 #if IL_SL_SIGNALLING_N0371185 Void setFlatScalingList ( UInt m_layerId );186 #else187 183 Void setFlatScalingList (); 188 #endif189 190 184 Void xsetFlatScalingList ( UInt list, UInt size, UInt qp); 191 185 Void xSetScalingListEnc ( TComScalingList *scalingList, UInt list, UInt size, UInt qp); -
branches/SHM-4.1-dev/source/Lib/TLibCommon/TypeDef.h
r528 r529 63 63 #define RPL_INIT_N0316_N0082 1 ///< JCTVC-N0316, JCTVC-N0082: initial reference picture list construction 64 64 65 #define IL_SL_SIGNALLING_N0371 0 ///< JCTVC-N0371: inter-layer scaling list66 65 #define SCALINGLIST_INFERRING 1 ///< JCTVC-N0371: inter-layer scaling list 67 66 #define M0463_VUI_EXT_ILP_REF 0 ///< JCTVC-M0463: VUI extension inter-layer dependency offset signalling -
branches/SHM-4.1-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp
r528 r529 313 313 READ_FLAG( uiCode, "pps_scaling_list_data_present_flag" ); pcPPS->setScalingListPresentFlag( uiCode ? true : false ); 314 314 315 #if IL_SL_SIGNALLING_N0371316 pcPPS->setPPS( pcPPS->getLayerId(), pcPPS );317 #endif318 319 315 if(pcPPS->getScalingListPresentFlag ()) 320 316 { 321 #if IL_SL_SIGNALLING_N0371322 pcPPS->getScalingList()->setLayerId( pcPPS->getLayerId() );323 324 if( pcPPS->getLayerId() > 0 )325 {326 READ_FLAG( uiCode, "pps_pred_scaling_list_flag" ); pcPPS->setPredScalingListFlag( uiCode ? true : false );327 pcPPS->getScalingList()->setPredScalingListFlag( pcPPS->getPredScalingListFlag() );328 329 if( pcPPS->getPredScalingListFlag() )330 {331 READ_UVLC ( uiCode, "scaling_list_pps_ref_layer_id" ); pcPPS->setScalingListRefLayerId( uiCode );332 333 // The value of pps_scaling_list_ref_layer_id shall be in the range of 0 to 62, inclusive334 assert( /*pcPPS->getScalingListRefLayerId() >= 0 &&*/ pcPPS->getScalingListRefLayerId() <= 62 );335 336 // 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 0337 if( pcPPS->getSPS()->getVPS()->getAvcBaseLayerFlag() )338 {339 assert( pcPPS->getScalingListRefLayerId() > 0 );340 }341 342 // 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 and343 // 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_id344 assert( pcPPS->getPPS( pcPPS->getScalingListRefLayerId() )->getPredScalingListFlag() == false );345 346 // 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,347 // 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 nuhLayerIdB348 assert( pcPPS->getSPS()->getVPS()->getScalingListLayerDependency( pcPPS->getLayerId(), pcPPS->getScalingListRefLayerId() ) == true );349 350 pcPPS->getScalingList()->setScalingListRefLayerId( pcPPS->getScalingListRefLayerId() );351 parseScalingList( pcPPS->getScalingList() );352 }353 else354 {355 parseScalingList( pcPPS->getScalingList() );356 }357 }358 else359 {360 parseScalingList( pcPPS->getScalingList() );361 }362 #else363 317 parseScalingList( pcPPS->getScalingList() ); 364 #endif365 318 } 366 319 … … 588 541 pcSPS->setTemporalIdNestingFlag( parameterSetManager->getPrefetchedVPS(pcSPS->getVPSId())->getTemporalNestingFlag() ); 589 542 } 590 #if IL_SL_SIGNALLING_N0371591 pcSPS->setVPS( parameterSetManager->getPrefetchedVPS(pcSPS->getVPSId()) );592 pcSPS->setSPS( pcSPS->getLayerId(), pcSPS );593 #endif594 543 #endif 595 544 if ( pcSPS->getMaxTLayers() == 1 ) … … 762 711 if(pcSPS->getScalingListPresentFlag ()) 763 712 { 764 765 #if IL_SL_SIGNALLING_N0371766 pcSPS->getScalingList()->setLayerId( pcSPS->getLayerId() );767 768 if( pcSPS->getLayerId() > 0 )769 {770 READ_FLAG( uiCode, "sps_pred_scaling_list_flag" ); pcSPS->setPredScalingListFlag ( uiCode );771 pcSPS->getScalingList()->setPredScalingListFlag( pcSPS->getPredScalingListFlag() );772 773 if( pcSPS->getPredScalingListFlag() )774 {775 READ_UVLC( uiCode, "scaling_list_sps_ref_layer_id" ); pcSPS->setScalingListRefLayerId( uiCode );776 777 // The value of sps_scaling_list_ref_layer_id shall be in the range of 0 to 62, inclusive778 assert( /*pcSPS->getScalingListRefLayerId() >= 0 &&*/ pcSPS->getScalingListRefLayerId() <= 62 );779 780 // 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 0781 if( pcSPS->getVPS()->getAvcBaseLayerFlag() )782 {783 assert( pcSPS->getScalingListRefLayerId() > 0 );784 }785 786 // 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 and787 // 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_id788 assert( pcSPS->getSPS( pcSPS->getScalingListRefLayerId() )->getPredScalingListFlag() == false );789 790 // 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,791 // 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 nuhLayerIdB792 assert( pcSPS->getVPS()->getScalingListLayerDependency( pcSPS->getLayerId(), pcSPS->getScalingListRefLayerId() ) == true );793 794 pcSPS->getScalingList()->setScalingListRefLayerId( pcSPS->getScalingListRefLayerId() );795 parseScalingList( pcSPS->getScalingList() );796 }797 else798 {799 parseScalingList( pcSPS->getScalingList() );800 }801 }802 else803 {804 parseScalingList( pcSPS->getScalingList() );805 }806 #else807 713 parseScalingList( pcSPS->getScalingList() ); 808 #endif809 810 714 } 811 715 #if SCALINGLIST_INFERRING … … 1502 1406 } 1503 1407 } 1504 #endif1505 1506 #if IL_SL_SIGNALLING_N03711507 for(i = 1; i < vps->getMaxLayers(); i++)1508 {1509 for(j = 0; j < i; j++)1510 {1511 vps->setScalingListLayerDependency( i, j, vps->checkLayerDependency( i,j ) );1512 }1513 }1514 1408 #endif 1515 1409 … … 2930 2824 for(listId = 0; listId < g_scalingListNum[sizeId]; listId++) 2931 2825 { 2932 #if IL_SL_SIGNALLING_N03712933 if ( scalingList->getLayerId() > 0 && scalingList->getPredScalingListFlag() )2934 {2935 READ_FLAG( code, "scaling_list_pred_mode_flag");2936 scalingListPredModeFlag = (code) ? true : false;2937 if(!scalingListPredModeFlag) //Copy Mode2938 {2939 READ_UVLC( code, "scaling_list_pred_matrix_id_delta");2940 scalingList->setRefMatrixId (sizeId,listId,(UInt)((Int)(listId)-(code)));2941 if( sizeId > SCALING_LIST_8x8 )2942 {2943 scalingList->setScalingListDC(sizeId,listId,((listId == scalingList->getRefMatrixId (sizeId,listId))? 16 :scalingList->getScalingListDC(sizeId, scalingList->getRefMatrixId (sizeId,listId))));2944 }2945 scalingList->processRefMatrix( sizeId, listId, scalingList->getRefMatrixId (sizeId,listId));2946 2947 }2948 else //DPCM Mode2949 {2950 xDecodeScalingList(scalingList, sizeId, listId);2951 }2952 }2953 else2954 {2955 READ_FLAG( code, "scaling_list_pred_mode_flag");2956 scalingListPredModeFlag = (code) ? true : false;2957 if(!scalingListPredModeFlag) //Copy Mode2958 {2959 READ_UVLC( code, "scaling_list_pred_matrix_id_delta");2960 scalingList->setRefMatrixId (sizeId,listId,(UInt)((Int)(listId)-(code)));2961 if( sizeId > SCALING_LIST_8x8 )2962 {2963 scalingList->setScalingListDC(sizeId,listId,((listId == scalingList->getRefMatrixId (sizeId,listId))? 16 :scalingList->getScalingListDC(sizeId, scalingList->getRefMatrixId (sizeId,listId))));2964 }2965 scalingList->processRefMatrix( sizeId, listId, scalingList->getRefMatrixId (sizeId,listId));2966 2967 }2968 else //DPCM Mode2969 {2970 xDecodeScalingList(scalingList, sizeId, listId);2971 }2972 }2973 #else2974 2826 READ_FLAG( code, "scaling_list_pred_mode_flag"); 2975 2827 scalingListPredModeFlag = (code) ? true : false; … … 2989 2841 xDecodeScalingList(scalingList, sizeId, listId); 2990 2842 } 2991 #endif2992 2843 } 2993 2844 } … … 3011 2862 if( sizeId > SCALING_LIST_8x8 ) 3012 2863 { 3013 #if IL_SL_SIGNALLING_N03713014 if( scalingList->getLayerId() > 0 && scalingList->getPredScalingListFlag() )3015 {3016 ref_scalingListDC[scalingList->getLayerId()][sizeId][listId] = scalingList->getScalingListDC(sizeId,listId);3017 scalingList->setScalingListDC(sizeId,listId,ref_scalingListDC[scalingList->getScalingListRefLayerId()][sizeId][listId]);3018 }3019 else3020 {3021 READ_SVLC( scalingListDcCoefMinus8, "scaling_list_dc_coef_minus8");3022 scalingList->setScalingListDC(sizeId,listId,scalingListDcCoefMinus8 + 8);3023 nextCoef = scalingList->getScalingListDC(sizeId,listId);3024 ref_scalingListDC[scalingList->getLayerId()][sizeId][listId] = scalingList->getScalingListDC(sizeId,listId);3025 }3026 #else3027 2864 READ_SVLC( scalingListDcCoefMinus8, "scaling_list_dc_coef_minus8"); 3028 2865 scalingList->setScalingListDC(sizeId,listId,scalingListDcCoefMinus8 + 8); 3029 2866 nextCoef = scalingList->getScalingListDC(sizeId,listId); 3030 #endif3031 2867 } 3032 2868 3033 2869 for(i = 0; i < coefNum; i++) 3034 2870 { 3035 #if IL_SL_SIGNALLING_N03713036 if( scalingList->getLayerId() > 0 && scalingList->getPredScalingListFlag() )3037 {3038 ref_scalingListCoef[scalingList->getLayerId()][sizeId][listId][i] = dst[scan[i]];3039 dst[scan[i]] = ref_scalingListCoef[scalingList->getScalingListRefLayerId()][sizeId][listId][i];3040 }3041 else3042 {3043 READ_SVLC( data, "scaling_list_delta_coef");3044 nextCoef = (nextCoef + data + 256 ) % 256;3045 dst[scan[i]] = nextCoef;3046 ref_scalingListCoef[scalingList->getLayerId()][sizeId][listId][i] = dst[scan[i]];3047 }3048 #else3049 2871 READ_SVLC( data, "scaling_list_delta_coef"); 3050 2872 nextCoef = (nextCoef + data + 256 ) % 256; 3051 2873 dst[scan[i]] = nextCoef; 3052 #endif3053 2874 } 3054 2875 } -
branches/SHM-4.1-dev/source/Lib/TLibDecoder/TDecTop.cpp
r528 r529 1465 1465 if(pcSlice->getSPS()->getScalingListFlag()) 1466 1466 { 1467 #if IL_SL_SIGNALLING_N03711468 pcSlice->getSPS()->getScalingList()->setLayerId( m_layerId );1469 #endif1470 1471 1467 pcSlice->setScalingList ( pcSlice->getSPS()->getScalingList() ); 1472 1468 1473 1469 if(pcSlice->getPPS()->getScalingListPresentFlag()) 1474 1470 { 1475 #if IL_SL_SIGNALLING_N03711476 pcSlice->getPPS()->getScalingList()->setLayerId( m_layerId );1477 #endif1478 1479 1471 pcSlice->setScalingList ( pcSlice->getPPS()->getScalingList() ); 1480 1472 } … … 1484 1476 if(!pcSlice->getPPS()->getScalingListPresentFlag() && !pcSlice->getSPS()->getScalingListPresentFlag()) 1485 1477 { 1486 #if IL_SL_SIGNALLING_N03711487 pcSlice->setDefaultScalingList( m_layerId );1488 #else1489 1478 pcSlice->setDefaultScalingList(); 1490 #endif1491 1479 } 1492 1480 m_cTrQuant.setScalingListDec(pcSlice->getScalingList()); … … 1495 1483 else 1496 1484 { 1497 #if IL_SL_SIGNALLING_N03711498 m_cTrQuant.setFlatScalingList( m_layerId );1499 #else1500 1485 m_cTrQuant.setFlatScalingList(); 1501 #endif1502 1486 m_cTrQuant.setUseScalingList(false); 1503 1487 } … … 1543 1527 TComPPS* pps = new TComPPS(); 1544 1528 1545 #if SCALINGLIST_INFERRING || IL_SL_SIGNALLING_N03711529 #if SCALINGLIST_INFERRING 1546 1530 pps->setLayerId( m_layerId ); 1547 1531 #endif -
branches/SHM-4.1-dev/source/Lib/TLibEncoder/TEncCavlc.cpp
r528 r529 240 240 WRITE_FLAG( pcPPS->getScalingListPresentFlag() ? 1 : 0, "pps_scaling_list_data_present_flag" ); 241 241 242 #if IL_SL_SIGNALLING_N0371243 pcPPS->setPPS( pcPPS->getLayerId(), pcPPS );244 #endif245 246 242 if( pcPPS->getScalingListPresentFlag() ) 247 243 { … … 249 245 printf("PPS\n"); 250 246 #endif 251 252 #if IL_SL_SIGNALLING_N0371253 m_pcSlice->getScalingList()->setLayerId( pcPPS->getLayerId() );254 255 if( pcPPS->getLayerId() > 0 )256 {257 WRITE_FLAG( pcPPS->getPredScalingListFlag() ? 1 : 0, "pps_pred_scaling_list_flag" );258 m_pcSlice->getScalingList()->setPredScalingListFlag( pcPPS->getPredScalingListFlag() );259 260 if( pcPPS->getPredScalingListFlag() )261 {262 // The value of pps_scaling_list_ref_layer_id shall be in the range of 0 to 62, inclusive263 assert( /*pcPPS->getScalingListRefLayerId() >= 0 &&*/ pcPPS->getScalingListRefLayerId() <= 62 );264 265 // 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 0266 if( pcPPS->getSPS()->getVPS()->getAvcBaseLayerFlag() )267 {268 assert( pcPPS->getScalingListRefLayerId() > 0 );269 }270 271 // 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 and272 // 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_id273 assert( pcPPS->getPPS( pcPPS->getScalingListRefLayerId() )->getPredScalingListFlag() == false );274 275 // 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,276 // 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 nuhLayerIdB277 assert( pcPPS->getSPS()->getVPS()->getScalingListLayerDependency( pcPPS->getLayerId(), pcPPS->getScalingListRefLayerId() ) == true );278 279 WRITE_UVLC( pcPPS->getScalingListRefLayerId(), "scaling_list_pps_ref_layer_id" );280 m_pcSlice->getScalingList()->setScalingListRefLayerId( pcPPS->getScalingListRefLayerId() );281 codeScalingList( m_pcSlice->getScalingList() );282 }283 else284 {285 codeScalingList( m_pcSlice->getScalingList() );286 }287 }288 else289 {290 codeScalingList( m_pcSlice->getScalingList() );291 }292 #else293 247 codeScalingList( m_pcSlice->getScalingList() ); 294 #endif295 248 } 296 249 … … 569 522 WRITE_FLAG( pcSPS->getScalingListFlag() ? 1 : 0, "scaling_list_enabled_flag" ); 570 523 571 #if IL_SL_SIGNALLING_N0371572 pcSPS->setSPS( pcSPS->getLayerId(), pcSPS );573 #endif574 575 524 if(pcSPS->getScalingListFlag()) 576 525 { … … 597 546 printf("SPS\n"); 598 547 #endif 599 600 #if IL_SL_SIGNALLING_N0371601 m_pcSlice->getScalingList()->setLayerId( pcSPS->getLayerId() );602 603 if( pcSPS->getLayerId() > 0 )604 {605 WRITE_FLAG( pcSPS->getPredScalingListFlag() ? 1 : 0, "sps_pred_scaling_list_flag" );606 m_pcSlice->getScalingList()->setPredScalingListFlag( pcSPS->getPredScalingListFlag() );607 608 if( pcSPS->getPredScalingListFlag() )609 {610 611 // The value of sps_scaling_list_ref_layer_id shall be in the range of 0 to 62, inclusive612 assert( /*pcSPS->getScalingListRefLayerId() >= 0 &&*/ pcSPS->getScalingListRefLayerId() <= 62 );613 614 // 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 0615 if( pcSPS->getVPS()->getAvcBaseLayerFlag() )616 {617 assert( pcSPS->getScalingListRefLayerId() > 0 );618 }619 620 // 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 and621 // 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_id622 assert( pcSPS->getSPS( pcSPS->getScalingListRefLayerId() )->getPredScalingListFlag() == false );623 624 // 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,625 // 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 nuhLayerIdB626 assert( pcSPS->getVPS()->getScalingListLayerDependency( pcSPS->getLayerId(), pcSPS->getScalingListRefLayerId() ) == true );627 628 WRITE_UVLC( pcSPS->getScalingListRefLayerId(), "scaling_list_sps_ref_layer_id" );629 m_pcSlice->getScalingList()->setScalingListRefLayerId( pcSPS->getScalingListRefLayerId() );630 codeScalingList( m_pcSlice->getScalingList() );631 }632 else633 {634 codeScalingList( m_pcSlice->getScalingList() );635 }636 }637 else638 {639 548 codeScalingList( m_pcSlice->getScalingList() ); 640 }641 #else642 codeScalingList( m_pcSlice->getScalingList() );643 #endif644 645 549 } 646 550 #if SCALINGLIST_INFERRING … … 1175 1079 } 1176 1080 #endif 1177 1178 #if IL_SL_SIGNALLING_N03711179 for(i = 1; i < vps->getMaxLayers(); i++)1180 {1181 for(j = 0; j < i; j++)1182 {1183 vps->setScalingListLayerDependency( i, j, vps->checkLayerDependency( i,j ) );1184 }1185 }1186 #endif1187 1188 1081 #endif 1189 1082 #if M0040_ADAPTIVE_RESOLUTION_CHANGE … … 2226 2119 startBit = m_pcBitIf->getNumberOfWrittenBits(); 2227 2120 #endif 2228 2229 #if IL_SL_SIGNALLING_N03712230 if( scalingList->getLayerId() > 0 && scalingList->getPredScalingListFlag() )2231 {2232 scalingListPredModeFlag = scalingList->checkPredMode( sizeId, listId );2233 WRITE_FLAG( scalingListPredModeFlag, "scaling_list_pred_mode_flag" );2234 if(!scalingListPredModeFlag)// Copy Mode2235 {2236 WRITE_UVLC( (Int)listId - (Int)scalingList->getRefMatrixId (sizeId,listId), "scaling_list_pred_matrix_id_delta");2237 }2238 else// DPCM Mode2239 {2240 xCodeScalingList(scalingList, sizeId, listId);2241 }2242 }2243 else2244 {2245 scalingListPredModeFlag = scalingList->checkPredMode( sizeId, listId );2246 WRITE_FLAG( scalingListPredModeFlag, "scaling_list_pred_mode_flag" );2247 if(!scalingListPredModeFlag)// Copy Mode2248 {2249 WRITE_UVLC( (Int)listId - (Int)scalingList->getRefMatrixId (sizeId,listId), "scaling_list_pred_matrix_id_delta");2250 }2251 else// DPCM Mode2252 {2253 xCodeScalingList(scalingList, sizeId, listId);2254 }2255 }2256 #else2257 2121 scalingListPredModeFlag = scalingList->checkPredMode( sizeId, listId ); 2258 2122 WRITE_FLAG( scalingListPredModeFlag, "scaling_list_pred_mode_flag" ); … … 2265 2129 xCodeScalingList(scalingList, sizeId, listId); 2266 2130 } 2267 #endif2268 2131 2269 2132 #if SCALING_LIST_OUTPUT_RESULT … … 2291 2154 Int *src = scalingList->getScalingListAddress(sizeId, listId); 2292 2155 2293 if( sizeId > SCALING_LIST_8x8 ) 2294 { 2295 #if IL_SL_SIGNALLING_N0371 2296 if( scalingList->getLayerId() > 0 && scalingList->getPredScalingListFlag() ) 2297 { 2298 ref_scalingListDC[scalingList->getLayerId()][sizeId][listId] = scalingList->getScalingListDC(sizeId,listId); 2299 scalingList->setScalingListDC(sizeId,listId,ref_scalingListDC[scalingList->getScalingListRefLayerId()][sizeId][listId]); 2300 } 2301 else 2302 { 2303 WRITE_SVLC( scalingList->getScalingListDC(sizeId,listId) - 8, "scaling_list_dc_coef_minus8"); 2304 nextCoef = scalingList->getScalingListDC(sizeId,listId); 2305 ref_scalingListDC[scalingList->getLayerId()][sizeId][listId] = scalingList->getScalingListDC(sizeId,listId); 2306 } 2307 #else 2308 WRITE_SVLC( scalingList->getScalingListDC(sizeId,listId) - 8, "scaling_list_dc_coef_minus8"); 2309 nextCoef = scalingList->getScalingListDC(sizeId,listId); 2310 #endif 2311 } 2312 for(Int i=0;i<coefNum;i++) 2313 { 2314 #if IL_SL_SIGNALLING_N0371 2315 if( scalingList->getLayerId() > 0 && scalingList->getPredScalingListFlag() ) 2316 { 2317 ref_scalingListCoef[scalingList->getLayerId()][sizeId][listId][i] = src[scan[i]]; 2318 src[scan[i]] = ref_scalingListCoef[scalingList->getScalingListRefLayerId()][sizeId][listId][i]; 2319 } 2320 else 2321 { 2322 data = src[scan[i]] - nextCoef; 2323 ref_scalingListCoef[scalingList->getLayerId()][sizeId][listId][i] = src[scan[i]]; 2324 nextCoef = src[scan[i]]; 2325 if(data > 127) 2326 { 2327 data = data - 256; 2328 } 2329 if(data < -128) 2330 { 2331 data = data + 256; 2332 } 2333 2334 WRITE_SVLC( data, "scaling_list_delta_coef"); 2335 } 2336 #else 2337 data = src[scan[i]] - nextCoef; 2338 nextCoef = src[scan[i]]; 2339 if(data > 127) 2340 { 2341 data = data - 256; 2342 } 2343 if(data < -128) 2344 { 2345 data = data + 256; 2346 } 2347 2348 WRITE_SVLC( data, "scaling_list_delta_coef"); 2349 #endif 2350 } 2156 if( sizeId > SCALING_LIST_8x8 ) 2157 { 2158 WRITE_SVLC( scalingList->getScalingListDC(sizeId,listId) - 8, "scaling_list_dc_coef_minus8"); 2159 nextCoef = scalingList->getScalingListDC(sizeId,listId); 2160 } 2161 for(Int i=0;i<coefNum;i++) 2162 { 2163 data = src[scan[i]] - nextCoef; 2164 nextCoef = src[scan[i]]; 2165 if(data > 127) 2166 { 2167 data = data - 256; 2168 } 2169 if(data < -128) 2170 { 2171 data = data + 256; 2172 } 2173 2174 WRITE_SVLC( data, "scaling_list_delta_coef"); 2175 } 2351 2176 } 2352 2177 Bool TEncCavlc::findMatchingLTRP ( TComSlice* pcSlice, UInt *ltrpsIndex, Int ltrpPOC, Bool usedFlag ) -
branches/SHM-4.1-dev/source/Lib/TLibEncoder/TEncGOP.cpp
r528 r529 661 661 #endif 662 662 663 #if IL_SL_SIGNALLING_N0371664 m_pcEncTop->getScalingList()->setLayerId( m_layerId );665 #endif666 667 663 pcSlice->setLastIDR(m_iLastIDR); 668 664 pcSlice->setSliceIdx(0); … … 672 668 if(m_pcEncTop->getUseScalingListId() == SCALING_LIST_OFF) 673 669 { 674 #if IL_SL_SIGNALLING_N0371675 m_pcEncTop->getTrQuant()->setFlatScalingList( m_layerId );676 #else677 670 m_pcEncTop->getTrQuant()->setFlatScalingList(); 678 #endif679 671 m_pcEncTop->getTrQuant()->setUseScalingList(false); 680 672 m_pcEncTop->getSPS()->setScalingListPresentFlag(false); … … 700 692 { 701 693 #endif 702 #if IL_SL_SIGNALLING_N0371703 pcSlice->getScalingList()->setLayerId( m_layerId );704 #endif705 706 #if IL_SL_SIGNALLING_N0371707 pcSlice->setDefaultScalingList ( m_layerId );708 #else709 694 pcSlice->setDefaultScalingList (); 710 #endif711 712 695 m_pcEncTop->getSPS()->setScalingListPresentFlag(false); 713 696 m_pcEncTop->getPPS()->setScalingListPresentFlag(false); … … 722 705 else if(m_pcEncTop->getUseScalingListId() == SCALING_LIST_FILE_READ) 723 706 { 724 #if IL_SL_SIGNALLING_N0371725 pcSlice->getScalingList()->setLayerId( m_layerId );726 #endif727 728 707 #if SCALINGLIST_INFERRING 729 708 // inferring of the scaling list can be moved to the config file … … 746 725 if(pcSlice->getScalingList()->xParseScalingList(m_pcCfg->getScalingListFile())) 747 726 { 748 #if IL_SL_SIGNALLING_N0371749 pcSlice->setDefaultScalingList ( m_layerId );750 #else751 727 pcSlice->setDefaultScalingList (); 752 #endif 753 } 754 #if IL_SL_SIGNALLING_N0371 755 pcSlice->getScalingList()->checkDcOfMatrix( m_layerId ); 756 #else 728 } 729 757 730 pcSlice->getScalingList()->checkDcOfMatrix(); 758 #endif759 731 m_pcEncTop->getSPS()->setScalingListPresentFlag(pcSlice->checkDefaultScalingList()); 760 761 #if IL_SL_SIGNALLING_N0371762 if( m_layerId > 0 )763 {764 m_pcEncTop->getSPS()->setPredScalingListFlag (true);765 m_pcEncTop->getSPS()->setScalingListRefLayerId( 0 );766 }767 #endif768 769 732 m_pcEncTop->getPPS()->setScalingListPresentFlag(false); 770 771 #if IL_SL_SIGNALLING_N0371772 if( m_layerId > 0 )773 {774 m_pcEncTop->getPPS()->setPredScalingListFlag (false);775 m_pcEncTop->getPPS()->setScalingListRefLayerId( 0 );776 }777 #endif778 733 779 734 #if SCALINGLIST_INFERRING … … 1778 1733 #if SVC_EXTENSION 1779 1734 nalu = NALUnit(NAL_UNIT_SPS, 0, m_layerId); 1780 #if IL_SL_SIGNALLING_N03711781 pcSlice->getSPS()->setVPS( pcSlice->getVPS() );1782 #endif1783 1735 #else 1784 1736 nalu = NALUnit(NAL_UNIT_SPS); -
branches/SHM-4.1-dev/source/Lib/TLibEncoder/TEncTop.cpp
r528 r529 1074 1074 Void TEncTop::xInitPPS() 1075 1075 { 1076 #if SCALINGLIST_INFERRING || IL_SL_SIGNALLING_N03711076 #if SCALINGLIST_INFERRING 1077 1077 m_cPPS.setLayerId( m_layerId ); 1078 1078 #endif
Note: See TracChangeset for help on using the changeset viewer.