Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Hardware & Software > Software players

Reply
 
Thread Tools Search this Thread Display Modes
Old 8th February 2014, 23:04   #22801  |  Link
The 8472
Registered User
 
Join Date: Jan 2014
Posts: 51
Quote:
Originally Posted by Ver Greeneyes View Post
Could you comment on your workflow? I've made a simple gradient test pattern, but I don't know if I did it right. I used a small C++ program to create a raw file containing 16-bit r, g and b values, then used ffmpeg to turn the raw file into a movie, with the following commandline:
Code:
ffmpeg -y -vcodec rawvideo -f rawvideo -pix_fmt rgb48le -s 1920x1080 -r 29.97 -i output.raw -vcodec ffv1 -pix_fmt yuv444p16le gradient.mkv
The test pattern movie is here: 1080p gradient test pattern
I'm using a script that uses imagemagick in a loop to generate PNM-images and then passes them to ffmpeg

Code:
convert -depth 16 -size 2560x1440 xc: -sparse-color Shepards '%[fx:0.5*w], %[fx:0.5*h] rgb(0,0,0) %w, %h rgb(0.1,0.1,0.1) 0, %h rgb(0,0.1,0) 0, 0 rgb(0.1,0,0) %w, 0 rgb(0,0,0.1)' 0001.pnm
ffmpeg -threads 8 -r 1/2 -pattern_type glob -i '*.pnm' -pix_fmt yuv444p16le -vcodec ffv1 -g 1 -an out.mkv


Added flat tiles:
Quote:
Originally Posted by The 8472 View Post
flat tiles with steps of grey smaller than the 8bit quantum (12bit quantum):
1440p
1080p
@madshi could you test those videos? They work fine with EVR-CP but mpc-hc crashes when i try to play them with madVR

Last edited by The 8472; 8th February 2014 at 23:12.
The 8472 is offline   Reply With Quote
Old 8th February 2014, 23:14   #22802  |  Link
madshi
Registered Developer
 
Join Date: Sep 2006
Posts: 9,140
Quote:
Originally Posted by The 8472 View Post
@madshi could you test those videos? They work fine with EVR-CP but mpc-hc crashes when i try to play them with madVR
Tried the 1080p one, plays fine here.
madshi is offline   Reply With Quote
Old 8th February 2014, 23:16   #22803  |  Link
bacondither
Registered User
 
Join Date: Oct 2013
Location: Sweden
Posts: 128
Filter Lite + random = build number 5?

Floyd-Steinberg + random = build number number 7?

PM me if you don't want to publish the correct answer

Quote:
Originally Posted by madshi View Post
So let's pick the algorithm which looks best, when looking at both your and my test images. Agreed
Yes, robustness in the algorithm to small brightness changes is something to strive for.

Anyway, after looking at your images i think that 5 and 7 looked the best but may have to revaluate the low noise ones.

Last edited by bacondither; 8th February 2014 at 23:29.
bacondither is offline   Reply With Quote
Old 8th February 2014, 23:19   #22804  |  Link
nevcairiel
Registered Developer
 
Join Date: Mar 2010
Location: Hamburg/Germany
Posts: 10,344
Quote:
Originally Posted by madshi View Post
I'm confused. Your image clearly shows error diffusion. Since when does EVR custom with full FP processing apply error diffusion??
It does not. It uses a simple pixel shader to dither using a huge pre-defined matrix. Looks like 32x32 ordered dithering.
__________________
LAV Filters - open source ffmpeg based media splitter and decoders
nevcairiel is offline   Reply With Quote
Old 8th February 2014, 23:32   #22805  |  Link
madshi
Registered Developer
 
Join Date: Sep 2006
Posts: 9,140
Quote:
Originally Posted by bacondither View Post
Filter Lite + random = build number 5?

Floyd-Steinberg + random = build number number 7?
Almost. The other way round.

Quote:
Originally Posted by bacondither View Post
Anyway, after looking at your images i think that 5 and 7 looked the best but may have to revaluate the low noise ones.
And try the new build 9, based on Shiandow's new idea.

Quote:
Originally Posted by nevcairiel View Post
It does not. It uses a simple pixel shader to dither using a huge pre-defined matrix. Looks like 32x32 ordered dithering.
Oh, ok. Doesn't look bad at all, to be honest.
madshi is offline   Reply With Quote
Old 8th February 2014, 23:33   #22806  |  Link
Shiandow
Registered User
 
