[Ffmpeg-devel] [PATCH] ported SGI decoder to the new API

Xiaohui Sun sunxiaohui
Mon Mar 26 11:27:40 CEST 2007


Hi,
> ------------------------------------------------------------------------
> **Michael Niedermayer Wrote:
> Hi
> On Fri, Mar 23, 2007 at 07:54:22PM +0800, sunxiaohui wrote:
> > Hi,
> > I have ported the SGI decoder to the new API.
> [...]
>
> > +typedef struct SGIInfo{
> > + short magic;
> > + char rle;
> > + char bytes_per_channel;
> > + unsigned short dimension;
> > + unsigned short xsize;
> > + unsigned short ysize;
> > + unsigned short zsize;
> > + unsigned short linesize;
> why are they not int?

they are two-byte parameters.

> > +} SGIInfo;
> why are there 2 structs (SGIInfo and SgiContext) and not 1


I will merge that.


>
> > + chan_offset = z;
> > +
> > + for (y = s_info- >ysize - 1; y >= 0; y--) {
> > + dest_row = ptr + (y * s_info- >linesize);
> > + for (x = s_info- >xsize; x > 0; x--) {
> > + dest_row[chan_offset] = bytestream_get_byte(&buf);
> > + dest_row += s_info- >zsize;
> > + }
> > + }
> > + }
> isnt this just a memcpy() (with a loop for linesize)?

It should add a s_info->zsize after each copy, and a memcpy() is unable
to do that.

>
> [...]
> -- 
> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
> There will always be a question for which you do not know the correct
> awnser.
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.6 (GNU/Linux)
> iD8DBQFGA+ErYR7HhwQLD6sRAmV8AJ4kajsU5egVQ8J6pUN97msFAwelVQCfafie
> vWP1y5EAG/bsH4MjiILOnOU=
> =Q3T2
> -----END PGP SIGNATURE-----
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at mplayerhq.hu
> http://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-devel






More information about the ffmpeg-devel mailing list