| 455 | } |
| 456 | |
| 457 | void decoderVTM::cacheStatistics(libVTMDec_picture *) |
| 458 | { |
| 459 | if (!internalsSupported) |
| 460 | return; |
| 461 | |
| 462 | DEBUG_DECVTM("decoderVTM::cacheStatistics ..."); |
| 463 | |
| 464 | // // Conversion from intra prediction mode to vector. |
| 465 | // // Coordinates are in x,y with the axes going right and down. |
| 466 | // static const int vectorTable[35][2] = |
| 467 | // { |
| 468 | // {0,0}, {0,0}, |
| 469 | // {32, -32}, |
| 470 | // {32, -26}, {32, -21}, {32, -17}, { 32, -13}, { 32, -9}, { 32, -5}, { 32, -2}, |
| 471 | // {32, 0}, |
| 472 | // {32, 2}, {32, 5}, {32, 9}, { 32, 13}, { 32, 17}, { 32, 21}, { 32, 26}, |
| 473 | // {32, 32}, |
| 474 | // {26, 32}, {21, 32}, {17, 32}, { 13, 32}, { 9, 32}, { 5, 32}, { 2, 32}, |
| 475 | // {0, 32}, |
| 476 | // {-2, 32}, {-5, 32}, {-9, 32}, {-13, 32}, {-17, 32}, {-21, 32}, {-26, 32}, |
| 477 | // {-32, 32} |
| 478 | // }; |
| 479 | |
| 480 | //// Get all the statistics |
| 481 | //// TODO: Could we only retrieve the statistics that are active/displayed? |
| 482 | // unsigned int nrTypes = libVTMDec_get_internal_type_number(); |
| 483 | // for (unsigned int t = 0; t <= nrTypes; t++) |
| 484 | //{ |
| 485 | // bool callAgain; |
| 486 | // do |
| 487 | // { |
| 488 | // // Get a pointer to the data values and how many values in this array are valid. |
| 489 | // unsigned int nrValues; |
| 490 | // libVTMDec_BlockValue *stats = libVTMDec_get_internal_info(decoder, img, t, nrValues, |
| 491 | // callAgain); |
| 492 | |
| 493 | // libVTMDec_InternalsType statType = libVTMDec_get_internal_type(t); |
| 494 | // if (stats != nullptr && nrValues > 0) |
| 495 | // { |
| 496 | // for (unsigned int i = 0; i < nrValues; i++) |
| 497 | // { |
| 498 | // libVTMDec_BlockValue b = stats[i]; |
| 499 | |
| 500 | // if (statType == libVTMDec_TYPE_VECTOR) |
| 501 | // curPOCStats[t].addBlockVector(b.x, b.y, b.w, b.h, b.value, b.value2); |
| 502 | // else |
| 503 | // curPOCStats[t].addBlockValue(b.x, b.y, b.w, b.h, b.value); |
| 504 | // if (statType == libVTMDec_TYPE_INTRA_DIR) |
| 505 | // { |
| 506 | // // Also add the vecotr to draw |
| 507 | // if (b.value >= 0 && b.value < 35) |
| 508 | // { |
| 509 | // int vecX = (float)vectorTable[b.value][0] * b.w / 4; |
| 510 | // int vecY = (float)vectorTable[b.value][1] * b.w / 4; |
| 511 | // curPOCStats[t].addBlockVector(b.x, b.y, b.w, b.h, vecX, vecY); |
| 512 | // } |
| 513 | // } |
| 514 | // } |