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 > General > Newbies

Reply
 
Thread Tools Search this Thread Display Modes
Old 10th November 2022, 02:10   #61  |  Link
Katie Boundary
Registered User
 
Katie Boundary's Avatar
 
Join Date: Jan 2015
Posts: 1,048
Actually, here's a fun experiment for you to try, with the numbers adjusted for PAL/SECAM material

Code:
A=mpeg2source("whatever.d2v").bob()

B=mpeg2source("whatever.d2v").converttorgb(interlaced=true).separatefields()

C=B.selecteven().bicubicresize(720,576,src_left=0,src_top=0.25,src_width=720,src_height=288)
D=B.selectodd().bicubicresize(720,576,src_left=0,src_top=-0.25,src_width=720,src_height=288)

E=interleave(C,D)

Compare(A,E)
You'll find naught but rounding errors
__________________
I ask unusual questions but always give proper thanks to those who give correct and useful answers.
Katie Boundary is offline   Reply With Quote
Old 10th November 2022, 14:20   #62  |  Link
flossy_cake
Registered User
 
Join Date: Aug 2016
Posts: 605
What I meant was, you're shifting the top field up by 0.25 and the bottom field down by 0.25, which in theory should be equivalent to shifting only the bottom field down by 0.5, which is how I was doing it (which is equivalent to shifting it down by 1.0 after the field is upscaled 2x vertically, which helps me visualise in my mind that the field alignment is preserved).

I was just curious to know why you did the 0.25/-0.25 split instead of 0/-0.5 split, whether that had any benefits (I was thinking, maybe that would help with line flicker at the top and bottom most rows of pixels?)

Last edited by flossy_cake; 10th November 2022 at 15:20.
flossy_cake is offline   Reply With Quote
Old 10th November 2022, 15:20   #63  |  Link
flossy_cake
Registered User
 
Join Date: Aug 2016
Posts: 605
Quote:
Originally Posted by Katie Boundary View Post
Actually, here's a fun experiment for you to try, with the numbers adjusted for PAL/SECAM material

You'll find naught but rounding errors
Test clip: https://drive.google.com/file/d/1WfW...usp=share_link

Script
Code:
clip = "576i 1-1 cadence.ts"
source = LWLibavVideoSource(clip)

A=source.bob()

B=source.separatefields()
C=B.selecteven().bicubicresize(720,576,src_left=0,src_top=0.25,src_width=720,src_height=288)
D=B.selectodd().bicubicresize(720,576,src_left=0,src_top=-0.25,src_width=720,src_height=288)
E=interleave(C,D)

Compare(A,E)
Result



I am not sure why PSNR is showing that value or what it means exactly, but if I replace last line with Compare(A,A) I get the same result.

Then compared the 0.25/-0.25 split vs 0/-0.5 split and they are not the same, obviously. But I think that is just because both bobbed frames are sitting 0.25 higher in the former.
flossy_cake is offline   Reply With Quote
Old 23rd November 2022, 12:12   #64  |  Link
flossy_cake
Registered User
 
Join Date: Aug 2016
Posts: 605
Quote:
Originally Posted by hello_hello View Post
Are you familiar with the resizing mess for DVDs?
The short story is DVDs can have a generic aspect ratio, which makes a 4:3 DVD exactly 4:3, or an ITU aspect ratio which follows the standard for digitising video, and as a result the aspect ratio could be ~1.36 instead of 1.33 (before any cropping). I'm pretty sure I went with an ITU aspect ratio for the DVD version, and the first thing I noticed when comparing it to the Bluray was the difference in aspect ratio, which looks to be exactly the difference between a generic and ITU aspect ratio for DVDs. Here's a couple of screenshots. Have a look at the clock-face on the left. I'll leave you to decide in which screenshot it looks round, or for that matter, if it's even supposed to be round.

https://i.ibb.co/tJXf43p/DVD-Encode.png
https://i.ibb.co/61qLbTy/Bluray.png

Out of curiosity I bought the newest version of the DVD ("remastered" one, specifically this one which was referenced here as being superior to the BD).

Well, the DVD aspect is identical to the BD, except the BD is slightly zoomed in to remove a few pixels of blanking at the bottom edge present on the DVD.

Oddly though, the external shots are a lot worse on DVD in terms of colour and resolution, except for the intro sequence.

Edge enhancement seems present in the DVD too, but diminished probably as a result from the downscale from 1080 to 576. Noise reduction is not present in the DVD it seems.

Screenshots:

DVD: https://i.lensdump.com/i/RR6Hyr.png
BD: https://i2.lensdump.com/i/RR6Oe7.png

DVD: https://i3.lensdump.com/i/RR6S73.png
BD: https://i1.lensdump.com/i/RR6zRF.png

DVD: https://i2.lensdump.com/i/RR6eU0.png
BD: https://i.lensdump.com/i/RR6vID.png

Clips:

DVD: https://drive.google.com/file/d/1qcU...usp=share_link
BD: https://drive.google.com/file/d/1a-N...usp=share_link

DVD: https://drive.google.com/file/d/1pAw...usp=share_link
BD: https://drive.google.com/file/d/1tw9...usp=share_link

