Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Let's talk De-Interlacing
Since most PS2 games run in interlaced resolutions of 480i (448i) I think each and every user of PCSX2 should clearly understand the mysterious F5 button and what is does.
And since I didn't find a thread that explains these de-interlacing option thoroughly with a good following discussion (hopefully), I decided to create one.

History and science (you can skip that):
Quote:Back in the PS2 era most TVs were CRTs which were designed to display interlaced (480i) resolution, and everything looked perfectly fine.
When HDTVs popped up, interlaced content showed sever stripes (combing) in motion on the progressive HDTV display.

Why is that?
Because LCDs use "sample and hold" to display a picture, while a CRT draws a single line to to bottom vertically per frame.
Also, on a CRT a single 240 frame with black lines every other scan-line looked coherent (NES, Genesis and SNES for example),
while on the LCD it looked.. well.. like a comb.
Thus, Even 240p frame followed by a Odd 240p frame which is interlaced content, looks great on a CRT but weaved/combed on an LCD.

We want to fix how interlaced content looks on an progressive LCD screen, this is where De-Interlacing comes in.
I'll try to explain in detail what every de-interlacing option in PCSX2 does, but I may need some correction.

First, here is an old quote from the forum:
Quote:* Weave: Does not really deinterlace at all; takes pairs of fields and puts them together (every other line) to one frame. Guaranteed to have artifacts unless the clip is completely static.

* Field blending: Takes consecutive pairs of fields and blends them together into one frame by averaging pixel values. Usually causes funky ghosting artifacts (since in an interlaced clip, each field is at a temporally separate point). Obviously very blurry since you effectively lose half the spatial resolution as well as half the temporal resolution (blending halves the frame- or fieldrate since every two fields are combined to one frame, so instead of 60 fields/s you get 30 frames/s).

* Bobbing/line doubling: Doubles the height of each field, effectively making each field its own frame. Also shifts the field slightly up or down so the picture won’t appear to jump up and down slightly. Quality depends on the quality of the resizing filter, but like blending it’s blurry since half the vertical resolution is lost in the upscale.

* Auto: Tries to find the correct setting for interlaced content, 99% of the time it selects Blend bff.
But there are games that display progressive content but report Interlaced, in these games Auto will select None.
More info:

* None: Doubles the line of a single frame from Even lines 240p to 448p and displays it, then doubles the line of the next single frame from Odd lines 240p to 448p and displays it.
The result looks as though it is  half the resolution of the intended 448 image with slight flickering, very much like Bob but less filtered.
BUT, in some games (GTA-VC, THPS3, SSX3), None actually looks like progressive content while still reported as Interlaced... strange.
edit: Apparently some games run at 30fps and output 60fps interlaced, so None or Weave will actually look like full frame 448p progressive at 30fps.

If you are interested to see how the original image looked on a CRT without extra blur of deinterlacing filtering or loss of resolution, set it to "Weave bff".
Make the Window Size to x2 integer of the reported vertical resolution, for example 1200x896 if the reported is 448i.
Also, turn off "Texture Filtering of Display" in GSdx Shader Configurations.
This only looks good on static images, since Weaving is much like Blending but without blending. Smile
This will result in a sharp and clean image much like a progressive image looks like on a progressive LCD monitor, but with visible comb effect in motion.

I think PCSX2 lacking a true NONE option where it displays Even 240p field then Odd 240p field, without filling the black lines like the regular None does.
This will display the content exactly like a CRT in its original resolution, but will have terrible comb effect and flickering, much worse than "Weave bff".

Personally, I still think that hardware PS2 on a Sony Trinitron CRT looks the best, but PCSX2 is getting there.
IMO, all de-interlacing options in PCSX2 have their minuses, like loosing spatial resolution, blurring, shaking, or combing, but mostly Blur.. blur on everything.
What do you think about Bob, Weave, Auto, None de-interlacing options, and do you think they can be further improved?


Sponsored links

well... the thing with the lines is, it can not be scaled and interpreted correct. or it doesn't matter. the lines are resampled. a 240 backbuffer with interlace (2x) would produce 480 correct interlaced lines. doing 448 you need a 224 backbuffer.

and... when you upscale 448 or 480 to 1080 you still have fractional line ratios (2.4107 or 2.25) when resampling the output to your native screen resolution. every 2.4107th or 2.25th uses a 'wrong' line offset. doing a double line. i have the luxury of a native 900p screen. if i'd pad 4 lines (2 top 2 bottom) i could upscale pixel accurate 2 x 448. that means in progressive mode, and without loosing details or 'duplicating' or 'sampling' wrong lines. in 480p resampling i'd loose. everyone would.

