Showing the changes to codec/decoder/core/src/mv_pred.cpp (1 of 29 files). Show all
Unified · Split
| @@ -155,7 +155,7 @@ void CopyRectBlock4Cols (void* vdst, void* vsrc, const int32_t stride_dst, const · 154 unmodified lines | ||
| 155 | 155 | memcpy (&dst[stride_dst * 3], &src[stride_src * 3], 16); |
| 156 | 156 | } |
| 157 | 157 | } |
| 158 | −void PredPSkipMvFromNeighbor (PDqLayer pCurLayer, int16_t iMvp[2]) { | |
| 158 | +void PredPSkipMvFromNeighbor (PDqLayer pCurDqLayer, int16_t iMvp[2]) { | |
| 159 | 159 | bool bTopAvail, bLeftTopAvail, bRightTopAvail, bLeftAvail; |
| 160 | 160 | |
| 161 | 161 | int32_t iCurSliceIdc, iTopSliceIdc, iLeftTopSliceIdc, iRightTopSliceIdc, iLeftSliceIdc; |
| @@ -170,14 +170,14 @@ void PredPSkipMvFromNeighbor (PDqLayer pCurLayer, int16_t iMvp[2]) { · 8 unmodified lines | ||
| 170 | 170 | int8_t iMatchRef; |
| 171 | 171 | int16_t iMvA[2], iMvB[2], iMvC[2], iMvD[2]; |
| 172 | 172 | |
| 173 | − iCurXy = pCurLayer->iMbXyIndex; | |
| 174 | − iCurX = pCurLayer->iMbX; | |
| 175 | − iCurY = pCurLayer->iMbY; | |
| 176 | − iCurSliceIdc = pCurLayer->pSliceIdc[iCurXy]; | |
| 173 | + iCurXy = pCurDqLayer->iMbXyIndex; | |
| 174 | + iCurX = pCurDqLayer->iMbX; | |
| 175 | + iCurY = pCurDqLayer->iMbY; | |
| 176 | + iCurSliceIdc = pCurDqLayer->pSliceIdc[iCurXy]; | |
| 177 | 177 | |
| 178 | 178 | if (iCurX != 0) { |
| 179 | 179 | iLeftXy = iCurXy - 1; |
| 180 | − iLeftSliceIdc = pCurLayer->pSliceIdc[iLeftXy]; | |
| 180 | + iLeftSliceIdc = pCurDqLayer->pSliceIdc[iLeftXy]; | |
| 181 | 181 | bLeftAvail = (iLeftSliceIdc == iCurSliceIdc); |
| 182 | 182 | } else { |
| 183 | 183 | bLeftAvail = 0; |
| @@ -185,19 +185,19 @@ void PredPSkipMvFromNeighbor (PDqLayer pCurLayer, int16_t iMvp[2]) { · 1 unmodified line | ||
| 185 | 185 | } |
| 186 | 186 | |
| 187 | 187 | if (iCurY != 0) { |
| 188 | − iTopXy = iCurXy - pCurLayer->iMbWidth; | |
| 189 | − iTopSliceIdc = pCurLayer->pSliceIdc[iTopXy]; | |
| 188 | + iTopXy = iCurXy - pCurDqLayer->iMbWidth; | |
| 189 | + iTopSliceIdc = pCurDqLayer->pSliceIdc[iTopXy]; | |
| 190 | 190 | bTopAvail = (iTopSliceIdc == iCurSliceIdc); |
| 191 | 191 | if (iCurX != 0) { |
| 192 | 192 | iLeftTopXy = iTopXy - 1; |
| 193 | − iLeftTopSliceIdc = pCurLayer->pSliceIdc[iLeftTopXy]; | |
| 193 | + iLeftTopSliceIdc = pCurDqLayer->pSliceIdc[iLeftTopXy]; | |
| 194 | 194 | bLeftTopAvail = (iLeftTopSliceIdc == iCurSliceIdc); |
| 195 | 195 | } else { |
| 196 | 196 | bLeftTopAvail = 0; |
| 197 | 197 | } |
| 198 | − if (iCurX != (pCurLayer->iMbWidth - 1)) { | |
| 198 | + if (iCurX != (pCurDqLayer->iMbWidth - 1)) { | |
| 199 | 199 | iRightTopXy = iTopXy + 1; |
| 200 | − iRightTopSliceIdc = pCurLayer->pSliceIdc[iRightTopXy]; | |
| 200 | + iRightTopSliceIdc = pCurDqLayer->pSliceIdc[iRightTopXy]; | |
| 201 | 201 | bRightTopAvail = (iRightTopSliceIdc == iCurSliceIdc); |
| 202 | 202 | } else { |
| 203 | 203 | bRightTopAvail = 0; |
| @@ -208,18 +208,18 @@ void PredPSkipMvFromNeighbor (PDqLayer pCurLayer, int16_t iMvp[2]) { · 4 unmodified lines | ||
| 208 | 208 | bRightTopAvail = 0; |
| 209 | 209 | } |
| 210 | 210 | |
| 211 | − iLeftType = ((iCurX != 0 && bLeftAvail) ? pCurLayer->pMbType[iLeftXy] : 0); | |
| 212 | − iTopType = ((iCurY != 0 && bTopAvail) ? pCurLayer->pMbType[iTopXy] : 0); | |
| 211 | + iLeftType = ((iCurX != 0 && bLeftAvail) ? GetMbType (pCurDqLayer)[iLeftXy] : 0); | |
| 212 | + iTopType = ((iCurY != 0 && bTopAvail) ? GetMbType (pCurDqLayer)[iTopXy] : 0); | |
| 213 | 213 | iLeftTopType = ((iCurX != 0 && iCurY != 0 && bLeftTopAvail) |
| 214 | − ? pCurLayer->pMbType[iLeftTopXy] : 0); | |
| 215 | − iRightTopType = ((iCurX != pCurLayer->iMbWidth - 1 && iCurY != 0 && bRightTopAvail) | |
| 216 | − ? pCurLayer->pMbType[iRightTopXy] : 0); | |
| 214 | + ? GetMbType (pCurDqLayer)[iLeftTopXy] : 0); | |
| 215 | + iRightTopType = ((iCurX != pCurDqLayer->iMbWidth - 1 && iCurY != 0 && bRightTopAvail) | |
| 216 | + ? GetMbType (pCurDqLayer)[iRightTopXy] : 0); | |
| 217 | 217 | |
| 218 | 218 | /*get neb mv&iRefIdxArray*/ |
| 219 | 219 | /*left*/ |
| 220 | 220 | if (bLeftAvail && IS_INTER (iLeftType)) { |
| 221 | − ST32 (iMvA, LD32 (pCurLayer->pMv[0][iLeftXy][3])); | |
| 222 | − iLeftRef = pCurLayer->pRefIndex[0][iLeftXy][3]; | |
| 221 | + ST32 (iMvA, LD32 (pCurDqLayer->pDec ? pCurDqLayer->pDec->pMv[0][iLeftXy][3] : pCurDqLayer->pMv[0][iLeftXy][3])); | |
| 222 | + iLeftRef = pCurDqLayer->pDec ? pCurDqLayer->pDec->pRefIndex[0][iLeftXy][3] : pCurDqLayer->pRefIndex[0][iLeftXy][3]; | |
| 223 | 223 | } else { |
| 224 | 224 | ST32 (iMvA, 0); |
| 225 | 225 | if (0 == bLeftAvail) { //not available |
| @@ -236,8 +236,8 @@ void PredPSkipMvFromNeighbor (PDqLayer pCurLayer, int16_t iMvp[2]) { · 10 unmodified lines | ||
| 236 | 236 | |
| 237 | 237 | /*top*/ |
| 238 | 238 | if (bTopAvail && IS_INTER (iTopType)) { |
| 239 | − ST32 (iMvB, LD32 (pCurLayer->pMv[0][iTopXy][12])); | |
| 240 | − iTopRef = pCurLayer->pRefIndex[0][iTopXy][12]; | |
| 239 | + ST32 (iMvB, LD32 (pCurDqLayer->pDec ? pCurDqLayer->pDec->pMv[0][iTopXy][12] : pCurDqLayer->pMv[0][iTopXy][12])); | |
| 240 | + iTopRef = pCurDqLayer->pDec ? pCurDqLayer->pDec->pRefIndex[0][iTopXy][12] : pCurDqLayer->pRefIndex[0][iTopXy][12]; | |
| 241 | 241 | } else { |
| 242 | 242 | ST32 (iMvB, 0); |
| 243 | 243 | if (0 == bTopAvail) { //not available |
| @@ -254,8 +254,10 @@ void PredPSkipMvFromNeighbor (PDqLayer pCurLayer, int16_t iMvp[2]) { · 10 unmodified lines | ||
| 254 | 254 | |
| 255 | 255 | /*right_top*/ |
| 256 | 256 | if (bRightTopAvail && IS_INTER (iRightTopType)) { |
| 257 | − ST32 (iMvC, LD32 (pCurLayer->pMv[0][iRightTopXy][12])); | |
| 258 | − iRightTopRef = pCurLayer->pRefIndex[0][iRightTopXy][12]; | |
| 257 | + ST32 (iMvC, LD32 (pCurDqLayer->pDec ? pCurDqLayer->pDec->pMv[0][iRightTopXy][12] : | |
| 258 | + pCurDqLayer->pMv[0][iRightTopXy][12])); | |
| 259 | + iRightTopRef = pCurDqLayer->pDec ? pCurDqLayer->pDec->pRefIndex[0][iRightTopXy][12] : | |
| 260 | + pCurDqLayer->pRefIndex[0][iRightTopXy][12]; | |
| 259 | 261 | } else { |
| 260 | 262 | ST32 (iMvC, 0); |
| 261 | 263 | if (0 == bRightTopAvail) { //not available |
| @@ -267,8 +269,9 @@ void PredPSkipMvFromNeighbor (PDqLayer pCurLayer, int16_t iMvp[2]) { · 5 unmodified lines | ||
| 267 | 269 | |
| 268 | 270 | /*left_top*/ |
| 269 | 271 | if (bLeftTopAvail && IS_INTER (iLeftTopType)) { |
| 270 | − ST32 (iMvD, LD32 (pCurLayer->pMv[0][iLeftTopXy][15])); | |
| 271 | − iLeftTopRef = pCurLayer->pRefIndex[0][iLeftTopXy][15]; | |
| 272 | + ST32 (iMvD, LD32 (pCurDqLayer->pDec ? pCurDqLayer->pDec->pMv[0][iLeftTopXy][15] : pCurDqLayer->pMv[0][iLeftTopXy][15])); | |
| 273 | + iLeftTopRef = pCurDqLayer->pDec ? pCurDqLayer->pDec->pRefIndex[0][iLeftTopXy][15] : | |
| 274 | + pCurDqLayer->pRefIndex[0][iLeftTopXy][15]; | |
| 272 | 275 | } else { |
| 273 | 276 | ST32 (iMvD, 0); |
| 274 | 277 | if (0 == bLeftTopAvail) { //not available |
| @@ -305,11 +308,11 @@ void PredPSkipMvFromNeighbor (PDqLayer pCurLayer, int16_t iMvp[2]) { · 30 unmodified lines | ||
| 305 | 308 | } |
| 306 | 309 | |
| 307 | 310 | int32_t GetColocatedMb (PWelsDecoderContext pCtx, MbType& mbType, SubMbType& subMbType) { |
| 308 | − PDqLayer pCurLayer = pCtx->pCurDqLayer; | |
| 309 | − int32_t iMbXy = pCurLayer->iMbXyIndex; | |
| 311 | + PDqLayer pCurDqLayer = pCtx->pCurDqLayer; | |
| 312 | + int32_t iMbXy = pCurDqLayer->iMbXyIndex; | |
| 310 | 313 | |
| 311 | − uint32_t is8x8 = IS_Inter_8x8 (pCurLayer->pMbType[iMbXy]); | |
| 312 | − mbType = pCurLayer->pMbType[iMbXy]; | |
| 314 | + uint32_t is8x8 = IS_Inter_8x8 (GetMbType (pCurDqLayer)[iMbXy]); | |
| 315 | + mbType = GetMbType (pCurDqLayer)[iMbXy]; | |
| 313 | 316 | |
| 314 | 317 | PPicture colocPic = pCtx->sRefPic.pRefList[LIST_1][0]; |
| 315 | 318 | |
| @@ -336,43 +339,43 @@ int32_t GetColocatedMb (PWelsDecoderContext pCtx, MbType& mbType, SubMbType& sub · 20 unmodified lines | ||
| 336 | 339 | } |
| 337 | 340 | |
| 338 | 341 | if (IS_INTRA (coloc_mbType)) { |
| 339 | − SetRectBlock (pCurLayer->iColocIntra, 4, 4, 4 * sizeof (int8_t), 1, sizeof (int8_t)); | |
| 342 | + SetRectBlock (pCurDqLayer->iColocIntra, 4, 4, 4 * sizeof (int8_t), 1, sizeof (int8_t)); | |
| 340 | 343 | return ERR_NONE; |
| 341 | 344 | } |
| 342 | − SetRectBlock (pCurLayer->iColocIntra, 4, 4, 4 * sizeof (int8_t), 0, sizeof (int8_t)); | |
| 345 | + SetRectBlock (pCurDqLayer->iColocIntra, 4, 4, 4 * sizeof (int8_t), 0, sizeof (int8_t)); | |
| 343 | 346 | |
| 344 | 347 | if (IS_INTER_16x16 (mbType)) { |
| 345 | 348 | int16_t iMVZero[2] = { 0 }; |
| 346 | 349 | int16_t* pMv = IS_TYPE_L1 (coloc_mbType) ? colocPic->pMv[LIST_1][iMbXy][0] : iMVZero; |
| 347 | − ST32 (pCurLayer->iColocMv[LIST_0][0], LD32 (colocPic->pMv[LIST_0][iMbXy][0])); | |
| 348 | − ST32 (pCurLayer->iColocMv[LIST_1][0], LD32 (pMv)); | |
| 349 | − pCurLayer->iColocRefIndex[LIST_0][0] = colocPic->pRefIndex[LIST_0][iMbXy][0]; | |
| 350 | − pCurLayer->iColocRefIndex[LIST_1][0] = IS_TYPE_L1 (coloc_mbType) ? colocPic->pRefIndex[LIST_1][iMbXy][0] : | |
| 351 | − REF_NOT_IN_LIST; | |
| 350 | + ST32 (pCurDqLayer->iColocMv[LIST_0][0], LD32 (colocPic->pMv[LIST_0][iMbXy][0])); | |
| 351 | + ST32 (pCurDqLayer->iColocMv[LIST_1][0], LD32 (pMv)); | |
| 352 | + pCurDqLayer->iColocRefIndex[LIST_0][0] = colocPic->pRefIndex[LIST_0][iMbXy][0]; | |
| 353 | + pCurDqLayer->iColocRefIndex[LIST_1][0] = IS_TYPE_L1 (coloc_mbType) ? colocPic->pRefIndex[LIST_1][iMbXy][0] : | |
| 354 | + REF_NOT_IN_LIST; | |
| 352 | 355 | } else { |
| 353 | 356 | if (!pCtx->pSps->bDirect8x8InferenceFlag) { |
| 354 | − CopyRectBlock4Cols (pCurLayer->iColocMv[LIST_0], colocPic->pMv[LIST_0][iMbXy], 16, 16, 4, 4); | |
| 355 | − CopyRectBlock4Cols (pCurLayer->iColocRefIndex[LIST_0], colocPic->pRefIndex[LIST_0][iMbXy], 4, 4, 4, 1); | |
| 357 | + CopyRectBlock4Cols (pCurDqLayer->iColocMv[LIST_0], colocPic->pMv[LIST_0][iMbXy], 16, 16, 4, 4); | |
| 358 | + CopyRectBlock4Cols (pCurDqLayer->iColocRefIndex[LIST_0], colocPic->pRefIndex[LIST_0][iMbXy], 4, 4, 4, 1); | |
| 356 | 359 | if (IS_TYPE_L1 (coloc_mbType)) { |
| 357 | − CopyRectBlock4Cols (pCurLayer->iColocMv[LIST_1], colocPic->pMv[LIST_1][iMbXy], 16, 16, 4, 4); | |
| 358 | − CopyRectBlock4Cols (pCurLayer->iColocRefIndex[LIST_1], colocPic->pRefIndex[LIST_1][iMbXy], 4, 4, 4, 1); | |
| 360 | + CopyRectBlock4Cols (pCurDqLayer->iColocMv[LIST_1], colocPic->pMv[LIST_1][iMbXy], 16, 16, 4, 4); | |
| 361 | + CopyRectBlock4Cols (pCurDqLayer->iColocRefIndex[LIST_1], colocPic->pRefIndex[LIST_1][iMbXy], 4, 4, 4, 1); | |
| 359 | 362 | } else { // only forward prediction |
| 360 | − SetRectBlock (pCurLayer->iColocRefIndex[LIST_1], 4, 4, 4, (uint8_t)REF_NOT_IN_LIST, 1); | |
| 363 | + SetRectBlock (pCurDqLayer->iColocRefIndex[LIST_1], 4, 4, 4, (uint8_t)REF_NOT_IN_LIST, 1); | |
| 361 | 364 | } |
| 362 | 365 | } else { |
| 363 | 366 | for (int32_t listIdx = 0; listIdx < 1 + !! (coloc_mbType & MB_TYPE_L1); listIdx++) { |
| 364 | − SetRectBlock (pCurLayer->iColocMv[listIdx][0], 2, 2, 16, LD32 (colocPic->pMv[listIdx][iMbXy][0]), 4); | |
| 365 | − SetRectBlock (pCurLayer->iColocMv[listIdx][2], 2, 2, 16, LD32 (colocPic->pMv[listIdx][iMbXy][3]), 4); | |
| 366 | − SetRectBlock (pCurLayer->iColocMv[listIdx][8], 2, 2, 16, LD32 (colocPic->pMv[listIdx][iMbXy][12]), 4); | |
| 367 | − SetRectBlock (pCurLayer->iColocMv[listIdx][10], 2, 2, 16, LD32 (colocPic->pMv[listIdx][iMbXy][15]), 4); | |
| 368 | − | |
| 369 | − SetRectBlock (&pCurLayer->iColocRefIndex[listIdx][0], 2, 2, 4, colocPic->pRefIndex[listIdx][iMbXy][0], 1); | |
| 370 | − SetRectBlock (&pCurLayer->iColocRefIndex[listIdx][2], 2, 2, 4, colocPic->pRefIndex[listIdx][iMbXy][3], 1); | |
| 371 | − SetRectBlock (&pCurLayer->iColocRefIndex[listIdx][8], 2, 2, 4, colocPic->pRefIndex[listIdx][iMbXy][12], 1); | |
| 372 | − SetRectBlock (&pCurLayer->iColocRefIndex[listIdx][10], 2, 2, 4, colocPic->pRefIndex[listIdx][iMbXy][15], 1); | |
| 367 | + SetRectBlock (pCurDqLayer->iColocMv[listIdx][0], 2, 2, 16, LD32 (colocPic->pMv[listIdx][iMbXy][0]), 4); | |
| 368 | + SetRectBlock (pCurDqLayer->iColocMv[listIdx][2], 2, 2, 16, LD32 (colocPic->pMv[listIdx][iMbXy][3]), 4); | |
| 369 | + SetRectBlock (pCurDqLayer->iColocMv[listIdx][8], 2, 2, 16, LD32 (colocPic->pMv[listIdx][iMbXy][12]), 4); | |
| 370 | + SetRectBlock (pCurDqLayer->iColocMv[listIdx][10], 2, 2, 16, LD32 (colocPic->pMv[listIdx][iMbXy][15]), 4); | |
| 371 | + | |
| 372 | + SetRectBlock (&pCurDqLayer->iColocRefIndex[listIdx][0], 2, 2, 4, colocPic->pRefIndex[listIdx][iMbXy][0], 1); | |
| 373 | + SetRectBlock (&pCurDqLayer->iColocRefIndex[listIdx][2], 2, 2, 4, colocPic->pRefIndex[listIdx][iMbXy][3], 1); | |
| 374 | + SetRectBlock (&pCurDqLayer->iColocRefIndex[listIdx][8], 2, 2, 4, colocPic->pRefIndex[listIdx][iMbXy][12], 1); | |
| 375 | + SetRectBlock (&pCurDqLayer->iColocRefIndex[listIdx][10], 2, 2, 4, colocPic->pRefIndex[listIdx][iMbXy][15], 1); | |
| 373 | 376 | } |
| 374 | 377 | if (! (coloc_mbType & MB_TYPE_L1)) // only forward prediction |
| 375 | − SetRectBlock (&pCurLayer->iColocRefIndex[1][0], 4, 4, 4, (uint8_t)REF_NOT_IN_LIST, 1); | |
| 378 | + SetRectBlock (&pCurDqLayer->iColocRefIndex[1][0], 4, 4, 4, (uint8_t)REF_NOT_IN_LIST, 1); | |
| 376 | 379 | } |
| 377 | 380 | } |
| 378 | 381 | return ERR_NONE; |
| @@ -382,9 +385,9 @@ int32_t PredMvBDirectSpatial (PWelsDecoderContext pCtx, int16_t iMvp[LIST_A][2], · 3 unmodified lines | ||
| 382 | 385 | SubMbType& subMbType) { |
| 383 | 386 | |
| 384 | 387 | int32_t ret = ERR_NONE; |
| 385 | − PDqLayer pCurLayer = pCtx->pCurDqLayer; | |
| 386 | − int32_t iMbXy = pCurLayer->iMbXyIndex; | |
| 387 | − bool bSkipOrDirect = (IS_SKIP (pCurLayer->pMbType[iMbXy]) | IS_DIRECT (pCurLayer->pMbType[iMbXy])) > 0; | |
| 388 | + PDqLayer pCurDqLayer = pCtx->pCurDqLayer; | |
| 389 | + int32_t iMbXy = pCurDqLayer->iMbXyIndex; | |
| 390 | + bool bSkipOrDirect = (IS_SKIP (GetMbType (pCurDqLayer)[iMbXy]) | IS_DIRECT (GetMbType (pCurDqLayer)[iMbXy])) > 0; | |
| 388 | 391 | |
| 389 | 392 | MbType mbType; |
| 390 | 393 | ret = GetColocatedMb (pCtx, mbType, subMbType); |
| @@ -404,15 +407,15 @@ int32_t PredMvBDirectSpatial (PWelsDecoderContext pCtx, int16_t iMvp[LIST_A][2], · 13 unmodified lines | ||
| 404 | 407 | int8_t iDiagonalRef[LIST_A]; |
| 405 | 408 | int16_t iMvA[LIST_A][2], iMvB[LIST_A][2], iMvC[LIST_A][2], iMvD[LIST_A][2]; |
| 406 | 409 | |
| 407 | − iCurXy = pCurLayer->iMbXyIndex; | |
| 410 | + iCurXy = pCurDqLayer->iMbXyIndex; | |
| 408 | 411 | |
| 409 | − iCurX = pCurLayer->iMbX; | |
| 410 | − iCurY = pCurLayer->iMbY; | |
| 411 | − iCurSliceIdc = pCurLayer->pSliceIdc[iCurXy]; | |
| 412 | + iCurX = pCurDqLayer->iMbX; | |
| 413 | + iCurY = pCurDqLayer->iMbY; | |
| 414 | + iCurSliceIdc = pCurDqLayer->pSliceIdc[iCurXy]; | |
| 412 | 415 | |
| 413 | 416 | if (iCurX != 0) { |
| 414 | 417 | iLeftXy = iCurXy - 1; |
| 415 | − iLeftSliceIdc = pCurLayer->pSliceIdc[iLeftXy]; | |
| 418 | + iLeftSliceIdc = pCurDqLayer->pSliceIdc[iLeftXy]; | |
| 416 | 419 | bLeftAvail = (iLeftSliceIdc == iCurSliceIdc); |
| 417 | 420 | } else { |
| 418 | 421 | bLeftAvail = 0; |
| @@ -420,19 +423,19 @@ int32_t PredMvBDirectSpatial (PWelsDecoderContext pCtx, int16_t iMvp[LIST_A][2], · 1 unmodified line | ||
| 420 | 423 | } |
| 421 | 424 | |
| 422 | 425 | if (iCurY != 0) { |
| 423 | − iTopXy = iCurXy - pCurLayer->iMbWidth; | |
| 424 | − iTopSliceIdc = pCurLayer->pSliceIdc[iTopXy]; | |
| 426 | + iTopXy = iCurXy - pCurDqLayer->iMbWidth; | |
| 427 | + iTopSliceIdc = pCurDqLayer->pSliceIdc[iTopXy]; | |
| 425 | 428 | bTopAvail = (iTopSliceIdc == iCurSliceIdc); |
| 426 | 429 | if (iCurX != 0) { |
| 427 | 430 | iLeftTopXy = iTopXy - 1; |
| 428 | − iLeftTopSliceIdc = pCurLayer->pSliceIdc[iLeftTopXy]; | |
| 431 | + iLeftTopSliceIdc = pCurDqLayer->pSliceIdc[iLeftTopXy]; | |
| 429 | 432 | bLeftTopAvail = (iLeftTopSliceIdc == iCurSliceIdc); |
| 430 | 433 | } else { |
| 431 | 434 | bLeftTopAvail = 0; |
| 432 | 435 | } |
| 433 | − if (iCurX != (pCurLayer->iMbWidth - 1)) { | |
| 436 | + if (iCurX != (pCurDqLayer->iMbWidth - 1)) { | |
| 434 | 437 | iRightTopXy = iTopXy + 1; |
| 435 | − iRightTopSliceIdc = pCurLayer->pSliceIdc[iRightTopXy]; | |
| 438 | + iRightTopSliceIdc = pCurDqLayer->pSliceIdc[iRightTopXy]; | |
| 436 | 439 | bRightTopAvail = (iRightTopSliceIdc == iCurSliceIdc); |
| 437 | 440 | } else { |
| 438 | 441 | bRightTopAvail = 0; |
| @@ -443,20 +446,22 @@ int32_t PredMvBDirectSpatial (PWelsDecoderContext pCtx, int16_t iMvp[LIST_A][2], · 4 unmodified lines | ||
| 443 | 446 | bRightTopAvail = 0; |
| 444 | 447 | } |
| 445 | 448 | |
| 446 | − iLeftType = ((iCurX != 0 && bLeftAvail) ? pCurLayer->pMbType[iLeftXy] : 0); | |
| 447 | − iTopType = ((iCurY != 0 && bTopAvail) ? pCurLayer->pMbType[iTopXy] : 0); | |
| 449 | + iLeftType = ((iCurX != 0 && bLeftAvail) ? GetMbType (pCurDqLayer)[iLeftXy] : 0); | |
| 450 | + iTopType = ((iCurY != 0 && bTopAvail) ? GetMbType (pCurDqLayer)[iTopXy] : 0); | |
| 448 | 451 | iLeftTopType = ((iCurX != 0 && iCurY != 0 && bLeftTopAvail) |
| 449 | − ? pCurLayer->pMbType[iLeftTopXy] : 0); | |
| 450 | − iRightTopType = ((iCurX != pCurLayer->iMbWidth - 1 && iCurY != 0 && bRightTopAvail) | |
| 451 | − ? pCurLayer->pMbType[iRightTopXy] : 0); | |
| 452 | + ? GetMbType (pCurDqLayer)[iLeftTopXy] : 0); | |
| 453 | + iRightTopType = ((iCurX != pCurDqLayer->iMbWidth - 1 && iCurY != 0 && bRightTopAvail) | |
| 454 | + ? GetMbType (pCurDqLayer)[iRightTopXy] : 0); | |
| 452 | 455 | |
| 453 | 456 | /*get neb mv&iRefIdxArray*/ |
| 454 | 457 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { |
| 455 | 458 | |
| 456 | 459 | /*left*/ |
| 457 | 460 | if (bLeftAvail && IS_INTER (iLeftType)) { |
| 458 | − ST32 (iMvA[listIdx], LD32 (pCurLayer->pMv[listIdx][iLeftXy][3])); | |
| 459 | − iLeftRef[listIdx] = pCurLayer->pRefIndex[listIdx][iLeftXy][3]; | |
| 461 | + ST32 (iMvA[listIdx], LD32 (pCurDqLayer->pDec ? pCurDqLayer->pDec->pMv[listIdx][iLeftXy][3] : | |
| 462 | + pCurDqLayer->pMv[listIdx][iLeftXy][3])); | |
| 463 | + iLeftRef[listIdx] = pCurDqLayer->pDec ? pCurDqLayer->pDec->pRefIndex[listIdx][iLeftXy][3] : | |
| 464 | + pCurDqLayer->pRefIndex[listIdx][iLeftXy][3]; | |
| 460 | 465 | } else { |
| 461 | 466 | ST32 (iMvA[listIdx], 0); |
| 462 | 467 | if (0 == bLeftAvail) { //not available |
| @@ -468,8 +473,10 @@ int32_t PredMvBDirectSpatial (PWelsDecoderContext pCtx, int16_t iMvp[LIST_A][2], · 5 unmodified lines | ||
| 468 | 473 | |
| 469 | 474 | /*top*/ |
| 470 | 475 | if (bTopAvail && IS_INTER (iTopType)) { |
| 471 | − ST32 (iMvB[listIdx], LD32 (pCurLayer->pMv[listIdx][iTopXy][12])); | |
| 472 | − iTopRef[listIdx] = pCurLayer->pRefIndex[listIdx][iTopXy][12]; | |
| 476 | + ST32 (iMvB[listIdx], LD32 (pCurDqLayer->pDec ? pCurDqLayer->pDec->pMv[listIdx][iTopXy][12] : | |
| 477 | + pCurDqLayer->pMv[listIdx][iTopXy][12])); | |
| 478 | + iTopRef[listIdx] = pCurDqLayer->pDec ? pCurDqLayer->pDec->pRefIndex[listIdx][iTopXy][12] : | |
| 479 | + pCurDqLayer->pRefIndex[listIdx][iTopXy][12]; | |
| 473 | 480 | } else { |
| 474 | 481 | ST32 (iMvB[listIdx], 0); |
| 475 | 482 | if (0 == bTopAvail) { //not available |
| @@ -481,8 +488,10 @@ int32_t PredMvBDirectSpatial (PWelsDecoderContext pCtx, int16_t iMvp[LIST_A][2], · 5 unmodified lines | ||
| 481 | 488 | |
| 482 | 489 | /*right_top*/ |
| 483 | 490 | if (bRightTopAvail && IS_INTER (iRightTopType)) { |
| 484 | − ST32 (iMvC[listIdx], LD32 (pCurLayer->pMv[listIdx][iRightTopXy][12])); | |
| 485 | − iRightTopRef[listIdx] = pCurLayer->pRefIndex[listIdx][iRightTopXy][12]; | |
| 491 | + ST32 (iMvC[listIdx], LD32 (pCurDqLayer->pDec ? pCurDqLayer->pDec->pMv[listIdx][iRightTopXy][12] : | |
| 492 | + pCurDqLayer->pMv[listIdx][iRightTopXy][12])); | |
| 493 | + iRightTopRef[listIdx] = pCurDqLayer->pDec ? pCurDqLayer->pDec->pRefIndex[listIdx][iRightTopXy][12] : | |
| 494 | + pCurDqLayer->pRefIndex[listIdx][iRightTopXy][12]; | |
| 486 | 495 | } else { |
| 487 | 496 | ST32 (iMvC[listIdx], 0); |
| 488 | 497 | if (0 == bRightTopAvail) { //not available |
| @@ -493,8 +502,10 @@ int32_t PredMvBDirectSpatial (PWelsDecoderContext pCtx, int16_t iMvp[LIST_A][2], · 4 unmodified lines | ||
| 493 | 502 | } |
| 494 | 503 | /*left_top*/ |
| 495 | 504 | if (bLeftTopAvail && IS_INTER (iLeftTopType)) { |
| 496 | − ST32 (iMvD[listIdx], LD32 (pCurLayer->pMv[listIdx][iLeftTopXy][15])); | |
| 497 | − iLeftTopRef[listIdx] = pCurLayer->pRefIndex[listIdx][iLeftTopXy][15]; | |
| 505 | + ST32 (iMvD[listIdx], LD32 (pCurDqLayer->pDec ? pCurDqLayer->pDec->pMv[listIdx][iLeftTopXy][15] : | |
| 506 | + pCurDqLayer->pMv[listIdx][iLeftTopXy][15])); | |
| 507 | + iLeftTopRef[listIdx] = pCurDqLayer->pDec ? pCurDqLayer->pDec->pRefIndex[listIdx][iLeftTopXy][15] : | |
| 508 | + pCurDqLayer->pRefIndex[listIdx][iLeftTopXy][15]; | |
| 498 | 509 | } else { |
| 499 | 510 | ST32 (iMvD[listIdx], 0); |
| 500 | 511 | if (0 == bLeftTopAvail) { //not available |
| @@ -543,7 +554,7 @@ int32_t PredMvBDirectSpatial (PWelsDecoderContext pCtx, int16_t iMvp[LIST_A][2], · 42 unmodified lines | ||
| 543 | 554 | mbType &= ~MB_TYPE_L0; |
| 544 | 555 | subMbType &= ~MB_TYPE_L0; |
| 545 | 556 | } |
| 546 | − pCurLayer->pMbType[iMbXy] = mbType; | |
| 557 | + GetMbType (pCurDqLayer)[iMbXy] = mbType; | |
| 547 | 558 | |
| 548 | 559 | int16_t pMvd[4] = { 0 }; |
| 549 | 560 | |
| @@ -551,31 +562,31 @@ int32_t PredMvBDirectSpatial (PWelsDecoderContext pCtx, int16_t iMvp[LIST_A][2], · 1 unmodified line | ||
| 551 | 562 | |
| 552 | 563 | if (IS_INTER_16x16 (mbType)) { |
| 553 | 564 | if ((* (int32_t*)iMvp[LIST_0] | * (int32_t*)iMvp[LIST_1])) { |
| 554 | − if (0 == pCurLayer->iColocIntra[0] && !bIsLongRef | |
| 555 | − && ((pCurLayer->iColocRefIndex[LIST_0][0] == 0 && (unsigned) (pCurLayer->iColocMv[LIST_0][0][0] + 1) <= 2 | |
| 556 | − && (unsigned) (pCurLayer->iColocMv[LIST_0][0][1] + 1) <= 2) | |
| 557 | − || (pCurLayer->iColocRefIndex[LIST_0][0] < 0 && pCurLayer->iColocRefIndex[LIST_1][0] == 0 | |
| 558 | − && (unsigned) (pCurLayer->iColocMv[LIST_1][0][0] + 1) <= 2 | |
| 559 | − && (unsigned) (pCurLayer->iColocMv[LIST_1][0][1] + 1) <= 2))) { | |
| 565 | + if (0 == pCurDqLayer->iColocIntra[0] && !bIsLongRef | |
| 566 | + && ((pCurDqLayer->iColocRefIndex[LIST_0][0] == 0 && (unsigned) (pCurDqLayer->iColocMv[LIST_0][0][0] + 1) <= 2 | |
| 567 | + && (unsigned) (pCurDqLayer->iColocMv[LIST_0][0][1] + 1) <= 2) | |
| 568 | + || (pCurDqLayer->iColocRefIndex[LIST_0][0] < 0 && pCurDqLayer->iColocRefIndex[LIST_1][0] == 0 | |
| 569 | + && (unsigned) (pCurDqLayer->iColocMv[LIST_1][0][0] + 1) <= 2 | |
| 570 | + && (unsigned) (pCurDqLayer->iColocMv[LIST_1][0][1] + 1) <= 2))) { | |
| 560 | 571 | if (0 >= ref[0]) * (uint32_t*)iMvp[LIST_0] = 0; |
| 561 | 572 | if (0 >= ref[1]) * (uint32_t*)iMvp[LIST_1] = 0; |
| 562 | 573 | } |
| 563 | 574 | } |
| 564 | − UpdateP16x16DirectCabac (pCurLayer); | |
| 575 | + UpdateP16x16DirectCabac (pCurDqLayer); | |
| 565 | 576 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { |
| 566 | − UpdateP16x16MotionInfo (pCurLayer, listIdx, ref[listIdx], iMvp[listIdx]); | |
| 567 | − UpdateP16x16MvdCabac (pCurLayer, pMvd, listIdx); | |
| 577 | + UpdateP16x16MotionInfo (pCurDqLayer, listIdx, ref[listIdx], iMvp[listIdx]); | |
| 578 | + UpdateP16x16MvdCabac (pCurDqLayer, pMvd, listIdx); | |
| 568 | 579 | } |
| 569 | 580 | } else { |
| 570 | 581 | if (bSkipOrDirect) { |
| 571 | 582 | int8_t pSubPartCount[4], pPartW[4]; |
| 572 | 583 | for (int32_t i = 0; i < 4; i++) { //Direct 8x8 Ref and mv |
| 573 | 584 | int16_t iIdx8 = i << 2; |
| 574 | − pCurLayer->pSubMbType[iMbXy][i] = subMbType; | |
| 585 | + pCurDqLayer->pSubMbType[iMbXy][i] = subMbType; | |
| 575 | 586 | int8_t pRefIndex[LIST_A][30]; |
| 576 | − UpdateP8x8RefIdxCabac (pCurLayer, pRefIndex, iIdx8, ref[LIST_0], LIST_0); | |
| 577 | − UpdateP8x8RefIdxCabac (pCurLayer, pRefIndex, iIdx8, ref[LIST_1], LIST_1); | |
| 578 | − UpdateP8x8DirectCabac (pCurLayer, iIdx8); | |
| 587 | + UpdateP8x8RefIdxCabac (pCurDqLayer, pRefIndex, iIdx8, ref[LIST_0], LIST_0); | |
| 588 | + UpdateP8x8RefIdxCabac (pCurDqLayer, pRefIndex, iIdx8, ref[LIST_1], LIST_1); | |
| 589 | + UpdateP8x8DirectCabac (pCurDqLayer, iIdx8); | |
| 579 | 590 | |
| 580 | 591 | pSubPartCount[i] = g_ksInterBSubMbTypeInfo[0].iPartCount; |
| 581 | 592 | pPartW[i] = g_ksInterBSubMbTypeInfo[0].iPartWidth; |
| @@ -584,7 +595,7 @@ int32_t PredMvBDirectSpatial (PWelsDecoderContext pCtx, int16_t iMvp[LIST_A][2], · 2 unmodified lines | ||
| 584 | 595 | pSubPartCount[i] = 4; |
| 585 | 596 | pPartW[i] = 1; |
| 586 | 597 | } |
| 587 | − FillSpatialDirect8x8Mv (pCurLayer, iIdx8, pSubPartCount[i], pPartW[i], subMbType, bIsLongRef, iMvp, ref, NULL, NULL); | |
| 598 | + FillSpatialDirect8x8Mv (pCurDqLayer, iIdx8, pSubPartCount[i], pPartW[i], subMbType, bIsLongRef, iMvp, ref, NULL, NULL); | |
| 588 | 599 | } |
| 589 | 600 | } |
| 590 | 601 | } |
| @@ -594,9 +605,9 @@ int32_t PredMvBDirectSpatial (PWelsDecoderContext pCtx, int16_t iMvp[LIST_A][2], · 3 unmodified lines | ||
| 594 | 605 | int32_t PredBDirectTemporal (PWelsDecoderContext pCtx, int16_t iMvp[LIST_A][2], int8_t ref[LIST_A], |
| 595 | 606 | SubMbType& subMbType) { |
| 596 | 607 | int32_t ret = ERR_NONE; |
| 597 | − PDqLayer pCurLayer = pCtx->pCurDqLayer; | |
| 598 | − int32_t iMbXy = pCurLayer->iMbXyIndex; | |
| 599 | − bool bSkipOrDirect = (IS_SKIP (pCurLayer->pMbType[iMbXy]) | IS_DIRECT (pCurLayer->pMbType[iMbXy])) > 0; | |
| 608 | + PDqLayer pCurDqLayer = pCtx->pCurDqLayer; | |
| 609 | + int32_t iMbXy = pCurDqLayer->iMbXyIndex; | |
| 610 | + bool bSkipOrDirect = (IS_SKIP (GetMbType (pCurDqLayer)[iMbXy]) | IS_DIRECT (GetMbType (pCurDqLayer)[iMbXy])) > 0; | |
| 600 | 611 | |
| 601 | 612 | MbType mbType; |
| 602 | 613 | ret = GetColocatedMb (pCtx, mbType, subMbType); |
| @@ -604,42 +615,42 @@ int32_t PredBDirectTemporal (PWelsDecoderContext pCtx, int16_t iMvp[LIST_A][2], · 1 unmodified line | ||
| 604 | 615 | return ret; |
| 605 | 616 | } |
| 606 | 617 | |
| 607 | − pCurLayer->pMbType[iMbXy] = mbType; | |
| 618 | + GetMbType (pCurDqLayer)[iMbXy] = mbType; | |
| 608 | 619 | |
| 609 | − PSlice pSlice = &pCurLayer->sLayerInfo.sSliceInLayer; | |
| 620 | + PSlice pSlice = &pCurDqLayer->sLayerInfo.sSliceInLayer; | |
| 610 | 621 | PSliceHeader pSliceHeader = &pSlice->sSliceHeaderExt.sSliceHeader; |
| 611 | 622 | int16_t pMvd[4] = { 0 }; |
| 612 | 623 | const int32_t ref0Count = WELS_MIN (pSliceHeader->uiRefCount[LIST_0], pCtx->sRefPic.uiRefCount[LIST_0]); |
| 613 | 624 | if (IS_INTER_16x16 (mbType)) { |
| 614 | 625 | ref[LIST_0] = 0; |
| 615 | 626 | ref[LIST_1] = 0; |
| 616 | − UpdateP16x16DirectCabac (pCurLayer); | |
| 617 | − UpdateP16x16RefIdx (pCurLayer, LIST_1, ref[LIST_1]); | |
| 627 | + UpdateP16x16DirectCabac (pCurDqLayer); | |
| 628 | + UpdateP16x16RefIdx (pCurDqLayer, LIST_1, ref[LIST_1]); | |
| 618 | 629 | ST64 (iMvp, 0); |
| 619 | − if (pCurLayer->iColocIntra[0]) { | |
| 620 | − UpdateP16x16MotionOnly (pCurLayer, LIST_0, iMvp[LIST_0]); | |
| 621 | − UpdateP16x16MotionOnly (pCurLayer, LIST_1, iMvp[LIST_1]); | |
| 622 | − UpdateP16x16RefIdx (pCurLayer, LIST_0, ref[LIST_0]); | |
| 630 | + if (pCurDqLayer->iColocIntra[0]) { | |
| 631 | + UpdateP16x16MotionOnly (pCurDqLayer, LIST_0, iMvp[LIST_0]); | |
| 632 | + UpdateP16x16MotionOnly (pCurDqLayer, LIST_1, iMvp[LIST_1]); | |
| 633 | + UpdateP16x16RefIdx (pCurDqLayer, LIST_0, ref[LIST_0]); | |
| 623 | 634 | } else { |
| 624 | 635 | ref[LIST_0] = 0; |
| 625 | − int16_t* mv = pCurLayer->iColocMv[LIST_0][0]; | |
| 626 | − int8_t colocRefIndexL0 = pCurLayer->iColocRefIndex[LIST_0][0]; | |
| 636 | + int16_t* mv = pCurDqLayer->iColocMv[LIST_0][0]; | |
| 637 | + int8_t colocRefIndexL0 = pCurDqLayer->iColocRefIndex[LIST_0][0]; | |
| 627 | 638 | if (colocRefIndexL0 >= 0) { |
| 628 | 639 | ref[LIST_0] = MapColToList0 (pCtx, colocRefIndexL0, ref0Count); |
| 629 | 640 | } else { |
| 630 | − mv = pCurLayer->iColocMv[LIST_1][0]; | |
| 641 | + mv = pCurDqLayer->iColocMv[LIST_1][0]; | |
| 631 | 642 | } |
| 632 | − UpdateP16x16RefIdx (pCurLayer, LIST_0, ref[LIST_0]); | |
| 643 | + UpdateP16x16RefIdx (pCurDqLayer, LIST_0, ref[LIST_0]); | |
| 633 | 644 | |
| 634 | 645 | iMvp[LIST_0][0] = (pSlice->iMvScale[LIST_0][ref[LIST_0]] * mv[0] + 128) >> 8; |
| 635 | 646 | iMvp[LIST_0][1] = (pSlice->iMvScale[LIST_0][ref[LIST_0]] * mv[1] + 128) >> 8; |
| 636 | − UpdateP16x16MotionOnly (pCurLayer, LIST_0, iMvp[LIST_0]); | |
| 647 | + UpdateP16x16MotionOnly (pCurDqLayer, LIST_0, iMvp[LIST_0]); | |
| 637 | 648 | iMvp[LIST_1][0] = iMvp[LIST_0][0] - mv[0]; |
| 638 | 649 | iMvp[LIST_1][1] = iMvp[LIST_0][1] - mv[1]; |
| 639 | − UpdateP16x16MotionOnly (pCurLayer, LIST_1, iMvp[LIST_1]); | |
| 650 | + UpdateP16x16MotionOnly (pCurDqLayer, LIST_1, iMvp[LIST_1]); | |
| 640 | 651 | } |
| 641 | − UpdateP16x16MvdCabac (pCurLayer, pMvd, LIST_0); | |
| 642 | − UpdateP16x16MvdCabac (pCurLayer, pMvd, LIST_1); | |
| 652 | + UpdateP16x16MvdCabac (pCurDqLayer, pMvd, LIST_0); | |
| 653 | + UpdateP16x16MvdCabac (pCurDqLayer, pMvd, LIST_1); | |
| 643 | 654 | } else { |
| 644 | 655 | if (bSkipOrDirect) { |
| 645 | 656 | int8_t pSubPartCount[4], pPartW[4]; |
| @@ -647,27 +658,27 @@ int32_t PredBDirectTemporal (PWelsDecoderContext pCtx, int16_t iMvp[LIST_A][2], · 1 unmodified line | ||
| 647 | 658 | for (int32_t i = 0; i < 4; i++) { |
| 648 | 659 | int16_t iIdx8 = i << 2; |
| 649 | 660 | const uint8_t iScan4Idx = g_kuiScan4[iIdx8]; |
| 650 | − pCurLayer->pSubMbType[iMbXy][i] = subMbType; | |
| 661 | + pCurDqLayer->pSubMbType[iMbXy][i] = subMbType; | |
| 651 | 662 | |
| 652 | − int16_t (*mvColoc)[2] = pCurLayer->iColocMv[LIST_0]; | |
| 663 | + int16_t (*mvColoc)[2] = pCurDqLayer->iColocMv[LIST_0]; | |
| 653 | 664 | |
| 654 | 665 | ref[LIST_1] = 0; |
| 655 | − UpdateP8x8RefIdxCabac (pCurLayer, pRefIndex, iIdx8, ref[LIST_1], LIST_1); | |
| 656 | − if (pCurLayer->iColocIntra[iScan4Idx]) { | |
| 666 | + UpdateP8x8RefIdxCabac (pCurDqLayer, pRefIndex, iIdx8, ref[LIST_1], LIST_1); | |
| 667 | + if (pCurDqLayer->iColocIntra[iScan4Idx]) { | |
| 657 | 668 | ref[LIST_0] = 0; |
| 658 | − UpdateP8x8RefIdxCabac (pCurLayer, pRefIndex, iIdx8, ref[LIST_0], LIST_0); | |
| 669 | + UpdateP8x8RefIdxCabac (pCurDqLayer, pRefIndex, iIdx8, ref[LIST_0], LIST_0); | |
| 659 | 670 | ST64 (iMvp, 0); |
| 660 | 671 | } else { |
| 661 | 672 | ref[LIST_0] = 0; |
| 662 | − int8_t colocRefIndexL0 = pCurLayer->iColocRefIndex[LIST_0][iScan4Idx]; | |
| 673 | + int8_t colocRefIndexL0 = pCurDqLayer->iColocRefIndex[LIST_0][iScan4Idx]; | |
| 663 | 674 | if (colocRefIndexL0 >= 0) { |
| 664 | 675 | ref[LIST_0] = MapColToList0 (pCtx, colocRefIndexL0, ref0Count); |
| 665 | 676 | } else { |
| 666 | − mvColoc = pCurLayer->iColocMv[LIST_1]; | |
| 677 | + mvColoc = pCurDqLayer->iColocMv[LIST_1]; | |
| 667 | 678 | } |
| 668 | − UpdateP8x8RefIdxCabac (pCurLayer, pRefIndex, iIdx8, ref[LIST_0], LIST_0); | |
| 679 | + UpdateP8x8RefIdxCabac (pCurDqLayer, pRefIndex, iIdx8, ref[LIST_0], LIST_0); | |
| 669 | 680 | } |
| 670 | − UpdateP8x8DirectCabac (pCurLayer, iIdx8); | |
| 681 | + UpdateP8x8DirectCabac (pCurDqLayer, iIdx8); | |
| 671 | 682 | |
| 672 | 683 | pSubPartCount[i] = g_ksInterBSubMbTypeInfo[0].iPartCount; |
| 673 | 684 | pPartW[i] = g_ksInterBSubMbTypeInfo[0].iPartWidth; |
| @@ -676,7 +687,7 @@ int32_t PredBDirectTemporal (PWelsDecoderContext pCtx, int16_t iMvp[LIST_A][2], · 2 unmodified lines | ||
| 676 | 687 | pSubPartCount[i] = 4; |
| 677 | 688 | pPartW[i] = 1; |
| 678 | 689 | } |
| 679 | − FillTemporalDirect8x8Mv (pCurLayer, iIdx8, pSubPartCount[i], pPartW[i], subMbType, ref, mvColoc, NULL, NULL); | |
| 690 | + FillTemporalDirect8x8Mv (pCurDqLayer, iIdx8, pSubPartCount[i], pPartW[i], subMbType, ref, mvColoc, NULL, NULL); | |
| 680 | 691 | } |
| 681 | 692 | } |
| 682 | 693 | } |
| @@ -785,14 +796,23 @@ void UpdateP16x16MotionInfo (PDqLayer pCurDqLayer, int32_t listIdx, int8_t iRef, · 102 unmodified lines | ||
| 785 | 796 | //mb |
| 786 | 797 | const uint8_t kuiScan4Idx = g_kuiScan4[i]; |
| 787 | 798 | const uint8_t kuiScan4IdxPlus4 = 4 + kuiScan4Idx; |
| 799 | + if (pCurDqLayer->pDec != NULL) { | |
| 800 | + ST16 (&pCurDqLayer->pDec->pRefIndex[listIdx][iMbXy][kuiScan4Idx], kiRef2); | |
| 801 | + ST16 (&pCurDqLayer->pDec->pRefIndex[listIdx][iMbXy][kuiScan4IdxPlus4], kiRef2); | |
| 802 | + | |
| 803 | + ST32 (pCurDqLayer->pDec->pMv[listIdx][iMbXy][kuiScan4Idx], kiMV32); | |
| 804 | + ST32 (pCurDqLayer->pDec->pMv[listIdx][iMbXy][1 + kuiScan4Idx], kiMV32); | |
| 805 | + ST32 (pCurDqLayer->pDec->pMv[listIdx][iMbXy][kuiScan4IdxPlus4], kiMV32); | |
| 806 | + ST32 (pCurDqLayer->pDec->pMv[listIdx][iMbXy][1 + kuiScan4IdxPlus4], kiMV32); | |
| 807 | + } else { | |
| 808 | + ST16 (&pCurDqLayer->pRefIndex[listIdx][iMbXy][kuiScan4Idx], kiRef2); | |
| 809 | + ST16 (&pCurDqLayer->pRefIndex[listIdx][iMbXy][kuiScan4IdxPlus4], kiRef2); | |
| 788 | 810 | |
| 789 | − ST16 (&pCurDqLayer->pRefIndex[listIdx][iMbXy][kuiScan4Idx ], kiRef2); | |
| 790 | − ST16 (&pCurDqLayer->pRefIndex[listIdx][iMbXy][kuiScan4IdxPlus4], kiRef2); | |
| 791 | − | |
| 792 | − ST32 (pCurDqLayer->pMv[listIdx][iMbXy][ kuiScan4Idx ], kiMV32); | |
| 793 | − ST32 (pCurDqLayer->pMv[listIdx][iMbXy][1 + kuiScan4Idx ], kiMV32); | |
| 794 | − ST32 (pCurDqLayer->pMv[listIdx][iMbXy][ kuiScan4IdxPlus4], kiMV32); | |
| 795 | − ST32 (pCurDqLayer->pMv[listIdx][iMbXy][1 + kuiScan4IdxPlus4], kiMV32); | |
| 811 | + ST32 (pCurDqLayer->pMv[listIdx][iMbXy][kuiScan4Idx], kiMV32); | |
| 812 | + ST32 (pCurDqLayer->pMv[listIdx][iMbXy][1 + kuiScan4Idx], kiMV32); | |
| 813 | + ST32 (pCurDqLayer->pMv[listIdx][iMbXy][kuiScan4IdxPlus4], kiMV32); | |
| 814 | + ST32 (pCurDqLayer->pMv[listIdx][iMbXy][1 + kuiScan4IdxPlus4], kiMV32); | |
| 815 | + } | |
| 796 | 816 | } |
| 797 | 817 | } |
| 798 | 818 | |
| @@ -808,8 +828,8 @@ void UpdateP16x16RefIdx (PDqLayer pCurDqLayer, int32_t listIdx, int8_t iRef) { · 9 unmodified lines | ||
| 808 | 828 | const uint8_t kuiScan4Idx = g_kuiScan4[i]; |
| 809 | 829 | const uint8_t kuiScan4IdxPlus4 = 4 + kuiScan4Idx; |
| 810 | 830 | |
| 811 | − ST16 (&pCurDqLayer->pRefIndex[listIdx][iMbXy][kuiScan4Idx], kiRef2); | |
| 812 | − ST16 (&pCurDqLayer->pRefIndex[listIdx][iMbXy][kuiScan4IdxPlus4], kiRef2); | |
| 831 | + ST16 (&pCurDqLayer->pDec->pRefIndex[listIdx][iMbXy][kuiScan4Idx], kiRef2); | |
| 832 | + ST16 (&pCurDqLayer->pDec->pRefIndex[listIdx][iMbXy][kuiScan4IdxPlus4], kiRef2); | |
| 813 | 833 | } |
| 814 | 834 | } |
| 815 | 835 | |
| @@ -824,11 +844,17 @@ void UpdateP16x16MotionOnly (PDqLayer pCurDqLayer, int32_t listIdx, int16_t iMVs · 8 unmodified lines | ||
| 824 | 844 | //mb |
| 825 | 845 | const uint8_t kuiScan4Idx = g_kuiScan4[i]; |
| 826 | 846 | const uint8_t kuiScan4IdxPlus4 = 4 + kuiScan4Idx; |
| 827 | − | |
| 828 | − ST32 (pCurDqLayer->pMv[listIdx][iMbXy][kuiScan4Idx], kiMV32); | |
| 829 | − ST32 (pCurDqLayer->pMv[listIdx][iMbXy][1 + kuiScan4Idx], kiMV32); | |
| 830 | − ST32 (pCurDqLayer->pMv[listIdx][iMbXy][kuiScan4IdxPlus4], kiMV32); | |
| 831 | − ST32 (pCurDqLayer->pMv[listIdx][iMbXy][1 + kuiScan4IdxPlus4], kiMV32); | |
| 847 | + if (pCurDqLayer->pDec != NULL) { | |
| 848 | + ST32 (pCurDqLayer->pDec->pMv[listIdx][iMbXy][kuiScan4Idx], kiMV32); | |
| 849 | + ST32 (pCurDqLayer->pDec->pMv[listIdx][iMbXy][1 + kuiScan4Idx], kiMV32); | |
| 850 | + ST32 (pCurDqLayer->pDec->pMv[listIdx][iMbXy][kuiScan4IdxPlus4], kiMV32); | |
| 851 | + ST32 (pCurDqLayer->pDec->pMv[listIdx][iMbXy][1 + kuiScan4IdxPlus4], kiMV32); | |
| 852 | + } else { | |
| 853 | + ST32 (pCurDqLayer->pMv[listIdx][iMbXy][kuiScan4Idx], kiMV32); | |
| 854 | + ST32 (pCurDqLayer->pMv[listIdx][iMbXy][1 + kuiScan4Idx], kiMV32); | |
| 855 | + ST32 (pCurDqLayer->pMv[listIdx][iMbXy][kuiScan4IdxPlus4], kiMV32); | |
| 856 | + ST32 (pCurDqLayer->pMv[listIdx][iMbXy][1 + kuiScan4IdxPlus4], kiMV32); | |
| 857 | + } | |
| 832 | 858 | } |
| 833 | 859 | } |
| 834 | 860 | |
| @@ -848,12 +874,21 @@ void UpdateP16x8MotionInfo (PDqLayer pCurDqLayer, int16_t iMotionVector[LIST_A][ · 13 unmodified lines | ||
| 848 | 874 | const uint8_t kuiCacheIdxPlus6 = 6 + kuiCacheIdx; |
| 849 | 875 | |
| 850 | 876 | //mb |
| 851 | − ST16 (&pCurDqLayer->pRefIndex[listIdx][iMbXy][kuiScan4Idx ], kiRef2); | |
| 852 | − ST16 (&pCurDqLayer->pRefIndex[listIdx][iMbXy][kuiScan4IdxPlus4], kiRef2); | |
| 853 | − ST32 (pCurDqLayer->pMv[listIdx][iMbXy][ kuiScan4Idx ], kiMV32); | |
| 854 | − ST32 (pCurDqLayer->pMv[listIdx][iMbXy][1 + kuiScan4Idx ], kiMV32); | |
| 855 | − ST32 (pCurDqLayer->pMv[listIdx][iMbXy][ kuiScan4IdxPlus4], kiMV32); | |
| 856 | − ST32 (pCurDqLayer->pMv[listIdx][iMbXy][1 + kuiScan4IdxPlus4], kiMV32); | |
| 877 | + if (pCurDqLayer->pDec != NULL) { | |
| 878 | + ST16 (&pCurDqLayer->pDec->pRefIndex[listIdx][iMbXy][kuiScan4Idx], kiRef2); | |
| 879 | + ST16 (&pCurDqLayer->pDec->pRefIndex[listIdx][iMbXy][kuiScan4IdxPlus4], kiRef2); | |
| 880 | + ST32 (pCurDqLayer->pDec->pMv[listIdx][iMbXy][kuiScan4Idx], kiMV32); | |
| 881 | + ST32 (pCurDqLayer->pDec->pMv[listIdx][iMbXy][1 + kuiScan4Idx], kiMV32); | |
| 882 | + ST32 (pCurDqLayer->pDec->pMv[listIdx][iMbXy][kuiScan4IdxPlus4], kiMV32); | |
| 883 | + ST32 (pCurDqLayer->pDec->pMv[listIdx][iMbXy][1 + kuiScan4IdxPlus4], kiMV32); | |
| 884 | + } else { | |
| 885 | + ST16 (&pCurDqLayer->pRefIndex[listIdx][iMbXy][kuiScan4Idx], kiRef2); | |
| 886 | + ST16 (&pCurDqLayer->pRefIndex[listIdx][iMbXy][kuiScan4IdxPlus4], kiRef2); | |
| 887 | + ST32 (pCurDqLayer->pMv[listIdx][iMbXy][kuiScan4Idx], kiMV32); | |
| 888 | + ST32 (pCurDqLayer->pMv[listIdx][iMbXy][1 + kuiScan4Idx], kiMV32); | |
| 889 | + ST32 (pCurDqLayer->pMv[listIdx][iMbXy][kuiScan4IdxPlus4], kiMV32); | |
| 890 | + ST32 (pCurDqLayer->pMv[listIdx][iMbXy][1 + kuiScan4IdxPlus4], kiMV32); | |
| 891 | + } | |
| 857 | 892 | //cache |
| 858 | 893 | ST16 (&iRefIndex[listIdx][kuiCacheIdx ], kiRef2); |
| 859 | 894 | ST16 (&iRefIndex[listIdx][kuiCacheIdxPlus6], kiRef2); |
| @@ -879,12 +914,21 @@ void UpdateP8x16MotionInfo (PDqLayer pCurDqLayer, int16_t iMotionVector[LIST_A][ · 19 unmodified lines | ||
| 879 | 914 | const uint8_t kuiCacheIdxPlus6 = 6 + kuiCacheIdx; |
| 880 | 915 | |
| 881 | 916 | //mb |
| 882 | − ST16 (&pCurDqLayer->pRefIndex[listIdx][iMbXy][kuiScan4Idx ], kiRef2); | |
| 883 | − ST16 (&pCurDqLayer->pRefIndex[listIdx][iMbXy][kuiScan4IdxPlus4], kiRef2); | |
| 884 | − ST32 (pCurDqLayer->pMv[listIdx][iMbXy][ kuiScan4Idx ], kiMV32); | |
| 885 | − ST32 (pCurDqLayer->pMv[listIdx][iMbXy][1 + kuiScan4Idx ], kiMV32); | |
| 886 | − ST32 (pCurDqLayer->pMv[listIdx][iMbXy][ kuiScan4IdxPlus4], kiMV32); | |
| 887 | − ST32 (pCurDqLayer->pMv[listIdx][iMbXy][1 + kuiScan4IdxPlus4], kiMV32); | |
| 917 | + if (pCurDqLayer->pDec != NULL) { | |
| 918 | + ST16 (&pCurDqLayer->pDec->pRefIndex[listIdx][iMbXy][kuiScan4Idx], kiRef2); | |
| 919 | + ST16 (&pCurDqLayer->pDec->pRefIndex[listIdx][iMbXy][kuiScan4IdxPlus4], kiRef2); | |
| 920 | + ST32 (pCurDqLayer->pDec->pMv[listIdx][iMbXy][kuiScan4Idx], kiMV32); | |
| 921 | + ST32 (pCurDqLayer->pDec->pMv[listIdx][iMbXy][1 + kuiScan4Idx], kiMV32); | |
| 922 | + ST32 (pCurDqLayer->pDec->pMv[listIdx][iMbXy][kuiScan4IdxPlus4], kiMV32); | |
| 923 | + ST32 (pCurDqLayer->pDec->pMv[listIdx][iMbXy][1 + kuiScan4IdxPlus4], kiMV32); | |
| 924 | + } else { | |
| 925 | + ST16 (&pCurDqLayer->pRefIndex[listIdx][iMbXy][kuiScan4Idx], kiRef2); | |
| 926 | + ST16 (&pCurDqLayer->pRefIndex[listIdx][iMbXy][kuiScan4IdxPlus4], kiRef2); | |
| 927 | + ST32 (pCurDqLayer->pMv[listIdx][iMbXy][kuiScan4Idx], kiMV32); | |
| 928 | + ST32 (pCurDqLayer->pMv[listIdx][iMbXy][1 + kuiScan4Idx], kiMV32); | |
| 929 | + ST32 (pCurDqLayer->pMv[listIdx][iMbXy][kuiScan4IdxPlus4], kiMV32); | |
| 930 | + ST32 (pCurDqLayer->pMv[listIdx][iMbXy][1 + kuiScan4IdxPlus4], kiMV32); | |
| 931 | + } | |
| 888 | 932 | //cache |
| 889 | 933 | ST16 (&iRefIndex[listIdx][kuiCacheIdx ], kiRef2); |
| 890 | 934 | ST16 (&iRefIndex[listIdx][kuiCacheIdxPlus6], kiRef2); |
| @@ -895,10 +939,10 @@ void UpdateP8x16MotionInfo (PDqLayer pCurDqLayer, int16_t iMotionVector[LIST_A][ · 4 unmodified lines | ||
| 895 | 939 | } |
| 896 | 940 | } |
| 897 | 941 | |
| 898 | −void FillSpatialDirect8x8Mv (PDqLayer pCurLayer, const int16_t& iIdx8, const int8_t& iPartCount, const int8_t& iPartW, | |
| 942 | +void FillSpatialDirect8x8Mv (PDqLayer pCurDqLayer, const int16_t& iIdx8, const int8_t& iPartCount, const int8_t& iPartW, | |
| 899 | 943 | const SubMbType& subMbType, const bool& bIsLongRef, int16_t pMvDirect[LIST_A][2], int8_t iRef[LIST_A], |
| 900 | 944 | int16_t pMotionVector[LIST_A][30][MV_A], int16_t pMvdCache[LIST_A][30][MV_A]) { |
| 901 | − int32_t iMbXy = pCurLayer->iMbXyIndex; | |
| 945 | + int32_t iMbXy = pCurDqLayer->iMbXyIndex; | |
| 902 | 946 | for (int32_t j = 0; j < iPartCount; j++) { |
| 903 | 947 | int8_t iPartIdx = iIdx8 + j * iPartW; |
| 904 | 948 | uint8_t iScan4Idx = g_kuiScan4[iPartIdx]; |
| @@ -909,10 +953,10 @@ void FillSpatialDirect8x8Mv (PDqLayer pCurLayer, const int16_t& iIdx8, const int · 4 unmodified lines | ||
| 909 | 953 | if (IS_SUB_8x8 (subMbType)) { |
| 910 | 954 | * (uint32_t*)pMV = * (uint32_t*)pMvDirect[LIST_0]; |
| 911 | 955 | ST32 ((pMV + 2), LD32 (pMV)); |
| 912 | − ST64 (pCurLayer->pMv[LIST_0][iMbXy][iScan4Idx], LD64 (pMV)); | |
| 913 | − ST64 (pCurLayer->pMv[LIST_0][iMbXy][iScan4Idx + 4], LD64 (pMV)); | |
| 914 | − ST64 (pCurLayer->pMvd[LIST_0][iMbXy][iScan4Idx], 0); | |
| 915 | − ST64 (pCurLayer->pMvd[LIST_0][iMbXy][iScan4Idx + 4], 0); | |
| 956 | + ST64 (pCurDqLayer->pDec->pMv[LIST_0][iMbXy][iScan4Idx], LD64 (pMV)); | |
| 957 | + ST64 (pCurDqLayer->pDec->pMv[LIST_0][iMbXy][iScan4Idx + 4], LD64 (pMV)); | |
| 958 | + ST64 (pCurDqLayer->pMvd[LIST_0][iMbXy][iScan4Idx], 0); | |
| 959 | + ST64 (pCurDqLayer->pMvd[LIST_0][iMbXy][iScan4Idx + 4], 0); | |
| 916 | 960 | if (pMotionVector != NULL) { |
| 917 | 961 | ST64 (pMotionVector[LIST_0][iCacheIdx], LD64 (pMV)); |
| 918 | 962 | ST64 (pMotionVector[LIST_0][iCacheIdx + 6], LD64 (pMV)); |
| @@ -923,10 +967,10 @@ void FillSpatialDirect8x8Mv (PDqLayer pCurLayer, const int16_t& iIdx8, const int · 4 unmodified lines | ||
| 923 | 967 | } |
| 924 | 968 | * (uint32_t*)pMV = * (uint32_t*)pMvDirect[LIST_1]; |
| 925 | 969 | ST32 ((pMV + 2), LD32 (pMV)); |
| 926 | − ST64 (pCurLayer->pMv[LIST_1][iMbXy][iScan4Idx], LD64 (pMV)); | |
| 927 | − ST64 (pCurLayer->pMv[LIST_1][iMbXy][iScan4Idx + 4], LD64 (pMV)); | |
| 928 | − ST64 (pCurLayer->pMvd[LIST_1][iMbXy][iScan4Idx], 0); | |
| 929 | − ST64 (pCurLayer->pMvd[LIST_1][iMbXy][iScan4Idx + 4], 0); | |
| 970 | + ST64 (pCurDqLayer->pDec->pMv[LIST_1][iMbXy][iScan4Idx], LD64 (pMV)); | |
| 971 | + ST64 (pCurDqLayer->pDec->pMv[LIST_1][iMbXy][iScan4Idx + 4], LD64 (pMV)); | |
| 972 | + ST64 (pCurDqLayer->pMvd[LIST_1][iMbXy][iScan4Idx], 0); | |
| 973 | + ST64 (pCurDqLayer->pMvd[LIST_1][iMbXy][iScan4Idx + 4], 0); | |
| 930 | 974 | if (pMotionVector != NULL) { |
| 931 | 975 | ST64 (pMotionVector[LIST_1][iCacheIdx], LD64 (pMV)); |
| 932 | 976 | ST64 (pMotionVector[LIST_1][iCacheIdx + 6], LD64 (pMV)); |
| @@ -937,8 +981,8 @@ void FillSpatialDirect8x8Mv (PDqLayer pCurLayer, const int16_t& iIdx8, const int · 4 unmodified lines | ||
| 937 | 981 | } |
| 938 | 982 | } else { //SUB_4x4 |
| 939 | 983 | * (uint32_t*)pMV = * (uint32_t*)pMvDirect[LIST_0]; |
| 940 | − ST32 (pCurLayer->pMv[LIST_0][iMbXy][iScan4Idx], LD32 (pMV)); | |
| 941 | − ST32 (pCurLayer->pMvd[LIST_0][iMbXy][iScan4Idx], 0); | |
| 984 | + ST32 (pCurDqLayer->pDec->pMv[LIST_0][iMbXy][iScan4Idx], LD32 (pMV)); | |
| 985 | + ST32 (pCurDqLayer->pMvd[LIST_0][iMbXy][iScan4Idx], 0); | |
| 942 | 986 | if (pMotionVector != NULL) { |
| 943 | 987 | ST32 (pMotionVector[LIST_0][iCacheIdx], LD32 (pMV)); |
| 944 | 988 | } |
| @@ -946,8 +990,8 @@ void FillSpatialDirect8x8Mv (PDqLayer pCurLayer, const int16_t& iIdx8, const int · 1 unmodified line | ||
| 946 | 990 | ST32 (pMvdCache[LIST_0][iCacheIdx], 0); |
| 947 | 991 | } |
| 948 | 992 | * (uint32_t*)pMV = * (uint32_t*)pMvDirect[LIST_1]; |
| 949 | − ST32 (pCurLayer->pMv[LIST_1][iMbXy][iScan4Idx], LD32 (pMV)); | |
| 950 | − ST32 (pCurLayer->pMvd[LIST_1][iMbXy][iScan4Idx], 0); | |
| 993 | + ST32 (pCurDqLayer->pDec->pMv[LIST_1][iMbXy][iScan4Idx], LD32 (pMV)); | |
| 994 | + ST32 (pCurDqLayer->pMvd[LIST_1][iMbXy][iScan4Idx], 0); | |
| 951 | 995 | if (pMotionVector != NULL) { |
| 952 | 996 | ST32 (pMotionVector[LIST_1][iCacheIdx], LD32 (pMV)); |
| 953 | 997 | } |
| @@ -956,19 +1000,19 @@ void FillSpatialDirect8x8Mv (PDqLayer pCurLayer, const int16_t& iIdx8, const int · 2 unmodified lines | ||
| 956 | 1000 | } |
| 957 | 1001 | } |
| 958 | 1002 | if ((* (int32_t*)pMvDirect[LIST_0] | * (int32_t*)pMvDirect[LIST_1])) { |
| 959 | − uint32_t uiColZeroFlag = (0 == pCurLayer->iColocIntra[iColocIdx]) && !bIsLongRef && | |
| 960 | − (pCurLayer->iColocRefIndex[LIST_0][iColocIdx] == 0 || (pCurLayer->iColocRefIndex[LIST_0][iColocIdx] < 0 | |
| 961 | − && pCurLayer->iColocRefIndex[LIST_1][iColocIdx] == 0)); | |
| 962 | − const int16_t (*mvColoc)[2] = 0 == pCurLayer->iColocRefIndex[LIST_0][iColocIdx] ? pCurLayer->iColocMv[LIST_0] : | |
| 963 | − pCurLayer->iColocMv[LIST_1]; | |
| 1003 | + uint32_t uiColZeroFlag = (0 == pCurDqLayer->iColocIntra[iColocIdx]) && !bIsLongRef && | |
| 1004 | + (pCurDqLayer->iColocRefIndex[LIST_0][iColocIdx] == 0 || (pCurDqLayer->iColocRefIndex[LIST_0][iColocIdx] < 0 | |
| 1005 | + && pCurDqLayer->iColocRefIndex[LIST_1][iColocIdx] == 0)); | |
| 1006 | + const int16_t (*mvColoc)[2] = 0 == pCurDqLayer->iColocRefIndex[LIST_0][iColocIdx] ? pCurDqLayer->iColocMv[LIST_0] : | |
| 1007 | + pCurDqLayer->iColocMv[LIST_1]; | |
| 964 | 1008 | const int16_t* mv = mvColoc[iColocIdx]; |
| 965 | 1009 | if (IS_SUB_8x8 (subMbType)) { |
| 966 | 1010 | if (uiColZeroFlag && ((unsigned) (mv[0] + 1) <= 2 && (unsigned) (mv[1] + 1) <= 2)) { |
| 967 | 1011 | if (iRef[LIST_0] == 0) { |
| 968 | − ST64 (pCurLayer->pMv[LIST_0][iMbXy][iScan4Idx], 0); | |
| 969 | − ST64 (pCurLayer->pMv[LIST_0][iMbXy][iScan4Idx + 4], 0); | |
| 970 | − ST64 (pCurLayer->pMvd[LIST_0][iMbXy][iScan4Idx], 0); | |
| 971 | − ST64 (pCurLayer->pMvd[LIST_0][iMbXy][iScan4Idx + 4], 0); | |
| 1012 | + ST64 (pCurDqLayer->pDec->pMv[LIST_0][iMbXy][iScan4Idx], 0); | |
| 1013 | + ST64 (pCurDqLayer->pDec->pMv[LIST_0][iMbXy][iScan4Idx + 4], 0); | |
| 1014 | + ST64 (pCurDqLayer->pMvd[LIST_0][iMbXy][iScan4Idx], 0); | |
| 1015 | + ST64 (pCurDqLayer->pMvd[LIST_0][iMbXy][iScan4Idx + 4], 0); | |
| 972 | 1016 | if (pMotionVector != NULL) { |
| 973 | 1017 | ST64 (pMotionVector[LIST_0][iCacheIdx], 0); |
| 974 | 1018 | ST64 (pMotionVector[LIST_0][iCacheIdx + 6], 0); |
| @@ -980,10 +1024,10 @@ void FillSpatialDirect8x8Mv (PDqLayer pCurLayer, const int16_t& iIdx8, const int · 5 unmodified lines | ||
| 980 | 1024 | } |
| 981 | 1025 | |
| 982 | 1026 | if (iRef[LIST_1] == 0) { |
| 983 | − ST64 (pCurLayer->pMv[LIST_1][iMbXy][iScan4Idx], 0); | |
| 984 | − ST64 (pCurLayer->pMv[LIST_1][iMbXy][iScan4Idx + 4], 0); | |
| 985 | − ST64 (pCurLayer->pMvd[LIST_1][iMbXy][iScan4Idx], 0); | |
| 986 | − ST64 (pCurLayer->pMvd[LIST_1][iMbXy][iScan4Idx + 4], 0); | |
| 1027 | + ST64 (pCurDqLayer->pDec->pMv[LIST_1][iMbXy][iScan4Idx], 0); | |
| 1028 | + ST64 (pCurDqLayer->pDec->pMv[LIST_1][iMbXy][iScan4Idx + 4], 0); | |
| 1029 | + ST64 (pCurDqLayer->pMvd[LIST_1][iMbXy][iScan4Idx], 0); | |
| 1030 | + ST64 (pCurDqLayer->pMvd[LIST_1][iMbXy][iScan4Idx + 4], 0); | |
| 987 | 1031 | if (pMotionVector != NULL) { |
| 988 | 1032 | ST64 (pMotionVector[LIST_1][iCacheIdx], 0); |
| 989 | 1033 | ST64 (pMotionVector[LIST_1][iCacheIdx + 6], 0); |
| @@ -997,8 +1041,8 @@ void FillSpatialDirect8x8Mv (PDqLayer pCurLayer, const int16_t& iIdx8, const int · 7 unmodified lines | ||
| 997 | 1041 | } else { |
| 998 | 1042 | if (uiColZeroFlag && ((unsigned) (mv[0] + 1) <= 2 && (unsigned) (mv[1] + 1) <= 2)) { |
| 999 | 1043 | if (iRef[LIST_0] == 0) { |
| 1000 | − ST32 (pCurLayer->pMv[LIST_0][iMbXy][iScan4Idx], 0); | |
| 1001 | − ST32 (pCurLayer->pMvd[LIST_0][iMbXy][iScan4Idx], 0); | |
| 1044 | + ST32 (pCurDqLayer->pDec->pMv[LIST_0][iMbXy][iScan4Idx], 0); | |
| 1045 | + ST32 (pCurDqLayer->pMvd[LIST_0][iMbXy][iScan4Idx], 0); | |
| 1002 | 1046 | if (pMotionVector != NULL) { |
| 1003 | 1047 | ST32 (pMotionVector[LIST_0][iCacheIdx], 0); |
| 1004 | 1048 | } |
| @@ -1007,8 +1051,8 @@ void FillSpatialDirect8x8Mv (PDqLayer pCurLayer, const int16_t& iIdx8, const int · 2 unmodified lines | ||
| 1007 | 1051 | } |
| 1008 | 1052 | } |
| 1009 | 1053 | if (iRef[LIST_1] == 0) { |
| 1010 | − ST32 (pCurLayer->pMv[LIST_1][iMbXy][iScan4Idx], 0); | |
| 1011 | − ST32 (pCurLayer->pMvd[LIST_1][iMbXy][iScan4Idx], 0); | |
| 1054 | + ST32 (pCurDqLayer->pDec->pMv[LIST_1][iMbXy][iScan4Idx], 0); | |
| 1055 | + ST32 (pCurDqLayer->pMvd[LIST_1][iMbXy][iScan4Idx], 0); | |
| 1012 | 1056 | if (pMotionVector != NULL) { |
| 1013 | 1057 | ST32 (pMotionVector[LIST_1][iCacheIdx], 0); |
| 1014 | 1058 | } |
| @@ -1022,11 +1066,12 @@ void FillSpatialDirect8x8Mv (PDqLayer pCurLayer, const int16_t& iIdx8, const int · 7 unmodified lines | ||
| 1022 | 1066 | } |
| 1023 | 1067 | } |
| 1024 | 1068 | |
| 1025 | −void FillTemporalDirect8x8Mv (PDqLayer pCurLayer, const int16_t& iIdx8, const int8_t& iPartCount, const int8_t& iPartW, | |
| 1069 | +void FillTemporalDirect8x8Mv (PDqLayer pCurDqLayer, const int16_t& iIdx8, const int8_t& iPartCount, | |
| 1070 | + const int8_t& iPartW, | |
| 1026 | 1071 | const SubMbType& subMbType, int8_t iRef[LIST_A], int16_t (*mvColoc)[2], int16_t pMotionVector[LIST_A][30][MV_A], |
| 1027 | 1072 | int16_t pMvdCache[LIST_A][30][MV_A]) { |
| 1028 | − PSlice pSlice = &pCurLayer->sLayerInfo.sSliceInLayer; | |
| 1029 | − int32_t iMbXy = pCurLayer->iMbXyIndex; | |
| 1073 | + PSlice pSlice = &pCurDqLayer->sLayerInfo.sSliceInLayer; | |
| 1074 | + int32_t iMbXy = pCurDqLayer->iMbXyIndex; | |
| 1030 | 1075 | int16_t pMvDirect[LIST_A][2] = { { 0, 0 }, { 0, 0 } }; |
| 1031 | 1076 | for (int32_t j = 0; j < iPartCount; j++) { |
| 1032 | 1077 | int8_t iPartIdx = iIdx8 + j * iPartW; |
| @@ -1038,16 +1083,16 @@ void FillTemporalDirect8x8Mv (PDqLayer pCurLayer, const int16_t& iIdx8, const in · 5 unmodified lines | ||
| 1038 | 1083 | |
| 1039 | 1084 | int16_t pMV[4] = { 0 }; |
| 1040 | 1085 | if (IS_SUB_8x8 (subMbType)) { |
| 1041 | − if (!pCurLayer->iColocIntra[iColocIdx]) { | |
| 1086 | + if (!pCurDqLayer->iColocIntra[iColocIdx]) { | |
| 1042 | 1087 | pMvDirect[LIST_0][0] = (pSlice->iMvScale[LIST_0][iRef[LIST_0]] * mv[0] + 128) >> 8; |
| 1043 | 1088 | pMvDirect[LIST_0][1] = (pSlice->iMvScale[LIST_0][iRef[LIST_0]] * mv[1] + 128) >> 8; |
| 1044 | 1089 | } |
| 1045 | 1090 | ST32 (pMV, LD32 (pMvDirect[LIST_0])); |
| 1046 | 1091 | ST32 ((pMV + 2), LD32 (pMvDirect[LIST_0])); |
| 1047 | − ST64 (pCurLayer->pMv[LIST_0][iMbXy][iScan4Idx], LD64 (pMV)); | |
| 1048 | − ST64 (pCurLayer->pMv[LIST_0][iMbXy][iScan4Idx + 4], LD64 (pMV)); | |
| 1049 | − ST64 (pCurLayer->pMvd[LIST_0][iMbXy][iScan4Idx], 0); | |
| 1050 | − ST64 (pCurLayer->pMvd[LIST_0][iMbXy][iScan4Idx + 4], 0); | |
| 1092 | + ST64 (pCurDqLayer->pDec->pMv[LIST_0][iMbXy][iScan4Idx], LD64 (pMV)); | |
| 1093 | + ST64 (pCurDqLayer->pDec->pMv[LIST_0][iMbXy][iScan4Idx + 4], LD64 (pMV)); | |
| 1094 | + ST64 (pCurDqLayer->pMvd[LIST_0][iMbXy][iScan4Idx], 0); | |
| 1095 | + ST64 (pCurDqLayer->pMvd[LIST_0][iMbXy][iScan4Idx + 4], 0); | |
| 1051 | 1096 | if (pMotionVector != NULL) { |
| 1052 | 1097 | ST64 (pMotionVector[LIST_0][iCacheIdx], LD64 (pMV)); |
| 1053 | 1098 | ST64 (pMotionVector[LIST_0][iCacheIdx + 6], LD64 (pMV)); |
| @@ -1056,16 +1101,16 @@ void FillTemporalDirect8x8Mv (PDqLayer pCurLayer, const int16_t& iIdx8, const in · 2 unmodified lines | ||
| 1056 | 1101 | ST64 (pMvdCache[LIST_0][iCacheIdx], 0); |
| 1057 | 1102 | ST64 (pMvdCache[LIST_0][iCacheIdx + 6], 0); |
| 1058 | 1103 | } |
| 1059 | − if (!pCurLayer->iColocIntra[g_kuiScan4[iIdx8]]) { | |
| 1104 | + if (!pCurDqLayer->iColocIntra[g_kuiScan4[iIdx8]]) { | |
| 1060 | 1105 | pMvDirect[LIST_1][0] = pMvDirect[LIST_0][0] - mv[0]; |
| 1061 | 1106 | pMvDirect[LIST_1][1] = pMvDirect[LIST_0][1] - mv[1]; |
| 1062 | 1107 | } |
| 1063 | 1108 | ST32 (pMV, LD32 (pMvDirect[LIST_1])); |
| 1064 | 1109 | ST32 ((pMV + 2), LD32 (pMvDirect[LIST_1])); |
| 1065 | − ST64 (pCurLayer->pMv[LIST_1][iMbXy][iScan4Idx], LD64 (pMV)); | |
| 1066 | − ST64 (pCurLayer->pMv[LIST_1][iMbXy][iScan4Idx + 4], LD64 (pMV)); | |
| 1067 | − ST64 (pCurLayer->pMvd[LIST_1][iMbXy][iScan4Idx], 0); | |
| 1068 | − ST64 (pCurLayer->pMvd[LIST_1][iMbXy][iScan4Idx + 4], 0); | |
| 1110 | + ST64 (pCurDqLayer->pDec->pMv[LIST_1][iMbXy][iScan4Idx], LD64 (pMV)); | |
| 1111 | + ST64 (pCurDqLayer->pDec->pMv[LIST_1][iMbXy][iScan4Idx + 4], LD64 (pMV)); | |
| 1112 | + ST64 (pCurDqLayer->pMvd[LIST_1][iMbXy][iScan4Idx], 0); | |
| 1113 | + ST64 (pCurDqLayer->pMvd[LIST_1][iMbXy][iScan4Idx + 4], 0); | |
| 1069 | 1114 | if (pMotionVector != NULL) { |
| 1070 | 1115 | ST64 (pMotionVector[LIST_1][iCacheIdx], LD64 (pMV)); |
| 1071 | 1116 | ST64 (pMotionVector[LIST_1][iCacheIdx + 6], LD64 (pMV)); |
| @@ -1075,24 +1120,24 @@ void FillTemporalDirect8x8Mv (PDqLayer pCurLayer, const int16_t& iIdx8, const in · 3 unmodified lines | ||
| 1075 | 1120 | ST64 (pMvdCache[LIST_1][iCacheIdx + 6], 0); |
| 1076 | 1121 | } |
| 1077 | 1122 | } else { //SUB_4x4 |
| 1078 | − if (!pCurLayer->iColocIntra[iColocIdx]) { | |
| 1123 | + if (!pCurDqLayer->iColocIntra[iColocIdx]) { | |
| 1079 | 1124 | pMvDirect[LIST_0][0] = (pSlice->iMvScale[LIST_0][iRef[LIST_0]] * mv[0] + 128) >> 8; |
| 1080 | 1125 | pMvDirect[LIST_0][1] = (pSlice->iMvScale[LIST_0][iRef[LIST_0]] * mv[1] + 128) >> 8; |
| 1081 | 1126 | } |
| 1082 | − ST32 (pCurLayer->pMv[LIST_0][iMbXy][iScan4Idx], LD32 (pMvDirect[LIST_0])); | |
| 1083 | − ST32 (pCurLayer->pMvd[LIST_0][iMbXy][iScan4Idx], 0); | |
| 1127 | + ST32 (pCurDqLayer->pDec->pMv[LIST_0][iMbXy][iScan4Idx], LD32 (pMvDirect[LIST_0])); | |
| 1128 | + ST32 (pCurDqLayer->pMvd[LIST_0][iMbXy][iScan4Idx], 0); | |
| 1084 | 1129 | if (pMotionVector != NULL) { |
| 1085 | 1130 | ST32 (pMotionVector[LIST_0][iCacheIdx], LD32 (pMvDirect[LIST_0])); |
| 1086 | 1131 | } |
| 1087 | 1132 | if (pMvdCache != NULL) { |
| 1088 | 1133 | ST32 (pMvdCache[LIST_0][iCacheIdx], 0); |
| 1089 | 1134 | } |
| 1090 | − if (!pCurLayer->iColocIntra[iColocIdx]) { | |
| 1135 | + if (!pCurDqLayer->iColocIntra[iColocIdx]) { | |
| 1091 | 1136 | pMvDirect[LIST_1][0] = pMvDirect[LIST_0][0] - mv[0]; |
| 1092 | 1137 | pMvDirect[LIST_1][1] = pMvDirect[LIST_0][1] - mv[1]; |
| 1093 | 1138 | } |
| 1094 | − ST32 (pCurLayer->pMv[LIST_1][iMbXy][iScan4Idx], LD32 (pMvDirect[LIST_1])); | |
| 1095 | − ST32 (pCurLayer->pMvd[LIST_1][iMbXy][iScan4Idx], 0); | |
| 1139 | + ST32 (pCurDqLayer->pDec->pMv[LIST_1][iMbXy][iScan4Idx], LD32 (pMvDirect[LIST_1])); | |
| 1140 | + ST32 (pCurDqLayer->pMvd[LIST_1][iMbXy][iScan4Idx], 0); | |
| 1096 | 1141 | if (pMotionVector != NULL) { |
| 1097 | 1142 | ST32 (pMotionVector[LIST_1][iCacheIdx], LD32 (pMvDirect[LIST_1])); |
| 1098 | 1143 | } |
| @@ -1122,8 +1167,9 @@ int8_t MapColToList0 (PWelsDecoderContext& pCtx, const int8_t& colocRefIndexL0, · 23 unmodified lines | ||
| 1122 | 1167 | void Update8x8RefIdx (PDqLayer& pCurDqLayer, const int16_t& iPartIdx, const int32_t& listIdx, const int8_t& iRef) { |
| 1123 | 1168 | int32_t iMbXy = pCurDqLayer->iMbXyIndex; |
| 1124 | 1169 | const uint8_t iScan4Idx = g_kuiScan4[iPartIdx]; |
| 1125 | − pCurDqLayer->pRefIndex[listIdx][iMbXy][iScan4Idx] = pCurDqLayer->pRefIndex[listIdx][iMbXy][iScan4Idx + 1] = | |
| 1126 | − pCurDqLayer->pRefIndex[listIdx][iMbXy][iScan4Idx + 4] = pCurDqLayer->pRefIndex[listIdx][iMbXy][iScan4Idx + 5] = iRef; | |
| 1170 | + pCurDqLayer->pDec->pRefIndex[listIdx][iMbXy][iScan4Idx] = pCurDqLayer->pDec->pRefIndex[listIdx][iMbXy][iScan4Idx + 1] = | |
| 1171 | + pCurDqLayer->pDec->pRefIndex[listIdx][iMbXy][iScan4Idx + 4] = pCurDqLayer->pDec->pRefIndex[listIdx][iMbXy][iScan4Idx + | |
| 1172 | + 5] = iRef; | |
| 1127 | 1173 | |
| 1128 | 1174 | } |
| 1129 | 1175 | } // namespace WelsDec |