English Amiga Board


Go Back   English Amiga Board > Requests > request.UAE Wishlist

 
 
Thread Tools
Old 24 August 2009, 10:42   #1
Maren
Banned
 
Join Date: Jul 2009
Location: *
Posts: 567
Suggestion for alternative handling of interlaced frames (WinUAE)

I was already halfway through "Dark Seed" when those nasty artifacts started becoming increasingly annoying, then thought to myself, why leave it like this? WinUAE does an excellent job with static frames, but evidently it doesn't work out that well when there's motion, just like weave-deinterlaced 576i movies playing on progressive screens.

My take on the issue is quite simple; rather than try to deal with the deinterlacing artifacts, I went for an "Interlaced Screen Simulator" approach, employing the well known concepts of scanlines and field dominance.

It all begins with you figuring out which field the game/application will draw first. It could be the Bottom Field or the Top Field, but for this example we'll just take a Full Frame, assume Bottom Field First and interlace it into 2 separate fields.


Full Frame


Bottom Field


Top Filed

Now all you gotta do is weave each of the aforementioned fields (320x200) with a new solid-black field of exactly the same size (320x200) into 2 new frames that we'll call "Bottom Frame" and "Top Frame" respectively.


Black Field

1. For the Bottom Field: weave it with the Black Field so that the first bottom line of the resulting Bottom Frame belongs to the Bottom Field and not the Black Field.


Bottom Frame

2. For the Top Field: weave it with the Black Field so that the first bottom line of the resulting Top Frame belongs to the Black Field and not the Top Field.


Top Frame

The procedure for "Top Field First" is essentially the inverse of what was done in step 1 and 2, not exactly rocket science but ask me if you must

Well, that's pretty much all the magic there's to the effect (videos accurately demonstrating what it looks like can be found in INSCSI.7z, attached to this post)


Result (APNG proved most unreliable for keeping a constant framerate, hence the black/white lines moving up and down, even with matching refresh rate (50.1hz), but you get the idea)

Now, the "Black Field" doesn't really have to be exactly the same size, I'm simply suggesting that to help me get the point across by making the visual example easier to follow. Since WinUAE has it's own way of applying scanlines, all that matters at the end is that you avoid drawing the Bottom Field higher than the Top Field (for the Bottom Field First example, of course) and always keep 1 scanline of vertical separation, otherwise it's going to stutter like hell

You may have noticed both the red and the cyan dots watermarking the lower left corner of each of the images posted here. Such allowed me to quickly identify and track down a given field, before, during and after the process. I have also included an alternative take (the video demonstration can also be found in INSCSI.7z, though should not be taken seriously) on the problem, this time combining the "Interlaced Screen Simulator" with a sort of pseudo-anaglyph thingy, bearing the advantage of completely removing the rather insignificant flicker also present in real Amiga monitors and SDTV's, at the cost of flashing bright colours (much less noticeable at 60 fields per second) or an epileptic seizure

And last but not the least, the names of the more relevant files in the .7z start with a "_"

