2 * LCL (LossLess Codec Library) Codec
3 * Copyright (c) 2002-2004 Roberto Togni
5 * This file is part of Libav.
7 * Libav is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * Libav is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with Libav; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
24 * LCL (LossLess Codec Library) Video Codec
25 * Decoder for MSZH and ZLIB codecs
26 * Experimental encoder for ZLIB RGB24
31 * Ver2.23 By Kenji Oshima 2000.09.20
32 * avimszh.dll, avizlib.dll
34 * A description of the decoding algorithm can be found here:
35 * http://www.pcisys.net/~melanson/codecs
37 * Supports: BGR24 (RGB 24bpp)
44 #include "libavutil/mem.h"
46 #include "bytestream.h"
50 #if CONFIG_ZLIB_DECODER
57 typedef struct LclDecContext
{
66 // Decompressed data size
67 unsigned int decomp_size
;
68 // Decompression buffer
69 unsigned char* decomp_buf
;
70 #if CONFIG_ZLIB_DECODER
77 * @param srcptr compressed source buffer, must be padded with at least 5 extra bytes
78 * @param destptr must be padded sufficiently for av_memcpy_backptr
80 static unsigned int mszh_decomp(const unsigned char * srcptr
, int srclen
, unsigned char * destptr
, unsigned int destsize
)
82 unsigned char *destptr_bak
= destptr
;
83 unsigned char *destptr_end
= destptr
+ destsize
;
84 const unsigned char *srcptr_end
= srcptr
+ srclen
;
85 unsigned mask
= *srcptr
++;
86 unsigned maskbit
= 0x80;
88 while (srcptr
< srcptr_end
&& destptr
< destptr_end
) {
89 if (!(mask
& maskbit
)) {
90 memcpy(destptr
, srcptr
, 4);
94 unsigned ofs
= bytestream_get_le16(&srcptr
);
95 unsigned cnt
= (ofs
>> 11) + 1;
97 ofs
= FFMIN(ofs
, destptr
- destptr_bak
);
99 cnt
= FFMIN(cnt
, destptr_end
- destptr
);
100 av_memcpy_backptr(destptr
, ofs
, cnt
);
107 if (destptr_end
- destptr
< 32 || srcptr_end
- srcptr
< 32) break;
108 memcpy(destptr
, srcptr
, 32);
117 return destptr
- destptr_bak
;
121 #if CONFIG_ZLIB_DECODER
123 * @brief decompress a zlib-compressed data block into decomp_buf
124 * @param src compressed input buffer
125 * @param src_len data length in input buffer
126 * @param offset offset in decomp_buf
127 * @param expected expected decompressed length
129 static int zlib_decomp(AVCodecContext
*avctx
, const uint8_t *src
, int src_len
, int offset
, int expected
)
131 LclDecContext
*c
= avctx
->priv_data
;
132 int zret
= inflateReset(&c
->zstream
);
134 av_log(avctx
, AV_LOG_ERROR
, "Inflate reset error: %d\n", zret
);
135 return AVERROR_UNKNOWN
;
137 c
->zstream
.next_in
= src
;
138 c
->zstream
.avail_in
= src_len
;
139 c
->zstream
.next_out
= c
->decomp_buf
+ offset
;
140 c
->zstream
.avail_out
= c
->decomp_size
- offset
;
141 zret
= inflate(&c
->zstream
, Z_FINISH
);
142 if (zret
!= Z_OK
&& zret
!= Z_STREAM_END
) {
143 av_log(avctx
, AV_LOG_ERROR
, "Inflate error: %d\n", zret
);
144 return AVERROR_UNKNOWN
;
146 if (expected
!= (unsigned int)c
->zstream
.total_out
) {
147 av_log(avctx
, AV_LOG_ERROR
, "Decoded size differs (%d != %lu)\n",
148 expected
, c
->zstream
.total_out
);
149 return AVERROR_UNKNOWN
;
151 return c
->zstream
.total_out
;
161 static int decode_frame(AVCodecContext
*avctx
, void *data
, int *got_frame
, AVPacket
*avpkt
)
163 const uint8_t *buf
= avpkt
->data
;
164 int buf_size
= avpkt
->size
;
165 LclDecContext
* const c
= avctx
->priv_data
;
166 unsigned char *encoded
= (unsigned char *)buf
;
167 unsigned int pixel_ptr
;
169 unsigned char *outptr
;
170 uint8_t *y_out
, *u_out
, *v_out
;
171 unsigned int width
= avctx
->width
; // Real image width
172 unsigned int height
= avctx
->height
; // Real image height
173 unsigned int mszh_dlen
;
174 unsigned char yq
, y1q
, uq
, vq
;
176 unsigned int mthread_inlen
, mthread_outlen
;
177 unsigned int len
= buf_size
;
180 avctx
->release_buffer(avctx
, &c
->pic
);
182 c
->pic
.reference
= 0;
183 c
->pic
.buffer_hints
= FF_BUFFER_HINTS_VALID
;
184 if ((ret
= ff_get_buffer(avctx
, &c
->pic
)) < 0) {
185 av_log(avctx
, AV_LOG_ERROR
, "get_buffer() failed\n");
189 outptr
= c
->pic
.data
[0]; // Output image pointer
191 /* Decompress frame */
192 switch (avctx
->codec_id
) {
193 case AV_CODEC_ID_MSZH
:
194 switch (c
->compression
) {
196 if (c
->flags
& FLAG_MULTITHREAD
) {
197 mthread_inlen
= AV_RL32(encoded
);
198 mthread_inlen
= FFMIN(mthread_inlen
, len
- 8);
199 mthread_outlen
= AV_RL32(encoded
+4);
200 mthread_outlen
= FFMIN(mthread_outlen
, c
->decomp_size
);
201 mszh_dlen
= mszh_decomp(encoded
+ 8, mthread_inlen
, c
->decomp_buf
, c
->decomp_size
);
202 if (mthread_outlen
!= mszh_dlen
) {
203 av_log(avctx
, AV_LOG_ERROR
, "Mthread1 decoded size differs (%d != %d)\n",
204 mthread_outlen
, mszh_dlen
);
205 return AVERROR_INVALIDDATA
;
207 mszh_dlen
= mszh_decomp(encoded
+ 8 + mthread_inlen
, len
- 8 - mthread_inlen
,
208 c
->decomp_buf
+ mthread_outlen
, c
->decomp_size
- mthread_outlen
);
209 if (mthread_outlen
!= mszh_dlen
) {
210 av_log(avctx
, AV_LOG_ERROR
, "Mthread2 decoded size differs (%d != %d)\n",
211 mthread_outlen
, mszh_dlen
);
212 return AVERROR_INVALIDDATA
;
214 encoded
= c
->decomp_buf
;
215 len
= c
->decomp_size
;
217 mszh_dlen
= mszh_decomp(encoded
, len
, c
->decomp_buf
, c
->decomp_size
);
218 if (c
->decomp_size
!= mszh_dlen
) {
219 av_log(avctx
, AV_LOG_ERROR
, "Decoded size differs (%d != %d)\n",
220 c
->decomp_size
, mszh_dlen
);
221 return AVERROR_INVALIDDATA
;
223 encoded
= c
->decomp_buf
;
227 case COMP_MSZH_NOCOMP
: {
229 switch (c
->imgtype
) {
243 bppx2
= 0; // will error out below
246 if (len
< ((width
* height
* bppx2
) >> 1))
247 return AVERROR_INVALIDDATA
;
251 av_log(avctx
, AV_LOG_ERROR
, "BUG! Unknown MSZH compression in frame decoder.\n");
252 return AVERROR_INVALIDDATA
;
255 #if CONFIG_ZLIB_DECODER
256 case AV_CODEC_ID_ZLIB
:
257 /* Using the original dll with normal compression (-1) and RGB format
258 * gives a file with ZLIB fourcc, but frame is really uncompressed.
259 * To be sure that's true check also frame size */
260 if (c
->compression
== COMP_ZLIB_NORMAL
&& c
->imgtype
== IMGTYPE_RGB24
&&
261 len
== width
* height
* 3) {
262 if (c
->flags
& FLAG_PNGFILTER
) {
263 memcpy(c
->decomp_buf
, encoded
, len
);
264 encoded
= c
->decomp_buf
;
268 } else if (c
->flags
& FLAG_MULTITHREAD
) {
269 mthread_inlen
= AV_RL32(encoded
);
270 mthread_inlen
= FFMIN(mthread_inlen
, len
- 8);
271 mthread_outlen
= AV_RL32(encoded
+4);
272 mthread_outlen
= FFMIN(mthread_outlen
, c
->decomp_size
);
273 ret
= zlib_decomp(avctx
, encoded
+ 8, mthread_inlen
, 0, mthread_outlen
);
274 if (ret
< 0) return ret
;
275 ret
= zlib_decomp(avctx
, encoded
+ 8 + mthread_inlen
, len
- 8 - mthread_inlen
,
276 mthread_outlen
, mthread_outlen
);
277 if (ret
< 0) return ret
;
279 int ret
= zlib_decomp(avctx
, encoded
, len
, 0, c
->decomp_size
);
280 if (ret
< 0) return ret
;
282 encoded
= c
->decomp_buf
;
283 len
= c
->decomp_size
;
287 av_log(avctx
, AV_LOG_ERROR
, "BUG! Unknown codec in frame decoder compression switch.\n");
288 return AVERROR_INVALIDDATA
;
292 /* Apply PNG filter */
293 if (avctx
->codec_id
== AV_CODEC_ID_ZLIB
&& (c
->flags
& FLAG_PNGFILTER
)) {
294 switch (c
->imgtype
) {
297 for (row
= 0; row
< height
; row
++) {
298 pixel_ptr
= row
* width
* 3;
299 yq
= encoded
[pixel_ptr
++];
300 uqvq
= AV_RL16(encoded
+pixel_ptr
);
302 for (col
= 1; col
< width
; col
++) {
303 encoded
[pixel_ptr
] = yq
-= encoded
[pixel_ptr
];
304 uqvq
-= AV_RL16(encoded
+pixel_ptr
+1);
305 AV_WL16(encoded
+pixel_ptr
+1, uqvq
);
311 for (row
= 0; row
< height
; row
++) {
312 pixel_ptr
= row
* width
* 2;
314 for (col
= 0; col
< width
/4; col
++) {
315 encoded
[pixel_ptr
] = yq
-= encoded
[pixel_ptr
];
316 encoded
[pixel_ptr
+1] = yq
-= encoded
[pixel_ptr
+1];
317 encoded
[pixel_ptr
+2] = yq
-= encoded
[pixel_ptr
+2];
318 encoded
[pixel_ptr
+3] = yq
-= encoded
[pixel_ptr
+3];
319 encoded
[pixel_ptr
+4] = uq
-= encoded
[pixel_ptr
+4];
320 encoded
[pixel_ptr
+5] = uq
-= encoded
[pixel_ptr
+5];
321 encoded
[pixel_ptr
+6] = vq
-= encoded
[pixel_ptr
+6];
322 encoded
[pixel_ptr
+7] = vq
-= encoded
[pixel_ptr
+7];
328 for (row
= 0; row
< height
; row
++) {
329 pixel_ptr
= row
* width
/ 2 * 3;
331 for (col
= 0; col
< width
/4; col
++) {
332 encoded
[pixel_ptr
] = yq
-= encoded
[pixel_ptr
];
333 encoded
[pixel_ptr
+1] = yq
-= encoded
[pixel_ptr
+1];
334 encoded
[pixel_ptr
+2] = yq
-= encoded
[pixel_ptr
+2];
335 encoded
[pixel_ptr
+3] = yq
-= encoded
[pixel_ptr
+3];
336 encoded
[pixel_ptr
+4] = uq
-= encoded
[pixel_ptr
+4];
337 encoded
[pixel_ptr
+5] = vq
-= encoded
[pixel_ptr
+5];
343 for (row
= 0; row
< height
; row
++) {
344 pixel_ptr
= row
* width
* 2;
346 for (col
= 0; col
< width
/2; col
++) {
347 encoded
[pixel_ptr
] = yq
-= encoded
[pixel_ptr
];
348 encoded
[pixel_ptr
+1] = yq
-= encoded
[pixel_ptr
+1];
349 encoded
[pixel_ptr
+2] = uq
-= encoded
[pixel_ptr
+2];
350 encoded
[pixel_ptr
+3] = vq
-= encoded
[pixel_ptr
+3];
356 for (row
= 0; row
< height
/2; row
++) {
357 pixel_ptr
= row
* width
* 3;
358 yq
= y1q
= uq
= vq
=0;
359 for (col
= 0; col
< width
/2; col
++) {
360 encoded
[pixel_ptr
] = yq
-= encoded
[pixel_ptr
];
361 encoded
[pixel_ptr
+1] = yq
-= encoded
[pixel_ptr
+1];
362 encoded
[pixel_ptr
+2] = y1q
-= encoded
[pixel_ptr
+2];
363 encoded
[pixel_ptr
+3] = y1q
-= encoded
[pixel_ptr
+3];
364 encoded
[pixel_ptr
+4] = uq
-= encoded
[pixel_ptr
+4];
365 encoded
[pixel_ptr
+5] = vq
-= encoded
[pixel_ptr
+5];
371 av_log(avctx
, AV_LOG_ERROR
, "BUG! Unknown imagetype in pngfilter switch.\n");
372 return AVERROR_INVALIDDATA
;
376 /* Convert colorspace */
377 y_out
= c
->pic
.data
[0] + (height
- 1) * c
->pic
.linesize
[0];
378 u_out
= c
->pic
.data
[1] + (height
- 1) * c
->pic
.linesize
[1];
379 v_out
= c
->pic
.data
[2] + (height
- 1) * c
->pic
.linesize
[2];
380 switch (c
->imgtype
) {
382 for (row
= 0; row
< height
; row
++) {
383 for (col
= 0; col
< width
; col
++) {
384 y_out
[col
] = *encoded
++;
385 u_out
[col
] = *encoded
++ + 128;
386 v_out
[col
] = *encoded
++ + 128;
388 y_out
-= c
->pic
.linesize
[0];
389 u_out
-= c
->pic
.linesize
[1];
390 v_out
-= c
->pic
.linesize
[2];
394 for (row
= 0; row
< height
; row
++) {
395 for (col
= 0; col
< width
- 3; col
+= 4) {
396 memcpy(y_out
+ col
, encoded
, 4);
398 u_out
[ col
>> 1 ] = *encoded
++ + 128;
399 u_out
[(col
>> 1) + 1] = *encoded
++ + 128;
400 v_out
[ col
>> 1 ] = *encoded
++ + 128;
401 v_out
[(col
>> 1) + 1] = *encoded
++ + 128;
403 y_out
-= c
->pic
.linesize
[0];
404 u_out
-= c
->pic
.linesize
[1];
405 v_out
-= c
->pic
.linesize
[2];
409 for (row
= height
- 1; row
>= 0; row
--) {
410 pixel_ptr
= row
* c
->pic
.linesize
[0];
411 memcpy(outptr
+ pixel_ptr
, encoded
, 3 * width
);
412 encoded
+= 3 * width
;
416 for (row
= 0; row
< height
; row
++) {
417 for (col
= 0; col
< width
- 3; col
+= 4) {
418 memcpy(y_out
+ col
, encoded
, 4);
420 u_out
[col
>> 2] = *encoded
++ + 128;
421 v_out
[col
>> 2] = *encoded
++ + 128;
423 y_out
-= c
->pic
.linesize
[0];
424 u_out
-= c
->pic
.linesize
[1];
425 v_out
-= c
->pic
.linesize
[2];
429 for (row
= 0; row
< height
; row
++) {
430 for (col
= 0; col
< width
- 1; col
+= 2) {
431 memcpy(y_out
+ col
, encoded
, 2);
433 u_out
[col
>> 1] = *encoded
++ + 128;
434 v_out
[col
>> 1] = *encoded
++ + 128;
436 y_out
-= c
->pic
.linesize
[0];
437 u_out
-= c
->pic
.linesize
[1];
438 v_out
-= c
->pic
.linesize
[2];
442 u_out
= c
->pic
.data
[1] + ((height
>> 1) - 1) * c
->pic
.linesize
[1];
443 v_out
= c
->pic
.data
[2] + ((height
>> 1) - 1) * c
->pic
.linesize
[2];
444 for (row
= 0; row
< height
- 1; row
+= 2) {
445 for (col
= 0; col
< width
- 1; col
+= 2) {
446 memcpy(y_out
+ col
, encoded
, 2);
448 memcpy(y_out
+ col
- c
->pic
.linesize
[0], encoded
, 2);
450 u_out
[col
>> 1] = *encoded
++ + 128;
451 v_out
[col
>> 1] = *encoded
++ + 128;
453 y_out
-= c
->pic
.linesize
[0] << 1;
454 u_out
-= c
->pic
.linesize
[1];
455 v_out
-= c
->pic
.linesize
[2];
459 av_log(avctx
, AV_LOG_ERROR
, "BUG! Unknown imagetype in image decoder.\n");
460 return AVERROR_INVALIDDATA
;
464 *(AVFrame
*)data
= c
->pic
;
466 /* always report that the buffer was completely consumed */
475 static av_cold
int decode_init(AVCodecContext
*avctx
)
477 LclDecContext
* const c
= avctx
->priv_data
;
478 unsigned int basesize
= avctx
->width
* avctx
->height
;
479 unsigned int max_basesize
= FFALIGN(avctx
->width
, 4) *
480 FFALIGN(avctx
->height
, 4);
481 unsigned int max_decomp_size
;
483 if (avctx
->extradata_size
< 8) {
484 av_log(avctx
, AV_LOG_ERROR
, "Extradata size too small.\n");
485 return AVERROR_INVALIDDATA
;
488 /* Check codec type */
489 if ((avctx
->codec_id
== AV_CODEC_ID_MSZH
&& avctx
->extradata
[7] != CODEC_MSZH
) ||
490 (avctx
->codec_id
== AV_CODEC_ID_ZLIB
&& avctx
->extradata
[7] != CODEC_ZLIB
)) {
491 av_log(avctx
, AV_LOG_ERROR
, "Codec id and codec type mismatch. This should not happen.\n");
494 /* Detect image type */
495 switch (c
->imgtype
= avctx
->extradata
[4]) {
497 c
->decomp_size
= basesize
* 3;
498 max_decomp_size
= max_basesize
* 3;
499 avctx
->pix_fmt
= AV_PIX_FMT_YUV444P
;
500 av_log(avctx
, AV_LOG_DEBUG
, "Image type is YUV 1:1:1.\n");
503 c
->decomp_size
= basesize
* 2;
504 max_decomp_size
= max_basesize
* 2;
505 avctx
->pix_fmt
= AV_PIX_FMT_YUV422P
;
506 av_log(avctx
, AV_LOG_DEBUG
, "Image type is YUV 4:2:2.\n");
509 c
->decomp_size
= basesize
* 3;
510 max_decomp_size
= max_basesize
* 3;
511 avctx
->pix_fmt
= AV_PIX_FMT_BGR24
;
512 av_log(avctx
, AV_LOG_DEBUG
, "Image type is RGB 24.\n");
515 c
->decomp_size
= basesize
/ 2 * 3;
516 max_decomp_size
= max_basesize
/ 2 * 3;
517 avctx
->pix_fmt
= AV_PIX_FMT_YUV411P
;
518 av_log(avctx
, AV_LOG_DEBUG
, "Image type is YUV 4:1:1.\n");
521 c
->decomp_size
= basesize
* 2;
522 max_decomp_size
= max_basesize
* 2;
523 avctx
->pix_fmt
= AV_PIX_FMT_YUV422P
;
524 av_log(avctx
, AV_LOG_DEBUG
, "Image type is YUV 2:1:1.\n");
527 c
->decomp_size
= basesize
/ 2 * 3;
528 max_decomp_size
= max_basesize
/ 2 * 3;
529 avctx
->pix_fmt
= AV_PIX_FMT_YUV420P
;
530 av_log(avctx
, AV_LOG_DEBUG
, "Image type is YUV 4:2:0.\n");
533 av_log(avctx
, AV_LOG_ERROR
, "Unsupported image format %d.\n", c
->imgtype
);
534 return AVERROR_INVALIDDATA
;
537 /* Detect compression method */
538 c
->compression
= (int8_t)avctx
->extradata
[5];
539 switch (avctx
->codec_id
) {
540 case AV_CODEC_ID_MSZH
:
541 switch (c
->compression
) {
543 av_log(avctx
, AV_LOG_DEBUG
, "Compression enabled.\n");
545 case COMP_MSZH_NOCOMP
:
547 av_log(avctx
, AV_LOG_DEBUG
, "No compression.\n");
550 av_log(avctx
, AV_LOG_ERROR
, "Unsupported compression format for MSZH (%d).\n", c
->compression
);
551 return AVERROR_INVALIDDATA
;
554 #if CONFIG_ZLIB_DECODER
555 case AV_CODEC_ID_ZLIB
:
556 switch (c
->compression
) {
557 case COMP_ZLIB_HISPEED
:
558 av_log(avctx
, AV_LOG_DEBUG
, "High speed compression.\n");
560 case COMP_ZLIB_HICOMP
:
561 av_log(avctx
, AV_LOG_DEBUG
, "High compression.\n");
563 case COMP_ZLIB_NORMAL
:
564 av_log(avctx
, AV_LOG_DEBUG
, "Normal compression.\n");
567 if (c
->compression
< Z_NO_COMPRESSION
|| c
->compression
> Z_BEST_COMPRESSION
) {
568 av_log(avctx
, AV_LOG_ERROR
, "Unsupported compression level for ZLIB: (%d).\n", c
->compression
);
569 return AVERROR_INVALIDDATA
;
571 av_log(avctx
, AV_LOG_DEBUG
, "Compression level for ZLIB: (%d).\n", c
->compression
);
576 av_log(avctx
, AV_LOG_ERROR
, "BUG! Unknown codec in compression switch.\n");
577 return AVERROR_INVALIDDATA
;
580 /* Allocate decompression buffer */
581 if (c
->decomp_size
) {
582 if ((c
->decomp_buf
= av_malloc(max_decomp_size
)) == NULL
) {
583 av_log(avctx
, AV_LOG_ERROR
, "Can't allocate decompression buffer.\n");
584 return AVERROR(ENOMEM
);
589 c
->flags
= avctx
->extradata
[6];
590 if (c
->flags
& FLAG_MULTITHREAD
)
591 av_log(avctx
, AV_LOG_DEBUG
, "Multithread encoder flag set.\n");
592 if (c
->flags
& FLAG_NULLFRAME
)
593 av_log(avctx
, AV_LOG_DEBUG
, "Nullframe insertion flag set.\n");
594 if (avctx
->codec_id
== AV_CODEC_ID_ZLIB
&& (c
->flags
& FLAG_PNGFILTER
))
595 av_log(avctx
, AV_LOG_DEBUG
, "PNG filter flag set.\n");
596 if (c
->flags
& FLAGMASK_UNUSED
)
597 av_log(avctx
, AV_LOG_ERROR
, "Unknown flag set (%d).\n", c
->flags
);
599 /* If needed init zlib */
600 #if CONFIG_ZLIB_DECODER
601 if (avctx
->codec_id
== AV_CODEC_ID_ZLIB
) {
603 c
->zstream
.zalloc
= Z_NULL
;
604 c
->zstream
.zfree
= Z_NULL
;
605 c
->zstream
.opaque
= Z_NULL
;
606 zret
= inflateInit(&c
->zstream
);
608 av_log(avctx
, AV_LOG_ERROR
, "Inflate init error: %d\n", zret
);
609 av_freep(&c
->decomp_buf
);
610 return AVERROR_UNKNOWN
;
623 static av_cold
int decode_end(AVCodecContext
*avctx
)
625 LclDecContext
* const c
= avctx
->priv_data
;
627 av_freep(&c
->decomp_buf
);
629 avctx
->release_buffer(avctx
, &c
->pic
);
630 #if CONFIG_ZLIB_DECODER
631 if (avctx
->codec_id
== AV_CODEC_ID_ZLIB
)
632 inflateEnd(&c
->zstream
);
638 #if CONFIG_MSZH_DECODER
639 AVCodec ff_mszh_decoder
= {
641 .type
= AVMEDIA_TYPE_VIDEO
,
642 .id
= AV_CODEC_ID_MSZH
,
643 .priv_data_size
= sizeof(LclDecContext
),
646 .decode
= decode_frame
,
647 .capabilities
= CODEC_CAP_DR1
,
648 .long_name
= NULL_IF_CONFIG_SMALL("LCL (LossLess Codec Library) MSZH"),
652 #if CONFIG_ZLIB_DECODER
653 AVCodec ff_zlib_decoder
= {
655 .type
= AVMEDIA_TYPE_VIDEO
,
656 .id
= AV_CODEC_ID_ZLIB
,
657 .priv_data_size
= sizeof(LclDecContext
),
660 .decode
= decode_frame
,
661 .capabilities
= CODEC_CAP_DR1
,
662 .long_name
= NULL_IF_CONFIG_SMALL("LCL (LossLess Codec Library) ZLIB"),