[Ffmpeg-devel] Some possible libswscale cleanups?

Michael Niedermayer michaelni
Thu Dec 21 20:23:02 CET 2006


Hi

On Thu, Dec 21, 2006 at 04:46:25PM +0100, Luca Abeni wrote:
[...]
> [...]
> > >  #define YSCALE_YUV_2_RGBX_C(type) \
> > >  			YSCALE_YUV_2_PACKEDX_C(type)\
> > > -			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];\
> > 
> > void* + int != random_type* + int
> Ughh... This is embarassing :( I just added "(type *)" without looking
> at the code (and when I tested it "type" probably was "uint8_t").
> I think the correct version should be
> -			b = c->table_bU[U];\
> +			r = (type *)c->table_rV[V];\
> +			g = (type *)(c->table_gU[U] + c->table_gV[V]);\
> right?

yes, or remove "entry_size *" where c->table_gV is initalized or another of
the thousends of possibilities ...


> 
> [...]
> > > +	uint16_t *srcPtr= (uint16_t *)src[0];
> > > +	uint16_t *dstPtr= (uint16_t *)dst[0] + dstStride[0]*y/2;
> > 
> > this also doesnt look correct for the same reason (/2 vs. 16bits)
> Ooops... I missed some parenthesys again :(
> It should be
> uint16_t *dstPtr= (uint16_t *)(dst[0] + dstStride[0]*y/2);
> right?

hmm iam not sure if the original code was correct at all, it could very
well be that your wrong () was actually more correct here ...

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

No evil is honorable: but death is honorable; therefore death is not evil.
-- Citium Zeno
-------------- 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/20061221/1d8c48a9/attachment.pgp>



More information about the ffmpeg-devel mailing list