Add additional function PrefetchLastPicForThread and variables for better control of threaded decoding in the case of multi-slice with one slice group contains one slice.
Showing the changes to codec/decoder/core/src/pic_queue.cpp (1 of 9 files). Show all
Unified · Split
| @@ -217,4 +217,16 @@ PPicture PrefetchPicForThread (PPicBuff pPicBuf) { · 216 unmodified lines | ||
| 217 | 217 | return pPic; |
| 218 | 218 | } |
| 219 | 219 | |
| 220 | +PPicture PrefetchLastPicForThread (PPicBuff pPicBuf, const int32_t& iLastPicBuffIdx) { | |
| 221 | + PPicture pPic = NULL; | |
| 222 | + | |
| 223 | + if (pPicBuf->iCapacity == 0) { | |
| 224 | + return NULL; | |
| 225 | + } | |
| 226 | + if (iLastPicBuffIdx >= 0 && iLastPicBuffIdx < pPicBuf->iCapacity) { | |
| 227 | + pPic = pPicBuf->ppPic[iLastPicBuffIdx]; | |
| 228 | + } | |
| 229 | + return pPic; | |
| 230 | +} | |
| 231 | + | |
| 220 | 232 | } // namespace WelsDec |