Log in

View Full Version : madVR - high quality video renderer (GPU assisted)


Pages : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 [1304] 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329

huhn
16th September 2024, 19:19
because d3d11 native decode isn't properly implemented in madVR.

deint is blocked for example. and there is much more madVR is crippled with it.

hardware decoding isn't cheaper then software too it depends especially with madVR.

the d3d11 to d3d9 interop can cost more then doing software decoding and uploading a huge data stream.
this will not happen with UHD but with a DVD totally possible. for some reason just calling a shader to do something cost quite a big even through the shader is doing close to nothing.

and you can not test this with madVR because of the stuff it does.
setting madVR to film and using dxva2 copyback will show very high CPU usage compared to d3d11 native.

d3d11 presentation is just adding another interop so it should always be slower.

comparing DXVA2 native to D3D11 native is not fair because madVR can't use D3D11 scaling and has to do an interop giving DXVA2 native a huge edge. if you now go and don't use DXVA2 scaling DXVA2 native decode will look slow because it now runs a bunch of additional shaders compared to D3D11 native.

flossy_cake
16th September 2024, 20:12
LAV only has one option for d3d11 decoding and its just called "d3d11" - is it native or copyback to RAM?

huhn
16th September 2024, 20:22
if you select an adapter it is copyback.
d3d11 can be used headless d3d9 doesn't like that so you can use an iGPU for decode that has no connected display.

d3d11 is in general superior to DXVA2 it can do so much more. madVR implementation is the issue and GPU driver obviously but you can not blame d3d11 for that.

longiloquence
16th September 2024, 23:58
Is there a newer build than the one in the OP?

huhn
17th September 2024, 06:32
https://www.videohelp.com/software/madVR

beta version are time bombed they only work for a couple of months.
206b was not released by madshi or atleast not in a thread i know about but is from his server.

NeonPhoenix
17th September 2024, 17:58
What quality issues are you having?

I don't know, just asking about trade for quality settings that I should keep checked for better quality because i've heard some of them are making the image worse if you uncheck it.

Sunspark
17th September 2024, 18:06
None of them make the image worse if you uncheck them.

Asmodian
17th September 2024, 22:42
The only one that could be argued to at least not harm quality (some say it is better quality) is scale chroma separately, if it saves performance.

Also, don't rerender frames when fade in/out is detected only has an impact when using reduce banding artifacts with a different strength during fade in/out. I always leave it checked because rerendering can cause dropped or delayed frames even on strong hardware, but I don't use reduce banding artifacts either so it is irrelevant. :p

clsid
18th September 2024, 00:16
Anyone who is a novice Madvr user should leave those settings at their defaults.

The quality impact is tiny and performance impact can be significant.

tp4tissue
18th September 2024, 17:54
I still use the copyback for black bar removal. My s90c is motorized with 1 meter of travel, on 2:1 movies, sometimes I use the bottom of the screen, sometimes top, just to even the wear out on the oled panel.

It's pretty conveniant the mount saves 4 settings. So you just press 1 button and it gets into position.

Madvr is really the only system that can do this, haha. No tv lets you do what madvr lets you do.

Klaus1189
18th September 2024, 18:00
What mount is that?

tp4tissue
18th September 2024, 18:16
What mount is that?

Just the cheap $200 motorized mount on amazon. It's made for hide-away tv cabinets, but I just bolted it directly against the wall.

I have a sit stand desk as well, so it works for sitting too.

I also don't need a couch now if I want to lounge, because I can just sit on the floor with a frumpy pillow against the wall. 77 inch tv isn't big enough for the living room anyway, so my computer room is perfect, only 10.5 feet.

I might get one of those floor rocker chairs.

flossy_cake
18th September 2024, 21:32
sometimes I use the bottom of the screen, sometimes top, just to even the wear out on the oled panel.

Ugh, I was thinking of getting a G4 for HTPC use but you're saying you can't even watch too many movies with black bars? 90% of what I watch is 4:3 pillarbox and it'll be displaying the same image at the desktop or frequently visited webpages like youtube with the red rectangle logo at the top left of youtube.com. My current compensation strategy consists of using "autohide the taskbar" and a 2 minute inactivity screen saver to black screen - reckon that'll be enough? It's not enough for my Samsung plasma which has some retention/burnin of those static youtube webpage elements but not the 4:3 bars.

