View Single Post
Old 28th November 2018, 10:57   #5  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,904
I downloaded your sample and it does have some issues.
First of all, whoever encoded it, thought that the content was Full Range (0-255) and applied a levels conversion in order to bring it to Limited Range (16-235), but the content was already in Limited TV Range (16-235 // 0.0-0.7V), so he screwed up blacks and whites by "compressing" them twice.

As you can see from the luma waveform, black is too high, at about 29, while it's supposed to be at 16:





As to the whites, they are not as high as they should be, but they have been clipped anyway, as you can see from this shot:



Once I manged to get blacks and whites at 16-235, I started fixing other issues like the pretty bad chroma which suffers from raimbowning artifacts:



Deraimbowning:



Last but not least, I noticed that there's a lot of noise as well.
Whenever I have to deal with noise, it's always up to the encoder: some people just want a clean picture at the expense of getting rid of details, other people just wanna preserve every single detail and are less prone to apply denoise.
In this case, there aren't many details anyway, so I applied a pretty strong denoise with 16bit precision - trying not to make banding - and then I applied debanding (at 16bit precision) just to be sure.
As a final step, I cropped inactive lines outside the safe area, I re-applied the borders and I upscaled to 16:9 848x480 via Spline64Resize.
This is the result:

Original:



Filtered:



Resized:



AVS Script:

Code:
FFMpegSource2("VTS_04_1.mpg", atrack=-1)

#Inverse Telecine
tfm(mode=1,pp=5,slow=2,micmatching=2,clip2=tdeint(mode=2,type=3)) 
tdecimate(mode=2, rate=23.976)

#Crop
Crop(10, 68, -10, -68)

#Levels adjustment
Levels(29, 1, 202, 16, 235, coring=false)

#Deraimbowning
ChubbyRain2(th=10, radius=10, show=false, sft=10, interlaced=false)

#Denoise with 16bit precision
dfttest(sigma=64, tbsize=1, lsb_in=false, lsb=true, Y=true, U=true, V=true, opt=3, dither=0)

#Debanding with 16bit precision
f3kdb(range=15, Y=45, Cb=30, Cr=30, grainY=0, grainC=0, sample_mode=2, blur_first=true, dynamic_grain=false,  opt=3, mt=true, keep_tv_range=true, input_mode=1, input_depth=16, output_mode=1, output_depth=16)

#Converting from 16bit stacked to regular 16bit
ConvertFromStacked(bits=16)

#Dithering down to 8bit with the Floyd-Steinberg error diffusion
ConvertBits(bits=8, dither=1)

#Adding borders back
AddBorders(0, 20, 0, 20)

#Little upscale to 16:9
Spline64Resize(848, 480)
Encoded file via x264, NeroAAC and MP4Box: https://we.tl/t-b1bzS4g3No


p.s as Manono said, if you don't think that the deinterlace I used is enough, you can try with QTGMC (it's gonna be slow, though).

Cheers

Last edited by FranceBB; 28th November 2018 at 11:01.
FranceBB is offline   Reply With Quote