Changeset 529 in SHVCSoftware for branches/SHM-4.1-dev/source/Lib/TLibEncoder


Ignore:
Timestamp:
25 Dec 2013, 05:53:40 (12 years ago)
Author:
seregin
Message:

remove IL_SL_SIGNALLING_N0371 macro and related code

Location:
branches/SHM-4.1-dev/source/Lib/TLibEncoder
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-4.1-dev/source/Lib/TLibEncoder/TEncCavlc.cpp

    r528 r529  
    240240  WRITE_FLAG( pcPPS->getScalingListPresentFlag() ? 1 : 0,                          "pps_scaling_list_data_present_flag" );
    241241
    242 #if IL_SL_SIGNALLING_N0371
    243   pcPPS->setPPS( pcPPS->getLayerId(), pcPPS ); 
    244 #endif
    245 
    246242  if( pcPPS->getScalingListPresentFlag() )
    247243  {
     
    249245    printf("PPS\n");
    250246#endif
    251 
    252 #if IL_SL_SIGNALLING_N0371
    253     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, inclusive
    263         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 0
    266         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 and
    272         // 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
    273         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 nuhLayerIdB
    277         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       else
    284       {
    285         codeScalingList( m_pcSlice->getScalingList() );
    286       }
    287     }
    288     else
    289     {
    290       codeScalingList( m_pcSlice->getScalingList() );
    291     }
    292 #else
    293247    codeScalingList( m_pcSlice->getScalingList() );
    294 #endif
    295248  }
    296249
     
    569522  WRITE_FLAG( pcSPS->getScalingListFlag() ? 1 : 0,                                   "scaling_list_enabled_flag" );
    570523
    571 #if IL_SL_SIGNALLING_N0371
    572   pcSPS->setSPS( pcSPS->getLayerId(), pcSPS );
    573 #endif
    574 
    575524  if(pcSPS->getScalingListFlag())
    576525  {
     
    597546    printf("SPS\n");
    598547#endif
    599 
    600 #if IL_SL_SIGNALLING_N0371
    601     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, inclusive
    612         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 0
    615         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 and
    621         // 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
    622         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 nuhLayerIdB
    626         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       else
    633       {
    634         codeScalingList( m_pcSlice->getScalingList() );
    635       }
    636     }
    637     else
    638     {
    639548      codeScalingList( m_pcSlice->getScalingList() );
    640     }
    641 #else
    642       codeScalingList( m_pcSlice->getScalingList() );
    643 #endif
    644 
    645549    }
    646550#if SCALINGLIST_INFERRING
     
    11751079  }
    11761080#endif
    1177 
    1178 #if IL_SL_SIGNALLING_N0371
    1179   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 #endif
    1187 
    11881081#endif
    11891082#if M0040_ADAPTIVE_RESOLUTION_CHANGE
     
    22262119        startBit = m_pcBitIf->getNumberOfWrittenBits();
    22272120#endif
    2228 
    2229 #if IL_SL_SIGNALLING_N0371
    2230         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 Mode
    2235           {
    2236             WRITE_UVLC( (Int)listId - (Int)scalingList->getRefMatrixId (sizeId,listId), "scaling_list_pred_matrix_id_delta");
    2237           }
    2238           else// DPCM Mode
    2239           {
    2240             xCodeScalingList(scalingList, sizeId, listId);
    2241           }
    2242         }
    2243         else
    2244         {
    2245           scalingListPredModeFlag = scalingList->checkPredMode( sizeId, listId );
    2246           WRITE_FLAG( scalingListPredModeFlag, "scaling_list_pred_mode_flag" );
    2247           if(!scalingListPredModeFlag)// Copy Mode
    2248           {
    2249             WRITE_UVLC( (Int)listId - (Int)scalingList->getRefMatrixId (sizeId,listId), "scaling_list_pred_matrix_id_delta");
    2250           }
    2251           else// DPCM Mode
    2252           {
    2253             xCodeScalingList(scalingList, sizeId, listId);
    2254           }
    2255         }
    2256 #else
    22572121        scalingListPredModeFlag = scalingList->checkPredMode( sizeId, listId );
    22582122        WRITE_FLAG( scalingListPredModeFlag, "scaling_list_pred_mode_flag" );
     
    22652129          xCodeScalingList(scalingList, sizeId, listId);
    22662130        }
    2267 #endif
    22682131
    22692132#if SCALING_LIST_OUTPUT_RESULT
     
    22912154  Int *src = scalingList->getScalingListAddress(sizeId, listId);
    22922155
    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  }
    23512176}
    23522177Bool TEncCavlc::findMatchingLTRP ( TComSlice* pcSlice, UInt *ltrpsIndex, Int ltrpPOC, Bool usedFlag )
  • branches/SHM-4.1-dev/source/Lib/TLibEncoder/TEncGOP.cpp

    r528 r529  
    661661#endif
    662662
    663 #if IL_SL_SIGNALLING_N0371
    664     m_pcEncTop->getScalingList()->setLayerId( m_layerId );
    665 #endif
    666 
    667663    pcSlice->setLastIDR(m_iLastIDR);
    668664    pcSlice->setSliceIdx(0);
     
    672668    if(m_pcEncTop->getUseScalingListId() == SCALING_LIST_OFF)
    673669    {
    674 #if IL_SL_SIGNALLING_N0371
    675       m_pcEncTop->getTrQuant()->setFlatScalingList( m_layerId );
    676 #else
    677670      m_pcEncTop->getTrQuant()->setFlatScalingList();
    678 #endif
    679671      m_pcEncTop->getTrQuant()->setUseScalingList(false);
    680672      m_pcEncTop->getSPS()->setScalingListPresentFlag(false);
     
    700692      {
    701693#endif
    702 #if IL_SL_SIGNALLING_N0371
    703       pcSlice->getScalingList()->setLayerId( m_layerId );
    704 #endif
    705 
    706 #if IL_SL_SIGNALLING_N0371
    707       pcSlice->setDefaultScalingList ( m_layerId );
    708 #else
    709694      pcSlice->setDefaultScalingList ();
    710 #endif
    711 
    712695      m_pcEncTop->getSPS()->setScalingListPresentFlag(false);
    713696      m_pcEncTop->getPPS()->setScalingListPresentFlag(false);
     
    722705    else if(m_pcEncTop->getUseScalingListId() == SCALING_LIST_FILE_READ)
    723706    {
    724 #if IL_SL_SIGNALLING_N0371
    725       pcSlice->getScalingList()->setLayerId( m_layerId );
    726 #endif
    727 
    728707#if SCALINGLIST_INFERRING
    729708      // inferring of the scaling list can be moved to the config file
     
    746725      if(pcSlice->getScalingList()->xParseScalingList(m_pcCfg->getScalingListFile()))
    747726      {
    748 #if IL_SL_SIGNALLING_N0371
    749         pcSlice->setDefaultScalingList ( m_layerId );
    750 #else
    751727        pcSlice->setDefaultScalingList ();
    752 #endif
    753       }
    754 #if IL_SL_SIGNALLING_N0371
    755       pcSlice->getScalingList()->checkDcOfMatrix( m_layerId );
    756 #else
     728      }
     729
    757730      pcSlice->getScalingList()->checkDcOfMatrix();
    758 #endif
    759731      m_pcEncTop->getSPS()->setScalingListPresentFlag(pcSlice->checkDefaultScalingList());
    760 
    761 #if IL_SL_SIGNALLING_N0371
    762       if( m_layerId > 0 )
    763       {
    764         m_pcEncTop->getSPS()->setPredScalingListFlag  (true);
    765         m_pcEncTop->getSPS()->setScalingListRefLayerId( 0 );
    766       }
    767 #endif
    768 
    769732      m_pcEncTop->getPPS()->setScalingListPresentFlag(false);
    770 
    771 #if IL_SL_SIGNALLING_N0371
    772       if( m_layerId > 0 )
    773       {
    774         m_pcEncTop->getPPS()->setPredScalingListFlag  (false);
    775         m_pcEncTop->getPPS()->setScalingListRefLayerId( 0   );
    776       }
    777 #endif
    778733
    779734#if SCALINGLIST_INFERRING
     
    17781733#if SVC_EXTENSION
    17791734      nalu = NALUnit(NAL_UNIT_SPS, 0, m_layerId);
    1780 #if IL_SL_SIGNALLING_N0371
    1781       pcSlice->getSPS()->setVPS( pcSlice->getVPS() );
    1782 #endif
    17831735#else
    17841736      nalu = NALUnit(NAL_UNIT_SPS);
  • branches/SHM-4.1-dev/source/Lib/TLibEncoder/TEncTop.cpp

    r528 r529  
    10741074Void TEncTop::xInitPPS()
    10751075{
    1076 #if SCALINGLIST_INFERRING ||  IL_SL_SIGNALLING_N0371
     1076#if SCALINGLIST_INFERRING
    10771077  m_cPPS.setLayerId( m_layerId );
    10781078#endif
Note: See TracChangeset for help on using the changeset viewer.