[FFmpeg-devel] [Ffmpeg-devel] PATCH: Blackfin Accelerated CSC (Color Space Converter)
Michael Niedermayer
michaelni
Wed May 2 12:02:15 CEST 2007
Hi
On Sat, Apr 28, 2007 at 09:23:48AM -0400, Marc Hoffman wrote:
Content-Description: message body text
> Marc Hoffman writes:
> > Michael Niedermayer writes:
> > > Hi
> > >
> > > On Thu, Apr 26, 2007 at 08:52:16AM -0400, Marc Hoffman wrote:
> > > Content-Description: message body text
> > > >
> > > > Marc Hoffman writes:
> > > > >
> > > > > Please review, and let me know how this is comming along?
>
> Review. Mods made per Michael.
>
[...]
> +static
> +int core_yuv420_rgb (SwsContext *c,
> + unsigned char **in, int *instrides,
> + int srcSliceY, int srcSliceH,
> + unsigned char **oplanes, int *outstrides, ltransform_t lcscf, int rgb)
> +{
> + unsigned char *py,*pu,*pv,*op;
> + int w = instrides[0];
> + int w2 = w/2;
> + int h2 = srcSliceH>>1;
> + int i;
> +
> + py = in[0];
> + pv = in[1+(0^rgb)];
> + pu = in[1+(1^rgb)];
> + op = oplanes[0] + srcSliceY*outstrides[0];
> +
> + if (rgb) {
> + c->cgu = c->ugCoeff&0xffffffffU;
> + c->cgv = c->vgCoeff&0xffffffffU;
> + } else {
> + c->cgu = c->vgCoeff&0xffffffffU;
> + c->cgv = c->ugCoeff&0xffffffffU;
> + }
the &0xff... is unneeded
indention is inconsistent
and instead of uint32_t cgu you could change ugCoeff to uint32_t
for blackfin per #ifdef, that would greatly simplify the code
same for the other variables
[...]
> +static
> +int bfin_yuv420_rgb565 (SwsContext *c,
> + unsigned char **in, int *instrides,
> + int srcSliceY, int srcSliceH,
> + unsigned char **oplanes, int *outstrides)
> +{
> + c->rmask = 0x001f * 0x00010001U;
> + c->gmask = 0x07e0 * 0x00010001U;
> + c->bmask = 0xf800 * 0x00010001U;
wouldnt static const variables like mmx uses be simpler and avoid wasting
space in the context? or does bfin have problems with accessing statics?
[...]
> +static void *ff_bfin_maybe_alloc_l1 (int amt, int where)
> +{
> + void *b = sram_alloc (amt, where);
> + if (b == 0)
> + b = av_malloc (amt);
tab
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
it is not once nor twice but times without number that the same ideas make
their appearance in the world. -- Aristotle
-------------- 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/20070502/0d5300e8/attachment.pgp>
More information about the ffmpeg-devel
mailing list