Last edited by flossy_cake; 23rd November 2022 at 12:17.
flossy_cake is offline   Reply With Quote
Old 23rd November 2022, 18:00   #65  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,823
Yeah it looks like they started again with the outside shots for the Bluray but not for the DVD. Like they decided to go back to the original film negative or something.

The inside shots do seem to have the same display aspect ratio but the outside shots are a tad different. The Bluray version is a little wider, but not 1.36 vs 1.33 wider. It's something in-between. Sigh....
hello_hello is offline   Reply With Quote
Old 23rd November 2022, 20:40   #66  |  Link
flossy_cake
Registered User
 
Join Date: Aug 2016
Posts: 605
Well, on balance I think I prefer the bluray version. What do you think?
flossy_cake is offline   Reply With Quote
Old 23rd November 2022, 20:45   #67  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,823
I haven't tried de-interlacing the DVD sample to see if de-interlaces more "cleanly", but assuming it doesn't, yes I'd prefer the bluray, at least for the outside shots.
hello_hello is offline   Reply With Quote
Old 24th November 2022, 06:13   #68  |  Link
flossy_cake
Registered User
 
Join Date: Aug 2016
Posts: 605
For those screenshots I was using AMD DXVA deint, and now that I look closely I'm seeing some weird squiggly line patterns in the video noise on Basil's coat. BWDIF(thr=2) doesn't have that and seems to be producing a better result. imo the best fast real-time video mode deinterlacers are, from best to worst:

1. BWDIF(thr=2) (can optionally add edeint=nnedi3 for antialiasing on moving pixels... but I don't like the shapes it makes on certain patterns...but still impressive what it can do)
2. TDeint
3. DXVA (AMD/NVidia implementation... I can only get this through MadVR... maybe someone should make an Avisynth filter for this? )

But without the thr param I would pick TDeint over BWDIF as it weaves a lot more.

Last edited by flossy_cake; 24th November 2022 at 06:22.
flossy_cake is offline   Reply With Quote
Old 24th November 2022, 12:54   #69  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,823
Quote:
Originally Posted by flossy_cake View Post
3. DXVA (AMD/NVidia implementation... I can only get this through MadVR... maybe someone should make an Avisynth filter for this? )
Is cuvid still I thing? I'm using on old version of MPC-HC as the newer flavours don't support XP. DXVA2 doesn't work but Cuvid DXVA does in LAV filters and the deinterlacing works but my old video card can barely de-interlace to 25fps at 1080p.

For funzies I enabled the old ffdshow DXVA decoder and it worked. I couldn't get it to decode with MADVR rendering for some reason, but using WMR9 it did (EVR doesn't play on XP any more). The video was being de-interlaced and it played a 1080p source smoothly even though I'm pretty sure it was de-interlacing to 50fps, although it has no de-interlacing options. It also only supports h264 and VC1.

It's been so long since I've wanted to watch interlaced video I had to work out why MPC-HC wasn't de-interlacing any video at all before I started.... given my "de-interlace once, do it properly, re-encode as progressive and it's done for good" philosophy.

Now I've had another look with de-interlacing enabled I'll take back what I said about the DVD quality. The video sections look better on the bluray too. Less noise and artefacts etc.

PS Did you try my decoding and deinterlacing suggestion in the TIVTC thread? Even if you just use TDeint and none of the other filtering I'm curious to learn if it works for the whole video. I think the sample encode I uploaded looks better in general than the original DVD, although there's probably still some room for a slight improvement. I didn't experiment much with filter options.

Last edited by hello_hello; 24th November 2022 at 13:09.
hello_hello is offline   Reply With Quote
Old 28th November 2022, 21:28   #70  |  Link
flossy_cake
Registered User
 
Join Date: Aug 2016
Posts: 605
Quote:
Originally Posted by hello_hello View Post
Interesting. The consensus has always been DVD video doesn't contain that sort of information. I don't think any encoding GUIs look for it. I'll check any DVDs I encode from now on.
You were right about this -- it must have been the ripping software that changed the aspect ratio for Garth Marenghi's Darkplace to 1.30:1 as I have the original DVD disc now and the dwpictAspectRatioX/Y is 4/3, 720x576 with active picture area 704x576.
flossy_cake is offline   Reply With Quote
Old 20th December 2022, 15:04   #71  |  Link
flossy_cake
Registered User
 
Join Date: Aug 2016
Posts: 605
Quote:
Originally Posted by flossy_cake View Post
Well, on balance I think I prefer the bluray version.
Reconsidering this. It looks like BBC has upscaled for the BD in such a way that for static parts of the image, both fields are upscaled independently of eachother and then weaved back together. Ideally they should be weaved first before upscaling.

I've seen this artefact before - TV broadcasters sometimes use it in my area and it's bad cause it screws up the field alignment and gives a mice teeth effect on static unmoving parts of the image:

DVD


BD


Source images: DVD, BD

Both taken from remux sources & deinterlaced with BWDIF(field=-2, thr=2).

And yeah, the BD version *still* manages to look cleaner and subjectively "better". DVD version has too much compression artefacting imo.

