[Ffmpeg-devel] Some possible libswscale cleanups?
Thu Dec 21 20:23:02 CET 2006
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]);\
yes, or remove "entry_size *" where c->table_gV is initalized or another of
the thousends of possibilities ...
> > > + uint16_t *srcPtr= (uint16_t *)src;
> > > + uint16_t *dstPtr= (uint16_t *)dst + dstStride*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 + dstStride*y/2);
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
Size: 189 bytes
Desc: not available
More information about the ffmpeg-devel