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

Michael Niedermayer michaelni
Tue Apr 24 01:50:42 CEST 2007


Hi

On Mon, Apr 23, 2007 at 12:40:14PM -0400, Marc Hoffman wrote:
Content-Description: message body text
> 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.
> 

[...]
> Index: swscale_internal.h
> ===================================================================
> --- swscale_internal.h	(revision 22904)
> +++ swscale_internal.h	(working copy)
> @@ -110,7 +110,9 @@
>  	int dstColorspaceTable[4];
>  	int srcRange, dstRange;
>  
> +        uint16_t crv,cbu,cgu,cgv,cy,oy;

iam against putting these into the context, nothing uses them except the
init function, find another way to pass them between the init functions

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The misfortune of the wise is better than the prosperity of the fool.
-- Epicurus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070424/75dc2aa6/attachment.pgp>



More information about the ffmpeg-devel mailing list