diff --git a/source/App/TAppDecoder/TAppDecTop.cpp b/source/App/TAppDecoder/TAppDecTop.cpp
index 862128f..566dc53 100644
a
|
b
|
Void TAppDecTop::decode() |
149 | 149 | m_cTVideoIOYuvReconFile.open( m_pchReconFile, true ); // write mode |
150 | 150 | recon_opened = true; |
151 | 151 | } |
| 152 | TComList<TComPic*>::iterator iterPic = pcListPic->begin(); |
| 153 | TComPic* pcPic = *(iterPic); |
| 154 | if (pcPic->getSlice(0)->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR) { |
| 155 | m_iPOCLastDisplay = 0; |
| 156 | xFlushOutput( pcListPic ); |
| 157 | m_iPOCLastDisplay = -1; |
| 158 | } |
152 | 159 | // write reconstuction to file |
153 | 160 | xWriteOutput( pcListPic ); |
154 | 161 | } |
… |
… |
Void TAppDecTop::xWriteOutput( TComList<TComPic*>* pcListPic ) |
204 | 211 | while (iterPic != pcListPic->end()) |
205 | 212 | { |
206 | 213 | TComPic* pcPic = *(iterPic); |
207 | | if(pcPic->getReconMark() && pcPic->getPOC() > m_iPOCLastDisplay) |
| 214 | if(pcPic->getReconMark() && pcPic->getPOC() > m_iPOCLastDisplay && pcPic->getDisplayMark()) |
208 | 215 | not_displayed++; |
209 | 216 | iterPic++; |
210 | 217 | } |
… |
… |
Void TAppDecTop::xWriteOutput( TComList<TComPic*>* pcListPic ) |
216 | 223 | TComPic* pcPic = *(iterPic); |
217 | 224 | |
218 | 225 | #if G1002_RPS |
219 | | if ( pcPic->getReconMark() && not_displayed > m_cTDecTop.getSPS()->getMaxNumberOfReorderPictures() && pcPic->getPOC() > m_iPOCLastDisplay) |
| 226 | if ( pcPic->getReconMark() && not_displayed > m_cTDecTop.getSPS()->getMaxNumberOfReorderPictures() && pcPic->getPOC() > m_iPOCLastDisplay && pcPic->getDisplayMark()) |
220 | 227 | { |
221 | 228 | // write to file |
222 | 229 | not_displayed--; |
… |
… |
Void TAppDecTop::xWriteOutput( TComList<TComPic*>* pcListPic ) |
232 | 239 | |
233 | 240 | // update POC of display order |
234 | 241 | m_iPOCLastDisplay = pcPic->getPOC(); |
| 242 | pcPic->setDisplayMark(false); |
235 | 243 | |
236 | 244 | // erase non-referenced picture in the reference picture list after display |
237 | 245 | if ( !pcPic->getSlice(0)->isReferenced() && pcPic->getReconMark() == true ) |
… |
… |
Void TAppDecTop::xFlushOutput( TComList<TComPic*>* pcListPic ) |
269 | 277 | { |
270 | 278 | TComPic* pcPic = *(iterPic); |
271 | 279 | |
272 | | if ( pcPic->getReconMark() && pcPic->getPOC() > m_iPOCLastDisplay) |
| 280 | if ( pcPic->getReconMark() && pcPic->getPOC() > m_iPOCLastDisplay && pcPic->getDisplayMark()) |
273 | 281 | { |
274 | 282 | // write to file |
275 | 283 | if ( m_pchReconFile ) |
… |
… |
Void TAppDecTop::xFlushOutput( TComList<TComPic*>* pcListPic ) |
279 | 287 | |
280 | 288 | // update POC of display order |
281 | 289 | m_iPOCLastDisplay = pcPic->getPOC(); |
| 290 | pcPic->setDisplayMark(false); |
282 | 291 | |
283 | 292 | // erase non-referenced picture in the reference picture list after display |
284 | 293 | if ( !pcPic->getSlice(0)->isReferenced() && pcPic->getReconMark() == true ) |
diff --git a/source/App/TAppEncoder/TAppEncCfg.cpp b/source/App/TAppEncoder/TAppEncCfg.cpp
index a2547f7..b4a89c5 100644
a
|
b
|
Void TAppEncCfg::destroy() |
94 | 94 | #if G1002_RPS |
95 | 95 | std::istringstream &operator>>(std::istringstream &in, GOPEntry &entry) //input |
96 | 96 | { |
| 97 | memset(&entry, 0, sizeof(entry)); |
97 | 98 | in>>entry.m_iSliceType; |
98 | 99 | in>>entry.m_iPOC; |
99 | 100 | in>>entry.m_iQPOffset; |
diff --git a/source/Lib/TLibCommon/TComPic.h b/source/Lib/TLibCommon/TComPic.h
index 3c8034b..a3deffc 100644
a
|
b
|
private: |
69 | 69 | TComPicYuv* m_pcPicYuvResi; // Residual |
70 | 70 | Bool m_bReconstructed; |
71 | 71 | UInt m_uiCurrSliceIdx; // Index of current slice |
| 72 | Bool m_bDisplayed; |
72 | 73 | |
73 | 74 | SEImessages* m_SEIs; ///< Any SEI messages that have been received. If !NULL we own the object. |
74 | 75 | |
… |
… |
public: |
123 | 124 | Void setReconMark (Bool b) { m_bReconstructed = b; } |
124 | 125 | Bool getReconMark () { return m_bReconstructed; } |
125 | 126 | |
| 127 | Void setDisplayMark (Bool b) { m_bDisplayed = b; } |
| 128 | Bool getDisplayMark () { return m_bDisplayed; } |
| 129 | |
126 | 130 | #if AMVP_BUFFERCOMPRESS |
127 | 131 | Void compressMotion(); |
128 | 132 | #endif |
diff --git a/source/Lib/TLibDecoder/TDecTop.cpp b/source/Lib/TLibDecoder/TDecTop.cpp
index 11f0439..379efec 100644
a
|
b
|
Void TDecTop::xGetNewPicBuffer ( TComSlice* pcSlice, TComPic*& rpcPic ) |
201 | 201 | // mark it should be extended |
202 | 202 | rpcPic->getPicYuvRec()->setBorderExtension(false); |
203 | 203 | } |
| 204 | rpcPic->setDisplayMark(true); |
204 | 205 | } |
205 | 206 | |
206 | 207 | Void TDecTop::executeDeblockAndAlf(UInt& ruiPOC, TComList<TComPic*>*& rpcListPic, Int& iSkipFrame, Int& iPOCLastDisplay) |
diff --git a/source/Lib/TLibEncoder/TEncCavlc.cpp b/source/Lib/TLibEncoder/TEncCavlc.cpp
index 2d98ee6..ace7499 100644
a
|
b
|
Void TEncCavlc::codeSliceHeader ( TComSlice* pcSlice ) |
491 | 491 | { |
492 | 492 | WRITE_UVLC( 0, "idr_pic_id" ); |
493 | 493 | WRITE_FLAG( 0, "no_output_of_prior_pics_flag" ); |
| 494 | pcSlice->setPOC(0); |
494 | 495 | } |
495 | 496 | else |
496 | 497 | { |
diff --git a/source/Lib/TLibEncoder/TEncGOP.cpp b/source/Lib/TLibEncoder/TEncGOP.cpp
index e021d5e..f74c292 100644
a
|
b
|
Void TEncGOP::init ( TEncTop* pcTEncTop ) |
110 | 110 | // ==================================================================================================================== |
111 | 111 | // Public member functions |
112 | 112 | // ==================================================================================================================== |
113 | | Void TEncGOP::compressGOP( Int iPOCLast, Int iNumPicRcvd, TComList<TComPic*>& rcListPic, TComList<TComPicYuv*>& rcListPicYuvRecOut, std::list<AccessUnit>& accessUnitsInGOP) |
| 113 | Void TEncGOP::compressGOP( Int& iPOCLast, Int iNumPicRcvd, TComList<TComPic*>& rcListPic, TComList<TComPicYuv*>& rcListPicYuvRecOut, std::list<AccessUnit>& accessUnitsInGOP) |
114 | 114 | { |
115 | 115 | TComPic* pcPic; |
116 | 116 | TComPicYuv* pcPicYuvRecOut; |
… |
… |
Void TEncGOP::compressGOP( Int iPOCLast, Int iNumPicRcvd, TComList<TComPic*>& rc |
243 | 243 | pcSlice->setSliceType(P_SLICE); |
244 | 244 | } |
245 | 245 | #endif |
| 246 | if (getNalUnitType(uiPOCCurr) == NAL_UNIT_CODED_SLICE_IDR) |
| 247 | iPOCLast = 0; |
| 248 | |
246 | 249 | // Set the nal unit type |
247 | 250 | pcSlice->setNalUnitType(getNalUnitType(uiPOCCurr)); |
248 | 251 | // Do decoding refresh marking if any |
diff --git a/source/Lib/TLibEncoder/TEncGOP.h b/source/Lib/TLibEncoder/TEncGOP.h
index d212b29..996deb8 100644
a
|
b
|
public: |
116 | 116 | virtual ~TEncGOP(); |
117 | 117 | |
118 | 118 | Void init ( TEncTop* pcTEncTop ); |
119 | | Void compressGOP ( Int iPOCLast, Int iNumPicRcvd, TComList<TComPic*>& rcListPic, TComList<TComPicYuv*>& rcListPicYuvRec, std::list<AccessUnit>& accessUnitsInGOP ); |
| 119 | Void compressGOP ( Int& iPOCLast, Int iNumPicRcvd, TComList<TComPic*>& rcListPic, TComList<TComPicYuv*>& rcListPicYuvRec, std::list<AccessUnit>& accessUnitsInGOP ); |
120 | 120 | |
121 | 121 | #if !G1002_RPS |
122 | 122 | Int getHrchDepth() { return m_iHrchDepth; } |