diff --git a/README.md b/README.md index 8734ef7..0f11379 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ Run uninstall.bat to unregister the filters and clean up user data. ### Common -By default, 10-bit and 16-bit input formats are not enabled for compatibility reasons. If you have a 10/16-bit capable video renderer installed, you can enable them by ticking the relevant checkboxes in the filter's settings page. On the other hand, if you don't have a said video renderer installed while enabling these input formats, you might experience compatibility issue and reduced video qualities. +By default, 10-bit and 16-bit input formats are enabled for best video quality. However, not all video renderers are capable of processing these data. If you do not have such a video renderer installed, leaving these options on might cause compatibility issues. In that case, you should open the settings page of the filter and untick the relevant checkboxes. Examples of 10/16-bit capable video renderers: [madVR](http://madvr.com/), [MPC Video Renderer](https://github.com/Aleksoid1978/VideoRenderer). diff --git a/avisynth_filter/src/format.cpp b/avisynth_filter/src/format.cpp index 8eaa56c..17edf1c 100644 --- a/avisynth_filter/src/format.cpp +++ b/avisynth_filter/src/format.cpp @@ -11,30 +11,30 @@ namespace SynthFilter { // for each group of formats with the same format ID, they should appear with the most preferred -> list preferred order const std::vector Format::PIXEL_FORMATS = { // 4:2:0 - { .name = L"NV12", .mediaSubtype = MEDIASUBTYPE_NV12, .fsFormatId = VideoInfo::CS_YV12, .bitCount = 12, .componentsPerPixel = 1, .subsampleWidthRatio = 2, .subsampleHeightRatio = 2, .areUVPlanesInterleaved = true, .resourceId = IDC_INPUT_FORMAT_NV12, .enabledByDefault = true }, - { .name = L"YV12", .mediaSubtype = MEDIASUBTYPE_YV12, .fsFormatId = VideoInfo::CS_YV12, .bitCount = 12, .componentsPerPixel = 1, .subsampleWidthRatio = 2, .subsampleHeightRatio = 2, .areUVPlanesInterleaved = false, .resourceId = IDC_INPUT_FORMAT_YV12, .enabledByDefault = true }, - { .name = L"I420", .mediaSubtype = MEDIASUBTYPE_I420, .fsFormatId = VideoInfo::CS_YV12, .bitCount = 12, .componentsPerPixel = 1, .subsampleWidthRatio = 2, .subsampleHeightRatio = 2, .areUVPlanesInterleaved = false, .resourceId = IDC_INPUT_FORMAT_I420, .enabledByDefault = true }, - { .name = L"IYUV", .mediaSubtype = MEDIASUBTYPE_IYUV, .fsFormatId = VideoInfo::CS_YV12, .bitCount = 12, .componentsPerPixel = 1, .subsampleWidthRatio = 2, .subsampleHeightRatio = 2, .areUVPlanesInterleaved = false, .resourceId = IDC_INPUT_FORMAT_IYUV, .enabledByDefault = true }, + { .name = L"NV12", .mediaSubtype = MEDIASUBTYPE_NV12, .fsFormatId = VideoInfo::CS_YV12, .bitCount = 12, .componentsPerPixel = 1, .subsampleWidthRatio = 2, .subsampleHeightRatio = 2, .areUVPlanesInterleaved = true, .resourceId = IDC_INPUT_FORMAT_NV12 }, + { .name = L"YV12", .mediaSubtype = MEDIASUBTYPE_YV12, .fsFormatId = VideoInfo::CS_YV12, .bitCount = 12, .componentsPerPixel = 1, .subsampleWidthRatio = 2, .subsampleHeightRatio = 2, .areUVPlanesInterleaved = false, .resourceId = IDC_INPUT_FORMAT_YV12 }, + { .name = L"I420", .mediaSubtype = MEDIASUBTYPE_I420, .fsFormatId = VideoInfo::CS_YV12, .bitCount = 12, .componentsPerPixel = 1, .subsampleWidthRatio = 2, .subsampleHeightRatio = 2, .areUVPlanesInterleaved = false, .resourceId = IDC_INPUT_FORMAT_I420 }, + { .name = L"IYUV", .mediaSubtype = MEDIASUBTYPE_IYUV, .fsFormatId = VideoInfo::CS_YV12, .bitCount = 12, .componentsPerPixel = 1, .subsampleWidthRatio = 2, .subsampleHeightRatio = 2, .areUVPlanesInterleaved = false, .resourceId = IDC_INPUT_FORMAT_IYUV }, // P010 has the most significant 6 bits zero-padded, while AviSynth expects the least significant bits padded // P010 without right shifting 6 bits on every WORD is equivalent to P016, without precision loss - { .name = L"P016", .mediaSubtype = MEDIASUBTYPE_P016, .fsFormatId = VideoInfo::CS_YUV420P16, .bitCount = 24, .componentsPerPixel = 1, .subsampleWidthRatio = 2, .subsampleHeightRatio = 2, .areUVPlanesInterleaved = true, .resourceId = IDC_INPUT_FORMAT_P016, .enabledByDefault = false }, - { .name = L"P010", .mediaSubtype = MEDIASUBTYPE_P010, .fsFormatId = VideoInfo::CS_YUV420P16, .bitCount = 24, .componentsPerPixel = 1, .subsampleWidthRatio = 2, .subsampleHeightRatio = 2, .areUVPlanesInterleaved = true, .resourceId = IDC_INPUT_FORMAT_P010, .enabledByDefault = false }, + { .name = L"P016", .mediaSubtype = MEDIASUBTYPE_P016, .fsFormatId = VideoInfo::CS_YUV420P16, .bitCount = 24, .componentsPerPixel = 1, .subsampleWidthRatio = 2, .subsampleHeightRatio = 2, .areUVPlanesInterleaved = true, .resourceId = IDC_INPUT_FORMAT_P016 }, + { .name = L"P010", .mediaSubtype = MEDIASUBTYPE_P010, .fsFormatId = VideoInfo::CS_YUV420P16, .bitCount = 24, .componentsPerPixel = 1, .subsampleWidthRatio = 2, .subsampleHeightRatio = 2, .areUVPlanesInterleaved = true, .resourceId = IDC_INPUT_FORMAT_P010 }, // 4:2:2 // YUY2 interleaves Y and UV planes together, thus twice as wide as unpacked formats per pixel - { .name = L"YUY2", .mediaSubtype = MEDIASUBTYPE_YUY2, .fsFormatId = VideoInfo::CS_YUY2, .bitCount = 16, .componentsPerPixel = 2, .subsampleWidthRatio = 0, .subsampleHeightRatio = 0, .areUVPlanesInterleaved = false, .resourceId = IDC_INPUT_FORMAT_YUY2, .enabledByDefault = true }, + { .name = L"YUY2", .mediaSubtype = MEDIASUBTYPE_YUY2, .fsFormatId = VideoInfo::CS_YUY2, .bitCount = 16, .componentsPerPixel = 2, .subsampleWidthRatio = 0, .subsampleHeightRatio = 0, .areUVPlanesInterleaved = false, .resourceId = IDC_INPUT_FORMAT_YUY2 }, // AviSynth+ does not support UYVY // P210 has the same problem as P010 - { .name = L"P216", .mediaSubtype = MEDIASUBTYPE_P216, .fsFormatId = VideoInfo::CS_YUV422P16, .bitCount = 32, .componentsPerPixel = 1, .subsampleWidthRatio = 2, .subsampleHeightRatio = 1, .areUVPlanesInterleaved = true, .resourceId = IDC_INPUT_FORMAT_P216, .enabledByDefault = false }, - { .name = L"P210", .mediaSubtype = MEDIASUBTYPE_P210, .fsFormatId = VideoInfo::CS_YUV422P16, .bitCount = 32, .componentsPerPixel = 1, .subsampleWidthRatio = 2, .subsampleHeightRatio = 1, .areUVPlanesInterleaved = true, .resourceId = IDC_INPUT_FORMAT_P210, .enabledByDefault = false }, + { .name = L"P216", .mediaSubtype = MEDIASUBTYPE_P216, .fsFormatId = VideoInfo::CS_YUV422P16, .bitCount = 32, .componentsPerPixel = 1, .subsampleWidthRatio = 2, .subsampleHeightRatio = 1, .areUVPlanesInterleaved = true, .resourceId = IDC_INPUT_FORMAT_P216 }, + { .name = L"P210", .mediaSubtype = MEDIASUBTYPE_P210, .fsFormatId = VideoInfo::CS_YUV422P16, .bitCount = 32, .componentsPerPixel = 1, .subsampleWidthRatio = 2, .subsampleHeightRatio = 1, .areUVPlanesInterleaved = true, .resourceId = IDC_INPUT_FORMAT_P210 }, // 4:4:4 - { .name = L"YV24", .mediaSubtype = MEDIASUBTYPE_YV24, .fsFormatId = VideoInfo::CS_YV24, .bitCount = 24, .componentsPerPixel = 1, .subsampleWidthRatio = 1, .subsampleHeightRatio = 1, .areUVPlanesInterleaved = false, .resourceId = IDC_INPUT_FORMAT_YV24, .enabledByDefault = true }, + { .name = L"YV24", .mediaSubtype = MEDIASUBTYPE_YV24, .fsFormatId = VideoInfo::CS_YV24, .bitCount = 24, .componentsPerPixel = 1, .subsampleWidthRatio = 1, .subsampleHeightRatio = 1, .areUVPlanesInterleaved = false, .resourceId = IDC_INPUT_FORMAT_YV24 }, // RGB - { .name = L"RGB24", .mediaSubtype = MEDIASUBTYPE_RGB24, .fsFormatId = VideoInfo::CS_BGR24, .bitCount = 24, .componentsPerPixel = 3, .subsampleWidthRatio = 0, .subsampleHeightRatio = 0, .areUVPlanesInterleaved = false, .resourceId = IDC_INPUT_FORMAT_RGB24, .enabledByDefault = true }, - { .name = L"RGB32", .mediaSubtype = MEDIASUBTYPE_RGB32, .fsFormatId = VideoInfo::CS_BGR32, .bitCount = 32, .componentsPerPixel = 4, .subsampleWidthRatio = 0, .subsampleHeightRatio = 0, .areUVPlanesInterleaved = false, .resourceId = IDC_INPUT_FORMAT_RGB32, .enabledByDefault = true }, + { .name = L"RGB24", .mediaSubtype = MEDIASUBTYPE_RGB24, .fsFormatId = VideoInfo::CS_BGR24, .bitCount = 24, .componentsPerPixel = 3, .subsampleWidthRatio = 0, .subsampleHeightRatio = 0, .areUVPlanesInterleaved = false, .resourceId = IDC_INPUT_FORMAT_RGB24 }, + { .name = L"RGB32", .mediaSubtype = MEDIASUBTYPE_RGB32, .fsFormatId = VideoInfo::CS_BGR32, .bitCount = 32, .componentsPerPixel = 4, .subsampleWidthRatio = 0, .subsampleHeightRatio = 0, .areUVPlanesInterleaved = false, .resourceId = IDC_INPUT_FORMAT_RGB32 }, // RGB48 will not work because LAV Filters outputs R-G-B pixel order while AviSynth+ expects B-G-R }; diff --git a/filter_common/src/environment.cpp b/filter_common/src/environment.cpp index 99e5f5d..db37f7e 100644 --- a/filter_common/src/environment.cpp +++ b/filter_common/src/environment.cpp @@ -120,7 +120,7 @@ auto Environment::LoadSettingsFromIni() -> void { std::ranges::for_each(Format::PIXEL_FORMATS, [this](const Format::PixelFormat &format) { const std::wstring settingName = std::format(L"{}{}", SETTING_NAME_INPUT_FORMAT_PREFIX, format.name); - if (_ini.GetBoolValue(L"", settingName.c_str(), format.enabledByDefault)) { + if (_ini.GetBoolValue(L"", settingName.c_str(), true)) { _enabledInputFormats.emplace(format.name); } }); @@ -135,7 +135,7 @@ auto Environment::LoadSettingsFromRegistry() -> void { std::ranges::for_each(Format::PIXEL_FORMATS, [this](const Format::PixelFormat &format) { const std::wstring settingName = std::format(L"{}{}", SETTING_NAME_INPUT_FORMAT_PREFIX, format.name); - if (_registry.ReadNumber(settingName.c_str(), format.enabledByDefault) != 0) { + if (_registry.ReadNumber(settingName.c_str(), 1) != 0) { _enabledInputFormats.emplace(format.name); } }); diff --git a/filter_common/src/format.h b/filter_common/src/format.h index 99dd578..e76d73b 100644 --- a/filter_common/src/format.h +++ b/filter_common/src/format.h @@ -41,7 +41,6 @@ class Format { bool areUVPlanesInterleaved; int resourceId; - bool enabledByDefault; }; struct VideoFormat { diff --git a/filter_common/src/version.h b/filter_common/src/version.h index ff3cab2..a9c578b 100644 --- a/filter_common/src/version.h +++ b/filter_common/src/version.h @@ -29,7 +29,7 @@ namespace SynthFilter { #define FILTER_NAME_WIDE WIDEN(FILTER_NAME_BASE) #define FILTER_VERSION_MAJOR 1 #define FILTER_VERSION_MINOR 1 -#define FILTER_VERSION_PATCH 0 +#define FILTER_VERSION_PATCH 1 #define FILTER_VERSION_STRING STRINGIZE(FILTER_VERSION_MAJOR) "." STRINGIZE(FILTER_VERSION_MINOR) "." STRINGIZE(FILTER_VERSION_PATCH) FILTER_VARIANT " # " FILTER_GIT_HASH } diff --git a/vapoursynth_filter/src/format.cpp b/vapoursynth_filter/src/format.cpp index 37c5bb1..bfeddeb 100644 --- a/vapoursynth_filter/src/format.cpp +++ b/vapoursynth_filter/src/format.cpp @@ -12,27 +12,27 @@ namespace SynthFilter { // for each group of formats with the same format ID, they should appear with the most preferred -> list preferred order const std::vector Format::PIXEL_FORMATS = { // 4:2:0 - { .name = L"NV12", .mediaSubtype = MEDIASUBTYPE_NV12, .fsFormatId = pfYUV420P8, .bitCount = 12, .subsampleWidthRatio = 2, .subsampleHeightRatio = 2, .areUVPlanesInterleaved = true, .resourceId = IDC_INPUT_FORMAT_NV12, .enabledByDefault = true }, - { .name = L"YV12", .mediaSubtype = MEDIASUBTYPE_YV12, .fsFormatId = pfYUV420P8, .bitCount = 12, .subsampleWidthRatio = 2, .subsampleHeightRatio = 2, .areUVPlanesInterleaved = false, .resourceId = IDC_INPUT_FORMAT_YV12, .enabledByDefault = true }, - { .name = L"I420", .mediaSubtype = MEDIASUBTYPE_I420, .fsFormatId = pfYUV420P8, .bitCount = 12, .subsampleWidthRatio = 2, .subsampleHeightRatio = 2, .areUVPlanesInterleaved = false, .resourceId = IDC_INPUT_FORMAT_I420, .enabledByDefault = true }, - { .name = L"IYUV", .mediaSubtype = MEDIASUBTYPE_IYUV, .fsFormatId = pfYUV420P8, .bitCount = 12, .subsampleWidthRatio = 2, .subsampleHeightRatio = 2, .areUVPlanesInterleaved = false, .resourceId = IDC_INPUT_FORMAT_IYUV, .enabledByDefault = true }, + { .name = L"NV12", .mediaSubtype = MEDIASUBTYPE_NV12, .fsFormatId = pfYUV420P8, .bitCount = 12, .subsampleWidthRatio = 2, .subsampleHeightRatio = 2, .areUVPlanesInterleaved = true, .resourceId = IDC_INPUT_FORMAT_NV12 }, + { .name = L"YV12", .mediaSubtype = MEDIASUBTYPE_YV12, .fsFormatId = pfYUV420P8, .bitCount = 12, .subsampleWidthRatio = 2, .subsampleHeightRatio = 2, .areUVPlanesInterleaved = false, .resourceId = IDC_INPUT_FORMAT_YV12 }, + { .name = L"I420", .mediaSubtype = MEDIASUBTYPE_I420, .fsFormatId = pfYUV420P8, .bitCount = 12, .subsampleWidthRatio = 2, .subsampleHeightRatio = 2, .areUVPlanesInterleaved = false, .resourceId = IDC_INPUT_FORMAT_I420 }, + { .name = L"IYUV", .mediaSubtype = MEDIASUBTYPE_IYUV, .fsFormatId = pfYUV420P8, .bitCount = 12, .subsampleWidthRatio = 2, .subsampleHeightRatio = 2, .areUVPlanesInterleaved = false, .resourceId = IDC_INPUT_FORMAT_IYUV }, // P010 has the most significant 6 bits zero-padded, while VapourSynth expects the least significant bits padded // P010 without right shifting 6 bits on every WORD is equivalent to P016, without precision loss - { .name = L"P016", .mediaSubtype = MEDIASUBTYPE_P016, .fsFormatId = pfYUV420P16, .bitCount = 24, .subsampleWidthRatio = 2, .subsampleHeightRatio = 2, .areUVPlanesInterleaved = true, .resourceId = IDC_INPUT_FORMAT_P016, .enabledByDefault = false }, - { .name = L"P010", .mediaSubtype = MEDIASUBTYPE_P010, .fsFormatId = pfYUV420P16, .bitCount = 24, .subsampleWidthRatio = 2, .subsampleHeightRatio = 2, .areUVPlanesInterleaved = true, .resourceId = IDC_INPUT_FORMAT_P010, .enabledByDefault = false }, + { .name = L"P016", .mediaSubtype = MEDIASUBTYPE_P016, .fsFormatId = pfYUV420P16, .bitCount = 24, .subsampleWidthRatio = 2, .subsampleHeightRatio = 2, .areUVPlanesInterleaved = true, .resourceId = IDC_INPUT_FORMAT_P016 }, + { .name = L"P010", .mediaSubtype = MEDIASUBTYPE_P010, .fsFormatId = pfYUV420P16, .bitCount = 24, .subsampleWidthRatio = 2, .subsampleHeightRatio = 2, .areUVPlanesInterleaved = true, .resourceId = IDC_INPUT_FORMAT_P010 }, // 4:2:2 - { .name = L"YUY2", .mediaSubtype = MEDIASUBTYPE_YUY2, .fsFormatId = pfCompatYUY2, .bitCount = 16, .subsampleWidthRatio = 0, .subsampleHeightRatio = 0, .areUVPlanesInterleaved = false, .resourceId = IDC_INPUT_FORMAT_YUY2, .enabledByDefault = true }, + { .name = L"YUY2", .mediaSubtype = MEDIASUBTYPE_YUY2, .fsFormatId = pfCompatYUY2, .bitCount = 16, .subsampleWidthRatio = 0, .subsampleHeightRatio = 0, .areUVPlanesInterleaved = false, .resourceId = IDC_INPUT_FORMAT_YUY2 }, // P210 has the same problem as P010 - { .name = L"P216", .mediaSubtype = MEDIASUBTYPE_P216, .fsFormatId = pfYUV422P16, .bitCount = 32, .subsampleWidthRatio = 2, .subsampleHeightRatio = 1, .areUVPlanesInterleaved = true, .resourceId = IDC_INPUT_FORMAT_P216, .enabledByDefault = false }, - { .name = L"P210", .mediaSubtype = MEDIASUBTYPE_P210, .fsFormatId = pfYUV422P16, .bitCount = 32, .subsampleWidthRatio = 2, .subsampleHeightRatio = 1, .areUVPlanesInterleaved = true, .resourceId = IDC_INPUT_FORMAT_P210, .enabledByDefault = false }, + { .name = L"P216", .mediaSubtype = MEDIASUBTYPE_P216, .fsFormatId = pfYUV422P16, .bitCount = 32, .subsampleWidthRatio = 2, .subsampleHeightRatio = 1, .areUVPlanesInterleaved = true, .resourceId = IDC_INPUT_FORMAT_P216 }, + { .name = L"P210", .mediaSubtype = MEDIASUBTYPE_P210, .fsFormatId = pfYUV422P16, .bitCount = 32, .subsampleWidthRatio = 2, .subsampleHeightRatio = 1, .areUVPlanesInterleaved = true, .resourceId = IDC_INPUT_FORMAT_P210 }, // 4:4:4 - { .name = L"YV24", .mediaSubtype = MEDIASUBTYPE_YV24, .fsFormatId = pfYUV444P8, .bitCount = 24, .subsampleWidthRatio = 1, .subsampleHeightRatio = 1, .areUVPlanesInterleaved = false, .resourceId = IDC_INPUT_FORMAT_YV24, .enabledByDefault = true }, + { .name = L"YV24", .mediaSubtype = MEDIASUBTYPE_YV24, .fsFormatId = pfYUV444P8, .bitCount = 24, .subsampleWidthRatio = 1, .subsampleHeightRatio = 1, .areUVPlanesInterleaved = false, .resourceId = IDC_INPUT_FORMAT_YV24 }, // RGB - { .name = L"RGB32", .mediaSubtype = MEDIASUBTYPE_RGB32, .fsFormatId = pfCompatBGR32, .bitCount = 32, .subsampleWidthRatio = 0, .subsampleHeightRatio = 0, .areUVPlanesInterleaved = false, .resourceId = IDC_INPUT_FORMAT_RGB32, .enabledByDefault = true }, + { .name = L"RGB32", .mediaSubtype = MEDIASUBTYPE_RGB32, .fsFormatId = pfCompatBGR32, .bitCount = 32, .subsampleWidthRatio = 0, .subsampleHeightRatio = 0, .areUVPlanesInterleaved = false, .resourceId = IDC_INPUT_FORMAT_RGB32 }, // RGB48 will not work because LAV Filters outputs R-G-B pixel order while AviSynth+ expects B-G-R };