Thanks for your time (and effort, if you ever consider implementing this )
Attached Files
File Type: 7z INSCSI.7z (649.5 KB, 275 views)
Maren is offline  
Old 24 August 2009, 11:12   #2
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,534
Whats wrong with current option that internally emulates interlaced as 576p 50fps? ("Remove interlace arfifacts" which is really bad name but I couldn't find any better..)
Toni Wilen is offline  
Old 24 August 2009, 11:36   #3
Maren
Banned
 
Join Date: Jul 2009
Location: *
Posts: 567
Quote:
Originally Posted by Toni Wilen View Post
Whats wrong with current option that internally emulates interlaced as 576p 50fps? ("Remove interlace arfifacts" which is really bad name but I couldn't find any better..)
Technically speaking, I don't know about the inner works of the feature so I can't tell, but granted, deinterlacing artifacts are still present with "Remove interlace arfifacts" on, at least in Dark Seed when there's something moving horizontally.
Maren is offline  
Old 24 August 2009, 12:36   #4
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,534
Attach statefile please. (standard lazyness etc..)
Toni Wilen is offline  
Old 24 August 2009, 13:14   #5
Maren
Banned
 
Join Date: Jul 2009
Location: *
Posts: 567

"Remove interlace artifacts" off


"Remove interlace artifacts" on

But the screenshots don't speak for what's actually visible when you play the game.

It turns out that disabling "Remove interlace artifacts" works a lil better for Dark Seed than leaving it enabled. For instance, when it's on, moving sprites like your character, show nasty deinterlacing artifacts that are visible even when they're not moving! when it's off, deinterlacing artifacts only appear during motion.
Maren is offline  
Old 24 August 2009, 13:30   #6
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,534
I said statefile, not screenshot
Toni Wilen is offline  
Old 24 August 2009, 13:45   #7
Maren
Banned
 
Join Date: Jul 2009
Location: *
Posts: 567
Sorry, I was still testing something else with a different config when I replied and could only post some screenshots I had already taken
Attached Files
File Type: txt winuaelog.txt (4.2 KB, 217 views)
File Type: txt winuaebootlog.txt (10.2 KB, 190 views)

Last edited by Maren; 03 March 2010 at 20:16.
Maren is offline  
Old 24 August 2009, 14:06   #8
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,534
I still don't see any statefiles (aka "saved state" or something)
(misc-panel, "save state"-button etc..)
Toni Wilen is offline  
Old 24 August 2009, 21:38   #9
Maren
Banned
 
Join Date: Jul 2009
Location: *
Posts: 567
Damnit, forgot to zip and got an "invalid file" error, but didn't notice (wouldn't hurt to add .uss as a valid extension, Admin)

Here's it anyways.
Attached Files
File Type: 7z darkseed.7z (390.5 KB, 279 views)
Maren is offline  
Old 25 August 2009, 15:50   #10
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,534
Ok, this is using some kind of double buffering which is not currently compatible with "remove interlace artifacts". Should be easy fix. Maybe.
Toni Wilen is offline  
Old 25 August 2009, 16:13   #11
Maren
Banned
 
Join Date: Jul 2009
Location: *
Posts: 567
Great

But regardless of the possibility of a fix for the current deinterlacing code, would you ever consider implementing the optional method described above? would it be that much of a hassle? it's actually more visually accurate than plain deinterlacing, which the Amiga couldn't even do without a scan doubler and probably some other trickery. Basically it looks like a real interlaced Amiga monitor, which helps build up that extra "authenticity" some fans like me are always looking forward to
Maren is offline  
Old 25 August 2009, 16:17   #12
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,534
I am not interested in any kind of image processing, sorry
Toni Wilen is offline  
Old 25 August 2009, 16:22   #13
Maren
Banned
 
Join Date: Jul 2009
Location: *
Posts: 567
Sometimes it's soooo bloody frustrating not to be a programmer
Maren is offline  
Old 25 August 2009, 16:37   #14
LocalH
Amiga user since 1990
 
LocalH's Avatar
 
Join Date: Aug 2004
Location: Kingsport, TN / USA
Age: 44
Posts: 295
That's a bad way to do it, anyway, since PC monitors tend to have lower image persistence than oldskool CRTs and scanlines are fatter than "between-scanlines" - your method will cause 50% brightness since the last field's lines will disappear before the next field's lines appear (real CRTs do not draw black scanlines, they just skip over the unused lines in a field and leave the previous image to naturally fade away). Best way to do it is to either interpolate the in-between lines (but keep the original lines where you have them) or just double them (possibly with some darkening but not black).
LocalH is offline  
Old 25 August 2009, 17:24   #15
Maren
Banned
 
Join Date: Jul 2009
Location: *
Posts: 567
Quote:
Originally Posted by LocalH View Post
That's a bad way to do it, anyway, since PC monitors tend to have lower image persistence than oldskool CRTs and scanlines are fatter than "between-scanlines" - your method will cause 50% brightness since the last field's lines will disappear before the next field's lines appear (real CRTs do not draw black scanlines, they just skip over the unused lines in a field and leave the previous image to naturally fade away). Best way to do it is to either interpolate the in-between lines (but keep the original lines where you have them) or just double them (possibly with some darkening but not black).

I beg to completely disagree. Replacing scanlines with interpolation makes the image much more flickery and pixelated to the eye. See for yourself (same suggested viewing conditions as with the previous vids)

The brightness drop can be easily corrected from the display panel or by making the scanlines brighter.
Attached Files
File Type: 7z interpolationtest.7z (250.0 KB, 267 views)
Maren is offline  
Old 25 August 2009, 18:12   #16
LocalH
Amiga user since 1990
 
LocalH's Avatar
 
Join Date: Aug 2004
Location: Kingsport, TN / USA
Age: 44
Posts: 295
Well, I did raise the option of mere doubling, with a degree of darkening on the unused scanlines of a field. The proper CRT way of doing it would be if the original scanlines bled into the unused ones based on brightness somewhat, since a bright white scanline is thicker than a medium-gray one (and of course a black one is the same thickness as an unused scanline for the most part).

Part of the issue with this for many people is the same old 50/60Hz issue with modern displays (which of course goes out the window when the monitor runs at 50Hz). For example, my LCD runs at 60Hz, and thus your videos look like ass to me solely due to that. This type of effect really requires perfect vsync. Since this is a little more involved than Amber-style scandoubling or internal "fake-576p" emulation, it should really be implemented as a filter, like the existing PAL filter. It would also be interesting to see this idea and the PAL filter combined as an option.

Last edited by LocalH; 25 August 2009 at 18:17.
LocalH is offline  
Old 26 August 2009, 02:44   #17
Maren
Banned
 
Join Date: Jul 2009
Location: *
Posts: 567
Quote:
Originally Posted by LocalH View Post
Well, I did raise the option of mere doubling, with a degree of darkening on the unused scanlines of a field. The proper CRT way of doing it would be if the original scanlines bled into the unused ones based on brightness somewhat, since a bright white scanline is thicker than a medium-gray one (and of course a black one is the same thickness as an unused scanline for the most part).

Part of the issue with this for many people is the same old 50/60Hz issue with modern displays (which of course goes out the window when the monitor runs at 50Hz). For example, my LCD runs at 60Hz, and thus your videos look like ass to me solely due to that. This type of effect really requires perfect vsync. Since this is a little more involved than Amber-style scandoubling or internal "fake-576p" emulation, it should really be implemented as a filter, like the existing PAL filter. It would also be interesting to see this idea and the PAL filter combined as an option.
Because of the way CRT TV's work, perfect scanlines would be much more complicated to recreate, which was not the intention of my post anyways; WinAUE can already do simple scanlines, so all Toni would have to do is bob the images up and down in the correct other.

The other thing I'd like to address is the brightness; if you're not ok with the slight dimming (much more noticeable in LCD screens because of the washed-out colours), you may NOT alter the brightness values but the gamma's, with the difference in luma ranges being the main reason. You can only increase the brightness for the scanlines by a maximum of 25%, and anything beyond that will result in a "smokey" image, so I'd rather discard such approach.

The inconvenience of not having a CRT monitor is akin to the inconvenience of not having a real Amiga hard drive connected to the pc for WinAUE to boot from; you don't need to, it should be optional as the title of the thread suggests. I you have the right hardware, great, if you don't, then use deinterlacing

Perfect vsync would not be absolutely necessary but convenient, and not any more than it is for regular non-interlaced games. The videos I posted do require perfect refresh rate match because you can't get a video player to vsync like WinUAE does, they simply can not alter the framerate to match your monitor's refresh rate
Maren is offline  
Old 31 October 2009, 15:04   #18
Photon
Moderator
 
Photon's Avatar
 
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,625
Quote:
Originally Posted by Maren View Post
Sometimes it's soooo bloody frustrating not to be a programmer
Not more frustrating than being one!

But I catch your drift.


I thought "remove interlace artifacts" was just "twice the vertical resolution instead of "Double"/"Scanlines" on" + go 25 fps? Will have a look.
Photon is offline  
Old 31 October 2009, 15:54   #19
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,534
Quote:
Originally Posted by Photon View Post
Not more frustrating than being one!

But I catch your drift.


I thought "remove interlace artifacts" was just "twice the vertical resolution instead of "Double"/"Scanlines" on" + go 25 fps? Will have a look.
No. This won't help at all with artifacts caused by moving objects.
Toni Wilen is offline  
Old 31 October 2009, 16:32   #20
Photon
Moderator
 
Photon's Avatar
 
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,625
Doh! of course not. Will give it a whirl and check.
Photon is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Automatically disable Direct3D scanlines/mask during interlaced screens (WinUAE) Maren request.UAE Wishlist 6 26 September 2010 09:14
Flickering when interlaced and non-interlaced highres screens "meet" Maren support.WinUAE 12 27 November 2009 22:59
WinUAE handling of ECS:BPLCON1:DOFF flag RedskullDC support.WinUAE 1 26 December 2007 17:12
WinUAE suggestion Critter support.WinUAE 15 05 September 2003 02:33

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 +2. The time now is 06:53.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.11217 seconds with 14 queries