Welcome, Guest. Please login or register.

What openbor you prefer: Double dragon,battletoads or final fight !? by lirexpatrio
[December 07, 2012, 07:15:27 pm]


what are your favorite games OpenBOR?! by lirexpatrio
[December 07, 2012, 07:09:46 pm]


Post Some Awesome Videos by maxman
[December 07, 2012, 05:51:39 pm]


Can @cmd playmusic "aaaa" 1 also increse music sound ? by BeasTie
[December 07, 2012, 05:24:38 pm]


Streets of Rage: Silent Storm by mtrain
[December 07, 2012, 03:45:05 pm]


Site will be down for maintenance on 12/8/2012 thru 12/10/2012 by Damon Caskey
[December 07, 2012, 07:42:42 am]


Cancelled SOR 3d Remake by riccochet
[December 07, 2012, 03:58:33 am]


Dungeon Fighter: B.O.R. by msmalik681
[December 07, 2012, 03:24:27 am]


[TUTORIAL] How to create 4 Games of OpenBOR in 1 CD (650 MB) by magggas
[December 06, 2012, 09:46:25 pm]


custknife by Bloodbane
[December 06, 2012, 09:34:09 pm]


blockfx help by B.Kardi
[December 06, 2012, 04:09:14 pm]


street of age 4 hd by corradlo
[December 06, 2012, 01:41:36 pm]


ClaFan - Classic Fantasy ver 1.17 by soniczxblade
[December 06, 2012, 05:01:20 am]


Bug Archive by Bloodbane
[December 06, 2012, 02:00:44 am]


"Bio-Doom" and "Gears of Doom" by BulletBob
[December 05, 2012, 10:07:21 pm]


Contra Locked 'N' Loaded v2 by Bloodbane
[December 05, 2012, 09:39:43 pm]


Downloadable OpenBoR Manual by BeasTie
[December 05, 2012, 08:31:24 pm]


Having trouble testing changes by B.Kardi
[December 05, 2012, 03:05:53 pm]


DragonBall Absalon by msmalik681
[December 05, 2012, 02:52:13 pm]


[Hi-Res] Swamp by Vibrant
[December 05, 2012, 10:47:14 am]


  • Dot Guests: 165
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.



Author Topic: Rewritten Scale2x filter  (Read 1258 times)

0 Members and 1 Guest are viewing this topic.

Offline Plombo

  • Hero Member
  • *****
  • Posts: 1724
  • Your source for useful modding tools!
Rewritten Scale2x filter
« on: October 25, 2012, 01:55:47 am »
Hi everyone.  Long time no see.

A fact that occasionally comes up in discussion (especially when discussing use of the engine for commercial games) is that OpenBOR contains some scaling filters based on code from other projects and licensed under the GPL, a free and open source software license that is incompatible with our own license.

One of these filters is called Scale2x or AdvMame2x.  The news for today is that Scale2x is a problem no more! :cheers!:

I spent most of this afternoon and evening writing a Scale2x implementation from scratch, with a fast MMX path for x86 (Windows/Mac/Linux) platforms and a path implemented in C for everything else.  My new Scale2x implementation is now in SVN and will replace the original Scale2x implementation in all builds of the engine starting tomorrow.  It hasn't been tested extensively, though, so please do tell me if there's a problem with it! :)

Offline BeasTie

  • Hero Member
  • *****
  • Posts: 760
Re: Rewritten Scale2x filter
« Reply #1 on: October 25, 2012, 04:07:30 am »
Cool stuff! Thanks Plombo.


Offline bWWd

  • Hero Member
  • *****
  • Posts: 1870
Re: Rewritten Scale2x filter
« Reply #2 on: October 25, 2012, 12:57:58 pm »
 :thumbs_up:great

Offline Damon Caskey

  • Hero Member
  • *****
  • Posts: 5335
    • The Gorge
Re: Rewritten Scale2x filter
« Reply #3 on: October 25, 2012, 05:49:29 pm »
Good to see you back!

Also, awesome addition. I wonder if anything is left after that?

DC
OpenBOR Wiki.

Coming Soon:
Spoiler
Fatal Fury Chronicals


Offline Plombo

  • Hero Member
  • *****
  • Posts: 1724
  • Your source for useful modding tools!
