Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GSdx: Rework automatic detection of deinterlacing #1525

Closed
MrCK1 opened this issue Aug 19, 2016 · 21 comments
Closed

GSdx: Rework automatic detection of deinterlacing #1525

MrCK1 opened this issue Aug 19, 2016 · 21 comments

Comments

@MrCK1
Copy link
Member

MrCK1 commented Aug 19, 2016

-PCSX2 version: Issue is pre-existing, but I used the Appveyor Build from PR #1524 for screenshots/further testing

-PCSX2 options: Defaults, changing interlacing settings affect the issue

-Plugins used: GSdx 1.0.0, SPU2-X, LilyPad, Linuz ISO/Gigaherz CDVD, the rest are null plugins

-Plugin settings: Defaults, no settings modifications affect the issue

-Description: de-interlacing needs to be improved.

-Last known version to work: Unknown, issue is ongoing

-PC specifications: Intel Core i5-4460, GTX 970, Windows 10, 8GB G-Skill RAM

With the number of changes that have been made in the GS in the past few months; the deinterlacing functions need to be brought up to speed. In this isssue, I am presenting 2 different cases where auto detection was further blurring the display; and required the deinterlacing mode to be manually selected. In both cases, the automatic detection appeared to be nearly identical to the blend-bff result.

Formula One 2001

Here, the picture was offset due to automatic detection, which also increased blurriness and motion blur/ghosting. This was corrected by switching to bob-tff as seen in the comparison below.

Auto

int_auto

Bob-tff

int_bob_tff

Wipeout Fusion

This game was a bit different. Bob-tff again rectified the issue in the 3D space; this wouldn't work inside the menus as bob caused the picture to shake. I had to switch to auto, weave, blend or none to fix this

Auto

wof_int_auto

Bob-tff

wof_int_bobtff

@MonJamp
Copy link
Contributor

MonJamp commented Aug 19, 2016