Join Date: Dec 2013
Posts: 753
Quote:
Originally Posted by madshi View Post
Hmmmm... It's interesting how you modified one of the Floyd-Steinberg weights to be applied on a different pixel! Had to modify my error diffusion kernel code to make that possible. After some testing I decided on using a random value of 0.5 instead of 0.2, though, for switching between the 2 different weight sets. A switch value of 0.2 resulted in visible 16x16 block edges. It seems that "my" weights are better at hiding the block edges. A value of 0.5 with your suggested algorithm produces nicely hidden block edges, and still has a very similar look to 0.2, from what I can see. Here's a test build using your suggestion:

http://madshi.net/madVRedtest2.rar

I like what I'm seeing here! Maybe it could even replace both the low-noise and medium-noise algorithms? I would like that, only having one error diffusion algorithm. Opinions?
It seems to perform as well as I'd hoped, maybe even better. Your weights do seem to be better at hiding boundary errors, I thought a value of 0.2 would be enough to have this effect without adding to much noise but it doesn't seem that raising it to 0.5 has introduce that much more noise.

From what I can see it seems to perform as well as build 2 but with some randomness, which seems ideal. Hopefully others will have the same result.
Shiandow is offline   Reply With Quote
Old 8th February 2014, 23:36   #22807  |  Link
6233638
Registered User
 
Join Date: Apr 2009
Posts: 1,019
Quote:
Originally Posted by madshi View Post
Here's a test build using your suggestion:

http://madshi.net/madVRedtest2.rar

I like what I'm seeing here! Maybe it could even replace both the low-noise and medium-noise algorithms? I would like that, only having one error diffusion algorithm. Opinions?
This does look slightly better than #2 in some cases. In others, there's no meaningful difference.
While I know it's not a priority, it does introduce noise on black when used with 3DLUTs.

The black level being raised by this is an obvious difference on my display, the slight changes in dither pattern between #2 and #9 are marginal.
6233638 is offline   Reply With Quote
Old 8th February 2014, 23:42   #22808  |  Link
Skankee
Registered User
 
Join Date: Dec 2012
Posts: 17
I did a short test, from good to bad:
low noise:
4
2
6,8

high noise:
3
1
5
7


I like a low-noise picture, so my favourite is 4 and 2 (4 was only a little bit better)
with enhanced gamma you can see some square-pattern at 6 and 8 -depending on the grey-level.

Example:http://s7.directupload.net/images/user/140208/rgduj3ru.png

But even without this i like 4 and 2 more.


The "worm-artefacts" didnt bother me, they was not visible to me until i was extreme close to my monitor.



From the other ones i think 3 and 1 is ok; 5 and 7 looks too "rough". I cant see any benefit in high noise Dithering, so in general i would choose "low noise" > "high noise".
Skankee is offline   Reply With Quote
Old 8th February 2014, 23:50   #22809  |  Link
The 8472
Registered User
 
Join Date: Jan 2014
Posts: 51
Quote:
Originally Posted by madshi View Post
Tried the 1080p one, plays fine here.
I can get it to work if I uncheck everything but NV12 in the Lav Video output formats - i.e. the same that EVR-CP consumes. But considering the input format it's clearly the wrong choice. So either LAV or madVR is choking on Y416.
The 8472 is offline   Reply With Quote
Old 8th February 2014, 23:54   #22810  |  Link
madshi
Registered Developer
 
Join Date: Sep 2006
Posts: 9,140
Quote:
Originally Posted by The 8472 View Post
I can get it to work if I uncheck everything but NV12 in the Lav Video output formats - i.e. the same that EVR-CP consumes. But considering the input format it's clearly the wrong choice. So either LAV or madVR is choking on Y416.
Works fine here with Y416!

Quote:
Originally Posted by Shiandow View Post
It seems to perform as well as I'd hoped, maybe even better. Your weights do seem to be better at hiding boundary errors, I thought a value of 0.2 would be enough to have this effect without adding to much noise but it doesn't seem that raising it to 0.5 has introduce that much more noise.

