Showing the changes to test/decoder/DecUT_DeblockCommon.cpp (1 of 1 file). Show all
Unified · Split
| @@ -24,7 +24,7 @@ if (iNum==0) { \ · 23 unmodified lines | |||
| 24 | iTc[0] = iTc[1] = iTc[2] = iTc[3] = 25; \ | 24 | iTc[0] = iTc[1] = iTc[2] = iTc[3] = 25; \ |
| 25 | pBase[0] = pRef[0] = 128; \ | 25 | pBase[0] = pRef[0] = 128; \ |
| 26 | for (int i = 1; i < iWidth*iWidth; i++) { \ | 26 | for (int i = 1; i < iWidth*iWidth; i++) { \ |
| 27 | pBase[i] = pRef[i] = CLIP3(0, 255, pBase[i-1] -16 + rand()%32); \ | 27 | pBase[i] = pRef[i] = CLIP3( pBase[i-1] -16 + rand()%32, 0, 255); \ |
| 28 | } \ | 28 | } \ |
| 29 | } else if (iNum==1) { \ | 29 | } else if (iNum==1) { \ |
| 30 | iAlpha = 4; \ | 30 | iAlpha = 4; \ |
| @@ -32,7 +32,7 @@ if (iNum==0) { \ · 1 unmodified line | |||
| 32 | iTc[0] = iTc[1] = iTc[2] = iTc[3] = 9; \ | 32 | iTc[0] = iTc[1] = iTc[2] = iTc[3] = 9; \ |
| 33 | pBase[0] = pRef[0] = 128; \ | 33 | pBase[0] = pRef[0] = 128; \ |
| 34 | for (int i = 1; i < iWidth*iWidth; i++) { \ | 34 | for (int i = 1; i < iWidth*iWidth; i++) { \ |
| 35 | pBase[i] = pRef[i] = CLIP3(0, 255, pBase[i-1] -4 + rand()%8); \ | 35 | pBase[i] = pRef[i] = CLIP3( pBase[i-1] -4 + rand()%8, 0, 255); \ |
| 36 | } \ | 36 | } \ |
| 37 | } else { \ | 37 | } else { \ |
| 38 | iAlpha = rand() % 256; \ | 38 | iAlpha = rand() % 256; \ |
| @@ -41,7 +41,7 @@ if (iNum==0) { \ · 2 unmodified lines | |||
| 41 | iTc[i] = rand() % 26; \ | 41 | iTc[i] = rand() % 26; \ |
| 42 | } \ | 42 | } \ |
| 43 | for (int i = 0; i < iWidth*iWidth; i++) { \ | 43 | for (int i = 0; i < iWidth*iWidth; i++) { \ |
| 44 | pBase[i] = pRef[i] = rand() % 256; \ | 44 | pBase[i] = pRef[i] = rand() % 200; \ |
| 45 | } \ | 45 | } \ |
| 46 | } | 46 | } |
| 47 | 47 | ||
| @@ -69,14 +69,14 @@ void anchor_DeblockingLumaNormal (uint8_t* pPix, int32_t iStrideX, int32_t iStri · 21 unmodified lines | |||
| 69 | if (abs (p[0] - q[0]) < iAlpha && abs (p[1] - p[0]) < iBeta && abs (q[1] - q[0]) < iBeta) { | 69 | if (abs (p[0] - q[0]) < iAlpha && abs (p[1] - p[0]) < iBeta && abs (q[1] - q[0]) < iBeta) { |
| 70 | // 8-470 | 70 | // 8-470 |
| 71 | if (abs (p[2] - p[0]) < iBeta) { | 71 | if (abs (p[2] - p[0]) < iBeta) { |
| 72 | pPix[iStrideX * -2] = p[1] + CLIP3 (((p[2] + ((p[0] + q[0] + 1) >> 1) - (p[1] << 1)) >> 1), -1 * pTc[iIndexTc], | 72 | pPix[iStrideX * -2] = CLIP3 (p[1] + CLIP3 (((p[2] + ((p[0] + q[0] + 1) >> 1) - (p[1] << 1)) >> 1), -1 * pTc[iIndexTc], |
| 73 | pTc[iIndexTc]); | 73 | pTc[iIndexTc]), 0, 255); |
| 74 | iTc++; | 74 | iTc++; |
| 75 | } | 75 | } |
| 76 | // 8-472 | 76 | // 8-472 |
| 77 | if (abs (q[2] - q[0]) < iBeta) { | 77 | if (abs (q[2] - q[0]) < iBeta) { |
| 78 | pPix[iStrideX * 1] = q[1] + CLIP3 (((q[2] + ((p[0] + q[0] + 1) >> 1) - (q[1] << 1)) >> 1), -1 * pTc[iIndexTc], | 78 | pPix[iStrideX * 1] = CLIP3 (q[1] + CLIP3 (((q[2] + ((p[0] + q[0] + 1) >> 1) - (q[1] << 1)) >> 1), -1 * pTc[iIndexTc], |
| 79 | pTc[iIndexTc]); | 79 | pTc[iIndexTc]), 0, 255); |
| 80 | iTc++; | 80 | iTc++; |
| 81 | } | 81 | } |
| 82 | // 8-467,468,469 | 82 | // 8-467,468,469 |
| @@ -224,9 +224,7 @@ TEST (DeblockingCommon, DeblockLumaLt4_c) { · 141 unmodified lines | |||
| 224 | 224 | ||
| 225 | ENFORCE_STACK_ALIGN_1D (int8_t, iTc, 4, 16); | 225 | ENFORCE_STACK_ALIGN_1D (int8_t, iTc, 4, 16); |
| 226 | 226 | ||
| 227 | bool bEqual = true; | 227 | for (int iNum = 0; iNum < TEST_CYCLE; iNum++) { |
| 228 | |||
| 229 | for (int iNum = 0; bEqual && iNum < TEST_CYCLE; iNum++) { | ||
| 230 | /* Horizontal */ | 228 | /* Horizontal */ |
| 231 | GENERATE_DATA_DEBLOCKING (iPixBase, iPixRef, 16) | 229 | GENERATE_DATA_DEBLOCKING (iPixBase, iPixRef, 16) |
| 232 | 230 | ||
| @@ -234,10 +232,8 @@ TEST (DeblockingCommon, DeblockLumaLt4_c) { · 1 unmodified line | |||
| 234 | DeblockLumaLt4_c (&iPixRef[8 * 1], 1, 16, iAlpha, iBeta, iTc); | 232 | DeblockLumaLt4_c (&iPixRef[8 * 1], 1, 16, iAlpha, iBeta, iTc); |
| 235 | 233 | ||
| 236 | for (int i = 0; i < 16 * 16; i++) { | 234 | for (int i = 0; i < 16 * 16; i++) { |
| 237 | if (iPixBase[i] != iPixRef[i]) { | 235 | ASSERT_FALSE (iPixBase[i] != iPixRef[i]) << "Horizontal Error, (Pos, Base, Ref)-(" << i << "," << |
| 238 | bEqual = false; | 236 | (uint32_t)iPixBase[i] << "," << (uint32_t)iPixRef[i] << ")"; |
| 239 | break; | ||
| 240 | } | ||
| 241 | } | 237 | } |
| 242 | 238 | ||
| 243 | /* Vertical */ | 239 | /* Vertical */ |
| @@ -247,14 +243,10 @@ TEST (DeblockingCommon, DeblockLumaLt4_c) { · 3 unmodified lines | |||
| 247 | DeblockLumaLt4_c (&iPixRef[8 * 16], 16, 1, iAlpha, iBeta, iTc); | 243 | DeblockLumaLt4_c (&iPixRef[8 * 16], 16, 1, iAlpha, iBeta, iTc); |
| 248 | 244 | ||
| 249 | for (int i = 0; i < 16 * 16; i++) { | 245 | for (int i = 0; i < 16 * 16; i++) { |
| 250 | if (iPixBase[i] != iPixRef[i]) { | 246 | ASSERT_FALSE (iPixBase[i] != iPixRef[i]) << "Vertical Error, (Pos, Base, Ref)-(" << i << "," << |
| 251 | bEqual = false; | 247 | (uint32_t)iPixBase[i] << "," << (uint32_t)iPixRef[i] << ")"; |
| 252 | break; | ||
| 253 | } | ||
| 254 | } | 248 | } |
| 255 | } | 249 | } |
| 256 | |||
| 257 | EXPECT_TRUE (bEqual); | ||
| 258 | } | 250 | } |
| 259 | TEST (DeblockingCommon, DeblockLumaEq4_c) { | 251 | TEST (DeblockingCommon, DeblockLumaEq4_c) { |
| 260 | //void DeblockLumaEq4_c (uint8_t* pPix, int32_t iStrideX, int32_t iStrideY, int32_t iAlpha, int32_t iBeta) | 252 | //void DeblockLumaEq4_c (uint8_t* pPix, int32_t iStrideX, int32_t iStrideY, int32_t iAlpha, int32_t iBeta) |
| @@ -267,9 +259,7 @@ TEST (DeblockingCommon, DeblockLumaEq4_c) { · 6 unmodified lines | |||
| 267 | /* NOT used here */ | 259 | /* NOT used here */ |
| 268 | ENFORCE_STACK_ALIGN_1D (int8_t, iTc, 4, 16); | 260 | ENFORCE_STACK_ALIGN_1D (int8_t, iTc, 4, 16); |
| 269 | 261 | ||
| 270 | bool bEqual = true; | 262 | for (int iNum = 0; iNum < TEST_CYCLE; iNum++) { |
| 271 | |||
| 272 | for (int iNum = 0; bEqual && iNum < TEST_CYCLE; iNum++) { | ||
| 273 | /* Horizontal */ | 263 | /* Horizontal */ |
| 274 | GENERATE_DATA_DEBLOCKING (iPixBase, iPixRef, 16) | 264 | GENERATE_DATA_DEBLOCKING (iPixBase, iPixRef, 16) |
| 275 | 265 | ||
| @@ -277,10 +267,8 @@ TEST (DeblockingCommon, DeblockLumaEq4_c) { · 1 unmodified line | |||
| 277 | DeblockLumaEq4_c (&iPixRef[8 * 1], 1, 16, iAlpha, iBeta); | 267 | DeblockLumaEq4_c (&iPixRef[8 * 1], 1, 16, iAlpha, iBeta); |
| 278 | 268 | ||
| 279 | for (int i = 0; i < 16 * 16; i++) { | 269 | for (int i = 0; i < 16 * 16; i++) { |
| 280 | if (iPixBase[i] != iPixRef[i]) { | 270 | ASSERT_FALSE (iPixBase[i] != iPixRef[i]) << "Horizontal Error, (Pos, Base, Ref)-(" << i << "," << |
| 281 | bEqual = false; | 271 | (uint32_t)iPixBase[i] << "," << (uint32_t)iPixRef[i] << ")"; |
| 282 | break; | ||
| 283 | } | ||
| 284 | } | 272 | } |
| 285 | 273 | ||
| 286 | /* Vertical */ | 274 | /* Vertical */ |
| @@ -290,14 +278,10 @@ TEST (DeblockingCommon, DeblockLumaEq4_c) { · 3 unmodified lines | |||
| 290 | DeblockLumaEq4_c (&iPixRef[8 * 16], 16, 1, iAlpha, iBeta); | 278 | DeblockLumaEq4_c (&iPixRef[8 * 16], 16, 1, iAlpha, iBeta); |
| 291 | 279 | ||
| 292 | for (int i = 0; i < 16 * 16; i++) { | 280 | for (int i = 0; i < 16 * 16; i++) { |
| 293 | if (iPixBase[i] != iPixRef[i]) { | 281 | ASSERT_FALSE (iPixBase[i] != iPixRef[i]) << "Vertical Error, (Pos, Base, Ref)-(" << i << "," << |
| 294 | bEqual = false; | 282 | (uint32_t)iPixBase[i] << "," << (uint32_t)iPixRef[i] << ")"; |
| 295 | break; | ||
| 296 | } | ||
| 297 | } | 283 | } |
| 298 | } | 284 | } |
| 299 | |||
| 300 | EXPECT_TRUE (bEqual); | ||
| 301 | } | 285 | } |
| 302 | 286 | ||
| 303 | TEST (DeblockingCommon, DeblockChromaLt4_c) { | 287 | TEST (DeblockingCommon, DeblockChromaLt4_c) { |
| @@ -312,9 +296,7 @@ TEST (DeblockingCommon, DeblockChromaLt4_c) { · 8 unmodified lines | |||
| 312 | 296 | ||
| 313 | ENFORCE_STACK_ALIGN_1D (int8_t, iTc, 4, 16); | 297 | ENFORCE_STACK_ALIGN_1D (int8_t, iTc, 4, 16); |
| 314 | 298 | ||
| 315 | bool bEqual = true; | 299 | for (int iNum = 0; iNum < TEST_CYCLE; iNum++) { |
| 316 | |||
| 317 | for (int iNum = 0; bEqual && iNum < TEST_CYCLE; iNum++) { | ||
| 318 | /* Horizontal */ | 300 | /* Horizontal */ |
| 319 | GENERATE_DATA_DEBLOCKING (iPixCbBase, iPixCbRef, 8) | 301 | GENERATE_DATA_DEBLOCKING (iPixCbBase, iPixCbRef, 8) |
| 320 | GENERATE_DATA_DEBLOCKING (iPixCrBase, iPixCrRef, 8) | 302 | GENERATE_DATA_DEBLOCKING (iPixCrBase, iPixCrRef, 8) |
| @@ -323,10 +305,10 @@ TEST (DeblockingCommon, DeblockChromaLt4_c) { · 2 unmodified lines | |||
| 323 | DeblockChromaLt4_c (&iPixCbRef[4 * 1], &iPixCrRef[4 * 1], 1, 8, iAlpha, iBeta, iTc); | 305 | DeblockChromaLt4_c (&iPixCbRef[4 * 1], &iPixCrRef[4 * 1], 1, 8, iAlpha, iBeta, iTc); |
| 324 | 306 | ||
| 325 | for (int i = 0; i < 8 * 8; i++) { | 307 | for (int i = 0; i < 8 * 8; i++) { |
| 326 | if (iPixCbBase[i] != iPixCbRef[i] || iPixCrBase[i] != iPixCrRef[i]) { | 308 | ASSERT_FALSE (iPixCbBase[i] != iPixCbRef[i] |
| 327 | bEqual = false; | 309 | || iPixCrBase[i] != iPixCrRef[i]) << "Horizontal Error, (pos, CbBase, CbRef, CrBase, CrRef)-(" << i << "," << |
| 328 | break; | 310 | (uint32_t)iPixCbBase[i] << "," << (uint32_t)iPixCbRef[i] << "," << (uint32_t)iPixCrBase[i] << "," << |
| 329 | } | 311 | (uint32_t)iPixCrRef[i] << ")"; |
| 330 | } | 312 | } |
| 331 | 313 | ||
| 332 | /* Vertical */ | 314 | /* Vertical */ |
| @@ -337,14 +319,12 @@ TEST (DeblockingCommon, DeblockChromaLt4_c) { · 4 unmodified lines | |||
| 337 | DeblockChromaLt4_c (&iPixCbRef[4 * 8], &iPixCrRef[4 * 8], 8, 1, iAlpha, iBeta, iTc); | 319 | DeblockChromaLt4_c (&iPixCbRef[4 * 8], &iPixCrRef[4 * 8], 8, 1, iAlpha, iBeta, iTc); |
| 338 | 320 | ||
| 339 | for (int i = 0; i < 8 * 8; i++) { | 321 | for (int i = 0; i < 8 * 8; i++) { |
| 340 | if (iPixCbBase[i] != iPixCbRef[i] || iPixCrBase[i] != iPixCrRef[i]) { | 322 | ASSERT_FALSE (iPixCbBase[i] != iPixCbRef[i] |
| 341 | bEqual = false; | 323 | || iPixCrBase[i] != iPixCrRef[i]) << "Vertical Error, (pos, CbBase, CbRef, CrBase, CrRef)-(" << i << "," << |
| 342 | break; | 324 | (uint32_t)iPixCbBase[i] << "," << (uint32_t)iPixCbRef[i] << "," << (uint32_t)iPixCrBase[i] << "," << |
| 343 | } | 325 | (uint32_t)iPixCrRef[i] << ")"; |
| 344 | } | 326 | } |
| 345 | } | 327 | } |
| 346 | |||
| 347 | EXPECT_TRUE (bEqual); | ||
| 348 | } | 328 | } |
| 349 | 329 | ||
| 350 | TEST (DeblockingCommon, DeblockChromaEq4_c) { | 330 | TEST (DeblockingCommon, DeblockChromaEq4_c) { |
| @@ -360,9 +340,7 @@ TEST (DeblockingCommon, DeblockChromaEq4_c) { · 9 unmodified lines | |||
| 360 | /* NOT used here*/ | 340 | /* NOT used here*/ |
| 361 | ENFORCE_STACK_ALIGN_1D (int8_t, iTc, 4, 16); | 341 | ENFORCE_STACK_ALIGN_1D (int8_t, iTc, 4, 16); |
| 362 | 342 | ||
| 363 | bool bEqual = true; | 343 | for (int iNum = 0; iNum < TEST_CYCLE; iNum++) { |
| 364 | |||
| 365 | for (int iNum = 0; bEqual && iNum < TEST_CYCLE; iNum++) { | ||
| 366 | /* Horizontal */ | 344 | /* Horizontal */ |
| 367 | GENERATE_DATA_DEBLOCKING (iPixCbBase, iPixCbRef, 8) | 345 | GENERATE_DATA_DEBLOCKING (iPixCbBase, iPixCbRef, 8) |
| 368 | GENERATE_DATA_DEBLOCKING (iPixCrBase, iPixCrRef, 8) | 346 | GENERATE_DATA_DEBLOCKING (iPixCrBase, iPixCrRef, 8) |
| @@ -371,10 +349,10 @@ TEST (DeblockingCommon, DeblockChromaEq4_c) { · 2 unmodified lines | |||
| 371 | DeblockChromaEq4_c (&iPixCbRef[4 * 1], &iPixCrRef[4 * 1], 1, 8, iAlpha, iBeta); | 349 | DeblockChromaEq4_c (&iPixCbRef[4 * 1], &iPixCrRef[4 * 1], 1, 8, iAlpha, iBeta); |
| 372 | 350 | ||
| 373 | for (int i = 0; i < 8 * 8; i++) { | 351 | for (int i = 0; i < 8 * 8; i++) { |
| 374 | if (iPixCbBase[i] != iPixCbRef[i] || iPixCrBase[i] != iPixCrRef[i]) { | 352 | ASSERT_FALSE (iPixCbBase[i] != iPixCbRef[i] |
| 375 | bEqual = false; | 353 | || iPixCrBase[i] != iPixCrRef[i]) << "Horizontal Error, (pos, CbBase, CbRef, CrBase, CrRef)-(" << i << "," << |
| 376 | break; | 354 | (uint32_t)iPixCbBase[i] << "," << (uint32_t)iPixCbRef[i] << "," << (uint32_t)iPixCrBase[i] << "," << |
| 377 | } | 355 | (uint32_t)iPixCrRef[i] << ")"; |
| 378 | } | 356 | } |
| 379 | 357 | ||
| 380 | /* Vertical */ | 358 | /* Vertical */ |
| @@ -385,12 +363,10 @@ TEST (DeblockingCommon, DeblockChromaEq4_c) { · 4 unmodified lines | |||
| 385 | DeblockChromaEq4_c (&iPixCbRef[4 * 8], &iPixCrRef[4 * 8], 8, 1, iAlpha, iBeta); | 363 | DeblockChromaEq4_c (&iPixCbRef[4 * 8], &iPixCrRef[4 * 8], 8, 1, iAlpha, iBeta); |
| 386 | 364 | ||
| 387 | for (int i = 0; i < 8 * 8; i++) { | 365 | for (int i = 0; i < 8 * 8; i++) { |
| 388 | if (iPixCbBase[i] != iPixCbRef[i] || iPixCrBase[i] != iPixCrRef[i]) { | 366 | ASSERT_FALSE (iPixCbBase[i] != iPixCbRef[i] |
| 389 | bEqual = false; | 367 | || iPixCrBase[i] != iPixCrRef[i]) << "Vertical Error, (pos, CbBase, CbRef, CrBase, CrRef)-(" << i << "," << |
| 390 | break; | 368 | (uint32_t)iPixCbBase[i] << "," << (uint32_t)iPixCbRef[i] << "," << (uint32_t)iPixCrBase[i] << "," << |
| 391 | } | 369 | (uint32_t)iPixCrRef[i] << ")"; |
| 392 | } | 370 | } |
| 393 | } | 371 | } |
| 394 | |||
| 395 | EXPECT_TRUE (bEqual); | ||
| 396 | } | 372 | } |