| 528 | } |
| 529 | |
| 530 | void decoderLibde265::cacheStatistics(const de265_image *img) |
| 531 | { |
| 532 | if (!this->internalsSupported) |
| 533 | return; |
| 534 | |
| 535 | DEBUG_LIBDE265("decoderLibde265::cacheStatistics"); |
| 536 | |
| 537 | /// --- CTB internals/statistics |
| 538 | int widthInCTB, heightInCTB, log2CTBSize; |
| 539 | this->lib.de265_internals_get_CTB_Info_Layout(img, &widthInCTB, &heightInCTB, &log2CTBSize); |
| 540 | int ctb_size = 1 << log2CTBSize; // width and height of each CTB |
| 541 | |
| 542 | // Save Slice index |
| 543 | { |
| 544 | QScopedArrayPointer<uint16_t> tmpArr(new uint16_t[widthInCTB * heightInCTB]); |
| 545 | this->lib.de265_internals_get_CTB_sliceIdx(img, tmpArr.data()); |
| 546 | for (int y = 0; y < heightInCTB; y++) |
| 547 | for (int x = 0; x < widthInCTB; x++) |
| 548 | { |
| 549 | uint16_t val = tmpArr[y * widthInCTB + x]; |
| 550 | this->statisticsData->at(0).addBlockValue( |
| 551 | x * ctb_size, y * ctb_size, ctb_size, ctb_size, (int)val); |
| 552 | } |
| 553 | } |
| 554 | |
| 555 | /// --- CB internals/statistics (part Size, prediction mode, PCM flag, CU trans_quant_bypass_flag) |
| 556 | |
| 557 | // TODO: How do we get the POC in here? / Should the decoder not be able to tell us the POC? |
| 558 | const int iPOC = 0; |
| 559 | |
| 560 | // Get CB info array layout from image |
| 561 | int widthInCB, heightInCB, log2CBInfoUnitSize; |
| 562 | this->lib.de265_internals_get_CB_Info_Layout(img, &widthInCB, &heightInCB, &log2CBInfoUnitSize); |
| 563 | int cb_infoUnit_size = 1 << log2CBInfoUnitSize; |
| 564 | // Get CB info from image |
| 565 | QScopedArrayPointer<uint16_t> cbInfoArr(new uint16_t[widthInCB * heightInCB]); |
| 566 | this->lib.de265_internals_get_CB_info(img, cbInfoArr.data()); |
| 567 | |
| 568 | // Get PB array layout from image |
| 569 | int widthInPB, heightInPB, log2PBInfoUnitSize; |
| 570 | this->lib.de265_internals_get_PB_Info_layout(img, &widthInPB, &heightInPB, &log2PBInfoUnitSize); |
| 571 | int pb_infoUnit_size = 1 << log2PBInfoUnitSize; |
| 572 | |
| 573 | // Get PB info from image |
| 574 | QScopedArrayPointer<int16_t> refPOC0(new int16_t[widthInPB * heightInPB]); |
| 575 | QScopedArrayPointer<int16_t> refPOC1(new int16_t[widthInPB * heightInPB]); |
| 576 | QScopedArrayPointer<int16_t> vec0_x(new int16_t[widthInPB * heightInPB]); |
| 577 | QScopedArrayPointer<int16_t> vec0_y(new int16_t[widthInPB * heightInPB]); |
| 578 | QScopedArrayPointer<int16_t> vec1_x(new int16_t[widthInPB * heightInPB]); |
| 579 | QScopedArrayPointer<int16_t> vec1_y(new int16_t[widthInPB * heightInPB]); |
| 580 | this->lib.de265_internals_get_PB_info(img, |
| 581 | refPOC0.data(), |
| 582 | refPOC1.data(), |
| 583 | vec0_x.data(), |
| 584 | vec0_y.data(), |
| 585 | vec1_x.data(), |
| 586 | vec1_y.data()); |
| 587 |
no test coverage detected