tp4tissue
18th September 2024, 21:50
You dont' have to do it if you're watching mostly sdr.

I'm just doing it because it's pretty easy with madvr. I don't really think burn in is a problem. These TVs will not go 10 years, probably become obsolete in 3-4 years. :rolleyes:

flossy_cake
18th September 2024, 21:56
These TVs will not go 10 years

What do you mean? I am fully expecting to get 10 years out of a G4 - are you saying the electronics won't last?

I just replaced the Y-board on my 10 year old plasma, now I am expecting to get another 5 years out of it and frankly I want to keep it forever as it's an impulse display that looks great on retro 2D console games.

Your comment about a top of the range OLED not lasting 10 years is very concerning to me - should I just go "cheap and cheerful" B4 instead?

strumf666
18th September 2024, 22:06
They might still work after 10 years, but the picture won't be the same; panels age and wear out with time.

tp4tissue
18th September 2024, 22:14
Yea, it might still work, but there wouldn't be much reason to keep watching it. Assuming climate change doesn't kill us all in 10 years (which it probably will), we'll have micro LED panels by then. 10,000 nits full field, active water cooling.

The other thing is, I'm hitting the point where I can't stomach much more television. I've seen about 7000 movies, 400 tv series.

My oled has spent more time as a glorified e-reader than reproducing moving pictures by 10:1.

flossy_cake
18th September 2024, 22:29
Oh okay, well I have no real passionate interest in HDR. I mean it looks impressive (had a Panasonic OLED briefly) but I am more interested in the art itself, things like the subject matter, the writing, storytelling, characters, music etc. It's similar to getting too focused on graphics in video games instead of just enjoying the experience and letting the atmosphere and stuff wash over you instead of being conscious of what you are looking at. The only reason I'm into video quality is to get it above that level where there aren't issues with the image that are jumping out at me and grabbing my attention and breaking the suspension of disbelief. I still don't quite have that with the Samsung plasma, its saturation tracking can get pretty awful on low light skin tones so some shows will just look kind of bad on it, but I have managed to compensate for that with some crazy tricks like undervolting Yrr (MLL control) and using a nonstandard 1D LUT which boosts red saturation of those low light skin tones. It's still not where I want it though, but enough to not grab my attention on 90% of stuff that I watch, which is mostly DVDs of older shows before everything seemed to turn to shit in my opinion. After around 2015 or so I'm not really seeing anything to get excited about, but maybe I'm being too cynical. I think there is gold out there it's just so much harder to find.

Sunspark
18th September 2024, 23:44
For sure keep that plasma.. they have good black levels and fast response time for games.

Sunspark
18th September 2024, 23:50
tp4tissue: 7000 movies? Wow! You definitely don't have ADD, you've been watching a movie a day for 19 years. Yeah, I don't blame you for wanting a change of pace.

Micro-leds kind of suck, I don't expect them to be all that popular, even though they're the hype item.

flossy_cake
19th September 2024, 00:00
For sure keep that plasma.. they have good black levels and fast response time for games.

Yeah actually the black level is only "ok" on mine - 0.05 nits which is about the same as a VA LCD. I use a single Philips Hue bulb as a bias light behind it and it gives me very fine tuned control over the brightness level via the bluetooth app so I can dial it right in to where a black field blends in with the bezel at night. I don't actually care about the black level of OLEDs very much. I would probably even tolerate the 0.15 nits of a IPS LCD with Philips Hue set brighter to compensate, but financially it doesn't make sense as it's not that much cheaper than an entry model B6 OLED so I may as well go with that but I want the MLA panel for the better viewing angle (the Panasonic OLED annoyed me somewhat with the green/magenta tint from left to right even though I'm only 30 degrees off center max, I could still easily notice it) plus the lower power consumption and hopefully lesser burn in risk as I can run a lower peak brightness due to the MLA letting more light out

tp4tissue
19th September 2024, 00:14
tp4tissue: 7000 movies? Wow! You definitely don't have ADD, you've been watching a movie a day for 19 years. Yeah, I don't blame you for wanting a change of pace.

Micro-leds kind of suck, I don't expect them to be all that popular, even though they're the hype item.

This was completed in the last 10 years. More than 1 a day. 3-4-6.

