Changeset 529 in SHVCSoftware for branches/SHM-4.1-dev/source/Lib/TLibEncoder
- Timestamp:
- 25 Dec 2013, 05:53:40 (12 years ago)
- Location:
- branches/SHM-4.1-dev/source/Lib/TLibEncoder
- Files:
-
- 3 edited
-
TEncCavlc.cpp (modified) (8 diffs)
-
TEncGOP.cpp (modified) (6 diffs)
-
TEncTop.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
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.