[Ffmpeg-devel] PATCH: BlackFin Optimized Color Space Converter

Marc Hoffman mmh
Mon Apr 23 18:40:14 CEST 2007


Michael Niedermayer writes:
 > Hi
 > 
 > On Mon, Apr 23, 2007 at 09:22:23AM -0400, Marc Hoffman wrote:
 > > Hi,
 > > 
 > > Michael Niedermayer writes:
 > >  > Hi
 > >  > 
 > >  > 
 > >  > [...]
 > >  > > +void yuv2rgb_bfin_init_tables (SwsContext *c, const int inv_table[4],
 > >  > > +                               int brightness,int contrast, int saturation)
 > >  > > +{
 > >  > > +    int cy,oy,crv,cbu,cgu,cgv;
 > >  > > +    av_log (c, AV_LOG_DEBUG, "b: %d, c: %d, s: %d\n", brightness, contrast, saturation);
 > >  > > +
 > >  > > +    cy      = ((0xffffLL) * contrast>>8 )>>9;
 > >  > > +    oy      = (-256*brightness)<<8;
 > >  > > +    crv     =   (inv_table[0]>>2)*(contrast>>16)*(saturation>>16);
 > >  > > +    cbu     =   (inv_table[1]>>2)*(contrast>>16)*(saturation>>16);
 > >  > > +    cgu     = -((inv_table[2]>>2)*(contrast>>16)*(saturation>>16));
 > >  > > +    cgv     = -((inv_table[3]>>2)*(contrast>>16)*(saturation>>16));
 > >  > 
 > >  > this looks wrong also its duplicate from sws_setColorspaceDetails()
 > > 
 > > Let me try and copy the values computed for X86 and see what
 > > happens. Thanks for pointing that out I just copied what I had done
 > > previously for altivec and adjusted for the way I do the internal
 > > computation with CRV CBU.
 > 
 > maybe altivec is wrong too i didnt check ...

Lets fix this us lets try to export the constants.

Then we can use the correctly computed values already computed as you
pointed out. What do you think about ifdefing the ARCH_X86 pieces in
the data structure?

comment: expose coefficients as plain 16bit ints for cross platform usage.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: swinfa.patch
Type: text/x-patch
Size: 1626 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070423/efdfe0bc/attachment.bin>



More information about the ffmpeg-devel mailing list