Re: Rewritten Scale2x filter
« Reply #4 on: October 25, 2012, 07:04:25 pm »
Good to see you back!

Also, awesome addition.

Thanks! :)

I wonder if anything is left after that?

If you mean GPL-encumbered code, then unfortunately yes.  I looked through the scaling filters, and all of them are GPL-licensed except for the Tv2x and dot matrix (and now Scale2x) filters.  That leaves 2xSaI (and its variants), Hq2x, Lq2x, simple, scanline, bilinear, and motion blur all still under the GPL.

I've been working on an MMX/SSE2 implementation of the Super 2xSaI filter today, although I don't know when it will be finished.  Here is what I think about the others:
  • The "Simple 2x" filter is just nearest-neighbor filtering.  One of us could rewrite it in 15 minutes, and probably will at some point.
  • Bilinear filtering is another well-known and relatively simple algorithm, so reimplementing it in C should be fairly easy, although performance is an issue.  The current implementation also has an MMX fast path for x86 machines.  Creating a new MMX or SSE2 implementation of bilinear filtering would be more time-consuming, but still possible.
  • Hq2x produces the best-looking output of any scaling filter in OpenBOR.  It's also obscenely complicated and completely undocumented, and has an MMX fast path to make it even more of a pain to reimplement. >:(
  • I don't know whether Lq2x will be worth keeping.  It produces decent-looking results and has acceptable performance.   I haven't looked at the code for it, but if it's anywhere near as complicated as hq2x, it's probably best to remove it if it ends up being the last chunk of encumbered code.
  • I don't know whether the other 2xSaI variants (2xSaI and Super Eagle) are different enough from Super 2xSaI to be worth keeping.
  • The scanline filter doesn't have an MMX version and would probably be easy to recreate in C.
  • Does anyone even care about the motion blur filter? ???

Now that I've written all that, I hope GPL-encumbered code is what you were referring to...  :eek:
« Last Edit: October 25, 2012, 07:12:53 pm by Plombo »

Offline Plombo

  • Hero Member
  • *****
  • Posts: 1724
  • Your source for useful modding tools!
