Changeset 1487 in SHVCSoftware


Ignore:
Timestamp:
24 Nov 2015, 03:13:36 (9 years ago)
Author:
fujitsu
Message:

Added support of scalable range extension profiles. Also corrected few issues such as the confWindow wrong initialization. Code is controlled by the macro SCALABLE_REXT.

Location:
branches/SHM-dev
Files:
9 added
16 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp

    r1475 r1487  
    5757
    5858
    59 
     59#if !SCALABLE_REXT
    6060enum ExtendedProfileName // this is used for determining profile strings, where multiple profiles map to a single profile idc with various constraint flag combinations
    6161{
     
    7070  SCALABLEMAIN = 7,
    7171  SCALABLEMAIN10 = 8,
     72#if SCALABLE_REXT
     73  SCALABLEREXT = 10,
     74#endif
    7275#endif
    7376  // The following are RExt profiles, which would map to the MAINREXT profile idc.
     
    7578  //                           the chroma format in the next digit
    7679  //                           the intra constraint in the next digit
    77   //                           If it is a RExt still picture, there is a '1' for the top digit.
     80  //                           If it is a RExt still picture, there is a '1' for the next digit,
     81  //                           If it is a Scalable Rext profile, there is a '1' for the top digit.
    7882  MONOCHROME_8      = 1008,
    7983  MONOCHROME_12     = 1012,
     
    97101  MAIN_444_STILL_PICTURE = 11308,
    98102  MAIN_444_16_STILL_PICTURE = 12316
     103#if SCALABLE_REXT
     104  ,
     105  SCALABLE_MONOCHROME_8   = 101008,
     106  SCALABLE_MONOCHROME_12  = 101012,
     107  SCALABLE_MONOCHROME_16  = 101016,
     108  SCALABLE_MAIN_444       = 101308
     109#endif
    99110};
     111#endif
    100112
    101113
     
    257269  {"scalable-main",        Profile::SCALABLEMAIN       },
    258270  {"scalable-main10",      Profile::SCALABLEMAIN10     },
     271#if SCALABLE_REXT
     272  {"scalable-Rext",        Profile::SCALABLEREXT     },
     273#endif
    259274#endif
    260275};
     
    305320    {"scalable-main",             SCALABLEMAIN     },
    306321    {"scalable-main10",           SCALABLEMAIN10   },
     322#if SCALABLE_REXT
     323    {"scalable-monochrome",       SCALABLE_MONOCHROME_8   },
     324    {"scalable-monochrome12",     SCALABLE_MONOCHROME_12  },
     325    {"scalable-monochrome16",     SCALABLE_MONOCHROME_16  },
     326    {"scalable-main_444",         SCALABLE_MAIN_444       },
     327#endif
    307328#endif
    308329};
     
    10741095  ("OutputBitDepth%d",                               cfg_OutputBitDepth[CHANNEL_TYPE_LUMA],    0, m_numLayers, "Bit-depth of output file (default:InternalBitDepth)")
    10751096  ("InputBitDepthC%d",                               cfg_InputBitDepth[CHANNEL_TYPE_CHROMA],   0, m_numLayers, "As per InputBitDepth but for chroma component. (default:InputBitDepth) for layer %d")
    1076   ("InternalBitDepthC%d",                            cfg_InternalBitDepth[CHANNEL_TYPE_CHROMA],0, m_numLayers, "As per InternalBitDepth but for chroma component. (default:IntrenalBitDepth) for layer %d")
     1097  ("InternalBitDepthC%d",                            cfg_InternalBitDepth[CHANNEL_TYPE_CHROMA],0, m_numLayers, "As per InternalBitDepth but for chroma component. (default:InternalBitDepth) for layer %d")
    10771098  ("OutputBitDepthC%d",                              cfg_OutputBitDepth[CHANNEL_TYPE_CHROMA],  0, m_numLayers, "As per OutputBitDepth but for chroma component. (default:InternalBitDepthC)")
    10781099
     
    17911812 
    17921813#if SVC_EXTENSION
     1814#if SCALABLE_REXT
     1815  Int cfgTmpConstraintChromaFormat = tmpConstraintChromaFormat;
     1816#endif
    17931817  for( Int layer = 0; layer < m_numLayers; layer++ )
    17941818  {
     
    18541878      m_profileList[layerPTLIdx] = Profile::MAINREXT;           
    18551879
     1880#if SCALABLE_REXT
     1881      if(m_numLayers > 1 && layer == 0 )
     1882      {
     1883        m_profileList[0] = extendedToShortProfileName(extendedProfile[0]);
     1884      }
     1885
     1886      if( m_apcLayerCfg[layer]->m_bitDepthConstraint != 0 || cfgTmpConstraintChromaFormat != 0)
     1887#else
    18561888      if( m_apcLayerCfg[layer]->m_bitDepthConstraint != 0 || tmpConstraintChromaFormat != 0)
     1889#endif
    18571890      {
    18581891        fprintf(stderr, "Error: The bit depth and chroma format constraints are not used when an explicit RExt profile is specified\n");
     
    18691902      }
    18701903    }
     1904#if SCALABLE_REXT
     1905    else if(extendedProfile[layerPTLIdx] >= 101008 && extendedProfile[layerPTLIdx] <= 101308)
     1906    {
     1907      m_profileList[layerPTLIdx] = Profile::SCALABLEREXT;
     1908     
     1909      if( m_apcLayerCfg[layer]->m_bitDepthConstraint != 0 || cfgTmpConstraintChromaFormat != 0)
     1910      {
     1911        fprintf(stderr, "Error: The bit depth and chroma format constraints are not used when an explicit Scalabe-RExt profile is specified\n");
     1912        exit(EXIT_FAILURE);
     1913      }
     1914      m_apcLayerCfg[layer]->m_bitDepthConstraint  = (extendedProfile[layerPTLIdx]%100);
     1915      m_apcLayerCfg[layer]->m_intraConstraintFlag = 0; // no all-intra constraint for scalable-Rext profiles
     1916      switch ((extendedProfile[layerPTLIdx]/100)%10)
     1917      {
     1918        case 0:  tmpConstraintChromaFormat=400; break;
     1919        case 1:  tmpConstraintChromaFormat=420; break;
     1920        case 2:  tmpConstraintChromaFormat=422; break;
     1921        default: tmpConstraintChromaFormat=444; break;
     1922      }
     1923    }
     1924#endif
    18711925    else
    18721926    {
    18731927      if( layer == 0 )
    18741928      {
     1929#if SCALABLE_REXT
     1930        m_profileList[0] = extendedToShortProfileName(extendedProfile[0]);
     1931#else
    18751932        m_profileList[0] = Profile::Name(extendedProfile[0]);
     1933#endif
    18761934      }
    18771935
     
    18841942      m_apcLayerCfg[layer]->m_chromaFormatConstraint = (tmpConstraintChromaFormat == 0) ? CHROMA_444 : numberToChromaFormat(tmpConstraintChromaFormat);
    18851943    }
     1944#if SCALABLE_REXT
     1945    else if( m_profileList[layerPTLIdx] == Profile::MAINREXT || m_profileList[layerPTLIdx] == Profile::SCALABLEREXT )
     1946#else
    18861947    else if( m_profileList[layerPTLIdx] == Profile::MAINREXT )
     1948#endif
    18871949    {
    18881950      if( m_apcLayerCfg[layer]->m_bitDepthConstraint == 0 && tmpConstraintChromaFormat == 0 )
     
    19231985      m_apcLayerCfg[layer]->m_bitDepthConstraint = (m_profileList[layerPTLIdx] == Profile::MAIN10 || m_profileList[layerPTLIdx] == Profile::SCALABLEMAIN10) ? 10 : 8;
    19241986    }
     1987#if FORMATIDX_CHECK
     1988    for(Int compareLayer = layer+1; compareLayer < m_numLayers; compareLayer++ )
     1989    {
     1990      if(m_apcLayerCfg[layer]->m_repFormatIdx == m_apcLayerCfg[compareLayer]->m_repFormatIdx && (
     1991           m_apcLayerCfg[layer]->m_chromaFormatIDC != m_apcLayerCfg[compareLayer]->m_chromaFormatIDC
     1992           // separate_colour_plane_flag not supported yet but if supported insert check here
     1993           || m_apcLayerCfg[layer]->m_iSourceWidth != m_apcLayerCfg[compareLayer]->m_iSourceWidth
     1994           || m_apcLayerCfg[layer]->m_iSourceHeight != m_apcLayerCfg[compareLayer]->m_iSourceHeight
     1995           || m_apcLayerCfg[layer]->m_internalBitDepth != m_apcLayerCfg[compareLayer]->m_internalBitDepth
     1996           || m_apcLayerCfg[layer]->m_confWinLeft != m_apcLayerCfg[compareLayer]->m_confWinLeft
     1997           || m_apcLayerCfg[layer]->m_confWinRight != m_apcLayerCfg[compareLayer]->m_confWinRight
     1998           || m_apcLayerCfg[layer]->m_confWinTop != m_apcLayerCfg[compareLayer]->m_confWinTop
     1999           || m_apcLayerCfg[layer]->m_confWinBottom != m_apcLayerCfg[compareLayer]->m_confWinBottom
     2000        ))
     2001      {
     2002        fprintf(stderr, "Error: Two layers using the same FormatIdx value must share the same values of the related parameters\n");
     2003        exit(EXIT_FAILURE);
     2004      }
     2005    }
     2006#endif
    19252007  }
    19262008#else
     
    25582640    ChromaFormat& m_chromaFormatIDC = m_apcLayerCfg[layer]->m_chromaFormatIDC;
    25592641
     2642#if SCALABLE_REXT
     2643    Int& m_confWinLeft              = m_apcLayerCfg[layer]->m_confWinLeft;
     2644    Int& m_confWinRight             = m_apcLayerCfg[layer]->m_confWinRight;
     2645    Int& m_confWinTop               = m_apcLayerCfg[layer]->m_confWinTop;
     2646    Int& m_confWinBottom            = m_apcLayerCfg[layer]->m_confWinBottom;
     2647#else
    25602648    Int& m_confWinLeft              = m_apcLayerCfg[layer]->m_confWinLeft;
    25612649    Int& m_confWinRight             = m_apcLayerCfg[layer]->m_confWinLeft;
    25622650    Int& m_confWinTop               = m_apcLayerCfg[layer]->m_confWinLeft;
    25632651    Int& m_confWinBottom            = m_apcLayerCfg[layer]->m_confWinLeft;
     2652#endif
    25642653    Int* m_aiPad                    = m_apcLayerCfg[layer]->m_aiPad;
    25652654    Int* m_aidQP                    = m_apcLayerCfg[layer]->m_aidQP;
     
    31103199  xConfirmPara(m_chromaFormatConstraint<m_chromaFormatIDC, "The chroma format used must not be greater than the chromaFormatConstraint value");
    31113200
     3201#if SCALABLE_REXT
     3202  if (m_profile==Profile::MAINREXT || m_profile==Profile::HIGHTHROUGHPUTREXT || m_profile==Profile::SCALABLEREXT)
     3203#else
    31123204  if (m_profile==Profile::MAINREXT || m_profile==Profile::HIGHTHROUGHPUTREXT)
     3205#endif
    31133206  {
    31143207    xConfirmPara(m_lowerBitRateConstraintFlag==false && m_intraConstraintFlag==false, "The lowerBitRateConstraint flag cannot be false when intraConstraintFlag is false");
    31153208    xConfirmPara(m_cabacBypassAlignmentEnabledFlag && m_profile!=Profile::HIGHTHROUGHPUTREXT, "AlignCABACBeforeBypass must not be enabled unless the high throughput profile is being used.");
     3209#if SCALABLE_REXT
     3210    if (m_profile == Profile::MAINREXT || m_profile==Profile::SCALABLEREXT)
     3211#else
    31163212    if (m_profile == Profile::MAINREXT)
     3213#endif
    31173214    {
    31183215      const UInt intraIdx = m_intraConstraintFlag ? 1:0;
     
    31623259    xConfirmPara(m_bitDepthConstraint!=((m_profile==Profile::MAIN10)?10:8), "BitDepthConstraint must be 8 for MAIN profile and 10 for MAIN10 profile.");
    31633260#endif
     3261#if SCALABLE_REXT // changes below are only about displayed text
     3262    xConfirmPara(m_chromaFormatConstraint!=CHROMA_420, "ChromaFormatConstraint must be 420 for non main-RExt and non scalable-Rext profiles.");
     3263    xConfirmPara(m_intraConstraintFlag==true, "IntraConstraintFlag must be false for non main_RExt and non scalable-Rext profiles.");
     3264    xConfirmPara(m_lowerBitRateConstraintFlag==false, "LowerBitrateConstraintFlag must be true for non main-RExt and non scalable-Rext profiles.");
     3265    xConfirmPara(m_profile == Profile::MAINSTILLPICTURE && m_framesToBeEncoded > 1, "Number of frames to be encoded must be 1 when main still picture profile is used.");
     3266
     3267    xConfirmPara(m_crossComponentPredictionEnabledFlag==true, "CrossComponentPrediction must not be used for non main-RExt and non scalable-Rext profiles.");
     3268    xConfirmPara(m_log2MaxTransformSkipBlockSize!=2, "Transform Skip Log2 Max Size must be 2 for V1 profiles.");
     3269    xConfirmPara(m_transformSkipRotationEnabledFlag==true, "UseResidualRotation must not be enabled for non main-RExt and non scalable-Rext profiles.");
     3270    xConfirmPara(m_transformSkipContextEnabledFlag==true, "UseSingleSignificanceMapContext must not be enabled for non main-RExt nand on scalable-Rext profiles.");
     3271    xConfirmPara(m_rdpcmEnabledFlag[RDPCM_SIGNAL_IMPLICIT]==true, "ImplicitResidualDPCM must not be enabled for non main-RExt and non scalable-Rext profiles.");
     3272    xConfirmPara(m_rdpcmEnabledFlag[RDPCM_SIGNAL_EXPLICIT]==true, "ExplicitResidualDPCM must not be enabled for non main-RExt and non scalable-Rext profiles.");
     3273    xConfirmPara(m_persistentRiceAdaptationEnabledFlag==true, "GolombRiceParameterAdaption must not be enabled for non main-RExt and non scalable-Rext profiles.");
     3274    xConfirmPara(m_extendedPrecisionProcessingFlag==true, "UseExtendedPrecision must not be enabled for non main-RExt and non scalable-Rext profiles.");
     3275    xConfirmPara(m_highPrecisionOffsetsEnabledFlag==true, "UseHighPrecisionPredictionWeighting must not be enabled for non main-RExt and non scalable-Rext profiles.");
     3276    xConfirmPara(m_enableIntraReferenceSmoothing==false, "EnableIntraReferenceSmoothing must be enabled for non main-RExt and non scalable-Rext profiles.");
     3277    xConfirmPara(m_cabacBypassAlignmentEnabledFlag, "AlignCABACBeforeBypass cannot be enabled for non main-RExt and non scalable-Rext profiles.");
     3278#else
    31643279    xConfirmPara(m_chromaFormatConstraint!=CHROMA_420, "ChromaFormatConstraint must be 420 for non main-RExt profiles.");
    31653280    xConfirmPara(m_intraConstraintFlag==true, "IntraConstraintFlag must be false for non main_RExt profiles.");
     
    31783293    xConfirmPara(m_enableIntraReferenceSmoothing==false, "EnableIntraReferenceSmoothing must be enabled for non main-RExt profiles.");
    31793294    xConfirmPara(m_cabacBypassAlignmentEnabledFlag, "AlignCABACBeforeBypass cannot be enabled for non main-RExt profiles.");
     3295#endif
    31803296  }
    31813297
     
    40294145    UInt& m_uiMaxCUDepth                   = m_apcLayerCfg[layerIdx]->m_uiMaxCUDepth;
    40304146
     4147#if SCALABLE_REXT
     4148    Int& m_confWinLeft                     = m_apcLayerCfg[layerIdx]->m_confWinLeft;
     4149    Int& m_confWinRight                    = m_apcLayerCfg[layerIdx]->m_confWinRight;
     4150    Int& m_confWinTop                      = m_apcLayerCfg[layerIdx]->m_confWinTop;
     4151    Int& m_confWinBottom                   = m_apcLayerCfg[layerIdx]->m_confWinBottom;
     4152#else
    40314153    Int& m_confWinLeft                     = m_apcLayerCfg[layerIdx]->m_confWinLeft;
    40324154    Int& m_confWinRight                    = m_apcLayerCfg[layerIdx]->m_confWinLeft;
    40334155    Int& m_confWinTop                      = m_apcLayerCfg[layerIdx]->m_confWinLeft;
    40344156    Int& m_confWinBottom                   = m_apcLayerCfg[layerIdx]->m_confWinLeft;
     4157#endif
    40354158
    40364159    Int& m_iSourceWidth                    = m_apcLayerCfg[layerIdx]->m_iSourceWidth;
  • branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.h

    r1475 r1487  
    4949//! \ingroup TAppEncoder
    5050//! \{
     51
     52#if SCALABLE_REXT
     53enum ExtendedProfileName // this is used for determining profile strings, where multiple profiles map to a single profile idc with various constraint flag combinations
     54{
     55  NONE = 0,
     56  MAIN = 1,
     57  MAIN10 = 2,
     58  MAINSTILLPICTURE = 3,
     59  MAINREXT = 4,
     60  HIGHTHROUGHPUTREXT = 5, // Placeholder profile for development
     61#if SVC_EXTENSION
     62  MULTIVIEWMAIN = 6,
     63  SCALABLEMAIN = 7,
     64  SCALABLEMAIN10 = 8,
     65#if SCALABLE_REXT
     66  SCALABLEREXT = 10,
     67#endif
     68#endif
     69  // The following are RExt profiles, which would map to the MAINREXT profile idc.
     70  // The enumeration indicates the bit-depth constraint in the bottom 2 digits
     71  //                           the chroma format in the next digit
     72  //                           the intra constraint in the next digit
     73  //                           If it is a RExt still picture, there is a '1' for the next digit,
     74  //                           If it is a Scalable Rext profile, there is a '1' for the top digit.
     75  MONOCHROME_8      = 1008,
     76  MONOCHROME_12     = 1012,
     77  MONOCHROME_16     = 1016,
     78  MAIN_12           = 1112,
     79  MAIN_422_10       = 1210,
     80  MAIN_422_12       = 1212,
     81  MAIN_444          = 1308,
     82  MAIN_444_10       = 1310,
     83  MAIN_444_12       = 1312,
     84  MAIN_444_16       = 1316, // non-standard profile definition, used for development purposes
     85  MAIN_INTRA        = 2108,
     86  MAIN_10_INTRA     = 2110,
     87  MAIN_12_INTRA     = 2112,
     88  MAIN_422_10_INTRA = 2210,
     89  MAIN_422_12_INTRA = 2212,
     90  MAIN_444_INTRA    = 2308,
     91  MAIN_444_10_INTRA = 2310,
     92  MAIN_444_12_INTRA = 2312,
     93  MAIN_444_16_INTRA = 2316,
     94  MAIN_444_STILL_PICTURE = 11308,
     95  MAIN_444_16_STILL_PICTURE = 12316
     96#if SCALABLE_REXT
     97  ,
     98  SCALABLE_MONOCHROME_8   = 101008,
     99  SCALABLE_MONOCHROME_12  = 101012,
     100  SCALABLE_MONOCHROME_16  = 101016,
     101  SCALABLE_MAIN_444       = 101308
     102#endif
     103};
     104#endif
    51105
    52106// ====================================================================================================================
     
    583637  Bool scanStringToArrayNumEntries(string const cfgString, Int &numEntries, const char* logString, std::vector<Int> &  returnVector);
    584638  Void cfgStringToArrayNumEntries(Int **arr, string const cfgString, Int &numEntries, const char* logString);
     639
     640#if SCALABLE_REXT
     641  Profile::Name extendedToShortProfileName(ExtendedProfileName uiExtendedProfileName)
     642  {
     643    if(uiExtendedProfileName < MONOCHROME_8)
     644    {
     645      return Profile::Name(uiExtendedProfileName);
     646    }
     647    else if(uiExtendedProfileName < SCALABLE_MONOCHROME_8)
     648    {
     649      return Profile::MAINREXT;
     650    }
     651    else
     652    {
     653      return Profile::SCALABLEREXT;
     654    }
     655  }
     656#endif
    585657#endif
    586658};// END CLASS DEFINITION TAppEncCfg
  • branches/SHM-dev/source/App/TAppEncoder/TAppEncLayerCfg.cpp

    r1460 r1487  
    5050  ::memset(m_phaseHorChroma, 0, sizeof(m_phaseHorChroma));
    5151  ::memset(m_phaseVerChroma, 0, sizeof(m_phaseVerChroma));
     52#if SCALABLE_REXT
     53  // variables uninitialized otherwise
     54  m_intraConstraintFlag = false;
     55  m_lowerBitRateConstraintFlag = false;
     56  m_onePictureOnlyConstraintFlag = false;
     57#endif
    5258}
    5359
  • branches/SHM-dev/source/Lib/TLibCommon/TComPic.cpp

    r1485 r1487  
    292292Void TComPic::copyUpsampledPictureYuv(TComPicYuv*   pcPicYuvIn, TComPicYuv*   pcPicYuvOut)
    293293{
     294#if SCALABLE_REXT
     295  Int upsampledRowWidthLuma = pcPicYuvOut->getStride(COMPONENT_Y); // 2 * pcPicYuvOut->getLumaMargin() + pcPicYuvOut->getWidth();
     296  copyOnetoOnePicture(
     297    pcPicYuvIn->getAddr(COMPONENT_Y),       
     298    pcPicYuvOut->getAddr(COMPONENT_Y),     
     299    pcPicYuvOut->getWidth(COMPONENT_Y),
     300    pcPicYuvOut->getHeight(COMPONENT_Y),
     301    upsampledRowWidthLuma);
     302
     303  if(pcPicYuvOut->getChromaFormat() != CHROMA_400)
     304  {
     305    Int upsampledRowWidthChroma = pcPicYuvOut->getStride(COMPONENT_Cb); //2 * pcPicYuvOut->getChromaMargin() + (pcPicYuvOut->getWidth()>>1);
     306
     307    copyOnetoOnePicture(
     308      pcPicYuvIn->getAddr(COMPONENT_Cr),       
     309      pcPicYuvOut->getAddr(COMPONENT_Cr),     
     310      pcPicYuvOut->getWidth(COMPONENT_Cr),
     311      pcPicYuvOut->getHeight(COMPONENT_Cr),
     312      upsampledRowWidthChroma);
     313    copyOnetoOnePicture(
     314      pcPicYuvIn->getAddr(COMPONENT_Cb),       
     315      pcPicYuvOut->getAddr(COMPONENT_Cb),     
     316      pcPicYuvOut->getWidth(COMPONENT_Cb),
     317      pcPicYuvOut->getHeight(COMPONENT_Cb),
     318      upsampledRowWidthChroma);
     319  }
     320#else
    294321  Int upsampledRowWidthLuma = pcPicYuvOut->getStride(COMPONENT_Y); // 2 * pcPicYuvOut->getLumaMargin() + pcPicYuvOut->getWidth();
    295322  Int upsampledRowWidthCroma = pcPicYuvOut->getStride(COMPONENT_Cb); //2 * pcPicYuvOut->getChromaMargin() + (pcPicYuvOut->getWidth()>>1);
     
    313340    pcPicYuvOut->getHeight(COMPONENT_Y)>>1,
    314341    upsampledRowWidthCroma);
     342#endif
    315343}
    316344
  • branches/SHM-dev/source/Lib/TLibCommon/TComUpsampleFilter.cpp

    r1431 r1487  
    8585  if( !resamplingPhase.phasePresentFlag )
    8686  {
     87#if SCALABLE_REXT
     88    if(chromaFormatIdc == 3)
     89    {
     90      phaseVerChroma = 0;
     91    }
     92    else
     93    {
     94#endif
    8795    Int refRegionHeight = heightBL - windowRL.getWindowTopOffset() - windowRL.getWindowBottomOffset();
    8896    phaseVerChroma = (4 * heightEL + (refRegionHeight >> 1)) / refRegionHeight - 4;
     97#if SCALABLE_REXT
     98    }
     99#endif
    89100  }
    90101
     
    139150    }
    140151
     152#if SCALABLE_REXT
     153  if(chromaFormatIdc != 0)
     154  {
     155#endif
    141156    widthEL  >>= 1;
    142157    heightEL >>= 1;
     
    177192      piDstV += strideEL;
    178193    }
     194#if SCALABLE_REXT
     195  }
     196#endif
    179197  }
    180198  else // general resampling process
     
    290308    //========== UV component upsampling ===========
    291309
     310#if SCALABLE_REXT
     311  if(chromaFormatIdc != 0)
     312  {
     313#endif
    292314    widthEL  >>= 1;
    293315    heightEL >>= 1;
     
    396418      }
    397419    }
     420#if SCALABLE_REXT
     421    }
     422#endif
    398423  }
    399424    pcUsPic->setBorderExtension(false);
  • branches/SHM-dev/source/Lib/TLibCommon/TypeDef.h

    r1486 r1487  
    4848
    4949#if SVC_EXTENSION
     50#define SCALABLE_REXT                    1
     51#define FORMATIDX_CHECK                  1
     52
    5053#define MAX_LAYERS                       8      ///< max number of layers the codec is supposed to handle
    5154
     
    197200// This can be enabled by the makefile
    198201#ifndef RExt__HIGH_BIT_DEPTH_SUPPORT
    199 #define RExt__HIGH_BIT_DEPTH_SUPPORT                      0 ///< 0 (default) use data type definitions for 8-10 bit video, 1 = use larger data types to allow for up to 16-bit video (originally developed as part of N0188)
     202#define RExt__HIGH_BIT_DEPTH_SUPPORT                      1 ///< 0 (default) use data type definitions for 8-10 bit video, 1 = use larger data types to allow for up to 16-bit video (originally developed as part of N0188)
    200203#endif
    201204
     
    644647    SCALABLEMAIN = 7,
    645648    SCALABLEMAIN10 = 8,
     649#if SCALABLE_REXT
     650    SCALABLEREXT = 10
     651#endif
    646652#endif
    647653  };
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r1464 r1487  
    681681}
    682682
     683#if SCALABLE_REXT
     684Void TDecCavlc::parseSPS(TComSPS* pcSPS, ParameterSetManager* pcParamSetManager)
     685#else
    683686Void TDecCavlc::parseSPS(TComSPS* pcSPS)
     687#endif
    684688{
    685689#if ENC_DEC_TRACE
     
    689693  UInt  uiCode;
    690694  READ_CODE( 4,  uiCode, "sps_video_parameter_set_id");          pcSPS->setVPSId        ( uiCode );
    691 
     695#if SCALABLE_REXT
     696  const TComVPS* pTmpVPS = pcParamSetManager->getVPS(pcSPS->getVPSId());
     697#endif
    692698#if SVC_EXTENSION
    693699  UInt uiTmp = 0;
     
    742748      pcSPS->setUpdateRepFormatIndex(uiCode);
    743749    }
     750#if SCALABLE_REXT
     751    // If update_rep_format_flag is equal to 0, the variable repFormatIdx is set equal to vps_rep_format_idx[ LayerIdxInVps[ layerIdCurr ] ].
     752    else
     753    {
     754      Int iVPSRepFormatIdx = pTmpVPS->getVpsRepFormatIdx( pTmpVPS->getLayerIdxInVps( pcSPS->getLayerId() ) );
     755      pcSPS->setUpdateRepFormatIndex( iVPSRepFormatIdx );
     756
     757      pcSPS->setChromaFormatIdc(              pTmpVPS->getVpsRepFormat(iVPSRepFormatIdx)->getChromaFormatVpsIdc() );
     758      pcSPS->setPicWidthInLumaSamples(        pTmpVPS->getVpsRepFormat(iVPSRepFormatIdx)->getPicWidthVpsInLumaSamples() );
     759      pcSPS->setPicHeightInLumaSamples(       pTmpVPS->getVpsRepFormat(iVPSRepFormatIdx)->getPicHeightVpsInLumaSamples() );
     760      pcSPS->setBitDepth(CHANNEL_TYPE_LUMA,   pTmpVPS->getVpsRepFormat(iVPSRepFormatIdx)->getBitDepthVpsLuma() );
     761      pcSPS->setBitDepth(CHANNEL_TYPE_CHROMA, pTmpVPS->getVpsRepFormat(iVPSRepFormatIdx)->getBitDepthVpsChroma() );
     762      Window &conf = pcSPS->getConformanceWindow();
     763      conf.setWindowLeftOffset(               pTmpVPS->getVpsRepFormat(iVPSRepFormatIdx)->getConformanceWindowVps().getWindowLeftOffset() );
     764      conf.setWindowRightOffset(              pTmpVPS->getVpsRepFormat(iVPSRepFormatIdx)->getConformanceWindowVps().getWindowRightOffset() );
     765      conf.setWindowTopOffset(                pTmpVPS->getVpsRepFormat(iVPSRepFormatIdx)->getConformanceWindowVps().getWindowTopOffset() );
     766      conf.setWindowBottomOffset(             pTmpVPS->getVpsRepFormat(iVPSRepFormatIdx)->getConformanceWindowVps().getWindowBottomOffset() );
     767    }
     768#endif
    744769  }
    745770  else
     
    21662191
    21672192  if (ptl->getProfileIdc() == Profile::MAINREXT           || ptl->getProfileCompatibilityFlag(Profile::MAINREXT) ||
    2168       ptl->getProfileIdc() == Profile::HIGHTHROUGHPUTREXT || ptl->getProfileCompatibilityFlag(Profile::HIGHTHROUGHPUTREXT))
     2193      ptl->getProfileIdc() == Profile::HIGHTHROUGHPUTREXT || ptl->getProfileCompatibilityFlag(Profile::HIGHTHROUGHPUTREXT
     2194#if SCALABLE_REXT
     2195      || ptl->getProfileIdc() == Profile::SCALABLEREXT
     2196#endif
     2197      ))
    21692198  {
    21702199    UInt maxBitDepth=16;
     
    29793008            ProfileTierLevel* ptl = vps->getPTL(vps->getProfileLevelTierIdx(i, j))->getGeneralPTL();
    29803009            numIncludedLayers++;
     3010#if SCALABLE_REXT
     3011            // if scalable profile is Scalable Main 10 or Scalable Rext, dimension_id = 2
     3012            const Profile::Name profileName = ( ptl->getProfileIdc() == Profile::SCALABLEMAIN10 || ptl->getProfileIdc() == Profile::SCALABLEREXT ) ? Profile::SCALABLEMAIN : ptl->getProfileIdc();
     3013#else
    29813014            const Profile::Name profileName = ptl->getProfileIdc() == Profile::SCALABLEMAIN10 ? Profile::SCALABLEMAIN : ptl->getProfileIdc();
     3015#endif
    29823016
    29833017            for( Int p = 0; p < profiles.size(); p++ )
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.h

    r1295 r1487  
    7676  Void  parseQtRootCbf      ( UInt uiAbsPartIdx, UInt& uiQtRootCbf );
    7777  Void  parseVPS            ( TComVPS* pcVPS );
     78#if SCALABLE_REXT
     79  Void  parseSPS            ( TComSPS* pcSPS, ParameterSetManager* pcParamSetManager );
     80#else
    7881  Void  parseSPS            ( TComSPS* pcSPS );
     82#endif
    7983#if !SVC_EXTENSION
    8084  Void  parsePPS            ( TComPPS* pcPPS );
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecEntropy.h

    r1295 r1487  
    7070
    7171  virtual Void  parseVPS                  ( TComVPS* pcVPS )     = 0;
     72#if SCALABLE_REXT
     73  virtual Void  parseSPS                  ( TComSPS* pcSPS, ParameterSetManager* pcParamSetManager )     = 0;
     74#else
    7275  virtual Void  parseSPS                  ( TComSPS* pcSPS )     = 0;
     76#endif
    7377#if CGS_3D_ASYMLUT
    7478  virtual Void  parsePPS                  ( TComPPS* pcPPS, TCom3DAsymLUT * pc3DAsymLUT , Int nLayerID )     = 0;
     
    143147
    144148  Void    decodeVPS                   ( TComVPS* pcVPS ) { m_pcEntropyDecoderIf->parseVPS(pcVPS); }
     149#if SCALABLE_REXT
     150  Void    decodeSPS                   ( TComSPS* pcSPS, ParameterSetManager* pcParamSetManager ) { m_pcEntropyDecoderIf->parseSPS(pcSPS, pcParamSetManager); }
     151#else
    145152  Void    decodeSPS                   ( TComSPS* pcSPS ) { m_pcEntropyDecoderIf->parseSPS(pcSPS); }
     153#endif
    146154
    147155#if CGS_3D_ASYMLUT
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecSbac.h

    r1295 r1487  
    7878  Void  setBitstream              ( TComInputBitstream* p  ) { m_pcBitstream = p; m_pcTDecBinIf->init( p ); }
    7979  Void  parseVPS                  ( TComVPS* /*pcVPS*/ ) {}
     80#if SCALABLE_REXT
     81  Void  parseSPS                  (TComSPS*  /*pcSPS*/, ParameterSetManager* /*pcParamSetManager*/ ) {}
     82#else
    8083  Void  parseSPS                  ( TComSPS* /*pcSPS*/ ) {}
     84#endif
    8185#if CGS_3D_ASYMLUT
    8286  Void  parsePPS                  ( TComPPS* /*pcPPS*/, TCom3DAsymLUT * /*pc3DAsymLUT*/, Int /*nLayerID*/ ) {}
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp

    r1486 r1487  
    19391939  sps->setLayerId(m_layerId);
    19401940#endif
     1941#if SCALABLE_REXT
     1942  m_cEntropyDecoder.decodeSPS( sps, &m_parameterSetManager );
     1943#else
    19411944  m_cEntropyDecoder.decodeSPS( sps );
     1945#endif
    19421946  m_parameterSetManager.storeSPS(sps, naluData);
    19431947}
  • branches/SHM-dev/source/Lib/TLibEncoder/TEnc3DAsymLUT.cpp

    r1440 r1487  
    218218        if( rCuboidColorInfo.N > 0 )
    219219        {
     220#if SCALABLE_REXT
     221          dErrorLuma += xCalEstPelDist( rCuboidColorInfo.N , rCuboidColorInfo.Ys , rCuboidColorInfo.Yy , rCuboidColorInfo.Yu , rCuboidColorInfo.Yv , rCuboidColorInfo.ys , rCuboidColorInfo.us , rCuboidColorInfo.vs , rCuboidColorInfo.yy , rCuboidColorInfo.yu , rCuboidColorInfo.yv , rCuboidColorInfo.uu , rCuboidColorInfo.uv , rCuboidColorInfo.vv , rCuboidColorInfo.YY ,
     222            rCuboid.P[0].Y , rCuboid.P[1].Y , rCuboid.P[2].Y , rCuboid.P[3].Y );
     223#else
    220224          dErrorLuma += xCalEstDist( rCuboidColorInfo.N , rCuboidColorInfo.Ys , rCuboidColorInfo.Yy , rCuboidColorInfo.Yu , rCuboidColorInfo.Yv , rCuboidColorInfo.ys , rCuboidColorInfo.us , rCuboidColorInfo.vs , rCuboidColorInfo.yy , rCuboidColorInfo.yu , rCuboidColorInfo.yv , rCuboidColorInfo.uu , rCuboidColorInfo.uv , rCuboidColorInfo.vv , rCuboidColorInfo.YY ,
    221225            rCuboid.P[0].Y , rCuboid.P[1].Y , rCuboid.P[2].Y , rCuboid.P[3].Y );
     226#endif
    222227        }
    223228        if( rCuboidColorInfoC.N > 0 )
    224229        {
     230#if SCALABLE_REXT
     231          dErrorChroma += xCalEstPelDist( rCuboidColorInfoC.N , rCuboidColorInfoC.Us , rCuboidColorInfoC.Uy , rCuboidColorInfoC.Uu , rCuboidColorInfoC.Uv , rCuboidColorInfoC.ys , rCuboidColorInfoC.us , rCuboidColorInfoC.vs , rCuboidColorInfoC.yy , rCuboidColorInfoC.yu , rCuboidColorInfoC.yv , rCuboidColorInfoC.uu , rCuboidColorInfoC.uv , rCuboidColorInfoC.vv , rCuboidColorInfoC.UU ,
     232            rCuboid.P[0].U , rCuboid.P[1].U , rCuboid.P[2].U , rCuboid.P[3].U );
     233          dErrorChroma += xCalEstPelDist( rCuboidColorInfoC.N , rCuboidColorInfoC.Vs , rCuboidColorInfoC.Vy , rCuboidColorInfoC.Vu , rCuboidColorInfoC.Vv , rCuboidColorInfoC.ys , rCuboidColorInfoC.us , rCuboidColorInfoC.vs , rCuboidColorInfoC.yy , rCuboidColorInfoC.yu , rCuboidColorInfoC.yv , rCuboidColorInfoC.uu , rCuboidColorInfoC.uv , rCuboidColorInfoC.vv , rCuboidColorInfoC.VV ,
     234            rCuboid.P[0].V , rCuboid.P[1].V , rCuboid.P[2].V , rCuboid.P[3].V );
     235#else
    225236          dErrorChroma += xCalEstDist( rCuboidColorInfoC.N , rCuboidColorInfoC.Us , rCuboidColorInfoC.Uy , rCuboidColorInfoC.Uu , rCuboidColorInfoC.Uv , rCuboidColorInfoC.ys , rCuboidColorInfoC.us , rCuboidColorInfoC.vs , rCuboidColorInfoC.yy , rCuboidColorInfoC.yu , rCuboidColorInfoC.yv , rCuboidColorInfoC.uu , rCuboidColorInfoC.uv , rCuboidColorInfoC.vv , rCuboidColorInfoC.UU ,
    226237            rCuboid.P[0].U , rCuboid.P[1].U , rCuboid.P[2].U , rCuboid.P[3].U );
    227238          dErrorChroma += xCalEstDist( rCuboidColorInfoC.N , rCuboidColorInfoC.Vs , rCuboidColorInfoC.Vy , rCuboidColorInfoC.Vu , rCuboidColorInfoC.Vv , rCuboidColorInfoC.ys , rCuboidColorInfoC.us , rCuboidColorInfoC.vs , rCuboidColorInfoC.yy , rCuboidColorInfoC.yu , rCuboidColorInfoC.yv , rCuboidColorInfoC.uu , rCuboidColorInfoC.uv , rCuboidColorInfoC.vv , rCuboidColorInfoC.VV ,
    228239            rCuboid.P[0].V , rCuboid.P[1].V , rCuboid.P[2].V , rCuboid.P[3].V );
     240#endif
    229241        }
    230242      }
  • branches/SHM-dev/source/Lib/TLibEncoder/TEnc3DAsymLUT.h

    r1440 r1487  
    175175
    176176  inline Double xCalEstDist( Double N, Double Ys, Double Yy, Double Yu, Double Yv, Double ys, Double us, Double vs, Double yy, Double yu, Double yv, Double uu, Double uv, Double vv, Double YY, Double a, Double b, Double c, Double d );
    177 
     177#if SCALABLE_REXT
     178/*
     179former xCalEstDist(Double, Double, Double, Double, Double, Double, Double, Double, Double, Double, Double, Double, Double, Double, Double, Pel, Pel, Pel, Pel)
     180replaced by this fucntion because behaving differently than other xCalEstDist and was conflicting with xCalEstDist when RExt__HIGH_BIT_DEPTH_SUPPORT = 1
     181*/
     182  inline Double xCalEstPelDist( Double N, Double Ys, Double Yy, Double Yu, Double Yv, Double ys, Double us, Double vs, Double yy, Double yu, Double yv, Double uu, Double uv, Double vv, Double YY, Pel nP0, Pel nP1, Pel nP3, Pel nP7 );
     183#else
    178184  inline Double xCalEstDist( Double N, Double Ys, Double Yy, Double Yu, Double Yv, Double ys, Double us, Double vs, Double yy, Double yu, Double yv, Double uu, Double uv, Double vv, Double YY, Pel nP0, Pel nP1, Pel nP3, Pel nP7 );
    179 
     185#endif
    180186#if R0179_ENC_OPT_3DLUT_SIZE
    181187  Void    xConsolidateData( SLUTSize *pCurLUTSize, SLUTSize *pMaxLUTSize );
     
    202208};
    203209
    204 Double TEnc3DAsymLUT::xCalEstDist( Double N, Double Ys, Double Yy, Double Yu, Double Yv, Double ys, Double us, Double vs, Double yy, Double yu, Double yv, Double uu, Double uv, Double vv, Double YY, Pel nP0, Pel nP1, Pel nP3, Pel nP7 ) 
     210
     211#if SCALABLE_REXT
     212/*
     213former xCalEstDist(Double, Double, Double, Double, Double, Double, Double, Double, Double, Double, Double, Double, Double, Double, Double, Pel, Pel, Pel, Pel)
     214replaced by this fucntion because behaving differently than other xCalEstDist and was conflicting with xCalEstDist when RExt__HIGH_BIT_DEPTH_SUPPORT = 1
     215*/
     216Double TEnc3DAsymLUT::xCalEstPelDist( Double N, Double Ys, Double Yy, Double Yu, Double Yv, Double ys, Double us, Double vs, Double yy, Double yu, Double yv, Double uu, Double uv, Double vv, Double YY, Pel nP0, Pel nP1, Pel nP3, Pel nP7 ) 
    205217{
    206218  const Int nOne = xGetNormCoeffOne();
     
    212224  return( dError );
    213225};
    214 
    215 #endif
    216 
    217 #endif
     226#else
     227Double TEnc3DAsymLUT::xCalEstDist( Double N, Double Ys, Double Yy, Double Yu, Double Yv, Double ys, Double us, Double vs, Double yy, Double yu, Double yv, Double uu, Double uv, Double vv, Double YY, Pel nP0, Pel nP1, Pel nP3, Pel nP7 ) 
     228{
     229  const Int nOne = xGetNormCoeffOne();
     230  Double a = 1.0 * nP0 / nOne;
     231  Double b = 1.0 * nP1 / nOne;
     232  Double c = 1.0 * nP3 / nOne;
     233  Double d = nP7;
     234  Double dError = N * d * d + 2 * b * c * uv + 2 * a * c * yv + 2 * a * b * yu - 2 * c * Yv - 2 * b * Yu - 2 * a * Yy + 2 * c * d * vs + 2 * b * d * us + 2 * a * d * ys + a * a * yy + c * c * vv + b * b * uu - 2 * d * Ys + YY;
     235  return( dError );
     236};
     237#endif
     238
     239#endif
     240
     241#endif
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncCavlc.cpp

    r1464 r1487  
    14121412  WRITE_FLAG(ptl->getFrameOnlyConstraintFlag(), PTL_TRACE_TEXT("frame_only_constraint_flag"      ));
    14131413
    1414   if (ptl->getProfileIdc() == Profile::MAINREXT || ptl->getProfileIdc() == Profile::HIGHTHROUGHPUTREXT )
     1414  if (ptl->getProfileIdc() == Profile::MAINREXT || ptl->getProfileIdc() == Profile::HIGHTHROUGHPUTREXT
     1415#if SCALABLE_REXT
     1416    || ptl->getProfileIdc() == Profile::SCALABLEREXT
     1417#endif
     1418    )
    14151419  {
    14161420    const UInt         bitDepthConstraint=ptl->getBitDepthConstraint();
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncSearch.cpp

    r1483 r1487  
    59605960                                           TComMv& rcMvHalf,
    59615961                                           TComMv& rcMvQter,
    5962                                            UInt& ruiCost     )                                           
     5962#if SCALABLE_REXT
     5963                                           Distortion& ruiCost     )
     5964#else
     5965                                           UInt& ruiCost     )
     5966#endif
    59635967{
    59645968  assert(pcMvInt->getHor() == 0 && pcMvInt->getVer() == 0);
     
    59955999  UInt          uiLastMode = 0;
    59966000
     6001#if SCALABLE_REXT
     6002  Distortion    uiCost[2]   = { MAX_UINT, MAX_UINT };     //uni, rdCost
     6003  Distortion    uiCostTemp;
     6004  Distortion    biPDistTemp = MAX_INT;
     6005#else
    59976006  UInt          uiCost[2]   = { MAX_UINT, MAX_UINT };     //uni, rdCost
    59986007  UInt          uiCostTemp;
    59996008  UInt          biPDistTemp = MAX_INT;
     6009#endif
    60006010  UInt          uiBitsTemp;
    60016011
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncSearch.h

    r1469 r1487  
    480480                                   TComMv&       rcMvHalf,
    481481                                   TComMv&       rcMvQter,
     482#if SCALABLE_REXT
     483                                   Distortion&   ruiCost     );
     484#else
    482485                                   UInt&         ruiCost     );
     486#endif
    483487#endif //SVC_EXTENSION 
    484488
Note: See TracChangeset for help on using the changeset viewer.