I've 100% at least 50% of those movies, but of course I've skipped very boring movie segments after about ~3000.

wolfield
19th September 2024, 00:15
Hi! I'm new to the HDR world, so I'm sorry in advance.

I need a tool that will remap frame nits to a different value on screen and will output it as an HDR, so no conversion to SDR, just a remap. My goal is simple - to make some extremely dim videos brighter. There are some movies that have FALL of ~120 nits that contain mostly daylight scenes in a broad daylight. Ridiculous, right? I want to have an ability to equalize that and bump that perceived overall brightness.
I'm trying to do this with madvrmeasure 206b since madVR have "output video in HDR format" option after it's mapping.
Setting "display peak luminance" lower than it is it will clamp the brightness in HDR, but it's the opposite to what I want.
Applying "use custom TM curves" doesn't work in HDR, whatever curve I make it has no effect, absolutely zero.

How can I make my boody display/video brighter in HDR. Why it's so hard?!!

Thank you!

Imaging DAC/amplifier that plays 24-bit high dynamic range audio on your speakers at some fixed maximum volume level and you can't do anything about it. Frustrating, right?

tp4tissue
19th September 2024, 00:50
It would be easier to do that on your TV than through madvr.

But Madvr does have an increase brightness hotkey, although I'm pretty sure it clips.

You can have it tone map and output in HDR mode.

I still think the TV is more appropriate for this though, because most have a specific function with what you want in mind as HDR is too dark on alot of movies.

wolfield
19th September 2024, 01:14
My monitor as many other HDR computer screens has NO controls available in HDR mode. HDR mode is calibrated and brightness is connected directly to the EOTF curve (100 nits frame = 100 nits on the screen approximately
) and locked. Actually this makes sense to me. What does not is how tf those hollywood guys with super-duper master displays make bright sun in the sky at 180 nits - that's a bloody mystery. Feels like OLED guys paid them, so the ABL won't kick in on the OLED screens.
You can have it tone map and output in HDR mode.
If you suggest tonemapping to SDR as a middle step this is a very bad solution to me. I paid for a MiniLED 1000+ nits display for a reason and actually enjoy good true HDR. I need a mapping curve to work in HDR, and report set brightness acording to the curve. This is a very simple thing to ask. Otherwise "output video in HDR format" in madVR makes 0 sense as well.

The only thing that seems working right now - is redoing Light Levels of the movie on my own in DaVinci Resolve.

flossy_cake
19th September 2024, 01:24
What happens when you use "output HDR" and "BT.2390" with a higher nits value? Apparently according to some comments on previous pages this should work but I have no way of testing it currently.

wolfield
19th September 2024, 01:56
Exactly nothing happens. If frame nits are lower than specified target value madVR with HDR output does nothing passing through frames "as-is". If specified nits are lower than frame nits madVR will tonemap down to that value and dim the screen even more.

huhn
19th September 2024, 02:44
yes as the spec defines.
making stuff brighter is not that easy. will it is if you don't care to do it correctly...

sampler s0 : register(s0);

#define bright 1.2

float4 main(float2 tex : TEXCOORD0) : COLOR
{
// original pixel
float4 c0 = tex2D(s0, tex);

return (c0 * bright);
}

it will clip sdr may mess up colors and may over run (i have no clue about shaders). to do this properly rgb to ycbcr then this should only be applied to the y channel but i will not write that.
the 1.2 defines the brightness change it as you pleasei guess this will not be linear at all so have fun.
and is just a manipulation of this code:

// $MinimumShaderProfile: ps_2_0

