Remove Force BT.601 option and update color matrix guessing

This commit is contained in:
Ryan Lucia 2018-03-25 09:30:29 -04:00 committed by wangqr
parent fff08c4650
commit 38bb1790ab
7 changed files with 8 additions and 15 deletions

View file

@ -594,7 +594,6 @@
},
"Pattern" : false
},
"Force BT.601" : true,
"Last Script Resolution Mismatch Choice" : 2,
"Open Audio" : true,
"Overscan Mask" : false,

View file

@ -590,7 +590,6 @@
},
"Pattern" : false
},
"Force BT.601" : true,
"Last Script Resolution Mismatch Choice" : 2,
"Open Audio" : true,
"Overscan Mask" : false,

View file

@ -421,9 +421,6 @@ void Advanced_Video(wxTreebook *book, Preferences *parent) {
wxArrayString sp_choice = to_wx(SubtitlesProviderFactory::GetClasses());
p->OptionChoice(expert, _("Subtitles provider"), sp_choice, "Subtitle/Provider");
p->CellSkip(expert);
p->OptionAdd(expert, _("Force BT.601"), "Video/Force BT.601");
#ifdef WITH_AVISYNTH
auto avisynth = p->PageSizer("Avisynth");
p->OptionAdd(avisynth, _("Allow pre-2.56a Avisynth"), "Provider/Avisynth/Allow Ancient");

View file

@ -58,7 +58,6 @@ Project::Project(agi::Context *c) : context(c) {
OPT_SUB("Provider/Video/FFmpegSource/Decoding Threads", &Project::ReloadVideo, this);
OPT_SUB("Provider/Video/FFmpegSource/Unsafe Seeking", &Project::ReloadVideo, this);
OPT_SUB("Subtitle/Provider", &Project::ReloadVideo, this);
OPT_SUB("Video/Force BT.601", &Project::ReloadVideo, this);
OPT_SUB("Video/Provider", &Project::ReloadVideo, this);
}

View file

@ -48,7 +48,7 @@ static const std::string names[] = {
};
YCbCrMatrix MatrixFromString(std::string const& str) {
if (str.empty()) return YCbCrMatrix::tv_601;
if (str.empty()) return YCbCrMatrix::tv_709;
auto pos = std::find(std::begin(names), std::end(names), str);
if (pos == std::end(names))
return YCbCrMatrix::rgb;

View file

@ -191,17 +191,16 @@ void AvisynthVideoProvider::Init(std::string const& colormatrix) {
real_colorspace = colorspace = "None";
else {
/// @todo maybe read ColorMatrix hints for d2v files?
AVSValue args[2] = { script, "Rec601" };
bool force_bt601 = OPT_GET("Video/Force BT.601")->GetBool() || colormatrix == "TV.601";
AVSValue args[2] = { script, "Rec709" };
bool bt709 = vi.width > 1024 || vi.height >= 600;
if (bt709 && (!force_bt601 || colormatrix == "TV.709")) {
args[1] = "Rec709";
real_colorspace = colorspace = "TV.709";
if (colormatrix == "TV.601") {
args[1] = "Rec601";
colorspace = "TV.601";
}
else {
colorspace = "TV.601";
real_colorspace = bt709 ? "TV.709" : "TV.601";
colorspace = "TV.709";
}
real_colorspace = bt709 ? "TV.709" : "TV.601";
const char *argnames[2] = { 0, "matrix" };
script = avs.GetEnv()->Invoke("ConvertToRGB32", AVSValue(args, 2), argnames);
}

View file

@ -262,7 +262,7 @@ void FFmpegSourceVideoProvider::LoadVideo(agi::fs::path const& filename, std::st
RealColorSpace = ColorSpace = colormatrix_description(CS, CR);
#if FFMS_VERSION >= ((2 << 24) | (17 << 16) | (1 << 8) | 0)
if (CS != AGI_CS_RGB && CS != AGI_CS_BT470BG && ColorSpace != colormatrix && (colormatrix == "TV.601" || OPT_GET("Video/Force BT.601")->GetBool())) {
if (CS != AGI_CS_RGB && CS != AGI_CS_BT470BG && ColorSpace != colormatrix && colormatrix == "TV.601") {
CS = AGI_CS_BT470BG;
ColorSpace = colormatrix_description(AGI_CS_BT470BG, CR);
}