2 * Indeo Video Interactive v4 compatible decoder
3 * Copyright (c) 2009-2011 Maxim Poliakovski
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 * Indeo Video Interactive version 4 decoder
26 * Indeo 4 data is usually transported within .avi or .mov files.
27 * Known FOURCCs: 'IV41'
30 #define BITSTREAM_READER_LE
32 #include "bitstream.h"
33 #include "indeo4data.h"
39 #define IVI4_PIC_SIZE_ESC 7
43 InvTransformPtr *inv_trans;
44 DCTransformPtr *dc_trans;
47 { ff_ivi_inverse_haar_8x8, ff_ivi_dc_haar_2d, 1 },
48 { ff_ivi_row_haar8, ff_ivi_dc_haar_2d, 0 },
49 { ff_ivi_col_haar8, ff_ivi_dc_haar_2d, 0 },
50 { ff_ivi_put_pixels_8x8, ff_ivi_put_dc_pixel_8x8, 1 },
51 { ff_ivi_inverse_slant_8x8, ff_ivi_dc_slant_2d, 1 },
52 { ff_ivi_row_slant8, ff_ivi_dc_row_slant, 1 },
53 { ff_ivi_col_slant8, ff_ivi_dc_col_slant, 1 },
54 { NULL, NULL, 0 }, /* inverse DCT 8x8 */
55 { NULL, NULL, 0 }, /* inverse DCT 8x1 */
56 { NULL, NULL, 0 }, /* inverse DCT 1x8 */
57 { ff_ivi_inverse_haar_4x4, ff_ivi_dc_haar_2d, 1 },
58 { ff_ivi_inverse_slant_4x4, ff_ivi_dc_slant_2d, 1 },
59 { NULL, NULL, 0 }, /* no transform 4x4 */
60 { ff_ivi_row_haar4, ff_ivi_dc_haar_2d, 0 },
61 { ff_ivi_col_haar4, ff_ivi_dc_haar_2d, 0 },
62 { ff_ivi_row_slant4, ff_ivi_dc_row_slant, 0 },
63 { ff_ivi_col_slant4, ff_ivi_dc_col_slant, 0 },
64 { NULL, NULL, 0 }, /* inverse DCT 4x4 */
68 * Decode subdivision of a plane.
69 * This is a simplified version that checks for two supported subdivisions:
70 * - 1 wavelet band per plane, size factor 1:1, code pattern: 3
71 * - 4 wavelet bands per plane, size factor 1:4, code pattern: 2,3,3,3,3
72 * Anything else is either unsupported or corrupt.
74 * @param[in,out] bc the Bitstream context
75 * @return number of wavelet bands or 0 on error
77 static int decode_plane_subdivision(BitstreamContext *bc)
81 switch (bitstream_read(bc, 2)) {
85 for (i = 0; i < 4; i++)
86 if (bitstream_read(bc, 2) != 3)
94 static inline int scale_tile_size(int def_size, int size_factor)
96 return size_factor == 15 ? def_size : (size_factor + 1) << 5;
100 * Decode Indeo 4 picture header.
102 * @param[in,out] ctx pointer to the decoder context
103 * @param[in] avctx pointer to the AVCodecContext
104 * @return result code: 0 = OK, negative number = error
106 static int decode_pic_hdr(IVI45DecContext *ctx, AVCodecContext *avctx)
108 int pic_size_indx, i, p;
109 IVIPicConfig pic_conf;
111 if (bitstream_read(&ctx->bc, 18) != 0x3FFF8) {
112 av_log(avctx, AV_LOG_ERROR, "Invalid picture start code!\n");
113 return AVERROR_INVALIDDATA;
116 ctx->prev_frame_type = ctx->frame_type;
117 ctx->frame_type = bitstream_read(&ctx->bc, 3);
118 if (ctx->frame_type == 7) {
119 av_log(avctx, AV_LOG_ERROR, "Invalid frame type: %d\n", ctx->frame_type);
120 return AVERROR_INVALIDDATA;
123 if (ctx->frame_type == IVI4_FRAMETYPE_BIDIR)
124 ctx->has_b_frames = 1;
126 ctx->has_transp = bitstream_read_bit(&ctx->bc);
128 /* unknown bit: Mac decoder ignores this bit, XANIM returns error */
129 if (bitstream_read_bit(&ctx->bc)) {
130 av_log(avctx, AV_LOG_ERROR, "Sync bit is set!\n");
131 return AVERROR_INVALIDDATA;
134 ctx->data_size = bitstream_read_bit(&ctx->bc) ? bitstream_read(&ctx->bc, 24) : 0;
136 /* null frames don't contain anything else so we just return */
137 if (ctx->frame_type >= IVI4_FRAMETYPE_NULL_FIRST) {
138 ff_dlog(avctx, "Null frame encountered!\n");
142 /* Check key lock status. If enabled - ignore lock word. */
143 /* Usually we have to prompt the user for the password, but */
144 /* we don't do that because Indeo 4 videos can be decoded anyway */
145 if (bitstream_read_bit(&ctx->bc)) {
146 bitstream_skip(&ctx->bc, 32);
147 ff_dlog(avctx, "Password-protected clip!\n");
150 pic_size_indx = bitstream_read(&ctx->bc, 3);
151 if (pic_size_indx == IVI4_PIC_SIZE_ESC) {
152 pic_conf.pic_height = bitstream_read(&ctx->bc, 16);
153 pic_conf.pic_width = bitstream_read(&ctx->bc, 16);
155 pic_conf.pic_height = ivi4_common_pic_sizes[pic_size_indx * 2 + 1];
156 pic_conf.pic_width = ivi4_common_pic_sizes[pic_size_indx * 2 ];
159 /* Decode tile dimensions. */
160 ctx->uses_tiling = bitstream_read_bit(&ctx->bc);
161 if (ctx->uses_tiling) {
162 pic_conf.tile_height = scale_tile_size(pic_conf.pic_height, bitstream_read(&ctx->bc, 4));
163 pic_conf.tile_width = scale_tile_size(pic_conf.pic_width, bitstream_read(&ctx->bc, 4));
165 pic_conf.tile_height = pic_conf.pic_height;
166 pic_conf.tile_width = pic_conf.pic_width;
169 /* Decode chroma subsampling. We support only 4:4 aka YVU9. */
170 if (bitstream_read(&ctx->bc, 2)) {
171 av_log(avctx, AV_LOG_ERROR, "Only YVU9 picture format is supported!\n");
172 return AVERROR_INVALIDDATA;
174 pic_conf.chroma_height = (pic_conf.pic_height + 3) >> 2;
175 pic_conf.chroma_width = (pic_conf.pic_width + 3) >> 2;
177 /* decode subdivision of the planes */
178 pic_conf.luma_bands = decode_plane_subdivision(&ctx->bc);
179 if (pic_conf.luma_bands)
180 pic_conf.chroma_bands = decode_plane_subdivision(&ctx->bc);
181 ctx->is_scalable = pic_conf.luma_bands != 1 || pic_conf.chroma_bands != 1;
182 if (ctx->is_scalable && (pic_conf.luma_bands != 4 || pic_conf.chroma_bands != 1)) {
183 av_log(avctx, AV_LOG_ERROR, "Scalability: unsupported subdivision! Luma bands: %d, chroma bands: %d\n",
184 pic_conf.luma_bands, pic_conf.chroma_bands);
185 return AVERROR_INVALIDDATA;
188 /* check if picture layout was changed and reallocate buffers */
189 if (ivi_pic_config_cmp(&pic_conf, &ctx->pic_conf)) {
190 if (ff_ivi_init_planes(ctx->planes, &pic_conf, 1)) {
191 av_log(avctx, AV_LOG_ERROR, "Couldn't reallocate color planes!\n");
192 ctx->pic_conf.luma_bands = 0;
193 return AVERROR(ENOMEM);
196 ctx->pic_conf = pic_conf;
198 /* set default macroblock/block dimensions */
199 for (p = 0; p <= 2; p++) {
200 for (i = 0; i < (!p ? pic_conf.luma_bands : pic_conf.chroma_bands); i++) {
201 ctx->planes[p].bands[i].mb_size = !p ? (!ctx->is_scalable ? 16 : 8) : 4;
202 ctx->planes[p].bands[i].blk_size = !p ? 8 : 4;
206 if (ff_ivi_init_tiles(ctx->planes, ctx->pic_conf.tile_width,
207 ctx->pic_conf.tile_height)) {
208 av_log(avctx, AV_LOG_ERROR,
209 "Couldn't reallocate internal structures!\n");
210 return AVERROR(ENOMEM);
214 ctx->frame_num = bitstream_read_bit(&ctx->bc) ? bitstream_read(&ctx->bc, 20) : 0;
216 /* skip decTimeEst field if present */
217 if (bitstream_read_bit(&ctx->bc))
218 bitstream_skip(&ctx->bc, 8);
220 /* decode macroblock and block huffman codebooks */
221 if (ff_ivi_dec_huff_desc(&ctx->bc, bitstream_read_bit(&ctx->bc), IVI_MB_HUFF, &ctx->mb_vlc, avctx) ||
222 ff_ivi_dec_huff_desc(&ctx->bc, bitstream_read_bit(&ctx->bc), IVI_BLK_HUFF, &ctx->blk_vlc, avctx))
223 return AVERROR_INVALIDDATA;
225 ctx->rvmap_sel = bitstream_read_bit(&ctx->bc) ? bitstream_read(&ctx->bc, 3) : 8;
227 ctx->in_imf = bitstream_read_bit(&ctx->bc);
228 ctx->in_q = bitstream_read_bit(&ctx->bc);
230 ctx->pic_glob_quant = bitstream_read(&ctx->bc, 5);
232 /* TODO: ignore this parameter if unused */
233 ctx->unknown1 = bitstream_read_bit(&ctx->bc) ? bitstream_read(&ctx->bc, 3) : 0;
235 ctx->checksum = bitstream_read_bit(&ctx->bc) ? bitstream_read(&ctx->bc, 16) : 0;
237 /* skip picture header extension if any */
238 while (bitstream_read_bit(&ctx->bc)) {
239 ff_dlog(avctx, "Pic hdr extension encountered!\n");
240 bitstream_skip(&ctx->bc, 8);
243 if (bitstream_read_bit(&ctx->bc)) {
244 av_log(avctx, AV_LOG_ERROR, "Bad blocks bits encountered!\n");
247 bitstream_align(&ctx->bc);
254 * Decode Indeo 4 band header.
256 * @param[in,out] ctx pointer to the decoder context
257 * @param[in,out] band pointer to the band descriptor
258 * @param[in] avctx pointer to the AVCodecContext
259 * @return result code: 0 = OK, negative number = error
261 static int decode_band_hdr(IVI45DecContext *ctx, IVIBandDesc *band,
262 AVCodecContext *avctx)
264 int plane, band_num, indx, transform_id, scan_indx;
267 plane = bitstream_read(&ctx->bc, 2);
268 band_num = bitstream_read(&ctx->bc, 4);
269 if (band->plane != plane || band->band_num != band_num) {
270 av_log(avctx, AV_LOG_ERROR, "Invalid band header sequence!\n");
271 return AVERROR_INVALIDDATA;
274 band->is_empty = bitstream_read_bit(&ctx->bc);
275 if (!band->is_empty) {
276 int old_blk_size = band->blk_size;
278 * If header size is not given, header size is 4 bytes. */
279 if (bitstream_read_bit(&ctx->bc))
280 bitstream_skip(&ctx->bc, 16);
282 band->is_halfpel = bitstream_read(&ctx->bc, 2);
283 if (band->is_halfpel >= 2) {
284 av_log(avctx, AV_LOG_ERROR, "Invalid/unsupported mv resolution: %d!\n",
286 return AVERROR_INVALIDDATA;
288 if (!band->is_halfpel)
289 ctx->uses_fullpel = 1;
291 band->checksum_present = bitstream_read_bit(&ctx->bc);
292 if (band->checksum_present)
293 band->checksum = bitstream_read(&ctx->bc, 16);
295 indx = bitstream_read(&ctx->bc, 2);
297 av_log(avctx, AV_LOG_ERROR, "Invalid block size!\n");
298 return AVERROR_INVALIDDATA;
300 band->mb_size = 16 >> indx;
301 band->blk_size = 8 >> (indx >> 1);
303 band->inherit_mv = bitstream_read_bit(&ctx->bc);
304 band->inherit_qdelta = bitstream_read_bit(&ctx->bc);
306 band->glob_quant = bitstream_read(&ctx->bc, 5);
308 if (!bitstream_read_bit(&ctx->bc) || ctx->frame_type == IVI4_FRAMETYPE_INTRA) {
309 transform_id = bitstream_read(&ctx->bc, 5);
310 if (transform_id >= FF_ARRAY_ELEMS(transforms) ||
311 !transforms[transform_id].inv_trans) {
312 avpriv_request_sample(avctx, "Transform %d", transform_id);
313 return AVERROR_PATCHWELCOME;
315 if ((transform_id >= 7 && transform_id <= 9) ||
316 transform_id == 17) {
317 avpriv_request_sample(avctx, "DCT transform");
318 return AVERROR_PATCHWELCOME;
321 if ((transform_id >= 0 && transform_id <= 2) || transform_id == 10)
324 band->inv_transform = transforms[transform_id].inv_trans;
325 band->dc_transform = transforms[transform_id].dc_trans;
326 band->is_2d_trans = transforms[transform_id].is_2d_trans;
327 if (transform_id < 10)
328 band->transform_size = 8;
330 band->transform_size = 4;
332 if (band->blk_size != band->transform_size)
333 return AVERROR_INVALIDDATA;
335 scan_indx = bitstream_read(&ctx->bc, 4);
336 if (scan_indx == 15) {
337 av_log(avctx, AV_LOG_ERROR, "Custom scan pattern encountered!\n");
338 return AVERROR_INVALIDDATA;
340 if (scan_indx > 4 && scan_indx < 10) {
341 if (band->blk_size != 4)
342 return AVERROR_INVALIDDATA;
343 } else if (band->blk_size != 8)
344 return AVERROR_INVALIDDATA;
346 band->scan = scan_index_to_tab[scan_indx];
348 band->quant_mat = bitstream_read(&ctx->bc, 5);
349 if (band->quant_mat >= FF_ARRAY_ELEMS(quant_index_to_tab)) {
351 if (band->quant_mat == 31)
352 av_log(avctx, AV_LOG_ERROR,
353 "Custom quant matrix encountered!\n");
355 avpriv_request_sample(avctx, "Quantization matrix %d",
357 band->quant_mat = -1;
358 return AVERROR_INVALIDDATA;
361 if (old_blk_size != band->blk_size) {
362 av_log(avctx, AV_LOG_ERROR,
363 "The band block size does not match the configuration "
365 return AVERROR_INVALIDDATA;
367 if (band->quant_mat < 0) {
368 av_log(avctx, AV_LOG_ERROR, "Invalid quant_mat inherited\n");
369 return AVERROR_INVALIDDATA;
373 /* decode block huffman codebook */
374 if (!bitstream_read_bit(&ctx->bc))
375 band->blk_vlc.tab = ctx->blk_vlc.tab;
377 if (ff_ivi_dec_huff_desc(&ctx->bc, 1, IVI_BLK_HUFF,
378 &band->blk_vlc, avctx))
379 return AVERROR_INVALIDDATA;
381 /* select appropriate rvmap table for this band */
382 band->rvmap_sel = bitstream_read_bit(&ctx->bc) ? bitstream_read(&ctx->bc, 3) : 8;
384 /* decode rvmap probability corrections if any */
385 band->num_corr = 0; /* there is no corrections */
386 if (bitstream_read_bit(&ctx->bc)) {
387 band->num_corr = bitstream_read(&ctx->bc, 8); /* get number of correction pairs */
388 if (band->num_corr > 61) {
389 av_log(avctx, AV_LOG_ERROR, "Too many corrections: %d\n",
391 return AVERROR_INVALIDDATA;
394 /* read correction pairs */
395 for (i = 0; i < band->num_corr * 2; i++)
396 band->corr[i] = bitstream_read(&ctx->bc, 8);
400 if (band->blk_size == 8) {
401 band->intra_base = &ivi4_quant_8x8_intra[quant_index_to_tab[band->quant_mat]][0];
402 band->inter_base = &ivi4_quant_8x8_inter[quant_index_to_tab[band->quant_mat]][0];
404 band->intra_base = &ivi4_quant_4x4_intra[quant_index_to_tab[band->quant_mat]][0];
405 band->inter_base = &ivi4_quant_4x4_inter[quant_index_to_tab[band->quant_mat]][0];
408 /* Indeo 4 doesn't use scale tables */
409 band->intra_scale = NULL;
410 band->inter_scale = NULL;
412 bitstream_align(&ctx->bc);
419 * Decode information (block type, cbp, quant delta, motion vector)
420 * for all macroblocks in the current tile.
422 * @param[in,out] ctx pointer to the decoder context
423 * @param[in,out] band pointer to the band descriptor
424 * @param[in,out] tile pointer to the tile descriptor
425 * @param[in] avctx pointer to the AVCodecContext
426 * @return result code: 0 = OK, negative number = error
428 static int decode_mb_info(IVI45DecContext *ctx, IVIBandDesc *band,
429 IVITile *tile, AVCodecContext *avctx)
431 int x, y, mv_x, mv_y, mv_delta, offs, mb_offset, blks_per_mb,
432 mv_scale, mb_type_bits;
433 IVIMbInfo *mb, *ref_mb;
434 int row_offset = band->mb_size * band->pitch;
437 ref_mb = tile->ref_mbs;
438 offs = tile->ypos * band->pitch + tile->xpos;
440 blks_per_mb = band->mb_size != band->blk_size ? 4 : 1;
441 mb_type_bits = ctx->frame_type == IVI4_FRAMETYPE_BIDIR ? 2 : 1;
443 /* scale factor for motion vectors */
444 mv_scale = (ctx->planes[0].bands[0].mb_size >> 3) - (band->mb_size >> 3);
447 for (y = tile->ypos; y < tile->ypos + tile->height; y += band->mb_size) {
450 for (x = tile->xpos; x < tile->xpos + tile->width; x += band->mb_size) {
453 mb->buf_offs = mb_offset;
457 if (bitstream_read_bit(&ctx->bc)) {
458 if (ctx->frame_type == IVI4_FRAMETYPE_INTRA) {
459 av_log(avctx, AV_LOG_ERROR, "Empty macroblock in an INTRA picture!\n");
460 return AVERROR_INVALIDDATA;
462 mb->type = 1; /* empty macroblocks are always INTER */
463 mb->cbp = 0; /* all blocks are empty */
466 if (!band->plane && !band->band_num && ctx->in_q) {
467 mb->q_delta = bitstream_read_vlc(&ctx->bc,
468 ctx->mb_vlc.tab->table,
470 mb->q_delta = IVI_TOSIGNED(mb->q_delta);
473 mb->mv_x = mb->mv_y = 0; /* no motion vector coded */
474 if (band->inherit_mv && ref_mb) {
475 /* motion vector inheritance */
477 mb->mv_x = ivi_scale_mv(ref_mb->mv_x, mv_scale);
478 mb->mv_y = ivi_scale_mv(ref_mb->mv_y, mv_scale);
480 mb->mv_x = ref_mb->mv_x;
481 mb->mv_y = ref_mb->mv_y;
485 if (band->inherit_mv) {
486 /* copy mb_type from corresponding reference mb */
488 return AVERROR_INVALIDDATA;
489 mb->type = ref_mb->type;
490 } else if (ctx->frame_type == IVI4_FRAMETYPE_INTRA ||
491 ctx->frame_type == IVI4_FRAMETYPE_INTRA1) {
492 mb->type = 0; /* mb_type is always INTRA for intra-frames */
494 mb->type = bitstream_read(&ctx->bc, mb_type_bits);
497 mb->cbp = bitstream_read(&ctx->bc, blks_per_mb);
500 if (band->inherit_qdelta) {
501 if (ref_mb) mb->q_delta = ref_mb->q_delta;
502 } else if (mb->cbp || (!band->plane && !band->band_num &&
504 mb->q_delta = bitstream_read_vlc(&ctx->bc,
505 ctx->mb_vlc.tab->table,
507 mb->q_delta = IVI_TOSIGNED(mb->q_delta);
511 mb->mv_x = mb->mv_y = 0; /* there is no motion vector in intra-macroblocks */
513 if (band->inherit_mv) {
515 /* motion vector inheritance */
517 mb->mv_x = ivi_scale_mv(ref_mb->mv_x, mv_scale);
518 mb->mv_y = ivi_scale_mv(ref_mb->mv_y, mv_scale);
520 mb->mv_x = ref_mb->mv_x;
521 mb->mv_y = ref_mb->mv_y;
524 /* decode motion vector deltas */
525 mv_delta = bitstream_read_vlc(&ctx->bc,
526 ctx->mb_vlc.tab->table,
528 mv_y += IVI_TOSIGNED(mv_delta);
529 mv_delta = bitstream_read_vlc(&ctx->bc,
530 ctx->mb_vlc.tab->table,
532 mv_x += IVI_TOSIGNED(mv_delta);
536 mv_delta = bitstream_read_vlc(&ctx->bc,
537 ctx->mb_vlc.tab->table,
539 mv_y += IVI_TOSIGNED(mv_delta);
540 mv_delta = bitstream_read_vlc(&ctx->bc,
541 ctx->mb_vlc.tab->table,
543 mv_x += IVI_TOSIGNED(mv_delta);
549 mb->b_mv_x = -mb->mv_x;
550 mb->b_mv_y = -mb->mv_y;
560 mb_offset += band->mb_size;
566 bitstream_align(&ctx->bc);
573 * Rearrange decoding and reference buffers.
575 * @param[in,out] ctx pointer to the decoder context
577 static void switch_buffers(IVI45DecContext *ctx)
579 int is_prev_ref = 0, is_ref = 0;
581 switch (ctx->prev_frame_type) {
582 case IVI4_FRAMETYPE_INTRA:
583 case IVI4_FRAMETYPE_INTRA1:
584 case IVI4_FRAMETYPE_INTER:
589 switch (ctx->frame_type) {
590 case IVI4_FRAMETYPE_INTRA:
591 case IVI4_FRAMETYPE_INTRA1:
592 case IVI4_FRAMETYPE_INTER:
597 if (is_prev_ref && is_ref) {
598 FFSWAP(int, ctx->dst_buf, ctx->ref_buf);
599 } else if (is_prev_ref) {
600 FFSWAP(int, ctx->ref_buf, ctx->b_ref_buf);
601 FFSWAP(int, ctx->dst_buf, ctx->ref_buf);
606 static int is_nonnull_frame(IVI45DecContext *ctx)
608 return ctx->frame_type < IVI4_FRAMETYPE_NULL_FIRST;
612 static av_cold int decode_init(AVCodecContext *avctx)
614 IVI45DecContext *ctx = avctx->priv_data;
616 ff_ivi_init_static_vlc();
618 /* copy rvmap tables in our context so we can apply changes to them */
619 memcpy(ctx->rvmap_tabs, ff_ivi_rvmap_tabs, sizeof(ff_ivi_rvmap_tabs));
621 /* Force allocation of the internal buffers */
622 /* during picture header decoding. */
623 ctx->pic_conf.pic_width = 0;
624 ctx->pic_conf.pic_height = 0;
626 avctx->pix_fmt = AV_PIX_FMT_YUV410P;
628 ctx->decode_pic_hdr = decode_pic_hdr;
629 ctx->decode_band_hdr = decode_band_hdr;
630 ctx->decode_mb_info = decode_mb_info;
631 ctx->switch_buffers = switch_buffers;
632 ctx->is_nonnull_frame = is_nonnull_frame;
635 ctx->show_indeo4_info = 1;
639 ctx->b_ref_buf = 3; /* buffer 2 is used for scalability mode */
640 ctx->p_frame = av_frame_alloc();
642 return AVERROR(ENOMEM);
648 AVCodec ff_indeo4_decoder = {
650 .long_name = NULL_IF_CONFIG_SMALL("Intel Indeo Video Interactive 4"),
651 .type = AVMEDIA_TYPE_VIDEO,
652 .id = AV_CODEC_ID_INDEO4,
653 .priv_data_size = sizeof(IVI45DecContext),
655 .close = ff_ivi_decode_close,
656 .decode = ff_ivi_decode_frame,
657 .capabilities = AV_CODEC_CAP_DR1,