Showing the changes to codec/decoder/core/src/decoder.cpp (1 of 1 file). Show all
Unified · Split
| @@ -174,50 +174,16 @@ void WelsDecoderDefaults (PWelsDecoderContext pCtx) { · 173 unmodified lines | ||
| 174 | 174 | |
| 175 | 175 | |
| 176 | 176 | /* |
| 177 | − * get size of reference picture list in target layer incoming, = (iNumRefFrames x 2) | |
| 177 | + * get size of reference picture list in target layer incoming, = (iNumRefFrames | |
| 178 | 178 | */ |
| 179 | 179 | static inline int32_t GetTargetRefListSize (PWelsDecoderContext pCtx) { |
| 180 | − bool* pSubsetSpsAvail = &pCtx->bSubspsAvailFlags[0]; | |
| 181 | − bool* pSpsAvail = &pCtx->bSpsAvailFlags[0]; | |
| 182 | − int32_t iSubsetIdx = -1; | |
| 183 | − int32_t iSpsIdx = -1; | |
| 184 | − bool bExistSubsetSps = false; | |
| 185 | − int32_t bExistSps = false; | |
| 186 | − int32_t iPos = MAX_SPS_COUNT - 1; | |
| 187 | 180 | int32_t iNumRefFrames = 0; |
| 188 | − | |
| 189 | − while (iPos >= 0) { | |
| 190 | − if (pSubsetSpsAvail[iPos]) { | |
| 191 | − bExistSubsetSps = true; | |
| 192 | − iSubsetIdx = iPos; | |
| 193 | − break; | |
| 194 | − } | |
| 195 | − -- iPos; | |
| 196 | − } | |
| 197 | − | |
| 198 | − if (!bExistSubsetSps) { | |
| 199 | − iPos = MAX_SPS_COUNT - 1; | |
| 200 | − while (iPos >= 0) { | |
| 201 | − if (pSpsAvail[iPos]) { | |
| 202 | − bExistSps = true; | |
| 203 | − iSpsIdx = iPos; | |
| 204 | − break; | |
| 205 | − } | |
| 206 | − -- iPos; | |
| 207 | − } | |
| 208 | − } | |
| 209 | − | |
| 210 | − if (! (bExistSubsetSps || bExistSps)) { | |
| 181 | + if ((pCtx == NULL) || (pCtx->pSps == NULL)) { | |
| 211 | 182 | iNumRefFrames = MAX_REF_PIC_COUNT; |
| 212 | 183 | } else { |
| 213 | − PSps pSps = bExistSubsetSps ? (&pCtx->sSubsetSpsBuffer[iSubsetIdx].sSps) : (&pCtx->sSpsBuffer[iSpsIdx]); | |
| 214 | − | |
| 215 | − iNumRefFrames = (pSps->iNumRefFrames) + 1; | |
| 184 | + iNumRefFrames = pCtx->pSps->iNumRefFrames + 1; | |
| 216 | 185 | } |
| 217 | 186 | |
| 218 | − if (0 == iNumRefFrames) | |
| 219 | − iNumRefFrames = (MIN_REF_PIC_COUNT); | |
| 220 | − | |
| 221 | 187 | #ifdef LONG_TERM_REF |
| 222 | 188 | //pic_queue size minimum set 2 |
| 223 | 189 | if (iNumRefFrames < 2) { |