Log in

View Full Version : 25i vs 50p (QTGMC) with x264 at the same bitrate


Livesms
5th June 2016, 14:07
Got 25fps interlaced source (DVB, TV show).
What is better way to encode it with x264 at the same bitrate
- leave interlaced and encode with --tff option
- deinterlace with QTGMC with double frame rate (50fps progressive) and encode as progressive at the same bitrate as planned for 25i source ?

Did some short test. Took a part (6000 frames, 720*576, DAR 16:9, 25 fps), encoded with x264 as interlaced (--tff) at 1150 kbps. Did the same encode at 1150 kbps but after deinterlacing (QTGMC - Slower).

Put both output files through Avisynth Compare (PSNR)
Compare( orig_video.QTGMC(), video25i.QTGMC(), "", "25i")
Compare( orig_video.QTGMC(), video50p, "", "50p")
and got
Overall PSNR: 40.9617 for 25i (then deintelaced and compared to deinterlaced original) and
Overall PSNR: 41.0287 for 25p (compared to deinterlaced original)...

Doubling framerate do not lead to quality loss at the same bitrate ?

Motenai Yoda
5th June 2016, 16:14
1- interlaced encoding usually is more efficient than encoding interlaced content as progressive, but it's still less efficient than encoding progressive content as progressive;
2- qtgmc include a denoiser, you can try with its losselss mode;
3- doubling framerate usually give almost identical couples of frames so don't take so much bitrate.

Livesms
5th June 2016, 16:18
1- interlaced encoding usually is more efficient than encoding interlaced content as progressive, but it's still less efficient than encoding progressive content as progressive;
2- qtgmc include a denoiser, you can try with its losselss mode;
3- doubling framerate usually give almost identical couples of frames so don't take so much bitrate.

1. I'm talking about encoding progressive as progressive (50p) and interlaced video as interlaced (--tff option for x264).
2. denoiser included with QTGMC enabled by default ?
3. Yes, deinterlacing with doubling framerate produce 2 almost indetial frames (with minimum difference) instead of 1 frame (interlaced with 2 fields).

Motenai Yoda
5th June 2016, 18:06
2. denoiser included with QTGMC enabled by default ?
qtgmc has a lot of stuff in it, you can find all about in the docs under Source Match / Lossless and Noise Bypass / Denoising
http://avisynth.nl/index.php/QTGMC

Livesms
6th June 2016, 10:59
Thanks. Tried to use denoise with QTGMC and got an error with dfttest.dll (will ask in QTGMC thread (http://forum.doom9.org/showthread.php?t=156028&page=109))

One more question - is there any avisynth plugin to provide comparing of two video as from visual quality (how similiar it looks to original in fact, not in ephemeral PSNR) ?

benwaggoner
8th June 2016, 23:06
1. I'm talking about encoding progressive as progressive (50p) and interlaced video as interlaced (--tff option for x264).
2. denoiser included with QTGMC enabled by default ?
3. Yes, deinterlacing with doubling framerate produce 2 almost indetial frames (with minimum difference) instead of 1 frame (interlaced with 2 fields).
In general, with a similarly good deinterlacer, native 25i encoding will provide better quality at a given bitrate than native 50p encode. The main advantage of encoding as deinterlaced is so that a particularly good offline deinterlacer can be used, and there is no dependence on the playback hardware having a good deinterlacer.

Still, there will certainly be content/bitrate combinations where 25i with a bad post-decoder deinterlacer will outperform 50p with a good pre-encode deinterlacer.

IIRC, in VC-1 we found a 20% advantage for 25i v. 50p in this case. It likely would be somewhat more for H.264 due to the availability of MBAFF.

Motenai Yoda
9th June 2016, 18:35
sure I can't get access to the high pro test clip and encoders of yours but, I made a quick test with parkrun_ter, with
assumetff()
qtgmc(SourceMatch=3, Lossless=2,NoiseProcess=1, NoiseRestore=1.0, Sigma=2.0 )
and only assumetff()

codec settings
"%~dp0avs4x26x.exe" -L "%~dp0x264.exe" --pass 1 -B 6000 --preset slow -o NUL %1
"%~dp0avs4x26x.exe" -L "%~dp0x264.exe" --pass 2 -B 6000 --preset slow --ssim --psnr -o %1_qtgmc.mp4 %1

"%~dp0avs4x26x.exe" -L "%~dp0x264.exe" --pass 1 -B 6000 --tff --preset slow -o NUL %1
"%~dp0avs4x26x.exe" -L "%~dp0x264.exe" --pass 2 -B 6000 --tff --preset slow --ssim --psnr -o %1_interlaced.mp4 %1

ssim is calculated with ssim() for both, psnr is the one x264 calculated

results are
interlaced ssim 77.32887 psnr 36.083
qtgmc ssim 81.72833 psnr 37.444

Livesms
13th June 2016, 20:45
All in all... got tons of DVB video - MPEG-2 (PAL), 720*576 (16:9), 25 FPS, Interlaced (TFF), ~3100 kbps

Need to reencode all video to free some space. Decided to reencode with x264 for 0.10 bit per pixel (~ 1100 kbps).

What way is better - reencode with x264 as interlaced or deinterlace it to progressive (50 fps) and reencode as progressive (50 fps) as the same 1100 kbps...

benwaggoner
14th June 2016, 06:36
results are
interlaced ssim 77.32887 psnr 36.083
qtgmc ssim 81.72833 psnr 37.444
I would expect that as fps goes up, SSIM and PSNR values that correlate with a given perceptual quality would go down.

There's probably no short cut to doing a visual comparison for this.

Motenai Yoda
15th June 2016, 12:24
I've done another comparison with all four ldv's 576i25 sequencies
while x264 preserve deinterlaced one's "structure" better, combed parts seems to force it to mantain fine details/high frequencies (or generate some sort of grain).
https://www.sendspace.com/file/616xsx

likely with further high bitrate 25i will outcome 50p even on the structure