Skip to content

Commit

Permalink
Merge pull request #491 from atsampson/nroptions
Browse files Browse the repository at this point in the history
Add options for NTSC noise reduction levels
  • Loading branch information
happycube committed Jun 1, 2020
2 parents fd9f66f + d14602c commit d0474eb
Showing 1 changed file with 32 additions and 0 deletions.
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

0 comments on commit d0474eb

Please sign in to comment.