Log in

View Full Version : Blocks and grain due to color?


eriler
15th July 2012, 13:43
Hi,

I have a problem in one of the encodes i am making, which is that there is blocks and and grain in the encode which won't go away with deblocking or debanding or degraining or smoothing.
Only thing that i have gotten to bite on it has been color correction.
This problem is also very apparent during fade-in/outs.
Here are some screenshots showing my problem; the first screenshot in each comparison being my encode, which has the problem, and the second on being a different person's encode which does not have the problem.

http://screenshotcomparison.com/comparison/135718
http://screenshotcomparison.com/comparison/135218
http://screenshotcomparison.com/comparison/135216
http://screenshotcomparison.com/comparison/135230

I have tried numerous different color corrections, but cannot seem to get it to look the same on all the screenshotcomparisons against the one encode im comparing against. If one looks about the same, the others doesn't. The fade-in (First screenshot) i have never been able to make look the same.

Is there some filter or anything which can help me with this here?
Or do i just have to keep trying to get the color correction working? I have tried and tried with the color correction, but it just won't look the same.

Thanks for any help.

Emulgator
15th July 2012, 18:30
Post your script.

Taurus
15th July 2012, 18:55
Post your script.
and/or your encoder settings x264/xvid/mpeg2/blah/blah

eriler
15th July 2012, 22:01
I have tried several scripts, they mostly consist of degraining, debanding, some sharpening, and maa(), but i'll post the one i used for those screenshots


ColorMatrix()
tfm()
crop( 0, 0, -4, 0)
Spline64Resize(720,480)

Tweak(bright=-3)
Tweak(cont=1.10)

Gradfun2dbmod(thr=1.4,thrC=1.8,str=1.0,temp=60,adapt=64)
f3kdb(dither_algo=3)
flash3kyuu_deband(sample_mode=2,dither_algo=1,y=64,cb=64,cr=64,grainy=32,grainc=32)

setmtmode(2)
setmemorymax(768)

source = last
dbl=source.deblock(30)
dblD = mt_makediff(source,dbl,U=3,V=3)
shrpD = mt_makediff(dbl,dbl.removegrain(11),U=3,V=3)
DD = shrpD.repair(dblD,13)
d = dbl.mt_adddiff(DD,U=3,V=3)
fin = Soothe(d,dbl) # успокоение, если не нужно, можно убрать

DeGrainMedian(limitY=4, limitUV=6, mode=3, interlaced=false, norow=false)
maa()
asharp(1.0,2.5,0.25,hqbf=true)

And the x264 encoder settings are
--crf 13 --preset slower --tune animation --aq-strength 1.0 --deblock 0:0 --merange 38 --bframes 16 --b-pyramid strict --no-fast-pskip --subme 11 --rc-lookahead 48 --sar 32:27

Emulgator
17th July 2012, 11:20
Strange script. I can't tell what you want to achieve.
First tweak, then dither 3 times, then deblock, then degrain, then sharpen ?
A sample of the source would be helpful.

eriler
17th July 2012, 16:24
Ah, yes, i'm aware it's a strange script, like i said, i had this problem with this about every script i've made and tried, but with pretty much the same result with the grains and blocks. So to see if debanding it very much pluss deblocking and degraining it would help, i tried that, but it didn't give satisfactory results.
Tweaking the color is the only thing that's fixed it to some extent, though not perfectly as you can see.

Here's a sample http://www.mediafire.com/download.php?3355i76nn0ca6s5

poisondeathray
17th July 2012, 17:18
I'm confused as to what you're trying to do with all those filters. The source is quite good (i.e. the preview without any filters except IVTC looks fine)

If you're having problems with fade encoding, then you can use zones and a bitrate multiplier, or try the --fade-compensate patch

eriler
17th July 2012, 21:55
If you're having problems with fade encoding, then you can use zones and a bitrate multiplier, or try the --fade-compensate patch

If is not only the fade that i am having problems with, it's the grains and banding and blocks that are all over the encodes.

Encoding the source without any filters aside from
ColorMatrix()
tfm()
crop( 0, 0, -4, 0)

Spline64Resize(720,480) # Spline64 (Sharp)


gives me alot of unwanted banding.
Adding debanding
ColorMatrix()
tfm()
crop( 0, 0, -4, 0)

Spline64Resize(720,480) # Spline64 (Sharp)
f3kdb(dither_algo=3) #deband
gives me lots of unwanted grains.

The script posted in the fourth post was just a sorry attempt at evening it out, though failed. I have like 20+ more of such examples in the folder with different scripts i've made and tried.

EDIT: This script fixes most of the banding and blocks and grain, however using this turns completely black scenes gray;
ColorMatrix()
tfm()
crop( 0, 0, -4, 0)

Spline64Resize(720,480) # Spline64 (Sharp)

