Changeset 705 in SHVCSoftware for branches/SHM-6-dev


Ignore:
Timestamp:
19 Apr 2014, 06:59:58 (11 years ago)
Author:
seregin
Message:

change the conformance input to be not multiplied by SubWidthC and SubHeightC, it should be a lossless change

Location:
branches/SHM-6-dev/source
Files:
8 edited

Legend:

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

    r694 r705  
    12231223        if( i >= m_acLayerCfg[layer].m_numSamplePredRefLayers )
    12241224        {
    1225           printf( "NumSamplePredRefLayers: The number of columns whose width are defined is larger than the allowed number of columns.\n" );
     1225          printf( "NumSamplePredRefLayers%d: The number of columns whose width are defined is larger than the allowed number of columns.\n", layer );
    12261226          exit( EXIT_FAILURE );
    12271227        }
     
    12321232      if( i < m_acLayerCfg[layer].m_numSamplePredRefLayers )
    12331233      {
    1234         printf( "NumSamplePredRefLayers: The width of some columns is not defined.\n" );
     1234        printf( "NumSamplePredRefLayers%d: The width of some columns is not defined.\n", layer );
    12351235        exit( EXIT_FAILURE );
    12361236      }
     
    12541254        if( i >= m_acLayerCfg[layer].m_numMotionPredRefLayers )
    12551255        {
    1256           printf( "NumMotionPredRefLayers: The number of columns whose width are defined is larger than the allowed number of columns.\n" );
     1256          printf( "NumMotionPredRefLayers%d: The number of columns whose width are defined is larger than the allowed number of columns.\n", layer );
    12571257          exit( EXIT_FAILURE );
    12581258        }
     
    12631263      if( i < m_acLayerCfg[layer].m_numMotionPredRefLayers )
    12641264      {
    1265         printf( "NumMotionPredRefLayers: The width of some columns is not defined.\n" );
     1265        printf( "NumMotionPredRefLayers%d: The width of some columns is not defined.\n", layer );
    12661266        exit( EXIT_FAILURE );
    12671267      }
     
    12931293        if( i >= m_acLayerCfg[layer].m_numActiveRefLayers )
    12941294        {
    1295           printf( "NumActiveRefLayers: The number of columns whose width are defined is larger than the allowed number of columns.\n" );
     1295          printf( "NumActiveRefLayers%d: The number of columns whose width are defined is larger than the allowed number of columns.\n", layer );
    12961296          exit( EXIT_FAILURE );
    12971297        }
     
    13021302      if( i < m_acLayerCfg[layer].m_numActiveRefLayers )
    13031303      {
    1304         printf( "NumActiveRefLayers: The width of some columns is not defined.\n" );
     1304        printf( "NumActiveRefLayers%d: The width of some columns is not defined.\n", layer );
    13051305        exit( EXIT_FAILURE );
    13061306      }
  • branches/SHM-6-dev/source/App/TAppEncoder/TAppEncLayerCfg.cpp

    r644 r705  
    171171  }
    172172#endif
     173#if REPN_FORMAT_IN_VPS
     174  printf("Real     Format               : %dx%d %dHz\n", m_iSourceWidth - ( m_confLeft + m_confRight ) * TComSPS::getWinUnitX( m_chromaFormatIDC ), m_iSourceHeight - ( m_confTop + m_confBottom ) * TComSPS::getWinUnitY( m_chromaFormatIDC ), m_iFrameRate );
     175#else
    173176  printf("Real     Format               : %dx%d %dHz\n", m_iSourceWidth - m_confLeft - m_confRight, m_iSourceHeight - m_confTop - m_confBottom, m_iFrameRate );
     177#endif
    174178  printf("Internal Format               : %dx%d %dHz\n", m_iSourceWidth, m_iSourceHeight, m_iFrameRate );
    175179#if O0194_DIFFERENT_BITDEPTH_EL_BL
     
    229233        m_aiPad[0] = m_confRight  = ((m_iSourceWidth / minCuSize) + 1) * minCuSize - m_iSourceWidth;
    230234        m_iSourceWidth  += m_confRight;
     235#if REPN_FORMAT_IN_VPS
     236        m_confRight /= TComSPS::getWinUnitX( m_chromaFormatIDC );
     237#endif
    231238      }
    232239      if (m_iSourceHeight % minCuSize)
     
    239246          m_aiPad[1] = m_confBottom << 1;
    240247        }
     248#if REPN_FORMAT_IN_VPS
     249        m_confBottom /= TComSPS::getWinUnitY( m_chromaFormatIDC );
     250#endif
    241251      }
    242252      break;
     
    249259      m_confRight  = m_aiPad[0];
    250260      m_confBottom = m_aiPad[1];
     261#if REPN_FORMAT_IN_VPS
     262      m_confRight /= TComSPS::getWinUnitX( m_chromaFormatIDC );
     263      m_confBottom /= TComSPS::getWinUnitY( m_chromaFormatIDC );
     264#endif
    251265      break;
    252266    }
     
    331345  xConfirmPara( m_aiPad[1] % TComSPS::getWinUnitY(CHROMA_420) != 0, "Vertical padding must be an integer multiple of the specified chroma subsampling");
    332346
     347#if !REPN_FORMAT_IN_VPS
    333348  xConfirmPara( m_confLeft   % TComSPS::getWinUnitX(CHROMA_420) != 0, "Left conformance window offset must be an integer multiple of the specified chroma subsampling");
    334349  xConfirmPara( m_confRight  % TComSPS::getWinUnitX(CHROMA_420) != 0, "Right conformance window offset must be an integer multiple of the specified chroma subsampling");
    335350  xConfirmPara( m_confTop    % TComSPS::getWinUnitY(CHROMA_420) != 0, "Top conformance window offset must be an integer multiple of the specified chroma subsampling");
    336351  xConfirmPara( m_confBottom % TComSPS::getWinUnitY(CHROMA_420) != 0, "Bottom conformance window offset must be an integer multiple of the specified chroma subsampling");
     352#endif
    337353
    338354#if LAYER_CTB 
  • branches/SHM-6-dev/source/App/TAppEncoder/TAppEncTop.cpp

    r697 r705  
    13261326  if(vps->getMaxLayers() > MAX_REF_LAYERS)
    13271327  {
    1328     for(UInt layerCtr = 1;layerCtr <= vps->getMaxLayers() - 1; layerCtr++)
     1328    for(UInt layerCtr = 1; layerCtr <= vps->getMaxLayers() - 1; layerCtr++)
    13291329    {
    13301330      assert( vps->getNumRefLayers(vps->getLayerIdInNuh(layerCtr)) <= MAX_REF_LAYERS);
  • branches/SHM-6-dev/source/Lib/TLibCommon/TComDataCU.cpp

    r694 r705  
    35043504  Int topStartL  = baseColPic->getSlice(0)->getSPS()->getScaledRefLayerWindowForLayer(baseColPic->getSlice(0)->getVPS()->getRefLayerId(getSlice()->getLayerId(), refLayerIdc)).getWindowTopOffset();
    35053505#if Q0200_CONFORMANCE_BL_SIZE
    3506   leftStartL += baseColPic->getConformanceWindow().getWindowLeftOffset();
    3507   topStartL  += baseColPic->getConformanceWindow().getWindowTopOffset();
     3506  Int chromaFormatIdc = baseColPic->getSlice(0)->getChromaFormatIdc();
     3507  leftStartL += baseColPic->getConformanceWindow().getWindowLeftOffset() * TComSPS::getWinUnitX( chromaFormatIdc );
     3508  topStartL  += baseColPic->getConformanceWindow().getWindowTopOffset() * TComSPS::getWinUnitY( chromaFormatIdc );
    35083509#endif
    35093510#else
  • branches/SHM-6-dev/source/Lib/TLibCommon/TComUpsampleFilter.cpp

    r703 r705  
    137137
    138138#if Q0200_CONFORMANCE_BL_SIZE
     139  Int chromaFormatIdc = currSlice->getBaseColPic(refLayerIdc)->getSlice(0)->getChromaFormatIdc();
    139140  const Window &confBL = currSlice->getBaseColPic(refLayerIdc)->getConformanceWindow();
    140   widthBL  -= confBL.getWindowLeftOffset() + confBL.getWindowRightOffset();
    141   heightBL -= confBL.getWindowBottomOffset() + confBL.getWindowTopOffset();
     141  Int xScal = TComSPS::getWinUnitX( chromaFormatIdc );
     142  Int yScal = TComSPS::getWinUnitY( chromaFormatIdc );
     143
     144  widthBL  -= ( confBL.getWindowLeftOffset() + confBL.getWindowRightOffset() ) * xScal;
     145  heightBL -= ( confBL.getWindowBottomOffset() + confBL.getWindowTopOffset() ) * yScal;
    142146#endif
    143147#if P0312_VERT_PHASE_ADJ
     
    301305    Int   addY = ( ( phaseY * scaleY + 2 ) >> 2 ) + ( 1 << ( shiftY - 5 ) );
    302306#else
    303     Int   addX       = ( ( ( widthBL * phaseX ) << ( shiftX - 2 ) ) + ( widthEL >> 1 ) ) / widthEL + ( 1 << ( shiftX - 5 ) );
    304     Int   addY       = ( ( ( heightBL * phaseY ) << ( shiftY - 2 ) ) + ( heightEL >> 1 ) ) / heightEL+ ( 1 << ( shiftY - 5 ) );
     307    Int   addX = ( ( ( widthBL * phaseX ) << ( shiftX - 2 ) ) + ( widthEL >> 1 ) ) / widthEL + ( 1 << ( shiftX - 5 ) );
     308    Int   addY = ( ( ( heightBL * phaseY ) << ( shiftY - 2 ) ) + ( heightEL >> 1 ) ) / heightEL+ ( 1 << ( shiftY - 5 ) );
    305309#endif
    306310
    307311#if Q0120_PHASE_CALCULATION
    308     Int   deltaX     = (Int)phaseAlignFlag <<3;
    309     Int   deltaY     = (((Int)phaseAlignFlag <<3)>>(Int)vertPhasePositionEnableFlag) + ((Int)vertPhasePositionFlag<<3);
    310 #else
    311     Int   deltaX     = 4 * phaseX;
    312     Int   deltaY     = 4 * phaseY;
     312    Int   deltaX = (Int)phaseAlignFlag <<3;
     313    Int   deltaY = (((Int)phaseAlignFlag <<3)>>(Int)vertPhasePositionEnableFlag) + ((Int)vertPhasePositionFlag<<3);
     314#else
     315    Int   deltaX = 4 * phaseX;
     316    Int   deltaY = 4 * phaseY;
    313317#endif
    314318    Int shiftXM4 = shiftX - 4;
    315319    Int shiftYM4 = shiftY - 4;
    316320
    317     widthEL   = pcUsPic->getWidth ();
    318     heightEL  = pcUsPic->getHeight();
    319 
    320     widthBL   = pcBasePic->getWidth ();
    321     heightBL  = min<Int>( pcBasePic->getHeight(), heightEL );
     321    widthEL  = pcUsPic->getWidth ();
     322    heightEL = pcUsPic->getHeight();
     323
     324    widthBL  = pcBasePic->getWidth ();
     325    heightBL = min<Int>( pcBasePic->getHeight(), heightEL );
    322326
    323327    Int leftStartL = scalEL.getWindowLeftOffset();
     
    327331    Int leftOffset = leftStartL > 0 ? leftStartL : 0;
    328332#if Q0200_CONFORMANCE_BL_SIZE
    329     leftStartL += confBL.getWindowLeftOffset() << 4;
    330     topStartL  += confBL.getWindowTopOffset() << 4;
     333    leftStartL += ( confBL.getWindowLeftOffset() * xScal ) << 4;
     334    topStartL  += ( confBL.getWindowTopOffset() * yScal ) << 4;
    331335#endif
    332336#if N0214_INTERMEDIATE_BUFFER_16BITS
     
    424428    heightBL  = pcBasePic->getHeight();
    425429#if Q0200_CONFORMANCE_BL_SIZE
    426     widthBL  -= confBL.getWindowLeftOffset() + confBL.getWindowRightOffset();
    427     heightBL -= confBL.getWindowBottomOffset() + confBL.getWindowTopOffset();
     430    widthBL  -= ( confBL.getWindowLeftOffset() + confBL.getWindowRightOffset() ) * xScal;
     431    heightBL -= ( confBL.getWindowBottomOffset() + confBL.getWindowTopOffset() ) * yScal;
    428432#endif
    429433    widthEL   = pcUsPic->getWidth () - scalEL.getWindowLeftOffset() - scalEL.getWindowRightOffset();
     
    447451    leftOffset = leftStartC > 0 ? leftStartC : 0;
    448452#if Q0200_CONFORMANCE_BL_SIZE
    449     leftStartC += ( confBL.getWindowLeftOffset() >> 1 ) << 4;
    450     topStartC  += ( confBL.getWindowTopOffset() >> 1 ) << 4;
     453    leftStartC += ( ( confBL.getWindowLeftOffset() * xScal ) >> 1 ) << 4;
     454    topStartC  += ( ( confBL.getWindowTopOffset() * yScal ) >> 1 ) << 4;
    451455#endif
    452456    shiftX = 16;
  • branches/SHM-6-dev/source/Lib/TLibDecoder/TDecTop.cpp

    r704 r705  
    15561556        Int heightBL  = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getHeight();
    15571557#if Q0200_CONFORMANCE_BL_SIZE
    1558         Window &confBL = pcSlice->getBaseColPic(refLayerIdc)->getConformanceWindow();
    1559 #if REPN_FORMAT_IN_VPS
    1560 UInt chromaFormatIdc =  pcSlice->getBaseColPic(refLayerIdc)->getSlice(0)->getChromaFormatIdc();
    1561 Int xScal = TComSPS::getWinUnitX( chromaFormatIdc );
    1562 Int yScal = TComSPS::getWinUnitY( chromaFormatIdc );
    1563 confBL.setWindowBottomOffset(confBL.getWindowBottomOffset()*yScal);
    1564 confBL.setWindowTopOffset(confBL.getWindowTopOffset()*yScal);
    1565 confBL.setWindowLeftOffset(confBL.getWindowLeftOffset()*xScal);
    1566 confBL.setWindowRightOffset(confBL.getWindowRightOffset()*xScal);
    1567 #endif
    1568         widthBL  -= confBL.getWindowLeftOffset() + confBL.getWindowRightOffset();
    1569         heightBL -= confBL.getWindowTopOffset() + confBL.getWindowBottomOffset();
     1558        Int chromaFormatIdc = pcSlice->getBaseColPic(refLayerIdc)->getSlice(0)->getChromaFormatIdc();
     1559        const Window &confBL = pcSlice->getBaseColPic(refLayerIdc)->getConformanceWindow();
     1560        widthBL  -= ( confBL.getWindowLeftOffset() + confBL.getWindowRightOffset() ) * TComSPS::getWinUnitX( chromaFormatIdc );
     1561        heightBL -= ( confBL.getWindowTopOffset() + confBL.getWindowBottomOffset() ) * TComSPS::getWinUnitY( chromaFormatIdc );
    15701562#endif
    15711563        Int widthEL   = pcPic->getPicYuvRec()->getWidth()  - scalEL.getWindowLeftOffset() - scalEL.getWindowRightOffset();
     
    16281620        }
    16291621        pcSlice->setFullPelBaseRec ( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc) );
    1630 #if REPN_FORMAT_IN_VPS && Q0200_CONFORMANCE_BL_SIZE
    1631 confBL.setWindowBottomOffset(confBL.getWindowBottomOffset()/yScal);
    1632 confBL.setWindowTopOffset(confBL.getWindowTopOffset()/yScal);
    1633 confBL.setWindowLeftOffset(confBL.getWindowLeftOffset()/xScal);
    1634 confBL.setWindowRightOffset(confBL.getWindowRightOffset()/xScal);
    1635 #endif
    16361622#endif
    16371623      }
  • branches/SHM-6-dev/source/Lib/TLibEncoder/TEncCavlc.cpp

    r683 r705  
    509509  if (conf.getWindowEnabledFlag())
    510510  {
     511#if REPN_FORMAT_IN_VPS
     512    WRITE_UVLC( conf.getWindowLeftOffset(),   "conf_win_left_offset"   );
     513    WRITE_UVLC( conf.getWindowRightOffset(),  "conf_win_right_offset"  );
     514    WRITE_UVLC( conf.getWindowTopOffset(),    "conf_win_top_offset"    );
     515    WRITE_UVLC( conf.getWindowBottomOffset(), "conf_win_bottom_offset" );
     516#else
    511517    WRITE_UVLC( conf.getWindowLeftOffset()   / TComSPS::getWinUnitX(pcSPS->getChromaFormatIdc() ), "conf_win_left_offset" );
    512518    WRITE_UVLC( conf.getWindowRightOffset()  / TComSPS::getWinUnitX(pcSPS->getChromaFormatIdc() ), "conf_win_right_offset" );
    513519    WRITE_UVLC( conf.getWindowTopOffset()    / TComSPS::getWinUnitY(pcSPS->getChromaFormatIdc() ), "conf_win_top_offset" );
    514520    WRITE_UVLC( conf.getWindowBottomOffset() / TComSPS::getWinUnitY(pcSPS->getChromaFormatIdc() ), "conf_win_bottom_offset" );
     521#endif
    515522  }
    516523
  • branches/SHM-6-dev/source/Lib/TLibEncoder/TEncGOP.cpp

    r703 r705  
    10491049        Int heightBL  = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getHeight();
    10501050#if Q0200_CONFORMANCE_BL_SIZE
    1051         const Window &confBL = pcSlice->getBaseColPic(refLayerIdc)->getConformanceWindow();
    1052         widthBL  -= confBL.getWindowLeftOffset() + confBL.getWindowRightOffset();
    1053         heightBL -= confBL.getWindowTopOffset() + confBL.getWindowBottomOffset();
     1051        Int chromaFormatIdc = pcSlice->getBaseColPic(refLayerIdc)->getSlice(0)->getChromaFormatIdc();
     1052        const Window &confBL = pcSlice->getBaseColPic(refLayerIdc)->getConformanceWindow();
     1053        widthBL  -= ( confBL.getWindowLeftOffset() + confBL.getWindowRightOffset() ) * TComSPS::getWinUnitX( chromaFormatIdc );
     1054        heightBL -= ( confBL.getWindowTopOffset() + confBL.getWindowBottomOffset() ) * TComSPS::getWinUnitY( chromaFormatIdc );
    10541055#endif
    10551056        Int widthEL   = pcPic->getPicYuvRec()->getWidth()  - scalEL.getWindowLeftOffset() - scalEL.getWindowRightOffset();
Note: See TracChangeset for help on using the changeset viewer.