Help save net neutrality! Learn more.
Close

#42 Tweak(Sat=nn) gives weird result

v2.5x
closed
Filters (75)
5
2003-01-18
2003-01-14
Ian Brabham
No

The inbuilt Tweak() filter gives strange results for
Saturation changes for non ISSE cpu case for both
YUY2 and YV12 (no ISSE yet) case.

Checking the code (110103 source bundle "levels.cpp")
we see the following implementation :-
....
u = srcp[x+1] - -128;
v = srcp[x+3] - -128;
u = (u * Cos + v * Sin) >> 12;
v = (v * Cos - u * Sin) >> 12;
.... /^\ Oops "u" is no longer the appropriate value

The code needs to be something like :-
....
ux = srcp[x+1] - -128;
v = srcp[x+3] - -128;
u = (ux * Cos + v * Sin) >> 12;
v = (v * Cos - ux * Sin) >> 12;
....
....
ux = srcpu[x] - -128;
v = srcpv[x] - -128;
u = (ux * Cos + v * Sin) >> 12;
v = (v * Cos - ux * Sin) >> 12;
....

Regards
IanB

Discussion

  • Ian Brabham

    Ian Brabham - 2003-01-14

    Fix Tweak(Sat=nn) filter

     
  • Klaus Post

    Klaus Post - 2003-01-17
    • assigned_to: nobody --> sh0dan
     
  • Klaus Post

    Klaus Post - 2003-01-17

    Logged In: YES
    user_id=578300

    Nicely spotted! It'll be implemented ASAP. Until then you
    can use colorYUV and use the gain parameter.

     
  • Klaus Post

    Klaus Post - 2003-01-18

    Logged In: YES
    user_id=578300

    Thanks a lot for the detailed report!

    Fixed!

     
  • Klaus Post

    Klaus Post - 2003-01-18
    • status: open --> closed
     

Log in to post a comment.