English Amiga Board Amiga Lore


Go Back   English Amiga Board > Support > support.WinUAE

 
 
Thread Tools
Old 12 February 2016, 03:32   #1
ED-209
Registered User

ED-209's Avatar
 
Join Date: Mar 2012
Location: OCP
Age: 37
Posts: 960
"remove interlace artifacts"

I was wondering if possible to improve the "remove interlace artifacts" option. I realize that there is no simple fix to cover all bases, as there are many different itteration of interlace output, with mixed modes etc

The specific case I'm looking at now are the Agatron Animation disks, where the comb effect is present on every animation.
I would have thought this to be considered 'normal' interlace use, as they are just anim5 files played with showanim?

First picture is with 'remove artifacts' disabled.
Second pic has it enabled, which doesn't fix the combing and adds "trash" frames.

Possible to fix in this case?
(Screenshots taken from Agatron animation disk #1)
Attached Thumbnails
Click image for larger version

Name:	pic1.jpg
Views:	273
Size:	68.9 KB
ID:	47440   Click image for larger version

Name:	pic2.jpg
Views:	281
Size:	76.0 KB
ID:	47441  
ED-209 is offline  
AdSense AdSense  
Old 12 February 2016, 07:16   #2
Foebane
Registered User
 
Join Date: Sep 2011
Location: Cardiff, UK
Posts: 442
I have the same problem when it comes to interlaced modes, but I never figured out a way to satisfactorily remove the combing, I just learnt to live with it, however much of a nuisance it is.
Foebane is offline  
Old 12 February 2016, 18:19   #3
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 42
Posts: 19,542
Remove interlace artifacts can only work if both fields are in memory at the same time.

In this case demo probably uses field based (not frame) double buffering, when showing odd field, previous even field is being overwritten with next even field. Field that UAE would need to generate full progressive image.
Toni Wilen is offline  
Old 12 February 2016, 20:06   #4
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 2,481
This might not help generally, but... isn't that car animation resolution 320x200 (or the PAL equivalent)? And the animation player just enables interlace mode to make recording the Amiga video output possible. So if you hack the animation player you could have it play in non-interlaced mode (maybe).

Could you try playing the anim with another animation player?

Edit to add: I figured out how to patch c/showanim on the Agatron animation disk. Make this change using a binary file editor (or replace it with the attached already-patched file): At byte offset 306 decimal, change 08E8 0002 00A5 to 4E71 4E71 4E71.

Were there any later versions of the Aegis/SPARTA ShowANIM player than 4.20? I could patch those too. This could be useful for playing other animations too.

Edit: replaced patched version with a better one.
Attached Files
File Type: zip ShowANIM_4.20_NoForceLace.zip (13.6 KB, 50 views)

Last edited by mark_k; 13 February 2016 at 20:04.
mark_k is offline  
Old 12 February 2016, 22:35   #5
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 2,481
There are quite a few of these animation disks, so rather than patching each one, one workaround is this.

In display settings, set Interlaced line mode to Single. You have to set (non-interlaced) Line mode to Single in order to do that. [That isn't ideal because then Workbench appears half its normal height, assuming you normally use Double line mode.]
Then configure WinUAE to stretch the display height by 2✕.

This brings up a suggestion for WinUAE: Add a Double option for Interlaced line mode. That would be like Single, except double height. Then the user could set Interlaced line mode to Double and have these animation disks play with no combing/fringing artifacts.

The patch to ShowANIM above is because code in ShowANIM does the equivalent of the "Lacer 1" command, i.e. it forces interlace to be globally enabled by setting the LACE bit in the gb_system_bplcon0 field of GfxBase.

Last edited by mark_k; 12 February 2016 at 22:44.
mark_k is offline  
Old 13 February 2016, 02:34   #6
ED-209
Registered User

ED-209's Avatar
 
Join Date: Mar 2012
Location: OCP
Age: 37
Posts: 960
Thanks for the explanation tony.

mark_k: Thanks very much for the patched showanim! I could not find any arg to switch laced off so my ability to tweak the program stopped there

Quote:
Originally Posted by mark_k View Post
This brings up a suggestion for WinUAE: Add a Double option for Interlaced line mode. That would be like Single, except double height. Then the user could set Interlaced line mode to Double and have these animation disks play with no combing/fringing artifacts.
I tried this and it also worked. It would be great if something could be implement as this "double buffer" method of display seems quite common. (Assumption that the majority of games/demos that 'remove artifacts' does not fix are using similar method).
ED-209 is offline  
Old 13 February 2016, 04:06   #7
Sandro
Banned
 
Join Date: Feb 2013
Location: spain
Posts: 897
Quote:
Originally Posted by mark_k View Post
There are quite a few of these animation disks, so rather than patching each one, one workaround is this.

In display settings, set Interlaced line mode to Single. You have to set (non-interlaced) Line mode to Single in order to do that. [That isn't ideal because then Workbench appears half its normal height, assuming you normally use Double line mode.]
Then configure WinUAE to stretch the display height by 2✕.

This brings up a suggestion for WinUAE: Add a Double option for Interlaced line mode. That would be like Single, except double height. Then the user could set Interlaced line mode to Double and have these animation disks play with no combing/fringing artifacts.

The patch to ShowANIM above is because code in ShowANIM does the equivalent of the "Lacer 1" command, i.e. it forces interlace to be globally enabled by setting the LACE bit in the gb_system_bplcon0 field of GfxBase.

can you post the winuae config of this?
I want to try thanks
Sandro is offline  
Old 13 February 2016, 13:15   #8
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 2,481
Quote:
Originally Posted by ED-209 View Post
I tried this and it also worked. It would be great if something could be implement as this "double buffer" method of display seems quite common. (Assumption that the majority of games/demos that 'remove artifacts' does not fix are using similar method).
The reason this works is that the animation is not interlaced. The player just forces interlacing to be enabled globally. So it won't work (well or at all) for animations which are actually interlaced.


The latest version of ShowANIM I've found so far is 5.7x-02, in the Rend24 archive on Aminet. I don't think that has the force-interlace problem. However it annoyingly opens a window on Workbench even when run from CLI. [Is that an original/official ShowANIM version?]

Last edited by mark_k; 13 February 2016 at 13:46.
mark_k is offline  
Old 13 February 2016, 15:33   #9
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 2,981
This is the same technique used by ProDAD's SSA system, right?
idrougge is offline  
Old 13 February 2016, 15:48   #10
ED-209
Registered User

ED-209's Avatar
 
Join Date: Mar 2012
Location: OCP
Age: 37
Posts: 960
Quote:
Originally Posted by mark_k View Post
The reason this works is that the animation is not interlaced. The player just forces interlacing to be enabled globally. So it won't work (well or at all) for animations which are actually interlaced.
Ok np.
I tested the single line mode method on 9 Fingers and Demon Download demos and it works well (aside from from improper scaling with 2x vertical) - normally both demos display combing using 'remove artifacts' or any other option, so is a good sign that implementing this properly could be well worth it
ED-209 is offline  
Old 13 February 2016, 20:02   #11
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 2,481
Maybe I was a bit pessimistic in saying it won't work then.
I'll take a look at those demos.

With Interlaced line mode set to Single, lines from both odd and even fields appear in the same position. So you lose vertical resolution, but that may be preferable if the alternative is fringing artifacts. And there may be some flicker since each output line is from different (adjacent) lines of the interlaced image on alternate frames.

Have you tried the "Double, fields+" line mode? Make sure to enable vsync if you try it, but the effect is very similar to a real 15kHz CRT monitor (i.e. with interlace flicker). The up-side is, no fringing artifacts and no loss of vertical resolution.



I've replaced the patched version of ShowANIM 4.20 attached above with a better one. In the first attempt I only removed the instruction where it set the LACE bit in gb_system_bplcon0, not the one where it clears that bit before exiting.

ShowANIM 4.30 is in gfx/conv/anim.lha on Aminet. That archive contains source and binary for a program called DisplayANIM which is a cut-down version of PlayANIM. At least, there's this comment in the source:
Code:
 *      Main program for animation file playing program
 *         Derived from ShowANIM code as a working example of
 *         ANIM playback.
 *
 *      Gary Bonham
 *      SPARTA, Inc.
 *      Laguna Hills, Ca
DisplayANIM has the same forcing of global interlace problem. An extract from its source:
Code:
   GfxBase->system_bplcon0 |= INTERLACE;

            delay = 0;
            loops = 1;
            ii = 1;
            if (continuousplay) {
               if (EndFlag) {
                  puts(" *** -c changed to -l ***\n");
                  loopplay = continuousplay;
                  continuousplay = 0;
               }
               else ii = continuousplay;
            }
            if (loopplay)       loops = loopplay;
            DBOpenGraphics(2,IFFfileList->firstframe->bmhd->pageWidth
                            ,IFFfileList->firstframe->bmhd->pageHeight
                            ,IFFfileList->firstframe->bmhd->nPlanes);
               for (loop=0;loop<loops;loop++) {
                  i = ii + 1;
                  while ((i = PlayAnim(IFFfileList,i,delay))) {}
               }
            DBCloseGraphics();
      GfxBase->system_bplcon0 &= ~INTERLACE;
Apart from the probably-not-wanted forcing of interlace mode, the way it restores system_bplcon0 before exiting isn't sufficient, so interlace mode may remain enabled after the program exits. (It should call RemakeDisplay() or RethinkDisplay() to Intuition picks up the change.) I found a newsgroup post from 1987 complaining about that.

Last edited by mark_k; 13 February 2016 at 22:36.
mark_k is offline  
Old 13 February 2016, 21:02   #12
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 2,481
Quote:
Originally Posted by idrougge View Post
This is the same technique used by ProDAD's SSA system, right?
I don't think this (i.e. ShowANIM forcing interlace on) is related to that at all. But SSA probably is field-based like Toni mentioned.

If you have an interlaced animation (320x400 say), as I understand it with the original ANIM compression types (excluding possibly ANIM-6) if you want to play back at 60 fields/sec, you need to decompress 400 lines of each frame, even though you only show half the lines in each field. So half the image data is effectively wasted. SSA is probably field-based, encoding each field as (probably) delta from the previous same field (i.e. delta from the previous-but-one field). [Anyone got any info on the SSA format?]
mark_k is offline  
Old 14 February 2016, 12:30   #13
ED-209
Registered User

ED-209's Avatar
 
Join Date: Mar 2012
Location: OCP
Age: 37
Posts: 960
Quote:
Originally Posted by mark_k View Post
Have you tried the "Double, fields+" line mode?
Yeh I've found that it works on the odd occasion where all other options fail, but I try to use as a last resort because I find the flickering + huge drop in brightness hard to tolerate, "too much" like a 15khz monitor

Quote:
I've replaced the patched version of ShowANIM 4.20 attached above with a better one.
Thanks mark! My plan with the agatron disks is to capture them all for upload to youtube. Easiest thing for me to do is overwrite showanim on disk with your version as most of the time there are custom args set when the program is invoked
ED-209 is offline  
Old 15 February 2016, 17:44   #14
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 2,481
I don't know your workflow for video capture/editing, but rather than spend time modifying each floppy disk, could you just set WinUAE line mode to Single, then double the image height in your video editing software?

Generally, for versions of ShowANIM that have the interlace problem you can make the following changes with a hex editor. I haven't found a later 4.x version than 4.30 so far.
Code:
Search for        Change to
08E8 0002 00A5    4E71 4E71 4E71
08A8 0002 00A5    4E71 4E71 4E71
[Maybe some disk is almost full so you want to patch the specific version of ShowANIM on that, instead of copying a possibly-larger later version to the disk.]
mark_k is offline  
Old 18 February 2016, 04:54   #15
ED-209
Registered User

ED-209's Avatar
 
Join Date: Mar 2012
Location: OCP
Age: 37
Posts: 960
Thanks for that
Some of the disks have intros & pictures etc in various non-interlace resolutions that I'd want to capture as well, so I think overwriting showanim is probably quickest option.
Would still love to see the double height interlace mode added to winuae at some stage
ED-209 is offline  
Old 18 February 2016, 12:58   #16
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 2,481
Single line mode will show non-interlaced modes properly too though???

However patching ShowANIM could still be worthwhile for someone wanting to view the animations on a real Amiga; the less-blocky and less-flickery non-interlaced graphics might be preferred. And there would be no deinterlacing artifacts for people with scan doublers (A2320 etc.).

Quote:
Originally Posted by ED-209 View Post
Would still love to see the double height interlace mode added to winuae at some stage
Me too. I think a scanlines option would be good too, for people that prefer that. (It would look the same as when non-laced line mode is set to scanlines and using the patched ShowANIM.)

Last edited by mark_k; 18 February 2016 at 22:15.
mark_k is offline  
Old 01 March 2016, 22:20   #17
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 2,481
Quote:
Originally Posted by Sandro View Post
can you post the winuae config of this?
I want to try thanks
Here you go. Line modes set to Single, Vert. size set to 2✕ in Filter settings.
Attached Files
File Type: zip A500_1.2_LineModeSingle.uae.zip (2.4 KB, 32 views)
mark_k is offline  
Old 01 March 2016, 23:39   #18
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 2,481
I've been trying to find various ShowANIM versions, with a view to maybe making an archive to easily patch any version to remove the forced interlacing.

So far I've found versions 3.30, 3.50, 4.00, 4.20 and 4.30. (The later 5.x versions don't seem to have the problem.) Anyone know of any others? Perhaps some old commercial packages might include a different version?

Here's a list of where I found the various versions.
Code:
Version	Size	Where
3.30	26176	VideoScape 3D V1.0 disk (first public version?)

3.50	27800	misc/fish/fish-0100.lha	

4.00	27880	misc/fish/fish-0123.lha
		misc/fish/fish-0125.lha
		misc/fish/fish-0127.lha
		misc/fish/fish-0132.lha

4.20	27776	game/role/StarWarsADV.lha
		game/role/TobiasTrek-1.lha
		game/think/StarTrek_A.lha
		pix/anim/TheRun.lha
		pix/anim/Windy.lha
		pix/anim/Zynex3_A.lha
		All(?) AGAtron animation disks

4.30	28156	VideoScape 3D V2.01 disk
		gfx/conv/anim.lha
		pix/anim/AutoLight_A.lha
		pix/anim/MarsFlight.lha

5.30-06	38624	gfx/edit/phantasmos3.lha

5.40-02	39268	misc/fish/fish-0270.lha
		misc/fish/fish-0437.lha
		pix/anim/Khern_A.lha
		pix/anim/MCDMach_A.lha
		pix/eric/AmyVsWalker.lzh

5.7x-02	39484	gfx/edit/rend105.lha

Last edited by mark_k; 01 March 2016 at 23:57.
mark_k is offline  
AdSense AdSense  
 


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Small issue with remove interlace artifacts mark_k support.WinUAE 0 14 May 2015 10:02
"Reminder "Lincs Amiga User Group aka "LAG" Meet Sat 5th of January 2013" rockape News 4 30 January 2013 00:06
CD32 Image-Name-Bug: "...(bla)[!].zip" -> "...(bla)[" / "...[test].zip" -> "...[tes" cfTrio support.WinUAE 8 18 December 2012 16:31
"Remove interlace artifacts" flickering in latest versions Zosite support.WinUAE 5 12 October 2012 11:25
"Remove interlace artifacts" issue with interlaced ↔ non-laced switching mark_k support.WinUAE 3 27 April 2012 21:03

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 03:38.


Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Page generated in 0.27592 seconds with 12 queries