Re: Rewritten Scale2x filter
« Reply #5 on: October 25, 2012, 10:02:49 pm »
Actually, maybe I should have paid more attention and not wasted my time earlier, because the *assembly* (not C source) file for the MMX version of 2xSaI has this copyright notice:
Code: [Select]
;/*---------------------------------------------------------------------*
; * The following (piece of) code, (part of) the 2xSaI engine,          *
; * copyright (c) 2001 by Derek Liauw Kie Fa.                           *
; * Non-Commercial use of the engine is allowed and is encouraged,      *
; * provided that appropriate credit be given and that this copyright   *
; * notice will not be removed under any circumstance.                  *
; * You may freely modify this code, but I request                      *
; * that any improvements to the engine be submitted to me, so          *
; * that I can implement these improvements in newer versions of        *
; * the engine.                                                         *

This is the original 2xSaI license, which is compatible with our license.  The author later released the entire 2xSaI codebase under the GPL, but the old license is still valid for this file since the original copyright notice is intact.  The 2xSaI.c file in OpenBOR, however, uses the GPL version.  I'll try to track down a version of the C implementation that uses the original license. :)

EDIT: See below.  I should have double-checked that last part before saying it, too.  The 2xSaI version in OpenBOR does not in fact have a GPL notice and instead has our standard OpenBOR copyright notice, which presumably means that our version comes from an implementation with the original license.
« Last Edit: October 26, 2012, 06:04:41 pm by Plombo »

Offline Damon Caskey

  • Hero Member
  • *****
  • Posts: 5335
    • The Gorge
Re: Rewritten Scale2x filter
« Reply #6 on: October 26, 2012, 05:56:41 am »
You didn't write for nothing, that was exactly what I was talking about. Looks like there is still a bit to be done before we can freely give blessing to commercial mods.

 :(

DC

OpenBOR Wiki.

Coming Soon:
Spoiler
Fatal Fury Chronicals


Offline darknior

  • Sr. Member
  • ****
  • Posts: 357
Re: Rewritten Scale2x filter
« Reply #7 on: October 26, 2012, 07:23:47 am »
Good to see you back too :D
Awesome job when we know the work it is ...

You speak about MMX, S2E, ... all these implementation will not change the compatibility with all the systems ?
XBOX, Wii, PSP, etc ...

Thanks

Offline Plombo

  • Hero Member
  • *****
  • Posts: 1724
  • Your source for useful modding tools!
Re: Rewritten Scale2x filter
« Reply #8 on: October 26, 2012, 12:42:38 pm »
Good to see you back too :D
Awesome job when we know the work it is ...

Thanks!

You speak about MMX, S2E, ... all these implementation will not change the compatibility with all the systems ?
XBOX, Wii, PSP, etc ...

No, it won't.  The Wii doesn't use the scaling filters anymore (it uses the GPU for scaling the mod to the correct size).  The other consoles will have the scaling filters, but use the C version of the filters instead of the MMX/SSE2 versions.  This is what already happens for the filters in OpenBOR that have MMX versions.  (It's also the main reason that scaling filters are so much slower on consoles, besides the reduction in computing power compared to a PC.)

Offline bWWd

  • Hero Member
  • *****
  • Posts: 1870
Re: Rewritten Scale2x filter
« Reply #9 on: October 26, 2012, 01:01:30 pm »
The license thing,  its just a license and author choice at the time.Im sure he might do one more almost identical piece of code with different license specifically for some particular commercial release if asked politely.

Offline darknior

  • Sr. Member
  • ****
  • Posts: 357
Re: Rewritten Scale2x filter
« Reply #10 on: October 26, 2012, 01:07:27 pm »
Ok so cool :D

But xBox has the MMX support i think. It is an x86 Intel proc like on PC.

And i think, if you can do it, it can be cool to officially add the NEW XBOX engine to the SVN :D
Now it is made by A600 with SDL.
Like that, we will also have your updates ;)

Offline Plombo

  • Hero Member
  • *****
  • Posts: 1724
  • Your source for useful modding tools!
Re: Rewritten Scale2x filter
« Reply #11 on: October 26, 2012, 03:53:03 pm »
Actually, after checking again, our 2xSaI.c file doesn't have the GPL notice.  So it looks like 2xSaI and its variants are not a problem at all, which is nice. :)

In other news, I've done a new version of Simple 2x, which should be landing in SVN soon. :)

Also, it looks like my Scale2x implementation might be crashing, but only when compiler optimizations are enabled, which would imply a gcc bug.  >:( I'll look into a workaround for that, too.

Offline Plombo

  • Hero Member
  • *****
  • Posts: 1724
  • Your source for useful modding tools!
Re: Rewritten Scale2x filter
« Reply #12 on: October 26, 2012, 06:08:07 pm »
But xBox has the MMX support i think. It is an x86 Intel proc like on PC.

MMX support will be enabled if the flag is set at compile time.  Since the Xbox port of OpenBOR 3 is only distributed by an external source, it's up to them to set the MMX flag.  They probably already do, in fact.

The license thing,  its just a license and author choice at the time.Im sure he might do one more almost identical piece of code with different license specifically for some particular commercial release if asked politely.

If someone wants to make a commercial game with OpenBOR and really wants to have 2xSaI available for some reason, then yes, they could contact the original author of 2xSaI and ask permission to use it in their commercial release.  It would be easier for them just to disable it when compiling the engine, though.
« Last Edit: October 26, 2012, 06:14:56 pm by Plombo »

Offline Plombo

  • Hero Member
  • *****
  • Posts: 1724
  • Your source for useful modding tools!
Re: Rewritten Scale2x filter
« Reply #13 on: October 26, 2012, 06:11:28 pm »
Time for more news!  I rewrote the "Simple 2x" filter today and committed it to SVN a few minutes ago.  It was easy as I expected, and it works exactly as before.  That's one less GPL-licensed filter! :cheers!:

Offline darknior

  • Sr. Member
  • ****
  • Posts: 357
Re: Rewritten Scale2x filter
« Reply #14 on: October 26, 2012, 06:31:56 pm »
Since the Xbox port of OpenBOR 3 is only distributed by an external source

Yes i know that ...
But now it make the hardest work, one coder here must add it to the official SVN.
If nobody do it, we will never have the news update ... :(
He do it for help because we love your engine :D
And nobody here have take time to update the old 2.0 version ;)

You are a best coder, i think it will be easy for you to add it to the SVN ;)

 



 0%




SimplePortal 2.3.3 © 2008-2010, SimplePortal