Mercurial > libavcodec.hg
diff cscd.c @ 3034:d37065d8aeff libavcodec
Our own LZO (1X) implementation, under LGPL and optimized for readability.
Tested on CamStudio sample files.
author | reimar |
---|---|
date | Thu, 12 Jan 2006 17:52:41 +0000 |
parents | 6bc2dc147ac5 |
children | 0b546eab515d |
line wrap: on
line diff
--- a/cscd.c Thu Jan 12 05:47:52 2006 +0000 +++ b/cscd.c Thu Jan 12 17:52:41 2006 +0000 @@ -25,9 +25,7 @@ #ifdef CONFIG_ZLIB #include <zlib.h> #endif -#ifdef CONFIG_LZO -#include <lzo1x.h> -#endif +#include "lzo.h" typedef struct { AVFrame pic; @@ -158,16 +156,10 @@ // decompress data switch ((buf[0] >> 1) & 7) { case 0: { // lzo compression -#ifdef CONFIG_LZO - unsigned int dlen = c->decomp_size; - if (lzo1x_decompress_safe(&buf[2], buf_size - 2, - c->decomp_buf, &dlen, NULL) != LZO_E_OK) + int outlen = c->decomp_size, inlen = buf_size - 2; + if (lzo1x_decode(c->decomp_buf, &outlen, &buf[2], &inlen)) av_log(avctx, AV_LOG_ERROR, "error during lzo decompression\n"); break; -#else - av_log(avctx, AV_LOG_ERROR, "compiled without lzo (GPL) support\n"); - return -1; -#endif } case 1: { // zlib compression #ifdef CONFIG_ZLIB