| 1353 | ntc::CompressionStats stats; |
| 1354 | do |
| 1355 | { |
| 1356 | ntcStatus = textureSet->RunCompressionSteps(&stats); |
| 1357 | if (ntcStatus == ntc::Status::Incomplete || ntcStatus == ntc::Status::Ok) |
| 1358 | { |
| 1359 | printf("Training: %d steps, %.4f ms/step, intermediate PSNR: %.2f dB\r", stats.currentStep, |
| 1360 | stats.millisecondsPerStep, ntc::LossToPSNR(stats.loss)); |
| 1361 | fflush(stdout); |
| 1362 | } |
| 1363 | } while (ntcStatus == ntc::Status::Incomplete); |
| 1364 | CHECK_NTC_RESULT(RunCompressionSteps); |
| 1365 | printf("\n"); |
| 1366 | |
| 1367 | ntcStatus = textureSet->FinalizeCompression(); |
| 1368 | CHECK_NTC_RESULT(FinalizeCompression); |
| 1369 | |
| 1370 | if (outFinalPsnr) |
| 1371 | *outFinalPsnr = ntc::LossToPSNR(stats.loss); |
| 1372 | |
| 1373 | return true; |
| 1374 | } |
| 1375 | |
| 1376 | struct AdaptiveSearchResult |
| 1377 | { |
| 1378 | std::vector<uint8_t> compressedData; |
| 1379 | ntc::LatentShape latentShape; |
| 1380 | float bitsPerPixel = 0.f; |
| 1381 | float psnr = 0.f; |
| 1382 | }; |
| 1383 | |
| 1384 | bool CompressTextureSetWithTargetPSNR(ntc::IContext* context, ntc::ITextureSet* textureSet) |
no test coverage detected