Ticket #981: display_window_v2.patch
File display_window_v2.patch, 10.1 KB (added by bheng, 11 years ago) |
---|
-
App/TAppDecoder/TAppDecTop.cpp
264 264 if ( m_pchReconFile ) 265 265 { 266 266 const Window &conf = pcPic->getConformanceWindow(); 267 const Window &defDisp = m_respectDefDispWindow || !pcPic->getSlice(0)->getSPS()->getVuiParametersPresentFlag() ? 268 pcPic->getSlice(0)->getSPS()->getVuiParameters()->getDefaultDisplayWindow() : 269 Window(); 267 const Window &defDisp = m_respectDefDispWindow ? pcPic->getDefDisplayWindow() : Window(); 270 268 m_cTVideoIOYuvReconFile.write( pcPic->getPicYuvRec(), 271 269 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 272 270 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), … … 323 321 if ( m_pchReconFile ) 324 322 { 325 323 const Window &conf = pcPic->getConformanceWindow(); 326 const Window &defDisp = m_respectDefDispWindow || !pcPic->getSlice(0)->getSPS()->getVuiParametersPresentFlag() ? 327 pcPic->getSlice(0)->getSPS()->getVuiParameters()->getDefaultDisplayWindow() : 328 Window(); 324 const Window &defDisp = m_respectDefDispWindow ? pcPic->getDefDisplayWindow() : Window(); 329 325 m_cTVideoIOYuvReconFile.write( pcPic->getPicYuvRec(), 330 326 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 331 327 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), -
Lib/TLibCommon/TComPic.cpp
72 72 { 73 73 } 74 74 75 Void TComPic::create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, Window &conformanceWindow, 75 Void TComPic::create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, Window &conformanceWindow, Window &defaultDisplayWindow, 76 76 Int *numReorderPics, Bool bIsVirtual) 77 77 78 78 { … … 92 92 93 93 /* store conformance window parameters with picture */ 94 94 m_conformanceWindow = conformanceWindow; 95 96 /* store display window parameters with picture */ 97 m_defaultDisplayWindow = defaultDisplayWindow; 95 98 96 99 /* store number of reorder pics with picture */ 97 100 memcpy(m_numReorderPics, numReorderPics, MAX_TLAYER*sizeof(Int)); -
Lib/TLibCommon/TComPic.h
79 79 80 80 Int m_numReorderPics[MAX_TLAYER]; 81 81 Window m_conformanceWindow; 82 Window m_defaultDisplayWindow; 82 83 83 84 std::vector<std::vector<TComDataCU*> > m_vSliceCUDataLink; 84 85 … … 88 89 TComPic(); 89 90 virtual ~TComPic(); 90 91 91 Void create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, Window &conformanceWindow, 92 Void create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, Window &conformanceWindow, Window &defaultDisplayWindow, 92 93 Int *numReorderPics, Bool bIsVirtual = false ); 93 94 94 95 virtual Void destroy(); … … 147 148 Void clearSliceBuffer() {m_apcPicSym->clearSliceBuffer(); } 148 149 149 150 Window& getConformanceWindow() { return m_conformanceWindow; } 151 Window& getDefDisplayWindow() { return m_defaultDisplayWindow; } 150 152 151 153 Void createNonDBFilterInfo (std::vector<Int> sliceStartAddress, Int sliceGranularityDepth 152 154 ,std::vector<Bool>* LFCrossSliceBoundary -
Lib/TLibDecoder/TDecCAVLC.cpp
407 407 if (uiCode != 0) 408 408 { 409 409 Window &defDisp = pcVUI->getDefaultDisplayWindow(); 410 READ_UVLC( uiCode, "def_disp_win_left_offset" ); defDisp.setWindowLeftOffset ( uiCode );411 READ_UVLC( uiCode, "def_disp_win_right_offset" ); defDisp.setWindowRightOffset ( uiCode );412 READ_UVLC( uiCode, "def_disp_win_top_offset" ); defDisp.setWindowTopOffset ( uiCode );413 READ_UVLC( uiCode, "def_disp_win_bottom_offset" ); defDisp.setWindowBottomOffset( uiCode );410 READ_UVLC( uiCode, "def_disp_win_left_offset" ); defDisp.setWindowLeftOffset ( uiCode * TComSPS::getWinUnitX( pcSPS->getChromaFormatIdc()) ); 411 READ_UVLC( uiCode, "def_disp_win_right_offset" ); defDisp.setWindowRightOffset ( uiCode * TComSPS::getWinUnitX( pcSPS->getChromaFormatIdc()) ); 412 READ_UVLC( uiCode, "def_disp_win_top_offset" ); defDisp.setWindowTopOffset ( uiCode * TComSPS::getWinUnitY( pcSPS->getChromaFormatIdc()) ); 413 READ_UVLC( uiCode, "def_disp_win_bottom_offset" ); defDisp.setWindowBottomOffset( uiCode * TComSPS::getWinUnitY( pcSPS->getChromaFormatIdc()) ); 414 414 } 415 415 #if L0043_TIMING_INFO 416 416 TimingInfo *timingInfo = pcVUI->getTimingInfo(); -
Lib/TLibDecoder/TDecTop.cpp
117 117 { 118 118 Int numReorderPics[MAX_TLAYER]; 119 119 Window &conformanceWindow = pcSlice->getSPS()->getConformanceWindow(); 120 Window defaultDisplayWindow = pcSlice->getSPS()->getVuiParametersPresentFlag() ? pcSlice->getSPS()->getVuiParameters()->getDefaultDisplayWindow() : Window(); 120 121 121 122 for( Int temporalLayer=0; temporalLayer < MAX_TLAYER; temporalLayer++) 122 123 { … … 129 130 rpcPic = new TComPic(); 130 131 131 132 rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 132 conformanceWindow, numReorderPics, true);133 conformanceWindow, defaultDisplayWindow, numReorderPics, true); 133 134 rpcPic->getPicSym()->allocSaoParam(&m_cSAO); 134 135 m_cListPic.pushBack( rpcPic ); 135 136 … … 167 168 } 168 169 rpcPic->destroy(); 169 170 rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 170 conformanceWindow, numReorderPics, true);171 conformanceWindow, defaultDisplayWindow, numReorderPics, true); 171 172 rpcPic->getPicSym()->allocSaoParam(&m_cSAO); 172 173 } 173 174 -
Lib/TLibEncoder/TEncPic.cpp
126 126 * \return Void 127 127 */ 128 128 Void TEncPic::create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth, 129 Window &conformanceWindow, Int *numReorderPics, Bool bIsVirtual )129 Window &conformanceWindow, Window &defaultDisplayWindow, Int *numReorderPics, Bool bIsVirtual ) 130 130 { 131 131 TComPic::create( iWidth, iHeight, uiMaxWidth, uiMaxHeight, uiMaxDepth, 132 conformanceWindow, numReorderPics, bIsVirtual );132 conformanceWindow, defaultDisplayWindow, numReorderPics, bIsVirtual ); 133 133 m_uiMaxAQDepth = uiMaxAQDepth; 134 134 if ( uiMaxAQDepth > 0 ) 135 135 { -
Lib/TLibEncoder/TEncPic.h
103 103 virtual ~TEncPic(); 104 104 105 105 Void create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth, 106 Window &conformanceWindow, Int *numReorderPics, Bool bIsVirtual = false );106 Window &conformanceWindow, Window &defaultDisplayWindow, Int *numReorderPics, Bool bIsVirtual = false ); 107 107 virtual Void destroy(); 108 108 109 109 TEncPicQPAdaptationLayer* getAQLayer( UInt uiDepth ) { return &m_acAQLayer[uiDepth]; } -
Lib/TLibEncoder/TEncTop.cpp
421 421 { 422 422 TEncPic* pcEPic = new TEncPic; 423 423 pcEPic->create( m_iSourceWidth, m_iSourceHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, m_cPPS.getMaxCuDQPDepth()+1 , 424 m_conformanceWindow, m_ numReorderPics);424 m_conformanceWindow, m_defaultDisplayWindow, m_numReorderPics); 425 425 rpcPic = pcEPic; 426 426 } 427 427 else … … 429 429 rpcPic = new TComPic; 430 430 431 431 rpcPic->create( m_iSourceWidth, m_iSourceHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 432 m_conformanceWindow, m_ numReorderPics);432 m_conformanceWindow, m_defaultDisplayWindow, m_numReorderPics); 433 433 } 434 434 if (getUseSAO()) 435 435 { -
Lib/TLibVideoIO/TVideoIOYuv.cpp
462 462 dstPicYuv = pPicYuv; 463 463 } 464 464 // location of upper left pel in a plane 465 Int planeOffset = 0; //confLeft + confTop * iStride;465 Int planeOffset = confLeft + confTop * iStride; 466 466 467 467 if (! writePlane(m_cHandle, dstPicYuv->getLumaAddr() + planeOffset, is16bit, iStride, width, height)) 468 468 { … … 475 475 iStride >>= 1; 476 476 confLeft >>= 1; 477 477 confRight >>= 1; 478 confTop >>= 1; 479 confBottom >>= 1; 478 480 479 planeOffset = 0; //confLeft + confTop * iStride;481 planeOffset = confLeft + confTop * iStride; 480 482 481 483 if (! writePlane(m_cHandle, dstPicYuv->getCbAddr() + planeOffset, is16bit, iStride, width, height)) 482 484 {