edit: hmm, I'm wondering if it's possible to repair the BD with Avisynth... perhaps something like reverse deinterlacing where we pick out the 1920x540 fields and downscale them to back to 720x288, weave to 720x576, then deint.

edit: looks like it only affects S01E02, S01E03 & S02E03.

Last edited by flossy_cake; 20th December 2022 at 16:01.
flossy_cake is offline   Reply With Quote
Old 21st December 2022, 16:44   #72  |  Link
flossy_cake
Registered User
 
Join Date: Aug 2016
Posts: 605
Quote:
Originally Posted by flossy_cake View Post
edit: hmm, I'm wondering if it's possible to repair the BD with Avisynth... perhaps something like reverse deinterlacing where we pick out the 1920x540 fields and downscale them to back to 720x288, weave to 720x576, then deint.

edit: looks like it only affects S01E02, S01E03 & S02E03.
This seems to work

Code:
SeparateFields()		# 1920x1080i25 -> 1920x540p50
LanczosResize(1920, 288)	# 1920x540p50 -> 1920x288p50
Weave()				# 1920x288p50 -> 1920x576i25
BWDIF(field=-2, thr=2)		# 1920x576i25 -> 1920x576p50
Sharpen(0, 0.5)			# compensate for softening caused by excess scaling
LanczosResize(1920, 1080)	# aspect
The resulting image is smooth and gets rid of the mice teeth artefacts on the test scene, but still looks softer than the DVD on fine details like the wreath pattern on the floor.

Worse still is that many scenes in the same episode don't have the mice teeth artefacts and the above code ends up destroying the image quality on those scenes (effectively 288p on everything).
flossy_cake is offline   Reply With Quote
Old 24th December 2022, 15:28   #73  |  Link
Katie Boundary
Registered User
 
Katie Boundary's Avatar
 
Join Date: Jan 2015
Posts: 1,048
Quote:
Originally Posted by flossy_cake View Post

I am not sure why PSNR is showing that value or what it means exactly, but if I replace last line with Compare(A,A) I get the same result.
A PSNR value of ~107 means that there's no difference between the two video streams.

Quote:
Originally Posted by flossy_cake View Post
Reconsidering this. It looks like BBC has upscaled for the BD in such a way that for static parts of the image, both fields are upscaled independently of eachother and then weaved back together. Ideally they should be weaved first before upscaling.

I've seen this artefact before - TV broadcasters sometimes use it in my area and it's bad cause it screws up the field alignment and gives a mice teeth effect on static unmoving parts of the image:
Yeah, he DVD releases of Babylon 5 had the same issue as a result of cropping everything to 360i widescreen and then upscaling back to 480i. There are at least two threads on the subject if you're willing to hunt for them.
__________________
I ask unusual questions but always give proper thanks to those who give correct and useful answers.
Katie Boundary is offline   Reply With Quote
Old 25th December 2022, 18:50   #74  |  Link
flossy_cake
Registered User
 
Join Date: Aug 2016
Posts: 605
Quote:
Originally Posted by Katie Boundary View Post
Yeah, he DVD releases of Babylon 5 had the same issue as a result of cropping everything to 360i widescreen and then upscaling back to 480i. There are at least two threads on the subject if you're willing to hunt for them.
As someone who is recently getting into DVDs and could have easily accidentally purchased them instead of the Blurays, I'm glad I got the Blurays instead! But the HD resolution makes it look a bit more like "actors on a set"

I was reading through your "in defence of bob" thread from 2016. I just wanted to comment that I think if it's bobbed from say 576i to 576p50 and then not scaled any more after that, then it should appear close to true 576p. The reason I think so is because the field alignment is preserved, and "persistence of vision" gives the effect of weaving the two fields when they are flashed rapidly at 20ms (this won't be visible in a static screenshot of a single bobbed frame). It's basically like it would appear on a CRT but with the black lines replaced with interpolated lines.

But, I think if we take the bobbed 576p50 and then scale it to something else like say 1080p50, the alignment of the fields inside the bobbed frames is not preserved anymore and I wouldn't really call it 576p. But I wouldn't call it 288p either. imo it's like somewhere in between.
flossy_cake is offline   Reply With Quote
Old 27th January 2023, 07:25   #75  |  Link
flossy_cake
Registered User
 
Join Date: Aug 2016
Posts: 605
A lot of these late 90's early 00's shot on video camera TV series use this horrid technique where they shoot at 576i50 or 480i60 and then in post production use "drop field" to make it into 576p25 or 480p30 where field1 is a carbon copy (or thereabouts) of field2. Basically just copy pasting field1 into field2.

The problem with this isn't just that the vertical resolution is halved. It seems to create an additional problem where it can create deinterlacing artefacts, because if we interpolate field1 and interpolate field2, and show them consecutively, the whole frame will jump up and down by 1px because of them being identical images spaced 1px vertically apart. So if you're using Bob() then the whole frame will jump up and down much more severely than usual, and even mocomp deint like BWDIF(field=-2) or TDeint(mode=1) will jump up and down 1px on just the moving parts of the image only which is still a bit noticeable.
flossy_cake is offline   Reply With Quote
Reply

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 18:49.


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