From patchwork Mon Sep 16 22:18:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcus B Spencer X-Patchwork-Id: 51627 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:9108:0:b0:48e:c0f8:d0de with SMTP id r8csp24544vqg; Mon, 16 Sep 2024 15:24:04 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUloqN4t3bjqO9akfHP+D7fWScMFRT7eHkoti5H96VO2a4gVStyZs8/xCtT5FdiNxcEdNh1/tsyph4iG3pX5wyz@gmail.com X-Google-Smtp-Source: AGHT+IEySABmcS4MI7ryN88NuGdBRMgezrzpD5d06Uer2kYUr2vXvrYSrAtiTu0ouPNXXPNjxpT0 X-Received: by 2002:a05:651c:543:b0:2f7:4c9d:7a8a with SMTP id 38308e7fff4ca-2f791b4d503mr64626771fa.32.1726525444617; Mon, 16 Sep 2024 15:24:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1726525444; cv=none; d=google.com; s=arc-20240605; b=HhitZurfgHVQtXfk9J4lE6nPIO0/dQuoyKhhc7nupYRhgOl4VBuTKUt33tKd716aVl QxwEZkRi/JodHMCfSbPM/9QzmIIaXSBI4WIoyp6FPZxEn0WDzic5QWau0iYbXDYpjEEh zuMPKQaDubZXB2Kvjb6zl6dBT41x+aIX6LFkDnjJHvR6geDvMTP8sgQH4QEYNTvGLHIS nUA8YWl1hRFp/xXZrvh75URN5tSvI4YC6LCPzBWROQjkyiaUiUyojpxSbqo9LMSC01y3 9+n7yS4bo09FXrMzQ5oVUz39d0j2GpVvp50cD3yMRryhqNdsGXcABkiSJI8hdOhNonk0 Kl7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=RipTxPmVc4RwKO9fw5Ii9u0OReduPVUnnNUXPt0Z9No=; fh=JuegC/vje050XLj6U2KtH3S0d9hYf9AYxo0tX+p7f28=; b=ktqZ1akybrsKeR/RIf3J4+i7aQxNSLS7Qa1hzeiWcSOGMd+OJcoOcJp2/SlxBVxtV5 xGq1E26vcAOBm2jSvrV84Nv9Zni6tPASZO3ElEGbuMmsCUc6EcOkPyDNvU2aEva5FGMr wqQJ36Ph+V6dmU8Ncjy0zpSSdJ5zQV4ZCqixwyDrEB1JhwAdOKw6pKXTeccFZ7WxBhu3 3zqnaibMrQHF6N5pxefgS7UPyUZ2/Ph7Lows07+Wz6S03yDfMs+gTlKv5iNeObehHXiC nI+LBTVlkdeTsGTmLAerU7xwREpUpgwJsLUbSD+bpTeOpMGaPGtbXqvkAbboyi5+GllS uTeA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@marcusspencer.xyz header.s=protonmail header.b=Wgygz60L; 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=marcusspencer.xyz Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 38308e7fff4ca-2f79d488dd8si18943041fa.604.2024.09.16.15.24.04; Mon, 16 Sep 2024 15:24:04 -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=@marcusspencer.xyz header.s=protonmail header.b=Wgygz60L; 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=marcusspencer.xyz Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id EB7BA68D840; Tue, 17 Sep 2024 01:23:59 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-43171.protonmail.ch (mail-43171.protonmail.ch [185.70.43.171]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C451768D840 for ; Tue, 17 Sep 2024 01:23:52 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marcusspencer.xyz; s=protonmail; t=1726525431; x=1726784631; bh=dLvHFZZmX+dbL6wGI8BRHrekzUwwAZJBRYLzlP7iB04=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:From:To: Cc:Date:Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=Wgygz60LAVaiyFyTa1S4GfzKiDMh0u+CMxkqbPEly8Ta7yecvtpzMVzcN7Y68MTQD DQGS5/HvDSfywIpTa/MXxvxJcoOuwA3BGNb2NPGBPlwnrGEKwhufSv2ORy9brxFLq8 OS5AWBnTe5iWC3RUKJeTgi1WTB+FLHGQY0SpXxtY3cAU4PPvTfaeSPnFBmCHCU9663 NfdvmegmTm+h+j3L/gw8agxjMJfklqgGolK/EqjFT8Vg1Wc+t+BF/qJ/7oXJ6wpluo jnqo11JV87m4WUS6EfLzscK5DpZBrDozvDk+b8txS48W7h8Yeq8dhePPQjUkT3gw2E mLc8uI/JcTHzg== X-Pm-Submission-Id: 4X6zw55XVYz3N From: Marcus B Spencer To: ffmpeg-devel@ffmpeg.org Date: Mon, 16 Sep 2024 17:18:27 -0500 Message-ID: <20240916222342.673778-1-marcus@marcusspencer.xyz> X-Mailer: git-send-email 2.46.1 In-Reply-To: <20240916095333.GI4991@pb2> References: <20240916095333.GI4991@pb2> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2] avformat: add farbfeld muxer and demuxer X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 Cc: Marcus B Spencer Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: hQLS/yTdkRzk farbfeld is an uncompressed image format that is a part of suckless tools (https://tools.suckless.org). Its documentation is available at https://tools.suckless.org/farbfeld. Add support for this image format in avformat. Signed-off-by: Marcus B Spencer --- Automatically generate testing sample for the demuxer using the muxer. Still depends on https://patchwork.ffmpeg.org/project/ffmpeg/patch/20240915051656.1321991-1-marcus@marcusspencer.xyz/. Changelog | 1 + configure | 1 + doc/general_contents.texi | 4 + libavformat/Makefile | 2 + libavformat/allformats.c | 4 +- libavformat/farbfelddec.c | 136 +++++++++++++++++++++++++++++++++ libavformat/farbfeldenc.c | 143 +++++++++++++++++++++++++++++++++++ libavformat/version.h | 4 +- tests/Makefile | 1 + tests/fate/farbfeld.mak | 14 ++++ tests/ref/fate/farbfeld-lena | 6 ++ 11 files changed, 313 insertions(+), 3 deletions(-) create mode 100644 libavformat/farbfelddec.c create mode 100644 libavformat/farbfeldenc.c create mode 100644 tests/fate/farbfeld.mak create mode 100644 tests/ref/fate/farbfeld-lena diff --git a/Changelog b/Changelog index 77a286f875..74d2b95f4d 100644 --- a/Changelog +++ b/Changelog @@ -22,6 +22,7 @@ version : - YUV colorspace negotiation for codecs and filters, obsoleting the YUVJ pixel format - Vulkan H.264 encoder +- farbfeld muxer and demuxer version 7.0: diff --git a/configure b/configure index da36419f2d..79943b327d 100755 --- a/configure +++ b/configure @@ -3641,6 +3641,7 @@ iamf_demuxer_select="iamfdec" iamf_muxer_select="iamfenc" image2_alias_pix_demuxer_select="image2_demuxer" image2_brender_pix_demuxer_select="image2_demuxer" +image_farbfeld_muxer_select="image2_muxer" imf_demuxer_deps="libxml2" imf_demuxer_select="mxf_demuxer" ipod_muxer_select="mov_muxer" diff --git a/doc/general_contents.texi b/doc/general_contents.texi index e7cf4f8239..bbc49d3665 100644 --- a/doc/general_contents.texi +++ b/doc/general_contents.texi @@ -489,6 +489,8 @@ library: @item Electronic Arts Multimedia @tab @tab X @tab Used in various EA games; files have extensions like WVE and UV2. @item Ensoniq Paris Audio File @tab @tab X +@item FF @tab X @tab X + @tab farbfeld uncompressed image @item FFM (FFserver live feed) @tab X @tab X @item Flash (SWF) @tab X @tab X @item Flash 9 (AVM2) @tab X @tab X @@ -786,6 +788,8 @@ following image formats are supported: @tab Digital Picture Exchange @item EXR @tab @tab X @tab OpenEXR +@item FF @tab X @tab X + @tab farbfeld uncompressed image @item FITS @tab X @tab X @tab Flexible Image Transport System @item HDR @tab X @tab X diff --git a/libavformat/Makefile b/libavformat/Makefile index 7ca68a7036..e2bf420916 100644 --- a/libavformat/Makefile +++ b/libavformat/Makefile @@ -284,6 +284,8 @@ OBJS-$(CONFIG_IMAGE_CRI_PIPE_DEMUXER) += img2dec.o img2.o OBJS-$(CONFIG_IMAGE_DDS_PIPE_DEMUXER) += img2dec.o img2.o OBJS-$(CONFIG_IMAGE_DPX_PIPE_DEMUXER) += img2dec.o img2.o OBJS-$(CONFIG_IMAGE_EXR_PIPE_DEMUXER) += img2dec.o img2.o +OBJS-$(CONFIG_IMAGE_FARBFELD_PIPE_DEMUXER)+= farbfelddec.o +OBJS-$(CONFIG_IMAGE_FARBFELD_MUXER) += farbfeldenc.o OBJS-$(CONFIG_IMAGE_GEM_PIPE_DEMUXER) += img2dec.o img2.o OBJS-$(CONFIG_IMAGE_GIF_PIPE_DEMUXER) += img2dec.o img2.o OBJS-$(CONFIG_IMAGE_HDR_PIPE_DEMUXER) += img2dec.o img2.o diff --git a/libavformat/allformats.c b/libavformat/allformats.c index 305fa46532..01a9ef92e5 100644 --- a/libavformat/allformats.c +++ b/libavformat/allformats.c @@ -531,12 +531,14 @@ extern const FFInputFormat ff_xwma_demuxer; extern const FFInputFormat ff_yop_demuxer; extern const FFInputFormat ff_yuv4mpegpipe_demuxer; extern const FFOutputFormat ff_yuv4mpegpipe_muxer; -/* image demuxers */ +/* image (de)muxers */ extern const FFInputFormat ff_image_bmp_pipe_demuxer; extern const FFInputFormat ff_image_cri_pipe_demuxer; extern const FFInputFormat ff_image_dds_pipe_demuxer; extern const FFInputFormat ff_image_dpx_pipe_demuxer; extern const FFInputFormat ff_image_exr_pipe_demuxer; +extern const FFInputFormat ff_image_farbfeld_pipe_demuxer; +extern const FFOutputFormat ff_image_farbfeld_muxer; extern const FFInputFormat ff_image_gem_pipe_demuxer; extern const FFInputFormat ff_image_gif_pipe_demuxer; extern const FFInputFormat ff_image_hdr_pipe_demuxer; diff --git a/libavformat/farbfelddec.c b/libavformat/farbfelddec.c new file mode 100644 index 0000000000..3dfad8ad91 --- /dev/null +++ b/libavformat/farbfelddec.c @@ -0,0 +1,136 @@ +/* + * Image format + * YUV4MPEG demuxer + * + * Modified by Marcus B Spencer to suit the farbfeld_pipe demuxer on 14 September 2024 + * + * Copyright (c) 2000, 2001, 2002 Fabrice Bellard + * Copyright (c) 2001, 2002, 2003 Fabrice Bellard + * Copyright (c) 2004 Michael Niedermayer + * Copyright (c) 2024 Marcus B Spencer + * + * 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 "avformat.h" +#include "avio.h" +#include "demux.h" +#include "internal.h" +#include "libavutil/imgutils.h" +#include "libavutil/opt.h" + +#define FARBFELD_MAGIC_LEN 8 +#define FARBFELD_HEADER_LEN (FARBFELD_MAGIC_LEN + 4 + 4) + +typedef struct FarbfeldDemuxContext { + const AVClass *class; + AVRational framerate; +} FarbfeldDemuxContext; + +static int farbfeld_read_header(AVFormatContext *ctx) +{ + FarbfeldDemuxContext *priv = ctx->priv_data; + char magic[FARBFELD_MAGIC_LEN]; + int width, height; + int packet_size; + AVStream *st; + int ret; + + if ((ret = avio_read(ctx->pb, magic, FARBFELD_MAGIC_LEN)) < 0) + return ret; + + if (memcmp(magic, "farbfeld", FARBFELD_MAGIC_LEN)) + return AVERROR_INVALIDDATA; + + if (!(st = avformat_new_stream(ctx, NULL))) + return AVERROR(ENOMEM); + + st->codecpar->codec_type = AVMEDIA_TYPE_VIDEO; + st->codecpar->format = AV_PIX_FMT_RGBA64BE; + st->codecpar->codec_id = AV_CODEC_ID_RAWVIDEO; + + width = avio_rb32(ctx->pb); + height = avio_rb32(ctx->pb); + + st->codecpar->width = width; + st->codecpar->height = height; + st->codecpar->framerate = + st->avg_frame_rate = + st->r_frame_rate = priv->framerate; + + packet_size = av_image_get_buffer_size(st->codecpar->format, width, height, 1); + if (packet_size < 0) + return AVERROR_INVALIDDATA; + + ctx->packet_size = FARBFELD_HEADER_LEN + packet_size; + + // reset position for inital packet + if ((ret = avio_seek(ctx->pb, 0, SEEK_SET)) < 0) + return ret; + + return 0; +} + +static int farbfeld_read_packet(AVFormatContext *ctx, AVPacket *pkt) +{ + char magic[FARBFELD_MAGIC_LEN]; + int ret; + + if ((ret = avio_read(ctx->pb, magic, FARBFELD_MAGIC_LEN)) < 0) + return ret; + + if (memcmp(magic, "farbfeld", FARBFELD_MAGIC_LEN)) + return AVERROR_INVALIDDATA; + + // width and height are assumed to be constant + avio_skip(ctx->pb, 8); + + if ((ret = av_get_packet(ctx->pb, pkt, + ctx->packet_size - + FARBFELD_HEADER_LEN)) < 0) + return ret; + + pkt->stream_index = 0; + + return 0; +} + +#define OFFSET(x) offsetof(FarbfeldDemuxContext, x) +#define DEC AV_OPT_FLAG_DECODING_PARAM + +static const AVOption demuxoptions[] = { + { "framerate", "set the video framerate", OFFSET(framerate), AV_OPT_TYPE_VIDEO_RATE, {.str = "25"}, 0, INT_MAX, DEC }, + { NULL }, +}; + +static const AVClass farbfeld_demux_class = { + .class_name = "FarbfeldDemuxContext", + .item_name = av_default_item_name, + .option = demuxoptions, + .version = LIBAVUTIL_VERSION_INT, +}; + +const FFInputFormat ff_image_farbfeld_pipe_demuxer = { + .p.name = "farbfeld_pipe", + .p.long_name = NULL_IF_CONFIG_SMALL("piped farbfeld uncompressed image sequence"), + .p.extensions = "ff", + .p.flags = AVFMT_NOTIMESTAMPS, + .p.priv_class = &farbfeld_demux_class, + .priv_data_size = sizeof(FarbfeldDemuxContext), + .read_header = farbfeld_read_header, + .read_packet = farbfeld_read_packet, +}; diff --git a/libavformat/farbfeldenc.c b/libavformat/farbfeldenc.c new file mode 100644 index 0000000000..daa1defaf3 --- /dev/null +++ b/libavformat/farbfeldenc.c @@ -0,0 +1,143 @@ +/* + * misc image utilities + * YUV4MPEG muxer + * Image format + * + * Modified by Marcus B Spencer to suit the farbfeld muxer on 14 September 2024 + * + * Copyright (c) 2001, 2002, 2003 Fabrice Bellard + * Copyright (c) 2000, 2001, 2002 Fabrice Bellard + * Copyright (c) 2004 Michael Niedermayer + * Copyright (c) 2024 Marcus B Spencer + * + * 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 "avformat.h" +#include "img2.h" +#include "internal.h" +#include "libavutil/avstring.h" +#include "libavutil/frame.h" +#include "libavutil/opt.h" +#include "mux.h" + +typedef struct FarbfeldMuxContext { + const AVClass *class; + int start_number, img_number; + int update; +} FarbfeldMuxContext; + +static int farbfeld_init(AVFormatContext *ctx) +{ + FarbfeldMuxContext *priv = ctx->priv_data; + + if (ctx->streams[0]->codecpar->codec_id != AV_CODEC_ID_WRAPPED_AVFRAME && + ctx->streams[0]->codecpar->codec_id != AV_CODEC_ID_RAWVIDEO) { + av_log(ctx, AV_LOG_ERROR, "Codec not supported.\n"); + return AVERROR_INVALIDDATA; + } + + if (ctx->streams[0]->codecpar->format != AV_PIX_FMT_RGBA64BE) { + av_log(ctx, AV_LOG_ERROR, + "farbfeld only supports the rgba64be pixel format. " + "Add '-pix_fmt rgba64be' to your output options to resolve " + "this error.\n" + ); + return AVERROR_INVALIDDATA; + } + + priv->img_number = priv->start_number; + + return 0; +} + +static int farbfeld_write_packet(AVFormatContext *ctx, AVPacket *pkt) +{ + AVStream *st = ctx->streams[pkt->stream_index]; + int width = st->codecpar->width, height = st->codecpar->height; + FarbfeldMuxContext *priv = ctx->priv_data; + char filename[1024]; + const uint8_t *src; + const AVFrame *p; + AVIOContext *pb; + int ret; + + if (priv->update) + av_strlcpy(filename, ctx->url, sizeof filename); + else if ((ret = ff_img_get_frame_filename(ctx, filename, sizeof filename, + priv->start_number, + priv->img_number)) < 0) + return ret; + + if ((ret = ctx->io_open(ctx, &pb, filename, AVIO_FLAG_WRITE, NULL)) < 0) { + av_log(ctx, AV_LOG_ERROR, "Could not open file : %s\n", filename); + return ret; + } + + avio_write(pb, "farbfeld", 8); + + avio_wb32(pb, width); + avio_wb32(pb, height); + + if (st->codecpar->codec_id == AV_CODEC_ID_RAWVIDEO) + avio_write(pb, pkt->data, pkt->size); + else { + p = (const AVFrame *)pkt->data; + src = p->data[0]; + + for (int i = 0; i < height; i++) { + avio_write(pb, src, width * 8); // 8 bytes per pixel + src += p->linesize[0]; + } + } + + priv->img_number++; + + avio_flush(pb); + + return ff_format_io_close(ctx, &pb); +} + +#define OFFSET(x) offsetof(FarbfeldMuxContext, x) +#define ENC AV_OPT_FLAG_ENCODING_PARAM +static const AVOption muxoptions[] = { + { "update", "continuously overwrite one file", OFFSET(update), AV_OPT_TYPE_BOOL,{ .i64 = 0 }, 0, 1, ENC }, + { "start_number", "set first number in the sequence", OFFSET(start_number), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, INT_MAX, ENC }, + { NULL }, +}; + +static const AVClass farbfeld_mux_class = { + .class_name = "FarbfeldMuxContext", + .item_name = av_default_item_name, + .option = muxoptions, + .version = LIBAVUTIL_VERSION_INT, +}; + +const FFOutputFormat ff_image_farbfeld_muxer = { + .p.name = "farbfeld", + .p.long_name = NULL_IF_CONFIG_SMALL("farbfeld uncompressed image"), + .p.extensions = "ff", + .p.audio_codec = AV_CODEC_ID_NONE, + .p.video_codec = AV_CODEC_ID_WRAPPED_AVFRAME, + .p.subtitle_codec = AV_CODEC_ID_NONE, + .p.flags = AVFMT_NOTIMESTAMPS | AVFMT_NOFILE, + .p.priv_class = &farbfeld_mux_class, + .priv_data_size = sizeof(FarbfeldMuxContext), + .init = farbfeld_init, + .write_packet = farbfeld_write_packet, + .flags_internal = FF_OFMT_FLAG_MAX_ONE_OF_EACH, +}; diff --git a/libavformat/version.h b/libavformat/version.h index 384cbd49cc..4bde82abb4 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -31,8 +31,8 @@ #include "version_major.h" -#define LIBAVFORMAT_VERSION_MINOR 5 -#define LIBAVFORMAT_VERSION_MICRO 101 +#define LIBAVFORMAT_VERSION_MINOR 6 +#define LIBAVFORMAT_VERSION_MICRO 100 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ LIBAVFORMAT_VERSION_MINOR, \ diff --git a/tests/Makefile b/tests/Makefile index 9b70145015..5cfc117305 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -183,6 +183,7 @@ include $(SRC_PATH)/tests/fate/ffprobe.mak include $(SRC_PATH)/tests/fate/fifo-muxer.mak include $(SRC_PATH)/tests/fate/filter-audio.mak # Must be included after vcodec.mak +include $(SRC_PATH)/tests/fate/farbfeld.mak include $(SRC_PATH)/tests/fate/filter-video.mak include $(SRC_PATH)/tests/fate/fits.mak include $(SRC_PATH)/tests/fate/flac.mak diff --git a/tests/fate/farbfeld.mak b/tests/fate/farbfeld.mak new file mode 100644 index 0000000000..b51503b7b2 --- /dev/null +++ b/tests/fate/farbfeld.mak @@ -0,0 +1,14 @@ +tests/data/farbfeld-lena.ff: TAG = GEN +tests/data/farbfeld-lena.ff: ffmpeg$(PROGSSUF)$(EXESUF) | tests/data + $(M)$(TARGET_EXEC) $(TARGET_PATH)/$< -nostdin \ + -i $(TARGET_SAMPLES)/lena.pnm -y -bitexact -pix_fmt rgba64be \ + $(TARGET_PATH)/tests/data/farbfeld-lena.ff 2>/dev/null + +FATE_FARBFELD += fate-farbfeld-lena +fate-farbfeld-lena: tests/data/farbfeld-lena.ff +fate-farbfeld-lena: CMD = framecrc -i $(TARGET_PATH)/tests/data/farbfeld-lena.ff + +FATE_FARBFELD-$(call ALLYES, IMAGE_FARBFELD_PIPE_DEMUXER IMAGE_FARBFELD_MUXER) += $(FATE_FARBFELD) + +FATE_SAMPLES_FFMPEG += $(FATE_FARBFELD-yes) +fate-farbfeld: $(FATE_FARBFELD-yes) diff --git a/tests/ref/fate/farbfeld-lena b/tests/ref/fate/farbfeld-lena new file mode 100644 index 0000000000..75fc52284a --- /dev/null +++ b/tests/ref/fate/farbfeld-lena @@ -0,0 +1,6 @@ +#tb 0: 1/25 +#media_type 0: video +#codec_id 0: rawvideo +#dimensions 0: 256x256 +#sar 0: 0/1 +0, 0, 0, 1, 524288, 0x8c061893