| 517 | } |
| 518 | |
| 519 | void decoderHM::fillStatisticList(stats::StatisticsData &statisticsData) const |
| 520 | { |
| 521 | using namespace stats::color; |
| 522 | |
| 523 | // Ask the decoder how many internals types there are |
| 524 | unsigned int nrTypes = this->lib.libHMDEC_get_internal_type_number(); |
| 525 | |
| 526 | for (unsigned int i = 0; i < nrTypes; i++) |
| 527 | { |
| 528 | auto name = QString(this->lib.libHMDEC_get_internal_type_name(i)); |
| 529 | auto description = QString(this->lib.libHMDEC_get_internal_type_description(i)); |
| 530 | auto statType = this->lib.libHMDEC_get_internal_type(i); |
| 531 | int max = 0; |
| 532 | if (statType == LIBHMDEC_TYPE_RANGE || statType == LIBHMDEC_TYPE_RANGE_ZEROCENTER) |
| 533 | { |
| 534 | unsigned int uMax = this->lib.libHMDEC_get_internal_type_max(i); |
| 535 | max = (uMax > INT_MAX) ? INT_MAX : uMax; |
| 536 | } |
| 537 | |
| 538 | if (statType == LIBHMDEC_TYPE_FLAG) |
| 539 | { |
| 540 | stats::StatisticsType flag(i, name, ColorMapper({0, 1}, PredefinedType::Jet)); |
| 541 | flag.description = description; |
| 542 | statisticsData.addStatType(flag); |
| 543 | } |
| 544 | else if (statType == LIBHMDEC_TYPE_RANGE) |
| 545 | { |
| 546 | stats::StatisticsType range(i, name, ColorMapper({0, max}, PredefinedType::Jet)); |
| 547 | range.description = description; |
| 548 | statisticsData.addStatType(range); |
| 549 | } |
| 550 | else if (statType == LIBHMDEC_TYPE_RANGE_ZEROCENTER) |
| 551 | { |
| 552 | stats::StatisticsType rangeZero(i, name, ColorMapper({-max, max}, PredefinedType::Col3_bblg)); |
| 553 | rangeZero.description = description; |
| 554 | statisticsData.addStatType(rangeZero); |
| 555 | } |
| 556 | else if (statType == LIBHMDEC_TYPE_VECTOR) |
| 557 | { |
| 558 | auto scale = this->lib.libHMDEC_get_internal_type_vector_scaling(i); |
| 559 | stats::StatisticsType vec(i, name, scale); |
| 560 | vec.description = description; |
| 561 | statisticsData.addStatType(vec); |
| 562 | } |
| 563 | else if (statType == LIBHMDEC_TYPE_INTRA_DIR) |
| 564 | { |
| 565 | stats::StatisticsType intraDir(i, name, ColorMapper({0, 34}, PredefinedType::Jet)); |
| 566 | intraDir.description = description; |
| 567 | intraDir.hasVectorData = true; |
| 568 | intraDir.renderVectorData = true; |
| 569 | intraDir.vectorScale = 32; |
| 570 | // Don't draw the vector values for the intra dir. They don't have actual meaning. |
| 571 | intraDir.renderVectorDataValues = false; |
| 572 | intraDir.setMappingValues( |
| 573 | {"INTRA_PLANAR", "INTRA_DC", "INTRA_ANGULAR_2", "INTRA_ANGULAR_3", |
| 574 | "INTRA_ANGULAR_4", "INTRA_ANGULAR_5", "INTRA_ANGULAR_6", "INTRA_ANGULAR_7", |
| 575 | "INTRA_ANGULAR_8", "INTRA_ANGULAR_9", "INTRA_ANGULAR_10", "INTRA_ANGULAR_11", |
| 576 | "INTRA_ANGULAR_12", "INTRA_ANGULAR_13", "INTRA_ANGULAR_14", "INTRA_ANGULAR_15", |
nothing calls this directly
no test coverage detected