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


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/Lib
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • 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.