[Ffmpeg-devel] tiff encoder (qualification task for GSoC)

Michael Niedermayer michaelni
Tue Apr 3 03:07:03 CEST 2007


Hi

On Mon, Apr 02, 2007 at 10:17:50PM +0200, Bartlomiej Wolowiec wrote:
[...]
> > >                  if(out + bpp + 1 > outbuf + out_size) return -1;
> > > +
> > > +                if(targa_style)
> > >                  *out++ = 0x80 | (count - 1);
> > > -                memcpy(out, ptr, bpp);
> > > +                else
> > > +                *out++ = -(count - 1);
> >
> > well, as i already said to the other student, this can be done without the
> > branch and more generically, actually i could think of 3 ways to do this
> > simpler and the look up table variant is not the one i want because theres
> > a much simpler solution which should be both fast and support all sane
> > variants to store this byte
> 
> Well, I added two arguments to the function and the value is calculated that 
> way: (count ^ xor) + add. I think that this solution is fast and universal. 

rle encoder patch applied


[...]
> +/** sizes of various TIFF field types (string size = 100)*/
> +const uint8_t type_sizes[6] = {
> +    0, 1, 100, 2, 4, 8
>  };

must have a ff_ prefix to avoid name clashes and the renaming of the
existing array should be a seperate patch (or leave the 12 bytes of
duplication ...)


[...]
> @@ -86,6 +54,7 @@
>      LZWState *lzw;
>  } TiffContext;
>  
> +
>  static int tget_short(uint8_t **p, int le){

cosmetic 


[...]

> +    strip_sizes = av_mallocz(4 * strips);
> +    strip_offsets = av_mallocz(4 * strips);

s/4/sizeof(*strip_...)/

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

I count him braver who overcomes his desires than him who conquers his
enemies for the hardest victory is over self. -- 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/20070403/a13ae930/attachment.pgp>



More information about the ffmpeg-devel mailing list