/*
* (C) 2007-2013 see Authors.txt
*
* This file is part of MPC-HC.
*
* MPC-HC is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* MPC-HC is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/

sampler s0 : register(s0);

#define const_1 ( 16.0 / 255.0)
#define const_2 (255.0 / 219.0)

float4 main(float2 tex : TEXCOORD0) : COLOR
{
// original pixel
float4 c0 = tex2D(s0, tex);

return ((c0 - const_1) * const_2);
}

mzso
19th September 2024, 07:29
I still use the copyback for black bar removal. My s90c is motorized with 1 meter of travel, on 2:1 movies, sometimes I use the bottom of the screen, sometimes top, just to even the wear out on the oled panel.

It's pretty conveniant the mount saves 4 settings. So you just press 1 button and it gets into position.

Madvr is really the only system that can do this, haha. No tv lets you do what madvr lets you do.

There are hardly any 2:1 movies though.

flossy_cake
19th September 2024, 10:21
Exactly nothing happens. If frame nits are lower than specified target value madVR with HDR output does nothing passing through frames "as-is". If specified nits are lower than frame nits madVR will tonemap down to that value and dim the screen even more.

Ohhh so it can only go DOWN not UP. Well, that's a shame.

to do this properly rgb to ycbcr then this should only be applied to the y channel but i will not write that.

Won't that mess with the hue/saturation? If I go to colorizer.org I can slide Y channel up/down and see how that changes hue/saturation in various colour models like HSV, HSB, Lab, xyY.

Whereas applying the same multiplier to all RGB channels preserves the hue and saturation because the RGB values are staying relatively proportional to eachother. This is why I hate 1D LUTs because the only thing you can do without damaging hue and saturation is a multiplier on the RGB channels. Any nonlinear curves on the RGB channels -- even simultaneously the same curve on R+G+B -- starts to change the hue/saturation.

I reckon the best way to do luminance curves is to use a pixel shader to convert to something like Lab and do the curves on the L channel. Hopefully the Lab model is accurate enough to have isolated the L channel so as to not introduce hue/saturation shifts when modifying L, but it's probably not a perfect model so there will probably be some slight shifts.

The Y channel in YCrCb is weird, it's derived from linear light RGB coefficients but it's a nonlinear value. Apparently that's why it's called "luma" instead of "luminance".

Alexkral
19th September 2024, 14:41
My goal is simple - to make some extremely dim videos brighter. There are some movies that have FALL of ~120 nits that contain mostly daylight scenes in a broad daylight. Ridiculous, right? I want to have an ability to equalize that and bump that perceived overall brightness.


I do this all the time when converting HDR to SDR as I also find ridiculous to have to watch bright sunny days at 100 nits in HDR. Unfortunately there is no solution that I am aware of if you want to output HDR, I mean, there would be no need to look for any solution if the gradings followed the ITU recommendation of setting the diffuse white level to 203 nits, but that doesn't seem to be happening. The problem is that PQ is an absolute format, so the TV doesn't scale the tone mapped result to the maximum brightness like it does with SDR. The shader that huhn posted will completely change the transfer function, I don't think the result will be acceptable, and anyway the highlights will be clipped at some point.

Anyway I am curious about this now as I think it could be done with inverse tone mapping, I will post some shader if I can think of how to do it, but I don't have much time lately.

flossy_cake
19th September 2024, 15:57
Try this: make a madvr hotkey for "source white level increase/decrease" (note: this is not the same as the "brightness" and "contrast" controls in the settings GUI) and while the video is playing use the hotkeys to increase the level to where you visually want it, eg. +16, then tag the filename with [whitelevel=16] to have it auto applied to just that file. Or you can tag the top level parent foldername instead to make it applied to all files within that folder which includes subdirectories.

I'm not sure it will work properly for HDR though, whether it will clip at the mastering white level of the file or if Madvr actually starts tonemapping the white level above the mastering white level which is what you'd want to get more brightness without clipping.

I've got a feeling it will do the former and will result in way too much clipping although I don't have a HDR setup to test.

wolfield
19th September 2024, 20:01
flossy_cake, hey, it works!! It stretches highlights into higher light levels, exactly as I imagined. It does produce slight clipping before reaching display's maximum light level capability if you overdo it, so I'm not sure by what algorithm it produces such result. Also it bumps the blacks/shadows a tiny bit too which in some scenes can be suboptimal, but you can try and lower "source black level" - and this may or may not screw your gamma but saves the shadows.
This is more than livable already! So much better than nothing I had before. Thank you so much!! Let me give you a hug!

huhn
19th September 2024, 20:08
you always affect them.
tone mapping does something similar the other way.
not changing hue/saturation is one of the biggest issue which is up to this day an issue but has been improved on.

using YCtCp (comes up a lot lately) improves this already.

flossy_cake
20th September 2024, 09:14
Cool I didn't know about that.

Glad to hear the white level works for HDR but looking at Wikipedia page for ICtCp the "I" channel is 0.998 accurate vs 0.819 for the Y in YCbCr. So a better solution than using white level might be to add a pixel shader to convert the RGB to ICtCp using the PQ formula on the Wikipedia page, then perhaps we could just do a multiplier on the "I" channel and convert back to RGB? Would that work?

edit: I guess it depends what rgb(1.0, 1.0, 1.0) represents inside the shader. In PQ encoding it would represent 10,000 nits, so if the mastering level of the file was only say 1000 nits then there would be plenty of RGB headroom to increase peak brightness without clipping. This got me thinking, the whole purpose of PQ was to avoid wasting code values by having the code values map to human contrast sensitivity per the Barten Contrast Sensitivity function, but if they make rgb(1.0, 1.0, 1.0) hard coded to 10,000 nits it wastes code values for videos that were mastered at less than 10,000 nits.

nevcairiel
20th September 2024, 10:03
edit: I guess it depends what rgb(1.0, 1.0, 1.0) represents inside the shader. In PQ encoding it would represent 10,000 nits, so if the mastering level of the file was only say 1000 nits then there would be plenty of RGB headroom to increase peak brightness without clipping. This got me thinking, the whole purpose of PQ was to avoid wasting code values by having the code values map to human contrast sensitivity per the Barten Contrast Sensitivity function, but if they make rgb(1.0, 1.0, 1.0) hard coded to 10,000 nits it wastes code values for videos that were mastered at less than 10,000 nits.

PQ is designed in such a way that the upper range of the values takes very few bits to begin with. 1000 nits is at ~0.75, so 75% of the number space are used for the first 1000 nits, and only 25% are used for the last 9000. This gives you all the precision you need for the brightness levels where most content is. Even in a 10000 nits movie, only very few peak highlights would exist in that range, and of course it aligns better with our vision.

flossy_cake
20th September 2024, 13:28
1000 nits is at ~0.75, so 75% of the number space are used for the first 1000 nits, and only 25% are used for the last 9000.

Yes and that's a waste of 25% of the available code values for 1000 nit content, which is ironic given the whole point of PQ is to make the most use of the available code values :sly:

They could have made it so it uses the whole range of code values and just flag it as 1000 nits in metadata, similar to how matrix and gamut are flagged and it's up to the decoding device to do the transform.

So for 1000 nit video we get 768 steps of luminance instead of 1024 if metadata was used instead. This sounds bad but I guess PQ is still very perceptually uniform so it ends up not really mattering, gradients are still going to look smooth. I guess my argument is that it's ironic, not that it's bad per se.

huhn
20th September 2024, 22:54
you can't...

changing the max real brightness changes the brightness of secondaries and primaries.

even while wasting 25 % of all bits it is still massively better than SDR it wins hands down.

SDR does the same anyway outside of cartoon or CGI bright pixel are not used much it happens more but that's it.

also video is limited range for brightness we waste another ~15%. and there are also good reason to do that.

flossy_cake
20th September 2024, 23:40
Yes and I find it interesting that even when doing a multiplier on RGB channels in SDR or using a higher peak brightness setting at the display, this actually changes the tonemapping in relation to human vision. So a higher peak brightness in SDR actually looks like it's using a different tonemapping curve than a lower peak brightness, even though the gamma is mathematically the same for both. The reason is that gamma is not perceptually uniform.

huhn
21st September 2024, 01:54
but why do you think that. just look at a triplet

230 0 0

and now you increase that 230 by something 1.2 it is a different color now.

but if you would instead change the gamma it would not much as far.

flossy_cake
21st September 2024, 11:04
Let's compare how 50% grey looks in relation to 100% white, for two different peak whites, using the same gamma for both.

Gamma 2.4 @ 100nits
50% grey = 19 nits
100% white = 100 nits

Gamma 2.4 @ 200 nits
50% grey = 38 nits
100% white = 200 nits

So in terms of human vision think about how 19 nits looks in relation to 100 nits, and compare that with how 38 nits looks in relation to 200 nits.

Mathematically we are using the same gamma and the same 2x multiplier for both, so the 50% grey should look the same relative to the 100% white in both cases, shouldn't it?

But according to the Barten contrast sensitivity function which measures human contrast sensitivity steps (which HDR PQ was made from) the perceived difference between 19 nits and 100 nits isn't the same as the perceived difference between 38 nits and 200 nits, in terms of human perception of contrast.

So I think the best solution will be to convert the SDR swizzle to a human perceptually uniform encoding, then perform the desired contrast adjustments, then convert it back to SDR.

For HDR it already uses the PQ curve which is perceptually uniform so doing multipliers on the RGB channels should be ok, shouldn't it?

huhn
21st September 2024, 14:32
no it is not this only works in linear light and for black and white movies.

colors will move on the xy coordinate if you do it in RGB.

you can also not just increase the brightness of sdr at one point everything will look like wax.

flossy_cake
21st September 2024, 17:31
If I go to colorizer.org

Start with default colour RGB(169, 104, 54)

Multiply by 1.5 = RGB(254, 156, 81)

xy coordinates seem to stay the same (x=47, y=40)

I believe colorizer.org is using SDR gamma for all calculations, so with HDR PQ it should be different, but I don't know in what way. The RGB steps are more perceptually uniform in PQ so...better?

huhn
21st September 2024, 20:03
ok let's just change these numbers.

instead of 169 104 54 we use 169 0 0.
169 and 254 are not the same color.

huhn
21st September 2024, 21:52
i found a new potential bug and i need someone with an oled to reproduce it.

dithering ordered
uncheck don't use linear light for dithering
10 bit with 10 bit output.

now open a totally black RGB image 4/3 for better visibility in a pitch black room in fullscreen. after 20 sec you should be able to see the 4/3 black on the screen with ease.

doesn't happen at 8 bit or with error diffusion or if "don't use linear light" for dithering is checked.

flossy_cake
21st September 2024, 22:58
ok let's just change these numbers.

instead of 169 104 54 we use 169 0 0.
169 and 254 are not the same color.

Comparing rgb(169,0,0) with rgb(254,0,0) at colorizer.org

It says xy coordinate is the same for both (x=64, y=33)

edit: but Lab says ab values have changed, so I guess it depends on the color model.

flossy_cake
21st September 2024, 23:11
now open a totally black RGB image 4/3 for better visibility in a pitch black room in fullscreen. after 20 sec you should be able to see the 4/3 black on the screen with ease.

doesn't happen at 8 bit or with error diffusion or if "don't use linear light" for dithering is checked.

Can you take a screenshot then we can inspect the pixel values?

In my dithering shader I don't apply dithering to any rgb channels with a value of 0 otherwise I would get some dithered pixels on black which raised the black level slightly (not an issue on most displays, but on an OLED in pitch black room it would definitely be noticeable). Is it something like that?

huhn
21st September 2024, 23:25
no i can't. because of 10 bit.
and no the other dither option are black in comparison a display error as a source is low.

that fact that 8 bit doesn't show that issue is a clear indicator.

Comparing rgb(169,0,0) with rgb(254,0,0) at colorizer.org

It says xy coordinate is the same for both (x=64, y=33)

edit: but Lab says ab values have changed, so I guess it depends on the color model.
it is really that simple: https://ibb.co/YN5DD6g

the RGB used in display rendering is in x y CIE and has a range of ~0.9 to 0.8.
there are others like XYZ or xyz i usually use xyY.

flossy_cake
22nd September 2024, 00:28
the RGB used in display rendering is in x y CIE and has a range of ~0.9 to 0.8.
there are others like XYZ or xyz i usually use xyY.

Yeah it seems colorizer.org is using xyY and is normalising them to 0-100 range so like if you put RGB(255,255,255) it says 31.27,32.9 instead of 0.3127,0.329 so it looks like colorizer.org math assumes the RGB is in sRGB space with D65 whitepoint

My understanding is that if green and blue are both at 0 then any nonzero value for red is going to be red at max saturation so raising and lowering red is just increasing/decreasing luminance and not affecting saturation.

But there are many models, like the HSL/HSB model is total garbage and shouldn't be used for anything

But if you trust the xyY model then it should be ok

huhn
22nd September 2024, 03:56
no...
a TV and video only has one 255 0 0 there are no other colors at that position this counts for all primaries.

here is yet another example if that doesn't make it clear i give up.

169 255 255 to 255 255 255.
this is turning this bluish color i don't know the English name of to white removing any saturation.

even with the 169 0 0 example after multiplication 170 0 0 to 255 0 0 will all be 255 0 0 which should be more then enough.