[Ffmpeg-devel] libswscale cleanups and warning fixes
Michael Niedermayer
michaelni
Tue Dec 26 18:03:38 CET 2006
Hi
On Tue, Dec 26, 2006 at 05:05:45PM +0100, Luca Abeni wrote:
> Hi Michael,
>
> On Sun, 2006-12-24 at 15:40 +0100, Michael Niedermayer wrote:
> [...]
> > > #define YSCALE_YUV_2_RGB1B_C(type) \
> > > YSCALE_YUV_2_PACKED1B_C\
> > > type *r, *b, *g;\
> > > - r = c->table_rV[V];\
> > > - g = c->table_gU[U] + c->table_gV[V];\
> > > - b = c->table_bU[U];\
> > > + r = (type *)c->table_rV[V];\
> > > + g = (type *)(c->table_gU[U] + c->table_gV[V]);\
> > > + b = (type *)c->table_bU[U];\
> >
> > why are these needed? if c->table* isnt void anymore?
> Well, my patch is changing c->table* from void * to uint8_t *, so gcc is
> complaining when type is not uint8_t:
> swscale_template.c:1698: warning: assignment from incompatible pointer type
> and similar warnings.
> I do not know how meaningful these warnings are, but I was trying to
> reduce the verbosity of the build.
ok, add the casts
[...]
> > > - dst_type *r, *g, *b;\
> > > + dst_type attribute_unused *r, *g, attribute_unused *b;\
> > > uint8_t *py_1= src[0] + y*srcStride[0];\
> > > uint8_t *py_2= py_1 + srcStride[0];\
> > > uint8_t *pu= src[1] + (y>>1)*srcStride[1];\
> > > uint8_t *pv= src[2] + (y>>1)*srcStride[2];\
> > > unsigned int h_size= c->dstW>>3;\
> > > while (h_size--) {\
> > > - int U, V, Y;\
> > > + int attribute_unused U, attribute_unused V, Y;\
> >
> > hmm int attribute_unused U,V,Y; or attribute_unused int U,V,Y;
> > doenst work?
> Well, I only wanted to apply the "unused" attribute to U and V (I do not
> see the "unused variable" warning for Y). So, I ended up with this funny
> "int attribute_unused U, attribute_unused V, Y;" but I see now that the
> "unused" attribute is probably also applied to Y. Both "int
> attribute_unused U,V,Y" and "attribute_unused int U,V,Y" work. Which
> form is preferred?
dunno choose whichever you prefer
> So, I think the best thing would be
> attribute_unused int U,V; (or int attribute_unused)
> int Y;
> Would this be ok?
yes
> I'll prepare a new patch in a short time (I think the
not needed just commit it
[...]
> > [clippatch]
> > looks ok
> So I can commit it, right?
yes
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Let us carefully observe those good qualities wherein our enemies excel us
and endeavor to excel them, by avoiding what is faulty, and imitating what
is excellent in them. -- Plutarch
-------------- 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/20061226/3f637286/attachment.pgp>
More information about the ffmpeg-devel
mailing list