Changeset 1434 in SHVCSoftware for branches/SHM-dev


Ignore:
Timestamp:
11 Aug 2015, 20:47:57 (9 years ago)
Author:
seregin
Message:

port rev 4588

Location:
branches/SHM-dev/source
Files:
14 edited

Legend:

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

    r1433 r1434  
    15631563  ("SEIToneMapNominalWhiteLevelLumaCodeValue",        m_nominalWhiteLevelLumaCodeValue,                   235, "Specifies luma sample value of the nominal white level assigned decoded pictures")
    15641564  ("SEIToneMapExtendedWhiteLevelLumaCodeValue",       m_extendedWhiteLevelLumaCodeValue,                  300, "Specifies luma sample value of the extended dynamic range assigned decoded pictures")
    1565   ("SEIChromaSamplingFilterHint",                     m_chromaSamplingFilterSEIenabled,                 false, "Control generation of the chroma sampling filter hint SEI message")
    1566   ("SEIChromaSamplingHorizontalFilterType",           m_chromaSamplingHorFilterIdc,                         2, "Defines the Index of the chroma sampling horizontal filter\n"
     1565  ("SEIChromaResamplingFilterHint",                   m_chromaResamplingFilterSEIenabled,               false, "Control generation of the chroma sampling filter hint SEI message")
     1566  ("SEIChromaResamplingHorizontalFilterType",         m_chromaResamplingHorFilterIdc,                       2, "Defines the Index of the chroma sampling horizontal filter\n"
    15671567                                                                                                               "\t0: unspecified  - Chroma filter is unknown or is determined by the application"
    15681568                                                                                                               "\t1: User-defined - Filter coefficients are specified in the chroma sampling filter hint SEI message"
    15691569                                                                                                               "\t2: Standards-defined - ITU-T Rec. T.800 | ISO/IEC15444-1, 5/3 filter")
    1570   ("SEIChromaSamplingVerticalFilterType",             m_chromaSamplingVerFilterIdc,                         2, "Defines the Index of the chroma sampling vertical filter\n"
     1570  ("SEIChromaResamplingVerticalFilterType",           m_chromaResamplingVerFilterIdc,                         2, "Defines the Index of the chroma sampling vertical filter\n"
    15711571                                                                                                               "\t0: unspecified  - Chroma filter is unknown or is determined by the application"
    15721572                                                                                                               "\t1: User-defined - Filter coefficients are specified in the chroma sampling filter hint SEI message"
     
    41964196  }
    41974197
     4198  if (m_chromaResamplingFilterSEIenabled)
     4199  {
     4200    xConfirmPara( (m_chromaFormatIDC == CHROMA_400 ), "chromaResamplingFilterSEI is not allowed to be present when ChromaFormatIDC is equal to zero (4:0:0)" );
     4201    xConfirmPara(m_vuiParametersPresentFlag && m_chromaLocInfoPresentFlag && (m_chromaSampleLocTypeTopField != m_chromaSampleLocTypeBottomField ), "When chromaResamplingFilterSEI is enabled, ChromaSampleLocTypeTopField has to be equal to ChromaSampleLocTypeBottomField" );
     4202  }
     4203
    41984204#if P0123_ALPHA_CHANNEL_SEI
    41994205  if( m_alphaSEIEnabled && !m_alphaCancelFlag )
  • branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.h

    r1433 r1434  
    329329  Int       m_pictureTimingSEIEnabled;
    330330  Bool      m_toneMappingInfoSEIEnabled;
    331   Bool      m_chromaSamplingFilterSEIenabled;
    332   Int       m_chromaSamplingHorFilterIdc;
    333   Int       m_chromaSamplingVerFilterIdc;
     331  Bool      m_chromaResamplingFilterSEIenabled;
     332  Int       m_chromaResamplingHorFilterIdc;
     333  Int       m_chromaResamplingVerFilterIdc;
    334334  Int       m_toneMapId;
    335335  Bool      m_toneMapCancelFlag;
  • branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp

    r1433 r1434  
    729729  m_cTEncTop.setTMISEINominalWhiteLevelLumaCodeValue              ( m_nominalWhiteLevelLumaCodeValue );
    730730  m_cTEncTop.setTMISEIExtendedWhiteLevelLumaCodeValue             ( m_extendedWhiteLevelLumaCodeValue );
    731   m_cTEncTop.setChromaSamplingFilterHintEnabled                   ( m_chromaSamplingFilterSEIenabled );
    732   m_cTEncTop.setChromaSamplingHorFilterIdc                        ( m_chromaSamplingHorFilterIdc );
    733   m_cTEncTop.setChromaSamplingVerFilterIdc                        ( m_chromaSamplingVerFilterIdc );
     731  m_cTEncTop.setChromaResamplingFilterHintEnabled                 ( m_chromaResamplingFilterSEIenabled );
     732  m_cTEncTop.setChromaResamplingHorFilterIdc                      ( m_chromaResamplingHorFilterIdc );
     733  m_cTEncTop.setChromaResamplingVerFilterIdc                      ( m_chromaResamplingVerFilterIdc );
    734734  m_cTEncTop.setFramePackingArrangementSEIEnabled                 ( m_framePackingSEIEnabled );
    735735  m_cTEncTop.setFramePackingArrangementSEIType                    ( m_framePackingSEIType );
  • branches/SHM-dev/source/Lib/TLibCommon/SEI.cpp

    r1286 r1434  
    148148    case SEI::SEGM_RECT_FRAME_PACKING:              return "Segmented rectangular frame packing arrangement";
    149149    case SEI::TEMP_MOTION_CONSTRAINED_TILE_SETS:    return "Temporal motion constrained tile sets";
    150     case SEI::CHROMA_SAMPLING_FILTER_HINT:          return "Chroma sampling filter hint";
     150    case SEI::CHROMA_RESAMPLING_FILTER_HINT:        return "Chroma sampling filter hint";
    151151#if Q0074_COLOUR_REMAPPING_SEI
    152152    case SEI::COLOUR_REMAPPING_INFO:                return "Colour Remapping Information";
  • branches/SHM-dev/source/Lib/TLibCommon/SEI.h

    r1335 r1434  
    8989    SEGM_RECT_FRAME_PACKING              = 138,
    9090    TEMP_MOTION_CONSTRAINED_TILE_SETS    = 139,
    91     CHROMA_SAMPLING_FILTER_HINT          = 140,
     91    CHROMA_RESAMPLING_FILTER_HINT        = 140,
    9292    KNEE_FUNCTION_INFO                   = 141,
    9393#if Q0074_COLOUR_REMAPPING_SEI
     
    465465};
    466466
    467 class SEIChromaSamplingFilterHint : public SEI
    468 {
    469 public:
    470   PayloadType payloadType() const {return CHROMA_SAMPLING_FILTER_HINT;}
    471   SEIChromaSamplingFilterHint() {}
    472   virtual ~SEIChromaSamplingFilterHint() {
    473     if(m_verChromaFilterIdc == 1)
    474     {
    475       for(Int i = 0; i < m_numVerticalFilters; i ++)
    476       {
    477         free(m_verFilterCoeff[i]);
    478       }
    479       free(m_verFilterCoeff);
    480       free(m_verTapLengthMinus1);
    481     }
    482     if(m_horChromaFilterIdc == 1)
    483     {
    484       for(Int i = 0; i < m_numHorizontalFilters; i ++)
    485       {
    486         free(m_horFilterCoeff[i]);
    487       }
    488       free(m_horFilterCoeff);
    489       free(m_horTapLengthMinus1);
    490     }
    491   }
    492 
    493   Int   m_verChromaFilterIdc;
    494   Int   m_horChromaFilterIdc;
    495   Bool  m_verFilteringProcessFlag;
    496   Int   m_targetFormatIdc;
    497   Bool  m_perfectReconstructionFlag;
    498   Int   m_numVerticalFilters;
    499   Int*  m_verTapLengthMinus1;
    500   Int** m_verFilterCoeff;
    501   Int   m_numHorizontalFilters;
    502   Int*  m_horTapLengthMinus1;
    503   Int** m_horFilterCoeff;
     467class SEIChromaResamplingFilterHint : public SEI
     468{
     469public:
     470  PayloadType payloadType() const {return CHROMA_RESAMPLING_FILTER_HINT;}
     471  SEIChromaResamplingFilterHint() {}
     472  virtual ~SEIChromaResamplingFilterHint() {}
     473
     474  Int                            m_verChromaFilterIdc;
     475  Int                            m_horChromaFilterIdc;
     476  Bool                           m_verFilteringFieldProcessingFlag;
     477  Int                            m_targetFormatIdc;
     478  Bool                           m_perfectReconstructionFlag;
     479  std::vector<std::vector<Int> > m_verFilterCoeff;
     480  std::vector<std::vector<Int> > m_horFilterCoeff;
    504481};
    505482
  • branches/SHM-dev/source/Lib/TLibDecoder/SEIread.cpp

    r1379 r1434  
    299299      xParseSEITimeCode((SEITimeCode&) *sei, payloadSize, pDecodedMessageOutputStream);
    300300      break;
    301     case SEI::CHROMA_SAMPLING_FILTER_HINT:
    302       sei = new SEIChromaSamplingFilterHint;
    303       xParseSEIChromaSamplingFilterHint((SEIChromaSamplingFilterHint&) *sei, payloadSize/*, sps*/, pDecodedMessageOutputStream);
     301    case SEI::CHROMA_RESAMPLING_FILTER_HINT:
     302      sei = new SEIChromaResamplingFilterHint;
     303      xParseSEIChromaResamplingFilterHint((SEIChromaResamplingFilterHint&) *sei, payloadSize, pDecodedMessageOutputStream);
    304304      //}
    305305      break;
     
    12601260}
    12611261
    1262 Void SEIReader::xParseSEIChromaSamplingFilterHint(SEIChromaSamplingFilterHint& sei, UInt payloadSize/*, TComSPS* sps*/, std::ostream *pDecodedMessageOutputStream)
     1262Void SEIReader::xParseSEIChromaResamplingFilterHint(SEIChromaResamplingFilterHint& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream)
    12631263{
    12641264  UInt uiCode;
     
    12671267  sei_read_code( pDecodedMessageOutputStream, 8, uiCode, "ver_chroma_filter_idc"); sei.m_verChromaFilterIdc = uiCode;
    12681268  sei_read_code( pDecodedMessageOutputStream, 8, uiCode, "hor_chroma_filter_idc"); sei.m_horChromaFilterIdc = uiCode;
    1269   sei_read_flag( pDecodedMessageOutputStream, uiCode, "ver_filtering_process_flag"); sei.m_verFilteringProcessFlag = uiCode;
     1269  sei_read_flag( pDecodedMessageOutputStream, uiCode, "ver_filtering_field_processing_flag"); sei.m_verFilteringFieldProcessingFlag = uiCode;
    12701270  if(sei.m_verChromaFilterIdc == 1 || sei.m_horChromaFilterIdc == 1)
    12711271  {
     
    12731273    if(sei.m_verChromaFilterIdc == 1)
    12741274    {
    1275       sei_read_uvlc( pDecodedMessageOutputStream, uiCode, "num_vertical_filters"); sei.m_numVerticalFilters = uiCode;
    1276       if(sei.m_numVerticalFilters > 0)
    1277       {
    1278         sei.m_verTapLengthMinus1 = (Int*)malloc(sei.m_numVerticalFilters * sizeof(Int));
    1279         sei.m_verFilterCoeff = (Int**)malloc(sei.m_numVerticalFilters * sizeof(Int*));
    1280         for(Int i = 0; i < sei.m_numVerticalFilters; i ++)
    1281         {
    1282           sei_read_uvlc( pDecodedMessageOutputStream, uiCode, "ver_tap_length_minus_1"); sei.m_verTapLengthMinus1[i] = uiCode;
    1283           sei.m_verFilterCoeff[i] = (Int*)malloc(sei.m_verTapLengthMinus1[i] * sizeof(Int));
    1284           for(Int j = 0; j < sei.m_verTapLengthMinus1[i]; j ++)
     1275      UInt numVerticalFilters;
     1276      sei_read_uvlc( pDecodedMessageOutputStream, numVerticalFilters, "num_vertical_filters"); sei.m_verFilterCoeff.resize(numVerticalFilters);
     1277      if(numVerticalFilters > 0)
     1278      {
     1279        for(Int i = 0; i < numVerticalFilters; i++)
     1280        {
     1281          UInt verTapLengthMinus1;
     1282          sei_read_uvlc( pDecodedMessageOutputStream, verTapLengthMinus1, "ver_tap_length_minus_1"); sei.m_verFilterCoeff[i].resize(verTapLengthMinus1+1);
     1283          for(Int j = 0; j < (verTapLengthMinus1 + 1); j++)
    12851284          {
    12861285            sei_read_svlc( pDecodedMessageOutputStream, sei.m_verFilterCoeff[i][j], "ver_filter_coeff");
     
    12911290    if(sei.m_horChromaFilterIdc == 1)
    12921291    {
    1293       sei_read_uvlc( pDecodedMessageOutputStream, uiCode, "num_horizontal_filters"); sei.m_numHorizontalFilters = uiCode;
    1294       if(sei.m_numHorizontalFilters  > 0)
    1295       {
    1296         sei.m_horTapLengthMinus1 = (Int*)malloc(sei.m_numHorizontalFilters * sizeof(Int));
    1297         sei.m_horFilterCoeff = (Int**)malloc(sei.m_numHorizontalFilters * sizeof(Int*));
    1298         for(Int i = 0; i < sei.m_numHorizontalFilters; i ++)
    1299         {
    1300           sei_read_uvlc( pDecodedMessageOutputStream, uiCode, "hor_tap_length_minus_1"); sei.m_horTapLengthMinus1[i] = uiCode;
    1301           sei.m_horFilterCoeff[i] = (Int*)malloc(sei.m_horTapLengthMinus1[i] * sizeof(Int));
    1302           for(Int j = 0; j < sei.m_horTapLengthMinus1[i]; j ++)
     1292      UInt numHorizontalFilters;
     1293      sei_read_uvlc( pDecodedMessageOutputStream, numHorizontalFilters, "num_horizontal_filters"); sei.m_horFilterCoeff.resize(numHorizontalFilters);
     1294      if(numHorizontalFilters  > 0)
     1295      {
     1296        for(Int i = 0; i < numHorizontalFilters; i++)
     1297        {
     1298          UInt horTapLengthMinus1;
     1299          sei_read_uvlc( pDecodedMessageOutputStream, horTapLengthMinus1, "hor_tap_length_minus_1"); sei.m_horFilterCoeff[i].resize(horTapLengthMinus1+1);
     1300          for(Int j = 0; j < (horTapLengthMinus1 + 1); j++)
    13031301          {
    13041302            sei_read_svlc( pDecodedMessageOutputStream, sei.m_horFilterCoeff[i][j], "hor_filter_coeff");
  • branches/SHM-dev/source/Lib/TLibDecoder/SEIread.h

    r1259 r1434  
    6161  Void parseSEImessage(TComInputBitstream* bs, SEIMessages& seis, const NalUnitType nalUnitType, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream);
    6262#endif
     63
    6364protected:
    6465#if O0164_MULTI_LAYER_HRD
     
    7778  Void xParseSEIuserDataUnregistered          (SEIuserDataUnregistered &sei,          UInt payloadSize,                     std::ostream *pDecodedMessageOutputStream);
    7879  Void xParseSEIActiveParameterSets           (SEIActiveParameterSets  &sei,          UInt payloadSize,                     std::ostream *pDecodedMessageOutputStream);
     80#if SVC_EXTENSION
     81  Void xParseSEIDecodingUnitInfo              (SEIDecodingUnitInfo& sei,              UInt payloadSize, const TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, const TComVPS *vps, std::ostream *pDecodedMessageOutputStream);
     82#else
     83  Void xParseSEIDecodingUnitInfo              (SEIDecodingUnitInfo& sei,              UInt payloadSize, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream);
     84#endif
    7985  Void xParseSEIDecodedPictureHash            (SEIDecodedPictureHash& sei,            UInt payloadSize,                     std::ostream *pDecodedMessageOutputStream);
    8086#if SVC_EXTENSION
    81   Void xParseSEIDecodingUnitInfo              (SEIDecodingUnitInfo& sei,              UInt payloadSize, const TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, const TComVPS *vps, std::ostream *pDecodedMessageOutputStream);
    8287  Void xParseSEIBufferingPeriod               (SEIBufferingPeriod& sei,               UInt payloadSize, const TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, const TComVPS *vps, std::ostream *pDecodedMessageOutputStream);
    8388  Void xParseSEIPictureTiming                 (SEIPictureTiming& sei,                 UInt payloadSize, const TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, const TComVPS *vps, std::ostream *pDecodedMessageOutputStream);
    8489#else
    85   Void xParseSEIDecodingUnitInfo              (SEIDecodingUnitInfo& sei,              UInt payloadSize, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream);
    8690  Void xParseSEIBufferingPeriod               (SEIBufferingPeriod& sei,               UInt payloadSize, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream);
    8791  Void xParseSEIPictureTiming                 (SEIPictureTiming& sei,                 UInt payloadSize, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream);
     
    101105  Void xParseSEITempMotionConstraintsTileSets (SEITempMotionConstrainedTileSets& sei, UInt payloadSize,                     std::ostream *pDecodedMessageOutputStream);
    102106  Void xParseSEITimeCode                      (SEITimeCode& sei,                      UInt payloadSize,                     std::ostream *pDecodedMessageOutputStream);
    103   Void xParseSEIChromaSamplingFilterHint      (SEIChromaSamplingFilterHint& sei,      UInt payloadSize/*,TComSPS* */,       std::ostream *pDecodedMessageOutputStream);
     107  Void xParseSEIChromaResamplingFilterHint    (SEIChromaResamplingFilterHint& sei,    UInt payloadSize,                     std::ostream *pDecodedMessageOutputStream);
    104108  Void xParseSEIKneeFunctionInfo              (SEIKneeFunctionInfo& sei,              UInt payloadSize,                     std::ostream *pDecodedMessageOutputStream);
    105109  Void xParseSEIMasteringDisplayColourVolume  (SEIMasteringDisplayColourVolume& sei,  UInt payloadSize,                     std::ostream *pDecodedMessageOutputStream);
  • branches/SHM-dev/source/Lib/TLibEncoder/SEIEncoder.cpp

    r1307 r1434  
    416416}
    417417
    418 Void SEIEncoder::initSEIChromaSamplingFilterHint(SEIChromaSamplingFilterHint *seiChromaSamplingFilterHint, Int iHorFilterIndex, Int iVerFilterIndex)
    419 {
    420   assert (m_isInitialized);
    421   assert (seiChromaSamplingFilterHint!=NULL);
    422 
    423   seiChromaSamplingFilterHint->m_verChromaFilterIdc = iVerFilterIndex;
    424   seiChromaSamplingFilterHint->m_horChromaFilterIdc = iHorFilterIndex;
    425   seiChromaSamplingFilterHint->m_verFilteringProcessFlag = 1;
    426   seiChromaSamplingFilterHint->m_targetFormatIdc = 3;
    427   seiChromaSamplingFilterHint->m_perfectReconstructionFlag = false;
    428   if(seiChromaSamplingFilterHint->m_verChromaFilterIdc == 1)
    429   {
    430     seiChromaSamplingFilterHint->m_numVerticalFilters = 1;
    431     seiChromaSamplingFilterHint->m_verTapLengthMinus1 = (Int*)malloc(seiChromaSamplingFilterHint->m_numVerticalFilters * sizeof(Int));
    432     seiChromaSamplingFilterHint->m_verFilterCoeff =    (Int**)malloc(seiChromaSamplingFilterHint->m_numVerticalFilters * sizeof(Int*));
    433     for(Int i = 0; i < seiChromaSamplingFilterHint->m_numVerticalFilters; i ++)
    434     {
    435       seiChromaSamplingFilterHint->m_verTapLengthMinus1[i] = 0;
    436       seiChromaSamplingFilterHint->m_verFilterCoeff[i] = (Int*)malloc(seiChromaSamplingFilterHint->m_verTapLengthMinus1[i] * sizeof(Int));
    437       for(Int j = 0; j < seiChromaSamplingFilterHint->m_verTapLengthMinus1[i]; j ++)
    438       {
    439         seiChromaSamplingFilterHint->m_verFilterCoeff[i][j] = 0;
    440       }
    441     }
     418Void SEIEncoder::initSEIChromaResamplingFilterHint(SEIChromaResamplingFilterHint *seiChromaResamplingFilterHint, Int iHorFilterIndex, Int iVerFilterIndex)
     419{
     420  assert (m_isInitialized);
     421  assert (seiChromaResamplingFilterHint!=NULL);
     422
     423  seiChromaResamplingFilterHint->m_verChromaFilterIdc = iVerFilterIndex;
     424  seiChromaResamplingFilterHint->m_horChromaFilterIdc = iHorFilterIndex;
     425  seiChromaResamplingFilterHint->m_verFilteringFieldProcessingFlag = 1;
     426  seiChromaResamplingFilterHint->m_targetFormatIdc = 3;
     427  seiChromaResamplingFilterHint->m_perfectReconstructionFlag = false;
     428
     429  // this creates some example filter values, if explicit filter definition is selected
     430  if (seiChromaResamplingFilterHint->m_verChromaFilterIdc == 1)
     431  {
     432    const Int numVerticalFilters = 3;
     433    const Int verTapLengthMinus1[] = {5,3,3};
     434
     435    seiChromaResamplingFilterHint->m_verFilterCoeff.resize(numVerticalFilters);
     436    for(Int i = 0; i < numVerticalFilters; i ++)
     437    {
     438      seiChromaResamplingFilterHint->m_verFilterCoeff[i].resize(verTapLengthMinus1[i]+1);
     439    }
     440    // Note: C++11 -> seiChromaResamplingFilterHint->m_verFilterCoeff[0] = {-3,13,31,23,3,-3};
     441    seiChromaResamplingFilterHint->m_verFilterCoeff[0][0] = -3;
     442    seiChromaResamplingFilterHint->m_verFilterCoeff[0][1] = 13;
     443    seiChromaResamplingFilterHint->m_verFilterCoeff[0][2] = 31;
     444    seiChromaResamplingFilterHint->m_verFilterCoeff[0][3] = 23;
     445    seiChromaResamplingFilterHint->m_verFilterCoeff[0][4] = 3;
     446    seiChromaResamplingFilterHint->m_verFilterCoeff[0][5] = -3;
     447
     448    seiChromaResamplingFilterHint->m_verFilterCoeff[1][0] = -1;
     449    seiChromaResamplingFilterHint->m_verFilterCoeff[1][1] = 25;
     450    seiChromaResamplingFilterHint->m_verFilterCoeff[1][2] = 247;
     451    seiChromaResamplingFilterHint->m_verFilterCoeff[1][3] = -15;
     452
     453    seiChromaResamplingFilterHint->m_verFilterCoeff[2][0] = -20;
     454    seiChromaResamplingFilterHint->m_verFilterCoeff[2][1] = 186;
     455    seiChromaResamplingFilterHint->m_verFilterCoeff[2][2] = 100;
     456    seiChromaResamplingFilterHint->m_verFilterCoeff[2][3] = -10;
    442457  }
    443458  else
    444459  {
    445     seiChromaSamplingFilterHint->m_numVerticalFilters = 0;
    446     seiChromaSamplingFilterHint->m_verTapLengthMinus1 = NULL;
    447     seiChromaSamplingFilterHint->m_verFilterCoeff = NULL;
    448   }
    449   if(seiChromaSamplingFilterHint->m_horChromaFilterIdc == 1)
    450   {
    451     seiChromaSamplingFilterHint->m_numHorizontalFilters = 1;
    452     seiChromaSamplingFilterHint->m_horTapLengthMinus1 = (Int*)malloc(seiChromaSamplingFilterHint->m_numHorizontalFilters * sizeof(Int));
    453     seiChromaSamplingFilterHint->m_horFilterCoeff = (Int**)malloc(seiChromaSamplingFilterHint->m_numHorizontalFilters * sizeof(Int*));
    454     for(Int i = 0; i < seiChromaSamplingFilterHint->m_numHorizontalFilters; i ++)
    455     {
    456       seiChromaSamplingFilterHint->m_horTapLengthMinus1[i] = 0;
    457       seiChromaSamplingFilterHint->m_horFilterCoeff[i] = (Int*)malloc(seiChromaSamplingFilterHint->m_horTapLengthMinus1[i] * sizeof(Int));
    458       for(Int j = 0; j < seiChromaSamplingFilterHint->m_horTapLengthMinus1[i]; j ++)
    459       {
    460         seiChromaSamplingFilterHint->m_horFilterCoeff[i][j] = 0;
    461       }
    462     }
     460    seiChromaResamplingFilterHint->m_verFilterCoeff.resize(0);
     461  }
     462
     463  if (seiChromaResamplingFilterHint->m_horChromaFilterIdc == 1)
     464  {
     465    Int const numHorizontalFilters = 1;
     466    const Int horTapLengthMinus1[] = {3};
     467
     468    seiChromaResamplingFilterHint->m_horFilterCoeff.resize(numHorizontalFilters);
     469    for(Int i = 0; i < numHorizontalFilters; i ++)
     470    {
     471      seiChromaResamplingFilterHint->m_horFilterCoeff[i].resize(horTapLengthMinus1[i]+1);
     472    }
     473    seiChromaResamplingFilterHint->m_horFilterCoeff[0][0] = 1;
     474    seiChromaResamplingFilterHint->m_horFilterCoeff[0][1] = 6;
     475    seiChromaResamplingFilterHint->m_horFilterCoeff[0][2] = 1;
    463476  }
    464477  else
    465478  {
    466     seiChromaSamplingFilterHint->m_numHorizontalFilters = 0;
    467     seiChromaSamplingFilterHint->m_horTapLengthMinus1 = NULL;
    468     seiChromaSamplingFilterHint->m_horFilterCoeff = NULL;
     479    seiChromaResamplingFilterHint->m_horFilterCoeff.resize(0);
    469480  }
    470481}
  • branches/SHM-dev/source/Lib/TLibEncoder/SEIEncoder.h

    r1307 r1434  
    7979  Void initSEITempMotionConstrainedTileSets (SEITempMotionConstrainedTileSets *sei, const TComPPS *pps);
    8080  Void initSEIKneeFunctionInfo(SEIKneeFunctionInfo *sei);
    81   Void initSEIChromaSamplingFilterHint(SEIChromaSamplingFilterHint *sei, Int iHorFilterIndex, Int iVerFilterIndex);
     81  Void initSEIChromaResamplingFilterHint(SEIChromaResamplingFilterHint *sei, Int iHorFilterIndex, Int iVerFilterIndex);
    8282  Void initSEITimeCode(SEITimeCode *sei);
    8383
  • branches/SHM-dev/source/Lib/TLibEncoder/SEIwrite.cpp

    r1379 r1434  
    140140#endif
    141141    break;
    142   case SEI::CHROMA_SAMPLING_FILTER_HINT:
    143     xWriteSEIChromaSamplingFilterHint(*static_cast<const SEIChromaSamplingFilterHint*>(&sei)/*, sps*/);
     142  case SEI::CHROMA_RESAMPLING_FILTER_HINT:
     143    xWriteSEIChromaResamplingFilterHint(*static_cast<const SEIChromaResamplingFilterHint*>(&sei));
    144144    break;
    145145  case SEI::TEMP_MOTION_CONSTRAINED_TILE_SETS:
     
    206206#endif //SVC_EXTENSION
    207207  default:
    208     assert(!"Unhandled SEI message");
     208    assert(!"Trying to write unhandled SEI message");
    209209    break;
    210210  }
     
    922922}
    923923
    924 Void SEIWriter::xWriteSEIChromaSamplingFilterHint(const SEIChromaSamplingFilterHint &sei/*, TComSPS* sps*/)
     924Void SEIWriter::xWriteSEIChromaResamplingFilterHint(const SEIChromaResamplingFilterHint &sei)
    925925{
    926926  WRITE_CODE(sei.m_verChromaFilterIdc, 8, "ver_chroma_filter_idc");
    927927  WRITE_CODE(sei.m_horChromaFilterIdc, 8, "hor_chroma_filter_idc");
    928   WRITE_FLAG(sei.m_verFilteringProcessFlag, "ver_filtering_process_flag");
     928  WRITE_FLAG(sei.m_verFilteringFieldProcessingFlag, "ver_filtering_field_processing_flag");
    929929  if(sei.m_verChromaFilterIdc == 1 || sei.m_horChromaFilterIdc == 1)
    930930  {
    931     writeUserDefinedCoefficients(sei);
    932   }
    933 }
    934 
    935 // write hardcoded chroma filter coefficients in the SEI messages
    936 Void SEIWriter::writeUserDefinedCoefficients(const SEIChromaSamplingFilterHint &sei)
    937 {
    938   Int const iNumVerticalFilters = 3;
    939   Int verticalTapLength_minus1[iNumVerticalFilters] = {5,3,3};
    940   Int* userVerticalCoefficients[iNumVerticalFilters];
    941   for(Int i = 0; i < iNumVerticalFilters; i ++)
    942   {
    943     userVerticalCoefficients[i] = (Int*)malloc( (verticalTapLength_minus1[i]+1) * sizeof(Int));
    944   }
    945   userVerticalCoefficients[0][0] = -3;
    946   userVerticalCoefficients[0][1] = 13;
    947   userVerticalCoefficients[0][2] = 31;
    948   userVerticalCoefficients[0][3] = 23;
    949   userVerticalCoefficients[0][4] = 3;
    950   userVerticalCoefficients[0][5] = -3;
    951 
    952   userVerticalCoefficients[1][0] = -1;
    953   userVerticalCoefficients[1][1] = 25;
    954   userVerticalCoefficients[1][2] = 247;
    955   userVerticalCoefficients[1][3] = -15;
    956 
    957   userVerticalCoefficients[2][0] = -20;
    958   userVerticalCoefficients[2][1] = 186;
    959   userVerticalCoefficients[2][2] = 100;
    960   userVerticalCoefficients[2][3] = -10;
    961  
    962   Int const iNumHorizontalFilters = 1;
    963   Int horizontalTapLength_minus1[iNumHorizontalFilters] = {3};
    964   Int* userHorizontalCoefficients[iNumHorizontalFilters];
    965   for(Int i = 0; i < iNumHorizontalFilters; i ++)
    966   {
    967     userHorizontalCoefficients[i] = (Int*)malloc( (horizontalTapLength_minus1[i]+1) * sizeof(Int));
    968   }
    969   userHorizontalCoefficients[0][0] = 1;
    970   userHorizontalCoefficients[0][1] = 6;
    971   userHorizontalCoefficients[0][2] = 1;
    972 
    973   WRITE_UVLC(3, "target_format_idc");
    974   if(sei.m_verChromaFilterIdc == 1)
    975   {
    976     WRITE_UVLC(iNumVerticalFilters, "num_vertical_filters");
    977     if(iNumVerticalFilters > 0)
    978     {
    979       for(Int i = 0; i < iNumVerticalFilters; i ++)
    980       {
    981         WRITE_UVLC(verticalTapLength_minus1[i], "ver_tap_length_minus_1");
    982         for(Int j = 0; j < verticalTapLength_minus1[i]; j ++)
    983         {
    984           WRITE_SVLC(userVerticalCoefficients[i][j], "ver_filter_coeff");
    985         }
    986       }
    987     }
    988   }
    989   if(sei.m_horChromaFilterIdc == 1)
    990   {
    991     WRITE_UVLC(iNumHorizontalFilters, "num_horizontal_filters");
    992     if(iNumHorizontalFilters > 0)
    993     {
    994       for(Int i = 0; i < iNumHorizontalFilters; i ++)
    995       {
    996         WRITE_UVLC(horizontalTapLength_minus1[i], "hor_tap_length_minus_1");
    997         for(Int j = 0; j < horizontalTapLength_minus1[i]; j ++)
    998         {
    999           WRITE_SVLC(userHorizontalCoefficients[i][j], "hor_filter_coeff");
     931    WRITE_UVLC(sei.m_targetFormatIdc, "target_format_idc");
     932    if(sei.m_verChromaFilterIdc == 1)
     933    {
     934      const Int numVerticalFilter = (Int)sei.m_verFilterCoeff.size();
     935      WRITE_UVLC(numVerticalFilter, "num_vertical_filters");
     936      if(numVerticalFilter > 0)
     937      {
     938        for(Int i = 0; i < numVerticalFilter; i ++)
     939        {
     940          const Int verTapLengthMinus1 = (Int) sei.m_verFilterCoeff[i].size() - 1;
     941          WRITE_UVLC(verTapLengthMinus1, "ver_tap_length_minus_1");
     942          for(Int j = 0; j < (verTapLengthMinus1 + 1); j ++)
     943          {
     944            WRITE_SVLC(sei.m_verFilterCoeff[i][j], "ver_filter_coeff");
     945          }
     946        }
     947      }
     948    }
     949    if(sei.m_horChromaFilterIdc == 1)
     950    {
     951      const Int numHorizontalFilter = (Int) sei.m_horFilterCoeff.size();
     952      WRITE_UVLC(numHorizontalFilter, "num_horizontal_filters");
     953      if(numHorizontalFilter > 0)
     954      {
     955        for(Int i = 0; i < numHorizontalFilter; i ++)
     956        {
     957          const Int horTapLengthMinus1 = (Int) sei.m_horFilterCoeff[i].size() - 1;
     958          WRITE_UVLC(horTapLengthMinus1, "hor_tap_length_minus_1");
     959          for(Int j = 0; j < (horTapLengthMinus1 + 1); j ++)
     960          {
     961            WRITE_SVLC(sei.m_horFilterCoeff[i][j], "hor_filter_coeff");
     962          }
    1000963        }
    1001964      }
  • branches/SHM-dev/source/Lib/TLibEncoder/SEIwrite.h

    r1352 r1434  
    5757
    5858protected:
    59 #if O0164_MULTI_LAYER_HRD
    60   Void xWriteSEIpayloadData(TComBitIf& bs, const SEI& sei, const TComVPS *vps, const TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei);
    61 #else
    62   Void xWriteSEIpayloadData(TComBitIf& bs, const SEI& sei, const TComSPS *sps);
    63 #endif
    6459  Void xWriteSEIuserDataUnregistered(const SEIuserDataUnregistered &sei);
    6560  Void xWriteSEIActiveParameterSets(const SEIActiveParameterSets& sei);
     
    7570  Void xWriteSEIBufferingPeriod(const SEIBufferingPeriod& sei, const TComSPS *sps);
    7671  Void xWriteSEIPictureTiming(const SEIPictureTiming& sei, const TComSPS *sps);
    77 #endif
    78   TComSPS *m_pSPS;
     72#endif 
    7973  Void xWriteSEIRecoveryPoint(const SEIRecoveryPoint& sei);
    8074  Void xWriteSEIFramePacking(const SEIFramePacking& sei);
     
    9387  Void xWriteSEITempMotionConstrainedTileSets(const SEITempMotionConstrainedTileSets& sei);
    9488  Void xWriteSEITimeCode(const SEITimeCode& sei);
    95   Void xWriteSEIChromaSamplingFilterHint(const SEIChromaSamplingFilterHint& sei/*, TComSPS *sps*/);
    96   Void writeUserDefinedCoefficients(const SEIChromaSamplingFilterHint& sei);
     89  Void xWriteSEIChromaResamplingFilterHint(const SEIChromaResamplingFilterHint& sei);
    9790  Void xWriteSEIKneeFunctionInfo(const SEIKneeFunctionInfo &sei);
    9891  Void xWriteSEIMasteringDisplayColourVolume( const SEIMasteringDisplayColourVolume& sei);
     92
     93#if O0164_MULTI_LAYER_HRD
     94  Void xWriteSEIpayloadData(TComBitIf& bs, const SEI& sei, const TComVPS *vps, const TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei);
     95#else
     96  Void xWriteSEIpayloadData(TComBitIf& bs, const SEI& sei, const TComSPS *sps);
     97#endif
    9998  Void xWriteByteAlign();
    10099#if Q0074_COLOUR_REMAPPING_SEI
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncCavlc.cpp

    r1417 r1434  
    6565}
    6666
     67Void  xTraceAccessUnitDelimiter ()
     68{
     69  fprintf( g_hTrace, "=========== Access Unit Delimiter ===========\n");
     70}
     71
    6772#endif
    6873
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncCfg.h

    r1433 r1434  
    357357  Bool      m_vuiParametersPresentFlag;                       ///< enable generation of VUI parameters
    358358  Bool      m_aspectRatioInfoPresentFlag;                     ///< Signals whether aspect_ratio_idc is present
    359   Bool      m_chromaSamplingFilterHintEnabled;                ///< Signals whether chroma sampling filter hint data is present
    360   Int       m_chromaSamplingHorFilterIdc;                     ///< Specifies the Index of filter to use
    361   Int       m_chromaSamplingVerFilterIdc;                     ///< Specifies the Index of filter to use
     359  Bool      m_chromaResamplingFilterHintEnabled;              ///< Signals whether chroma sampling filter hint data is present
     360  Int       m_chromaResamplingHorFilterIdc;                   ///< Specifies the Index of filter to use
     361  Int       m_chromaResamplingVerFilterIdc;                   ///< Specifies the Index of filter to use
    362362  Int       m_aspectRatioIdc;                                 ///< aspect_ratio_idc
    363363  Int       m_sarWidth;                                       ///< horizontal size of the sample aspect ratio
     
    10591059  Bool         getLowerBitRateConstraintFlag() const                 { return m_lowerBitRateConstraintFlag; }
    10601060  Void         setLowerBitRateConstraintFlag(Bool b)                 { m_lowerBitRateConstraintFlag=b; }
    1061   Bool      getChromaSamplingFilterHintEnabled()                     { return m_chromaSamplingFilterHintEnabled;}
    1062   Void      setChromaSamplingFilterHintEnabled(Bool i)               { m_chromaSamplingFilterHintEnabled = i;}
    1063   Int       getChromaSamplingHorFilterIdc()                          { return m_chromaSamplingHorFilterIdc;}
    1064   Void      setChromaSamplingHorFilterIdc(Int i)                     { m_chromaSamplingHorFilterIdc = i;}
    1065   Int       getChromaSamplingVerFilterIdc()                          { return m_chromaSamplingVerFilterIdc;}
    1066   Void      setChromaSamplingVerFilterIdc(Int i)                     { m_chromaSamplingVerFilterIdc = i;}
     1061
     1062  Bool         getChromaResamplingFilterHintEnabled()                { return m_chromaResamplingFilterHintEnabled;}
     1063  Void         setChromaResamplingFilterHintEnabled(Bool i)          { m_chromaResamplingFilterHintEnabled = i;}
     1064  Int          getChromaResamplingHorFilterIdc()                     { return m_chromaResamplingHorFilterIdc;}
     1065  Void         setChromaResamplingHorFilterIdc(Int i)                { m_chromaResamplingHorFilterIdc = i;}
     1066  Int          getChromaResamplingVerFilterIdc()                     { return m_chromaResamplingVerFilterIdc;}
     1067  Void         setChromaResamplingVerFilterIdc(Int i)                { m_chromaResamplingVerFilterIdc = i;}
    10671068
    10681069  Void      setSummaryOutFilename(const std::string &s)              { m_summaryOutFilename = s; }
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp

    r1433 r1434  
    635635    seiMessages.push_back(sei);
    636636  }
     637  if(m_pcCfg->getChromaResamplingFilterHintEnabled())
     638  {
     639    SEIChromaResamplingFilterHint *seiChromaResamplingFilterHint = new SEIChromaResamplingFilterHint;
     640    m_seiEncoder.initSEIChromaResamplingFilterHint(seiChromaResamplingFilterHint, m_pcCfg->getChromaResamplingHorFilterIdc(), m_pcCfg->getChromaResamplingVerFilterIdc());
     641    seiMessages.push_back(seiChromaResamplingFilterHint);
     642  }
    637643
    638644#if SVC_EXTENSION
     
    890896    m_seiEncoder.initSEIRecoveryPoint(recoveryPointSEI, slice);
    891897    seiMessages.push_back(recoveryPointSEI);
    892 
    893     if(m_pcCfg->getDecodingRefreshType() == 3)
    894     {
    895       m_iLastRecoveryPicPOC = slice->getPOC();
    896     }
    897898  }
    898899  if (m_pcCfg->getTemporalLevel0IndexSEIEnabled())
     
    901902    m_seiEncoder.initTemporalLevel0IndexSEI(temporalLevel0IndexSEI, slice);
    902903    seiMessages.push_back(temporalLevel0IndexSEI);
    903   }
    904 
    905   if(slice->getSPS()->getVuiParametersPresentFlag() && m_pcCfg->getChromaSamplingFilterHintEnabled() && ( slice->getSliceType() == I_SLICE ))
    906   {
    907     SEIChromaSamplingFilterHint *seiChromaSamplingFilterHint = new SEIChromaSamplingFilterHint;
    908     m_seiEncoder.initSEIChromaSamplingFilterHint(seiChromaSamplingFilterHint, m_pcCfg->getChromaSamplingHorFilterIdc(), m_pcCfg->getChromaSamplingVerFilterIdc());
    909     seiMessages.push_back(seiChromaSamplingFilterHint);
    910904  }
    911905
     
    17141708      pcSlice->setMFMEnabledFlag(false);
    17151709    }
    1716 #endif //SVC_EXTENSION   
     1710#endif //SVC_EXTENSION
     1711
    17171712    pcSlice->setLastIDR(m_iLastIDR);
    17181713    pcSlice->setSliceIdx(0);
     
    19161911      }
    19171912    }
     1913
    19181914    if (m_pcCfg->getEfficientFieldIRAPEnabled())
    19191915    {
Note: See TracChangeset for help on using the changeset viewer.