From what I can see it seems to perform as well as build 2 but with some randomness, which seems ideal. Hopefully others will have the same result.
Quote:
Originally Posted by 6233638 View Post
This does look slightly better than #2 in some cases. In others, there's no meaningful difference.
While I know it's not a priority, it does introduce noise on black when used with 3DLUTs.

The black level being raised by this is an obvious difference on my display, the slight changes in dither pattern between #2 and #9 are marginal.
Ok, I've done a minor change in the weights, which seems to reduce stray dots a little bit. Maybe that fixes the problem with the noise on black, without hurting the image quality? Can you guys try and confirm?

http://madshi.net/madVRedtest3.rar (build 10)

Weights used now are (changes compared to build 9 in brackets):

Code:
Floyd-Steinberg:
0.5375  (+ 0.1)
0.0625
0.1875
0.3125
-0.1000  (- 0.1)

madshi:
0.7770
0.0000
0.0090
0.4861
-0.3098
Quote:
Originally Posted by Skankee View Post
I did a short test, from good to bad:
low noise:
4
2
6,8

high noise:
3
1
5
7

I like a low-noise picture, so my favourite is 4 and 2 (4 was only a little bit better)
with enhanced gamma you can see some square-pattern at 6 and 8 -depending on the grey-level.

Example:http://s7.directupload.net/images/user/140208/rgduj3ru.png

But even without this i like 4 and 2 more.

The "worm-artefacts" didnt bother me, they was not visible to me until i was extreme close to my monitor.

From the other ones i think 3 and 1 is ok; 5 and 7 looks too "rough". I cant see any benefit in high noise Dithering, so in general i would choose "low noise" > "high noise".
Yes, I mostly agree with you, except that I prefer 2 over 4. Try the new build 10. I hope it could be the new best low-noise solution.
madshi is offline   Reply With Quote
Old 8th February 2014, 23:57   #22811  |  Link
nevcairiel
Registered Developer
 
Join Date: Mar 2010
Location: Hamburg/Germany
Posts: 10,344
Quote:
Originally Posted by madshi View Post
Works fine here with Y416!
I get a null pointer crash in madVR when I play the 1080p file in MPC-HC with 0.87.4 release, just FWIW.
(also happens in the new build 10)

Edit:
Somehow related to the height. I hacked it to use 1032 as height instead (because thats a more aligned number), and the crash stops.
__________________
LAV Filters - open source ffmpeg based media splitter and decoders

Last edited by nevcairiel; 9th February 2014 at 00:06.
nevcairiel is offline   Reply With Quote
Old 9th February 2014, 00:07   #22812  |  Link
madshi
Registered Developer
 
Join Date: Sep 2006
Posts: 9,140
No crash here, using the latest test build, though. And rather old MPC-HC + LAV versions.
madshi is offline   Reply With Quote
Old 9th February 2014, 00:11   #22813  |  Link
6233638
Registered User
 
Join Date: Apr 2009
Posts: 1,019
Quote:
Originally Posted by madshi View Post
Ok, I've done a minor change in the weights, which seems to reduce stray dots a little bit. Maybe that fixes the problem with the noise on black, without hurting the image quality? Can you guys try and confirm?

http://madshi.net/madVRedtest3.rar (build 10)
If anything, this is actually worse for noise on black.

If the problem is that the 3DLUT is clipping values at 16, is there some way to fix the yCMS 3DLUT generation so that it doesn't? (preferably without requiring recalibration - but that may be unavoidable)
There's no reason for values below 16 to be clipped in the LUT that I can see.


If it helps, these are the values I'm using:
Code:
red,   Yxy, 0.2126, 0.640000, 0.330000
green, Yxy, 0.7152, 0.300000, 0.600000
blue,  Yxy, 0.0722, 0.150000, 0.060000
white, Yxy, 1.0000, 0.312713, 0.329016

