Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add options for NTSC noise reduction levels #491

Merged
merged 1 commit into from
Jun 1, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions tools/ld-chroma-decoder/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,18 @@ int main(int argc, char *argv[])
QCoreApplication::translate("main", "NTSC: Use 75% white-point (default 100%)"));
parser.addOption(whitePointOption);

// Option to set the chroma noise reduction level
QCommandLineOption chromaNROption(QStringList() << "chroma-nr",
QCoreApplication::translate("main", "NTSC: Chroma noise reduction level in dB (default 0.0)"),
QCoreApplication::translate("main", "number"));
parser.addOption(chromaNROption);

// Option to set the luma noise reduction level
QCommandLineOption lumaNROption(QStringList() << "luma-nr",
QCoreApplication::translate("main", "NTSC: Luma noise reduction level in dB (default 1.0)"),
QCoreApplication::translate("main", "number"));
parser.addOption(lumaNROption);

// -- PAL decoder options --

// Option to use Simple PAL UV filter
Expand Down Expand Up @@ -313,6 +325,26 @@ int main(int argc, char *argv[])
combConfig.showOpticalFlowMap = true;
}

if (parser.isSet(chromaNROption)) {
combConfig.cNRLevel = parser.value(chromaNROption).toDouble();

if (combConfig.cNRLevel < 0.0) {
// Quit with error
qCritical("Chroma noise reduction cannot be negative");
return -1;
}
}

if (parser.isSet(lumaNROption)) {
combConfig.yNRLevel = parser.value(lumaNROption).toDouble();

if (combConfig.yNRLevel < 0.0) {
// Quit with error
qCritical("Luma noise reduction cannot be negative");
return -1;
}
}

if (parser.isSet(transformModeOption)) {
const QString name = parser.value(transformModeOption);

Expand Down