| 627 | } |
| 628 | |
| 629 | bool PickLatentShape(ntc::LatentShape& outShape) |
| 630 | { |
| 631 | if (!std::isnan(g_options.targetPsnr) || g_options.matchBcPsnr) |
| 632 | { |
| 633 | // When doing adaptive compression, start with an empty latent space because the first configuration |
| 634 | // will be given by the adaptive compression session. |
| 635 | outShape = ntc::LatentShape::Empty(); |
| 636 | } |
| 637 | else if (!std::isnan(g_options.bitsPerPixel)) |
| 638 | { |
| 639 | float selectedBpp = 0.f; |
| 640 | if (ntc::PickLatentShape(g_options.bitsPerPixel, selectedBpp, outShape) != ntc::Status::Ok) |
| 641 | { |
| 642 | fprintf(stderr, "Cannot select a latent shape for %.3f bpp.\n", g_options.bitsPerPixel); |
| 643 | return false; |
| 644 | } |
| 645 | |
| 646 | printf("Selected latent shape for %.3f bpp: --gridSizeScale %d --numFeatures %d\n", |
| 647 | selectedBpp, outShape.gridSizeScale, outShape.numFeatures); |
| 648 | } |
| 649 | else |
| 650 | { |
| 651 | outShape.gridSizeScale = g_options.gridSizeScale; |
| 652 | outShape.numFeatures = g_options.numFeatures; |
| 653 | } |
| 654 | return true; |
| 655 | } |
| 656 | |
| 657 | void OverrideTextureBcFormat(ntc::ITextureMetadata* texture, ManifestEntry* manifestEntry) |
| 658 | { |
no outgoing calls
no test coverage detected