5,   Yxy, 0.00105, 0.312713, 0.329016
10,  Yxy, 0.00593, 0.312713, 0.329016
15,  Yxy, 0.01535, 0.312713, 0.329016
20,  Yxy, 0.02865, 0.312713, 0.329016
25,  Yxy, 0.04665, 0.312713, 0.329016
30,  Yxy, 0.07030, 0.312713, 0.329016
35,  Yxy, 0.09950, 0.312713, 0.329016
40,  Yxy, 0.13400, 0.312713, 0.329016
45,  Yxy, 0.17480, 0.312713, 0.329016
50,  Yxy, 0.22100, 0.312713, 0.329016
55,  Yxy, 0.27800, 0.312713, 0.329016
60,  Yxy, 0.33390, 0.312713, 0.329016
65,  Yxy, 0.40280, 0.312713, 0.329016
70,  Yxy, 0.48000, 0.312713, 0.329016
75,  Yxy, 0.55800, 0.312713, 0.329016
80,  Yxy, 0.64300, 0.312713, 0.329016
85,  Yxy, 0.73200, 0.312713, 0.329016
90,  Yxy, 0.82750, 0.312713, 0.329016
95,  Yxy, 0.92500, 0.312713, 0.329016
100, Yxy, 1.00000, 0.312713, 0.329016
Obviously they won't look correct on your display, but should at least let you reproduce this.

I am only using the LUT for gamma correction (as grayscale/gamut corrections introduced banding) so perhaps there's another solution?
6233638 is offline   Reply With Quote
Old 9th February 2014, 00:11   #22814  |  Link
The 8472
Registered User
 
Join Date: Jan 2014
Posts: 51
Quote:
Originally Posted by nevcairiel View Post
Edit:
Somehow related to the height. I hacked it to use 1032 as height instead (because thats a more aligned number), and the crash stops.

Ah, I generated a 13x7 pattern and stretched it to the target resolution using NN to avoid making it being too "friendly" to madshi's 16x16 ED tiles.

Any way how I can narrow down who's the culprit here between lav, madvr and mpc-hc?

Last edited by The 8472; 9th February 2014 at 00:27.
The 8472 is offline   Reply With Quote
Old 9th February 2014, 00:30   #22815  |  Link
bacondither
Registered User
 
Join Date: Oct 2013
Location: Sweden
Posts: 128
Screenshots from big buck bunny with the brightness severly lowered in madvr to push many pixels to the low end of the 8 bit spectrum and then i brighten the image to reveal the dither noise in a image more realistic then solid grey bars...

A lot of pictures of a bunny with different dithering methods


Build 10 looks good but with a minimal grid pattern. Build 7 is free from artifacts and have a slightly higer noise level, but still it is lightyears lower then fully random dither.

Last edited by bacondither; 9th February 2014 at 00:43.
bacondither is offline   Reply With Quote
Old 9th February 2014, 01:17   #22816  |  Link
Shiandow
Registered User
 
Join Date: Dec 2013
Posts: 753
Quote:
Originally Posted by madshi View Post
Ok, I've done a minor change in the weights, which seems to reduce stray dots a little bit. Maybe that fixes the problem with the noise on black, without hurting the image quality? Can you guys try and confirm?

http://madshi.net/madVRedtest3.rar (build 10)
In my implementation this change seems to have a positive effect, although it is very subtle, it doesn't seem to change the response on near black colours.

Your original algorithm does seem to behave somewhat unusually on nearly black surfaces, it gives a pure black response in places where all other weights I tried have at least some lighter pixels.

Example.

The top uses the weights from build 10 and the lower half uses the 'your' weights. The weights from build 10 clearly have more white pixels in almost black areas. The behaviour from the original algorithm seems to be unusual for error diffusion algorithms. You could do so by changing 0.5375 back to 0.4375 but this seems to cause the 'banding' I pointed out earlier. From what I understand error diffusion simply shouldn't activate on these areas so I think it would be better to solve that problem instead of trying to solve it by changing the weights.

Edit: If you must solve it by changing the weights then simply scaling the weights by a factor 16/17 seems to have a better effect.

Last edited by Shiandow; 9th February 2014 at 01:43.
Shiandow is offline   Reply With Quote
Old 9th February 2014, 01:57   #22817  |  Link
cyberbeing
Broadband Junkie
 
Join Date: Oct 2005
Posts: 1,859
So far I've only done one test pattern test (next I'll need to do real content tests), but here are my initial results:

_____

Top 6 (best to worse) for the ones which appear random:
7
3
9
10
5
1

Notes for random set:
7 has the most uniform distribution of noise out of all of them by far, which results in lowest distortion and sharpest result
5 & 7 do not have any dithering artifacts, and have fine-grained noise
3 has the lowest noise on black, and has medium-grained noise
1 has large-grained noise, and bad crosstalk, and extreme amount of noise on black
9 & 10 seem similar to 3, but with larger checkerboard patterns

