[Ffmpeg-devel] [PATCH] simple internal lzo decoder

Benjamin Larsson banan
Tue Jan 10 23:33:12 CET 2006

Reimar D?ffinger wrote:

>the attached patch adds a simple and probably slow LZO decoder to ffmpeg and
>makes the CamStudio decoder use it. For simplicity it also disables support
>for external liblzo if that is wanted (though currently the external
>decoder would be the default with --enable-gpl, which I think is not a
>good idea).
>Please comment (and of course, test it as well).
>Btw. since I could not find any specs, I created this decompressor by
>"converting" the original code in a drawing and reimplementing from
>there (after some "graph-optimizations"). The first time I tried it like
>this, I guess I really should put up a picture of the drawing when I get the
>time :-)
>Reimar D?ffinger
>Index: libavcodec/Makefile
>RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/Makefile,v
>retrieving revision 1.219
>diff -u -r1.219 Makefile
>--- libavcodec/Makefile	9 Jan 2006 15:41:39 -0000	1.219
>+++ libavcodec/Makefile	10 Jan 2006 20:47:31 -0000
>@@ -18,7 +18,7 @@
>       fft.o mdct.o raw.o golomb.o cabac.o\
>       dpcm.o adx.o faandct.o parser.o g726.o \
>       vp3dsp.o h264idct.o rangecoder.o pnm.o h263.o msmpeg4.o h263dec.o \
>-      opt.o
>+      opt.o lzo.o
As long as only one codec is using/eventually using the lzo decoder, I
think it
should only be included if that codes is enabled and uses it.

>+ * \brief read one byte from input buffer, avoiding overrun
>+ * \return byte read
>+ */
Are those doxygen coments valid ?

>+static inline int get_byte(LZOContext *c) {
>+    int res = c->in[0];
>+    if (c->in_remain) {
>+      c->in++;
>+      c->in_remain--;
>+    } else
>+      c->error |= LZO_INPUT_DEPLETED;
>+    return res;
Nitpicking, not enough indentation. There are a few more of those also.

And while you are at it can you draw up a LGPL rar3 compatible
decompressor :) ?

Benjamin Larsson

"incorrect information" is an oxymoron. Information is, by definition, factual, correct.

More information about the ffmpeg-devel mailing list