bugGnash - The GNU Flash player - Bugs: bug #23290, cxform accuracy problem

 
 

bug #23290: cxform accuracy problem

Submitted by:  Zou Lunkai <zoulunkai>
Submitted on:  Mon 19 May 2008 08:36:14 AM UTC  
 
Category: coreSeverity: 3 - Normal
Release: NoneStatus: Fixed
Privacy: PublicAssigned to: Zou Lunkai <zoulunkai>
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Fri 23 May 2008 01:54:10 AM UTC, comment #6:

I'v tested various cases for the CXFORM, both multiplication and addition overflow as expected. And that's what pp does. The accuracy problem should be fixed now.

> Actually, an even easier way might be dividing characters
> between as-referenceable ones and non-as-referenceable ones.


Refactory the character inheritance chain should be a right and important way to go. Not only this item, but many other works should be benefitted. But not in my recent plan:)

Next plan is researching the swf matrix accuracy.

Zou Lunkai <zoulunkai>In charge of this item.
Wed 21 May 2008 08:55:40 AM UTC, comment #5:

Actually, an even easier way might be dividing characters
between as-referenceable ones and non-as-referenceable ones.

Assuming we have enough things in common.

Sandro Santilli <strk>
Project Member
Wed 21 May 2008 08:53:47 AM UTC, comment #4:

Adding another cxform to each character might not be a good idea
from memory use point of view.
Is not the only case in which we'd need to duplicate a few
components, we should research on an elegant approach
for that.

Might be worth reading about the "curiously recurring template pattern"

Sandro Santilli <strk>
Project Member
Wed 21 May 2008 08:25:23 AM UTC, comment #3:

The accuracy problem should be fixed. Attached file also works now. But there's still other problems with Color object. eg. the relation between _alpha property and Color.aa/ab; Color object not only works for sprites, but also buttons, editText instances...

Zou Lunkai <zoulunkai>In charge of this item.
Mon 19 May 2008 02:58:00 PM UTC, comment #2:

If it better matches PP behavior, then it's fine and should be done. Just for the speed it's not worth it IMHO.

Udo Giacomozzi <udog>
Project Member
Mon 19 May 2008 08:41:32 AM UTC, comment #1:

Make sure to test both SWF-defined and ActionScript-defined
transforms. The latter is done with the Color class, there
should be a test for it already.
Note that with ActionScript the values can also be retrived,
so should give you more options for self-contained tests.

Sandro Santilli <strk>
Project Member
Mon 19 May 2008 08:36:14 AM UTC, original submission:

Gnash is too acurate when calculating the color transformation matrix.

Tests description:

mc1.mc11.mc111.mc1111.mc11111.mc111111

mc11:redMult 1%
mc111:redMult 20%
mc1111:redMult 1000%
mc11111:redMult 1000%
mc111111:redMult 1000%

redMult is defined in cxform, like a scaling factor.

The final concatenated 'relMult' without accuracy lost is 200%, Gnash mades this by using float numbers during the calculation. Unluckly, "no accuracy lost" is the problem:)

I believe pp uses integral alrithmatic during the cxform concatination. Play the attached file with Gnash and pp, you'll see the big difference. Test file is pretty simple, only one frame and no AS.

Note the accuracy problem is not only related to cxform, but also the transformation matrix and coordinates system in general.

I think it's predictable that using integral alrithmatic for cxform would speed it(cxform related work) up at least 100 times for CPU without FPU no surprisingly.

I plan to work on class cxform, to replace floats with ints. The accuracy would surely be lost after that. But it's actually a improvement instead of a "real lost", right?

Zou Lunkai <zoulunkai>In charge of this item.

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #15678:  cxform_mult.swf added by zoulunkai (252B - application/x-shockwave-flash)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by udog (Posted a comment)
  • -unavailable- added by strk (Posted a comment)
  • -unavailable- added by zoulunkai (Submitted the item)
  • -unavailable- added by zoulunkai
  • -unavailable- added by zoulunkai
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 23 May 2008 01:54:37 AM UTCzoulunkaiOpen/ClosedOpen=>Closed
    Fri 23 May 2008 01:54:09 AM UTCzoulunkaiStatusIn Progress=>Fixed
    Wed 21 May 2008 08:25:23 AM UTCzoulunkaiStatusNone=>In Progress
    Mon 19 May 2008 08:36:14 AM UTCzoulunkaiAttached File-=>Added cxform_mult.swf, #15678
      Carbon-Copy-=>Added "benjamin wolsey"
      Carbon-Copy-=>Added "udo giacomozzi"

    Back to the top


    Powered by Savane 3.1-cleanup1