-
-
Notifications
You must be signed in to change notification settings - Fork 111
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
New LUT calibration based on mp4 test videos (part I) #896
base: master
Are you sure you want to change the base?
Conversation
337ecec
to
fa7eff8
Compare
b97f332
to
1ab1a2c
Compare
By the way Yolofant said the right thing - once you add in image blending from the ui layer things become a lot slower check === compare with old method i mean =) |
Always tested here with GUI disabled including comparing NV12 mode to RGB mode performance. I agree that mixing RGB with YUV converted to RGB when GUI is enabled incurs additional costs and BTW disables NV12 mode so the calibration wouldn't work anyway so it could be easily detected. EDIT: If I understand correctly when GUI capturing is enabled, the correct RGB from the GUI is mixed with material that requires LUT correction (YUV from HDMI input that must be converted internally to RGB before mixing)? But it will end badly when it comes to quality...The proper way: libdile/vtcapture provide capturing => ignore GUI, in the other case switch to GUI mode, if GUI mode colors are correct then disable tone mapping. Do not mixup both modes. |
In my opinion, this makes sense and is the more elegant solution. |
for me it's around 62-64ms with linux socket on 640x360 and 70-80ms on 720p |
Probably it's caused by the missing USB grabber module in the build. It seems even the grabber is not used the report tries to read the module properties searching for selected device and capturing resolution. Will take a look later. |
1 @s1mptom I think I fixed it in the latest commit |
New webOS org.webosbrew.hyperhdr.loader |
Added YUV limited test files to test the impact of this setting (usually used in most of video files) on the calibration: |
Squashed commit of the following: commit 6d37f16 Author: Awawa <[email protected]> Date: Mon Sep 23 18:53:19 2024 +0200 Add quarter of frame mode for flatbuffers commit 8f48dce Author: Awawa <[email protected]> Date: Sun Sep 22 01:27:37 2024 +0200 Grabber benchmark support for flatbuffers commit a42d5d9 Author: Awawa <[email protected]> Date: Tue Sep 17 21:30:30 2024 +0200 Add support for SDR (BT2020 in SRGB) calibration commit 7832376 Author: Awawa <[email protected]> Date: Sun Sep 15 18:49:49 2024 +0200 More precise color capture saving/loading New calibration_captured_yuv.txt format commit b1c3fbb Author: Awawa <[email protected]> Date: Sat Sep 14 00:18:15 2024 +0200 Support for SDR calibration commit 6c28e42 Author: Awawa <[email protected]> Date: Fri Sep 13 01:39:56 2024 +0200 Fix calibration for 1280x720 capturing setting commit 96544ac Author: Awawa <[email protected]> Date: Thu Sep 12 19:05:36 2024 +0200 More precise calculation commit 205ebe0 Author: Awawa <[email protected]> Date: Tue Sep 10 22:42:29 2024 +0200 Faster HLG OOTF when disabled commit f0c2499 Author: Awawa <[email protected]> Date: Tue Sep 10 00:50:02 2024 +0200 More detailed scan commit 280e0b8 Author: Awawa <[email protected]> Date: Mon Sep 9 02:25:16 2024 +0200 Verify if BT.2100 HLG OOTF is present commit bbb08e3 Author: Awawa <[email protected]> Date: Mon Sep 9 01:31:13 2024 +0200 Added BT.2100 HLG support (4) commit edd58ff Author: Awawa <[email protected]> Date: Mon Sep 9 01:24:51 2024 +0200 Added BT.2100 HLG support (3) commit 37bd1d0 Author: Awawa <[email protected]> Date: Mon Sep 9 01:21:06 2024 +0200 Added BT.2100 HLG support (2) commit 0864fe9 Author: Awawa <[email protected]> Date: Sun Sep 8 03:03:00 2024 +0200 Added BT.2100 HLG support commit 7130cd0 Author: Awawa <[email protected]> Date: Thu Sep 5 23:41:27 2024 +0200 Added a new nice web wizard for LUT calibration commit 5c95eac Author: Awawa <[email protected]> Date: Thu Sep 5 01:23:08 2024 +0200 HDR10 calibration is working again also using video test files commit 1b0020a Author: Awawa <[email protected]> Date: Thu Sep 5 01:11:41 2024 +0200 HDR10 calibration is working again also using video test files commit 4e82cc8 Author: Awawa <[email protected]> Date: Thu Sep 5 01:02:21 2024 +0200 HDR10 calibrator: fix errors commit 4de0544 Author: Awawa <[email protected]> Date: Thu Sep 5 00:47:52 2024 +0200 Fix errors (2) commit 09c499d Author: Awawa <[email protected]> Date: Thu Sep 5 00:34:53 2024 +0200 Test C++17 commit 9999d18 Author: Awawa <[email protected]> Date: Thu Sep 5 00:30:07 2024 +0200 Fix errors (1) commit 60f4673 Author: Awawa <[email protected]> Date: Thu Sep 5 00:19:44 2024 +0200 HDR10 calibration is working again also using video test files commit 0106566 Author: Awawa <[email protected]> Date: Thu Sep 5 00:14:45 2024 +0200 Save captured YUV colors in HyperHDR home folder commit 6fd5447 Author: Awawa <[email protected]> Date: Wed Sep 4 23:32:39 2024 +0200 Add support for Flatbuffers NV12 calibration commit 7f84ef6 Author: Awawa <[email protected]> Date: Wed Sep 4 23:00:50 2024 +0200 Implemented LUT saving commit ae75b4a Author: Awawa <[email protected]> Date: Wed Sep 4 21:51:12 2024 +0200 Optimize YUV coef matrix creation commit 32f133a Author: Awawa <[email protected]> Date: Wed Sep 4 20:44:06 2024 +0200 Extract methods commit 90ee566 Author: Awawa <[email protected]> Date: Wed Sep 4 19:51:04 2024 +0200 Optimize matrix multiplication commit c873b87 Author: Awawa <[email protected]> Date: Wed Sep 4 01:20:50 2024 +0200 Testing more conditions and deviation of YUV coefs commit b766491 Author: Awawa <[email protected]> Date: Mon Sep 2 23:19:16 2024 +0200 Add precise scanner commit 4fff3a6 Author: Awawa <[email protected]> Date: Sat Aug 31 15:30:14 2024 +0200 Verify source: only NV12/YUYV/MJPEG source are supported for the calibration process commit 3b2a260 Author: Awawa <[email protected]> Date: Sat Aug 31 02:39:24 2024 +0200 Update LutCalibrator.cpp commit 34b4aa7 Author: Awawa <[email protected]> Date: Sat Aug 31 01:09:00 2024 +0200 More math commit 71d4f13 Author: Awawa <[email protected]> Date: Fri Aug 30 22:50:33 2024 +0200 Add more colorspace math commit ce88768 Author: Awawa <[email protected]> Date: Fri Aug 30 20:45:08 2024 +0200 Add detection of bt.2020 gamma in the input data commit f2445c6 Author: Awawa <[email protected]> Date: Wed Aug 28 21:30:12 2024 +0200 Const correction commit 45b169a Author: Awawa <[email protected]> Date: Wed Aug 28 21:06:36 2024 +0200 Add save raw image commit db9bc92 Author: Awawa <[email protected]> Date: Tue Aug 27 00:36:20 2024 +0200 Parse text HDR LUT to binary format commit 17f0527 Author: Awawa <[email protected]> Date: Fri Aug 23 23:14:36 2024 +0200 Calibration for new boards. 17*17*17 YUV samples. commit c573efd Author: Awawa <[email protected]> Date: Fri Aug 23 01:39:22 2024 +0200 Correction commit a026103 Author: Awawa <[email protected]> Date: Fri Aug 23 01:19:50 2024 +0200 Print error stats commit 97ec1ca Author: Awawa <[email protected]> Date: Fri Aug 23 01:02:51 2024 +0200 Parse and verify colors of all test boards commit 86dd611 Author: Awawa <[email protected]> Date: Thu Aug 22 23:28:55 2024 +0200 Read CRC from the test board commit 09e88aa Author: Awawa <[email protected]> Date: Thu Aug 22 23:04:02 2024 +0200 Make board verifier work commit d005d7d Author: Awawa <[email protected]> Date: Thu Aug 22 22:00:42 2024 +0200 Optimize board creator commit 19503b0 Author: Awawa <[email protected]> Date: Thu Aug 22 19:54:38 2024 +0200 Add CapturedColor commit 77826cc Author: Awawa <[email protected]> Date: Thu Aug 22 00:59:18 2024 +0200 Extract classes & namespaces commit a07a4cf Author: Awawa <[email protected]> Date: Mon Aug 19 22:42:25 2024 +0200 Use vectors commit 1ab1a2c Author: Awawa <[email protected]> Date: Tue Aug 13 22:45:10 2024 +0200 Test video commit 35c3d0b Author: Awawa <[email protected]> Date: Tue Aug 13 01:15:58 2024 +0200 Test images creator commit c85ef1a Author: awawa-dev <[email protected]> Date: Sun Feb 11 22:50:09 2024 +0100 LUT rework commit ea61970 Author: awawa-dev <[email protected]> Date: Sun Feb 4 14:38:38 2024 +0100 to revert
interesting thing - with a limited range test file i'm getting BT601 and
with full range i'm getting FCC. And result still more contrasty than
original picture =( looks like there's no difference at all so maybe i'm
doing something wrong. and checked few times that i'm not using full range
…On Wed, Sep 25, 2024 at 10:07 PM Awawa ***@***.***> wrote:
Added YUV limited test files to test the impact of this setting (usually
used in video files) on the calibration:
https://github.com/awawa-dev/awawa-dev.github.io/tree/master/calibration
—
Reply to this email directly, view it on GitHub
<#896 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAOKOHMIHR7M3UQY4JA23FLZYMQ2ZAVCNFSM6AAAAABKPQAGCOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNZVGI3DCMRZGI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
As I told you coef are just starting reference, while searching kR/kB delta can change them significantly. And the most important: BT601 and FCC are almost identical. Link: http://avisynth.nl/index.php/Color_conversions |
Added few improvements, rather more significantly for USB grabbers:
Since there are a lot of changes here that block other new HyperHDR functionalities that I would like to add, I plan to move the AI part to another pull-request. Here I want to work on a better scoring function, because RGB distance is a fast algorithm, but it is not very well suited to the situation. |
The last commit brings an important fix (corrected saving results) and a new denoising algorithm that significantly improves calibration results using the YUV420 format, especially YUV420 LIMITED. Based on these tests, I am considering completely removing the YUV420 FULL RANGE test files since LIMITED works just as well and is somewhat standard. I don't plan on adding any more new features in this PR unless I find some bugs. WIndows 11 HDR 1080p 12-bits RGB, MS2130 (F3 firmware, 1080p YUV)
WEBOS 1080p5, internal player
WEBOS 1080p5, MPC-HC/MADVR + Win10 1080p
WEBOS 1080p5, VLC player + Win10 1080p
|
@awawa-dev |
mpc-hc + madvr SDR results look weird so after replacing the madvr with built-in enhanced video renderer custom presenter and the results for SDR 420 limited improved from 717 to 262... guess madvr is really heavy processing SDR even without any up/downscaling and it's not the best solution for me - lesson learnt. calibration_captured_yuv_sdr_webos_420_limited_mpc_enhanced_video_renderer_cs.txt |
Comparison of the new calibration capabilities from this PR compared to the previous one .. so of course also to the old LUTs which can still be downloaded from the application. On Windows with HDR enabled, calibration using mpc-hc + madvr and Elgato HD60X and HDR_420_limited test file gave a perfect result of 195 (using SDR_420_limited in such a configuration with Elgato failed). Test Subject: my favorite Fairy Tail ;-) |
@awawa-dev Is it the same with your C9? I then copied lut_lin_tables_dv.3d to What is the best way to do this? |
@satgit62 |
Yes, indeed, with this device the free space on |
@awawa-dev |
actually not =) looks like i have a lot of free space on G3...) but previously i'm already thinking about it (3 parts in LUT and 3 separate files with only 1 usefull part) but... it's not my 1st priority right now..)) but in near future we could handle this too ofc (i mean there will definitely need to implement support on the HyperHDR side and on the WebOS backend side as well) |
Hello, |
@satgit62 good work 👍 I will have more time during the weekend, I am preparing another cherry on top of the cake for the current calibrator... but that will be in a few days. |
Hello, |
Squashed commit of the following: commit 4cb189a Author: Awawa <[email protected]> Date: Thu Oct 3 22:10:07 2024 +0200 Important calibration fix and stronger noise resistance commit 3acbc6e Author: Awawa <[email protected]> Date: Thu Oct 3 01:33:31 2024 +0200 Fix commit fde0461 Author: Awawa <[email protected]> Date: Thu Sep 26 01:31:27 2024 +0200 Improvements commit 6d37f16 Author: Awawa <[email protected]> Date: Mon Sep 23 18:53:19 2024 +0200 Add quarter of frame mode for flatbuffers commit 8f48dce Author: Awawa <[email protected]> Date: Sun Sep 22 01:27:37 2024 +0200 Grabber benchmark support for flatbuffers commit a42d5d9 Author: Awawa <[email protected]> Date: Tue Sep 17 21:30:30 2024 +0200 Add support for SDR (BT2020 in SRGB) calibration commit 7832376 Author: Awawa <[email protected]> Date: Sun Sep 15 18:49:49 2024 +0200 More precise color capture saving/loading New calibration_captured_yuv.txt format commit b1c3fbb Author: Awawa <[email protected]> Date: Sat Sep 14 00:18:15 2024 +0200 Support for SDR calibration commit 6c28e42 Author: Awawa <[email protected]> Date: Fri Sep 13 01:39:56 2024 +0200 Fix calibration for 1280x720 capturing setting commit 96544ac Author: Awawa <[email protected]> Date: Thu Sep 12 19:05:36 2024 +0200 More precise calculation commit 205ebe0 Author: Awawa <[email protected]> Date: Tue Sep 10 22:42:29 2024 +0200 Faster HLG OOTF when disabled commit f0c2499 Author: Awawa <[email protected]> Date: Tue Sep 10 00:50:02 2024 +0200 More detailed scan commit 280e0b8 Author: Awawa <[email protected]> Date: Mon Sep 9 02:25:16 2024 +0200 Verify if BT.2100 HLG OOTF is present commit bbb08e3 Author: Awawa <[email protected]> Date: Mon Sep 9 01:31:13 2024 +0200 Added BT.2100 HLG support (4) commit edd58ff Author: Awawa <[email protected]> Date: Mon Sep 9 01:24:51 2024 +0200 Added BT.2100 HLG support (3) commit 37bd1d0 Author: Awawa <[email protected]> Date: Mon Sep 9 01:21:06 2024 +0200 Added BT.2100 HLG support (2) commit 0864fe9 Author: Awawa <[email protected]> Date: Sun Sep 8 03:03:00 2024 +0200 Added BT.2100 HLG support commit 7130cd0 Author: Awawa <[email protected]> Date: Thu Sep 5 23:41:27 2024 +0200 Added a new nice web wizard for LUT calibration commit 5c95eac Author: Awawa <[email protected]> Date: Thu Sep 5 01:23:08 2024 +0200 HDR10 calibration is working again also using video test files commit 1b0020a Author: Awawa <[email protected]> Date: Thu Sep 5 01:11:41 2024 +0200 HDR10 calibration is working again also using video test files commit 4e82cc8 Author: Awawa <[email protected]> Date: Thu Sep 5 01:02:21 2024 +0200 HDR10 calibrator: fix errors commit 4de0544 Author: Awawa <[email protected]> Date: Thu Sep 5 00:47:52 2024 +0200 Fix errors (2) commit 09c499d Author: Awawa <[email protected]> Date: Thu Sep 5 00:34:53 2024 +0200 Test C++17 commit 9999d18 Author: Awawa <[email protected]> Date: Thu Sep 5 00:30:07 2024 +0200 Fix errors (1) commit 60f4673 Author: Awawa <[email protected]> Date: Thu Sep 5 00:19:44 2024 +0200 HDR10 calibration is working again also using video test files commit 0106566 Author: Awawa <[email protected]> Date: Thu Sep 5 00:14:45 2024 +0200 Save captured YUV colors in HyperHDR home folder commit 6fd5447 Author: Awawa <[email protected]> Date: Wed Sep 4 23:32:39 2024 +0200 Add support for Flatbuffers NV12 calibration commit 7f84ef6 Author: Awawa <[email protected]> Date: Wed Sep 4 23:00:50 2024 +0200 Implemented LUT saving commit ae75b4a Author: Awawa <[email protected]> Date: Wed Sep 4 21:51:12 2024 +0200 Optimize YUV coef matrix creation commit 32f133a Author: Awawa <[email protected]> Date: Wed Sep 4 20:44:06 2024 +0200 Extract methods commit 90ee566 Author: Awawa <[email protected]> Date: Wed Sep 4 19:51:04 2024 +0200 Optimize matrix multiplication commit c873b87 Author: Awawa <[email protected]> Date: Wed Sep 4 01:20:50 2024 +0200 Testing more conditions and deviation of YUV coefs commit b766491 Author: Awawa <[email protected]> Date: Mon Sep 2 23:19:16 2024 +0200 Add precise scanner commit 4fff3a6 Author: Awawa <[email protected]> Date: Sat Aug 31 15:30:14 2024 +0200 Verify source: only NV12/YUYV/MJPEG source are supported for the calibration process commit 3b2a260 Author: Awawa <[email protected]> Date: Sat Aug 31 02:39:24 2024 +0200 Update LutCalibrator.cpp commit 34b4aa7 Author: Awawa <[email protected]> Date: Sat Aug 31 01:09:00 2024 +0200 More math commit 71d4f13 Author: Awawa <[email protected]> Date: Fri Aug 30 22:50:33 2024 +0200 Add more colorspace math commit ce88768 Author: Awawa <[email protected]> Date: Fri Aug 30 20:45:08 2024 +0200 Add detection of bt.2020 gamma in the input data commit f2445c6 Author: Awawa <[email protected]> Date: Wed Aug 28 21:30:12 2024 +0200 Const correction commit 45b169a Author: Awawa <[email protected]> Date: Wed Aug 28 21:06:36 2024 +0200 Add save raw image commit db9bc92 Author: Awawa <[email protected]> Date: Tue Aug 27 00:36:20 2024 +0200 Parse text HDR LUT to binary format commit 17f0527 Author: Awawa <[email protected]> Date: Fri Aug 23 23:14:36 2024 +0200 Calibration for new boards. 17*17*17 YUV samples. commit c573efd Author: Awawa <[email protected]> Date: Fri Aug 23 01:39:22 2024 +0200 Correction commit a026103 Author: Awawa <[email protected]> Date: Fri Aug 23 01:19:50 2024 +0200 Print error stats commit 97ec1ca Author: Awawa <[email protected]> Date: Fri Aug 23 01:02:51 2024 +0200 Parse and verify colors of all test boards commit 86dd611 Author: Awawa <[email protected]> Date: Thu Aug 22 23:28:55 2024 +0200 Read CRC from the test board commit 09e88aa Author: Awawa <[email protected]> Date: Thu Aug 22 23:04:02 2024 +0200 Make board verifier work commit d005d7d Author: Awawa <[email protected]> Date: Thu Aug 22 22:00:42 2024 +0200 Optimize board creator commit 19503b0 Author: Awawa <[email protected]> Date: Thu Aug 22 19:54:38 2024 +0200 Add CapturedColor commit 77826cc Author: Awawa <[email protected]> Date: Thu Aug 22 00:59:18 2024 +0200 Extract classes & namespaces commit a07a4cf Author: Awawa <[email protected]> Date: Mon Aug 19 22:42:25 2024 +0200 Use vectors commit 1ab1a2c Author: Awawa <[email protected]> Date: Tue Aug 13 22:45:10 2024 +0200 Test video commit 35c3d0b Author: Awawa <[email protected]> Date: Tue Aug 13 01:15:58 2024 +0200 Test images creator commit c85ef1a Author: awawa-dev <[email protected]> Date: Sun Feb 11 22:50:09 2024 +0100 LUT rework commit ea61970 Author: awawa-dev <[email protected]> Date: Sun Feb 4 14:38:38 2024 +0100 to revert
I don't know what the final effect will be, but since AI is currently very popular ;) Let's use Deep Learning Function Approximation to calibrate SDR/HDR/whatever video source. We will use Python and its related libraries here but it is an optional functionality and you do not have to use it nor will we install it: it must be present in the system.
But first, let's sort out the calibrator code because it needs cleaning before further work. We will use a new library for linear algebra that will help us.
Main changes (non-AI):
Old method using Windows 10 and a web browser is no longer mandatory, you can use the old method using browser or simply play the video test file in your favorite video player.
New algos that support even video source trans-coded to full BT2020 range and provide better quality
Captured colors are saved in the HyperHDR directory after calibration as calibration_captured_yuv.txt and can be provided to me for analysis if I have some spare time.
Support only for YUV/NV12/MJPEG modes. RGB mode is not supported anymore.
Confirmed support for webos calibration with backend that supports NV12 flatbuffers communication. Each webos mode (SDR/HDR/DV) may require its own calibration.
Grabber benchmark supports flatbuffers source
Video source noise detection
If calibrating using Windows (using the web browser or the video player as a video source) please disable features like 'Night mode' or 'Auto-HDR'. Do not change the color balance in your graphic driver.
Video test files:
https://github.com/awawa-dev/awawa-dev.github.io/tree/master/calibration
Use SDR video only if your OS or video player will automatically apply SDR to HDR tone mapping. Or if you are calibrating eg. webos.
The web browser method and playing yuv444 file usually provides the best calibration quality but yuv444 is supported probably only by the PC players. yuv420 has better compatibility but worse quality (the risk the player is starting using its own filters like dithering).
Presenting capabilities of new tone mapping algos:
Source desktop (Windows 11 HDR enabled):
Captured by MS2130 (F3 firmware !!!) without tone mapping:
Tone mapping enabled: