2007-07-13 01:40:33 +03:00
|
|
|
/*
|
|
|
|
* LCL (LossLess Codec Library) Codec
|
|
|
|
* Copyright (c) 2002-2004 Roberto Togni
|
|
|
|
*
|
2011-03-18 19:35:10 +02:00
|
|
|
* This file is part of Libav.
|
2007-07-13 01:40:33 +03:00
|
|
|
*
|
2011-03-18 19:35:10 +02:00
|
|
|
* Libav is free software; you can redistribute it and/or
|
2007-07-13 01:40:33 +03:00
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
2011-03-18 19:35:10 +02:00
|
|
|
* Libav is distributed in the hope that it will be useful,
|
2007-07-13 01:40:33 +03:00
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
2011-03-18 19:35:10 +02:00
|
|
|
* License along with Libav; if not, write to the Free Software
|
2007-07-13 01:40:33 +03:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2010-04-20 17:45:34 +03:00
|
|
|
* @file
|
2007-07-13 01:40:33 +03:00
|
|
|
* LCL (LossLess Codec Library) Video Codec
|
|
|
|
* Decoder for MSZH and ZLIB codecs
|
|
|
|
* Experimental encoder for ZLIB RGB24
|
|
|
|
*
|
|
|
|
* Fourcc: MSZH, ZLIB
|
|
|
|
*
|
|
|
|
* Original Win32 dll:
|
|
|
|
* Ver2.23 By Kenji Oshima 2000.09.20
|
|
|
|
* avimszh.dll, avizlib.dll
|
|
|
|
*
|
|
|
|
* A description of the decoding algorithm can be found here:
|
|
|
|
* http://www.pcisys.net/~melanson/codecs
|
|
|
|
*
|
|
|
|
* Supports: BGR24 (RGB 24bpp)
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
2012-10-18 20:27:51 +03:00
|
|
|
#include "libavutil/mem.h"
|
2007-07-13 01:40:33 +03:00
|
|
|
#include "avcodec.h"
|
2009-05-31 13:35:39 +03:00
|
|
|
#include "bytestream.h"
|
2012-11-10 15:22:56 +03:00
|
|
|
#include "internal.h"
|
2007-07-13 01:40:33 +03:00
|
|
|
#include "lcl.h"
|
|
|
|
|
2009-05-31 12:16:06 +03:00
|
|
|
#if CONFIG_ZLIB_DECODER
|
2007-07-13 01:40:33 +03:00
|
|
|
#include <zlib.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Decoder context
|
|
|
|
*/
|
|
|
|
typedef struct LclDecContext {
|
|
|
|
// Image type
|
|
|
|
int imgtype;
|
|
|
|
// Compression type
|
|
|
|
int compression;
|
|
|
|
// Flags
|
|
|
|
int flags;
|
|
|
|
// Decompressed data size
|
|
|
|
unsigned int decomp_size;
|
|
|
|
// Decompression buffer
|
|
|
|
unsigned char* decomp_buf;
|
2009-05-31 12:16:06 +03:00
|
|
|
#if CONFIG_ZLIB_DECODER
|
2007-07-13 01:40:33 +03:00
|
|
|
z_stream zstream;
|
|
|
|
#endif
|
|
|
|
} LclDecContext;
|
|
|
|
|
|
|
|
|
2009-05-31 13:28:40 +03:00
|
|
|
/**
|
2011-06-23 23:41:54 +03:00
|
|
|
* @param srcptr compressed source buffer, must be padded with at least 5 extra bytes
|
|
|
|
* @param destptr must be padded sufficiently for av_memcpy_backptr
|
2009-05-31 13:28:40 +03:00
|
|
|
*/
|
2009-05-31 13:38:17 +03:00
|
|
|
static unsigned int mszh_decomp(const unsigned char * srcptr, int srclen, unsigned char * destptr, unsigned int destsize)
|
2007-07-13 01:40:33 +03:00
|
|
|
{
|
|
|
|
unsigned char *destptr_bak = destptr;
|
|
|
|
unsigned char *destptr_end = destptr + destsize;
|
2009-05-31 13:38:17 +03:00
|
|
|
const unsigned char *srcptr_end = srcptr + srclen;
|
2009-05-31 14:34:19 +03:00
|
|
|
unsigned mask = *srcptr++;
|
|
|
|
unsigned maskbit = 0x80;
|
2007-07-13 01:40:33 +03:00
|
|
|
|
2009-05-31 13:26:58 +03:00
|
|
|
while (srcptr < srcptr_end && destptr < destptr_end) {
|
2009-05-31 13:58:20 +03:00
|
|
|
if (!(mask & maskbit)) {
|
2009-05-31 13:16:28 +03:00
|
|
|
memcpy(destptr, srcptr, 4);
|
2007-07-13 01:40:33 +03:00
|
|
|
destptr += 4;
|
|
|
|
srcptr += 4;
|
|
|
|
} else {
|
2009-05-31 14:35:20 +03:00
|
|
|
unsigned ofs = bytestream_get_le16(&srcptr);
|
|
|
|
unsigned cnt = (ofs >> 11) + 1;
|
2007-07-13 01:40:33 +03:00
|
|
|
ofs &= 0x7ff;
|
2009-05-31 20:44:35 +03:00
|
|
|
ofs = FFMIN(ofs, destptr - destptr_bak);
|
2007-07-13 01:40:33 +03:00
|
|
|
cnt *= 4;
|
2009-05-31 13:44:42 +03:00
|
|
|
cnt = FFMIN(cnt, destptr_end - destptr);
|
2009-05-31 13:42:26 +03:00
|
|
|
av_memcpy_backptr(destptr, ofs, cnt);
|
|
|
|
destptr += cnt;
|
2007-07-13 01:40:33 +03:00
|
|
|
}
|
2009-05-31 13:58:20 +03:00
|
|
|
maskbit >>= 1;
|
2009-05-31 14:32:03 +03:00
|
|
|
if (!maskbit) {
|
|
|
|
mask = *srcptr++;
|
2009-05-31 21:17:33 +03:00
|
|
|
while (!mask) {
|
|
|
|
if (destptr_end - destptr < 32 || srcptr_end - srcptr < 32) break;
|
|
|
|
memcpy(destptr, srcptr, 32);
|
|
|
|
destptr += 32;
|
|
|
|
srcptr += 32;
|
|
|
|
mask = *srcptr++;
|
|
|
|
}
|
2009-05-31 14:32:03 +03:00
|
|
|
maskbit = 0x80;
|
|
|
|
}
|
2007-07-13 01:40:33 +03:00
|
|
|
}
|
|
|
|
|
2009-05-30 12:07:10 +03:00
|
|
|
return destptr - destptr_bak;
|
2007-07-13 01:40:33 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-07-02 15:41:07 +03:00
|
|
|
#if CONFIG_ZLIB_DECODER
|
2009-05-31 12:51:46 +03:00
|
|
|
/**
|
2011-06-23 23:41:54 +03:00
|
|
|
* @brief decompress a zlib-compressed data block into decomp_buf
|
|
|
|
* @param src compressed input buffer
|
|
|
|
* @param src_len data length in input buffer
|
|
|
|
* @param offset offset in decomp_buf
|
|
|
|
* @param expected expected decompressed length
|
2009-05-31 12:51:46 +03:00
|
|
|
*/
|
|
|
|
static int zlib_decomp(AVCodecContext *avctx, const uint8_t *src, int src_len, int offset, int expected)
|
|
|
|
{
|
|
|
|
LclDecContext *c = avctx->priv_data;
|
|
|
|
int zret = inflateReset(&c->zstream);
|
|
|
|
if (zret != Z_OK) {
|
|
|
|
av_log(avctx, AV_LOG_ERROR, "Inflate reset error: %d\n", zret);
|
2012-11-18 20:53:46 +03:00
|
|
|
return AVERROR_UNKNOWN;
|
2009-05-31 12:51:46 +03:00
|
|
|
}
|
|
|
|
c->zstream.next_in = src;
|
|
|
|
c->zstream.avail_in = src_len;
|
|
|
|
c->zstream.next_out = c->decomp_buf + offset;
|
|
|
|
c->zstream.avail_out = c->decomp_size - offset;
|
|
|
|
zret = inflate(&c->zstream, Z_FINISH);
|
|
|
|
if (zret != Z_OK && zret != Z_STREAM_END) {
|
|
|
|
av_log(avctx, AV_LOG_ERROR, "Inflate error: %d\n", zret);
|
2012-11-18 20:53:46 +03:00
|
|
|
return AVERROR_UNKNOWN;
|
2009-05-31 12:51:46 +03:00
|
|
|
}
|
|
|
|
if (expected != (unsigned int)c->zstream.total_out) {
|
|
|
|
av_log(avctx, AV_LOG_ERROR, "Decoded size differs (%d != %lu)\n",
|
|
|
|
expected, c->zstream.total_out);
|
2012-11-18 20:53:46 +03:00
|
|
|
return AVERROR_UNKNOWN;
|
2009-05-31 12:51:46 +03:00
|
|
|
}
|
|
|
|
return c->zstream.total_out;
|
|
|
|
}
|
2009-05-31 22:51:21 +03:00
|
|
|
#endif
|
2009-05-31 12:51:46 +03:00
|
|
|
|
2007-07-13 01:40:33 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
*
|
|
|
|
* Decode a frame
|
|
|
|
*
|
|
|
|
*/
|
2012-11-13 21:35:22 +03:00
|
|
|
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
|
2007-07-13 01:40:33 +03:00
|
|
|
{
|
2012-11-21 23:34:46 +03:00
|
|
|
AVFrame *frame = data;
|
2009-04-07 18:59:50 +03:00
|
|
|
const uint8_t *buf = avpkt->data;
|
|
|
|
int buf_size = avpkt->size;
|
2007-07-13 01:55:35 +03:00
|
|
|
LclDecContext * const c = avctx->priv_data;
|
2007-07-13 01:40:33 +03:00
|
|
|
unsigned int pixel_ptr;
|
|
|
|
int row, col;
|
2014-08-02 16:14:55 +03:00
|
|
|
unsigned char *encoded, *outptr;
|
2009-05-31 12:09:32 +03:00
|
|
|
uint8_t *y_out, *u_out, *v_out;
|
2007-07-13 01:40:33 +03:00
|
|
|
unsigned int width = avctx->width; // Real image width
|
|
|
|
unsigned int height = avctx->height; // Real image height
|
|
|
|
unsigned int mszh_dlen;
|
|
|
|
unsigned char yq, y1q, uq, vq;
|
2012-11-18 20:53:46 +03:00
|
|
|
int uqvq, ret;
|
2007-07-13 01:40:33 +03:00
|
|
|
unsigned int mthread_inlen, mthread_outlen;
|
|
|
|
unsigned int len = buf_size;
|
|
|
|
|
2012-11-21 23:34:46 +03:00
|
|
|
if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
|
2007-07-13 01:55:35 +03:00
|
|
|
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
|
2012-11-18 20:53:46 +03:00
|
|
|
return ret;
|
2007-07-13 01:55:35 +03:00
|
|
|
}
|
2007-07-13 01:40:33 +03:00
|
|
|
|
2012-11-21 23:34:46 +03:00
|
|
|
outptr = frame->data[0]; // Output image pointer
|
2007-07-13 01:40:33 +03:00
|
|
|
|
|
|
|
/* Decompress frame */
|
|
|
|
switch (avctx->codec_id) {
|
2012-08-05 12:11:04 +03:00
|
|
|
case AV_CODEC_ID_MSZH:
|
2007-07-13 01:55:35 +03:00
|
|
|
switch (c->compression) {
|
|
|
|
case COMP_MSZH:
|
2007-07-13 01:40:33 +03:00
|
|
|
if (c->flags & FLAG_MULTITHREAD) {
|
2014-08-02 16:14:55 +03:00
|
|
|
mthread_inlen = AV_RL32(buf);
|
2009-05-31 12:59:46 +03:00
|
|
|
mthread_inlen = FFMIN(mthread_inlen, len - 8);
|
2014-08-02 16:14:55 +03:00
|
|
|
mthread_outlen = AV_RL32(buf + 4);
|
2009-05-31 12:57:42 +03:00
|
|
|
mthread_outlen = FFMIN(mthread_outlen, c->decomp_size);
|
2014-08-02 16:14:55 +03:00
|
|
|
mszh_dlen = mszh_decomp(buf + 8, mthread_inlen, c->decomp_buf, c->decomp_size);
|
2007-07-13 01:55:35 +03:00
|
|
|
if (mthread_outlen != mszh_dlen) {
|
|
|
|
av_log(avctx, AV_LOG_ERROR, "Mthread1 decoded size differs (%d != %d)\n",
|
|
|
|
mthread_outlen, mszh_dlen);
|
2012-11-18 20:53:46 +03:00
|
|
|
return AVERROR_INVALIDDATA;
|
2007-07-13 01:40:33 +03:00
|
|
|
}
|
2014-08-02 16:14:55 +03:00
|
|
|
mszh_dlen = mszh_decomp(buf + 8 + mthread_inlen, len - 8 - mthread_inlen,
|
2007-07-13 01:55:35 +03:00
|
|
|
c->decomp_buf + mthread_outlen, c->decomp_size - mthread_outlen);
|
|
|
|
if (mthread_outlen != mszh_dlen) {
|
|
|
|
av_log(avctx, AV_LOG_ERROR, "Mthread2 decoded size differs (%d != %d)\n",
|
|
|
|
mthread_outlen, mszh_dlen);
|
2012-11-18 20:53:46 +03:00
|
|
|
return AVERROR_INVALIDDATA;
|
2007-07-13 01:40:33 +03:00
|
|
|
}
|
2007-07-13 01:55:35 +03:00
|
|
|
encoded = c->decomp_buf;
|
|
|
|
len = c->decomp_size;
|
2007-07-13 01:40:33 +03:00
|
|
|
} else {
|
2014-08-02 16:14:55 +03:00
|
|
|
mszh_dlen = mszh_decomp(buf, len, c->decomp_buf, c->decomp_size);
|
2007-07-13 01:55:35 +03:00
|
|
|
if (c->decomp_size != mszh_dlen) {
|
|
|
|
av_log(avctx, AV_LOG_ERROR, "Decoded size differs (%d != %d)\n",
|
|
|
|
c->decomp_size, mszh_dlen);
|
2012-11-18 20:53:46 +03:00
|
|
|
return AVERROR_INVALIDDATA;
|
2007-07-13 01:40:33 +03:00
|
|
|
}
|
2007-07-13 01:55:35 +03:00
|
|
|
encoded = c->decomp_buf;
|
|
|
|
len = mszh_dlen;
|
2007-07-13 01:40:33 +03:00
|
|
|
}
|
2007-07-13 01:55:35 +03:00
|
|
|
break;
|
2012-02-24 03:09:36 +03:00
|
|
|
case COMP_MSZH_NOCOMP: {
|
|
|
|
int bppx2;
|
|
|
|
switch (c->imgtype) {
|
|
|
|
case IMGTYPE_YUV111:
|
|
|
|
case IMGTYPE_RGB24:
|
|
|
|
bppx2 = 6;
|
|
|
|
break;
|
|
|
|
case IMGTYPE_YUV422:
|
|
|
|
case IMGTYPE_YUV211:
|
|
|
|
bppx2 = 4;
|
|
|
|
break;
|
|
|
|
case IMGTYPE_YUV411:
|
|
|
|
case IMGTYPE_YUV420:
|
|
|
|
bppx2 = 3;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
bppx2 = 0; // will error out below
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (len < ((width * height * bppx2) >> 1))
|
|
|
|
return AVERROR_INVALIDDATA;
|
2007-07-13 01:40:33 +03:00
|
|
|
break;
|
2012-02-24 03:09:36 +03:00
|
|
|
}
|
2007-07-13 01:40:33 +03:00
|
|
|
default:
|
2007-07-13 01:55:35 +03:00
|
|
|
av_log(avctx, AV_LOG_ERROR, "BUG! Unknown MSZH compression in frame decoder.\n");
|
2012-11-18 20:53:46 +03:00
|
|
|
return AVERROR_INVALIDDATA;
|
2007-07-13 01:55:35 +03:00
|
|
|
}
|
|
|
|
break;
|
2009-05-31 12:16:06 +03:00
|
|
|
#if CONFIG_ZLIB_DECODER
|
2012-08-05 12:11:04 +03:00
|
|
|
case AV_CODEC_ID_ZLIB:
|
2007-07-13 01:55:35 +03:00
|
|
|
/* Using the original dll with normal compression (-1) and RGB format
|
|
|
|
* gives a file with ZLIB fourcc, but frame is really uncompressed.
|
|
|
|
* To be sure that's true check also frame size */
|
2009-05-30 12:07:10 +03:00
|
|
|
if (c->compression == COMP_ZLIB_NORMAL && c->imgtype == IMGTYPE_RGB24 &&
|
2012-02-23 01:22:56 +03:00
|
|
|
len == width * height * 3) {
|
|
|
|
if (c->flags & FLAG_PNGFILTER) {
|
2014-08-02 16:14:55 +03:00
|
|
|
memcpy(c->decomp_buf, buf, len);
|
2012-02-23 01:22:56 +03:00
|
|
|
encoded = c->decomp_buf;
|
|
|
|
} else {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
} else if (c->flags & FLAG_MULTITHREAD) {
|
2014-08-02 16:14:55 +03:00
|
|
|
mthread_inlen = AV_RL32(buf);
|
2009-05-31 12:59:46 +03:00
|
|
|
mthread_inlen = FFMIN(mthread_inlen, len - 8);
|
2014-08-02 16:14:55 +03:00
|
|
|
mthread_outlen = AV_RL32(buf + 4);
|
2009-05-31 12:57:42 +03:00
|
|
|
mthread_outlen = FFMIN(mthread_outlen, c->decomp_size);
|
2014-08-02 16:14:55 +03:00
|
|
|
ret = zlib_decomp(avctx, buf + 8, mthread_inlen, 0, mthread_outlen);
|
2009-05-31 12:51:46 +03:00
|
|
|
if (ret < 0) return ret;
|
2014-08-02 16:14:55 +03:00
|
|
|
ret = zlib_decomp(avctx, buf + 8 + mthread_inlen, len - 8 - mthread_inlen,
|
2009-05-31 12:51:46 +03:00
|
|
|
mthread_outlen, mthread_outlen);
|
|
|
|
if (ret < 0) return ret;
|
2007-07-13 01:55:35 +03:00
|
|
|
} else {
|
2014-08-02 16:14:55 +03:00
|
|
|
int ret = zlib_decomp(avctx, buf, len, 0, c->decomp_size);
|
2009-05-31 12:51:46 +03:00
|
|
|
if (ret < 0) return ret;
|
2007-07-13 01:55:35 +03:00
|
|
|
}
|
|
|
|
encoded = c->decomp_buf;
|
2008-02-19 23:46:40 +02:00
|
|
|
len = c->decomp_size;
|
2007-07-13 01:55:35 +03:00
|
|
|
break;
|
2009-05-31 12:19:21 +03:00
|
|
|
#endif
|
2007-07-13 01:55:35 +03:00
|
|
|
default:
|
|
|
|
av_log(avctx, AV_LOG_ERROR, "BUG! Unknown codec in frame decoder compression switch.\n");
|
2012-11-18 20:53:46 +03:00
|
|
|
return AVERROR_INVALIDDATA;
|
2007-07-13 01:40:33 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Apply PNG filter */
|
2012-08-05 12:11:04 +03:00
|
|
|
if (avctx->codec_id == AV_CODEC_ID_ZLIB && (c->flags & FLAG_PNGFILTER)) {
|
2007-07-13 01:40:33 +03:00
|
|
|
switch (c->imgtype) {
|
|
|
|
case IMGTYPE_YUV111:
|
2007-07-13 01:55:35 +03:00
|
|
|
case IMGTYPE_RGB24:
|
|
|
|
for (row = 0; row < height; row++) {
|
|
|
|
pixel_ptr = row * width * 3;
|
|
|
|
yq = encoded[pixel_ptr++];
|
|
|
|
uqvq = AV_RL16(encoded+pixel_ptr);
|
|
|
|
pixel_ptr += 2;
|
|
|
|
for (col = 1; col < width; col++) {
|
|
|
|
encoded[pixel_ptr] = yq -= encoded[pixel_ptr];
|
|
|
|
uqvq -= AV_RL16(encoded+pixel_ptr+1);
|
|
|
|
AV_WL16(encoded+pixel_ptr+1, uqvq);
|
|
|
|
pixel_ptr += 3;
|
2007-07-13 01:40:33 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case IMGTYPE_YUV422:
|
2007-07-13 01:55:35 +03:00
|
|
|
for (row = 0; row < height; row++) {
|
|
|
|
pixel_ptr = row * width * 2;
|
|
|
|
yq = uq = vq =0;
|
2007-07-13 01:40:33 +03:00
|
|
|
for (col = 0; col < width/4; col++) {
|
2007-07-13 01:55:35 +03:00
|
|
|
encoded[pixel_ptr] = yq -= encoded[pixel_ptr];
|
|
|
|
encoded[pixel_ptr+1] = yq -= encoded[pixel_ptr+1];
|
|
|
|
encoded[pixel_ptr+2] = yq -= encoded[pixel_ptr+2];
|
|
|
|
encoded[pixel_ptr+3] = yq -= encoded[pixel_ptr+3];
|
|
|
|
encoded[pixel_ptr+4] = uq -= encoded[pixel_ptr+4];
|
|
|
|
encoded[pixel_ptr+5] = uq -= encoded[pixel_ptr+5];
|
|
|
|
encoded[pixel_ptr+6] = vq -= encoded[pixel_ptr+6];
|
|
|
|
encoded[pixel_ptr+7] = vq -= encoded[pixel_ptr+7];
|
|
|
|
pixel_ptr += 8;
|
2007-07-13 01:40:33 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case IMGTYPE_YUV411:
|
2007-07-13 01:55:35 +03:00
|
|
|
for (row = 0; row < height; row++) {
|
|
|
|
pixel_ptr = row * width / 2 * 3;
|
|
|
|
yq = uq = vq =0;
|
2007-07-13 01:40:33 +03:00
|
|
|
for (col = 0; col < width/4; col++) {
|
2007-07-13 01:55:35 +03:00
|
|
|
encoded[pixel_ptr] = yq -= encoded[pixel_ptr];
|
|
|
|
encoded[pixel_ptr+1] = yq -= encoded[pixel_ptr+1];
|
|
|
|
encoded[pixel_ptr+2] = yq -= encoded[pixel_ptr+2];
|
|
|
|
encoded[pixel_ptr+3] = yq -= encoded[pixel_ptr+3];
|
|
|
|
encoded[pixel_ptr+4] = uq -= encoded[pixel_ptr+4];
|
|
|
|
encoded[pixel_ptr+5] = vq -= encoded[pixel_ptr+5];
|
|
|
|
pixel_ptr += 6;
|
2007-07-13 01:40:33 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case IMGTYPE_YUV211:
|
2007-07-13 01:55:35 +03:00
|
|
|
for (row = 0; row < height; row++) {
|
|
|
|
pixel_ptr = row * width * 2;
|
|
|
|
yq = uq = vq =0;
|
2007-07-13 01:40:33 +03:00
|
|
|
for (col = 0; col < width/2; col++) {
|
2007-07-13 01:55:35 +03:00
|
|
|
encoded[pixel_ptr] = yq -= encoded[pixel_ptr];
|
|
|
|
encoded[pixel_ptr+1] = yq -= encoded[pixel_ptr+1];
|
|
|
|
encoded[pixel_ptr+2] = uq -= encoded[pixel_ptr+2];
|
|
|
|
encoded[pixel_ptr+3] = vq -= encoded[pixel_ptr+3];
|
|
|
|
pixel_ptr += 4;
|
2007-07-13 01:40:33 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case IMGTYPE_YUV420:
|
2007-07-13 01:55:35 +03:00
|
|
|
for (row = 0; row < height/2; row++) {
|
|
|
|
pixel_ptr = row * width * 3;
|
|
|
|
yq = y1q = uq = vq =0;
|
2007-07-13 01:40:33 +03:00
|
|
|
for (col = 0; col < width/2; col++) {
|
2007-07-13 01:55:35 +03:00
|
|
|
encoded[pixel_ptr] = yq -= encoded[pixel_ptr];
|
|
|
|
encoded[pixel_ptr+1] = yq -= encoded[pixel_ptr+1];
|
|
|
|
encoded[pixel_ptr+2] = y1q -= encoded[pixel_ptr+2];
|
|
|
|
encoded[pixel_ptr+3] = y1q -= encoded[pixel_ptr+3];
|
|
|
|
encoded[pixel_ptr+4] = uq -= encoded[pixel_ptr+4];
|
|
|
|
encoded[pixel_ptr+5] = vq -= encoded[pixel_ptr+5];
|
2007-07-13 01:40:33 +03:00
|
|
|
pixel_ptr += 6;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
2007-07-13 01:55:35 +03:00
|
|
|
av_log(avctx, AV_LOG_ERROR, "BUG! Unknown imagetype in pngfilter switch.\n");
|
2012-11-18 20:53:46 +03:00
|
|
|
return AVERROR_INVALIDDATA;
|
2007-07-13 01:55:35 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Convert colorspace */
|
2012-11-21 23:34:46 +03:00
|
|
|
y_out = frame->data[0] + (height - 1) * frame->linesize[0];
|
|
|
|
u_out = frame->data[1] + (height - 1) * frame->linesize[1];
|
|
|
|
v_out = frame->data[2] + (height - 1) * frame->linesize[2];
|
2007-07-13 01:55:35 +03:00
|
|
|
switch (c->imgtype) {
|
|
|
|
case IMGTYPE_YUV111:
|
2009-05-31 12:09:32 +03:00
|
|
|
for (row = 0; row < height; row++) {
|
2007-07-13 01:55:35 +03:00
|
|
|
for (col = 0; col < width; col++) {
|
2009-05-31 12:09:32 +03:00
|
|
|
y_out[col] = *encoded++;
|
|
|
|
u_out[col] = *encoded++ + 128;
|
|
|
|
v_out[col] = *encoded++ + 128;
|
2007-07-13 01:55:35 +03:00
|
|
|
}
|
2012-11-21 23:34:46 +03:00
|
|
|
y_out -= frame->linesize[0];
|
|
|
|
u_out -= frame->linesize[1];
|
|
|
|
v_out -= frame->linesize[2];
|
2007-07-13 01:55:35 +03:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case IMGTYPE_YUV422:
|
2009-05-31 12:09:32 +03:00
|
|
|
for (row = 0; row < height; row++) {
|
|
|
|
for (col = 0; col < width - 3; col += 4) {
|
|
|
|
memcpy(y_out + col, encoded, 4);
|
|
|
|
encoded += 4;
|
|
|
|
u_out[ col >> 1 ] = *encoded++ + 128;
|
|
|
|
u_out[(col >> 1) + 1] = *encoded++ + 128;
|
|
|
|
v_out[ col >> 1 ] = *encoded++ + 128;
|
|
|
|
v_out[(col >> 1) + 1] = *encoded++ + 128;
|
2007-07-13 01:55:35 +03:00
|
|
|
}
|
2012-11-21 23:34:46 +03:00
|
|
|
y_out -= frame->linesize[0];
|
|
|
|
u_out -= frame->linesize[1];
|
|
|
|
v_out -= frame->linesize[2];
|
2007-07-13 01:55:35 +03:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case IMGTYPE_RGB24:
|
|
|
|
for (row = height - 1; row >= 0; row--) {
|
2012-11-21 23:34:46 +03:00
|
|
|
pixel_ptr = row * frame->linesize[0];
|
2009-05-30 14:20:07 +03:00
|
|
|
memcpy(outptr + pixel_ptr, encoded, 3 * width);
|
|
|
|
encoded += 3 * width;
|
2007-07-13 01:55:35 +03:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case IMGTYPE_YUV411:
|
2009-05-31 12:09:32 +03:00
|
|
|
for (row = 0; row < height; row++) {
|
|
|
|
for (col = 0; col < width - 3; col += 4) {
|
|
|
|
memcpy(y_out + col, encoded, 4);
|
|
|
|
encoded += 4;
|
|
|
|
u_out[col >> 2] = *encoded++ + 128;
|
|
|
|
v_out[col >> 2] = *encoded++ + 128;
|
2007-07-13 01:55:35 +03:00
|
|
|
}
|
2012-11-21 23:34:46 +03:00
|
|
|
y_out -= frame->linesize[0];
|
|
|
|
u_out -= frame->linesize[1];
|
|
|
|
v_out -= frame->linesize[2];
|
2007-07-13 01:55:35 +03:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case IMGTYPE_YUV211:
|
2009-05-31 12:09:32 +03:00
|
|
|
for (row = 0; row < height; row++) {
|
|
|
|
for (col = 0; col < width - 1; col += 2) {
|
|
|
|
memcpy(y_out + col, encoded, 2);
|
|
|
|
encoded += 2;
|
|
|
|
u_out[col >> 1] = *encoded++ + 128;
|
|
|
|
v_out[col >> 1] = *encoded++ + 128;
|
2007-07-13 01:55:35 +03:00
|
|
|
}
|
2012-11-21 23:34:46 +03:00
|
|
|
y_out -= frame->linesize[0];
|
|
|
|
u_out -= frame->linesize[1];
|
|
|
|
v_out -= frame->linesize[2];
|
2007-07-13 01:55:35 +03:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case IMGTYPE_YUV420:
|
2012-11-21 23:34:46 +03:00
|
|
|
u_out = frame->data[1] + ((height >> 1) - 1) * frame->linesize[1];
|
|
|
|
v_out = frame->data[2] + ((height >> 1) - 1) * frame->linesize[2];
|
2009-05-31 12:09:32 +03:00
|
|
|
for (row = 0; row < height - 1; row += 2) {
|
|
|
|
for (col = 0; col < width - 1; col += 2) {
|
|
|
|
memcpy(y_out + col, encoded, 2);
|
|
|
|
encoded += 2;
|
2012-11-21 23:34:46 +03:00
|
|
|
memcpy(y_out + col - frame->linesize[0], encoded, 2);
|
2009-05-31 12:09:32 +03:00
|
|
|
encoded += 2;
|
|
|
|
u_out[col >> 1] = *encoded++ + 128;
|
|
|
|
v_out[col >> 1] = *encoded++ + 128;
|
2007-07-13 01:55:35 +03:00
|
|
|
}
|
2012-11-21 23:34:46 +03:00
|
|
|
y_out -= frame->linesize[0] << 1;
|
|
|
|
u_out -= frame->linesize[1];
|
|
|
|
v_out -= frame->linesize[2];
|
2007-07-13 01:55:35 +03:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
av_log(avctx, AV_LOG_ERROR, "BUG! Unknown imagetype in image decoder.\n");
|
2012-11-18 20:53:46 +03:00
|
|
|
return AVERROR_INVALIDDATA;
|
2007-07-13 01:40:33 +03:00
|
|
|
}
|
|
|
|
|
2012-11-13 21:35:22 +03:00
|
|
|
*got_frame = 1;
|
2007-07-13 01:40:33 +03:00
|
|
|
|
|
|
|
/* always report that the buffer was completely consumed */
|
|
|
|
return buf_size;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
*
|
|
|
|
* Init lcl decoder
|
|
|
|
*
|
|
|
|
*/
|
2008-03-21 05:11:20 +02:00
|
|
|
static av_cold int decode_init(AVCodecContext *avctx)
|
2007-07-13 01:40:33 +03:00
|
|
|
{
|
|
|
|
LclDecContext * const c = avctx->priv_data;
|
|
|
|
unsigned int basesize = avctx->width * avctx->height;
|
2012-10-23 20:22:52 +03:00
|
|
|
unsigned int max_basesize = FFALIGN(avctx->width, 4) *
|
|
|
|
FFALIGN(avctx->height, 4);
|
2007-07-13 01:40:33 +03:00
|
|
|
unsigned int max_decomp_size;
|
|
|
|
|
|
|
|
if (avctx->extradata_size < 8) {
|
|
|
|
av_log(avctx, AV_LOG_ERROR, "Extradata size too small.\n");
|
2012-03-01 04:50:28 +03:00
|
|
|
return AVERROR_INVALIDDATA;
|
2007-07-13 01:40:33 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Check codec type */
|
2012-08-05 12:11:04 +03:00
|
|
|
if ((avctx->codec_id == AV_CODEC_ID_MSZH && avctx->extradata[7] != CODEC_MSZH) ||
|
|
|
|
(avctx->codec_id == AV_CODEC_ID_ZLIB && avctx->extradata[7] != CODEC_ZLIB)) {
|
2007-07-13 01:40:33 +03:00
|
|
|
av_log(avctx, AV_LOG_ERROR, "Codec id and codec type mismatch. This should not happen.\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Detect image type */
|
2009-05-31 12:12:17 +03:00
|
|
|
switch (c->imgtype = avctx->extradata[4]) {
|
2007-07-13 01:55:35 +03:00
|
|
|
case IMGTYPE_YUV111:
|
|
|
|
c->decomp_size = basesize * 3;
|
|
|
|
max_decomp_size = max_basesize * 3;
|
2012-10-06 13:10:34 +03:00
|
|
|
avctx->pix_fmt = AV_PIX_FMT_YUV444P;
|
2009-05-31 12:23:54 +03:00
|
|
|
av_log(avctx, AV_LOG_DEBUG, "Image type is YUV 1:1:1.\n");
|
2007-07-13 01:55:35 +03:00
|
|
|
break;
|
|
|
|
case IMGTYPE_YUV422:
|
|
|
|
c->decomp_size = basesize * 2;
|
|
|
|
max_decomp_size = max_basesize * 2;
|
2012-10-06 13:10:34 +03:00
|
|
|
avctx->pix_fmt = AV_PIX_FMT_YUV422P;
|
2009-05-31 12:23:54 +03:00
|
|
|
av_log(avctx, AV_LOG_DEBUG, "Image type is YUV 4:2:2.\n");
|
2007-07-13 01:55:35 +03:00
|
|
|
break;
|
|
|
|
case IMGTYPE_RGB24:
|
|
|
|
c->decomp_size = basesize * 3;
|
|
|
|
max_decomp_size = max_basesize * 3;
|
2012-10-06 13:10:34 +03:00
|
|
|
avctx->pix_fmt = AV_PIX_FMT_BGR24;
|
2009-05-31 12:23:54 +03:00
|
|
|
av_log(avctx, AV_LOG_DEBUG, "Image type is RGB 24.\n");
|
2007-07-13 01:55:35 +03:00
|
|
|
break;
|
|
|
|
case IMGTYPE_YUV411:
|
|
|
|
c->decomp_size = basesize / 2 * 3;
|
|
|
|
max_decomp_size = max_basesize / 2 * 3;
|
2012-10-06 13:10:34 +03:00
|
|
|
avctx->pix_fmt = AV_PIX_FMT_YUV411P;
|
2009-05-31 12:23:54 +03:00
|
|
|
av_log(avctx, AV_LOG_DEBUG, "Image type is YUV 4:1:1.\n");
|
2007-07-13 01:55:35 +03:00
|
|
|
break;
|
|
|
|
case IMGTYPE_YUV211:
|
|
|
|
c->decomp_size = basesize * 2;
|
|
|
|
max_decomp_size = max_basesize * 2;
|
2012-10-06 13:10:34 +03:00
|
|
|
avctx->pix_fmt = AV_PIX_FMT_YUV422P;
|
2009-05-31 12:23:54 +03:00
|
|
|
av_log(avctx, AV_LOG_DEBUG, "Image type is YUV 2:1:1.\n");
|
2007-07-13 01:55:35 +03:00
|
|
|
break;
|
|
|
|
case IMGTYPE_YUV420:
|
|
|
|
c->decomp_size = basesize / 2 * 3;
|
|
|
|
max_decomp_size = max_basesize / 2 * 3;
|
2012-10-06 13:10:34 +03:00
|
|
|
avctx->pix_fmt = AV_PIX_FMT_YUV420P;
|
2009-05-31 12:23:54 +03:00
|
|
|
av_log(avctx, AV_LOG_DEBUG, "Image type is YUV 4:2:0.\n");
|
2007-07-13 01:55:35 +03:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
av_log(avctx, AV_LOG_ERROR, "Unsupported image format %d.\n", c->imgtype);
|
2012-03-01 04:50:28 +03:00
|
|
|
return AVERROR_INVALIDDATA;
|
2007-07-13 01:40:33 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Detect compression method */
|
2009-05-31 13:50:54 +03:00
|
|
|
c->compression = (int8_t)avctx->extradata[5];
|
2007-07-13 01:40:33 +03:00
|
|
|
switch (avctx->codec_id) {
|
2012-08-05 12:11:04 +03:00
|
|
|
case AV_CODEC_ID_MSZH:
|
2007-07-13 01:55:35 +03:00
|
|
|
switch (c->compression) {
|
|
|
|
case COMP_MSZH:
|
2009-05-31 12:23:54 +03:00
|
|
|
av_log(avctx, AV_LOG_DEBUG, "Compression enabled.\n");
|
2007-07-13 01:40:33 +03:00
|
|
|
break;
|
2007-07-13 01:55:35 +03:00
|
|
|
case COMP_MSZH_NOCOMP:
|
|
|
|
c->decomp_size = 0;
|
2009-05-31 12:23:54 +03:00
|
|
|
av_log(avctx, AV_LOG_DEBUG, "No compression.\n");
|
2007-07-13 01:55:35 +03:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
av_log(avctx, AV_LOG_ERROR, "Unsupported compression format for MSZH (%d).\n", c->compression);
|
2012-03-01 04:50:28 +03:00
|
|
|
return AVERROR_INVALIDDATA;
|
2007-07-13 01:55:35 +03:00
|
|
|
}
|
|
|
|
break;
|
2009-05-31 12:16:06 +03:00
|
|
|
#if CONFIG_ZLIB_DECODER
|
2012-08-05 12:11:04 +03:00
|
|
|
case AV_CODEC_ID_ZLIB:
|
2007-07-13 01:55:35 +03:00
|
|
|
switch (c->compression) {
|
|
|
|
case COMP_ZLIB_HISPEED:
|
2009-05-31 12:23:54 +03:00
|
|
|
av_log(avctx, AV_LOG_DEBUG, "High speed compression.\n");
|
2007-07-13 01:55:35 +03:00
|
|
|
break;
|
|
|
|
case COMP_ZLIB_HICOMP:
|
2009-05-31 12:23:54 +03:00
|
|
|
av_log(avctx, AV_LOG_DEBUG, "High compression.\n");
|
2007-07-13 01:55:35 +03:00
|
|
|
break;
|
|
|
|
case COMP_ZLIB_NORMAL:
|
2009-05-31 12:23:54 +03:00
|
|
|
av_log(avctx, AV_LOG_DEBUG, "Normal compression.\n");
|
2007-07-13 01:55:35 +03:00
|
|
|
break;
|
|
|
|
default:
|
2009-05-30 12:07:10 +03:00
|
|
|
if (c->compression < Z_NO_COMPRESSION || c->compression > Z_BEST_COMPRESSION) {
|
2007-07-13 01:55:35 +03:00
|
|
|
av_log(avctx, AV_LOG_ERROR, "Unsupported compression level for ZLIB: (%d).\n", c->compression);
|
2012-03-01 04:50:28 +03:00
|
|
|
return AVERROR_INVALIDDATA;
|
2007-07-13 01:40:33 +03:00
|
|
|
}
|
2009-05-31 12:23:54 +03:00
|
|
|
av_log(avctx, AV_LOG_DEBUG, "Compression level for ZLIB: (%d).\n", c->compression);
|
2007-07-13 01:55:35 +03:00
|
|
|
}
|
|
|
|
break;
|
2009-05-31 12:19:21 +03:00
|
|
|
#endif
|
2007-07-13 01:55:35 +03:00
|
|
|
default:
|
|
|
|
av_log(avctx, AV_LOG_ERROR, "BUG! Unknown codec in compression switch.\n");
|
2012-03-01 04:50:28 +03:00
|
|
|
return AVERROR_INVALIDDATA;
|
2007-07-13 01:40:33 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Allocate decompression buffer */
|
|
|
|
if (c->decomp_size) {
|
2014-08-14 23:31:24 +03:00
|
|
|
if (!(c->decomp_buf = av_malloc(max_decomp_size))) {
|
2007-07-13 01:40:33 +03:00
|
|
|
av_log(avctx, AV_LOG_ERROR, "Can't allocate decompression buffer.\n");
|
2012-03-01 04:50:28 +03:00
|
|
|
return AVERROR(ENOMEM);
|
2007-07-13 01:40:33 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Detect flags */
|
2009-05-31 12:12:17 +03:00
|
|
|
c->flags = avctx->extradata[6];
|
2007-07-13 01:40:33 +03:00
|
|
|
if (c->flags & FLAG_MULTITHREAD)
|
2009-05-31 12:23:54 +03:00
|
|
|
av_log(avctx, AV_LOG_DEBUG, "Multithread encoder flag set.\n");
|
2007-07-13 01:40:33 +03:00
|
|
|
if (c->flags & FLAG_NULLFRAME)
|
2009-05-31 12:23:54 +03:00
|
|
|
av_log(avctx, AV_LOG_DEBUG, "Nullframe insertion flag set.\n");
|
2012-08-05 12:11:04 +03:00
|
|
|
if (avctx->codec_id == AV_CODEC_ID_ZLIB && (c->flags & FLAG_PNGFILTER))
|
2009-05-31 12:23:54 +03:00
|
|
|
av_log(avctx, AV_LOG_DEBUG, "PNG filter flag set.\n");
|
2007-07-13 01:40:33 +03:00
|
|
|
if (c->flags & FLAGMASK_UNUSED)
|
|
|
|
av_log(avctx, AV_LOG_ERROR, "Unknown flag set (%d).\n", c->flags);
|
|
|
|
|
|
|
|
/* If needed init zlib */
|
2009-05-31 12:16:06 +03:00
|
|
|
#if CONFIG_ZLIB_DECODER
|
2012-08-05 12:11:04 +03:00
|
|
|
if (avctx->codec_id == AV_CODEC_ID_ZLIB) {
|
2009-05-31 12:27:07 +03:00
|
|
|
int zret;
|
2007-07-13 01:40:33 +03:00
|
|
|
c->zstream.zalloc = Z_NULL;
|
|
|
|
c->zstream.zfree = Z_NULL;
|
|
|
|
c->zstream.opaque = Z_NULL;
|
2009-05-30 12:07:10 +03:00
|
|
|
zret = inflateInit(&c->zstream);
|
2007-07-13 01:40:33 +03:00
|
|
|
if (zret != Z_OK) {
|
|
|
|
av_log(avctx, AV_LOG_ERROR, "Inflate init error: %d\n", zret);
|
2009-05-31 14:47:52 +03:00
|
|
|
av_freep(&c->decomp_buf);
|
2012-03-01 04:50:28 +03:00
|
|
|
return AVERROR_UNKNOWN;
|
2007-07-13 01:40:33 +03:00
|
|
|
}
|
|
|
|
}
|
2009-05-31 12:19:21 +03:00
|
|
|
#endif
|
2007-07-13 01:40:33 +03:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
*
|
|
|
|
* Uninit lcl decoder
|
|
|
|
*
|
|
|
|
*/
|
2008-03-21 05:11:20 +02:00
|
|
|
static av_cold int decode_end(AVCodecContext *avctx)
|
2007-07-13 01:40:33 +03:00
|
|
|
{
|
2007-07-13 01:55:35 +03:00
|
|
|
LclDecContext * const c = avctx->priv_data;
|
2007-07-13 01:40:33 +03:00
|
|
|
|
2009-05-31 14:47:52 +03:00
|
|
|
av_freep(&c->decomp_buf);
|
2009-05-31 12:16:06 +03:00
|
|
|
#if CONFIG_ZLIB_DECODER
|
2012-08-05 12:11:04 +03:00
|
|
|
if (avctx->codec_id == AV_CODEC_ID_ZLIB)
|
2009-05-31 14:42:50 +03:00
|
|
|
inflateEnd(&c->zstream);
|
2007-07-13 01:40:33 +03:00
|
|
|
#endif
|
|
|
|
|
2007-07-13 01:55:35 +03:00
|
|
|
return 0;
|
2007-07-13 01:40:33 +03:00
|
|
|
}
|
|
|
|
|
2009-01-14 01:44:16 +02:00
|
|
|
#if CONFIG_MSZH_DECODER
|
2011-01-25 23:40:11 +02:00
|
|
|
AVCodec ff_mszh_decoder = {
|
2011-07-17 13:54:31 +03:00
|
|
|
.name = "mszh",
|
2013-10-03 23:57:53 +03:00
|
|
|
.long_name = NULL_IF_CONFIG_SMALL("LCL (LossLess Codec Library) MSZH"),
|
2011-07-17 13:54:31 +03:00
|
|
|
.type = AVMEDIA_TYPE_VIDEO,
|
2012-08-05 12:11:04 +03:00
|
|
|
.id = AV_CODEC_ID_MSZH,
|
2011-07-17 13:54:31 +03:00
|
|
|
.priv_data_size = sizeof(LclDecContext),
|
|
|
|
.init = decode_init,
|
|
|
|
.close = decode_end,
|
|
|
|
.decode = decode_frame,
|
2015-07-07 02:41:27 +02:00
|
|
|
.capabilities = AV_CODEC_CAP_DR1,
|
2007-07-13 01:40:33 +03:00
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
2009-01-14 01:44:16 +02:00
|
|
|
#if CONFIG_ZLIB_DECODER
|
2011-01-25 23:40:11 +02:00
|
|
|
AVCodec ff_zlib_decoder = {
|
2011-07-17 13:54:31 +03:00
|
|
|
.name = "zlib",
|
2013-10-03 23:57:53 +03:00
|
|
|
.long_name = NULL_IF_CONFIG_SMALL("LCL (LossLess Codec Library) ZLIB"),
|
2011-07-17 13:54:31 +03:00
|
|
|
.type = AVMEDIA_TYPE_VIDEO,
|
2012-08-05 12:11:04 +03:00
|
|
|
.id = AV_CODEC_ID_ZLIB,
|
2011-07-17 13:54:31 +03:00
|
|
|
.priv_data_size = sizeof(LclDecContext),
|
|
|
|
.init = decode_init,
|
|
|
|
.close = decode_end,
|
|
|
|
.decode = decode_frame,
|
2015-07-07 02:41:27 +02:00
|
|
|
.capabilities = AV_CODEC_CAP_DR1,
|
2007-07-13 01:40:33 +03:00
|
|
|
};
|
|
|
|
#endif
|