ConvertToYV12()
Tweak(sat=1.4)
Tweak(bright=8)
Tweak(cont=1.10)

Guest
17th July 2012, 22:07
This doesn't address your main issue, but:

Tweak(sat=1.4)
Tweak(bright=8)
Tweak(cont=1.10)

should be replaced with:

Tweak(sat=1.4,bright=8,cont=1.10)

You don't need a separate call for each parameter!

poisondeathray
17th July 2012, 22:16
How are you taking screenshots? I think there is a problem there , and/or you have "filteritis" - you don't need to much of anything for this source. What decoder, what renderer, what software ?

If you don't use any filters, it looks like the 2nd mouse over (you dont even need colormatrix)

http://screenshotcomparison.com/comparison/135216

eriler
17th July 2012, 22:41
I use MPC-HC v1.5.3.3819 to take screenshots, and the codec i have is CCCP version 2011-11-11. I can add that both the screenshots of my encodes and the screenshots of the "target encode" are taken from the same MPC-HC on the same computer with the same CCCP.

And, indeed, without any filtering this screenshot looks pretty much the same, aside from the color correction; http://screenshotcomparison.com/comparison/136198


however if you play 1 or 2 seconds past this, you will find this:

http://screenshotcomparison.com/comparison/136199

Where the banding is pretty much gone due to the color correction target encode, while my non-colorcorrected encode still has the banding.

As the thread name implied, i was looking for any suggestions for colorcorrection that might help, if there's anyone that has good experience with this, or if there is any kind of filter which will fix this with colors. Because i have been unable to get my color correction to be satisfactory at all the points, and even if getting it to look pretty much similar to one screenshot of the target encode, it doesn't look similar to the other screenshots, no matter how many different colorcorrection combinations i've tried.

poisondeathray
17th July 2012, 22:56
I think you're using the wrong renderer. Something like VMR9(renderless). I think this is a playback/display issue. (The elevated levels is the giveaway) .

You don't need to color correct this. You don't need any filters (or minimal)

Take the screenshot of the no filter encode through avspmod

eriler
17th July 2012, 23:07
But, if this is a playback/display issue, how does it only apply to the encodes i made, and not to the other encode someone else made that i am trying to match?

Also, the .mkv encode i made from the sample with only IVTC seems fine in avspmod.

poisondeathray
17th July 2012, 23:09
Do you have more than 1 media player open at once? Only 1 can use the gfx overlay at a time. The other will use a different renderer hence the difference in appearance

eriler
17th July 2012, 23:10
I do indeed only have one open at a time.

poisondeathray
17th July 2012, 23:13
Then something else isn't configured properly, probably your graphics card settings or renderer .

If you preview each in avspmod or in vdub (the source, the encode, the "goal" ) they look very similar, correct ?

eriler
17th July 2012, 23:27
Yes, they do indeed.
Anyway, i will try encoding this on my laptop or a server instead of my desktop tomorrow hopefully, since i do not have time right now, and we'll see how it goes.

I also just tried to play the unfiltered encode on my laptop (computers connected by LAN), and it seemed fine as it did in the avspmod. I will try updating my CCCP codec tomorrow on my desktop as well (Got a different version on the laptop and servers then the current one on my desktop).

I will post back on how it goes. Thank you for all the help.

Emulgator
18th July 2012, 09:06
The source looks ok to me.

EDIT: This script fixes most of the banding and blocks and grain,
however using this turns completely black scenes gray;

ColorMatrix()
# called without arguments. Why, what for ?
tfm()
# tfm can be avoided. Just use DGIndex with Ignore Pulldown flags.
# Now you get the encoded frames, of which 100% shall be progressive in case of 100% Film.
crop( 0, 0, -4, 0)
# why, what for ? The source picture is already well aligned.
# The small border echo on the right side, well...
Spline64Resize(720,480) # Spline64 (Sharp)
# You stretch the picture content horizontally by doing so, intended?
ConvertToYV12()
# no need for that, coming from a DVD this is already YV12
Tweak(sat=1.4)
# ah, now we push colours a bit. Were there none ?
You may watch the result on a modern LCD TV, not on a laptop.
Tweak(bright=8)
# Yes, lifting brightness by 8 indeed turns blacks grey.
Tweak(cont=1.10)
# And now lets push contrast up.
# Holes in Histogram. Banding becomes visible.


The source was encoded properly, I saw no blocks,
the banding is to be expected for 8bit, the source contained the appropriate grain to mask it.
To remove this grain will make banding visible again.

Beside of that: Pushing any curve's (Y,U,V,R,G,B,etc.) in your case contrast's slope
above y=x leaves histogram holes, if not dithered or calculated in higher bitdepth like 16 or 32 bit.

You may want to comment in Histograms to see what you are actually doing with your script.

If you must tweak a source, then you might consider using SmoothAdjust() by LaTo.

This operates in 32bit float, dithers, histograms are supplied.