just for the heck. internal 448 in 900p. to be expected 4 lines with 'artefacts'. to note that the width is f*cked. it's not 1280. cause 900 / 960 * 1280 is 1200. wrong math. it should need a crop to 448 (backbuffer) ratio not the output aspect, of 2x480 roughly, here.

[Image: VemMPoC.png]

it's not relevant to interlaced mode, but you get the gist. producing a correct upscaled interlace means you gotta internally render explicit the half of your screen resolution/height to not f*ck up the interlace resampling with some odd 2x or 2.x 480 stuff.

and for interlacing relevance. a gt4 half frame. height is 224. not 240. this may be something that should be fixed. not upping interlaced mode with 480 aspect. i know this game looks a lil blurry.

[Image: hXrXE18.png]
I've always used bob. I never noticed the halved vertical res. I guess to compensate I'll have to just run my games at 3840 4320.
The scaling matter is all perfectly understood; When I say 480i I mean full NTSC frame and I realize that games usually use 448i.
On a typical 1080p HDTV the only vertical integer of 448 (typical NTSC usual game) is 896, that's why I suggested 1200x896, this window resolution will have perfect vertical integer scaling for the current PCSX2 build that doesn't have Integer Scaling (yet).

As for deinterlacing modes, they all compensated in some way.
Bob has lower vertical resolution and shaking, Blend has lower temporal resolution in motion (blur), Weave has combing artifacts.
So the they all are flawed in some way, but that they are fast and do the job on-the-fly without much processing.
A more complex deinterlacing technique like YADIF will have too great delay time for realtime gaming.
(01-09-2018, 06:55 AM)James-F Wrote: @dabore
The scaling matter is all perfectly understood; When I say 480i I mean full NTSC frame and I realize that games usually use 448i.
On a typical 1080p HDTV the only vertical integer of 448 (typical NTSC usual game) is 896, that's why I suggested 1200x896, this window resolution will have perfect vertical integer scaling for the current PCSX2 build that doesn't have Integer Scaling (yet).

yep. i get this 896 line thing. i was working on the code yesterday. mess coder me. the problem are the huge black bars in 1080 (which i can't even test. i only got 900). and i'm not sure if 1200 is correct to do. when upscaling from a lower backbuffer width (like 512 - see zoe2 snapshot, i think dmc does it too, i gotta search the disc) it doesn't matter, cause the lines should be filtered anyway. but when upscaling from precise 640 width it should rather be 1280, the pixel accurate 2x. when doing this with x448 it's loosing the aspect ratio, it's not 4:3 anymore, but on a widescreen with space left it doesn't matter at all, and the picture quality is far superior. less horizontal (line) scaling artefacts and no real point sample aliasing even. it could be avoided and emulated if the final screen output would be rendered as linear filtered lines. similar as on a tv, the pixels would me analogue smudged to fit. thing is, on an lcd i'd rather have the "as crisp as possible" picture. hence, rather bogus the specs. Smile
Working on an Integer Scaling code?
It is almost done:
I've tested it and it works perfectly;
There is an option to scale to 224 (filed) or 448 (frame) integers, also there is a Center option and 1:1 scaling.

The horizontal resolution is much less important in Integer scaling than proper Vertical resolution scaling, this is true for all low resolution emulation if no filtering is used afterwards.
Bilinear filtering fixes non integer scaling but it is very blurry when simply stretching 448 image to 1080, but there is a fix for that too, overscaling then downscaling, ie. x5 or x6 scaling of 448 then back down to 1080.
I use the overscaling technique with all my emulators and the result is great scaling with almost no blur.

The problem with "as crisp as possible" with on-the-fly deinterlacing as Bob or Blend is that it's not possible, both lose too much information to be crisp.
This can be done with more complex deinterlacing but as already said, it will add too much lag time to be playable, therefor it is only good for video.

I like crisp picture also, so Integer scaling and Weave bff are great options even though combing is visible in motion.
Other deinterlacing options in PCSX2 are too blurry in comparison to what I see on my PS2 and Sony CRT.
The best would be games with progressive option built in, but they are few on the PS2 since most games are interlaced.
horizontal is less important? it is important. cause that's what manages the horizontal pixel ratio. atleast on native wide buffers it's more important. i tested the build. good vertical. and while maintaining 480 math 4:3 is neat, it's not the correct picture. the copypaste 640 width is.

[Image: zBuzEG9.png]

i get that, frame gotta fix this, but in terms of gt4 here, it renders just the half buffer not the full 2x (interlaced) resolution. i could try to get there, but the coders modified other files then i tried. i have no idea where to start redoing it. to many entries on that imho. i started to modify the gsrenderer::vsync method. totally other point of entry. mess coder me got no clue. Laugh

Users browsing this thread: 1 Guest(s)