| 5071 | } |
| 5072 | |
| 5073 | static void logNr2WisdomSummary(const QString& context) |
| 5074 | { |
| 5075 | #ifndef HAVE_FFTW3 |
| 5076 | QStringList lines; |
| 5077 | lines << QStringLiteral("Audio NR2 wisdom summary:") |
| 5078 | << QStringLiteral(" context=%1 status=unavailable action=runtime-plans reason=\"built without FFTW3\"") |
| 5079 | .arg(context); |
| 5080 | qCInfo(lcAudioSummary).noquote() << lines.join(QLatin1Char('\n')); |
| 5081 | #else |
| 5082 | const QString directory = wisdomDir(); |
| 5083 | const QString path = directory + "aethersdr_fftw_wisdom"; |
| 5084 | const QFileInfo info(path); |
| 5085 | |
| 5086 | QString status; |
| 5087 | QString action; |
| 5088 | bool warn = false; |
| 5089 | |
| 5090 | if (!info.exists()) { |
| 5091 | status = QStringLiteral("missing"); |
| 5092 | action = QStringLiteral("train-on-first-enable"); |
| 5093 | } else if (!info.isFile()) { |
| 5094 | status = QStringLiteral("invalid"); |
| 5095 | action = QStringLiteral("discard-and-regenerate-on-first-enable"); |
| 5096 | warn = true; |
| 5097 | } else if (SpectralNR::loadWisdom(directory.toStdString())) { |
| 5098 | status = QStringLiteral("valid"); |
| 5099 | action = QStringLiteral("use-cached-wisdom"); |
| 5100 | } else { |
| 5101 | status = QStringLiteral("invalid-or-stale"); |
| 5102 | action = QStringLiteral("discard-and-regenerate-on-first-enable"); |
| 5103 | warn = true; |
| 5104 | } |
| 5105 | |
| 5106 | QStringList lines; |
| 5107 | lines << QStringLiteral("Audio NR2 wisdom summary:") |
| 5108 | << QStringLiteral(" context=%1 status=%2 action=%3") |
| 5109 | .arg(context, status, action) |
| 5110 | << QStringLiteral(" %1").arg(wisdomFileDetailText(info)); |
| 5111 | |
| 5112 | const QString summary = lines.join(QLatin1Char('\n')); |
| 5113 | if (warn) { |
| 5114 | qCWarning(lcAudioSummary).noquote() << summary; |
| 5115 | qCWarning(lcAudio).noquote() |
| 5116 | << QStringLiteral("AudioEngine: NR2 FFTW wisdom %1; %2 %3") |
| 5117 | .arg(status, action, wisdomFileDetailText(info)); |
| 5118 | } else { |
| 5119 | qCInfo(lcAudioSummary).noquote() << summary; |
| 5120 | } |
| 5121 | #endif |
| 5122 | } |
| 5123 | |
| 5124 | static void logNr2WisdomGenerationSummary(SpectralNR::WisdomResult result) |
| 5125 | { |
no test coverage detected