Ticket #835: invalid_sps_bug.patch
File invalid_sps_bug.patch, 11.3 KB (added by bheng, 11 years ago) |
---|
-
source/App/TAppDecoder/TAppDecTop.cpp
256 256 while (iterPic != pcListPic->end()) 257 257 { 258 258 TComPic* pcPic = *(iterPic); 259 TComSPS *sps = pcPic->getSlice(0)->getSPS();260 259 261 if ( pcPic->getOutputMark() && (not_displayed > pcPic->get Slice(0)->getSPS()->getNumReorderPics(tId) && pcPic->getPOC() > m_iPOCLastDisplay))260 if ( pcPic->getOutputMark() && (not_displayed > pcPic->getNumReorderPics(tId) && pcPic->getPOC() > m_iPOCLastDisplay)) 262 261 { 263 262 // write to file 264 263 not_displayed--; 265 264 if ( m_pchReconFile ) 266 265 { 267 m_cTVideoIOYuvReconFile.write( pcPic->getPicYuvRec(), sps->getPicCropLeftOffset(), sps->getPicCropRightOffset(), sps->getPicCropTopOffset(), sps->getPicCropBottomOffset() );266 m_cTVideoIOYuvReconFile.write( pcPic->getPicYuvRec(), pcPic->getPicCropLeftOffset(), pcPic->getPicCropRightOffset(), pcPic->getPicCropTopOffset(), pcPic->getPicCropBottomOffset() ); 268 267 } 269 268 270 269 // update POC of display order … … 309 308 while (iterPic != pcListPic->end()) 310 309 { 311 310 TComPic* pcPic = *(iterPic); 312 TComSPS *sps = pcPic->getSlice(0)->getSPS();313 311 314 312 if ( pcPic->getOutputMark() ) 315 313 { 316 314 // write to file 317 315 if ( m_pchReconFile ) 318 316 { 319 m_cTVideoIOYuvReconFile.write( pcPic->getPicYuvRec(), sps->getPicCropLeftOffset(), sps->getPicCropRightOffset(), sps->getPicCropTopOffset(), sps->getPicCropBottomOffset() );317 m_cTVideoIOYuvReconFile.write( pcPic->getPicYuvRec(), pcPic->getPicCropLeftOffset(), pcPic->getPicCropRightOffset(), pcPic->getPicCropTopOffset(), pcPic->getPicCropBottomOffset() ); 320 318 } 321 319 322 320 // update POC of display order -
source/Lib/TLibCommon/TComPic.cpp
73 73 { 74 74 } 75 75 76 Void TComPic::create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, Bool bIsVirtual ) 76 Void TComPic::create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, 77 Bool picCroppingFlag, Int picCropLeftOffset, Int picCropRightOffset, Int picCropTopOffset, Int picCropBottomOffset, 78 Int *numReorderPics, Bool bIsVirtual) 79 77 80 { 78 81 m_apcPicSym = new TComPicSym; m_apcPicSym ->create( iWidth, iHeight, uiMaxWidth, uiMaxHeight, uiMaxDepth ); 79 82 if (!bIsVirtual) … … 85 88 /* there are no SEI messages associated with this picture initially */ 86 89 m_SEIs = NULL; 87 90 m_bUsedByCurr = false; 91 92 /* store cropping parameters with picture */ 93 m_picCroppingFlag = picCroppingFlag; 94 m_picCropLeftOffset = picCropLeftOffset; 95 m_picCropRightOffset = picCropRightOffset; 96 m_picCropTopOffset = picCropTopOffset; 97 m_picCropBottomOffset = picCropBottomOffset; 98 99 /* store number of reorder pics with picture */ 100 memcpy(m_numReorderPics, numReorderPics, MAX_TLAYER*sizeof(Int)); 101 88 102 return; 89 103 } 90 104 -
source/Lib/TLibCommon/TComPic.h
77 77 Bool m_bIndependentTileBoundaryForNDBFilter; 78 78 TComPicYuv* m_pNDBFilterYuvTmp; //!< temporary picture buffer when non-cross slice/tile boundary in-loop filtering is enabled 79 79 Bool m_bCheckLTMSB; 80 81 Int m_numReorderPics[MAX_TLAYER]; 82 Bool m_picCroppingFlag; 83 Int m_picCropLeftOffset; 84 Int m_picCropRightOffset; 85 Int m_picCropTopOffset; 86 Int m_picCropBottomOffset; 87 80 88 std::vector<std::vector<TComDataCU*> > m_vSliceCUDataLink; 81 89 82 90 SEImessages* m_SEIs; ///< Any SEI messages that have been received. If !NULL we own the object. … … 85 93 TComPic(); 86 94 virtual ~TComPic(); 87 95 88 Void create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, Bool bIsVirtual = false ); 96 Void create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, 97 Bool picCroppingFlag, Int picCropLeftOffset, Int picCropRightOffset, Int picCropTopOffset, Int picCropBottomOffset, 98 Int *numReorderPics, Bool bIsVirtual = false ); 99 89 100 virtual Void destroy(); 90 101 91 102 UInt getTLayer() { return m_uiTLayer; } … … 133 144 Void setOutputMark (Bool b) { m_bNeededForOutput = b; } 134 145 Bool getOutputMark () { return m_bNeededForOutput; } 135 146 147 Void setNumReorderPics(Int i, UInt tlayer) { m_numReorderPics[tlayer] = i; } 148 Int getNumReorderPics(UInt tlayer) { return m_numReorderPics[tlayer]; } 149 Bool getPicCroppingFlag() const { return m_picCroppingFlag; } 150 Void setPicCroppingFlag(Bool val) { m_picCroppingFlag = val; } 151 Int getPicCropLeftOffset() const { return m_picCropLeftOffset; } 152 Void setPicCropLeftOffset(Int val) { m_picCropLeftOffset = val; } 153 Int getPicCropRightOffset() const { return m_picCropRightOffset; } 154 Void setPicCropRightOffset(Int val) { m_picCropRightOffset = val; } 155 Int getPicCropTopOffset() const { return m_picCropTopOffset; } 156 Void setPicCropTopOffset(Int val) { m_picCropTopOffset = val; } 157 Int getPicCropBottomOffset() const { return m_picCropBottomOffset; } 158 Void setPicCropBottomOffset(Int val) { m_picCropBottomOffset = val; } 159 136 160 Void compressMotion(); 137 161 UInt getCurrSliceIdx() { return m_uiCurrSliceIdx; } 138 162 Void setCurrSliceIdx(UInt i) { m_uiCurrSliceIdx = i; } -
source/Lib/TLibDecoder/TDecTop.cpp
130 130 131 131 Void TDecTop::xGetNewPicBuffer ( TComSlice* pcSlice, TComPic*& rpcPic ) 132 132 { 133 Int tlayer; 134 Int numReorderPics[MAX_TLAYER]; 135 Bool picCroppingFlag = pcSlice->getSPS()->getPicCroppingFlag(); 136 Int picCropLeftOffset = pcSlice->getSPS()->getPicCropLeftOffset(); 137 Int picCropRightOffset = pcSlice->getSPS()->getPicCropRightOffset(); 138 Int picCropTopOffset = pcSlice->getSPS()->getPicCropTopOffset(); 139 Int picCropBottomOffset = pcSlice->getSPS()->getPicCropBottomOffset(); 140 141 for(tlayer=0; tlayer<MAX_TLAYER; tlayer++) { 142 numReorderPics[tlayer] = pcSlice->getSPS()->getNumReorderPics(tlayer); 143 } 144 133 145 xUpdateGopSize(pcSlice); 134 146 135 147 m_iMaxRefPicNum = pcSlice->getSPS()->getMaxDecPicBuffering(pcSlice->getTLayer())+pcSlice->getSPS()->getNumReorderPics(pcSlice->getTLayer()) + 1; // +1 to have space for the picture currently being decoded … … 137 149 { 138 150 rpcPic = new TComPic(); 139 151 140 rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, true); 152 rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 153 picCroppingFlag, picCropLeftOffset, picCropRightOffset, picCropTopOffset, picCropBottomOffset, numReorderPics, true); 141 154 rpcPic->getPicSym()->allocSaoParam(&m_cSAO); 142 155 m_cListPic.pushBack( rpcPic ); 143 156 … … 174 187 m_cListPic.pushBack( rpcPic ); 175 188 } 176 189 rpcPic->destroy(); 177 rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, true); 190 rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 191 picCroppingFlag, picCropLeftOffset, picCropRightOffset, picCropTopOffset, picCropBottomOffset, numReorderPics, true); 178 192 rpcPic->getPicSym()->allocSaoParam(&m_cSAO); 179 193 } 180 194 -
source/Lib/TLibEncoder/TEncPic.cpp
125 125 * \param bIsVirtual 126 126 * \return Void 127 127 */ 128 Void TEncPic::create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth, Bool bIsVirtual ) 128 Void TEncPic::create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth, 129 Bool picCroppingFlag, Int picCropLeftOffset, Int picCropRightOffset, 130 Int picCropTopOffset, Int picCropBottomOffset, Int *numReorderPics, Bool bIsVirtual ) 129 131 { 130 TComPic::create( iWidth, iHeight, uiMaxWidth, uiMaxHeight, uiMaxDepth, bIsVirtual ); 132 TComPic::create( iWidth, iHeight, uiMaxWidth, uiMaxHeight, uiMaxDepth, 133 picCroppingFlag, picCropLeftOffset, picCropRightOffset, picCropTopOffset, picCropBottomOffset, 134 numReorderPics, bIsVirtual ); 131 135 m_uiMaxAQDepth = uiMaxAQDepth; 132 136 if ( uiMaxAQDepth > 0 ) 133 137 { -
source/Lib/TLibEncoder/TEncPic.h
102 102 TEncPic(); 103 103 virtual ~TEncPic(); 104 104 105 Void create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth, Bool bIsVirtual = false ); 105 Void create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth, 106 Bool picCroppingFlag, Int picCropLeftOffset, Int picCropRightOffset, Int picCropTopOffset, Int picCropBottomOffset, 107 Int *numReorderPics, Bool bIsVirtual = false ); 106 108 virtual Void destroy(); 107 109 108 110 TEncPicQPAdaptationLayer* getAQLayer( UInt uiDepth ) { return &m_acAQLayer[uiDepth]; } -
source/Lib/TLibEncoder/TEncTop.cpp
403 403 if ( getUseAdaptiveQP() ) 404 404 { 405 405 TEncPic* pcEPic = new TEncPic; 406 pcEPic->create( m_iSourceWidth, m_iSourceHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, m_cPPS.getMaxCuDQPDepth()+1 ); 406 pcEPic->create( m_iSourceWidth, m_iSourceHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, m_cPPS.getMaxCuDQPDepth()+1 , 407 (m_croppingMode>0), m_cropLeft, m_cropRight, m_cropTop, m_cropBottom, m_numReorderPics); 407 408 rpcPic = pcEPic; 408 409 } 409 410 else 410 411 { 411 412 rpcPic = new TComPic; 412 rpcPic->create( m_iSourceWidth, m_iSourceHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth ); 413 414 rpcPic->create( m_iSourceWidth, m_iSourceHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 415 (m_croppingMode>0), m_cropLeft, m_cropRight, m_cropTop, m_cropBottom, m_numReorderPics); 413 416 } 414 417 if (getUseSAO()) 415 418 {