I was trying to fix this bug a while ago (I probably should've reported it). The auto deinterlacing code doesn't ever choose bob bff/tff as the deinterlacing method so any game that needs bob bff/tff to deinterlace is effected by this issue. I got stuck trying to fix this bug since I couldn't figure out how to detect if a game was "bobbing".

Another game that's effected by this issue is Thrillville which requires the bob bff deinterlacing mode.

@avih
Copy link
Contributor

avih commented Aug 19, 2016

IIRC @ramapcsx2 added the auto mode, which IIRC just chooses blend if it's interlaced.

There's no game which "needs" bob. If the content is interlaced, then the correct way to handle it is to deinterlace it.

PCSX2 supports three deinterlace modes:

  • "weave" (which effectively does nothing and still has the comb artefacts)
  • "blend" which just blends the two fields and ends up blurry, but without shakes.
  • "bob" which alternates the fields (so it gets the full fps of the game) and is technically the most correct way to deinterlace (even if there are higher quality deinterlacers with motion compensation etc - which PCSX2 doesn't have) - but it does "shake" the picture up and down.

Then there's another parameter which is top or bottom field first. I'm not sure how easy it is to detect or guess it per game.

While I personally prefer bob if I need to deinterlace because it has higher and smoother fps and no blur, other people may prefer blend because it doesn't shake. It's a personal preference.

So if one wanted to do "auto deinterlace" properly, it would need the following:

  • Know what the user prefers between bob and blend (no one should want weave) - user config.
  • Know to detect correctly when deinterlace is required - automatically.
  • Know to choose the correct first field between top/bottom (tff/bff) - automatically.

@mirh
Copy link

mirh commented Aug 19, 2016

"weave" (which effectively does nothing and still has the comb artefacts)

I don't see what's the point then :s

@avih
Copy link
Contributor

avih commented Aug 19, 2016

I don't see what's the point then :s

For users, not much.

But it doesn't do absolutely nothing, hence "effectively nothing". IIRC it still updates the image 60 times a sec (or 50 with PAL), but on every frame it updates just one field (alternately). So possibly for some testing etc.

But maybe it could also be useful if someone records the video in weave mode, and then deinterlace it later with higher quality deinterlacer in some video editor etc.

@MrCK1
Copy link
Member Author

MrCK1 commented Aug 19, 2016

@avih I was only really focusing on the blurriness due to bad deinterlacing.

If you blow up the WOF images in your browser, you can see how the 3D image is blurred in the distance when auto deinterlacing is used

In my 2 test games, bob didn't cause the picture to shake. It seems like the case detection needs to be "widened" for more scenarios

@avih
Copy link
Contributor

avih commented Aug 19, 2016

I understand, and it's because auto deinterlace uses blend - which indeed blurs.

@avih
Copy link
Contributor

avih commented Aug 19, 2016

My suggestion is to keep it at "none", and if a game is interlaced, just use F5 to go through all the modes until you find the one you like best. It would be either bob or blend, and it also needs the correct bff/tff.

If someone wants to automate it well, sounds like a good thing to have.

@mirh
Copy link

mirh commented Aug 19, 2016

OT but, could motion detection be somewhat implemented? Or is it impossible to do in realtime?

@MonJamp
Copy link
Contributor

MonJamp commented Aug 19, 2016

OT but, could motion detection be somewhat implemented? Or is it impossible to do in realtime?

This is what I was wondering too, some games don't shake with "bob" and these games usually look best with bob deinterlacing. Whereas games that do shake with "bob" should probably be using the blend deinterlacing mode.

@avih
Copy link
Contributor

avih commented Aug 19, 2016

The question is too generic. motion compensation (MC) in deinterlace could be implemented in different ways, some of them more demanding than others, and with different compensation qualities. There are also other approaches without MC which improve deinterlacing (mostly reducing the shaking of bob and improving its sharpness), like what YADIF does in video players.

Also some video drivers can deinterlace if they recognize it as "video", and sometimes the deinterlace method could be configured.

Bottom line, PCSX2 supports only the most basic and trivial deinterlace methods, although bob is also considered the most faithful one, so it's not terrible.

Surely it's possible to add more deinterlace methods which some/many people would like more than blend or bob, but.. someone has to actually code it :)

@avih
Copy link
Contributor

avih commented Aug 19, 2016

This is what I was wondering too, some games don't shake with "bob" and these games usually look best with bob deinterlacing. Whereas games that do shake with "bob" should probably be using the blend deinterlacing mode.

You're missing something, but I'm not sure what.

If the game doesn't shake with bob, it's most likely isn't interlaced, and most probably 30fps progressive, at which case "none" would be the best.

If it's interlaced and then you choose bob, it will shake. That's how bob works.

See this http://www.100fps.com/

@MonJamp
Copy link
Contributor

MonJamp commented Aug 19, 2016

Sorry this might be even more off topic but, maybe this is specific to only Thrillville?

With no interlacing the game shakes: https://gfycat.com/GrouchyRareAffenpinscher

With blend the game is very blurry:
2016-08-19 20_59_26-slot_ 0 _ speed_ 100 60 03 _ limiter_ normal _ gsdx d3d11 sw _ 640x445 _ blen

With bob the game is not blurry and there is no shaking:
2016-08-19 20_59_02-slot_ 0 _ speed_ 100 59 91 _ limiter_ normal _ gsdx d3d11 sw _ 640x445 _ bob

@avih
Copy link
Contributor

avih commented Aug 19, 2016

No worries, and it's not off topic. I believe you of course, but something is just weird here.

Where it says "blend" at the title, the image actually looks like bob - the main symptom to observe in a static image is that the vertical resolution is half - you can see this at the diagonal line on the floor or at the score(?) at the top - it has lower vertical resolution, and of course the fact that you say it shakes up and down - a clear symptom of bob.

And where the title says bob, the image looks like blend (or none if it's not interlaced). You can see that it has a higher resolution.

Note that static images do not do justice with bob, because the "other" part of the resolution is at the other image - the two images which makes it look like shaking. But with blend you see both images one over the other, so it looks like higher resolution, but it will get blurred - when the camera moves.

If the game is mostly static stuff, then blend could look better than bob, because it will not shake and will seem to have slightly higher resolution. But for a lot of action, bob will generally look smoother.

Anyway, it looks to me like possibly a PCSX2 bug where it says "blend" but actually does bob, and vice verse. Does it happen with other games too?

@MonJamp
Copy link
Contributor

MonJamp commented Aug 19, 2016

Well it doesn't shake when "blend" is selected, it only shakes with interlacing set to "none".

I've only noticed this behavior with Thrillville. It's really weird that a game would cause a UI bug.

@avih
Copy link
Contributor

avih commented Aug 19, 2016

Well it doesn't shake when "blend" is selected, it only shakes with interlacing set to "none".

OK, I can see that here too with the latest build. It seems that "none" actually does bob when the game is interlaced. You can cycle to bob and see that it looks exactly like "none" (either the tff or bff, but not both).

I don't recall it did that in the past (iirc none looked pretty much like weave, which technically is the correct look when not deinterlacing an interlaced sequence), and I actually consider it good behavior, and maybe exactly what "auto" should do.

When I think of it, it seems to me that "none" is "use bob if the game is interlaced" and "auto" is "use blend if the game is interlaced", and both of them don't do anything when the game is not interlaced. Which is like.. perfect. Every user can choose one of those to be used automatically when required according to every user's preference.

Other than "none" and "auto", all the other weave/bob/blend with either bff or tff seems to be behaving correctly.

I didn't try enough games to see if bff/tff is always chosen correctly, but with the 2-3 games which I did try, it does seem to be chosen correctly - and actually it's the same for all games I tried:

For bob - tff seems always the correct choice.
For blend or weave - bff seems always the correct choice.

So if I had to guess what's going on, it seems like "none" is "normal if not interlaced, and bob tff when the game is interlaced", and "auto" is "normal if not interlaced, and blend bff when the game is interlaced.

If that's indeed the case, I'd imagine that depending on personal preference, most users should stick to either none or auto, depending if they prefer bob or blend, respectively, when the game is interlaced.

At which case, we should probably rename none and auto to "auto - bob" and "auto - blend" respectively.

@ramapcsx2
Copy link
Member

The problem with some games might be that they do additional processing that interacts with the GSdx deinterlacing. They can manually offset each other field by some pixels, for example. I don't know why they do that but maybe this produced a nicer picture on CRTs.

@FlatOutPS2
Copy link
Contributor

FlatOutPS2 commented Aug 22, 2016

Try The Mark Of Kri. Auto and None look exactly the same, gently shaking up and down. Both weave options don't shake and look very interlaced, Bob looks sharp, but tff shakes violently and bff doesn't shake, and both Blend options don't shake either, and look blurry. Auto and None look like Bob tff, but instead of violently shaking, only shake gently. :/

@ramapcsx2
Copy link
Member

This game is probably such a case, where GSdx detects the "correct" deinterlacing method and uses it, but the game adds it's own method to the mix..

@MrCK1
Copy link
Member Author

MrCK1 commented Apr 5, 2017

Anybody have anything else to say here before I close this? I'd say that there's no need to add an additional layer of auto-detection "guesswork" on top of GSdx just for interlacing; with all the problems that would introduce.

@ramapcsx2
Copy link
Member

I don't think we can find a much better solution than what we have now. In light of the complexity of the issue, we're doing pretty well, actually. I consider constant bobbing and jumpy images as worse than blur. Still, the option for manual override is there.

@MrCK1 MrCK1 closed this as completed Apr 10, 2017
@mirh
Copy link

mirh commented Apr 10, 2017

#1458 seems some way to nevertheless improve the situation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants