From patchwork Fri Jun 2 19:56:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul B Mahol X-Patchwork-Id: 3802 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.10.2 with SMTP id 2csp351513vsk; Fri, 2 Jun 2017 13:02:54 -0700 (PDT) X-Received: by 10.28.132.66 with SMTP id g63mr575511wmd.59.1496433773954; Fri, 02 Jun 2017 13:02:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1496433773; cv=none; d=google.com; s=arc-20160816; b=T3ckry9OeEVf52tFab6lSnBdiKfRAzAGboSjVC0NidJLD0Ft6dhGSGHtZv6BMcRxWS 6w73wHsoC7qtLd6SnCuaC8vethjEMeZmL/V/jrkZNEWu06/SRdaGLUVa+wP2IT2deoha OHPu7W3msZV9q3o/oBxLreeeD0RCU29k4Ag7tMVYOVha0M6LCN2URHma1rFM7dJ63HQF de9qa9aQklbgnV0QD4yEDU3UjCatZ564kQABF/lJAEet6+qjX6X2Tc0zldX28biS2ebs vBsl6AHELArYls3xkm1UIdHYsZ6ovQ7nnV06PiJ0u2rD9osr6UbFmrK4UQokGKt4hHuO qRDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=nXBR9vJ8x/m8sSvCQlUdq90oCzUTS7776ymlN9+yAuw=; b=OaM9fw4jdzIGeJrtFjFQ5if/zQlHlRTHRFPtdwgc23iX9u9w95XPWgeQje8wsYMrR+ RQWvGKhTNgJ1EJOue+/0D4WKGoCVQmpWoWtoMXZakMco5jeaAM9uvpi61SZ/zA7gqrPU NLgKJc1pEZMgKLj3HuccYv9XtbAkdAWaY4rnTbk8Q+KWlfWwjzUFpTP16KOcCc4gZxYc 7a6znJyeKqSPKA9Iq1kPFjZkdwE3WoGdAEvAI5teq2ZfI665dusNQM/V2Xmadlqxy+Lv XfFdsun/LsviZDbMLEXAz50dKsk1BdVJe+yYf09Frv2477Cvt/knVsd37IusTXFms3Ki GbJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id m66si3709188wma.23.2017.06.02.13.02.53; Fri, 02 Jun 2017 13:02:53 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 726F8689C4C; Fri, 2 Jun 2017 23:02:44 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr0-f196.google.com (mail-wr0-f196.google.com [209.85.128.196]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B76AB689C33 for ; Fri, 2 Jun 2017 23:02:37 +0300 (EEST) Received: by mail-wr0-f196.google.com with SMTP id g76so2114708wrd.2 for ; Fri, 02 Jun 2017 13:02:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=PaC/RfLzBHtMBxNUbPC9QCDX7LkLbvQXAntg7H2K6nY=; b=AUnOA+phLNj5k3fXaaVzs1Ayorv3eFXb8uVsrNkv+WWnt3EtFf6upt+/fMC6JZzuAZ 1e4yx7qNbkX7I6o+MvlRnAIx3UhXINPSVCLoNNIJokiwJthRiitkgCn5wrMj53aVzRyR HyRo0uuaqAp05ZReKnS8+8Jofy34Gxr6B2o3ULNaWFTlZJiXICmwS6onuYcKSD7hc2YY zyvnoXINj4a6Al8Xoysxje5g1IC26BbClYaC0xXkLvbPrMv/iuWI83Z5sm+QPHyX+lSi n8rRY1BEy/tmgaHW6WYKJKDd+R76R0cq5a1dmQL8iEjesetVGCeyR4EXvj64TtgwaHCb R82Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=PaC/RfLzBHtMBxNUbPC9QCDX7LkLbvQXAntg7H2K6nY=; b=nN6xQUYSr9fzc9rJ2uCx4tGozzYGu2xkQw/GTbtBL9aq9nizib5hipj7s5GIUwx+Vt 2w6TW1QsodPrDAKxQqqN7xz23JeFMfZ9d8IXWxmLdVluGcZwLtyvOe7oaN0UHBhqjMgo hw4GLr4xm7pHyIr9lEplFgcMHkyl1o2mHcByJBXRhASo9U9lPBPksyrdTPeDEMr5uhhO CnwMYiG5u4Caaah7GsJjAq+AKW+/ehb/qGxDrwXfmbZztkSTu1t+ptiMSDI7LirRUjat 06qoFxfpV2zW1jZ/oeXru16F2y2t3OGuIMJh7KO6dpdi5NEiyBoMggOf/q/JgUOWcRpj cszQ== X-Gm-Message-State: AODbwcAnpo2GK771xhpAvuk4+12Y7YUKnE0Ld1jd0QcfgIrZyRmLmK5i At+tKB68vafvpoK6 X-Received: by 10.223.163.80 with SMTP id d16mr7563203wrb.164.1496433397941; Fri, 02 Jun 2017 12:56:37 -0700 (PDT) Received: from localhost.localdomain ([94.250.174.60]) by smtp.gmail.com with ESMTPSA id t27sm4324515wra.35.2017.06.02.12.56.36 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 02 Jun 2017 12:56:37 -0700 (PDT) From: Paul B Mahol To: ffmpeg-devel@ffmpeg.org Date: Fri, 2 Jun 2017 21:56:18 +0200 Message-Id: <20170602195619.4374-2-onemda@gmail.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170602195619.4374-1-onemda@gmail.com> References: <20170602195619.4374-1-onemda@gmail.com> Subject: [FFmpeg-devel] [PATCH 2/3] avcodec: add Gremlin Digital Video decoder X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Paul B Mahol --- libavcodec/Makefile | 1 + libavcodec/allcodecs.c | 1 + libavcodec/avcodec.h | 1 + libavcodec/codec_desc.c | 7 + libavcodec/gdv.c | 404 ++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 414 insertions(+) create mode 100644 libavcodec/gdv.c diff --git a/libavcodec/Makefile b/libavcodec/Makefile index 759cc0c..af24ecd 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -308,6 +308,7 @@ OBJS-$(CONFIG_G723_1_DECODER) += g723_1dec.o g723_1.o \ OBJS-$(CONFIG_G723_1_ENCODER) += g723_1enc.o g723_1.o \ acelp_vectors.o celp_filters.o celp_math.o OBJS-$(CONFIG_G729_DECODER) += g729dec.o lsp.o celp_math.o celp_filters.o acelp_filters.o acelp_pitch_delay.o acelp_vectors.o g729postfilter.o +OBJS-$(CONFIG_GDV_DECODER) += gdv.o OBJS-$(CONFIG_GIF_DECODER) += gifdec.o lzw.o OBJS-$(CONFIG_GIF_ENCODER) += gif.o lzwenc.o OBJS-$(CONFIG_GREMLIN_DPCM_DECODER) += dpcm.o diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c index 31a6010..a1046d0 100644 --- a/libavcodec/allcodecs.c +++ b/libavcodec/allcodecs.c @@ -194,6 +194,7 @@ static void register_all(void) REGISTER_DECODER(FRAPS, fraps); REGISTER_DECODER(FRWU, frwu); REGISTER_DECODER(G2M, g2m); + REGISTER_DECODER(GDV, gdv); REGISTER_ENCDEC (GIF, gif); REGISTER_ENCDEC (H261, h261); REGISTER_ENCDEC (H263, h263); diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 59bd1c5..dcdcfe0 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -446,6 +446,7 @@ enum AVCodecID { AV_CODEC_ID_MSCC, AV_CODEC_ID_SRGC, AV_CODEC_ID_SVG, + AV_CODEC_ID_GDV, /* various PCM "codecs" */ AV_CODEC_ID_FIRST_AUDIO = 0x10000, ///< A dummy id pointing at the start of audio codecs diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c index 4cc5729..cf1246e 100644 --- a/libavcodec/codec_desc.c +++ b/libavcodec/codec_desc.c @@ -1410,6 +1410,13 @@ static const AVCodecDescriptor codec_descriptors[] = { .long_name = NULL_IF_CONFIG_SMALL("Screen Recorder Gold Codec"), .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS, }, + { + .id = AV_CODEC_ID_GDV, + .type = AVMEDIA_TYPE_VIDEO, + .name = "gdv", + .long_name = NULL_IF_CONFIG_SMALL("Gremlin Digital Video"), + .props = AV_CODEC_PROP_LOSSY, + }, /* image codecs */ { diff --git a/libavcodec/gdv.c b/libavcodec/gdv.c new file mode 100644 index 0000000..975031f --- /dev/null +++ b/libavcodec/gdv.c @@ -0,0 +1,404 @@ +/* + * Grelmlin Digital Video (GDV) decoder + * Copyright (c) 2017 Konstantin Shishkov + * Copyright (c) 2017 Paul B Mahol + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * 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. + * + * FFmpeg is distributed in the hope that it will be useful, + * 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 + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "libavutil/common.h" +#include "avcodec.h" +#include "bytestream.h" +#include "internal.h" + +typedef struct GDVContext { + AVCodecContext *avctx; + + GetByteContext gb; + GetByteContext g2; + PutByteContext pb; + + uint32_t pal[256]; + uint8_t *frame; + unsigned frame_size; + unsigned scale_h, scale_v; +} GDVContext; + +typedef struct Bits32 { + uint32_t queue; + uint8_t fill; +} Bits32; + +#define PREAMBLE_SIZE 4096 + +static av_cold int gdv_decode_init(AVCodecContext *avctx) +{ + GDVContext *gdv = avctx->priv_data; + int i, j, k; + + avctx->pix_fmt = AV_PIX_FMT_PAL8; + gdv->frame_size = avctx->width * avctx->height + PREAMBLE_SIZE; + gdv->frame = av_calloc(gdv->frame_size, 1); + if (!gdv->frame) + return AVERROR(ENOMEM); + + for (i = 0; i < 2; i++) { + for (j = 0; j < 256; j++) { + for (k = 0; k < 8; k++) { + gdv->frame[i * 2048 + j * 8 + k] = j; + } + } + } + + return 0; +} + +static void rescale(GDVContext *gdv, uint8_t *dst, int w, int h, int scale_v, int scale_h) +{ + int i, j, y, x; + + if ((gdv->scale_v == scale_v) && (gdv->scale_h == scale_h)) { + return; + } + + if (gdv->scale_h && gdv->scale_v) { + for (j = 0; j < h; j++) { + int y = h - j - 1; + for (i = 0; i < w; i++) { + int x = w - i - 1; + dst[PREAMBLE_SIZE + x + y * w] = dst[PREAMBLE_SIZE + x/2 + (y/2) * (w/2)]; + } + } + } else if (gdv->scale_h) { + for (j = 0; j < h; j++) { + int y = h - j - 1; + for (x = 0; x < w; x++) { + dst[PREAMBLE_SIZE + x + y * w] = dst[PREAMBLE_SIZE + x + (y/2) * w]; + } + } + } else if (gdv->scale_v) { + for (j = 0; j < h; j++) { + int y = h - j - 1; + for (i = 0; i < w; i++) { + int x = w - i - 1; + dst[PREAMBLE_SIZE + x + y * w] = dst[PREAMBLE_SIZE + x/2 + y * (w/2)]; + } + } + } + + if (scale_h && scale_v) { + for (y = 0; y < h/2; y++) { + for (x = 0; x < w/2; x++) { + dst[PREAMBLE_SIZE + x + y * (w/2)] = dst[PREAMBLE_SIZE + x*2 + y*2 * w]; + } + } + } else if (scale_h) { + for (y = 0; y < h/2; y++) { + for (x = 0; x < w; x++) { + dst[PREAMBLE_SIZE + x + y * w] = dst[PREAMBLE_SIZE + x + y*2 * w]; + } + } + } else if (scale_v) { + for (y = 0; y < h; y++) { + for (x = 0; x < w/2; x++) { + dst[PREAMBLE_SIZE + x + y * w] = dst[PREAMBLE_SIZE + x*2 + y * w]; + } + } + } + + gdv->scale_v = scale_v; + gdv->scale_h = scale_h; +} + +static void fill_bits32(Bits32 *bits, GetByteContext *gb) +{ + bits->queue = bytestream2_get_le32(gb); + bits->fill = 32; +} + +static int read_bits32(Bits32 *bits, GetByteContext *gb, int nbits) +{ + int res = bits->queue & ((1 << nbits) - 1); + + bits->queue >>= nbits; + bits->fill -= nbits; + if (bits->fill <= 16) { + bits->queue |= bytestream2_get_le16(gb) << bits->fill; + bits->fill += 16; + } + + return res; +} + +static void lz_copy(PutByteContext *pb, GetByteContext *g2, int offset, unsigned len) +{ + int i; + + if (offset == -1) { + int c; + + bytestream2_seek(g2, bytestream2_tell_p(pb) - 1, SEEK_SET); + c = bytestream2_get_byte(g2); + for (i = 0; i < len; i++) { + bytestream2_put_byte(pb, c); + } + } else if (offset < 0) { + int start = bytestream2_tell_p(pb) - (-offset); + + bytestream2_seek(g2, start, SEEK_SET); + for (i = 0; i < len; i++) { + bytestream2_put_byte(pb, bytestream2_get_byte(g2)); + } + } else { + int start = bytestream2_tell_p(pb) + offset; + + bytestream2_seek(g2, start, SEEK_SET); + for (i = 0; i < len; i++) { + bytestream2_put_byte(pb, bytestream2_get_byte(g2)); + } + } +} + +static int decompress_68(AVCodecContext *avctx, unsigned skip, unsigned use8) +{ + GDVContext *gdv = avctx->priv_data; + GetByteContext *gb = &gdv->gb; + GetByteContext *g2 = &gdv->g2; + PutByteContext *pb = &gdv->pb; + Bits32 bits; + + bytestream2_init(g2, gdv->frame, gdv->frame_size); + bytestream2_skip_p(pb, skip + PREAMBLE_SIZE); + fill_bits32(&bits, gb); + + while (bytestream2_get_bytes_left_p(pb) > 0 && bytestream2_get_bytes_left(gb) > 0) { + int tag = read_bits32(&bits, gb, 2); + if (tag == 0) { + int b = read_bits32(&bits, gb, 1); + if (b == 0) { + bytestream2_put_byte(pb, bytestream2_get_byte(gb)); + } else { + int i, len = 2; + int lbits = 0; + while (1) { + int val; + + lbits += 1; + val = read_bits32(&bits, gb, lbits); + len += val; + if (val != ((1 << lbits) - 1)) { + break; + } + assert(lbits < 16); + } + for (i = 0; i < len; i++) { + bytestream2_put_byte(pb, bytestream2_get_byte(gb)); + } + } + } else if (tag == 1) { + int b = read_bits32(&bits, gb, 1); + int len; + + if (b == 0) { + len = (read_bits32(&bits, gb, 4)) + 2; + } else { + int bb = bytestream2_get_byte(gb); + if ((bb & 0x80) == 0) { + len = bb + 18; + } else { + int top = (bb & 0x7F) << 8; + len = top + bytestream2_get_byte(gb) + 146; + } + } + bytestream2_skip_p(pb, len); + } else if (tag == 2) { + int i, subtag = read_bits32(&bits, gb, 2); + + if (subtag != 3) { + int top = (read_bits32(&bits, gb, 4)) << 8; + int offs = top + bytestream2_get_byte(gb); + if ((subtag != 0) || (offs <= 0xF80)) { + int len = (subtag) + 3; + lz_copy(pb, g2, (offs) - 4096, len); + } else { + if (offs == 0xFFF) { + return 0; + } + + int real_off = ((offs >> 4) & 0x7) + 1; + int len = ((offs & 0xF) + 2) * 2; + int c1 = gdv->frame[bytestream2_tell_p(pb) - real_off]; + int c2 = gdv->frame[bytestream2_tell_p(pb) - real_off + 1]; + for (i = 0; i < len/2; i++) { + bytestream2_put_byte(pb, c1); + bytestream2_put_byte(pb, c2); + } + } + } else { + int b = bytestream2_get_byte(gb); + int off = ((b & 0x7F)) + 1; + int len = ((b & 0x80) == 0) ? 2 : 3; + + lz_copy(pb, g2, -off, len); + } + } else { + int len; + int off; + if (use8) { + int b = bytestream2_get_byte(gb); + if ((b & 0xC0) == 0xC0) { + len = ((b & 0x3F)) + 8; + int q = read_bits32(&bits, gb, 4); + off = (q << 8) + (bytestream2_get_byte(gb)) + 1; + } else { + int ofs1; + if ((b & 0x80) == 0) { + len = ((b >> 4)) + 6; + ofs1 = (b & 0xF); + } else { + len = ((b & 0x3F)) + 14; + ofs1 = read_bits32(&bits, gb, 4); + } + off = (ofs1 << 8) + (bytestream2_get_byte(gb)) - 4096; + } + } else { + int b = bytestream2_get_byte(gb); + + if ((b >> 4) == 0xF) { + len = bytestream2_get_byte(gb) + 21; + } else { + len = (b >> 4) + 6; + } + int ofs1 = (b & 0xF); + off = (ofs1 << 8) + bytestream2_get_byte(gb) - 4096; + } + lz_copy(pb, g2, off, len); + } + } + + return 0; +} + +static int gdv_decode_frame(AVCodecContext *avctx, void *data, + int *got_frame, AVPacket *avpkt) +{ + GDVContext *gdv = avctx->priv_data; + GetByteContext *gb = &gdv->gb; + PutByteContext *pb = &gdv->pb; + AVFrame *frame = data; + int ret, i, pal_size; + const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, &pal_size); + int compression; + unsigned flags; + uint8_t *dst; + + if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) + return ret; + if (pal && pal_size == AVPALETTE_SIZE) + memcpy(gdv->pal, pal, AVPALETTE_SIZE); + + bytestream2_init(gb, avpkt->data, avpkt->size); + bytestream2_init_writer(pb, gdv->frame, gdv->frame_size); + + flags = bytestream2_get_le32(gb); + compression = flags & 0xF; + + rescale(gdv, gdv->frame, avctx->width, avctx->height, + !!(flags & 0x10), !!(flags & 0x20)); + + switch (compression) { + case 1: + memset(gdv->frame + PREAMBLE_SIZE, 0, gdv->frame_size - PREAMBLE_SIZE); + case 0: + for (i = 0; i < 256; i++) { + unsigned r = bytestream2_get_byte(gb); + unsigned g = bytestream2_get_byte(gb); + unsigned b = bytestream2_get_byte(gb); + gdv->pal[i] = 0xFF << 24 | r << 18 | g << 10 | b << 2; + } + break; + case 3: + break; + case 6: + ret = decompress_68(avctx, flags >> 8, 0); + break; + case 8: + ret = decompress_68(avctx, flags >> 8, 1); + break; + default: + return AVERROR_INVALIDDATA; + } + + memcpy(frame->data[1], gdv->pal, AVPALETTE_SIZE); + dst = frame->data[0]; + + if (!gdv->scale_v && !gdv->scale_h) { + int sidx = PREAMBLE_SIZE, didx = 0; + int y, x; + + for (y = 0; y < avctx->height; y++) { + for (x = 0; x < avctx->width; x++) { + dst[x+didx] = gdv->frame[x+sidx]; + } + sidx += avctx->width; + didx += frame->linesize[0]; + } + } else { + int sidx = PREAMBLE_SIZE, didx = 0; + int y, x; + + for (y = 0; y < avctx->height; y++) { + if (!gdv->scale_v) { + for (x = 0; x < avctx->width; x++) { + dst[didx + x] = gdv->frame[sidx + x]; + } + } else { + for (x = 0; x < avctx->width; x++) { + dst[didx + x] = gdv->frame[sidx + x/2]; + } + } + if (!gdv->scale_h || ((y & 1) == 1)) { + sidx += !gdv->scale_v ? avctx->width : avctx->width/2; + } + didx += frame->linesize[0]; + } + } + + *got_frame = 1; + + return ret < 0 ? ret : avpkt->size; +} + +static av_cold int gdv_decode_close(AVCodecContext *avctx) +{ + GDVContext *gdv = avctx->priv_data; + av_freep(&gdv->frame); + return 0; +} + +AVCodec ff_gdv_decoder = { + .name = "gdv", + .long_name = NULL_IF_CONFIG_SMALL("Gremlin Digital Video"), + .type = AVMEDIA_TYPE_VIDEO, + .id = AV_CODEC_ID_GDV, + .priv_data_size = sizeof(GDVContext), + .init = gdv_decode_init, + .close = gdv_decode_close, + .decode = gdv_decode_frame, + .capabilities = AV_CODEC_CAP_DR1, + .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, +};