_____

Top 5 (best to worse) for the ones which have non-random patterns:
2
"directcompute test build 3"
6
8
4

Notes for non-random set:
6 is unique, as the only only which does not add even a single dot of noise to black with my 3DLUT.
8 has bad crosstalk, 2 & 4 have moderate crosstalk, 6 has the lowest crosstalk
6 & 8 produces rather distinct 16x16 blocks in its pattern.
2 & 4 have vertical lines in their patterns.
4 has chunky pattens
I've listed directcompute test build 3 here as well, since it has slightly different behavior then the others.

_____

Edit: Added 9 & 10

Last edited by cyberbeing; 9th February 2014 at 13:49.
cyberbeing is offline   Reply With Quote
Old 9th February 2014, 02:11   #22818  |  Link
Olivier C.
Registered User
 
Join Date: Jan 2014
Location: France
Posts: 76
Did you try ICM color managment and untick "Disable gamma ramp" ? I think it can work
Olivier C. is offline   Reply With Quote
Old 9th February 2014, 02:41   #22819  |  Link
6233638
Registered User
 
Join Date: Apr 2009
Posts: 1,019
Quote:
Originally Posted by cyberbeing View Post
7 has the most uniform distribution of noise out of all of them by far, which results in lowest distortion and sharpest result
To me, 7 seems very noisy near black compared to some of the others. It also seems to display noise in horizontal bands with some shades.

Extremely brightened example of what's happening on black:


These "lines" can be noticeable at a distance, and have shown up in other shades near black.

Quote:
Originally Posted by cyberbeing View Post
9 & 10 seem similar to 3, but with larger checkerboard patterns
I find that while there are "checkerboard patterns" visible when you zoom in, they are almost completely invisible when viewing normally - which cannot be said for some of the other dithering artifacts.

Quote:
Originally Posted by cyberbeing View Post
2 & 4 have vertical lines in their patterns.
That's true, but it's very subtle with #2.

Ultimately, it seems to be a trade-off between "perfect" dithering which seems to be noisy, or making a slight trade-off when inspected at large magnifications, for a perceptually better image.
6233638 is offline   Reply With Quote
Old 9th February 2014, 03:28   #22820  |  Link
cyberbeing
Broadband Junkie
 
Join Date: Oct 2005
Posts: 1,859
Initial test on real-world (anime) content.

Top 5 (best to worse) for the ones which appear random:
7
5
3
9
10

Notes:
7 remained the sharpest of the bunch, with lower distortion than 5
7 & 5 did not have any patterns, but were more noisy
3 has the smoothest result, with very few noticeable patterns
9 & 10 both had very noticeable patterns, and performed very poorly around source banding.


Quote:
Originally Posted by 6233638 View Post
Quote:
Originally Posted by cyberbeing View Post
7 has the most uniform distribution of noise out of all of them by far, which results in lowest distortion and sharpest result
To me, 7 seems very noisy near black compared to some of the others. It also seems to display noise in horizontal bands with some shades.
I cannot reproduce this. 7 is the most uniform out of the random ones, even on black. Though I do agree it is the most noisy of this 3,5,7,9,10 bunch near-black, but still a far cry from the extreme noise 1 and 'random dither'.

Video black brightened with Levels + Curves in Photoshop with my madVR 3DLUT active:
ED3 | ED5 | ED7 | ED9 | ED10

ED10 produces vertical line clumps on black.
ED9 has clumps.
ED7 is relatively uniform, yet most noise because of this.
ED5 has clumps.
ED3 is very low noise with clumps.

I'm curious how you producing those "extremely brightened" images, and beginning to suspect your 3DLUT is compensating for a display which has erratic behavior near-black. Do some of your dither pixels on black and near-black have an Red, Green, or Blue value greater then +1 compared to the surrounding pixels?

Last edited by cyberbeing; 9th February 2014 at 04:38.
cyberbeing is offline   Reply With Quote
Reply

Tags
direct compute, dithering, error diffusion, madvr, ngu, nnedi3, quality, renderer, scaling, uhd upscaling, upsampling

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 21:52.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.