diff --git a/.gitignore b/.gitignore index 381c5ba..f0c157a 100644 --- a/.gitignore +++ b/.gitignore @@ -2,5 +2,3 @@ ffmpeg-*.asc ffmpeg-*.rpm ffmpeg-*.tar.xz /ffmpeg.keyring -/results_* -/*.rpm diff --git a/0001-avfilter-vf_libplacebo-remove-deprecated-field.patch b/0001-avfilter-vf_libplacebo-remove-deprecated-field.patch new file mode 100644 index 0000000..0819af4 --- /dev/null +++ b/0001-avfilter-vf_libplacebo-remove-deprecated-field.patch @@ -0,0 +1,73 @@ +From 1231003c3c6d4839a9e838d06f8e16ee7690958f Mon Sep 17 00:00:00 2001 +From: Niklas Haas +Date: Mon, 13 Mar 2023 14:33:16 +0100 +Subject: [PATCH] avfilter/vf_libplacebo: remove deprecated field + +This has not been functional since a year ago, including in our current +minimum dependency of libplacebo (v4.192.0). It also causes build errors +against libplacebo v6, so it needs to be removed from the code. We can +keep the option around for now, but it should also be removed soon. + +Signed-off-by: Niklas Haas +Signed-off-by: James Almer +--- + doc/filters.texi | 3 --- + libavfilter/vf_libplacebo.c | 7 ++++--- + 2 files changed, 4 insertions(+), 6 deletions(-) + +diff --git a/doc/filters.texi b/doc/filters.texi +index 7a7b2ba4e79e..77b594f69cb1 100644 +--- a/doc/filters.texi ++++ b/doc/filters.texi +@@ -16242,9 +16242,6 @@ Disable linear light scaling. + @item disable_builtin + Disable built-in GPU sampling (forces LUT). + +-@item force_icc_lut +-Force the use of a full ICC 3DLUT for gamut mapping. +- + @item disable_fbos + Forcibly disable FBOs, resulting in loss of almost all functionality, but + offering the maximum possible speed. +diff --git a/libavfilter/vf_libplacebo.c b/libavfilter/vf_libplacebo.c +index d75723289069..757dc519e9ad 100644 +--- a/libavfilter/vf_libplacebo.c ++++ b/libavfilter/vf_libplacebo.c +@@ -97,7 +97,6 @@ typedef struct LibplaceboContext { + float polar_cutoff; + int disable_linear; + int disable_builtin; +- int force_icc_lut; + int force_dither; + int disable_fbos; + +@@ -139,6 +138,7 @@ typedef struct LibplaceboContext { + float desat_exp; + int gamut_warning; + int gamut_clipping; ++ int force_icc_lut; + #endif + + /* pl_dither_params */ +@@ -463,7 +463,6 @@ static int process_frames(AVFilterContext *avctx, AVFrame *out, AVFrame *in) + .polar_cutoff = s->polar_cutoff, + .disable_linear_scaling = s->disable_linear, + .disable_builtin_scalers = s->disable_builtin, +- .force_icc_lut = s->force_icc_lut, + .force_dither = s->force_dither, + .disable_fbos = s->disable_fbos, + }; +@@ -855,7 +854,9 @@ static const AVOption libplacebo_options[] = { + { "polar_cutoff", "Polar LUT cutoff", OFFSET(polar_cutoff), AV_OPT_TYPE_FLOAT, {.dbl = 0}, 0.0, 1.0, DYNAMIC }, + { "disable_linear", "Disable linear scaling", OFFSET(disable_linear), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, DYNAMIC }, + { "disable_builtin", "Disable built-in scalers", OFFSET(disable_builtin), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, DYNAMIC }, +- { "force_icc_lut", "Force the use of a full ICC 3DLUT for color mapping", OFFSET(force_icc_lut), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, DYNAMIC }, ++#if FF_API_LIBPLACEBO_OPTS ++ { "force_icc_lut", "Deprecated, does nothing", OFFSET(force_icc_lut), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, DYNAMIC | AV_OPT_FLAG_DEPRECATED }, ++#endif + { "force_dither", "Force dithering", OFFSET(force_dither), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, DYNAMIC }, + { "disable_fbos", "Force-disable FBOs", OFFSET(disable_fbos), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, DYNAMIC }, + { NULL }, +-- +2.39.2 + diff --git a/0001-avfilter-vf_libplacebo-wrap-deprecated-opts-in-FF_AP.patch b/0001-avfilter-vf_libplacebo-wrap-deprecated-opts-in-FF_AP.patch new file mode 100644 index 0000000..2d2a939 --- /dev/null +++ b/0001-avfilter-vf_libplacebo-wrap-deprecated-opts-in-FF_AP.patch @@ -0,0 +1,76 @@ +From 11eca6018c40f5ebe6af93cbc4b4dce447d8b3bc Mon Sep 17 00:00:00 2001 +From: Niklas Haas +Date: Mon, 13 Mar 2023 15:10:26 +0100 +Subject: [PATCH] avfilter/vf_libplacebo: wrap deprecated opts in FF_API define + +Signed-off-by: Niklas Haas +Signed-off-by: James Almer +--- + libavfilter/version_major.h | 2 ++ + libavfilter/vf_libplacebo.c | 8 ++++++++ + 2 files changed, 10 insertions(+) + +diff --git a/libavfilter/version_major.h b/libavfilter/version_major.h +index 899dfdb27dba..1decc4012ee0 100644 +--- a/libavfilter/version_major.h ++++ b/libavfilter/version_major.h +@@ -35,4 +35,6 @@ + * the public API and may change, break or disappear at any time. + */ + ++#define FF_API_LIBPLACEBO_OPTS (LIBAVFILTER_VERSION_MAJOR < 10) ++ + #endif /* AVFILTER_VERSION_MAJOR_H */ +diff --git a/libavfilter/vf_libplacebo.c b/libavfilter/vf_libplacebo.c +index 7cd495de2619..d75723289069 100644 +--- a/libavfilter/vf_libplacebo.c ++++ b/libavfilter/vf_libplacebo.c +@@ -132,11 +132,14 @@ typedef struct LibplaceboContext { + int inverse_tonemapping; + float crosstalk; + int tonemapping_lut_size; ++ ++#if FF_API_LIBPLACEBO_OPTS + /* for backwards compatibility */ + float desat_str; + float desat_exp; + int gamut_warning; + int gamut_clipping; ++#endif + + /* pl_dither_params */ + int dithering; +@@ -380,6 +383,7 @@ static int process_frames(AVFilterContext *avctx, AVFrame *out, AVFrame *in) + pl_rect2df_aspect_set(&target.crop, aspect, s->pad_crop_ratio); + } + ++#if FF_API_LIBPLACEBO_OPTS + /* backwards compatibility with older API */ + if (!tonemapping_mode && (s->desat_str >= 0.0f || s->desat_exp >= 0.0f)) { + float str = s->desat_str < 0.0f ? 0.9f : s->desat_str; +@@ -397,6 +401,7 @@ static int process_frames(AVFilterContext *avctx, AVFrame *out, AVFrame *in) + gamut_mode = PL_GAMUT_WARN; + if (s->gamut_clipping) + gamut_mode = PL_GAMUT_DESATURATE; ++#endif + + /* Update render params */ + params = (struct pl_render_params) { +@@ -818,11 +823,14 @@ static const AVOption libplacebo_options[] = { + { "inverse_tonemapping", "Inverse tone mapping (range expansion)", OFFSET(inverse_tonemapping), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, DYNAMIC }, + { "tonemapping_crosstalk", "Crosstalk factor for tone-mapping", OFFSET(crosstalk), AV_OPT_TYPE_FLOAT, {.dbl = 0.04}, 0.0, 0.30, DYNAMIC }, + { "tonemapping_lut_size", "Tone-mapping LUT size", OFFSET(tonemapping_lut_size), AV_OPT_TYPE_INT, {.i64 = 256}, 2, 1024, DYNAMIC }, ++ ++#if FF_API_LIBPLACEBO_OPTS + /* deprecated options for backwards compatibility, defaulting to -1 to not override the new defaults */ + { "desaturation_strength", "Desaturation strength", OFFSET(desat_str), AV_OPT_TYPE_FLOAT, {.dbl = -1.0}, -1.0, 1.0, DYNAMIC | AV_OPT_FLAG_DEPRECATED }, + { "desaturation_exponent", "Desaturation exponent", OFFSET(desat_exp), AV_OPT_TYPE_FLOAT, {.dbl = -1.0}, -1.0, 10.0, DYNAMIC | AV_OPT_FLAG_DEPRECATED }, + { "gamut_warning", "Highlight out-of-gamut colors", OFFSET(gamut_warning), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, DYNAMIC | AV_OPT_FLAG_DEPRECATED }, + { "gamut_clipping", "Enable colorimetric gamut clipping", OFFSET(gamut_clipping), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, DYNAMIC | AV_OPT_FLAG_DEPRECATED }, ++#endif + + { "dithering", "Dither method to use", OFFSET(dithering), AV_OPT_TYPE_INT, {.i64 = PL_DITHER_BLUE_NOISE}, -1, PL_DITHER_METHOD_COUNT - 1, DYNAMIC, "dither" }, + { "none", "Disable dithering", 0, AV_OPT_TYPE_CONST, {.i64 = -1}, 0, 0, STATIC, "dither" }, +-- +2.39.2 + diff --git a/0001-fftools-ffmpeg_filter-initialize-the-o-to-silence-th.patch b/0001-fftools-ffmpeg_filter-initialize-the-o-to-silence-th.patch new file mode 100644 index 0000000..85b43a4 --- /dev/null +++ b/0001-fftools-ffmpeg_filter-initialize-the-o-to-silence-th.patch @@ -0,0 +1,30 @@ +From a0a0a804998da8d1a397479c9bafeb000e6be088 Mon Sep 17 00:00:00 2001 +From: Jun Zhao +Date: Sat, 25 Feb 2023 21:54:00 +0800 +Subject: [PATCH] fftools/ffmpeg_filter: initialize the 'o' to silence the + warning + +silence the warning: variable 'o' is used uninitialized whenever +'&&' condition is false + +Signed-off-by: Jun Zhao +--- + fftools/ffmpeg_filter.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c +index 1f5bbf6c4d..3504a3cc0a 100644 +--- a/fftools/ffmpeg_filter.c ++++ b/fftools/ffmpeg_filter.c +@@ -362,7 +362,7 @@ fail: + + static int filter_opt_apply(AVFilterContext *f, const char *key, const char *val) + { +- const AVOption *o; ++ const AVOption *o = NULL; + int ret; + + ret = av_opt_set(f, key, val, AV_OPT_SEARCH_CHILDREN); +-- +2.41.0 + diff --git a/0001-lavc-libopenh264-Drop-openh264-runtime-version-check.patch b/0001-lavc-libopenh264-Drop-openh264-runtime-version-check.patch new file mode 100644 index 0000000..7066f16 --- /dev/null +++ b/0001-lavc-libopenh264-Drop-openh264-runtime-version-check.patch @@ -0,0 +1,109 @@ +From a641e629591d68bd3edd99bddec623dc31295f6b Mon Sep 17 00:00:00 2001 +From: Kalev Lember +Date: Wed, 6 Dec 2023 14:37:34 +0100 +Subject: [PATCH] lavc/libopenh264: Drop openh264 runtime version checks + +Years ago, openh264 releases often changed their ABI without changing +the library soname. To avoid running into ABI issues, a version check +was added to lavc libopenh264 code to error out at runtime in case the +build time and runtime openh264 versions don't match. + +This should no longer be an issue with newer openh264 releases and we +can drop the runtime version check and rely on upstream doing the right +thing and bump the library soname if the ABI changes, similar to how +other libraries are consumed in ffmpeg. + +Almost all major distributions now include openh264 and this means there +are more eyes on ABI changes and issues are discovered and reported +quickly. See e.g. https://github.com/cisco/openh264/issues/3564 where an +ABI issue was quickly discovered and fixed. + +Relaxing the check allows downstream distributions to build ffmpeg +against e.g. openh264 2.3.1 and ship an update to ABI-compatible +openh264 2.4.0, without needing to coordinate a lock step update between +ffmpeg and openh264 (which can be difficult if openh264 is distributed +by Cisco and ffmpeg comes from the distro, such as is the case for +Fedora). + +Signed-off-by: Kalev Lember +--- + libavcodec/libopenh264.c | 15 --------------- + libavcodec/libopenh264.h | 2 -- + libavcodec/libopenh264dec.c | 4 ---- + libavcodec/libopenh264enc.c | 4 ---- + 4 files changed, 25 deletions(-) + +diff --git a/libavcodec/libopenh264.c b/libavcodec/libopenh264.c +index 0f6d28ed88..c80c85ea8b 100644 +--- a/libavcodec/libopenh264.c ++++ b/libavcodec/libopenh264.c +@@ -46,18 +46,3 @@ void ff_libopenh264_trace_callback(void *ctx, int level, const char *msg) + int equiv_ffmpeg_log_level = libopenh264_to_ffmpeg_log_level(level); + av_log(ctx, equiv_ffmpeg_log_level, "%s\n", msg); + } +- +-int ff_libopenh264_check_version(void *logctx) +-{ +- // Mingw GCC < 4.7 on x86_32 uses an incorrect/buggy ABI for the WelsGetCodecVersion +- // function (for functions returning larger structs), thus skip the check in those +- // configurations. +-#if !defined(_WIN32) || !defined(__GNUC__) || !ARCH_X86_32 || AV_GCC_VERSION_AT_LEAST(4, 7) +- OpenH264Version libver = WelsGetCodecVersion(); +- if (memcmp(&libver, &g_stCodecVersion, sizeof(libver))) { +- av_log(logctx, AV_LOG_ERROR, "Incorrect library version loaded\n"); +- return AVERROR(EINVAL); +- } +-#endif +- return 0; +-} +diff --git a/libavcodec/libopenh264.h b/libavcodec/libopenh264.h +index dbb9c5d429..0b462d6fdc 100644 +--- a/libavcodec/libopenh264.h ++++ b/libavcodec/libopenh264.h +@@ -34,6 +34,4 @@ + + void ff_libopenh264_trace_callback(void *ctx, int level, const char *msg); + +-int ff_libopenh264_check_version(void *logctx); +- + #endif /* AVCODEC_LIBOPENH264_H */ +diff --git a/libavcodec/libopenh264dec.c b/libavcodec/libopenh264dec.c +index 7d650ae03e..b6a9bba2dc 100644 +--- a/libavcodec/libopenh264dec.c ++++ b/libavcodec/libopenh264dec.c +@@ -52,13 +52,9 @@ static av_cold int svc_decode_init(AVCodecContext *avctx) + { + SVCContext *s = avctx->priv_data; + SDecodingParam param = { 0 }; +- int err; + int log_level; + WelsTraceCallback callback_function; + +- if ((err = ff_libopenh264_check_version(avctx)) < 0) +- return AVERROR_DECODER_NOT_FOUND; +- + if (WelsCreateDecoder(&s->decoder)) { + av_log(avctx, AV_LOG_ERROR, "Unable to create decoder\n"); + return AVERROR_UNKNOWN; +diff --git a/libavcodec/libopenh264enc.c b/libavcodec/libopenh264enc.c +index f518d0894e..6f231d22b2 100644 +--- a/libavcodec/libopenh264enc.c ++++ b/libavcodec/libopenh264enc.c +@@ -110,14 +110,10 @@ static av_cold int svc_encode_init(AVCodecContext *avctx) + { + SVCContext *s = avctx->priv_data; + SEncParamExt param = { 0 }; +- int err; + int log_level; + WelsTraceCallback callback_function; + AVCPBProperties *props; + +- if ((err = ff_libopenh264_check_version(avctx)) < 0) +- return AVERROR_ENCODER_NOT_FOUND; +- + if (WelsCreateSVCEncoder(&s->encoder)) { + av_log(avctx, AV_LOG_ERROR, "Unable to create encoder\n"); + return AVERROR_UNKNOWN; +-- +2.43.0 + diff --git a/FFmpeg-devel-v10-Support-enhanced-flv-in-FFmpeg.patch b/FFmpeg-devel-v10-Support-enhanced-flv-in-FFmpeg.patch new file mode 100644 index 0000000..28ff7bb --- /dev/null +++ b/FFmpeg-devel-v10-Support-enhanced-flv-in-FFmpeg.patch @@ -0,0 +1,1230 @@ +From patchwork Mon May 15 08:31:56 2023 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Steven Liu +X-Patchwork-Id: 41615 +Delivered-To: ffmpegpatchwork2@gmail.com +Received: by 2002:a05:6a20:ba91:b0:105:feb:71f2 with SMTP id + fb17csp1443896pzb; + Mon, 15 May 2023 01:33:01 -0700 (PDT) +X-Google-Smtp-Source: + ACHHUZ69PgG6fq/KF6IIeKoVV29fkg7cAJfmPD3LnnTmI9YYVAPo/alZm7B+7f+FoOgn9rHdYUo5 +X-Received: by 2002:a17:907:97cb:b0:96a:4654:9a57 with SMTP id + js11-20020a17090797cb00b0096a46549a57mr16869758ejc.54.1684139580951; + Mon, 15 May 2023 01:33:00 -0700 (PDT) +ARC-Seal: i=1; a=rsa-sha256; t=1684139580; cv=none; + d=google.com; s=arc-20160816; + b=iOREUkvWDLqSJl40trM7wg3ufEQ23FOBLjpslXsds5HWyK48b/76lFgQwRfHJbHqbh + vc4N6DopB5msRi0VK/pJnDAdtuyQR2tqEgLvbZpHJzjK1zHUKRV5JHlmVhNvQOfYWpMR + VL/1OMmbTctEza2Z7/VYsrVLHLy4QOlLh4w/JdRcx/7rhiOA1ixpMxC4qUb5IGMhnqen + P2dDbAoqdmGUZtmA4VOfxkgkHnIaeFv+UffJGIZs1Lyb7c3zytwdpLLiezRzVLWQaStW + TVdcDk45pOrA29lZ46Tq8YNJP7O5zfSevFIqrB85mUjSNoyZi24gz19yxJa/09O1qb+o + thzw== +ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; + s=arc-20160816; + h=sender:errors-to:content-transfer-encoding:cc:reply-to + :list-subscribe:list-help:list-post:list-archive:list-unsubscribe + :list-id:precedence:subject:feedback-id:mime-version:references + :in-reply-to:message-id:date:to:from:delivered-to; + bh=Qg7uugO6uqQCX67+SdNELVYF39/WDPRDFt1+H7toQ+s=; + b=b1cxdqSVG1Oc157HlNUA+LfJhknU/nr3g5wnSLXmP7DrR+RQp2CFwGfjV+wTkfWLok + WydumkYG2biOpmhMi+mG4ci5WvU2R9bv1qpKGreRpsImGmjubQxu5CC9gwmenz3c+1v8 + pu+qkw142w9uMerjOpaw6oWvaHq9hWGVy6Uni33AqMJhfj9WqSwBCezk62krxzBar/VN + XNbzzpAMIuXcj0DcHS70oDHOTbtLq4uDLGpkQwnBpYbswfGD0h8N+B+BSCs3ZqN/l5Jc + juIQY4i3ja2W1yHm6Zlze2qU8lFRPzRwVBZBv9vro88VyFic0UZx9wRuIqJB9BZIb0h/ + vkiA== +ARC-Authentication-Results: i=1; mx.google.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 +Return-Path: +Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) + by mx.google.com with ESMTP id + gt37-20020a1709072da500b0096b1c38458dsi2828116ejc.409.2023.05.15.01.33.00; + Mon, 15 May 2023 01:33:00 -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; + 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 +Received: from [127.0.1.1] (localhost [127.0.0.1]) + by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D930568BE0C; + Mon, 15 May 2023 11:32:57 +0300 (EEST) +X-Original-To: ffmpeg-devel@ffmpeg.org +Delivered-To: ffmpeg-devel@ffmpeg.org +Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.155.67.158]) + by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 522F7680274 + for ; Mon, 15 May 2023 11:32:49 +0300 (EEST) +X-QQ-mid: bizesmtp68t1684139564tg642pbl +Received: from localhost ( [103.102.203.204]) by bizesmtp.qq.com (ESMTP) with + id ; Mon, 15 May 2023 16:32:42 +0800 (CST) +X-QQ-SSF: 01100000000000Z0Z000000A0000000 +X-QQ-FEAT: nCMT0YKS3i1MU7IXSsiS1Rwde6i/4Rq2kuPO2PoXw3OvtJB24MU+Y2GwdEg4Y + pg0ZfSggM3VBmRCkHI3ioSOH2mvVyYG9LgwhhyfixPaFItcpF4EF6xoZepQpa1H5v1BDi7s + iwCwF3shgH8dl96iJKKryT4TtjUTnYRoRhCPtLCGfUthaM/R44xdqxRvjDqIVn1BUMb5GPu + DMuaskzO8QQCFxvduUvovkXjJc5v17Krm2lf945Tmm/pIpV/qLjAgAhYHqOoxrgBGHZDYWY + 0XeS7RvYkKTR24z9m9Sk75veOTKtFzksnbLJYkIDYj+voAd1djXPJWtuB2elhm/DIa9+5lW + 2DnKrJ/Bb2Ok13ggXoC600jHcxkLbuOqDuK5k5Dhub7ECOTPJythkMV+FYQCw== +X-QQ-GoodBg: 0 +X-BIZMAIL-ID: 14547348156280638791 +From: Steven Liu +To: ffmpeg-devel@ffmpeg.org +Date: Mon, 15 May 2023 16:31:56 +0800 +Message-Id: <20230515083201.48201-2-lq@chinaffmpeg.org> +X-Mailer: git-send-email 2.40.0 +In-Reply-To: <20230515083201.48201-1-lq@chinaffmpeg.org> +References: + + <20230515083201.48201-1-lq@chinaffmpeg.org> +MIME-Version: 1.0 +X-QQ-SENDSIZE: 520 +Feedback-ID: bizesmtp:chinaffmpeg.org:qybglogicsvrsz:qybglogicsvrsz3a-3 +Subject: [FFmpeg-devel] [PATCH v10 1/6] avformat/flvenc: support mux hevc in + enhanced flv +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: Steven Liu +Errors-To: ffmpeg-devel-bounces@ffmpeg.org +Sender: "ffmpeg-devel" +X-TUID: WUhHC4/dXuk+ + +Signed-off-by: Steven Liu +--- + libavformat/Makefile | 2 +- + libavformat/flv.h | 15 +++++++++++++++ + libavformat/flvenc.c | 38 +++++++++++++++++++++++++++++--------- + 3 files changed, 45 insertions(+), 10 deletions(-) + +diff --git a/libavformat/Makefile b/libavformat/Makefile +index f8ad7c6a11..1ef3d15467 100644 +--- a/libavformat/Makefile ++++ b/libavformat/Makefile +@@ -214,7 +214,7 @@ OBJS-$(CONFIG_FLAC_MUXER) += flacenc.o flacenc_header.o \ + OBJS-$(CONFIG_FLIC_DEMUXER) += flic.o + OBJS-$(CONFIG_FLV_DEMUXER) += flvdec.o + OBJS-$(CONFIG_LIVE_FLV_DEMUXER) += flvdec.o +-OBJS-$(CONFIG_FLV_MUXER) += flvenc.o avc.o ++OBJS-$(CONFIG_FLV_MUXER) += flvenc.o avc.o hevc.o + OBJS-$(CONFIG_FOURXM_DEMUXER) += 4xm.o + OBJS-$(CONFIG_FRAMECRC_MUXER) += framecrcenc.o framehash.o + OBJS-$(CONFIG_FRAMEHASH_MUXER) += hashenc.o framehash.o +diff --git a/libavformat/flv.h b/libavformat/flv.h +index 3571b90279..91e0a4140c 100644 +--- a/libavformat/flv.h ++++ b/libavformat/flv.h +@@ -35,6 +35,12 @@ + + #define FLV_VIDEO_FRAMETYPE_OFFSET 4 + ++/* Extended VideoTagHeader ++ * defined in reference link: ++ * https://github.com/veovera/enhanced-rtmp/blob/main/enhanced-rtmp-v1.pdf ++ * */ ++#define FLV_IS_EX_HEADER 0x80 ++ + /* bitmasks to isolate specific values */ + #define FLV_AUDIO_CHANNEL_MASK 0x01 + #define FLV_AUDIO_SAMPLESIZE_MASK 0x02 +@@ -112,6 +118,15 @@ enum { + FLV_CODECID_MPEG4 = 9, + }; + ++enum { ++ PacketTypeSequenceStart = 0, ++ PacketTypeCodedFrames = 1, ++ PacketTypeSequenceEnd = 2, ++ PacketTypeCodedFramesX = 3, ++ PacketTypeMetadata = 4, ++ PacketTypeMPEG2TSSequenceStart = 5, ++}; ++ + enum { + FLV_FRAME_KEY = 1 << FLV_VIDEO_FRAMETYPE_OFFSET, ///< key frame (for AVC, a seekable frame) + FLV_FRAME_INTER = 2 << FLV_VIDEO_FRAMETYPE_OFFSET, ///< inter frame (for AVC, a non-seekable frame) +diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c +index 721f062811..35e198fa15 100644 +--- a/libavformat/flvenc.c ++++ b/libavformat/flvenc.c +@@ -28,6 +28,7 @@ + #include "libavcodec/mpeg4audio.h" + #include "avio.h" + #include "avc.h" ++#include "hevc.h" + #include "avformat.h" + #include "flv.h" + #include "internal.h" +@@ -46,6 +47,7 @@ static const AVCodecTag flv_video_codec_ids[] = { + { AV_CODEC_ID_VP6, FLV_CODECID_VP6 }, + { AV_CODEC_ID_VP6A, FLV_CODECID_VP6A }, + { AV_CODEC_ID_H264, FLV_CODECID_H264 }, ++ { AV_CODEC_ID_HEVC, MKBETAG('h', 'v', 'c', '1') }, + { AV_CODEC_ID_NONE, 0 } + }; + +@@ -489,7 +491,7 @@ static void flv_write_codec_header(AVFormatContext* s, AVCodecParameters* par, i + FLVContext *flv = s->priv_data; + + if (par->codec_id == AV_CODEC_ID_AAC || par->codec_id == AV_CODEC_ID_H264 +- || par->codec_id == AV_CODEC_ID_MPEG4) { ++ || par->codec_id == AV_CODEC_ID_MPEG4 || par->codec_id == AV_CODEC_ID_HEVC) { + int64_t pos; + avio_w8(pb, + par->codec_type == AVMEDIA_TYPE_VIDEO ? +@@ -532,10 +534,19 @@ static void flv_write_codec_header(AVFormatContext* s, AVCodecParameters* par, i + } + avio_write(pb, par->extradata, par->extradata_size); + } else { +- avio_w8(pb, par->codec_tag | FLV_FRAME_KEY); // flags +- avio_w8(pb, 0); // AVC sequence header +- avio_wb24(pb, 0); // composition time +- ff_isom_write_avcc(pb, par->extradata, par->extradata_size); ++ if (par->codec_id == AV_CODEC_ID_HEVC) { ++ avio_w8(pb, FLV_IS_EX_HEADER | PacketTypeSequenceStart); // ExVideoTagHeader mode with PacketTypeSequenceStart ++ avio_write(pb, "hvc1", 4); ++ } else { ++ avio_w8(pb, par->codec_tag | FLV_FRAME_KEY); // flags ++ avio_w8(pb, 0); // AVC sequence header ++ avio_wb24(pb, 0); // composition time ++ } ++ ++ if (par->codec_id == AV_CODEC_ID_HEVC) ++ ff_isom_write_hvcc(pb, par->extradata, par->extradata_size, 0); ++ else ++ ff_isom_write_avcc(pb, par->extradata, par->extradata_size); + } + data_size = avio_tell(pb) - pos; + avio_seek(pb, -data_size - 10, SEEK_CUR); +@@ -832,13 +843,13 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt) + if (par->codec_id == AV_CODEC_ID_VP6F || par->codec_id == AV_CODEC_ID_VP6A || + par->codec_id == AV_CODEC_ID_VP6 || par->codec_id == AV_CODEC_ID_AAC) + flags_size = 2; +- else if (par->codec_id == AV_CODEC_ID_H264 || par->codec_id == AV_CODEC_ID_MPEG4) ++ else if (par->codec_id == AV_CODEC_ID_H264 || par->codec_id == AV_CODEC_ID_MPEG4 || par->codec_id == AV_CODEC_ID_HEVC) + flags_size = 5; + else + flags_size = 1; + + if (par->codec_id == AV_CODEC_ID_AAC || par->codec_id == AV_CODEC_ID_H264 +- || par->codec_id == AV_CODEC_ID_MPEG4) { ++ || par->codec_id == AV_CODEC_ID_MPEG4 || par->codec_id == AV_CODEC_ID_HEVC) { + size_t side_size; + uint8_t *side = av_packet_get_side_data(pkt, AV_PKT_DATA_NEW_EXTRADATA, &side_size); + if (side && side_size > 0 && (side_size != par->extradata_size || memcmp(side, par->extradata, side_size))) { +@@ -858,7 +869,7 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt) + "Packets are not in the proper order with respect to DTS\n"); + return AVERROR(EINVAL); + } +- if (par->codec_id == AV_CODEC_ID_H264 || par->codec_id == AV_CODEC_ID_MPEG4) { ++ if (par->codec_id == AV_CODEC_ID_H264 || par->codec_id == AV_CODEC_ID_MPEG4 || par->codec_id == AV_CODEC_ID_HEVC) { + if (pkt->pts == AV_NOPTS_VALUE) { + av_log(s, AV_LOG_ERROR, "Packet is missing PTS\n"); + return AVERROR(EINVAL); +@@ -903,6 +914,10 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt) + if (par->extradata_size > 0 && *(uint8_t*)par->extradata != 1) + if ((ret = ff_avc_parse_nal_units_buf(pkt->data, &data, &size)) < 0) + return ret; ++ } else if (par->codec_id == AV_CODEC_ID_HEVC) { ++ if (par->extradata_size > 0 && *(uint8_t*)par->extradata != 1) ++ if ((ret = ff_hevc_annexb2mp4_buf(pkt->data, &data, &size, 0, NULL)) < 0) ++ return ret; + } else if (par->codec_id == AV_CODEC_ID_AAC && pkt->size > 2 && + (AV_RB16(pkt->data) & 0xfff0) == 0xfff0) { + if (!s->streams[pkt->stream_index]->nb_frames) { +@@ -964,7 +979,12 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt) + avio_wb32(pb, data_size + 11); + } else { + av_assert1(flags>=0); +- avio_w8(pb,flags); ++ if (par->codec_id == AV_CODEC_ID_HEVC) { ++ avio_w8(pb, FLV_IS_EX_HEADER | PacketTypeCodedFramesX); // ExVideoTagHeader mode with PacketTypeCodedFramesX ++ avio_write(pb, "hvc1", 4); ++ } else { ++ avio_w8(pb, flags); ++ } + if (par->codec_id == AV_CODEC_ID_VP6) + avio_w8(pb,0); + if (par->codec_id == AV_CODEC_ID_VP6F || par->codec_id == AV_CODEC_ID_VP6A) { + +From patchwork Mon May 15 08:31:57 2023 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Steven Liu +X-Patchwork-Id: 41616 +Delivered-To: ffmpegpatchwork2@gmail.com +Received: by 2002:a05:6a20:ba91:b0:105:feb:71f2 with SMTP id + fb17csp1444123pzb; + Mon, 15 May 2023 01:33:22 -0700 (PDT) +X-Google-Smtp-Source: + ACHHUZ4qSqnHARATYvNTOiXhMIIgGWUHo612wN3Ui1r3cYPQd57E+B9kiCRYijDhzgObKMKkDm54 +X-Received: by 2002:a17:907:6e8e:b0:94f:3521:396 with SMTP id + sh14-20020a1709076e8e00b0094f35210396mr35740883ejc.23.1684139602011; + Mon, 15 May 2023 01:33:22 -0700 (PDT) +ARC-Seal: i=1; a=rsa-sha256; t=1684139601; cv=none; + d=google.com; s=arc-20160816; + b=EFJgx9cm5ew2+PIpTeHi7QCzos//oOs5q/HndQxc0+dHYlju5X4rVSACmfk9L0DH3j + +cG0n2/3wAsguA1rC3B8a+qXkRfAXC1ropuhDwKCZCdw0Iv40Vm4JeHolEQWRni8Ko+F + MhWY7AvxrX4GsO0pp4SfKsVFaJdo18dlpn+BUd9FX5N7V6lUTadQsVcJYJBd2B2MIRUi + mJaEPp8WpRkiS92DgWhPzUC9ELnwrySnNL0mOo9DCd9cjFXQ9KXW6qjRoP0blbL8N2ws + BlY2dJVmSM36n/GK9gZb+6fUg3xVufDUfdRr0m4jpa/ILD93/nwAZsqhk3k4j00se+CO + 7Vrw== +ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; + s=arc-20160816; + h=sender:errors-to:content-transfer-encoding:cc:reply-to + :list-subscribe:list-help:list-post:list-archive:list-unsubscribe + :list-id:precedence:subject:feedback-id:mime-version:references + :in-reply-to:message-id:date:to:from:delivered-to; + bh=ygUb60Tr5LbPnhiS1As+hL+qX45KII+ocpY9X3Jq4TI=; + b=UpGhqbfo/+m9WW5qE92LKOdOlxkCWyy2QVqiXCjXpxepdDd0IKkhGqSspte9zJrUT8 + QWg8IiDK6JTnGnvp+hO6doZjhXc1GyyTx6cMQQX+2JzqTtbWF03S94GwBgmN/U2RIK9M + f980SSgfNZRSJF5kJ+dO2ix4M5WIWhxEYB/MRzn/RbxAvYkwLNG1gMMBTNimogbFsXRo + h5WgGxO4k8mx/x8PBrtNv1aPZ86FAcXC3Aieao7aVnRDvWjepEus5jEfGu2QuqnvM2qK + WIjUyFrppJL/crANtgR+tFcL8395bRGYObYtIBblUQ/g5ddHzjsaClJ/42r3h1vez39q + nPjQ== +ARC-Authentication-Results: i=1; mx.google.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 +Return-Path: +Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) + by mx.google.com with ESMTP id + v21-20020a1709060b5500b0095ec54a22bcsi10907595ejg.106.2023.05.15.01.33.21; + Mon, 15 May 2023 01:33:21 -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; + 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 +Received: from [127.0.1.1] (localhost [127.0.0.1]) + by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D3F7668C092; + Mon, 15 May 2023 11:33:18 +0300 (EEST) +X-Original-To: ffmpeg-devel@ffmpeg.org +Delivered-To: ffmpeg-devel@ffmpeg.org +Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.155.67.158]) + by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8180368C004 + for ; Mon, 15 May 2023 11:33:11 +0300 (EEST) +X-QQ-mid: bizesmtp62t1684139585txhp32ou +Received: from localhost ( [103.102.203.204]) by bizesmtp.qq.com (ESMTP) with + id ; Mon, 15 May 2023 16:33:04 +0800 (CST) +X-QQ-SSF: 01100000000000Z0Z000000A0000000 +X-QQ-FEAT: 6ArnuSDJ+inVC06MH1nrJeu56+35diptW3dCdHt3bMayFZoCyE8QyUO0QY9zm + iY62JCSpSKYEK4ca2kpxkB99PI50FiWfNtzLDZ+VzUTy013GMpLwh1CWeVX5cF15RyEAIC9 + u3Ozg7IY8mv+GiDtf6FDgSyumE1D93qxV1R2sJ5v38V3NbNPcikg0aDxZXOlC+Hr+LdhsZi + 4X5tDi3NovhpCf+8Wo+ZaejHOrE8MUcUGpbh8dHRew6dnmkdkK5ytSHSZEye8RsXZnMdp4A + mqBZqIDGw1a4e04JAc/NDCs7qq4qthxMFB1skhaOv6DLcL+EqV2QFwnJn7V5Oof7BwfjaTG + mEAVpiZDnQhFvOgHemH1v61Blub2nCnAurrGhGMaywIzFXT87aOSLCDlFprSg== +X-QQ-GoodBg: 0 +X-BIZMAIL-ID: 11210839191292587357 +From: Steven Liu +To: ffmpeg-devel@ffmpeg.org +Date: Mon, 15 May 2023 16:31:57 +0800 +Message-Id: <20230515083201.48201-3-lq@chinaffmpeg.org> +X-Mailer: git-send-email 2.40.0 +In-Reply-To: <20230515083201.48201-1-lq@chinaffmpeg.org> +References: + + <20230515083201.48201-1-lq@chinaffmpeg.org> +MIME-Version: 1.0 +X-QQ-SENDSIZE: 520 +Feedback-ID: bizesmtp:chinaffmpeg.org:qybglogicsvrsz:qybglogicsvrsz3a-3 +Subject: [FFmpeg-devel] [PATCH v10 2/6] avformat/flvdec: support demux hevc + in enhanced flv +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: Steven Liu +Errors-To: ffmpeg-devel-bounces@ffmpeg.org +Sender: "ffmpeg-devel" +X-TUID: SFsjHMHu2ISl + +Signed-off-by: Steven Liu +--- + libavformat/flvdec.c | 58 ++++++++++++++++++++++++++++++++++++++------ + 1 file changed, 50 insertions(+), 8 deletions(-) + +diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c +index d83edff727..c8e6cadf1c 100644 +--- a/libavformat/flvdec.c ++++ b/libavformat/flvdec.c +@@ -79,6 +79,8 @@ typedef struct FLVContext { + int64_t last_ts; + int64_t time_offset; + int64_t time_pos; ++ ++ uint8_t exheader; + } FLVContext; + + /* AMF date type */ +@@ -302,13 +304,25 @@ static void flv_set_audio_codec(AVFormatContext *s, AVStream *astream, + } + } + +-static int flv_same_video_codec(AVCodecParameters *vpar, int flags) ++static int flv_same_video_codec(AVFormatContext *s, AVCodecParameters *vpar, int flags) + { + int flv_codecid = flags & FLV_VIDEO_CODECID_MASK; ++ FLVContext *flv = s->priv_data; + + if (!vpar->codec_id && !vpar->codec_tag) + return 1; + ++ if (flv->exheader) { ++ uint8_t *codec_id_str = (uint8_t *)s->pb->buf_ptr; ++ uint32_t codec_id = codec_id_str[3] | codec_id_str[2] << 8 | codec_id_str[1] << 16 | codec_id_str[0] << 24; ++ switch(codec_id) { ++ case MKBETAG('h', 'v', 'c', '1'): ++ return vpar->codec_id == AV_CODEC_ID_HEVC; ++ default: ++ break; ++ } ++ } ++ + switch (flv_codecid) { + case FLV_CODECID_H263: + return vpar->codec_id == AV_CODEC_ID_FLV1; +@@ -331,9 +345,24 @@ static int flv_set_video_codec(AVFormatContext *s, AVStream *vstream, + int flv_codecid, int read) + { + FFStream *const vstreami = ffstream(vstream); ++ FLVContext *flv = s->priv_data; + int ret = 0; + AVCodecParameters *par = vstream->codecpar; + enum AVCodecID old_codec_id = vstream->codecpar->codec_id; ++ flv_codecid &= FLV_VIDEO_CODECID_MASK; ++ ++ if (flv->exheader) { ++ uint32_t codec_id = avio_rb32(s->pb); ++ ++ switch(codec_id) { ++ case MKBETAG('h', 'v', 'c', '1'): ++ par->codec_id = AV_CODEC_ID_HEVC; ++ vstreami->need_parsing = AVSTREAM_PARSE_HEADERS; ++ return 4; ++ default: ++ break; ++ } ++ } + switch (flv_codecid) { + case FLV_CODECID_H263: + par->codec_id = AV_CODEC_ID_FLV1; +@@ -796,6 +825,7 @@ static int flv_read_header(AVFormatContext *s) + s->start_time = 0; + flv->sum_flv_tag_size = 0; + flv->last_keyframe_stream_index = -1; ++ flv->exheader = 0; + + return 0; + } +@@ -1071,6 +1101,11 @@ retry: + } else if (type == FLV_TAG_TYPE_VIDEO) { + stream_type = FLV_STREAM_TYPE_VIDEO; + flags = avio_r8(s->pb); ++ /* ++ * Reference Enhancing FLV 2023-03-v1.0.0-B.8 ++ * https://github.com/veovera/enhanced-rtmp/blob/main/enhanced-rtmp-v1.pdf ++ * */ ++ flv->exheader = (flags >> 7) & 1; + size--; + if ((flags & FLV_VIDEO_FRAMETYPE_MASK) == FLV_FRAME_VIDEO_INFO_CMD) + goto skip; +@@ -1129,7 +1164,7 @@ skip: + break; + } else if (stream_type == FLV_STREAM_TYPE_VIDEO) { + if (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO && +- (s->video_codec_id || flv_same_video_codec(st->codecpar, flags))) ++ (s->video_codec_id || flv_same_video_codec(s, st->codecpar, flags))) + break; + } else if (stream_type == FLV_STREAM_TYPE_SUBTITLE) { + if (st->codecpar->codec_type == AVMEDIA_TYPE_SUBTITLE) +@@ -1230,7 +1265,7 @@ retry_duration: + avcodec_parameters_free(&par); + } + } else if (stream_type == FLV_STREAM_TYPE_VIDEO) { +- int ret = flv_set_video_codec(s, st, flags & FLV_VIDEO_CODECID_MASK, 1); ++ int ret = flv_set_video_codec(s, st, flags, 1); + if (ret < 0) + return ret; + size -= ret; +@@ -1242,16 +1277,23 @@ retry_duration: + + if (st->codecpar->codec_id == AV_CODEC_ID_AAC || + st->codecpar->codec_id == AV_CODEC_ID_H264 || +- st->codecpar->codec_id == AV_CODEC_ID_MPEG4) { +- int type = avio_r8(s->pb); +- size--; ++ st->codecpar->codec_id == AV_CODEC_ID_MPEG4 || ++ st->codecpar->codec_id == AV_CODEC_ID_HEVC) { ++ int type = 0; ++ if (flv->exheader && stream_type == FLV_STREAM_TYPE_VIDEO) { ++ type = flags & 0x0F; ++ } else { ++ type = avio_r8(s->pb); ++ size--; ++ } + + if (size < 0) { + ret = AVERROR_INVALIDDATA; + goto leave; + } + +- if (st->codecpar->codec_id == AV_CODEC_ID_H264 || st->codecpar->codec_id == AV_CODEC_ID_MPEG4) { ++ if (st->codecpar->codec_id == AV_CODEC_ID_H264 || st->codecpar->codec_id == AV_CODEC_ID_MPEG4 || ++ (st->codecpar->codec_id == AV_CODEC_ID_HEVC && type == PacketTypeCodedFrames)) { + // sign extension + int32_t cts = (avio_rb24(s->pb) + 0xff800000) ^ 0xff800000; + pts = av_sat_add64(dts, cts); +@@ -1267,7 +1309,7 @@ retry_duration: + } + } + if (type == 0 && (!st->codecpar->extradata || st->codecpar->codec_id == AV_CODEC_ID_AAC || +- st->codecpar->codec_id == AV_CODEC_ID_H264)) { ++ st->codecpar->codec_id == AV_CODEC_ID_H264 || st->codecpar->codec_id == AV_CODEC_ID_HEVC)) { + AVDictionaryEntry *t; + + if (st->codecpar->extradata) { + +From patchwork Mon May 15 08:31:58 2023 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Steven Liu +X-Patchwork-Id: 41617 +Delivered-To: ffmpegpatchwork2@gmail.com +Received: by 2002:a05:6a20:ba91:b0:105:feb:71f2 with SMTP id + fb17csp1444209pzb; + Mon, 15 May 2023 01:33:31 -0700 (PDT) +X-Google-Smtp-Source: + ACHHUZ5N/MWld9fXzokkRVS1e13AYakkRyH/RvyBiJ7xA512EWdWgrGE4ferugcTRoHNahvjayC9 +X-Received: by 2002:a17:907:9724:b0:96a:1260:dbf5 with SMTP id + jg36-20020a170907972400b0096a1260dbf5mr18082554ejc.45.1684139611447; + Mon, 15 May 2023 01:33:31 -0700 (PDT) +ARC-Seal: i=1; a=rsa-sha256; t=1684139611; cv=none; + d=google.com; s=arc-20160816; + b=op6Xl3YinOSd8d/Ya4YpQjHSbJx0t7fHaCHvvqvkJgTbKfjmTJjDFsMWkeT/ceA1lA + xV9Y1JGrAlZmudpgaJtXHukLJessnBrqaBy5gm0lX6bJ0X4AKJt/F7GB3FR3OPISq79w + 7djeHUx2VAxfWn1awCcFrcyyMPrGB2GPMdoXxcUVmySNNK0ohuroQ2JhVRajwj0sIBFg + f0pu7vXX9ct499tFl5rHEd//2Xl3rY6kNHfPlMOcJEclT+35TUaTWE88+rJODaiMArcZ + RaFK8xqfAOJjw0X9t6YiwBk1Kl/sFKEj71Fxu5khg7IvhF7kzRDSZXLCkKW9UvPYhGOl + 25Bw== +ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; + s=arc-20160816; + h=sender:errors-to:content-transfer-encoding:cc:reply-to + :list-subscribe:list-help:list-post:list-archive:list-unsubscribe + :list-id:precedence:subject:feedback-id:mime-version:references + :in-reply-to:message-id:date:to:from:delivered-to; + bh=0O0kUGD5r8lgXEiC2RUfiZ1ccVRPd03lWds0dqdVEq0=; + b=OAvZATeoNq/BI3pJd21Xz2nKh+ZI8Zkofe4Ob6USu1ZEOyZzK2xxgtxL6SjJAxecG6 + NfECg8e13DLbnVAB5OnMK8TY/HV/4N/iqPksn6PbJSkCyafRqg477+SRs7tOl89c3isr + Cp8o+j7t+gW2fkV9Y6L8MZa9etJpusa0LYXVBLPDs+tHNgXNec9UTA1YnoSyMqErrh58 + chMh6B6P+5aRcKrBfKZY1F8WAzMjphdQ78c3YZ+ikgGfkoPgRKTEUq+xQAMm7UXirMcn + qtndeDiQypN1eg7LiEbAsLhj7K2jibIlDmwUk+6JDE1ASz05FViAbk3nFfWydNP8iUlh + z+CQ== +ARC-Authentication-Results: i=1; mx.google.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 +Return-Path: +Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) + by mx.google.com with ESMTP id + rv22-20020a17090710d600b00965e8c67d7dsi11399192ejb.285.2023.05.15.01.33.31; + Mon, 15 May 2023 01:33:31 -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; + 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 +Received: from [127.0.1.1] (localhost [127.0.0.1]) + by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CAF3668C08B; + Mon, 15 May 2023 11:33:22 +0300 (EEST) +X-Original-To: ffmpeg-devel@ffmpeg.org +Delivered-To: ffmpeg-devel@ffmpeg.org +Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.155.67.158]) + by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5613068C08B + for ; Mon, 15 May 2023 11:33:16 +0300 (EEST) +X-QQ-mid: bizesmtp62t1684139591t5vf5iss +Received: from localhost ( [103.102.203.204]) by bizesmtp.qq.com (ESMTP) with + id ; Mon, 15 May 2023 16:33:09 +0800 (CST) +X-QQ-SSF: 01100000000000Z0Z000000A0000000 +X-QQ-FEAT: 0VYWLLCf4rd8sf4B0xdI45yO9pa7cA5LkUN5r8jryl/9HUTcEOcDnq6sEFLpU + pZ/JnwSIqfqFtRB8Bq8+032WcwZIBdGWmOUpIZLcDlBPHVtS9YwSO56p7te0932mhQHQVWr + 2MJ60EhPcxfhXG3M89QSysYDgLjUIRbb/cP/Br05mCJ05c+Q4NzWwlRwweOG0lUJ4aMNli9 + i3Qf8lSAK8hK3JWYZP0Fg66JaFkZvw6Yz6N4ESVf4Vp85rwWKPfpBz538IiCze/ePbVgZWB + zvbU1mVAkapT05cTLyqAlv7tefflgoYcrW79Z+Opy2wSYDZLpCkRIe+w4yWG7eCg71dUgnc + 79D+MVyHSJjuXS/sQLaeFanS1V55WK4izy9J/bFHdSprmySwmpk8hf5zhIZOQ== +X-QQ-GoodBg: 0 +X-BIZMAIL-ID: 5377996165340525619 +From: Steven Liu +To: ffmpeg-devel@ffmpeg.org +Date: Mon, 15 May 2023 16:31:58 +0800 +Message-Id: <20230515083201.48201-4-lq@chinaffmpeg.org> +X-Mailer: git-send-email 2.40.0 +In-Reply-To: <20230515083201.48201-1-lq@chinaffmpeg.org> +References: + + <20230515083201.48201-1-lq@chinaffmpeg.org> +MIME-Version: 1.0 +X-QQ-SENDSIZE: 520 +Feedback-ID: bizesmtp:chinaffmpeg.org:qybglogicsvrsz:qybglogicsvrsz3a-3 +Subject: [FFmpeg-devel] [PATCH v10 3/6] avformat/flvenc: support mux av1 in + enhanced flv +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: Steven Liu +Errors-To: ffmpeg-devel-bounces@ffmpeg.org +Sender: "ffmpeg-devel" +X-TUID: dRfPdsIvexzh + +Signed-off-by: Steven Liu +--- + libavformat/Makefile | 2 +- + libavformat/flvenc.c | 22 ++++++++++++++++++---- + 2 files changed, 19 insertions(+), 5 deletions(-) + +diff --git a/libavformat/Makefile b/libavformat/Makefile +index 1ef3d15467..c868e1626c 100644 +--- a/libavformat/Makefile ++++ b/libavformat/Makefile +@@ -214,7 +214,7 @@ OBJS-$(CONFIG_FLAC_MUXER) += flacenc.o flacenc_header.o \ + OBJS-$(CONFIG_FLIC_DEMUXER) += flic.o + OBJS-$(CONFIG_FLV_DEMUXER) += flvdec.o + OBJS-$(CONFIG_LIVE_FLV_DEMUXER) += flvdec.o +-OBJS-$(CONFIG_FLV_MUXER) += flvenc.o avc.o hevc.o ++OBJS-$(CONFIG_FLV_MUXER) += flvenc.o avc.o hevc.o av1.o + OBJS-$(CONFIG_FOURXM_DEMUXER) += 4xm.o + OBJS-$(CONFIG_FRAMECRC_MUXER) += framecrcenc.o framehash.o + OBJS-$(CONFIG_FRAMEHASH_MUXER) += hashenc.o framehash.o +diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c +index 35e198fa15..c1784b332d 100644 +--- a/libavformat/flvenc.c ++++ b/libavformat/flvenc.c +@@ -28,6 +28,7 @@ + #include "libavcodec/mpeg4audio.h" + #include "avio.h" + #include "avc.h" ++#include "av1.h" + #include "hevc.h" + #include "avformat.h" + #include "flv.h" +@@ -48,6 +49,7 @@ static const AVCodecTag flv_video_codec_ids[] = { + { AV_CODEC_ID_VP6A, FLV_CODECID_VP6A }, + { AV_CODEC_ID_H264, FLV_CODECID_H264 }, + { AV_CODEC_ID_HEVC, MKBETAG('h', 'v', 'c', '1') }, ++ { AV_CODEC_ID_AV1, MKBETAG('a', 'v', '0', '1') }, + { AV_CODEC_ID_NONE, 0 } + }; + +@@ -491,7 +493,8 @@ static void flv_write_codec_header(AVFormatContext* s, AVCodecParameters* par, i + FLVContext *flv = s->priv_data; + + if (par->codec_id == AV_CODEC_ID_AAC || par->codec_id == AV_CODEC_ID_H264 +- || par->codec_id == AV_CODEC_ID_MPEG4 || par->codec_id == AV_CODEC_ID_HEVC) { ++ || par->codec_id == AV_CODEC_ID_MPEG4 || par->codec_id == AV_CODEC_ID_HEVC ++ || par->codec_id == AV_CODEC_ID_AV1) { + int64_t pos; + avio_w8(pb, + par->codec_type == AVMEDIA_TYPE_VIDEO ? +@@ -537,6 +540,9 @@ static void flv_write_codec_header(AVFormatContext* s, AVCodecParameters* par, i + if (par->codec_id == AV_CODEC_ID_HEVC) { + avio_w8(pb, FLV_IS_EX_HEADER | PacketTypeSequenceStart); // ExVideoTagHeader mode with PacketTypeSequenceStart + avio_write(pb, "hvc1", 4); ++ } else if (par->codec_id == AV_CODEC_ID_AV1) { ++ avio_w8(pb, FLV_IS_EX_HEADER | PacketTypeSequenceStart); ++ avio_write(pb, "av01", 4); + } else { + avio_w8(pb, par->codec_tag | FLV_FRAME_KEY); // flags + avio_w8(pb, 0); // AVC sequence header +@@ -545,6 +551,8 @@ static void flv_write_codec_header(AVFormatContext* s, AVCodecParameters* par, i + + if (par->codec_id == AV_CODEC_ID_HEVC) + ff_isom_write_hvcc(pb, par->extradata, par->extradata_size, 0); ++ else if (par->codec_id == AV_CODEC_ID_AV1) ++ ff_isom_write_av1c(pb, par->extradata, par->extradata_size, 1); + else + ff_isom_write_avcc(pb, par->extradata, par->extradata_size); + } +@@ -843,13 +851,15 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt) + if (par->codec_id == AV_CODEC_ID_VP6F || par->codec_id == AV_CODEC_ID_VP6A || + par->codec_id == AV_CODEC_ID_VP6 || par->codec_id == AV_CODEC_ID_AAC) + flags_size = 2; +- else if (par->codec_id == AV_CODEC_ID_H264 || par->codec_id == AV_CODEC_ID_MPEG4 || par->codec_id == AV_CODEC_ID_HEVC) ++ else if (par->codec_id == AV_CODEC_ID_H264 || par->codec_id == AV_CODEC_ID_MPEG4 || ++ par->codec_id == AV_CODEC_ID_HEVC || par->codec_id == AV_CODEC_ID_AV1) + flags_size = 5; + else + flags_size = 1; + + if (par->codec_id == AV_CODEC_ID_AAC || par->codec_id == AV_CODEC_ID_H264 +- || par->codec_id == AV_CODEC_ID_MPEG4 || par->codec_id == AV_CODEC_ID_HEVC) { ++ || par->codec_id == AV_CODEC_ID_MPEG4 || par->codec_id == AV_CODEC_ID_HEVC ++ || par->codec_id == AV_CODEC_ID_AV1) { + size_t side_size; + uint8_t *side = av_packet_get_side_data(pkt, AV_PKT_DATA_NEW_EXTRADATA, &side_size); + if (side && side_size > 0 && (side_size != par->extradata_size || memcmp(side, par->extradata, side_size))) { +@@ -869,7 +879,8 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt) + "Packets are not in the proper order with respect to DTS\n"); + return AVERROR(EINVAL); + } +- if (par->codec_id == AV_CODEC_ID_H264 || par->codec_id == AV_CODEC_ID_MPEG4 || par->codec_id == AV_CODEC_ID_HEVC) { ++ if (par->codec_id == AV_CODEC_ID_H264 || par->codec_id == AV_CODEC_ID_MPEG4 || ++ par->codec_id == AV_CODEC_ID_HEVC || par->codec_id == AV_CODEC_ID_AV1) { + if (pkt->pts == AV_NOPTS_VALUE) { + av_log(s, AV_LOG_ERROR, "Packet is missing PTS\n"); + return AVERROR(EINVAL); +@@ -982,6 +993,9 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt) + if (par->codec_id == AV_CODEC_ID_HEVC) { + avio_w8(pb, FLV_IS_EX_HEADER | PacketTypeCodedFramesX); // ExVideoTagHeader mode with PacketTypeCodedFramesX + avio_write(pb, "hvc1", 4); ++ } else if (par->codec_id == AV_CODEC_ID_AV1) { ++ avio_w8(pb, FLV_IS_EX_HEADER | PacketTypeCodedFrames); ++ avio_write(pb, "av01", 4); + } else { + avio_w8(pb, flags); + } + +From patchwork Mon May 15 08:31:59 2023 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Steven Liu +X-Patchwork-Id: 41618 +Delivered-To: ffmpegpatchwork2@gmail.com +Received: by 2002:a05:6a20:ba91:b0:105:feb:71f2 with SMTP id + fb17csp1444290pzb; + Mon, 15 May 2023 01:33:41 -0700 (PDT) +X-Google-Smtp-Source: + ACHHUZ7k5HSYVpKlutDCH3BVN03oQ1eQ9NWjKwBebLGv5fK0d2qVGGgCtBo3XdEGlDTDUuvlDzRX +X-Received: by 2002:a17:907:9347:b0:94f:322d:909c with SMTP id + bv7-20020a170907934700b0094f322d909cmr26994118ejc.34.1684139620986; + Mon, 15 May 2023 01:33:40 -0700 (PDT) +ARC-Seal: i=1; a=rsa-sha256; t=1684139620; cv=none; + d=google.com; s=arc-20160816; + b=BBSgegXR1u0K767R9MAxQddt49hZNhDS+YgCHGYo0B07ClteK018739TK9tupVh7pK + wuvk/gzkEpIZpf2I3LQnpaxvQx0ZnllSKyz+x+560wEVKkQw5tlwpgr4qA3m0ApBBmQR + 2ZUu6WRpBnVeXJbT5n+ymITrLd1NVXLNPqoz7kL0iDML0b2iC9PqCoGRTHF6zJZFtCH2 + ZYUq4OdcbflvqqLBvKvSgEwuVof0bqDwD8kfq9noKTf7wrx5bcdIbq6XMYG1n6AnPq7R + R+ekmhosFoZ7IgohAkj9k8j6l4ipCc6yVN2M8TN1TfTwRC01vzz+SRYOXZWLNb0eqZzh + Zp2A== +ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; + s=arc-20160816; + h=sender:errors-to:content-transfer-encoding:cc:reply-to + :list-subscribe:list-help:list-post:list-archive:list-unsubscribe + :list-id:precedence:subject:feedback-id:mime-version:references + :in-reply-to:message-id:date:to:from:delivered-to; + bh=J5hIt8/6l7983HWQOAGA1qy6mjWmMWu6DJ2RZRfJeuQ=; + b=rX88kWHJtUiqnNutEQCOwUvfl5lV/FVHviaDHIsiatvB92XG71pgeFVXopTjJ+st3F + lu+/rKnYKAVXFqF4WHMP6bu0VT5bFE2A9806gTD5Rf1D2yGVjKWRH8fhY6Jl2KhEhQA+ + Efc6fMZ2qZRmdx5S2INE2k+sY3zgWZsFkv2NDowFLnjnpmTGneVW82ybCbL06DRH7Jts + wxWDfFfTqnp2VNwD0C462f5ogLB8cH7f9uoFviTovEYcXc8iLpHP38cJa3hdAuJg972S + cgjJSuZUaQ38bqmw7th2MDkaFSzryck0wafneRdJUxyKG7ltbwk4hgAz89yzUB7nZeU6 + yucA== +ARC-Authentication-Results: i=1; mx.google.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 +Return-Path: +Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) + by mx.google.com with ESMTP id + gv41-20020a1709072be900b00965f171543esi11575148ejc.148.2023.05.15.01.33.40; + Mon, 15 May 2023 01:33:40 -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; + 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 +Received: from [127.0.1.1] (localhost [127.0.0.1]) + by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D65AD68C0A8; + Mon, 15 May 2023 11:33:29 +0300 (EEST) +X-Original-To: ffmpeg-devel@ffmpeg.org +Delivered-To: ffmpeg-devel@ffmpeg.org +Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.155.67.158]) + by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5AA6768C09F + for ; Mon, 15 May 2023 11:33:22 +0300 (EEST) +X-QQ-mid: bizesmtp75t1684139596t4okf86m +Received: from localhost ( [103.102.203.204]) by bizesmtp.qq.com (ESMTP) with + id ; Mon, 15 May 2023 16:33:15 +0800 (CST) +X-QQ-SSF: 01100000000000Z0Z000000A0000000 +X-QQ-FEAT: KvvwR/hcPA3wY6H84uX1Z4OhW9I2bQ1QV35znBz44h8GZ/oUuMaFpDcrT3dSg + MUkTVTMEyhXhHNx2JIMxfw5+q/3TCUtvnKXsxLZtQsy/0Nq/y+p0xVsHJzQmM8CvbT6L6Q3 + OmxwvGAO6ljvI/iA+SXU+3+HUNyetDE8UTRW1ZGCtG9iJRbK9wXPoiAMzLepT2+CHGO2brq + CwH6RA/e9/I4xOHLleywtC4oDlPuyHovxzzedsBTrXYic5tb0+D65abc6NjfHr7zrYD/DQu + HY0NNweX9YP/jE8jJ0TPLhcx7wighw+KDFbYf+UcUuaPHhzfAZh2f6aplibzVuvV78OPq2S + thQ/XeMGf/W9C/Oy4Eq145+G+pUQ7zx/OKY8Jj/33dmvwZkUr8= +X-QQ-GoodBg: 0 +X-BIZMAIL-ID: 9530387995930120932 +From: Steven Liu +To: ffmpeg-devel@ffmpeg.org +Date: Mon, 15 May 2023 16:31:59 +0800 +Message-Id: <20230515083201.48201-5-lq@chinaffmpeg.org> +X-Mailer: git-send-email 2.40.0 +In-Reply-To: <20230515083201.48201-1-lq@chinaffmpeg.org> +References: + + <20230515083201.48201-1-lq@chinaffmpeg.org> +MIME-Version: 1.0 +X-QQ-SENDSIZE: 520 +Feedback-ID: bizesmtp:chinaffmpeg.org:qybglogicsvrsz:qybglogicsvrsz3a-3 +Subject: [FFmpeg-devel] [PATCH v10 4/6] avformat/flvdec: support demux av1 + in enhanced flv +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: Steven Liu +Errors-To: ffmpeg-devel-bounces@ffmpeg.org +Sender: "ffmpeg-devel" +X-TUID: MKqjViniwIy+ + +Signed-off-by: Steven Liu +--- + libavformat/flvdec.c | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c +index c8e6cadf1c..a0362ff11c 100644 +--- a/libavformat/flvdec.c ++++ b/libavformat/flvdec.c +@@ -318,6 +318,8 @@ static int flv_same_video_codec(AVFormatContext *s, AVCodecParameters *vpar, int + switch(codec_id) { + case MKBETAG('h', 'v', 'c', '1'): + return vpar->codec_id == AV_CODEC_ID_HEVC; ++ case MKBETAG('a', 'v', '0', '1'): ++ return vpar->codec_id == AV_CODEC_ID_AV1; + default: + break; + } +@@ -359,6 +361,10 @@ static int flv_set_video_codec(AVFormatContext *s, AVStream *vstream, + par->codec_id = AV_CODEC_ID_HEVC; + vstreami->need_parsing = AVSTREAM_PARSE_HEADERS; + return 4; ++ case MKBETAG('a', 'v', '0', '1'): ++ par->codec_id = AV_CODEC_ID_AV1; ++ vstreami->need_parsing = AVSTREAM_PARSE_HEADERS; ++ return 4; + default: + break; + } +@@ -1278,7 +1284,8 @@ retry_duration: + if (st->codecpar->codec_id == AV_CODEC_ID_AAC || + st->codecpar->codec_id == AV_CODEC_ID_H264 || + st->codecpar->codec_id == AV_CODEC_ID_MPEG4 || +- st->codecpar->codec_id == AV_CODEC_ID_HEVC) { ++ st->codecpar->codec_id == AV_CODEC_ID_HEVC || ++ st->codecpar->codec_id == AV_CODEC_ID_AV1) { + int type = 0; + if (flv->exheader && stream_type == FLV_STREAM_TYPE_VIDEO) { + type = flags & 0x0F; +@@ -1309,7 +1316,8 @@ retry_duration: + } + } + if (type == 0 && (!st->codecpar->extradata || st->codecpar->codec_id == AV_CODEC_ID_AAC || +- st->codecpar->codec_id == AV_CODEC_ID_H264 || st->codecpar->codec_id == AV_CODEC_ID_HEVC)) { ++ st->codecpar->codec_id == AV_CODEC_ID_H264 || st->codecpar->codec_id == AV_CODEC_ID_HEVC || ++ st->codecpar->codec_id == AV_CODEC_ID_AV1)) { + AVDictionaryEntry *t; + + if (st->codecpar->extradata) { + +From patchwork Mon May 15 08:32:00 2023 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Steven Liu +X-Patchwork-Id: 41619 +Delivered-To: ffmpegpatchwork2@gmail.com +Received: by 2002:a05:6a20:ba91:b0:105:feb:71f2 with SMTP id + fb17csp1444532pzb; + Mon, 15 May 2023 01:34:10 -0700 (PDT) +X-Google-Smtp-Source: + ACHHUZ4QlFqXMa0WNHK3Z3HLgPm2UskuQZX2wmbFhYm+ZL0BsDRPhLxJboG0YhDPFi999aVCQZE+ +X-Received: by 2002:a05:6402:14c3:b0:50d:fcfb:8633 with SMTP id + f3-20020a05640214c300b0050dfcfb8633mr9613789edx.9.1684139650196; + Mon, 15 May 2023 01:34:10 -0700 (PDT) +ARC-Seal: i=1; a=rsa-sha256; t=1684139650; cv=none; + d=google.com; s=arc-20160816; + b=sjfm4xhTPqjGNyHlxS3/kMPilx13EB+7S0YxjOI5lR9MMg8Sy3KgL187C6tuZqUwoZ + dJo7A3q41EK4WJyWTTUyqUOr8q8JPjbBTCJpVsERuMuMWpHrhQxvwEDibvfuDI0ZI2vK + y5pqRZ23OMNZLCC+fsc85gQDKPgvkYZTYisSOsWVRiZQGl04TipfZE1Uza8R7ZEXRgdH + ZW770YcfzVXmKKzralH4thSFhGfMZRpX7kj6oBtmpUco4Z6iu42o3iBTcaioGBzdWdPY + KL94WAIaMnCyO1JJaUAJGzEcQTGhPbXUzG7JvmqEwSa168GBSEjQJ3qJc8oOr+UVWcvn + HvaQ== +ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; + s=arc-20160816; + h=sender:errors-to:content-transfer-encoding:cc:reply-to + :list-subscribe:list-help:list-post:list-archive:list-unsubscribe + :list-id:precedence:subject:feedback-id:mime-version:references + :in-reply-to:message-id:date:to:from:delivered-to; + bh=b1Sp5oqZAMwakI7a3Zvw4MdnKPyomZo8cXqDnyJamjg=; + b=jcFJOli16NPqGPnMDcJVER3TEkWreNJ2Vu7711GhJhFkmXLNFhS2FUAoT9QBTy+JWm + jxaBjiVvs1MMQ+a3k3yT7AzVSUMMDDSagiE/jWzQ+vBN9dr/jQOMtJWxwfm4oTbBc0/r + GcHTgPKB2HvEiLOWaJ4CSfZcYBvosoew/IfPgKm06P2Btmc+faSXLCZ63nKEVTq7NCpx + qllJPkFmvlwB/+soxN7nZgTzXm/uurSOBMajImRGPOZUOZQE1I5Tk8OtJXZP6QtlSvXT + ZcglewhTYuHlAXbpT4sYyddMwKg9yPu6/Wmrol/wg3QpXPZ0lVtLeTozus/2UTISJrR5 + Lp3Q== +ARC-Authentication-Results: i=1; mx.google.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 +Return-Path: +Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) + by mx.google.com with ESMTP id + f25-20020a056402151900b0050bd37278d9si11856925edw.435.2023.05.15.01.34.09; + Mon, 15 May 2023 01:34:10 -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; + 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 +Received: from [127.0.1.1] (localhost [127.0.0.1]) + by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0DB6568C092; + Mon, 15 May 2023 11:34:07 +0300 (EEST) +X-Original-To: ffmpeg-devel@ffmpeg.org +Delivered-To: ffmpeg-devel@ffmpeg.org +Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.154.221.58]) + by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 96A14680274 + for ; Mon, 15 May 2023 11:33:59 +0300 (EEST) +X-QQ-mid: bizesmtp76t1684139634tg83beu0 +Received: from localhost ( [103.102.203.204]) by bizesmtp.qq.com (ESMTP) with + id ; Mon, 15 May 2023 16:33:52 +0800 (CST) +X-QQ-SSF: 01100000000000Z0Z000000A0000000 +X-QQ-FEAT: DWSCcwW/aQb83U5Bq9N00w3kkIuofNiUvlQbgR0sgGjFEas+vh7wXyRycFT/z + w33SH7uNRX8lmP+8+iy6jQH/gsaQRVAau2z8K0utdx9GuZMvY0e5SZfB0zBfncb1NdBZJxB + Ptvibavnj2rDlqrGLO9dvFEfmYj1K48HYp6rdjCb+xRPfyOtnct3Zq6ST7F1DxU1+Kmt8cw + 2qVgeA79DNHm1JbcDzi/2W/SpzWHWk/jamN4cAQfKyP9B4AvMPaFd8kdl6akYbR0Q84H73M + Pcx8UXz6iw4sCTSPFzf0zrsI4+shly9KFp4UESTfRbDEJ46pcyw8+6Uz+Q7w+7CRtPlOsms + K6IAbcLwicf/v8Rm2nHdrNPotcaMgY5p7IqmkY/Y/b2feqKiAM= +X-QQ-GoodBg: 0 +X-BIZMAIL-ID: 4611718483056789364 +From: Steven Liu +To: ffmpeg-devel@ffmpeg.org +Date: Mon, 15 May 2023 16:32:00 +0800 +Message-Id: <20230515083201.48201-6-lq@chinaffmpeg.org> +X-Mailer: git-send-email 2.40.0 +In-Reply-To: <20230515083201.48201-1-lq@chinaffmpeg.org> +References: + + <20230515083201.48201-1-lq@chinaffmpeg.org> +MIME-Version: 1.0 +X-QQ-SENDSIZE: 520 +Feedback-ID: bizesmtp:chinaffmpeg.org:qybglogicsvrsz:qybglogicsvrsz3a-3 +Subject: [FFmpeg-devel] [PATCH v10 5/6] avformat/flvenc: support mux vp9 in + enhanced flv +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: Steven Liu +Errors-To: ffmpeg-devel-bounces@ffmpeg.org +Sender: "ffmpeg-devel" +X-TUID: appcyLUJeeFW + +Signed-off-by: Steven Liu +--- + libavformat/Makefile | 2 +- + libavformat/flvenc.c | 22 ++++++++++++++-------- + 2 files changed, 15 insertions(+), 9 deletions(-) + +diff --git a/libavformat/Makefile b/libavformat/Makefile +index c868e1626c..16cfe107ea 100644 +--- a/libavformat/Makefile ++++ b/libavformat/Makefile +@@ -214,7 +214,7 @@ OBJS-$(CONFIG_FLAC_MUXER) += flacenc.o flacenc_header.o \ + OBJS-$(CONFIG_FLIC_DEMUXER) += flic.o + OBJS-$(CONFIG_FLV_DEMUXER) += flvdec.o + OBJS-$(CONFIG_LIVE_FLV_DEMUXER) += flvdec.o +-OBJS-$(CONFIG_FLV_MUXER) += flvenc.o avc.o hevc.o av1.o ++OBJS-$(CONFIG_FLV_MUXER) += flvenc.o avc.o hevc.o av1.o vpcc.o + OBJS-$(CONFIG_FOURXM_DEMUXER) += 4xm.o + OBJS-$(CONFIG_FRAMECRC_MUXER) += framecrcenc.o framehash.o + OBJS-$(CONFIG_FRAMEHASH_MUXER) += hashenc.o framehash.o +diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c +index c1784b332d..475dd0bf44 100644 +--- a/libavformat/flvenc.c ++++ b/libavformat/flvenc.c +@@ -29,6 +29,7 @@ + #include "avio.h" + #include "avc.h" + #include "av1.h" ++#include "vpcc.h" + #include "hevc.h" + #include "avformat.h" + #include "flv.h" +@@ -50,6 +51,7 @@ static const AVCodecTag flv_video_codec_ids[] = { + { AV_CODEC_ID_H264, FLV_CODECID_H264 }, + { AV_CODEC_ID_HEVC, MKBETAG('h', 'v', 'c', '1') }, + { AV_CODEC_ID_AV1, MKBETAG('a', 'v', '0', '1') }, ++ { AV_CODEC_ID_VP9, MKBETAG('v', 'p', '0', '9') }, + { AV_CODEC_ID_NONE, 0 } + }; + +@@ -494,7 +496,7 @@ static void flv_write_codec_header(AVFormatContext* s, AVCodecParameters* par, i + + if (par->codec_id == AV_CODEC_ID_AAC || par->codec_id == AV_CODEC_ID_H264 + || par->codec_id == AV_CODEC_ID_MPEG4 || par->codec_id == AV_CODEC_ID_HEVC +- || par->codec_id == AV_CODEC_ID_AV1) { ++ || par->codec_id == AV_CODEC_ID_AV1 || par->codec_id == AV_CODEC_ID_VP9) { + int64_t pos; + avio_w8(pb, + par->codec_type == AVMEDIA_TYPE_VIDEO ? +@@ -540,9 +542,9 @@ static void flv_write_codec_header(AVFormatContext* s, AVCodecParameters* par, i + if (par->codec_id == AV_CODEC_ID_HEVC) { + avio_w8(pb, FLV_IS_EX_HEADER | PacketTypeSequenceStart); // ExVideoTagHeader mode with PacketTypeSequenceStart + avio_write(pb, "hvc1", 4); +- } else if (par->codec_id == AV_CODEC_ID_AV1) { ++ } else if (par->codec_id == AV_CODEC_ID_AV1 || par->codec_id == AV_CODEC_ID_VP9) { + avio_w8(pb, FLV_IS_EX_HEADER | PacketTypeSequenceStart); +- avio_write(pb, "av01", 4); ++ avio_write(pb, par->codec_id == AV_CODEC_ID_AV1 ? "av01" : "vp09", 4); + } else { + avio_w8(pb, par->codec_tag | FLV_FRAME_KEY); // flags + avio_w8(pb, 0); // AVC sequence header +@@ -553,6 +555,8 @@ static void flv_write_codec_header(AVFormatContext* s, AVCodecParameters* par, i + ff_isom_write_hvcc(pb, par->extradata, par->extradata_size, 0); + else if (par->codec_id == AV_CODEC_ID_AV1) + ff_isom_write_av1c(pb, par->extradata, par->extradata_size, 1); ++ else if (par->codec_id == AV_CODEC_ID_VP9) ++ ff_isom_write_vpcc(s, pb, par->extradata, par->extradata_size, par); + else + ff_isom_write_avcc(pb, par->extradata, par->extradata_size); + } +@@ -852,14 +856,15 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt) + par->codec_id == AV_CODEC_ID_VP6 || par->codec_id == AV_CODEC_ID_AAC) + flags_size = 2; + else if (par->codec_id == AV_CODEC_ID_H264 || par->codec_id == AV_CODEC_ID_MPEG4 || +- par->codec_id == AV_CODEC_ID_HEVC || par->codec_id == AV_CODEC_ID_AV1) ++ par->codec_id == AV_CODEC_ID_HEVC || par->codec_id == AV_CODEC_ID_AV1 || ++ par->codec_id == AV_CODEC_ID_VP9) + flags_size = 5; + else + flags_size = 1; + + if (par->codec_id == AV_CODEC_ID_AAC || par->codec_id == AV_CODEC_ID_H264 + || par->codec_id == AV_CODEC_ID_MPEG4 || par->codec_id == AV_CODEC_ID_HEVC +- || par->codec_id == AV_CODEC_ID_AV1) { ++ || par->codec_id == AV_CODEC_ID_AV1 || par->codec_id == AV_CODEC_ID_VP9) { + size_t side_size; + uint8_t *side = av_packet_get_side_data(pkt, AV_PKT_DATA_NEW_EXTRADATA, &side_size); + if (side && side_size > 0 && (side_size != par->extradata_size || memcmp(side, par->extradata, side_size))) { +@@ -880,7 +885,8 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt) + return AVERROR(EINVAL); + } + if (par->codec_id == AV_CODEC_ID_H264 || par->codec_id == AV_CODEC_ID_MPEG4 || +- par->codec_id == AV_CODEC_ID_HEVC || par->codec_id == AV_CODEC_ID_AV1) { ++ par->codec_id == AV_CODEC_ID_HEVC || par->codec_id == AV_CODEC_ID_AV1 || ++ par->codec_id == AV_CODEC_ID_VP9) { + if (pkt->pts == AV_NOPTS_VALUE) { + av_log(s, AV_LOG_ERROR, "Packet is missing PTS\n"); + return AVERROR(EINVAL); +@@ -993,9 +999,9 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt) + if (par->codec_id == AV_CODEC_ID_HEVC) { + avio_w8(pb, FLV_IS_EX_HEADER | PacketTypeCodedFramesX); // ExVideoTagHeader mode with PacketTypeCodedFramesX + avio_write(pb, "hvc1", 4); +- } else if (par->codec_id == AV_CODEC_ID_AV1) { ++ } else if (par->codec_id == AV_CODEC_ID_AV1 || par->codec_id == AV_CODEC_ID_VP9) { + avio_w8(pb, FLV_IS_EX_HEADER | PacketTypeCodedFrames); +- avio_write(pb, "av01", 4); ++ avio_write(pb, par->codec_id == AV_CODEC_ID_AV1 ? "av01" : "vp09", 4); + } else { + avio_w8(pb, flags); + } + +From patchwork Mon May 15 08:32:01 2023 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Steven Liu +X-Patchwork-Id: 41620 +Delivered-To: ffmpegpatchwork2@gmail.com +Received: by 2002:a05:6a20:ba91:b0:105:feb:71f2 with SMTP id + fb17csp1444616pzb; + Mon, 15 May 2023 01:34:19 -0700 (PDT) +X-Google-Smtp-Source: + ACHHUZ4K6eOJwwn7jPfy0dhTP4IQr2XzDB8PfB7Er6aQtrCrxnddiRIgdBqZB72dHhyqfbILXd5E +X-Received: by 2002:a17:906:ee8e:b0:95e:c549:9ace with SMTP id + wt14-20020a170906ee8e00b0095ec5499acemr28082182ejb.62.1684139659496; + Mon, 15 May 2023 01:34:19 -0700 (PDT) +ARC-Seal: i=1; a=rsa-sha256; t=1684139659; cv=none; + d=google.com; s=arc-20160816; + b=FM9SQbkYmqWaOAa8YRKsdoj3BSoNN/SsDqXgEaRL8lCygJuahCT1ybocV1IqmUSTxS + l5AcUJGbZbl2BeNhK5mX43aCfKBSSF3DLhmRCMBC8pU2iPmv7TuSV58kRfLY6r83j8Ic + dV56QUYYtN+Ve0BWnaHFOzivSNAgHxwePstQL043LHD2rn+B5CyNvq7l2CahnhMJ8JUG + zJNSBe/LFF0Lhkymqd877vkJ+x+UjSWEIdomIJdAcAt2D06jDxwIF/nnLDDHmvQeny2N + 8xqssE401QcYCq6GtRi0UTAyMrYiDU4RUPOh8Kjb5YoMXYpbI+BCsr6VJlh6/F6cFD58 + YStw== +ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; + s=arc-20160816; + h=sender:errors-to:content-transfer-encoding:cc:reply-to + :list-subscribe:list-help:list-post:list-archive:list-unsubscribe + :list-id:precedence:subject:feedback-id:mime-version:references + :in-reply-to:message-id:date:to:from:delivered-to; + bh=JCKfqtynP85UyN4OG5PQuC2GOM45EC75rPa/TN9Pkis=; + b=MF78hg+0KkjUNq5Bjz6b4rjcJDJqrFufWHhDWzKgWCGo15fvnVg3UY8PDvpsUYxxSA + SXQJP1urvuxLvJ9m6N20/mBCgrN9Cqca537oiWWNbayAOBLuihXPNDPZLqYgD9yg+03U + Qo46rKs8BxkuzTKsqfFu1cf8b3qgqp2wt2mOFFnRU8p9J5foA5HCpHoEB1SWo8KqKjqz + NeFoyh4k/CHk8Qy2rhQ/ahuNo0zByXEVuGqBEK1GakW8bC6DpX/gX9PnsE7BvpOrO/+z + iEJxUd1RyUFDRETjdcqfLeRlEBO0NbFi9GTRjg0oY7m2OM8gh9zw7TIOoKfKaCVepa+1 + zs+g== +ARC-Authentication-Results: i=1; mx.google.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 +Return-Path: +Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) + by mx.google.com with ESMTP id + f21-20020a170906825500b00965c55c71d9si10492876ejx.988.2023.05.15.01.34.19; + Mon, 15 May 2023 01:34:19 -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; + 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 +Received: from [127.0.1.1] (localhost [127.0.0.1]) + by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3486468C072; + Mon, 15 May 2023 11:34:13 +0300 (EEST) +X-Original-To: ffmpeg-devel@ffmpeg.org +Delivered-To: ffmpeg-devel@ffmpeg.org +Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.154.221.58]) + by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6482B68C0A0 + for ; Mon, 15 May 2023 11:34:05 +0300 (EEST) +X-QQ-mid: bizesmtp71t1684139639tsfp6osq +Received: from localhost ( [103.102.203.204]) by bizesmtp.qq.com (ESMTP) with + id ; Mon, 15 May 2023 16:33:58 +0800 (CST) +X-QQ-SSF: 01100000000000Z0Z000000A0000000 +X-QQ-FEAT: v2TBAhtyi5HmOI8RH62YXWVaml0uNXxcsJwtXrqVzXdpJwJpkYcpKS0jOn5b8 + vputCYK1FNClBNOmv9AzELjT/K26cFOsUYKBpAudrf8Al/Kmwl8CjyT6nDK06QByrHu67A4 + sX8VQrazIXO6ZPIrfA9ElusXtssmR22e8ju0nXX7oNy/AS4t0bZkuJRVmYCoHSCnLqnvF9r + YboVdmg0ZbLovrXBy26bgQr944G/tQRTeAGorAwE61Lf9tqlRKuT8TO8/BA/V7zBuaZTSxA + nghl61awPoduY4vd9Nepw43V2Cun4wfPTvAMJn9EQhrdUge4sIN0Q4EuWkBd9dC/nTOwVKV + WsjLxbyL6apFe08XmyeS9MDJkL+bFN3ykpDJqblBg8C1AYOjVyYFS2Yt/atcQ== +X-QQ-GoodBg: 0 +X-BIZMAIL-ID: 14221595051603022987 +From: Steven Liu +To: ffmpeg-devel@ffmpeg.org +Date: Mon, 15 May 2023 16:32:01 +0800 +Message-Id: <20230515083201.48201-7-lq@chinaffmpeg.org> +X-Mailer: git-send-email 2.40.0 +In-Reply-To: <20230515083201.48201-1-lq@chinaffmpeg.org> +References: + + <20230515083201.48201-1-lq@chinaffmpeg.org> +MIME-Version: 1.0 +X-QQ-SENDSIZE: 520 +Feedback-ID: bizesmtp:chinaffmpeg.org:qybglogicsvrsz:qybglogicsvrsz3a-3 +Subject: [FFmpeg-devel] [PATCH v10 6/6] avformat/flvdec: support demux vp9 + in enhanced flv +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: Steven Liu +Errors-To: ffmpeg-devel-bounces@ffmpeg.org +Sender: "ffmpeg-devel" +X-TUID: wOtvTzk+zhdw + +Signed-off-by: Steven Liu +--- + libavformat/flvdec.c | 11 +++++++++-- + 1 file changed, 9 insertions(+), 2 deletions(-) + +diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c +index a0362ff11c..a6a94a4021 100644 +--- a/libavformat/flvdec.c ++++ b/libavformat/flvdec.c +@@ -320,6 +320,8 @@ static int flv_same_video_codec(AVFormatContext *s, AVCodecParameters *vpar, int + return vpar->codec_id == AV_CODEC_ID_HEVC; + case MKBETAG('a', 'v', '0', '1'): + return vpar->codec_id == AV_CODEC_ID_AV1; ++ case MKBETAG('v', 'p', '0', '9'): ++ return vpar->codec_id == AV_CODEC_ID_VP9; + default: + break; + } +@@ -365,6 +367,10 @@ static int flv_set_video_codec(AVFormatContext *s, AVStream *vstream, + par->codec_id = AV_CODEC_ID_AV1; + vstreami->need_parsing = AVSTREAM_PARSE_HEADERS; + return 4; ++ case MKBETAG('v', 'p', '0', '9'): ++ par->codec_id = AV_CODEC_ID_VP9; ++ vstreami->need_parsing = AVSTREAM_PARSE_HEADERS; ++ return 4; + default: + break; + } +@@ -1285,7 +1291,8 @@ retry_duration: + st->codecpar->codec_id == AV_CODEC_ID_H264 || + st->codecpar->codec_id == AV_CODEC_ID_MPEG4 || + st->codecpar->codec_id == AV_CODEC_ID_HEVC || +- st->codecpar->codec_id == AV_CODEC_ID_AV1) { ++ st->codecpar->codec_id == AV_CODEC_ID_AV1 || ++ st->codecpar->codec_id == AV_CODEC_ID_VP9) { + int type = 0; + if (flv->exheader && stream_type == FLV_STREAM_TYPE_VIDEO) { + type = flags & 0x0F; +@@ -1317,7 +1324,7 @@ retry_duration: + } + if (type == 0 && (!st->codecpar->extradata || st->codecpar->codec_id == AV_CODEC_ID_AAC || + st->codecpar->codec_id == AV_CODEC_ID_H264 || st->codecpar->codec_id == AV_CODEC_ID_HEVC || +- st->codecpar->codec_id == AV_CODEC_ID_AV1)) { ++ st->codecpar->codec_id == AV_CODEC_ID_AV1 || st->codecpar->codec_id == AV_CODEC_ID_VP9)) { + AVDictionaryEntry *t; + + if (st->codecpar->extradata) { diff --git a/README.md b/README.md index 238c0d3..9b921a7 100644 --- a/README.md +++ b/README.md @@ -5,3 +5,24 @@ demux, stream, filter and play pretty much anything that humans and machines have created. It supports the most obscure ancient formats up to the cutting edge. No matter if they were designed by some standards committee, the community or a corporation. + +## Creating the 'free' tarball + +1. Update the `Version` in the spec file. +2. Set the `Release` to 0 in the spec file. +3. Set `pkg_suffix` to `%nil` +4. Do a full build locally: `fedpkg mockbuild --with full_build` +5. Run `./ffmpeg_update_free_sources.sh results_ffmpeg/5.0/0.fc35/build.log` + This will update the `ffmpeg_free_sources` file list. + Note that header files will need to be manually added + to the `ffmpeg_free_sources` file list. +6. Run `./ffmpeg_gen_free_tarball.sh` to create the tarball. +7. Set `pkg_suffix` to `-free` again +8. Set the `Release` to 1 in the spec file. +9. Do a scratch build. + +OR + +1. Edit `ffmpeg_free_sources` and add missing files +2. Run `./ffmpeg_gen_free_tarball.sh` to create the tarball. +3. Do a scratch build. diff --git a/enable_decoders b/enable_decoders index f558db4..ea1c38e 100644 --- a/enable_decoders +++ b/enable_decoders @@ -1,5 +1,4 @@ ## module name # reason for enablement in ffmpeg (usually there is another package that already got legal review) -aac aasc libfdk_aac # fdk-aac-free ac3 @@ -57,7 +56,6 @@ adpcm_xa adpcm_xmd adpcm_yamaha adpcm_zork -aic alac alias_pix amrnb @@ -69,7 +67,6 @@ anull apac ape apng # animated png -apv arbc argo ass # trivial @@ -84,6 +81,7 @@ aura aura2 av1 # libaom av1_qsv # libaom +ayuv # trivial bethsoftvid # trivial bfi # trivial bink @@ -116,7 +114,6 @@ dfa dfpwm dirac # dirac dnxhd -dnxhr dolby_e dpx dsd_lsbf @@ -165,7 +162,7 @@ gsm_ms gsm_ms_at h261 h263 -h263_v4l2m2m # hardware +h263_v4l2m2m h263i h263p hap @@ -198,8 +195,6 @@ jv kgv1 kmvc lagarith -libaribb24 # aribb24 -libaribcaption # libaribcaption libaom # libaom libaom_av1 # libaom libcodec2 # codec2 @@ -208,10 +203,9 @@ libgsm # libgsm libgsm_ms # libgsm libilbc # ilbc libjxl # libjxl -liblc3 # liblc3 libopencore_amrnb # opencore-amr libopencore_amrwb # opencore-amr -libopenh264 # openh264 +libopenh264 # openh264_dlopen libopenjpeg # openjpeg libopus # opus librsvg # librsvg @@ -220,7 +214,6 @@ libspeex # speex libvorbis # libvorbis libvpx_vp8 # libvpx libvpx_vp9 # libvpx -libxevd libzvbi_teletext # zvbi loco lscr @@ -251,13 +244,13 @@ mp3on4 mp3on4float mpc7 mpc8 -mpeg1_v4l2m2m mpeg1video +mpeg1_v4l2m2m +mpeg2video mpeg2_qsv mpeg2_v4l2m2m -mpeg2video mpeg4 -mpeg4_v4l2m2m # hardware +mpeg4_v4l2m2m mpegvideo mpl2 msa1 @@ -335,8 +328,6 @@ pictor pjs png # libpng ppm # trivial -prores -prores_raw prosumer psd ptx @@ -344,7 +335,6 @@ qcelp qdm2 qdmc qdraw -qoa qoi qpeg qtrle diff --git a/enable_encoders b/enable_encoders index ba284da..10dd53a 100644 --- a/enable_encoders +++ b/enable_encoders @@ -31,6 +31,7 @@ av1_amf av1_nvenc av1_qsv av1_vaapi +ayuv # trival bitpacked # trivial bmp # trivial cinepak @@ -38,7 +39,6 @@ cljr dca dfpwm dnxhd -dnxhr dpx dvbsub dvdsub @@ -70,23 +70,22 @@ hevc_v4l2m2m # hardware hevc_vaapi # hardware huffyuv # trivial+zlib ilbc # ilbc -jpeg2000 jpegls -libaom +jpeg2000 +libaom # libaom libaom_av1 # libaom libcodec2 # codec2 libgsm # libgsm libgsm_ms # libgsm libilbc # ilbc libjxl # libjxl -liblc3 # liblc3 libmp3lame # lame -liboapv libopencore_amrnb -libopenh264 # openh264 +libopenh264 # openh264_dlopen libopenjpeg # openjpeg libopus # opus librav1e # rav1e +libschroedinger # schroedinger libspeex # speex libsvtav1 libtheora # libtheora @@ -97,7 +96,6 @@ libvpx_vp8 # libvpx libvpx_vp9 # libvpx libwebp # libwebp libwebp_anim # libwebp -libxeve libxvid # xvidcore mjpeg # mjpegtools mjpeg_qsv # mjpegtools @@ -106,9 +104,9 @@ mlp mp2 # twolame mp2fixed # twolame mpeg1video +mpeg2video mpeg2_qsv mpeg2_vaapi -mpeg2video mpeg4 mpeg4_v4l2m2m # hardware msmpeg4v2 @@ -149,9 +147,6 @@ pgmyuv # trivial phm # trivial png # libpng ppm # trivial -prores -prores_aw -prores_ks qoi qtrle r10k # trivial diff --git a/ffmpeg-allow-fdk-aac-free.patch b/ffmpeg-allow-fdk-aac-free.patch index 11e1a3c..3b87cce 100644 --- a/ffmpeg-allow-fdk-aac-free.patch +++ b/ffmpeg-allow-fdk-aac-free.patch @@ -4,24 +4,23 @@ fdk-aac-free-devel is GPL compatible See https://bugzilla.redhat.com/show_bug.cgi?id=1501522#c112 -Index: ffmpeg-7.0/configure +Index: ffmpeg-5.0/configure =================================================================== ---- ffmpeg-7.0.orig/configure 2022-02-09 20:07:49.490888877 +0100 -+++ ffmpeg-7.0/configure 2022-02-09 20:08:30.102854308 +0100 -@@ -1872,7 +1872,6 @@ EXTERNAL_LIBRARY_GPL_LIST=" - +--- ffmpeg-5.0.orig/configure 2022-02-09 20:07:49.490888877 +0100 ++++ ffmpeg-5.0/configure 2022-02-09 20:08:30.102854308 +0100 +@@ -1783,7 +1783,6 @@ EXTERNAL_LIBRARY_GPL_LIST=" + EXTERNAL_LIBRARY_NONFREE_LIST=" decklink - libfdk_aac libtls " - -@@ -1912,6 +1911,7 @@ EXTERNAL_LIBRARY_LIST=" - libcodec2 + +@@ -1822,6 +1821,7 @@ EXTERNAL_LIBRARY_LIST=" libdav1d libdc1394 + libdrm + libfdk_aac libflite libfontconfig libfreetype - diff --git a/ffmpeg-chromium.patch b/ffmpeg-chromium.patch index 9872622..2160609 100644 --- a/ffmpeg-chromium.patch +++ b/ffmpeg-chromium.patch @@ -12,35 +12,35 @@ diff --git a/libavformat/avformat.h b/libavformat/avformat.h index 1916aa2dc5..e6682849fa 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h -@@ -1170,6 +1170,10 @@ typedef struct AVStreamGroup { - - struct AVCodecParserContext *av_stream_get_parser(const AVStream *s); - +@@ -1019,6 +1019,10 @@ attribute_deprecated + int64_t av_stream_get_end_pts(const AVStream *st); + #endif + +// Chromium: We use the internal field first_dts vvv +int64_t av_stream_get_first_dts(const AVStream *st); +// Chromium: We use the internal field first_dts ^^^ + #define AV_PROGRAM_RUNNING 1 - + /** diff --git a/libavformat/utils.c b/libavformat/utils.c index cf4d68bff9..7d750abf88 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c -@@ -56,6 +56,13 @@ int ff_unlock_avformat(void) - * various utility functions for use within FFmpeg - */ +@@ -55,6 +55,13 @@ int ff_unlock_avformat(void) + return ff_mutex_unlock(&avformat_mutex) ? -1 : 0; + } +// Chromium: We use the internal field first_dts vvv +int64_t av_stream_get_first_dts(const AVStream *st) +{ -+ return cffstream(st)->first_dts; ++ return cffstream(st)->first_dts; +} +// Chromium: We use the internal field first_dts ^^^ + /* an arbitrarily chosen "sane" max packet size -- 50M */ #define SANE_CHUNK_SIZE (50000000) - + -- 2.41.0 diff --git a/ffmpeg-codec-choice.patch b/ffmpeg-codec-choice.patch index f6a4ead..221b4f6 100644 --- a/ffmpeg-codec-choice.patch +++ b/ffmpeg-codec-choice.patch @@ -11,19 +11,19 @@ reduced codec selection list. libavformat/matroskaenc.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) -Index: ffmpeg-7.0/libavformat/matroskaenc.c +Index: ffmpeg-6.0/libavformat/matroskaenc.c =================================================================== ---- ffmpeg-7.0.orig/libavformat/matroskaenc.c -+++ ffmpeg-7.0/libavformat/matroskaenc.c -@@ -3540,16 +3540,25 @@ static int mkv_query_codec(enum AVCodecI +--- ffmpeg-6.0.orig/libavformat/matroskaenc.c ++++ ffmpeg-6.0/libavformat/matroskaenc.c +@@ -3321,16 +3321,25 @@ static int mkv_query_codec(enum AVCodecI return 0; } - + +#define PREFAUDIO \ -+ CONFIG_LIBOPUS_ENCODER ? AV_CODEC_ID_OPUS : \ -+ CONFIG_AAC_ENCODER ? AV_CODEC_ID_AAC : \ -+ CONFIG_VORBIS_ENCODER ? AV_CODEC_ID_VORBIS : \ -+ AV_CODEC_ID_AC3 ++ CONFIG_LIBOPUS_ENCODER ? AV_CODEC_ID_OPUS : \ ++ CONFIG_AAC_ENCODER ? AV_CODEC_ID_AAC : \ ++ CONFIG_VORBIS_ENCODER ? AV_CODEC_ID_VORBIS : \ ++ AV_CODEC_ID_AC3 + const FFOutputFormat ff_matroska_muxer = { .p.name = "matroska", @@ -36,16 +36,16 @@ Index: ffmpeg-7.0/libavformat/matroskaenc.c - .p.video_codec = CONFIG_LIBX264_ENCODER ? - AV_CODEC_ID_H264 : AV_CODEC_ID_MPEG4, + .p.audio_codec = PREFAUDIO, -+ .p.video_codec = -+ CONFIG_LIBVPX_VP9_ENCODER ? AV_CODEC_ID_VP9 : \ -+ CONFIG_LIBX264_ENCODER ? AV_CODEC_ID_H264 : \ -+ CONFIG_LIBVPX_VP8_ENCODER ? AV_CODEC_ID_VP8 : \ -+ CONFIG_MPEG4_ENCODER ? AV_CODEC_ID_MPEG4 : \ -+ AV_CODEC_ID_THEORA, ++ .p.video_codec = ++ CONFIG_LIBVPX_VP9_ENCODER ? AV_CODEC_ID_VP9 : \ ++ CONFIG_LIBX264_ENCODER ? AV_CODEC_ID_H264 : \ ++ CONFIG_LIBVPX_VP8_ENCODER ? AV_CODEC_ID_VP8 : \ ++ CONFIG_MPEG4_ENCODER ? AV_CODEC_ID_MPEG4 : \ ++ AV_CODEC_ID_THEORA, .init = mkv_init, .deinit = mkv_deinit, .write_header = mkv_write_header, -@@ -3617,8 +3626,7 @@ const FFOutputFormat ff_matroska_audio_m +@@ -3388,8 +3397,7 @@ const FFOutputFormat ff_matroska_audio_m .p.mime_type = "audio/x-matroska", .p.extensions = "mka", .priv_data_size = sizeof(MatroskaMuxContext), @@ -55,4 +55,3 @@ Index: ffmpeg-7.0/libavformat/matroskaenc.c .p.video_codec = AV_CODEC_ID_NONE, .init = mkv_init, .deinit = mkv_deinit, - diff --git a/ffmpeg-dlopen-openh264.patch b/ffmpeg-dlopen-openh264.patch new file mode 100644 index 0000000..a283f85 --- /dev/null +++ b/ffmpeg-dlopen-openh264.patch @@ -0,0 +1,363 @@ +From 1f48740db0dda8d6ec1b97a7f4a794e381a65636 Mon Sep 17 00:00:00 2001 +From: Neal Gompa +Date: Wed, 12 Oct 2022 09:41:27 -0400 +Subject: [PATCH] avcodec/openh264: Add the ability to dlopen() OpenH264 + +We can't directly depend on OpenH264, but we can weakly link to it +and gracefully expose the capability. + +Co-authored-by: Andreas Schneider +Co-authored-by: Neal Gompa + +Signed-off-by: Andreas Schneider +Signed-off-by: Neal Gompa +--- + configure | 3 + + libavcodec/Makefile | 1 + + libavcodec/libopenh264.c | 5 ++ + libavcodec/libopenh264_dlopen.c | 147 ++++++++++++++++++++++++++++++++ + libavcodec/libopenh264_dlopen.h | 58 +++++++++++++ + libavcodec/libopenh264dec.c | 10 +++ + libavcodec/libopenh264enc.c | 10 +++ + 7 files changed, 234 insertions(+) + create mode 100644 libavcodec/libopenh264_dlopen.c + create mode 100644 libavcodec/libopenh264_dlopen.h + +diff --git a/configure b/configure +index ba5793b2ff..8855c1a908 100755 +--- a/configure ++++ b/configure +@@ -251,6 +251,7 @@ External library support: + --enable-libopencore-amrwb enable AMR-WB decoding via libopencore-amrwb [no] + --enable-libopencv enable video filtering via libopencv [no] + --enable-libopenh264 enable H.264 encoding via OpenH264 [no] ++ --enable-libopenh264-dlopen enable H.264 encoding via dlopen()'ed OpenH264 [no] + --enable-libopenjpeg enable JPEG 2000 de/encoding via OpenJPEG [no] + --enable-libopenmpt enable decoding tracked files via libopenmpt [no] + --enable-libopenvino enable OpenVINO as a DNN module backend +@@ -1844,6 +1845,7 @@ EXTERNAL_LIBRARY_LIST=" + libmysofa + libopencv + libopenh264 ++ libopenh264_dlopen + libopenjpeg + libopenmpt + libopenvino +@@ -6596,6 +6598,7 @@ enabled libopencv && { check_headers opencv2/core/core_c.h && + require libopencv opencv2/core/core_c.h cvCreateImageHeader -lopencv_core -lopencv_imgproc; } || + require_pkg_config libopencv opencv opencv/cxcore.h cvCreateImageHeader; } + enabled libopenh264 && require_pkg_config libopenh264 openh264 wels/codec_api.h WelsGetCodecVersion ++enabled libopenh264_dlopen && enable libopenh264 && add_cppflags "-I$(dirname `readlink -f $0`)/ffdlopenhdrs/include -DCONFIG_LIBOPENH264_DLOPEN=1" + enabled libopenjpeg && { check_pkg_config libopenjpeg "libopenjp2 >= 2.1.0" openjpeg.h opj_version || + { require_pkg_config libopenjpeg "libopenjp2 >= 2.1.0" openjpeg.h opj_version -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } } + enabled libopenmpt && require_pkg_config libopenmpt "libopenmpt >= 0.2.6557" libopenmpt/libopenmpt.h openmpt_module_create -lstdc++ && append libopenmpt_extralibs "-lstdc++" +diff --git a/libavcodec/Makefile b/libavcodec/Makefile +index 457ec58377..08a26fba5f 100644 +--- a/libavcodec/Makefile ++++ b/libavcodec/Makefile +@@ -1075,6 +1075,7 @@ OBJS-$(CONFIG_LIBMP3LAME_ENCODER) += libmp3lame.o + OBJS-$(CONFIG_LIBOPENCORE_AMRNB_DECODER) += libopencore-amr.o + OBJS-$(CONFIG_LIBOPENCORE_AMRNB_ENCODER) += libopencore-amr.o + OBJS-$(CONFIG_LIBOPENCORE_AMRWB_DECODER) += libopencore-amr.o ++OBJS-$(CONFIG_LIBOPENH264_DLOPEN) += libopenh264_dlopen.o + OBJS-$(CONFIG_LIBOPENH264_DECODER) += libopenh264dec.o libopenh264.o + OBJS-$(CONFIG_LIBOPENH264_ENCODER) += libopenh264enc.o libopenh264.o + OBJS-$(CONFIG_LIBOPENJPEG_DECODER) += libopenjpegdec.o +diff --git a/libavcodec/libopenh264.c b/libavcodec/libopenh264.c +index c80c85ea8b..128c3d9846 100644 +--- a/libavcodec/libopenh264.c ++++ b/libavcodec/libopenh264.c +@@ -20,8 +20,13 @@ + */ + + #include ++ ++#ifdef CONFIG_LIBOPENH264_DLOPEN ++#include "libopenh264_dlopen.h" ++#else + #include + #include ++#endif + + #include "libavutil/error.h" + #include "libavutil/log.h" +diff --git a/libavcodec/libopenh264_dlopen.c b/libavcodec/libopenh264_dlopen.c +new file mode 100644 +index 0000000000..49ea8ff44f +--- /dev/null ++++ b/libavcodec/libopenh264_dlopen.c +@@ -0,0 +1,147 @@ ++/* ++ * OpenH264 dlopen code ++ * ++ * Copyright (C) 2022 Andreas Schneider ++ * ++ * 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 ++ ++#include "libopenh264_dlopen.h" ++ ++/* ++ * The symbol binding makes sure we do not run into strict aliasing issues which ++ * can lead into segfaults. ++ */ ++typedef int (*__oh264_WelsCreateSVCEncoder)(ISVCEncoder **); ++typedef void (*__oh264_WelsDestroySVCEncoder)(ISVCEncoder *); ++typedef int (*__oh264_WelsGetDecoderCapability)(SDecoderCapability *); ++typedef long (*__oh264_WelsCreateDecoder)(ISVCDecoder **); ++typedef void (*__oh264_WelsDestroyDecoder)(ISVCDecoder *); ++typedef OpenH264Version (*__oh264_WelsGetCodecVersion)(void); ++typedef void (*__oh264_WelsGetCodecVersionEx)(OpenH264Version *); ++ ++#define OH264_SYMBOL_ENTRY(i) \ ++ union { \ ++ __oh264_##i f; \ ++ void *obj; \ ++ } _oh264_##i ++ ++struct oh264_symbols { ++ OH264_SYMBOL_ENTRY(WelsCreateSVCEncoder); ++ OH264_SYMBOL_ENTRY(WelsDestroySVCEncoder); ++ OH264_SYMBOL_ENTRY(WelsGetDecoderCapability); ++ OH264_SYMBOL_ENTRY(WelsCreateDecoder); ++ OH264_SYMBOL_ENTRY(WelsDestroyDecoder); ++ OH264_SYMBOL_ENTRY(WelsGetCodecVersion); ++ OH264_SYMBOL_ENTRY(WelsGetCodecVersionEx); ++}; ++ ++/* Symbols are bound by loadLibOpenH264() */ ++static struct oh264_symbols openh264_symbols; ++ ++int oh264_WelsCreateSVCEncoder(ISVCEncoder **ppEncoder) { ++ return openh264_symbols._oh264_WelsCreateSVCEncoder.f(ppEncoder); ++} ++ ++void oh264_WelsDestroySVCEncoder(ISVCEncoder *pEncoder) { ++ return openh264_symbols._oh264_WelsDestroySVCEncoder.f(pEncoder); ++} ++ ++int oh264_WelsGetDecoderCapability(SDecoderCapability *pDecCapability) { ++ return openh264_symbols._oh264_WelsGetDecoderCapability.f(pDecCapability); ++} ++ ++long oh264_WelsCreateDecoder(ISVCDecoder **ppDecoder) { ++ return openh264_symbols._oh264_WelsCreateDecoder.f(ppDecoder); ++} ++ ++void oh264_WelsDestroyDecoder(ISVCDecoder *pDecoder) { ++ return openh264_symbols._oh264_WelsDestroyDecoder.f(pDecoder); ++} ++ ++OpenH264Version oh264_WelsGetCodecVersion(void) { ++ return openh264_symbols._oh264_WelsGetCodecVersion.f(); ++} ++ ++void oh264_WelsGetCodecVersionEx(OpenH264Version *pVersion) { ++ openh264_symbols._oh264_WelsGetCodecVersionEx.f(pVersion); ++} ++ ++static void *_oh264_bind_symbol(AVCodecContext *avctx, ++ void *handle, ++ const char *sym_name) { ++ void *sym = NULL; ++ ++ sym = dlsym(handle, sym_name); ++ if (sym == NULL) { ++ const char *err = dlerror(); ++ av_log(avctx, ++ AV_LOG_WARNING, ++ "%s: Failed to bind %s\n", ++ err, ++ sym_name); ++ return NULL; ++ } ++ ++ return sym; ++} ++ ++#define oh264_bind_symbol(avctx, handle, sym_name) \ ++ if (openh264_symbols._oh264_##sym_name.obj == NULL) { \ ++ openh264_symbols._oh264_##sym_name.obj = _oh264_bind_symbol(avctx, handle, #sym_name); \ ++ if (openh264_symbols._oh264_##sym_name.obj == NULL) { \ ++ return 1; \ ++ } \ ++ } ++ ++int loadLibOpenH264(AVCodecContext *avctx) { ++ static bool initialized = false; ++ void *libopenh264 = NULL; ++ const char *err = NULL; ++ ++ if (initialized) { ++ return 0; ++ } ++ ++#define OPENH264_LIB "libopenh264.so.7" ++ libopenh264 = dlopen(OPENH264_LIB, RTLD_LAZY); ++ err = dlerror(); ++ if (err != NULL) { ++ av_log(avctx, AV_LOG_WARNING, ++ "%s: %s is missing, openh264 support will be disabled\n", err, ++ OPENH264_LIB); ++ ++ if (libopenh264 != NULL) { ++ dlclose(libopenh264); ++ } ++ return 1; ++ } ++ ++ oh264_bind_symbol(avctx, libopenh264, WelsCreateSVCEncoder); ++ oh264_bind_symbol(avctx, libopenh264, WelsDestroySVCEncoder); ++ oh264_bind_symbol(avctx, libopenh264, WelsGetDecoderCapability); ++ oh264_bind_symbol(avctx, libopenh264, WelsCreateDecoder); ++ oh264_bind_symbol(avctx, libopenh264, WelsDestroyDecoder); ++ oh264_bind_symbol(avctx, libopenh264, WelsGetCodecVersion); ++ oh264_bind_symbol(avctx, libopenh264, WelsGetCodecVersionEx); ++ ++ initialized = true; ++ ++ return 0; ++} +diff --git a/libavcodec/libopenh264_dlopen.h b/libavcodec/libopenh264_dlopen.h +new file mode 100644 +index 0000000000..d7d8bb7cad +--- /dev/null ++++ b/libavcodec/libopenh264_dlopen.h +@@ -0,0 +1,58 @@ ++/* ++ * OpenH264 dlopen code ++ * ++ * Copyright (C) 2022 Andreas Schneider ++ * ++ * 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 ++ */ ++ ++#ifndef HAVE_LIBOPENH264_DLOPEN_H ++#define HAVE_LIBOPENH264_DLOPEN_H ++ ++#ifdef CONFIG_LIBOPENH264_DLOPEN ++ ++#include ++#include ++ ++#include "avcodec.h" ++ ++int oh264_WelsCreateSVCEncoder(ISVCEncoder **ppEncoder); ++#define WelsCreateSVCEncoder oh264_WelsCreateSVCEncoder ++ ++void oh264_WelsDestroySVCEncoder(ISVCEncoder *pEncoder); ++#define WelsDestroySVCEncoder oh264_WelsDestroySVCEncoder ++ ++int oh264_WelsGetDecoderCapability(SDecoderCapability *pDecCapability); ++#define WelsGetDecoderCapability oh264_WelsGetDecoderCapability ++ ++long oh264_WelsCreateDecoder(ISVCDecoder **ppDecoder); ++#define WelsCreateDecoder oh264_WelsCreateDecoder ++ ++void oh264_WelsDestroyDecoder(ISVCDecoder *pDecoder); ++#define WelsDestroyDecoder oh264_WelsDestroyDecoder ++ ++OpenH264Version oh264_WelsGetCodecVersion(void); ++#define WelsGetCodecVersion oh264_WelsGetCodecVersion ++ ++void oh264_WelsGetCodecVersionEx(OpenH264Version *pVersion); ++#define WelsGetCodecVersionEx oh264_WelsGetCodecVersionEx ++ ++int loadLibOpenH264(AVCodecContext *avctx); ++ ++#endif /* CONFIG_LIBOPENH264_DLOPEN */ ++ ++#endif /* HAVE_LIBOPENH264_DLOPEN_H */ +diff --git a/libavcodec/libopenh264dec.c b/libavcodec/libopenh264dec.c +index 7e14d4dd7d..a805598446 100644 +--- a/libavcodec/libopenh264dec.c ++++ b/libavcodec/libopenh264dec.c +@@ -19,8 +19,12 @@ + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + ++#ifdef CONFIG_LIBOPENH264_DLOPEN ++#include "libopenh264_dlopen.h" ++#else + #include + #include ++#endif + + #include "libavutil/common.h" + #include "libavutil/fifo.h" +@@ -55,6 +59,12 @@ static av_cold int svc_decode_init(AVCodecContext *avctx) + int log_level; + WelsTraceCallback callback_function; + ++#ifdef CONFIG_LIBOPENH264_DLOPEN ++ if (loadLibOpenH264(avctx)) { ++ return AVERROR_DECODER_NOT_FOUND; ++ } ++#endif ++ + if (WelsCreateDecoder(&s->decoder)) { + av_log(avctx, AV_LOG_ERROR, "Unable to create decoder\n"); + return AVERROR_UNKNOWN; +diff --git a/libavcodec/libopenh264enc.c b/libavcodec/libopenh264enc.c +index 5257906567..80481f3d0a 100644 +--- a/libavcodec/libopenh264enc.c ++++ b/libavcodec/libopenh264enc.c +@@ -19,8 +19,12 @@ + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + ++#ifdef CONFIG_LIBOPENH264_DLOPEN ++#include "libopenh264_dlopen.h" ++#else + #include + #include ++#endif + + #include "libavutil/attributes.h" + #include "libavutil/common.h" +@@ -114,6 +118,12 @@ static av_cold int svc_encode_init(AVCodecContext *avctx) + WelsTraceCallback callback_function; + AVCPBProperties *props; + ++#ifdef CONFIG_LIBOPENH264_DLOPEN ++ if (loadLibOpenH264(avctx)) { ++ return AVERROR_ENCODER_NOT_FOUND; ++ } ++#endif ++ + if (WelsCreateSVCEncoder(&s->encoder)) { + av_log(avctx, AV_LOG_ERROR, "Unable to create encoder\n"); + return AVERROR_UNKNOWN; +-- +2.36.1 + diff --git a/ffmpeg-ge-av1-vaapi-encode-support.patch b/ffmpeg-ge-av1-vaapi-encode-support.patch new file mode 100644 index 0000000..6ae8258 --- /dev/null +++ b/ffmpeg-ge-av1-vaapi-encode-support.patch @@ -0,0 +1,3984 @@ +From 7c2ea45053b7a3d4193bb0abb9c0f3b0cdbeec7a Mon Sep 17 00:00:00 2001 +From: GloriousEggroll +Date: Thu, 9 Nov 2023 17:51:19 -0700 +Subject: [PATCH] backport av1 encode support + +Adapted from https://patchwork.ffmpeg.org/project/ffmpeg/list/?series=9594 + +--- + configure | 3 + + doc/encoders.texi | 14 + + libavcodec/Makefile | 2 + + libavcodec/allcodecs.c | 1 + + libavcodec/av1.h | 7 + + libavcodec/av1_levels.c | 92 +++ + libavcodec/av1_levels.h | 58 ++ + libavcodec/cbs.c | 155 +++-- + libavcodec/cbs.h | 88 ++- + libavcodec/cbs_av1.c | 262 +++----- + libavcodec/cbs_av1.h | 1 + + libavcodec/cbs_av1_syntax_template.c | 4 +- + libavcodec/cbs_bsf.c | 5 + + libavcodec/cbs_h2645.c | 149 ++--- + libavcodec/cbs_internal.h | 96 ++- + libavcodec/cbs_mpeg2.c | 15 +- + libavcodec/cbs_vp9.c | 122 ++-- + libavcodec/extract_extradata_bsf.c | 7 +- + libavcodec/trace_headers_bsf.c | 2 + + libavcodec/vaapi_encode.c | 370 ++++++++--- + libavcodec/vaapi_encode.h | 39 +- + libavcodec/vaapi_encode_av1.c | 949 +++++++++++++++++++++++++++ + libavcodec/vaapi_encode_h264.c | 94 +-- + libavcodec/vaapi_encode_h265.c | 76 ++- + libavcodec/vaapi_encode_mpeg2.c | 6 +- + libavcodec/vaapi_encode_vp8.c | 6 +- + libavcodec/vaapi_encode_vp9.c | 26 +- + 27 files changed, 2054 insertions(+), 595 deletions(-) + create mode 100644 libavcodec/av1_levels.c + create mode 100644 libavcodec/av1_levels.h + create mode 100644 libavcodec/vaapi_encode_av1.c + +diff --git a/configure b/configure +index b6616f0..f5a91b6 100755 +--- a/configure ++++ b/configure +@@ -3259,6 +3259,8 @@ av1_qsv_decoder_select="qsvdec" + av1_qsv_encoder_select="qsvenc" + av1_qsv_encoder_deps="libvpl" + av1_amf_encoder_deps="amf" ++av1_vaapi_encoder_deps="VAEncPictureParameterBufferAV1" ++av1_vaapi_encoder_select="cbs_av1 vaapi_encode" + + # parsers + aac_parser_select="adts_header mpeg4audio" +@@ -6973,6 +6975,7 @@ if enabled vaapi; then + check_type "va/va.h va/va_enc_jpeg.h" "VAEncPictureParameterBufferJPEG" + check_type "va/va.h va/va_enc_vp8.h" "VAEncPictureParameterBufferVP8" + check_type "va/va.h va/va_enc_vp9.h" "VAEncPictureParameterBufferVP9" ++ check_type "va/va.h va/va_enc_av1.h" "VAEncPictureParameterBufferAV1" + fi + + if enabled_all opencl libdrm ; then +diff --git a/doc/encoders.texi b/doc/encoders.texi +index b02737b..994e27f 100644 +--- a/doc/encoders.texi ++++ b/doc/encoders.texi +@@ -3965,6 +3965,20 @@ Average variable bitrate. + Each encoder also has its own specific options: + @table @option + ++@item av1_vaapi ++@option{profile} sets the value of @emph{seq_profile}. ++@option{tier} sets the value of @emph{seq_tier}. ++@option{level} sets the value of @emph{seq_level_idx}. ++ ++@table @option ++@item tiles ++Set the number of tiles to encode the input video with, as columns x rows. ++(default is auto, which means use minimal tile column/row number). ++@item tile_groups ++Set tile groups number. All the tiles will be distributed as evenly as possible to ++each tile group. (default is 1). ++@end table ++ + @item h264_vaapi + @option{profile} sets the value of @emph{profile_idc} and the @emph{constraint_set*_flag}s. + @option{level} sets the value of @emph{level_idc}. +diff --git a/libavcodec/Makefile b/libavcodec/Makefile +index 389253f..5f620e6 100644 +--- a/libavcodec/Makefile ++++ b/libavcodec/Makefile +@@ -255,6 +255,7 @@ OBJS-$(CONFIG_AV1_CUVID_DECODER) += cuviddec.o + OBJS-$(CONFIG_AV1_MEDIACODEC_DECODER) += mediacodecdec.o + OBJS-$(CONFIG_AV1_NVENC_ENCODER) += nvenc_av1.o nvenc.o + OBJS-$(CONFIG_AV1_QSV_ENCODER) += qsvenc_av1.o ++OBJS-$(CONFIG_AV1_VAAPI_ENCODER) += vaapi_encode_av1.o av1_levels.o + OBJS-$(CONFIG_AVRN_DECODER) += avrndec.o + OBJS-$(CONFIG_AVRP_DECODER) += r210dec.o + OBJS-$(CONFIG_AVRP_ENCODER) += r210enc.o +@@ -1298,6 +1299,7 @@ TESTPROGS = avcodec \ + jpeg2000dwt \ + mathops \ + ++TESTPROGS-$(CONFIG_AV1_VAAPI_ENCODER) += av1_levels + TESTPROGS-$(CONFIG_CABAC) += cabac + TESTPROGS-$(CONFIG_DCT) += avfft + TESTPROGS-$(CONFIG_FFT) += fft fft-fixed32 +diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c +index e593ad1..4706fc3 100644 +--- a/libavcodec/allcodecs.c ++++ b/libavcodec/allcodecs.c +@@ -838,6 +838,7 @@ extern const FFCodec ff_av1_nvenc_encoder; + extern const FFCodec ff_av1_qsv_decoder; + extern const FFCodec ff_av1_qsv_encoder; + extern const FFCodec ff_av1_amf_encoder; ++extern const FFCodec ff_av1_vaapi_encoder; + extern const FFCodec ff_libopenh264_encoder; + extern const FFCodec ff_libopenh264_decoder; + extern const FFCodec ff_h264_amf_encoder; +diff --git a/libavcodec/av1.h b/libavcodec/av1.h +index 384f7cd..8704bc4 100644 +--- a/libavcodec/av1.h ++++ b/libavcodec/av1.h +@@ -175,6 +175,13 @@ enum { + AV1_RESTORE_SWITCHABLE = 3, + }; + ++// TX mode (section 6.8.21) ++enum { ++ AV1_ONLY_4X4 = 0, ++ AV1_TX_MODE_LARGEST = 1, ++ AV1_TX_MODE_SELECT = 2, ++}; ++ + // Sequence Headers are actually unbounded because one can use + // an arbitrary number of leading zeroes when encoding via uvlc. + // The following estimate is based around using the lowest number +diff --git a/libavcodec/av1_levels.c b/libavcodec/av1_levels.c +new file mode 100644 +index 0000000..19b6ee1 +--- /dev/null ++++ b/libavcodec/av1_levels.c +@@ -0,0 +1,92 @@ ++/* ++ * Copyright (c) 2023 Intel Corporation ++ * ++ * 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 ++#include "libavutil/macros.h" ++#include "av1_levels.h" ++ ++/** ignore entries which named in spec but no details. Like level 2.2 and 7.0. */ ++static const AV1LevelDescriptor av1_levels[] = { ++ // Name MaxVSize MainMbps MaxTiles ++ // | level_idx | MaxDisplayRate | HighMbps | MaxTileCols ++ // | | MaxPicSize | | MaxDecodeRate | | MainCR | | ++ // | | | MaxHSize | | | MaxHeaderRate | | | HighCR| | ++ // | | | | | | | | | | | | | | ++ { "2.0", 0, 147456, 2048, 1152, 4423680, 5529600, 150, 1.5, 0, 2, 0, 8, 4 }, ++ { "2.1", 1, 278784, 2816, 1584, 8363520, 10454400, 150, 3.0, 0, 2, 0, 8, 4 }, ++ { "3.0", 4, 665856, 4352, 2448, 19975680, 24969600, 150, 6.0, 0, 2, 0, 16, 6 }, ++ { "3.1", 5, 1065024, 5504, 3096, 31950720, 39938400, 150, 10.0, 0, 2, 0, 16, 6 }, ++ { "4.0", 8, 2359296, 6144, 3456, 70778880, 77856768, 300, 12.0, 30.0, 4, 4, 32, 8 }, ++ { "4.1", 9, 2359296, 6144, 3456, 141557760, 155713536, 300, 20.0, 50.0, 4, 4, 32, 8 }, ++ { "5.0", 12, 8912896, 8192, 4352, 267386880, 273715200, 300, 30.0, 100.0, 6, 4, 64, 8 }, ++ { "5.1", 13, 8912896, 8192, 4352, 534773760, 547430400, 300, 40.0, 160.0, 8, 4, 64, 8 }, ++ { "5.2", 14, 8912896, 8192, 4352, 1069547520, 1094860800, 300, 60.0, 240.0, 8, 4, 64, 8 }, ++ { "5.3", 15, 8912896, 8192, 4352, 1069547520, 1176502272, 300, 60.0, 240.0, 8, 4, 64, 8 }, ++ { "6.0", 16, 35651584, 16384, 8704, 1069547520, 1176502272, 300, 60.0, 240.0, 8, 4, 128, 16 }, ++ { "6.1", 17, 35651584, 16384, 8704, 2139095040, 2189721600, 300, 100.0, 480.0, 8, 4, 128, 16 }, ++ { "6.2", 18, 35651584, 16384, 8704, 4278190080, 4379443200, 300, 160.0, 800.0, 8, 4, 128, 16 }, ++ { "6.3", 19, 35651584, 16384, 8704, 4278190080, 4706009088, 300, 160.0, 800.0, 8, 4, 128, 16 }, ++}; ++ ++const AV1LevelDescriptor *ff_av1_guess_level(int64_t bitrate, ++ int tier, ++ int width, ++ int height, ++ int tiles, ++ int tile_cols, ++ float fps) ++{ ++ int pic_size; ++ uint64_t display_rate; ++ float max_br; ++ ++ pic_size = width * height; ++ display_rate = (uint64_t)pic_size * fps; ++ ++ for (int i = 0; i < FF_ARRAY_ELEMS(av1_levels); i++) { ++ const AV1LevelDescriptor *level = &av1_levels[i]; ++ // Limitation: decode rate, header rate, compress rate, etc. are not considered. ++ if (pic_size > level->max_pic_size) ++ continue; ++ if (width > level->max_h_size) ++ continue; ++ if (height > level->max_v_size) ++ continue; ++ if (display_rate > level->max_display_rate) ++ continue; ++ ++ if (tier) ++ max_br = level->high_mbps; ++ else ++ max_br = level->main_mbps; ++ if (!max_br) ++ continue; ++ if (bitrate > (int64_t)(1000000.0 * max_br)) ++ continue; ++ ++ if (tiles > level->max_tiles) ++ continue; ++ if (tile_cols > level->max_tile_cols) ++ continue; ++ return level; ++ } ++ ++ return NULL; ++} +diff --git a/libavcodec/av1_levels.h b/libavcodec/av1_levels.h +new file mode 100644 +index 0000000..164cb87 +--- /dev/null ++++ b/libavcodec/av1_levels.h +@@ -0,0 +1,58 @@ ++/* ++ * Copyright (c) 2023 Intel Corporation ++ * ++ * 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 ++ */ ++ ++#ifndef AVCODEC_AV1_LEVELS_H ++#define AVCODEC_AV1_LEVELS_H ++ ++#include ++ ++typedef struct AV1LevelDescriptor { ++ char name[4]; ++ uint8_t level_idx; ++ ++ uint32_t max_pic_size; ++ uint32_t max_h_size; ++ uint32_t max_v_size; ++ uint64_t max_display_rate; ++ uint64_t max_decode_rate; ++ ++ uint32_t max_header_rate; ++ float main_mbps; ++ float high_mbps; ++ uint32_t main_cr; ++ uint32_t high_cr; ++ uint32_t max_tiles; ++ uint32_t max_tile_cols; ++} AV1LevelDescriptor; ++ ++/** ++ * Guess the level of a stream from some parameters. ++ * ++ * Unknown parameters may be zero, in which case they will be ignored. ++ */ ++const AV1LevelDescriptor *ff_av1_guess_level(int64_t bitrate, ++ int tier, ++ int width, ++ int height, ++ int tile_rows, ++ int tile_cols, ++ float fps); ++ ++#endif /* AVCODEC_AV1_LEVELS_H */ +diff --git a/libavcodec/cbs.c b/libavcodec/cbs.c +index 504197e..64b9aee 100644 +--- a/libavcodec/cbs.c ++++ b/libavcodec/cbs.c +@@ -111,8 +111,9 @@ av_cold int ff_cbs_init(CodedBitstreamContext **ctx_ptr, + + ctx->decompose_unit_types = NULL; + +- ctx->trace_enable = 0; +- ctx->trace_level = AV_LOG_TRACE; ++ ctx->trace_enable = 0; ++ ctx->trace_level = AV_LOG_TRACE; ++ ctx->trace_context = ctx; + + *ctx_ptr = ctx; + return 0; +@@ -490,19 +491,27 @@ void ff_cbs_trace_header(CodedBitstreamContext *ctx, + av_log(ctx->log_ctx, ctx->trace_level, "%s\n", name); + } + +-void ff_cbs_trace_syntax_element(CodedBitstreamContext *ctx, int position, +- const char *str, const int *subscripts, +- const char *bits, int64_t value) ++void ff_cbs_trace_read_log(void *trace_context, ++ GetBitContext *gbc, int length, ++ const char *str, const int *subscripts, ++ int64_t value) + { ++ CodedBitstreamContext *ctx = trace_context; + char name[256]; ++ char bits[256]; + size_t name_len, bits_len; + int pad, subs, i, j, k, n; +- +- if (!ctx->trace_enable) +- return; ++ int position; + + av_assert0(value >= INT_MIN && value <= UINT32_MAX); + ++ position = get_bits_count(gbc); ++ ++ av_assert0(length < 256); ++ for (i = 0; i < length; i++) ++ bits[i] = get_bits1(gbc) ? '1' : '0'; ++ bits[length] = 0; ++ + subs = subscripts ? subscripts[0] : 0; + n = 0; + for (i = j = 0; str[i];) { +@@ -529,7 +538,7 @@ void ff_cbs_trace_syntax_element(CodedBitstreamContext *ctx, int position, + av_assert0(n == subs); + + name_len = strlen(name); +- bits_len = strlen(bits); ++ bits_len = length; + + if (name_len + bits_len > 60) + pad = bits_len + 2; +@@ -540,14 +549,48 @@ void ff_cbs_trace_syntax_element(CodedBitstreamContext *ctx, int position, + position, name, pad, bits, value); + } + +-int ff_cbs_read_unsigned(CodedBitstreamContext *ctx, GetBitContext *gbc, +- int width, const char *name, +- const int *subscripts, uint32_t *write_to, +- uint32_t range_min, uint32_t range_max) ++void ff_cbs_trace_write_log(void *trace_context, ++ PutBitContext *pbc, int length, ++ const char *str, const int *subscripts, ++ int64_t value) + { +- uint32_t value; ++ CodedBitstreamContext *ctx = trace_context; ++ ++ // Ensure that the syntax element is written to the output buffer, ++ // make a GetBitContext pointed at the start position, then call the ++ // read log function which can read the bits back to log them. ++ ++ GetBitContext gbc; + int position; + ++ if (length > 0) { ++ PutBitContext flush; ++ flush = *pbc; ++ flush_put_bits(&flush); ++ } ++ ++ position = put_bits_count(pbc); ++ av_assert0(position >= length); ++ ++ init_get_bits(&gbc, pbc->buf, position); ++ ++ skip_bits_long(&gbc, position - length); ++ ++ ff_cbs_trace_read_log(ctx, &gbc, length, str, subscripts, value); ++} ++ ++static av_always_inline int cbs_read_unsigned(CodedBitstreamContext *ctx, ++ GetBitContext *gbc, ++ int width, const char *name, ++ const int *subscripts, ++ uint32_t *write_to, ++ uint32_t range_min, ++ uint32_t range_max) ++{ ++ uint32_t value; ++ ++ CBS_TRACE_READ_START(); ++ + av_assert0(width > 0 && width <= 32); + + if (get_bits_left(gbc) < width) { +@@ -556,21 +599,9 @@ int ff_cbs_read_unsigned(CodedBitstreamContext *ctx, GetBitContext *gbc, + return AVERROR_INVALIDDATA; + } + +- if (ctx->trace_enable) +- position = get_bits_count(gbc); +- + value = get_bits_long(gbc, width); + +- if (ctx->trace_enable) { +- char bits[33]; +- int i; +- for (i = 0; i < width; i++) +- bits[i] = value >> (width - i - 1) & 1 ? '1' : '0'; +- bits[i] = 0; +- +- ff_cbs_trace_syntax_element(ctx, position, name, subscripts, +- bits, value); +- } ++ CBS_TRACE_READ_END(); + + if (value < range_min || value > range_max) { + av_log(ctx->log_ctx, AV_LOG_ERROR, "%s out of range: " +@@ -583,11 +614,29 @@ int ff_cbs_read_unsigned(CodedBitstreamContext *ctx, GetBitContext *gbc, + return 0; + } + ++int ff_cbs_read_unsigned(CodedBitstreamContext *ctx, GetBitContext *gbc, ++ int width, const char *name, ++ const int *subscripts, uint32_t *write_to, ++ uint32_t range_min, uint32_t range_max) ++{ ++ return cbs_read_unsigned(ctx, gbc, width, name, subscripts, ++ write_to, range_min, range_max); ++} ++ ++int ff_cbs_read_simple_unsigned(CodedBitstreamContext *ctx, GetBitContext *gbc, ++ int width, const char *name, uint32_t *write_to) ++{ ++ return cbs_read_unsigned(ctx, gbc, width, name, NULL, ++ write_to, 0, UINT32_MAX); ++} ++ + int ff_cbs_write_unsigned(CodedBitstreamContext *ctx, PutBitContext *pbc, + int width, const char *name, + const int *subscripts, uint32_t value, + uint32_t range_min, uint32_t range_max) + { ++ CBS_TRACE_WRITE_START(); ++ + av_assert0(width > 0 && width <= 32); + + if (value < range_min || value > range_max) { +@@ -600,32 +649,31 @@ int ff_cbs_write_unsigned(CodedBitstreamContext *ctx, PutBitContext *pbc, + if (put_bits_left(pbc) < width) + return AVERROR(ENOSPC); + +- if (ctx->trace_enable) { +- char bits[33]; +- int i; +- for (i = 0; i < width; i++) +- bits[i] = value >> (width - i - 1) & 1 ? '1' : '0'; +- bits[i] = 0; +- +- ff_cbs_trace_syntax_element(ctx, put_bits_count(pbc), +- name, subscripts, bits, value); +- } +- + if (width < 32) + put_bits(pbc, width, value); + else + put_bits32(pbc, value); + ++ CBS_TRACE_WRITE_END(); ++ + return 0; + } + ++int ff_cbs_write_simple_unsigned(CodedBitstreamContext *ctx, PutBitContext *pbc, ++ int width, const char *name, uint32_t value) ++{ ++ return ff_cbs_write_unsigned(ctx, pbc, width, name, NULL, ++ value, 0, MAX_UINT_BITS(width)); ++} ++ + int ff_cbs_read_signed(CodedBitstreamContext *ctx, GetBitContext *gbc, + int width, const char *name, + const int *subscripts, int32_t *write_to, + int32_t range_min, int32_t range_max) + { + int32_t value; +- int position; ++ ++ CBS_TRACE_READ_START(); + + av_assert0(width > 0 && width <= 32); + +@@ -635,21 +683,9 @@ int ff_cbs_read_signed(CodedBitstreamContext *ctx, GetBitContext *gbc, + return AVERROR_INVALIDDATA; + } + +- if (ctx->trace_enable) +- position = get_bits_count(gbc); +- + value = get_sbits_long(gbc, width); + +- if (ctx->trace_enable) { +- char bits[33]; +- int i; +- for (i = 0; i < width; i++) +- bits[i] = value & (1U << (width - i - 1)) ? '1' : '0'; +- bits[i] = 0; +- +- ff_cbs_trace_syntax_element(ctx, position, name, subscripts, +- bits, value); +- } ++ CBS_TRACE_READ_END(); + + if (value < range_min || value > range_max) { + av_log(ctx->log_ctx, AV_LOG_ERROR, "%s out of range: " +@@ -667,6 +703,8 @@ int ff_cbs_write_signed(CodedBitstreamContext *ctx, PutBitContext *pbc, + const int *subscripts, int32_t value, + int32_t range_min, int32_t range_max) + { ++ CBS_TRACE_WRITE_START(); ++ + av_assert0(width > 0 && width <= 32); + + if (value < range_min || value > range_max) { +@@ -679,22 +717,13 @@ int ff_cbs_write_signed(CodedBitstreamContext *ctx, PutBitContext *pbc, + if (put_bits_left(pbc) < width) + return AVERROR(ENOSPC); + +- if (ctx->trace_enable) { +- char bits[33]; +- int i; +- for (i = 0; i < width; i++) +- bits[i] = value & (1U << (width - i - 1)) ? '1' : '0'; +- bits[i] = 0; +- +- ff_cbs_trace_syntax_element(ctx, put_bits_count(pbc), +- name, subscripts, bits, value); +- } +- + if (width < 32) + put_sbits(pbc, width, value); + else + put_bits32(pbc, value); + ++ CBS_TRACE_WRITE_END(); ++ + return 0; + } + +diff --git a/libavcodec/cbs.h b/libavcodec/cbs.h +index ee21623..f6509a2 100644 +--- a/libavcodec/cbs.h ++++ b/libavcodec/cbs.h +@@ -167,6 +167,51 @@ typedef struct CodedBitstreamFragment { + CodedBitstreamUnit *units; + } CodedBitstreamFragment; + ++ ++struct CodedBitstreamContext; ++struct GetBitContext; ++struct PutBitContext; ++ ++/** ++ * Callback type for read tracing. ++ * ++ * @param ctx User-set trace context. ++ * @param gbc A GetBitContext set at the start of the syntax ++ * element. This is a copy, the callee does not ++ * need to preserve it. ++ * @param length Length in bits of the syntax element. ++ * @param name String name of the syntax elements. ++ * @param subscripts If the syntax element is an array, a pointer to ++ * an array of subscripts into the array. ++ * @param value Parsed value of the syntax element. ++ */ ++typedef void (*CBSTraceReadCallback)(void *trace_context, ++ struct GetBitContext *gbc, ++ int start_position, ++ const char *name, ++ const int *subscripts, ++ int64_t value); ++ ++/** ++ * Callback type for write tracing. ++ * ++ * @param ctx User-set trace context. ++ * @param pbc A PutBitContext set at the end of the syntax ++ * element. The user must not modify this, but may ++ * inspect it to determine state. ++ * @param length Length in bits of the syntax element. ++ * @param name String name of the syntax elements. ++ * @param subscripts If the syntax element is an array, a pointer to ++ * an array of subscripts into the array. ++ * @param value Written value of the syntax element. ++ */ ++typedef void (*CBSTraceWriteCallback)(void *trace_context, ++ struct PutBitContext *pbc, ++ int start_position, ++ const char *name, ++ const int *subscripts, ++ int64_t value); ++ + /** + * Context structure for coded bitstream operations. + */ +@@ -210,11 +255,29 @@ typedef struct CodedBitstreamContext { + */ + int trace_enable; + /** +- * Log level to use for trace output. ++ * Log level to use for default trace output. + * + * From AV_LOG_*; defaults to AV_LOG_TRACE. + */ + int trace_level; ++ /** ++ * User context pointer to pass to trace callbacks. ++ */ ++ void *trace_context; ++ /** ++ * Callback for read tracing. ++ * ++ * If tracing is enabled then this is called once for each syntax ++ * element parsed. ++ */ ++ CBSTraceReadCallback trace_read_callback; ++ /** ++ * Callback for write tracing. ++ * ++ * If tracing is enabled then this is called once for each syntax ++ * element written. ++ */ ++ CBSTraceWriteCallback trace_write_callback; + + /** + * Write buffer. Used as intermediate buffer when writing units. +@@ -433,4 +496,27 @@ int ff_cbs_make_unit_writable(CodedBitstreamContext *ctx, + CodedBitstreamUnit *unit); + + ++ ++/** ++ * Helper function for read tracing which formats the syntax element ++ * and logs the result. ++ * ++ * Trace context should be set to the CodedBitstreamContext. ++ */ ++void ff_cbs_trace_read_log(void *trace_context, ++ struct GetBitContext *gbc, int length, ++ const char *str, const int *subscripts, ++ int64_t value); ++ ++/** ++ * Helper function for write tracing which formats the syntax element ++ * and logs the result. ++ * ++ * Trace context should be set to the CodedBitstreamContext. ++ */ ++void ff_cbs_trace_write_log(void *trace_context, ++ struct PutBitContext *pbc, int length, ++ const char *str, const int *subscripts, ++ int64_t value); ++ + #endif /* AVCODEC_CBS_H */ +diff --git a/libavcodec/cbs_av1.c b/libavcodec/cbs_av1.c +index 45e1288..6098c97 100644 +--- a/libavcodec/cbs_av1.c ++++ b/libavcodec/cbs_av1.c +@@ -31,10 +31,8 @@ static int cbs_av1_read_uvlc(CodedBitstreamContext *ctx, GetBitContext *gbc, + uint32_t range_min, uint32_t range_max) + { + uint32_t zeroes, bits_value, value; +- int position; + +- if (ctx->trace_enable) +- position = get_bits_count(gbc); ++ CBS_TRACE_READ_START(); + + zeroes = 0; + while (1) { +@@ -50,6 +48,9 @@ static int cbs_av1_read_uvlc(CodedBitstreamContext *ctx, GetBitContext *gbc, + } + + if (zeroes >= 32) { ++ // Note that the spec allows an arbitrarily large number of ++ // zero bits followed by a one bit in this case, but the ++ // libaom implementation does not support it. + value = MAX_UINT_BITS(32); + } else { + if (get_bits_left(gbc) < zeroes) { +@@ -62,36 +63,7 @@ static int cbs_av1_read_uvlc(CodedBitstreamContext *ctx, GetBitContext *gbc, + value = bits_value + (UINT32_C(1) << zeroes) - 1; + } + +- if (ctx->trace_enable) { +- char bits[65]; +- int i, j, k; +- +- if (zeroes >= 32) { +- while (zeroes > 32) { +- k = FFMIN(zeroes - 32, 32); +- for (i = 0; i < k; i++) +- bits[i] = '0'; +- bits[i] = 0; +- ff_cbs_trace_syntax_element(ctx, position, name, +- NULL, bits, 0); +- zeroes -= k; +- position += k; +- } +- } +- +- for (i = 0; i < zeroes; i++) +- bits[i] = '0'; +- bits[i++] = '1'; +- +- if (zeroes < 32) { +- for (j = 0; j < zeroes; j++) +- bits[i++] = (bits_value >> (zeroes - j - 1) & 1) ? '1' : '0'; +- } +- +- bits[i] = 0; +- ff_cbs_trace_syntax_element(ctx, position, name, +- NULL, bits, value); +- } ++ CBS_TRACE_READ_END_NO_SUBSCRIPTS(); + + if (value < range_min || value > range_max) { + av_log(ctx->log_ctx, AV_LOG_ERROR, "%s out of range: " +@@ -109,7 +81,9 @@ static int cbs_av1_write_uvlc(CodedBitstreamContext *ctx, PutBitContext *pbc, + uint32_t range_min, uint32_t range_max) + { + uint32_t v; +- int position, zeroes; ++ int zeroes; ++ ++ CBS_TRACE_WRITE_START(); + + if (value < range_min || value > range_max) { + av_log(ctx->log_ctx, AV_LOG_ERROR, "%s out of range: " +@@ -118,28 +92,17 @@ static int cbs_av1_write_uvlc(CodedBitstreamContext *ctx, PutBitContext *pbc, + return AVERROR_INVALIDDATA; + } + +- if (ctx->trace_enable) +- position = put_bits_count(pbc); +- + zeroes = av_log2(value + 1); + v = value - (1U << zeroes) + 1; ++ ++ if (put_bits_left(pbc) < 2 * zeroes + 1) ++ return AVERROR(ENOSPC); ++ + put_bits(pbc, zeroes, 0); + put_bits(pbc, 1, 1); + put_bits(pbc, zeroes, v); + +- if (ctx->trace_enable) { +- char bits[65]; +- int i, j; +- i = 0; +- for (j = 0; j < zeroes; j++) +- bits[i++] = '0'; +- bits[i++] = '1'; +- for (j = 0; j < zeroes; j++) +- bits[i++] = (v >> (zeroes - j - 1) & 1) ? '1' : '0'; +- bits[i++] = 0; +- ff_cbs_trace_syntax_element(ctx, position, name, NULL, +- bits, value); +- } ++ CBS_TRACE_WRITE_END_NO_SUBSCRIPTS(); + + return 0; + } +@@ -148,20 +111,19 @@ static int cbs_av1_read_leb128(CodedBitstreamContext *ctx, GetBitContext *gbc, + const char *name, uint64_t *write_to) + { + uint64_t value; +- int position, err, i; ++ uint32_t byte; ++ int i; + +- if (ctx->trace_enable) +- position = get_bits_count(gbc); ++ CBS_TRACE_READ_START(); + + value = 0; + for (i = 0; i < 8; i++) { +- int subscript[2] = { 1, i }; +- uint32_t byte; +- err = ff_cbs_read_unsigned(ctx, gbc, 8, "leb128_byte[i]", subscript, +- &byte, 0x00, 0xff); +- if (err < 0) +- return err; +- ++ if (get_bits_left(gbc) < 8) { ++ av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid leb128 at " ++ "%s: bitstream ended.\n", name); ++ return AVERROR_INVALIDDATA; ++ } ++ byte = get_bits(gbc, 8); + value |= (uint64_t)(byte & 0x7f) << (i * 7); + if (!(byte & 0x80)) + break; +@@ -170,39 +132,38 @@ static int cbs_av1_read_leb128(CodedBitstreamContext *ctx, GetBitContext *gbc, + if (value > UINT32_MAX) + return AVERROR_INVALIDDATA; + +- if (ctx->trace_enable) +- ff_cbs_trace_syntax_element(ctx, position, name, NULL, "", value); ++ CBS_TRACE_READ_END_NO_SUBSCRIPTS(); + + *write_to = value; + return 0; + } + ++/** Minimum byte length will be used to indicate the len128 of value if byte_len is 0. */ + static int cbs_av1_write_leb128(CodedBitstreamContext *ctx, PutBitContext *pbc, +- const char *name, uint64_t value) ++ const char *name, uint64_t value, uint8_t byte_len) + { +- int position, err, len, i; ++ int len, i; + uint8_t byte; + +- len = (av_log2(value) + 7) / 7; ++ CBS_TRACE_WRITE_START(); ++ ++ if (byte_len) ++ av_assert0(byte_len >= (av_log2(value) + 7) / 7); + +- if (ctx->trace_enable) +- position = put_bits_count(pbc); ++ len = byte_len ? byte_len : (av_log2(value) + 7) / 7; + + for (i = 0; i < len; i++) { +- int subscript[2] = { 1, i }; ++ if (put_bits_left(pbc) < 8) ++ return AVERROR(ENOSPC); + + byte = value >> (7 * i) & 0x7f; + if (i < len - 1) + byte |= 0x80; + +- err = ff_cbs_write_unsigned(ctx, pbc, 8, "leb128_byte[i]", subscript, +- byte, 0x00, 0xff); +- if (err < 0) +- return err; ++ put_bits(pbc, 8, byte); + } + +- if (ctx->trace_enable) +- ff_cbs_trace_syntax_element(ctx, position, name, NULL, "", value); ++ CBS_TRACE_WRITE_END_NO_SUBSCRIPTS(); + + return 0; + } +@@ -212,12 +173,11 @@ static int cbs_av1_read_ns(CodedBitstreamContext *ctx, GetBitContext *gbc, + const int *subscripts, uint32_t *write_to) + { + uint32_t m, v, extra_bit, value; +- int position, w; ++ int w; + +- av_assert0(n > 0); ++ CBS_TRACE_READ_START(); + +- if (ctx->trace_enable) +- position = get_bits_count(gbc); ++ av_assert0(n > 0); + + w = av_log2(n) + 1; + m = (1 << w) - n; +@@ -240,18 +200,7 @@ static int cbs_av1_read_ns(CodedBitstreamContext *ctx, GetBitContext *gbc, + value = (v << 1) - m + extra_bit; + } + +- if (ctx->trace_enable) { +- char bits[33]; +- int i; +- for (i = 0; i < w - 1; i++) +- bits[i] = (v >> i & 1) ? '1' : '0'; +- if (v >= m) +- bits[i++] = extra_bit ? '1' : '0'; +- bits[i] = 0; +- +- ff_cbs_trace_syntax_element(ctx, position, +- name, subscripts, bits, value); +- } ++ CBS_TRACE_READ_END(); + + *write_to = value; + return 0; +@@ -262,7 +211,8 @@ static int cbs_av1_write_ns(CodedBitstreamContext *ctx, PutBitContext *pbc, + const int *subscripts, uint32_t value) + { + uint32_t w, m, v, extra_bit; +- int position; ++ ++ CBS_TRACE_WRITE_START(); + + if (value > n) { + av_log(ctx->log_ctx, AV_LOG_ERROR, "%s out of range: " +@@ -271,9 +221,6 @@ static int cbs_av1_write_ns(CodedBitstreamContext *ctx, PutBitContext *pbc, + return AVERROR_INVALIDDATA; + } + +- if (ctx->trace_enable) +- position = put_bits_count(pbc); +- + w = av_log2(n) + 1; + m = (1 << w) - n; + +@@ -290,18 +237,7 @@ static int cbs_av1_write_ns(CodedBitstreamContext *ctx, PutBitContext *pbc, + put_bits(pbc, 1, extra_bit); + } + +- if (ctx->trace_enable) { +- char bits[33]; +- int i; +- for (i = 0; i < w - 1; i++) +- bits[i] = (v >> i & 1) ? '1' : '0'; +- if (value >= m) +- bits[i++] = extra_bit ? '1' : '0'; +- bits[i] = 0; +- +- ff_cbs_trace_syntax_element(ctx, position, +- name, subscripts, bits, value); +- } ++ CBS_TRACE_WRITE_END(); + + return 0; + } +@@ -311,33 +247,24 @@ static int cbs_av1_read_increment(CodedBitstreamContext *ctx, GetBitContext *gbc + const char *name, uint32_t *write_to) + { + uint32_t value; +- int position, i; +- char bits[33]; + +- av_assert0(range_min <= range_max && range_max - range_min < sizeof(bits) - 1); +- if (ctx->trace_enable) +- position = get_bits_count(gbc); ++ CBS_TRACE_READ_START(); ++ ++ av_assert0(range_min <= range_max && range_max - range_min < 32); + +- for (i = 0, value = range_min; value < range_max;) { ++ for (value = range_min; value < range_max;) { + if (get_bits_left(gbc) < 1) { + av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid increment value at " + "%s: bitstream ended.\n", name); + return AVERROR_INVALIDDATA; + } +- if (get_bits1(gbc)) { +- bits[i++] = '1'; ++ if (get_bits1(gbc)) + ++value; +- } else { +- bits[i++] = '0'; ++ else + break; +- } + } + +- if (ctx->trace_enable) { +- bits[i] = 0; +- ff_cbs_trace_syntax_element(ctx, position, +- name, NULL, bits, value); +- } ++ CBS_TRACE_READ_END_NO_SUBSCRIPTS(); + + *write_to = value; + return 0; +@@ -349,6 +276,8 @@ static int cbs_av1_write_increment(CodedBitstreamContext *ctx, PutBitContext *pb + { + int len; + ++ CBS_TRACE_WRITE_START(); ++ + av_assert0(range_min <= range_max && range_max - range_min < 32); + if (value < range_min || value > range_max) { + av_log(ctx->log_ctx, AV_LOG_ERROR, "%s out of range: " +@@ -364,23 +293,11 @@ static int cbs_av1_write_increment(CodedBitstreamContext *ctx, PutBitContext *pb + if (put_bits_left(pbc) < len) + return AVERROR(ENOSPC); + +- if (ctx->trace_enable) { +- char bits[33]; +- int i; +- for (i = 0; i < len; i++) { +- if (range_min + i == value) +- bits[i] = '0'; +- else +- bits[i] = '1'; +- } +- bits[i] = 0; +- ff_cbs_trace_syntax_element(ctx, put_bits_count(pbc), +- name, NULL, bits, value); +- } +- + if (len > 0) + put_bits(pbc, len, (1 << len) - 1 - (value != range_max)); + ++ CBS_TRACE_WRITE_END_NO_SUBSCRIPTS(); ++ + return 0; + } + +@@ -388,12 +305,10 @@ static int cbs_av1_read_subexp(CodedBitstreamContext *ctx, GetBitContext *gbc, + uint32_t range_max, const char *name, + const int *subscripts, uint32_t *write_to) + { +- uint32_t value; +- int position, err; +- uint32_t max_len, len, range_offset, range_bits; ++ uint32_t value, max_len, len, range_offset, range_bits; ++ int err; + +- if (ctx->trace_enable) +- position = get_bits_count(gbc); ++ CBS_TRACE_READ_START(); + + av_assert0(range_max > 0); + max_len = av_log2(range_max - 1) - 3; +@@ -412,9 +327,8 @@ static int cbs_av1_read_subexp(CodedBitstreamContext *ctx, GetBitContext *gbc, + } + + if (len < max_len) { +- err = ff_cbs_read_unsigned(ctx, gbc, range_bits, +- "subexp_bits", NULL, &value, +- 0, MAX_UINT_BITS(range_bits)); ++ err = ff_cbs_read_simple_unsigned(ctx, gbc, range_bits, ++ "subexp_bits", &value); + if (err < 0) + return err; + +@@ -426,9 +340,7 @@ static int cbs_av1_read_subexp(CodedBitstreamContext *ctx, GetBitContext *gbc, + } + value += range_offset; + +- if (ctx->trace_enable) +- ff_cbs_trace_syntax_element(ctx, position, +- name, subscripts, "", value); ++ CBS_TRACE_READ_END_VALUE_ONLY(); + + *write_to = value; + return err; +@@ -438,9 +350,11 @@ static int cbs_av1_write_subexp(CodedBitstreamContext *ctx, PutBitContext *pbc, + uint32_t range_max, const char *name, + const int *subscripts, uint32_t value) + { +- int position, err; ++ int err; + uint32_t max_len, len, range_offset, range_bits; + ++ CBS_TRACE_WRITE_START(); ++ + if (value > range_max) { + av_log(ctx->log_ctx, AV_LOG_ERROR, "%s out of range: " + "%"PRIu32", but must be in [0,%"PRIu32"].\n", +@@ -448,9 +362,6 @@ static int cbs_av1_write_subexp(CodedBitstreamContext *ctx, PutBitContext *pbc, + return AVERROR_INVALIDDATA; + } + +- if (ctx->trace_enable) +- position = put_bits_count(pbc); +- + av_assert0(range_max > 0); + max_len = av_log2(range_max - 1) - 3; + +@@ -476,10 +387,9 @@ static int cbs_av1_write_subexp(CodedBitstreamContext *ctx, PutBitContext *pbc, + return err; + + if (len < max_len) { +- err = ff_cbs_write_unsigned(ctx, pbc, range_bits, +- "subexp_bits", NULL, +- value - range_offset, +- 0, MAX_UINT_BITS(range_bits)); ++ err = ff_cbs_write_simple_unsigned(ctx, pbc, range_bits, ++ "subexp_bits", ++ value - range_offset); + if (err < 0) + return err; + +@@ -491,9 +401,7 @@ static int cbs_av1_write_subexp(CodedBitstreamContext *ctx, PutBitContext *pbc, + return err; + } + +- if (ctx->trace_enable) +- ff_cbs_trace_syntax_element(ctx, position, +- name, subscripts, "", value); ++ CBS_TRACE_WRITE_END_VALUE_ONLY(); + + return err; + } +@@ -546,8 +454,6 @@ static size_t cbs_av1_get_payload_bytes_left(GetBitContext *gbc) + + #define SUBSCRIPTS(subs, ...) (subs > 0 ? ((int[subs + 1]){ subs, __VA_ARGS__ }) : NULL) + +-#define fb(width, name) \ +- xf(width, name, current->name, 0, MAX_UINT_BITS(width), 0, ) + #define fc(width, name, range_min, range_max) \ + xf(width, name, current->name, range_min, range_max, 0, ) + #define flag(name) fb(1, name) +@@ -573,6 +479,13 @@ static size_t cbs_av1_get_payload_bytes_left(GetBitContext *gbc) + #define READWRITE read + #define RWContext GetBitContext + ++#define fb(width, name) do { \ ++ uint32_t value; \ ++ CHECK(ff_cbs_read_simple_unsigned(ctx, rw, width, \ ++ #name, &value)); \ ++ current->name = value; \ ++ } while (0) ++ + #define xf(width, name, var, range_min, range_max, subs, ...) do { \ + uint32_t value; \ + CHECK(ff_cbs_read_unsigned(ctx, rw, width, #name, \ +@@ -645,6 +558,7 @@ static size_t cbs_av1_get_payload_bytes_left(GetBitContext *gbc) + #undef READ + #undef READWRITE + #undef RWContext ++#undef fb + #undef xf + #undef xsu + #undef uvlc +@@ -661,6 +575,11 @@ static size_t cbs_av1_get_payload_bytes_left(GetBitContext *gbc) + #define READWRITE write + #define RWContext PutBitContext + ++#define fb(width, name) do { \ ++ CHECK(ff_cbs_write_simple_unsigned(ctx, rw, width, #name, \ ++ current->name)); \ ++ } while (0) ++ + #define xf(width, name, var, range_min, range_max, subs, ...) do { \ + CHECK(ff_cbs_write_unsigned(ctx, rw, width, #name, \ + SUBSCRIPTS(subs, __VA_ARGS__), \ +@@ -703,7 +622,7 @@ static size_t cbs_av1_get_payload_bytes_left(GetBitContext *gbc) + } while (0) + + #define leb128(name) do { \ +- CHECK(cbs_av1_write_leb128(ctx, rw, #name, current->name)); \ ++ CHECK(cbs_av1_write_leb128(ctx, rw, #name, current->name, 0)); \ + } while (0) + + #define infer(name, value) do { \ +@@ -723,6 +642,7 @@ static size_t cbs_av1_get_payload_bytes_left(GetBitContext *gbc) + #undef WRITE + #undef READWRITE + #undef RWContext ++#undef fb + #undef xf + #undef xsu + #undef uvlc +@@ -1086,9 +1006,14 @@ static int cbs_av1_write_obu(CodedBitstreamContext *ctx, + + if (obu->header.obu_has_size_field) { + pbc_tmp = *pbc; +- // Add space for the size field to fill later. +- put_bits32(pbc, 0); +- put_bits32(pbc, 0); ++ if (obu->obu_size_byte_len) { ++ for (int i = 0; i < obu->obu_size_byte_len; i++) ++ put_bits(pbc, 8, 0); ++ } else { ++ // Add space for the size field to fill later. ++ put_bits32(pbc, 0); ++ put_bits32(pbc, 0); ++ } + } + + td = NULL; +@@ -1208,7 +1133,7 @@ static int cbs_av1_write_obu(CodedBitstreamContext *ctx, + end_pos /= 8; + + *pbc = pbc_tmp; +- err = cbs_av1_write_leb128(ctx, pbc, "obu_size", obu->obu_size); ++ err = cbs_av1_write_leb128(ctx, pbc, "obu_size", obu->obu_size, obu->obu_size_byte_len); + if (err < 0) + goto error; + +@@ -1225,8 +1150,11 @@ static int cbs_av1_write_obu(CodedBitstreamContext *ctx, + } + + if (obu->obu_size > 0) { +- memmove(pbc->buf + data_pos, +- pbc->buf + start_pos, header_size); ++ if (!obu->obu_size_byte_len) { ++ obu->obu_size_byte_len = start_pos - data_pos; ++ memmove(pbc->buf + data_pos, ++ pbc->buf + start_pos, header_size); ++ } + skip_put_bytes(pbc, header_size); + + if (td) { +diff --git a/libavcodec/cbs_av1.h b/libavcodec/cbs_av1.h +index 1fc80dc..c5dae3c 100644 +--- a/libavcodec/cbs_av1.h ++++ b/libavcodec/cbs_av1.h +@@ -392,6 +392,7 @@ typedef struct AV1RawOBU { + AV1RawOBUHeader header; + + size_t obu_size; ++ uint8_t obu_size_byte_len; + + union { + AV1RawSequenceHeader sequence_header; +diff --git a/libavcodec/cbs_av1_syntax_template.c b/libavcodec/cbs_av1_syntax_template.c +index e95925a..cf2e259 100644 +--- a/libavcodec/cbs_av1_syntax_template.c ++++ b/libavcodec/cbs_av1_syntax_template.c +@@ -1018,9 +1018,9 @@ static int FUNC(read_tx_mode)(CodedBitstreamContext *ctx, RWContext *rw, + int err; + + if (priv->coded_lossless) +- infer(tx_mode, 0); ++ infer(tx_mode, AV1_ONLY_4X4); + else +- increment(tx_mode, 1, 2); ++ increment(tx_mode, AV1_TX_MODE_LARGEST, AV1_TX_MODE_SELECT); + + return 0; + } +diff --git a/libavcodec/cbs_bsf.c b/libavcodec/cbs_bsf.c +index 069f6e9..b252854 100644 +--- a/libavcodec/cbs_bsf.c ++++ b/libavcodec/cbs_bsf.c +@@ -123,6 +123,11 @@ int ff_cbs_bsf_generic_init(AVBSFContext *bsf, const CBSBSFType *type) + if (err < 0) + return err; + ++ ctx->output->trace_enable = 1; ++ ctx->output->trace_level = AV_LOG_TRACE; ++ ctx->output->trace_context = ctx->output; ++ ctx->output->trace_write_callback = ff_cbs_trace_write_log; ++ + if (bsf->par_in->extradata) { + err = ff_cbs_read_extradata(ctx->input, frag, bsf->par_in); + if (err < 0) { +diff --git a/libavcodec/cbs_h2645.c b/libavcodec/cbs_h2645.c +index 80e4882..355f4d5 100644 +--- a/libavcodec/cbs_h2645.c ++++ b/libavcodec/cbs_h2645.c +@@ -34,41 +34,38 @@ static int cbs_read_ue_golomb(CodedBitstreamContext *ctx, GetBitContext *gbc, + uint32_t *write_to, + uint32_t range_min, uint32_t range_max) + { +- uint32_t value; +- int position, i, j; +- unsigned int k; +- char bits[65]; ++ uint32_t leading_bits, value; ++ int max_length, leading_zeroes; + +- position = get_bits_count(gbc); ++ CBS_TRACE_READ_START(); + +- for (i = 0; i < 32; i++) { +- if (get_bits_left(gbc) < i + 1) { ++ max_length = FFMIN(get_bits_left(gbc), 32); ++ ++ leading_bits = show_bits_long(gbc, max_length); ++ if (leading_bits == 0) { ++ if (max_length >= 32) { ++ av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid ue-golomb code at " ++ "%s: more than 31 zeroes.\n", name); ++ return AVERROR_INVALIDDATA; ++ } else { + av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid ue-golomb code at " + "%s: bitstream ended.\n", name); + return AVERROR_INVALIDDATA; + } +- k = get_bits1(gbc); +- bits[i] = k ? '1' : '0'; +- if (k) +- break; + } +- if (i >= 32) { ++ ++ leading_zeroes = max_length - 1 - av_log2(leading_bits); ++ skip_bits_long(gbc, leading_zeroes); ++ ++ if (get_bits_left(gbc) < leading_zeroes + 1) { + av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid ue-golomb code at " +- "%s: more than 31 zeroes.\n", name); ++ "%s: bitstream ended.\n", name); + return AVERROR_INVALIDDATA; + } +- value = 1; +- for (j = 0; j < i; j++) { +- k = get_bits1(gbc); +- bits[i + j + 1] = k ? '1' : '0'; +- value = value << 1 | k; +- } +- bits[i + j + 1] = 0; +- --value; + +- if (ctx->trace_enable) +- ff_cbs_trace_syntax_element(ctx, position, name, subscripts, +- bits, value); ++ value = get_bits_long(gbc, leading_zeroes + 1) - 1; ++ ++ CBS_TRACE_READ_END(); + + if (value < range_min || value > range_max) { + av_log(ctx->log_ctx, AV_LOG_ERROR, "%s out of range: " +@@ -86,45 +83,44 @@ static int cbs_read_se_golomb(CodedBitstreamContext *ctx, GetBitContext *gbc, + int32_t *write_to, + int32_t range_min, int32_t range_max) + { ++ uint32_t leading_bits, unsigned_value; ++ int max_length, leading_zeroes; + int32_t value; +- int position, i, j; +- unsigned int k; +- uint32_t v; +- char bits[65]; + +- position = get_bits_count(gbc); ++ CBS_TRACE_READ_START(); + +- for (i = 0; i < 32; i++) { +- if (get_bits_left(gbc) < i + 1) { ++ max_length = FFMIN(get_bits_left(gbc), 32); ++ ++ leading_bits = show_bits_long(gbc, max_length); ++ if (leading_bits == 0) { ++ if (max_length >= 32) { ++ av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid se-golomb code at " ++ "%s: more than 31 zeroes.\n", name); ++ return AVERROR_INVALIDDATA; ++ } else { + av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid se-golomb code at " + "%s: bitstream ended.\n", name); + return AVERROR_INVALIDDATA; + } +- k = get_bits1(gbc); +- bits[i] = k ? '1' : '0'; +- if (k) +- break; + } +- if (i >= 32) { ++ ++ leading_zeroes = max_length - 1 - av_log2(leading_bits); ++ skip_bits_long(gbc, leading_zeroes); ++ ++ if (get_bits_left(gbc) < leading_zeroes + 1) { + av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid se-golomb code at " +- "%s: more than 31 zeroes.\n", name); ++ "%s: bitstream ended.\n", name); + return AVERROR_INVALIDDATA; + } +- v = 1; +- for (j = 0; j < i; j++) { +- k = get_bits1(gbc); +- bits[i + j + 1] = k ? '1' : '0'; +- v = v << 1 | k; +- } +- bits[i + j + 1] = 0; +- if (v & 1) +- value = -(int32_t)(v / 2); ++ ++ unsigned_value = get_bits_long(gbc, leading_zeroes + 1); ++ ++ if (unsigned_value & 1) ++ value = -(int32_t)(unsigned_value / 2); + else +- value = v / 2; ++ value = unsigned_value / 2; + +- if (ctx->trace_enable) +- ff_cbs_trace_syntax_element(ctx, position, name, subscripts, +- bits, value); ++ CBS_TRACE_READ_END(); + + if (value < range_min || value > range_max) { + av_log(ctx->log_ctx, AV_LOG_ERROR, "%s out of range: " +@@ -144,6 +140,8 @@ static int cbs_write_ue_golomb(CodedBitstreamContext *ctx, PutBitContext *pbc, + { + int len; + ++ CBS_TRACE_WRITE_START(); ++ + if (value < range_min || value > range_max) { + av_log(ctx->log_ctx, AV_LOG_ERROR, "%s out of range: " + "%"PRIu32", but must be in [%"PRIu32",%"PRIu32"].\n", +@@ -156,27 +154,14 @@ static int cbs_write_ue_golomb(CodedBitstreamContext *ctx, PutBitContext *pbc, + if (put_bits_left(pbc) < 2 * len + 1) + return AVERROR(ENOSPC); + +- if (ctx->trace_enable) { +- char bits[65]; +- int i; +- +- for (i = 0; i < len; i++) +- bits[i] = '0'; +- bits[len] = '1'; +- for (i = 0; i < len; i++) +- bits[len + i + 1] = (value + 1) >> (len - i - 1) & 1 ? '1' : '0'; +- bits[len + len + 1] = 0; +- +- ff_cbs_trace_syntax_element(ctx, put_bits_count(pbc), +- name, subscripts, bits, value); +- } +- + put_bits(pbc, len, 0); + if (len + 1 < 32) + put_bits(pbc, len + 1, value + 1); + else + put_bits32(pbc, value + 1); + ++ CBS_TRACE_WRITE_END(); ++ + return 0; + } + +@@ -188,6 +173,8 @@ static int cbs_write_se_golomb(CodedBitstreamContext *ctx, PutBitContext *pbc, + int len; + uint32_t uvalue; + ++ CBS_TRACE_WRITE_START(); ++ + if (value < range_min || value > range_max) { + av_log(ctx->log_ctx, AV_LOG_ERROR, "%s out of range: " + "%"PRId32", but must be in [%"PRId32",%"PRId32"].\n", +@@ -207,27 +194,14 @@ static int cbs_write_se_golomb(CodedBitstreamContext *ctx, PutBitContext *pbc, + if (put_bits_left(pbc) < 2 * len + 1) + return AVERROR(ENOSPC); + +- if (ctx->trace_enable) { +- char bits[65]; +- int i; +- +- for (i = 0; i < len; i++) +- bits[i] = '0'; +- bits[len] = '1'; +- for (i = 0; i < len; i++) +- bits[len + i + 1] = (uvalue + 1) >> (len - i - 1) & 1 ? '1' : '0'; +- bits[len + len + 1] = 0; +- +- ff_cbs_trace_syntax_element(ctx, put_bits_count(pbc), +- name, subscripts, bits, value); +- } +- + put_bits(pbc, len, 0); + if (len + 1 < 32) + put_bits(pbc, len + 1, uvalue + 1); + else + put_bits32(pbc, uvalue + 1); + ++ CBS_TRACE_WRITE_END(); ++ + return 0; + } + +@@ -261,8 +235,6 @@ static int cbs_h265_payload_extension_present(GetBitContext *gbc, uint32_t paylo + + #define u(width, name, range_min, range_max) \ + xu(width, name, current->name, range_min, range_max, 0, ) +-#define ub(width, name) \ +- xu(width, name, current->name, 0, MAX_UINT_BITS(width), 0, ) + #define flag(name) ub(1, name) + #define ue(name, range_min, range_max) \ + xue(name, current->name, range_min, range_max, 0, ) +@@ -298,6 +270,12 @@ static int cbs_h265_payload_extension_present(GetBitContext *gbc, uint32_t paylo + #define READWRITE read + #define RWContext GetBitContext + ++#define ub(width, name) do { \ ++ uint32_t value; \ ++ CHECK(ff_cbs_read_simple_unsigned(ctx, rw, width, #name, \ ++ &value)); \ ++ current->name = value; \ ++ } while (0) + #define xu(width, name, var, range_min, range_max, subs, ...) do { \ + uint32_t value; \ + CHECK(ff_cbs_read_unsigned(ctx, rw, width, #name, \ +@@ -372,6 +350,7 @@ static int cbs_h2645_read_more_rbsp_data(GetBitContext *gbc) + #undef READ + #undef READWRITE + #undef RWContext ++#undef ub + #undef xu + #undef xi + #undef xue +@@ -387,6 +366,11 @@ static int cbs_h2645_read_more_rbsp_data(GetBitContext *gbc) + #define READWRITE write + #define RWContext PutBitContext + ++#define ub(width, name) do { \ ++ uint32_t value = current->name; \ ++ CHECK(ff_cbs_write_simple_unsigned(ctx, rw, width, #name, \ ++ value)); \ ++ } while (0) + #define xu(width, name, var, range_min, range_max, subs, ...) do { \ + uint32_t value = var; \ + CHECK(ff_cbs_write_unsigned(ctx, rw, width, #name, \ +@@ -450,6 +434,7 @@ static int cbs_h2645_read_more_rbsp_data(GetBitContext *gbc) + #undef WRITE + #undef READWRITE + #undef RWContext ++#undef ub + #undef xu + #undef xi + #undef xue +diff --git a/libavcodec/cbs_internal.h b/libavcodec/cbs_internal.h +index e585c77..60e31eb 100644 +--- a/libavcodec/cbs_internal.h ++++ b/libavcodec/cbs_internal.h +@@ -151,24 +151,29 @@ typedef struct CodedBitstreamType { + void ff_cbs_trace_header(CodedBitstreamContext *ctx, + const char *name); + +-void ff_cbs_trace_syntax_element(CodedBitstreamContext *ctx, int position, +- const char *name, const int *subscripts, +- const char *bitstring, int64_t value); +- + + // Helper functions for read/write of common bitstream elements, including +-// generation of trace output. ++// generation of trace output. The simple functions are equivalent to ++// their non-simple counterparts except that their range is unrestricted ++// (i.e. only limited by the amount of bits used) and they lack ++// the ability to use subscripts. + + int ff_cbs_read_unsigned(CodedBitstreamContext *ctx, GetBitContext *gbc, + int width, const char *name, + const int *subscripts, uint32_t *write_to, + uint32_t range_min, uint32_t range_max); + ++int ff_cbs_read_simple_unsigned(CodedBitstreamContext *ctx, GetBitContext *gbc, ++ int width, const char *name, uint32_t *write_to); ++ + int ff_cbs_write_unsigned(CodedBitstreamContext *ctx, PutBitContext *pbc, + int width, const char *name, + const int *subscripts, uint32_t value, + uint32_t range_min, uint32_t range_max); + ++int ff_cbs_write_simple_unsigned(CodedBitstreamContext *ctx, PutBitContext *pbc, ++ int width, const char *name, uint32_t value); ++ + int ff_cbs_read_signed(CodedBitstreamContext *ctx, GetBitContext *gbc, + int width, const char *name, + const int *subscripts, int32_t *write_to, +@@ -191,6 +196,87 @@ int ff_cbs_write_signed(CodedBitstreamContext *ctx, PutBitContext *pbc, + // range_min in the above functions. + #define MIN_INT_BITS(length) (-(INT64_C(1) << ((length) - 1))) + ++ ++// Start of a syntax element during read tracing. ++#define CBS_TRACE_READ_START() \ ++ GetBitContext trace_start; \ ++ do { \ ++ if (ctx->trace_enable) \ ++ trace_start = *gbc; \ ++ } while (0) ++ ++// End of a syntax element for tracing, make callback. ++#define CBS_TRACE_READ_END() \ ++ do { \ ++ if (ctx->trace_enable) { \ ++ int start_position = get_bits_count(&trace_start); \ ++ int end_position = get_bits_count(gbc); \ ++ av_assert0(start_position <= end_position); \ ++ ctx->trace_read_callback(ctx->trace_context, &trace_start, \ ++ end_position - start_position, \ ++ name, subscripts, value); \ ++ } \ ++ } while (0) ++ ++// End of a syntax element with no subscript entries. ++#define CBS_TRACE_READ_END_NO_SUBSCRIPTS() \ ++ do { \ ++ const int *subscripts = NULL; \ ++ CBS_TRACE_READ_END(); \ ++ } while (0) ++ ++// End of a syntax element which is made up of subelements which ++// are aleady traced, so we are only showing the value. ++#define CBS_TRACE_READ_END_VALUE_ONLY() \ ++ do { \ ++ if (ctx->trace_enable) { \ ++ ctx->trace_read_callback(ctx->trace_context, &trace_start, 0, \ ++ name, subscripts, value); \ ++ } \ ++ } while (0) ++ ++// Start of a syntax element during write tracing. ++#define CBS_TRACE_WRITE_START() \ ++ int start_position; \ ++ do { \ ++ if (ctx->trace_enable) \ ++ start_position = put_bits_count(pbc);; \ ++ } while (0) ++ ++// End of a syntax element for tracing, make callback. ++#define CBS_TRACE_WRITE_END() \ ++ do { \ ++ if (ctx->trace_enable) { \ ++ int end_position = put_bits_count(pbc); \ ++ av_assert0(start_position <= end_position); \ ++ ctx->trace_write_callback(ctx->trace_context, pbc, \ ++ end_position - start_position, \ ++ name, subscripts, value); \ ++ } \ ++ } while (0) ++ ++// End of a syntax element with no subscript entries. ++#define CBS_TRACE_WRITE_END_NO_SUBSCRIPTS() \ ++ do { \ ++ const int *subscripts = NULL; \ ++ CBS_TRACE_WRITE_END(); \ ++ } while (0) ++ ++// End of a syntax element which is made up of subelements which are ++// aleady traced, so we are only showing the value. This forges a ++// PutBitContext to point to the position of the start of the syntax ++// element, but the other state doesn't matter because length is zero. ++#define CBS_TRACE_WRITE_END_VALUE_ONLY() \ ++ do { \ ++ if (ctx->trace_enable) { \ ++ PutBitContext tmp; \ ++ init_put_bits(&tmp, pbc->buf, start_position); \ ++ skip_put_bits(&tmp, start_position); \ ++ ctx->trace_write_callback(ctx->trace_context, &tmp, 0, \ ++ name, subscripts, value); \ ++ } \ ++ } while (0) ++ + #define TYPE_LIST(...) { __VA_ARGS__ } + #define CBS_UNIT_TYPE_POD(type_, structure) { \ + .nb_unit_types = 1, \ +diff --git a/libavcodec/cbs_mpeg2.c b/libavcodec/cbs_mpeg2.c +index 04b0c7f..37fc28a 100644 +--- a/libavcodec/cbs_mpeg2.c ++++ b/libavcodec/cbs_mpeg2.c +@@ -40,8 +40,6 @@ + + #define SUBSCRIPTS(subs, ...) (subs > 0 ? ((int[subs + 1]){ subs, __VA_ARGS__ }) : NULL) + +-#define ui(width, name) \ +- xui(width, name, current->name, 0, MAX_UINT_BITS(width), 0, ) + #define uir(width, name) \ + xui(width, name, current->name, 1, MAX_UINT_BITS(width), 0, ) + #define uis(width, name, subs, ...) \ +@@ -65,6 +63,12 @@ + #define READWRITE read + #define RWContext GetBitContext + ++#define ui(width, name) do { \ ++ uint32_t value; \ ++ CHECK(ff_cbs_read_simple_unsigned(ctx, rw, width, #name, \ ++ &value)); \ ++ current->name = value; \ ++ } while (0) + #define xuia(width, string, var, range_min, range_max, subs, ...) do { \ + uint32_t value; \ + CHECK(ff_cbs_read_unsigned(ctx, rw, width, string, \ +@@ -95,6 +99,7 @@ + #undef READ + #undef READWRITE + #undef RWContext ++#undef ui + #undef xuia + #undef xsi + #undef nextbits +@@ -105,6 +110,11 @@ + #define READWRITE write + #define RWContext PutBitContext + ++#define ui(width, name) do { \ ++ CHECK(ff_cbs_write_simple_unsigned(ctx, rw, width, #name, \ ++ current->name)); \ ++ } while (0) ++ + #define xuia(width, string, var, range_min, range_max, subs, ...) do { \ + CHECK(ff_cbs_write_unsigned(ctx, rw, width, string, \ + SUBSCRIPTS(subs, __VA_ARGS__), \ +@@ -134,6 +144,7 @@ + #undef WRITE + #undef READWRITE + #undef RWContext ++#undef ui + #undef xuia + #undef xsi + #undef nextbits +diff --git a/libavcodec/cbs_vp9.c b/libavcodec/cbs_vp9.c +index 184fdca..816d06d 100644 +--- a/libavcodec/cbs_vp9.c ++++ b/libavcodec/cbs_vp9.c +@@ -28,11 +28,10 @@ static int cbs_vp9_read_s(CodedBitstreamContext *ctx, GetBitContext *gbc, + const int *subscripts, int32_t *write_to) + { + uint32_t magnitude; +- int position, sign; ++ int sign; + int32_t value; + +- if (ctx->trace_enable) +- position = get_bits_count(gbc); ++ CBS_TRACE_READ_START(); + + if (get_bits_left(gbc) < width + 1) { + av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid signed value at " +@@ -44,17 +43,7 @@ static int cbs_vp9_read_s(CodedBitstreamContext *ctx, GetBitContext *gbc, + sign = get_bits1(gbc); + value = sign ? -(int32_t)magnitude : magnitude; + +- if (ctx->trace_enable) { +- char bits[33]; +- int i; +- for (i = 0; i < width; i++) +- bits[i] = magnitude >> (width - i - 1) & 1 ? '1' : '0'; +- bits[i] = sign ? '1' : '0'; +- bits[i + 1] = 0; +- +- ff_cbs_trace_syntax_element(ctx, position, name, subscripts, +- bits, value); +- } ++ CBS_TRACE_READ_END(); + + *write_to = value; + return 0; +@@ -67,27 +56,19 @@ static int cbs_vp9_write_s(CodedBitstreamContext *ctx, PutBitContext *pbc, + uint32_t magnitude; + int sign; + ++ CBS_TRACE_WRITE_START(); ++ + if (put_bits_left(pbc) < width + 1) + return AVERROR(ENOSPC); + + sign = value < 0; + magnitude = sign ? -value : value; + +- if (ctx->trace_enable) { +- char bits[33]; +- int i; +- for (i = 0; i < width; i++) +- bits[i] = magnitude >> (width - i - 1) & 1 ? '1' : '0'; +- bits[i] = sign ? '1' : '0'; +- bits[i + 1] = 0; +- +- ff_cbs_trace_syntax_element(ctx, put_bits_count(pbc), +- name, subscripts, bits, value); +- } +- + put_bits(pbc, width, magnitude); + put_bits(pbc, 1, sign); + ++ CBS_TRACE_WRITE_END(); ++ + return 0; + } + +@@ -96,32 +77,24 @@ static int cbs_vp9_read_increment(CodedBitstreamContext *ctx, GetBitContext *gbc + const char *name, uint32_t *write_to) + { + uint32_t value; +- int position, i; +- char bits[8]; + +- av_assert0(range_min <= range_max && range_max - range_min < sizeof(bits) - 1); +- if (ctx->trace_enable) +- position = get_bits_count(gbc); ++ CBS_TRACE_READ_START(); ++ ++ av_assert0(range_min <= range_max && range_max - range_min < 32); + +- for (i = 0, value = range_min; value < range_max;) { ++ for (value = range_min; value < range_max;) { + if (get_bits_left(gbc) < 1) { + av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid increment value at " + "%s: bitstream ended.\n", name); + return AVERROR_INVALIDDATA; + } +- if (get_bits1(gbc)) { +- bits[i++] = '1'; ++ if (get_bits1(gbc)) + ++value; +- } else { +- bits[i++] = '0'; ++ else + break; +- } + } + +- if (ctx->trace_enable) { +- bits[i] = 0; +- ff_cbs_trace_syntax_element(ctx, position, name, NULL, bits, value); +- } ++ CBS_TRACE_READ_END_NO_SUBSCRIPTS(); + + *write_to = value; + return 0; +@@ -133,6 +106,8 @@ static int cbs_vp9_write_increment(CodedBitstreamContext *ctx, PutBitContext *pb + { + int len; + ++ CBS_TRACE_WRITE_START(); ++ + av_assert0(range_min <= range_max && range_max - range_min < 8); + if (value < range_min || value > range_max) { + av_log(ctx->log_ctx, AV_LOG_ERROR, "%s out of range: " +@@ -148,23 +123,11 @@ static int cbs_vp9_write_increment(CodedBitstreamContext *ctx, PutBitContext *pb + if (put_bits_left(pbc) < len) + return AVERROR(ENOSPC); + +- if (ctx->trace_enable) { +- char bits[8]; +- int i; +- for (i = 0; i < len; i++) { +- if (range_min + i == value) +- bits[i] = '0'; +- else +- bits[i] = '1'; +- } +- bits[i] = 0; +- ff_cbs_trace_syntax_element(ctx, put_bits_count(pbc), +- name, NULL, bits, value); +- } +- + if (len > 0) + put_bits(pbc, len, (1 << len) - 1 - (value != range_max)); + ++ CBS_TRACE_WRITE_END_NO_SUBSCRIPTS(); ++ + return 0; + } + +@@ -173,12 +136,11 @@ static int cbs_vp9_read_le(CodedBitstreamContext *ctx, GetBitContext *gbc, + const int *subscripts, uint32_t *write_to) + { + uint32_t value; +- int position, b; ++ int b; + +- av_assert0(width % 8 == 0); ++ CBS_TRACE_READ_START(); + +- if (ctx->trace_enable) +- position = get_bits_count(gbc); ++ av_assert0(width % 8 == 0); + + if (get_bits_left(gbc) < width) { + av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid le value at " +@@ -190,17 +152,7 @@ static int cbs_vp9_read_le(CodedBitstreamContext *ctx, GetBitContext *gbc, + for (b = 0; b < width; b += 8) + value |= get_bits(gbc, 8) << b; + +- if (ctx->trace_enable) { +- char bits[33]; +- int i; +- for (b = 0; b < width; b += 8) +- for (i = 0; i < 8; i++) +- bits[b + i] = value >> (b + i) & 1 ? '1' : '0'; +- bits[b] = 0; +- +- ff_cbs_trace_syntax_element(ctx, position, name, subscripts, +- bits, value); +- } ++ CBS_TRACE_READ_END(); + + *write_to = value; + return 0; +@@ -212,26 +164,18 @@ static int cbs_vp9_write_le(CodedBitstreamContext *ctx, PutBitContext *pbc, + { + int b; + ++ CBS_TRACE_WRITE_START(); ++ + av_assert0(width % 8 == 0); + + if (put_bits_left(pbc) < width) + return AVERROR(ENOSPC); + +- if (ctx->trace_enable) { +- char bits[33]; +- int i; +- for (b = 0; b < width; b += 8) +- for (i = 0; i < 8; i++) +- bits[b + i] = value >> (b + i) & 1 ? '1' : '0'; +- bits[b] = 0; +- +- ff_cbs_trace_syntax_element(ctx, put_bits_count(pbc), +- name, subscripts, bits, value); +- } +- + for (b = 0; b < width; b += 8) + put_bits(pbc, 8, value >> b & 0xff); + ++ CBS_TRACE_WRITE_END(); ++ + return 0; + } + +@@ -251,8 +195,6 @@ static int cbs_vp9_write_le(CodedBitstreamContext *ctx, PutBitContext *pbc, + + #define SUBSCRIPTS(subs, ...) (subs > 0 ? ((int[subs + 1]){ subs, __VA_ARGS__ }) : NULL) + +-#define f(width, name) \ +- xf(width, name, current->name, 0, ) + #define s(width, name) \ + xs(width, name, current->name, 0, ) + #define fs(width, name, subs, ...) \ +@@ -264,6 +206,12 @@ static int cbs_vp9_write_le(CodedBitstreamContext *ctx, PutBitContext *pbc, + #define READWRITE read + #define RWContext GetBitContext + ++#define f(width, name) do { \ ++ uint32_t value; \ ++ CHECK(ff_cbs_read_simple_unsigned(ctx, rw, width, #name, \ ++ &value)); \ ++ current->name = value; \ ++ } while (0) + #define xf(width, name, var, subs, ...) do { \ + uint32_t value; \ + CHECK(ff_cbs_read_unsigned(ctx, rw, width, #name, \ +@@ -329,6 +277,7 @@ static int cbs_vp9_write_le(CodedBitstreamContext *ctx, PutBitContext *pbc, + #undef READ + #undef READWRITE + #undef RWContext ++#undef f + #undef xf + #undef xs + #undef increment +@@ -344,6 +293,10 @@ static int cbs_vp9_write_le(CodedBitstreamContext *ctx, PutBitContext *pbc, + #define READWRITE write + #define RWContext PutBitContext + ++#define f(width, name) do { \ ++ CHECK(ff_cbs_write_simple_unsigned(ctx, rw, width, #name, \ ++ current->name)); \ ++ } while (0) + #define xf(width, name, var, subs, ...) do { \ + CHECK(ff_cbs_write_unsigned(ctx, rw, width, #name, \ + SUBSCRIPTS(subs, __VA_ARGS__), \ +@@ -396,6 +349,7 @@ static int cbs_vp9_write_le(CodedBitstreamContext *ctx, PutBitContext *pbc, + #undef WRITE + #undef READWRITE + #undef RWContext ++#undef f + #undef xf + #undef xs + #undef increment +diff --git a/libavcodec/extract_extradata_bsf.c b/libavcodec/extract_extradata_bsf.c +index 329b1a6..7eedb16 100644 +--- a/libavcodec/extract_extradata_bsf.c ++++ b/libavcodec/extract_extradata_bsf.c +@@ -48,10 +48,9 @@ typedef struct ExtractExtradataContext { + int remove; + } ExtractExtradataContext; + +-static int val_in_array(const int *arr, int len, int val) ++static int val_in_array(const int *arr, size_t len, int val) + { +- int i; +- for (i = 0; i < len; i++) ++ for (size_t i = 0; i < len; i++) + if (arr[i] == val) + return 1; + return 0; +@@ -145,7 +144,7 @@ static int extract_extradata_h2645(AVBSFContext *ctx, AVPacket *pkt, + + int extradata_size = 0, filtered_size = 0; + const int *extradata_nal_types; +- int nb_extradata_nal_types; ++ size_t nb_extradata_nal_types; + int i, has_sps = 0, has_vps = 0, ret = 0; + + if (ctx->par_in->codec_id == AV_CODEC_ID_HEVC) { +diff --git a/libavcodec/trace_headers_bsf.c b/libavcodec/trace_headers_bsf.c +index 028b0a1..8781f5f 100644 +--- a/libavcodec/trace_headers_bsf.c ++++ b/libavcodec/trace_headers_bsf.c +@@ -44,6 +44,8 @@ static int trace_headers_init(AVBSFContext *bsf) + + ctx->cbc->trace_enable = 1; + ctx->cbc->trace_level = AV_LOG_INFO; ++ ctx->cbc->trace_context = ctx->cbc; ++ ctx->cbc->trace_read_callback = ff_cbs_trace_read_log; + + if (bsf->par_in->extradata) { + CodedBitstreamFragment *frag = &ctx->fragment; +diff --git a/libavcodec/vaapi_encode.c b/libavcodec/vaapi_encode.c +index bfca315..f5bf5ab 100644 +--- a/libavcodec/vaapi_encode.c ++++ b/libavcodec/vaapi_encode.c +@@ -276,21 +276,34 @@ static int vaapi_encode_issue(AVCodecContext *avctx, + av_log(avctx, AV_LOG_DEBUG, "Issuing encode for pic %"PRId64"/%"PRId64" " + "as type %s.\n", pic->display_order, pic->encode_order, + picture_type_name[pic->type]); +- if (pic->nb_refs == 0) { ++ if (pic->nb_refs[0] == 0 && pic->nb_refs[1] == 0) { + av_log(avctx, AV_LOG_DEBUG, "No reference pictures.\n"); + } else { +- av_log(avctx, AV_LOG_DEBUG, "Refers to:"); +- for (i = 0; i < pic->nb_refs; i++) { ++ av_log(avctx, AV_LOG_DEBUG, "L0 refers to"); ++ for (i = 0; i < pic->nb_refs[0]; i++) { + av_log(avctx, AV_LOG_DEBUG, " %"PRId64"/%"PRId64, +- pic->refs[i]->display_order, pic->refs[i]->encode_order); ++ pic->refs[0][i]->display_order, pic->refs[0][i]->encode_order); + } + av_log(avctx, AV_LOG_DEBUG, ".\n"); ++ ++ if (pic->nb_refs[1]) { ++ av_log(avctx, AV_LOG_DEBUG, "L1 refers to"); ++ for (i = 0; i < pic->nb_refs[1]; i++) { ++ av_log(avctx, AV_LOG_DEBUG, " %"PRId64"/%"PRId64, ++ pic->refs[1][i]->display_order, pic->refs[1][i]->encode_order); ++ } ++ av_log(avctx, AV_LOG_DEBUG, ".\n"); ++ } + } + + av_assert0(!pic->encode_issued); +- for (i = 0; i < pic->nb_refs; i++) { +- av_assert0(pic->refs[i]); +- av_assert0(pic->refs[i]->encode_issued); ++ for (i = 0; i < pic->nb_refs[0]; i++) { ++ av_assert0(pic->refs[0][i]); ++ av_assert0(pic->refs[0][i]->encode_issued); ++ } ++ for (i = 0; i < pic->nb_refs[1]; i++) { ++ av_assert0(pic->refs[1][i]); ++ av_assert0(pic->refs[1][i]->encode_issued); + } + + av_log(avctx, AV_LOG_DEBUG, "Input surface is %#x.\n", pic->input_surface); +@@ -650,79 +663,200 @@ fail_at_end: + return err; + } + +-static int vaapi_encode_output(AVCodecContext *avctx, +- VAAPIEncodePicture *pic, AVPacket *pkt) ++static int vaapi_encode_set_output_property(AVCodecContext *avctx, ++ VAAPIEncodePicture *pic, ++ AVPacket *pkt) ++{ ++ VAAPIEncodeContext *ctx = avctx->priv_data; ++ ++ if (pic->type == PICTURE_TYPE_IDR) ++ pkt->flags |= AV_PKT_FLAG_KEY; ++ ++ pkt->pts = pic->pts; ++ pkt->duration = pic->duration; ++ ++ // for no-delay encoders this is handled in generic codec ++ if (avctx->codec->capabilities & AV_CODEC_CAP_DELAY && ++ avctx->flags & AV_CODEC_FLAG_COPY_OPAQUE) { ++ pkt->opaque = pic->opaque; ++ pkt->opaque_ref = pic->opaque_ref; ++ pic->opaque_ref = NULL; ++ } ++ ++ if (ctx->codec->flags & FLAG_TIMESTAMP_NO_DELAY) { ++ pkt->dts = pkt->pts; ++ return 0; ++ } ++ ++ if (ctx->output_delay == 0) { ++ pkt->dts = pkt->pts; ++ } else if (pic->encode_order < ctx->decode_delay) { ++ if (ctx->ts_ring[pic->encode_order] < INT64_MIN + ctx->dts_pts_diff) ++ pkt->dts = INT64_MIN; ++ else ++ pkt->dts = ctx->ts_ring[pic->encode_order] - ctx->dts_pts_diff; ++ } else { ++ pkt->dts = ctx->ts_ring[(pic->encode_order - ctx->decode_delay) % ++ (3 * ctx->output_delay + ctx->async_depth)]; ++ } ++ ++ return 0; ++} ++ ++static int vaapi_encode_get_coded_buffer_size(AVCodecContext *avctx, VABufferID buf_id) + { + VAAPIEncodeContext *ctx = avctx->priv_data; + VACodedBufferSegment *buf_list, *buf; ++ int size = 0; + VAStatus vas; +- int total_size = 0; +- uint8_t *ptr; + int err; + +- err = vaapi_encode_wait(avctx, pic); +- if (err < 0) +- return err; +- +- buf_list = NULL; +- vas = vaMapBuffer(ctx->hwctx->display, pic->output_buffer, ++ vas = vaMapBuffer(ctx->hwctx->display, buf_id, + (void**)&buf_list); + if (vas != VA_STATUS_SUCCESS) { + av_log(avctx, AV_LOG_ERROR, "Failed to map output buffers: " + "%d (%s).\n", vas, vaErrorStr(vas)); + err = AVERROR(EIO); +- goto fail; ++ return err; + } + + for (buf = buf_list; buf; buf = buf->next) +- total_size += buf->size; ++ size += buf->size; + +- err = ff_get_encode_buffer(avctx, pkt, total_size, 0); +- ptr = pkt->data; ++ vas = vaUnmapBuffer(ctx->hwctx->display, buf_id); ++ if (vas != VA_STATUS_SUCCESS) { ++ av_log(avctx, AV_LOG_ERROR, "Failed to unmap output buffers: " ++ "%d (%s).\n", vas, vaErrorStr(vas)); ++ err = AVERROR(EIO); ++ return err; ++ } + +- if (err < 0) +- goto fail_mapped; ++ return size; ++} ++ ++static int vaapi_encode_get_coded_buffer_data(AVCodecContext *avctx, ++ VABufferID buf_id, uint8_t **dst) ++{ ++ VAAPIEncodeContext *ctx = avctx->priv_data; ++ VACodedBufferSegment *buf_list, *buf; ++ VAStatus vas; ++ int err; ++ ++ vas = vaMapBuffer(ctx->hwctx->display, buf_id, ++ (void**)&buf_list); ++ if (vas != VA_STATUS_SUCCESS) { ++ av_log(avctx, AV_LOG_ERROR, "Failed to map output buffers: " ++ "%d (%s).\n", vas, vaErrorStr(vas)); ++ err = AVERROR(EIO); ++ return err; ++ } + + for (buf = buf_list; buf; buf = buf->next) { + av_log(avctx, AV_LOG_DEBUG, "Output buffer: %u bytes " + "(status %08x).\n", buf->size, buf->status); + +- memcpy(ptr, buf->buf, buf->size); +- ptr += buf->size; ++ memcpy(*dst, buf->buf, buf->size); ++ *dst += buf->size; + } + +- if (pic->type == PICTURE_TYPE_IDR) +- pkt->flags |= AV_PKT_FLAG_KEY; +- +- pkt->pts = pic->pts; +- pkt->duration = pic->duration; +- +- vas = vaUnmapBuffer(ctx->hwctx->display, pic->output_buffer); ++ vas = vaUnmapBuffer(ctx->hwctx->display, buf_id); + if (vas != VA_STATUS_SUCCESS) { + av_log(avctx, AV_LOG_ERROR, "Failed to unmap output buffers: " + "%d (%s).\n", vas, vaErrorStr(vas)); + err = AVERROR(EIO); +- goto fail; ++ return err; + } + +- // for no-delay encoders this is handled in generic codec +- if (avctx->codec->capabilities & AV_CODEC_CAP_DELAY && +- avctx->flags & AV_CODEC_FLAG_COPY_OPAQUE) { +- pkt->opaque = pic->opaque; +- pkt->opaque_ref = pic->opaque_ref; +- pic->opaque_ref = NULL; ++ return 0; ++} ++ ++static int vaapi_encode_get_coded_data(AVCodecContext *avctx, ++ VAAPIEncodePicture *pic, AVPacket *pkt) ++{ ++ VAAPIEncodeContext *ctx = avctx->priv_data; ++ VABufferID output_buffer_prev; ++ int total_size = 0; ++ uint8_t *ptr; ++ int ret; ++ ++ if (ctx->coded_buffer_ref) { ++ output_buffer_prev = (VABufferID)(uintptr_t)ctx->coded_buffer_ref->data; ++ ret = vaapi_encode_get_coded_buffer_size(avctx, output_buffer_prev); ++ if (ret < 0) ++ goto end; ++ total_size += ret; ++ } ++ ++ ret = vaapi_encode_get_coded_buffer_size(avctx, pic->output_buffer); ++ if (ret < 0) ++ goto end; ++ total_size += ret; ++ ++ ret = ff_get_encode_buffer(avctx, pkt, total_size, 0); ++ if (ret < 0) ++ goto end; ++ ptr = pkt->data; ++ ++ if (ctx->coded_buffer_ref) { ++ ret = vaapi_encode_get_coded_buffer_data(avctx, output_buffer_prev, &ptr); ++ if (ret < 0) ++ goto end; + } + ++ ret = vaapi_encode_get_coded_buffer_data(avctx, pic->output_buffer, &ptr); ++ if (ret < 0) ++ goto end; ++ ++end: ++ if (ctx->coded_buffer_ref) { ++ av_buffer_unref(&ctx->coded_buffer_ref); ++ } + av_buffer_unref(&pic->output_buffer_ref); + pic->output_buffer = VA_INVALID_ID; + ++ return ret; ++} ++ ++static int vaapi_encode_output(AVCodecContext *avctx, ++ VAAPIEncodePicture *pic, AVPacket *pkt) ++{ ++ VAAPIEncodeContext *ctx = avctx->priv_data; ++ AVPacket *pkt_ptr = pkt; ++ int err; ++ ++ err = vaapi_encode_wait(avctx, pic); ++ if (err < 0) ++ return err; ++ ++ if (pic->non_independent_frame) { ++ av_assert0(!ctx->coded_buffer_ref); ++ ctx->coded_buffer_ref = av_buffer_ref(pic->output_buffer_ref); ++ ++ if (pic->tail_size) { ++ if (ctx->tail_pkt->size) { ++ err = AVERROR(AVERROR_BUG); ++ goto end; ++ } ++ ++ err = ff_get_encode_buffer(avctx, ctx->tail_pkt, pic->tail_size, 0); ++ if (err < 0) ++ goto end; ++ ++ memcpy(ctx->tail_pkt->data, pic->tail_data, pic->tail_size); ++ pkt_ptr = ctx->tail_pkt; ++ } ++ } else { ++ err = vaapi_encode_get_coded_data(avctx, pic, pkt); ++ if (err < 0) ++ goto end; ++ } ++ + av_log(avctx, AV_LOG_DEBUG, "Output read for pic %"PRId64"/%"PRId64".\n", + pic->display_order, pic->encode_order); +- return 0; + +-fail_mapped: +- vaUnmapBuffer(ctx->hwctx->display, pic->output_buffer); +-fail: ++ vaapi_encode_set_output_property(avctx, pic, pkt_ptr); ++ ++end: + av_buffer_unref(&pic->output_buffer_ref); + pic->output_buffer = VA_INVALID_ID; + return err; +@@ -811,8 +945,12 @@ static void vaapi_encode_add_ref(AVCodecContext *avctx, + + if (is_ref) { + av_assert0(pic != target); +- av_assert0(pic->nb_refs < MAX_PICTURE_REFERENCES); +- pic->refs[pic->nb_refs++] = target; ++ av_assert0(pic->nb_refs[0] < MAX_PICTURE_REFERENCES && ++ pic->nb_refs[1] < MAX_PICTURE_REFERENCES); ++ if (target->display_order < pic->display_order) ++ pic->refs[0][pic->nb_refs[0]++] = target; ++ else ++ pic->refs[1][pic->nb_refs[1]++] = target; + ++refs; + } + +@@ -841,10 +979,16 @@ static void vaapi_encode_remove_refs(AVCodecContext *avctx, + if (pic->ref_removed[level]) + return; + +- for (i = 0; i < pic->nb_refs; i++) { +- av_assert0(pic->refs[i]); +- --pic->refs[i]->ref_count[level]; +- av_assert0(pic->refs[i]->ref_count[level] >= 0); ++ for (i = 0; i < pic->nb_refs[0]; i++) { ++ av_assert0(pic->refs[0][i]); ++ --pic->refs[0][i]->ref_count[level]; ++ av_assert0(pic->refs[0][i]->ref_count[level] >= 0); ++ } ++ ++ for (i = 0; i < pic->nb_refs[1]; i++) { ++ av_assert0(pic->refs[1][i]); ++ --pic->refs[1][i]->ref_count[level]; ++ av_assert0(pic->refs[1][i]->ref_count[level] >= 0); + } + + for (i = 0; i < pic->nb_dpb_pics; i++) { +@@ -889,7 +1033,7 @@ static void vaapi_encode_set_b_pictures(AVCodecContext *avctx, + vaapi_encode_add_ref(avctx, pic, end, 1, 1, 0); + vaapi_encode_add_ref(avctx, pic, prev, 0, 0, 1); + +- for (ref = end->refs[1]; ref; ref = ref->refs[1]) ++ for (ref = end->refs[1][0]; ref; ref = ref->refs[1][0]) + vaapi_encode_add_ref(avctx, pic, ref, 0, 1, 0); + } + *last = prev; +@@ -912,7 +1056,7 @@ static void vaapi_encode_set_b_pictures(AVCodecContext *avctx, + vaapi_encode_add_ref(avctx, pic, end, 1, 1, 0); + vaapi_encode_add_ref(avctx, pic, prev, 0, 0, 1); + +- for (ref = end->refs[1]; ref; ref = ref->refs[1]) ++ for (ref = end->refs[1][0]; ref; ref = ref->refs[1][0]) + vaapi_encode_add_ref(avctx, pic, ref, 0, 1, 0); + + if (i > 1) +@@ -926,11 +1070,44 @@ static void vaapi_encode_set_b_pictures(AVCodecContext *avctx, + } + } + ++static void vaapi_encode_add_next_prev(AVCodecContext *avctx, ++ VAAPIEncodePicture *pic) ++{ ++ VAAPIEncodeContext *ctx = avctx->priv_data; ++ int i; ++ ++ if (!pic) ++ return; ++ ++ if (pic->type == PICTURE_TYPE_IDR) { ++ for (i = 0; i < ctx->nb_next_prev; i++) { ++ --ctx->next_prev[i]->ref_count[0]; ++ ctx->next_prev[i] = NULL; ++ } ++ ctx->next_prev[0] = pic; ++ ++pic->ref_count[0]; ++ ctx->nb_next_prev = 1; ++ ++ return; ++ } ++ ++ if (ctx->nb_next_prev < MAX_PICTURE_REFERENCES) { ++ ctx->next_prev[ctx->nb_next_prev++] = pic; ++ ++pic->ref_count[0]; ++ } else { ++ --ctx->next_prev[0]->ref_count[0]; ++ for (i = 0; i < MAX_PICTURE_REFERENCES - 1; i++) ++ ctx->next_prev[i] = ctx->next_prev[i + 1]; ++ ctx->next_prev[i] = pic; ++ ++pic->ref_count[0]; ++ } ++} ++ + static int vaapi_encode_pick_next(AVCodecContext *avctx, + VAAPIEncodePicture **pic_out) + { + VAAPIEncodeContext *ctx = avctx->priv_data; +- VAAPIEncodePicture *pic = NULL, *next, *start; ++ VAAPIEncodePicture *pic = NULL, *prev = NULL, *next, *start; + int i, b_counter, closed_gop_end; + + // If there are any B-frames already queued, the next one to encode +@@ -941,11 +1118,18 @@ static int vaapi_encode_pick_next(AVCodecContext *avctx, + continue; + if (pic->type != PICTURE_TYPE_B) + continue; +- for (i = 0; i < pic->nb_refs; i++) { +- if (!pic->refs[i]->encode_issued) ++ for (i = 0; i < pic->nb_refs[0]; i++) { ++ if (!pic->refs[0][i]->encode_issued) ++ break; ++ } ++ if (i != pic->nb_refs[0]) ++ continue; ++ ++ for (i = 0; i < pic->nb_refs[1]; i++) { ++ if (!pic->refs[1][i]->encode_issued) + break; + } +- if (i == pic->nb_refs) ++ if (i == pic->nb_refs[1]) + break; + } + +@@ -1044,21 +1228,30 @@ static int vaapi_encode_pick_next(AVCodecContext *avctx, + + vaapi_encode_add_ref(avctx, pic, pic, 0, 1, 0); + if (pic->type != PICTURE_TYPE_IDR) { +- vaapi_encode_add_ref(avctx, pic, start, +- pic->type == PICTURE_TYPE_P, +- b_counter > 0, 0); +- vaapi_encode_add_ref(avctx, pic, ctx->next_prev, 0, 0, 1); ++ // TODO: apply both previous and forward multi reference for all vaapi encoders. ++ // And L0/L1 reference frame number can be set dynamically through query ++ // VAConfigAttribEncMaxRefFrames attribute. ++ if (avctx->codec_id == AV_CODEC_ID_AV1) { ++ for (i = 0; i < ctx->nb_next_prev; i++) ++ vaapi_encode_add_ref(avctx, pic, ctx->next_prev[i], ++ pic->type == PICTURE_TYPE_P, ++ b_counter > 0, 0); ++ } else ++ vaapi_encode_add_ref(avctx, pic, start, ++ pic->type == PICTURE_TYPE_P, ++ b_counter > 0, 0); ++ ++ vaapi_encode_add_ref(avctx, pic, ctx->next_prev[ctx->nb_next_prev - 1], 0, 0, 1); + } +- if (ctx->next_prev) +- --ctx->next_prev->ref_count[0]; + + if (b_counter > 0) { + vaapi_encode_set_b_pictures(avctx, start, pic, pic, 1, +- &ctx->next_prev); ++ &prev); + } else { +- ctx->next_prev = pic; ++ prev = pic; + } +- ++ctx->next_prev->ref_count[0]; ++ vaapi_encode_add_next_prev(avctx, prev); ++ + return 0; + } + +@@ -1205,10 +1398,23 @@ fail: + int ff_vaapi_encode_receive_packet(AVCodecContext *avctx, AVPacket *pkt) + { + VAAPIEncodeContext *ctx = avctx->priv_data; +- VAAPIEncodePicture *pic; ++ VAAPIEncodePicture *pic = NULL; + AVFrame *frame = ctx->frame; + int err; + ++start: ++ /** if no B frame before repeat P frame, sent repeat P frame out. */ ++ if (ctx->tail_pkt->size) { ++ for (VAAPIEncodePicture *tmp = ctx->pic_start; tmp; tmp = tmp->next) { ++ if (tmp->type == PICTURE_TYPE_B && tmp->pts < ctx->tail_pkt->pts) ++ break; ++ else if (!tmp->next) { ++ av_packet_move_ref(pkt, ctx->tail_pkt); ++ goto end; ++ } ++ } ++ } ++ + err = ff_encode_get_frame(avctx, frame); + if (err < 0 && err != AVERROR_EOF) + return err; +@@ -1228,8 +1434,6 @@ int ff_vaapi_encode_receive_packet(AVCodecContext *avctx, AVPacket *pkt) + } + + if (ctx->has_sync_buffer_func) { +- pic = NULL; +- + if (av_fifo_can_write(ctx->encode_fifo)) { + err = vaapi_encode_pick_next(avctx, &pic); + if (!err) { +@@ -1255,7 +1459,6 @@ int ff_vaapi_encode_receive_packet(AVCodecContext *avctx, AVPacket *pkt) + av_fifo_read(ctx->encode_fifo, &pic, 1); + ctx->encode_order = pic->encode_order + 1; + } else { +- pic = NULL; + err = vaapi_encode_pick_next(avctx, &pic); + if (err < 0) + return err; +@@ -1276,27 +1479,21 @@ int ff_vaapi_encode_receive_packet(AVCodecContext *avctx, AVPacket *pkt) + return err; + } + +- if (ctx->output_delay == 0) { +- pkt->dts = pkt->pts; +- } else if (pic->encode_order < ctx->decode_delay) { +- if (ctx->ts_ring[pic->encode_order] < INT64_MIN + ctx->dts_pts_diff) +- pkt->dts = INT64_MIN; +- else +- pkt->dts = ctx->ts_ring[pic->encode_order] - ctx->dts_pts_diff; +- } else { +- pkt->dts = ctx->ts_ring[(pic->encode_order - ctx->decode_delay) % +- (3 * ctx->output_delay + ctx->async_depth)]; +- } +- av_log(avctx, AV_LOG_DEBUG, "Output packet: pts %"PRId64" dts %"PRId64".\n", +- pkt->pts, pkt->dts); +- + ctx->output_order = pic->encode_order; + vaapi_encode_clear_old(avctx); + ++ /** loop to get an available pkt in encoder flushing. */ ++ if (ctx->end_of_stream && !pkt->size) ++ goto start; ++ ++end: ++ if (pkt->size) ++ av_log(avctx, AV_LOG_DEBUG, "Output packet: pts %"PRId64", dts %"PRId64", " ++ "size %d bytes.\n", pkt->pts, pkt->dts, pkt->size); ++ + return 0; + } + +- + static av_cold void vaapi_encode_add_global_param(AVCodecContext *avctx, int type, + void *buffer, size_t size) + { +@@ -2597,6 +2794,12 @@ av_cold int ff_vaapi_encode_init(AVCodecContext *avctx) + ctx->device = (AVHWDeviceContext*)ctx->device_ref->data; + ctx->hwctx = ctx->device->hwctx; + ++ ctx->tail_pkt = av_packet_alloc(); ++ if (!ctx->tail_pkt) { ++ err = AVERROR(ENOMEM); ++ goto fail; ++ } ++ + err = vaapi_encode_profile_entrypoint(avctx); + if (err < 0) + goto fail; +@@ -2789,6 +2992,7 @@ av_cold int ff_vaapi_encode_close(AVCodecContext *avctx) + } + + av_frame_free(&ctx->frame); ++ av_packet_free(&ctx->tail_pkt); + + av_freep(&ctx->codec_sequence_params); + av_freep(&ctx->codec_picture_params); +diff --git a/libavcodec/vaapi_encode.h b/libavcodec/vaapi_encode.h +index a1e639f..416a3ce 100644 +--- a/libavcodec/vaapi_encode.h ++++ b/libavcodec/vaapi_encode.h +@@ -49,6 +49,7 @@ enum { + // A.4.1: table A.6 allows at most 20 tile columns for any level. + MAX_TILE_COLS = 20, + MAX_ASYNC_DEPTH = 64, ++ MAX_REFERENCE_LIST_NUM = 2, + }; + + extern const AVCodecHWConfigInternal *const ff_vaapi_encode_hw_configs[]; +@@ -116,10 +117,11 @@ typedef struct VAAPIEncodePicture { + // but not if it isn't. + int nb_dpb_pics; + struct VAAPIEncodePicture *dpb[MAX_DPB_SIZE]; +- // The reference pictures used in decoding this picture. If they are +- // used by later pictures they will also appear in the DPB. +- int nb_refs; +- struct VAAPIEncodePicture *refs[MAX_PICTURE_REFERENCES]; ++ // The reference pictures used in decoding this picture. If they are ++ // used by later pictures they will also appear in the DPB. ref[0][] for ++ // previous reference frames. ref[1][] for future reference frames. ++ int nb_refs[MAX_REFERENCE_LIST_NUM]; ++ struct VAAPIEncodePicture *refs[MAX_REFERENCE_LIST_NUM][MAX_PICTURE_REFERENCES]; + // The previous reference picture in encode order. Must be in at least + // one of the reference list and DPB list. + struct VAAPIEncodePicture *prev; +@@ -131,6 +133,17 @@ typedef struct VAAPIEncodePicture { + + int nb_slices; + VAAPIEncodeSlice *slices; ++ ++ /** ++ * indicate if current frame is an independent frame that the coded data ++ * can be pushed to downstream directly. Coded of non-independent frame ++ * data will be concatenated into next independent frame. ++ */ ++ int non_independent_frame; ++ /** Tail data of current pic, used only for repeat header of AV1. */ ++ char tail_data[MAX_PARAM_BUFFER_SIZE]; ++ /** Byte length of tail_data. */ ++ size_t tail_size; + } VAAPIEncodePicture; + + typedef struct VAAPIEncodeProfile { +@@ -290,8 +303,9 @@ typedef struct VAAPIEncodeContext { + // Current encoding window, in display (input) order. + VAAPIEncodePicture *pic_start, *pic_end; + // The next picture to use as the previous reference picture in +- // encoding order. +- VAAPIEncodePicture *next_prev; ++ // encoding order. Order from small to large in encoding order. ++ VAAPIEncodePicture *next_prev[MAX_PICTURE_REFERENCES]; ++ int nb_next_prev; + + // Next input order index (display order). + int64_t input_order; +@@ -364,6 +378,16 @@ typedef struct VAAPIEncodeContext { + AVFifo *encode_fifo; + // Max number of frame buffered in encoder. + int async_depth; ++ ++ /** Head data for current output pkt, used only for AV1. */ ++ //void *header_data; ++ //size_t header_data_size; ++ ++ /** Buffered coded data of a pic if it is an non-independent frame. */ ++ AVBufferRef *coded_buffer_ref; ++ ++ /** Tail data of a pic, now only used for av1 repeat frame header. */ ++ AVPacket *tail_pkt; + } VAAPIEncodeContext; + + enum { +@@ -380,6 +404,9 @@ enum { + // Codec supports non-IDR key pictures (that is, key pictures do + // not necessarily empty the DPB). + FLAG_NON_IDR_KEY_PICTURES = 1 << 5, ++ // Codec output packet without timestamp delay, which means the ++ // output packet has same PTS and DTS. ++ FLAG_TIMESTAMP_NO_DELAY = 1 << 6, + }; + + typedef struct VAAPIEncodeType { +diff --git a/libavcodec/vaapi_encode_av1.c b/libavcodec/vaapi_encode_av1.c +new file mode 100644 +index 0000000..9d101fa +--- /dev/null ++++ b/libavcodec/vaapi_encode_av1.c +@@ -0,0 +1,949 @@ ++/* ++ * Copyright (c) 2023 Intel Corporation ++ * ++ * 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 ++#include ++ ++#include "libavutil/pixdesc.h" ++#include "libavutil/opt.h" ++ ++#include "cbs_av1.h" ++#include "put_bits.h" ++#include "codec_internal.h" ++#include "av1_levels.h" ++#include "vaapi_encode.h" ++ ++#define AV1_MAX_QUANT 255 ++ ++typedef struct VAAPIEncodeAV1Picture { ++ int64_t last_idr_frame; ++ int slot; ++} VAAPIEncodeAV1Picture; ++ ++typedef struct VAAPIEncodeAV1Context { ++ VAAPIEncodeContext common; ++ AV1RawOBU sh; /**< sequence header.*/ ++ AV1RawOBU fh; /**< frame header.*/ ++ CodedBitstreamContext *cbc; ++ CodedBitstreamFragment current_obu; ++ VAConfigAttribValEncAV1 attr; ++ VAConfigAttribValEncAV1Ext1 attr_ext1; ++ VAConfigAttribValEncAV1Ext2 attr_ext2; ++ ++ char sh_data[MAX_PARAM_BUFFER_SIZE]; /**< coded sequence header data. */ ++ size_t sh_data_len; /**< bit length of sh_data. */ ++ char fh_data[MAX_PARAM_BUFFER_SIZE]; /**< coded frame header data. */ ++ size_t fh_data_len; /**< bit length of fh_data. */ ++ ++ uint8_t uniform_tile; ++ uint8_t use_128x128_superblock; ++ int sb_cols; ++ int sb_rows; ++ int tile_cols_log2; ++ int tile_rows_log2; ++ int max_tile_width_sb; ++ int max_tile_height_sb; ++ uint8_t width_in_sbs_minus_1[AV1_MAX_TILE_COLS]; ++ uint8_t height_in_sbs_minus_1[AV1_MAX_TILE_ROWS]; ++ ++ int min_log2_tile_cols; ++ int max_log2_tile_cols; ++ int min_log2_tile_rows; ++ int max_log2_tile_rows; ++ ++ int q_idx_idr; ++ int q_idx_p; ++ int q_idx_b; ++ ++ /** bit positions in current frame header */ ++ int qindex_offset; ++ int loopfilter_offset; ++ int cdef_start_offset; ++ int cdef_param_size; ++ ++ /** user options */ ++ int profile; ++ int level; ++ int tier; ++ int tile_cols, tile_rows; ++ int tile_groups; ++} VAAPIEncodeAV1Context; ++ ++static void vaapi_encode_av1_trace_write_log(void *ctx, ++ PutBitContext *pbc, int length, ++ const char *str, const int *subscripts, ++ int64_t value) ++{ ++ VAAPIEncodeAV1Context *priv = ctx; ++ int position; ++ ++ position = put_bits_count(pbc); ++ av_assert0(position >= length); ++ ++ if (!strcmp(str, "base_q_idx")) ++ priv->qindex_offset = position - length; ++ else if (!strcmp(str, "loop_filter_level[0]")) ++ priv->loopfilter_offset = position - length; ++ else if (!strcmp(str, "cdef_damping_minus_3")) ++ priv->cdef_start_offset = position - length; ++ else if (!strcmp(str, "cdef_uv_sec_strength[i]")) ++ priv->cdef_param_size = position - priv->cdef_start_offset; ++} ++ ++static av_cold int vaapi_encode_av1_get_encoder_caps(AVCodecContext *avctx) ++{ ++ VAAPIEncodeContext *ctx = avctx->priv_data; ++ VAAPIEncodeAV1Context *priv = avctx->priv_data; ++ ++ // Surfaces must be aligned to superblock boundaries. ++ ctx->surface_width = FFALIGN(avctx->width, priv->use_128x128_superblock ? 128 : 64); ++ ctx->surface_height = FFALIGN(avctx->height, priv->use_128x128_superblock ? 128 : 64); ++ ++ return 0; ++} ++ ++static av_cold int vaapi_encode_av1_configure(AVCodecContext *avctx) ++{ ++ VAAPIEncodeContext *ctx = avctx->priv_data; ++ VAAPIEncodeAV1Context *priv = avctx->priv_data; ++ int ret; ++ ++ ret = ff_cbs_init(&priv->cbc, AV_CODEC_ID_AV1, avctx); ++ if (ret < 0) ++ return ret; ++ priv->cbc->trace_enable = 1; ++ priv->cbc->trace_level = AV_LOG_DEBUG; ++ priv->cbc->trace_context = ctx; ++ priv->cbc->trace_write_callback = vaapi_encode_av1_trace_write_log; ++ ++ if (ctx->rc_mode->quality) { ++ priv->q_idx_p = av_clip(ctx->rc_quality, 0, AV1_MAX_QUANT); ++ if (fabs(avctx->i_quant_factor) > 0.0) ++ priv->q_idx_idr = ++ av_clip((fabs(avctx->i_quant_factor) * priv->q_idx_p + ++ avctx->i_quant_offset) + 0.5, ++ 0, AV1_MAX_QUANT); ++ else ++ priv->q_idx_idr = priv->q_idx_p; ++ ++ if (fabs(avctx->b_quant_factor) > 0.0) ++ priv->q_idx_b = ++ av_clip((fabs(avctx->b_quant_factor) * priv->q_idx_p + ++ avctx->b_quant_offset) + 0.5, ++ 0, AV1_MAX_QUANT); ++ else ++ priv->q_idx_b = priv->q_idx_p; ++ } else { ++ /** Arbitrary value */ ++ priv->q_idx_idr = priv->q_idx_p = priv->q_idx_b = 128; ++ } ++ ++ return 0; ++} ++ ++static int vaapi_encode_av1_add_obu(AVCodecContext *avctx, ++ CodedBitstreamFragment *au, ++ uint8_t type, ++ void *obu_unit) ++{ ++ int ret; ++ ++ ret = ff_cbs_insert_unit_content(au, -1, ++ type, obu_unit, NULL); ++ if (ret < 0) { ++ av_log(avctx, AV_LOG_ERROR, "Failed to add OBU unit: " ++ "type = %d.\n", type); ++ return ret; ++ } ++ ++ return 0; ++} ++ ++static int vaapi_encode_av1_write_obu(AVCodecContext *avctx, ++ char *data, size_t *data_len, ++ CodedBitstreamFragment *bs) ++{ ++ VAAPIEncodeAV1Context *priv = avctx->priv_data; ++ int ret; ++ ++ ret = ff_cbs_write_fragment_data(priv->cbc, bs); ++ if (ret < 0) { ++ av_log(avctx, AV_LOG_ERROR, "Failed to write packed header.\n"); ++ return ret; ++ } ++ ++ if ((size_t)8 * MAX_PARAM_BUFFER_SIZE < 8 * bs->data_size - bs->data_bit_padding) { ++ av_log(avctx, AV_LOG_ERROR, "Access unit too large: " ++ "%zu < %zu.\n", (size_t)8 * MAX_PARAM_BUFFER_SIZE, ++ 8 * bs->data_size - bs->data_bit_padding); ++ return AVERROR(ENOSPC); ++ } ++ ++ memcpy(data, bs->data, bs->data_size); ++ *data_len = 8 * bs->data_size - bs->data_bit_padding; ++ ++ return 0; ++} ++ ++static int tile_log2(int blkSize, int target) { ++ int k; ++ for (k = 0; (blkSize << k) < target; k++); ++ return k; ++} ++ ++static int vaapi_encode_av1_set_tile(AVCodecContext *avctx) ++{ ++ VAAPIEncodeAV1Context *priv = avctx->priv_data; ++ int mi_cols, mi_rows, sb_shift, sb_size; ++ int max_tile_area_sb, max_tile_area_sb_varied; ++ int tile_width_sb, tile_height_sb, widest_tile_sb; ++ int tile_cols, tile_rows; ++ int min_log2_tiles; ++ int i; ++ ++ if (priv->tile_cols > AV1_MAX_TILE_COLS || ++ priv->tile_rows > AV1_MAX_TILE_ROWS) { ++ av_log(avctx, AV_LOG_ERROR, "Invalid tile number %dx%d, should less than %dx%d.\n", ++ priv->tile_cols, priv->tile_rows, AV1_MAX_TILE_COLS, AV1_MAX_TILE_ROWS); ++ return AVERROR(EINVAL); ++ } ++ ++ mi_cols = 2 * ((avctx->width + 7) >> 3); ++ mi_rows = 2 * ((avctx->height + 7) >> 3); ++ priv->sb_cols = priv->use_128x128_superblock ? ++ ((mi_cols + 31) >> 5) : ((mi_cols + 15) >> 4); ++ priv->sb_rows = priv->use_128x128_superblock ? ++ ((mi_rows + 31) >> 5) : ((mi_rows + 15) >> 4); ++ sb_shift = priv->use_128x128_superblock ? 5 : 4; ++ sb_size = sb_shift + 2; ++ priv->max_tile_width_sb = AV1_MAX_TILE_WIDTH >> sb_size; ++ max_tile_area_sb = AV1_MAX_TILE_AREA >> (2 * sb_size); ++ ++ priv->min_log2_tile_cols = tile_log2(priv->max_tile_width_sb, priv->sb_cols); ++ priv->max_log2_tile_cols = tile_log2(1, FFMIN(priv->sb_cols, AV1_MAX_TILE_COLS)); ++ priv->max_log2_tile_rows = tile_log2(1, FFMIN(priv->sb_rows, AV1_MAX_TILE_ROWS)); ++ min_log2_tiles = FFMAX(priv->min_log2_tile_cols, ++ tile_log2(max_tile_area_sb, priv->sb_rows * priv->sb_cols)); ++ ++ tile_cols = av_clip(priv->tile_cols, (priv->sb_cols + priv->max_tile_width_sb - 1) / priv->max_tile_width_sb, priv->sb_cols); ++ ++ if (!priv->tile_cols) ++ priv->tile_cols = tile_cols; ++ else if (priv->tile_cols != tile_cols){ ++ av_log(avctx, AV_LOG_ERROR, "Invalid tile cols %d, should be in range of %d~%d\n", ++ priv->tile_cols, ++ (priv->sb_cols + priv->max_tile_width_sb - 1) / priv->max_tile_width_sb, ++ priv->sb_cols); ++ return AVERROR(EINVAL); ++ } ++ ++ priv->tile_cols_log2 = tile_log2(1, priv->tile_cols); ++ tile_width_sb = (priv->sb_cols + (1 << priv->tile_cols_log2) - 1) >> ++ priv->tile_cols_log2; ++ ++ if (priv->tile_rows > priv->sb_rows) { ++ av_log(avctx, AV_LOG_ERROR, "Invalid tile rows %d, should be less than %d.\n", ++ priv->tile_rows, priv->sb_rows); ++ return AVERROR(EINVAL); ++ } ++ ++ /** Try user setting tile rows number first. */ ++ tile_rows = priv->tile_rows ? priv->tile_rows : 1; ++ for (; tile_rows <= priv->sb_rows && tile_rows <= AV1_MAX_TILE_ROWS; tile_rows++) { ++ /** try uniformed tile. */ ++ priv->tile_rows_log2 = tile_log2(1, tile_rows); ++ if ((priv->sb_cols + tile_width_sb - 1) / tile_width_sb == priv->tile_cols) { ++ for (i = 0; i < priv->tile_cols - 1; i++) ++ priv->width_in_sbs_minus_1[i] = tile_width_sb - 1; ++ priv->width_in_sbs_minus_1[i] = priv->sb_cols - (priv->tile_cols - 1) * tile_width_sb - 1; ++ ++ tile_height_sb = (priv->sb_rows + (1 << priv->tile_rows_log2) - 1) >> ++ priv->tile_rows_log2; ++ ++ if ((priv->sb_rows + tile_height_sb - 1) / tile_height_sb == tile_rows && ++ tile_height_sb <= max_tile_area_sb / tile_width_sb) { ++ for (i = 0; i < tile_rows - 1; i++) ++ priv->height_in_sbs_minus_1[i] = tile_height_sb - 1; ++ priv->height_in_sbs_minus_1[i] = priv->sb_rows - (tile_rows - 1) * tile_height_sb - 1; ++ ++ priv->uniform_tile = 1; ++ priv->min_log2_tile_rows = FFMAX(min_log2_tiles - priv->tile_cols_log2, 0); ++ ++ break; ++ } ++ } ++ ++ /** try non-uniformed tile. */ ++ widest_tile_sb = 0; ++ for (i = 0; i < priv->tile_cols; i++) { ++ priv->width_in_sbs_minus_1[i] = (i + 1) * priv->sb_cols / priv->tile_cols - i * priv->sb_cols / priv->tile_cols - 1; ++ widest_tile_sb = FFMAX(widest_tile_sb, priv->width_in_sbs_minus_1[i] + 1); ++ } ++ ++ if (min_log2_tiles) ++ max_tile_area_sb_varied = (priv->sb_rows * priv->sb_cols) >> (min_log2_tiles + 1); ++ else ++ max_tile_area_sb_varied = priv->sb_rows * priv->sb_cols; ++ priv->max_tile_height_sb = FFMAX(1, max_tile_area_sb_varied / widest_tile_sb); ++ ++ if (tile_rows == av_clip(tile_rows, (priv->sb_rows + priv->max_tile_height_sb - 1) / priv->max_tile_height_sb, priv->sb_rows)) { ++ for (i = 0; i < tile_rows; i++) ++ priv->height_in_sbs_minus_1[i] = (i + 1) * priv->sb_rows / tile_rows - i * priv->sb_rows / tile_rows - 1; ++ ++ break; ++ } ++ ++ /** Return invalid parameter if explicit tile rows is set. */ ++ if (priv->tile_rows) { ++ av_log(avctx, AV_LOG_ERROR, "Invalid tile rows %d.\n", priv->tile_rows); ++ return AVERROR(EINVAL); ++ } ++ } ++ ++ priv->tile_rows = tile_rows; ++ av_log(avctx, AV_LOG_DEBUG, "Setting tile cols/rows to %d/%d.\n", ++ priv->tile_cols, priv->tile_rows); ++ ++ /** check if tile cols/rows is supported by driver. */ ++ if (priv->attr_ext2.bits.max_tile_num_minus1) { ++ if ((priv->tile_cols * priv->tile_rows - 1) > priv->attr_ext2.bits.max_tile_num_minus1) { ++ av_log(avctx, AV_LOG_ERROR, "Unsupported tile num %d * %d = %d by driver, " ++ "should be at most %d.\n", priv->tile_cols, priv->tile_rows, ++ priv->tile_cols * priv->tile_rows, ++ priv->attr_ext2.bits.max_tile_num_minus1 + 1); ++ return AVERROR(EINVAL); ++ } ++ } ++ ++ /** check if tile group numbers is valid. */ ++ if (priv->tile_groups > priv->tile_cols * priv->tile_rows) { ++ av_log(avctx, AV_LOG_WARNING, "Invalid tile groups number %d, " ++ "correct to %d.\n", priv->tile_groups, priv->tile_cols * priv->tile_rows); ++ priv->tile_groups = priv->tile_cols * priv->tile_rows; ++ } ++ ++ return 0; ++} ++ ++static int vaapi_encode_av1_write_sequence_header(AVCodecContext *avctx, ++ char *data, size_t *data_len) ++{ ++ VAAPIEncodeAV1Context *priv = avctx->priv_data; ++ ++ memcpy(data, &priv->sh_data, MAX_PARAM_BUFFER_SIZE * sizeof(char)); ++ *data_len = priv->sh_data_len; ++ ++ return 0; ++} ++ ++static int vaapi_encode_av1_init_sequence_params(AVCodecContext *avctx) ++{ ++ VAAPIEncodeContext *ctx = avctx->priv_data; ++ VAAPIEncodeAV1Context *priv = avctx->priv_data; ++ AV1RawOBU *sh_obu = &priv->sh; ++ AV1RawSequenceHeader *sh = &sh_obu->obu.sequence_header; ++ VAEncSequenceParameterBufferAV1 *vseq = ctx->codec_sequence_params; ++ CodedBitstreamFragment *obu = &priv->current_obu; ++ const AVPixFmtDescriptor *desc; ++ int ret; ++ ++ memset(sh_obu, 0, sizeof(*sh_obu)); ++ sh_obu->header.obu_type = AV1_OBU_SEQUENCE_HEADER; ++ ++ desc = av_pix_fmt_desc_get(priv->common.input_frames->sw_format); ++ av_assert0(desc); ++ ++ sh->seq_profile = avctx->profile; ++ if (!sh->seq_force_screen_content_tools) ++ sh->seq_force_integer_mv = AV1_SELECT_INTEGER_MV; ++ sh->frame_width_bits_minus_1 = av_log2(avctx->width); ++ sh->frame_height_bits_minus_1 = av_log2(avctx->height); ++ sh->max_frame_width_minus_1 = avctx->width - 1; ++ sh->max_frame_height_minus_1 = avctx->height - 1; ++ sh->seq_tier[0] = priv->tier; ++ /** enable order hint and reserve maximum 8 bits for it by default. */ ++ sh->enable_order_hint = 1; ++ sh->order_hint_bits_minus_1 = 7; ++ ++ sh->color_config = (AV1RawColorConfig) { ++ .high_bitdepth = desc->comp[0].depth == 8 ? 0 : 1, ++ .color_primaries = avctx->color_primaries, ++ .transfer_characteristics = avctx->color_trc, ++ .matrix_coefficients = avctx->colorspace, ++ .color_description_present_flag = (avctx->color_primaries != AVCOL_PRI_UNSPECIFIED || ++ avctx->color_trc != AVCOL_TRC_UNSPECIFIED || ++ avctx->colorspace != AVCOL_SPC_UNSPECIFIED), ++ .color_range = avctx->color_range == AVCOL_RANGE_JPEG, ++ .subsampling_x = desc->log2_chroma_w, ++ .subsampling_y = desc->log2_chroma_h, ++ }; ++ ++ switch (avctx->chroma_sample_location) { ++ case AVCHROMA_LOC_LEFT: ++ sh->color_config.chroma_sample_position = AV1_CSP_VERTICAL; ++ break; ++ case AVCHROMA_LOC_TOPLEFT: ++ sh->color_config.chroma_sample_position = AV1_CSP_COLOCATED; ++ break; ++ default: ++ sh->color_config.chroma_sample_position = AV1_CSP_UNKNOWN; ++ break; ++ } ++ ++ if (avctx->level != FF_PROFILE_UNKNOWN) { ++ sh->seq_level_idx[0] = avctx->level; ++ } else { ++ const AV1LevelDescriptor *level; ++ float framerate; ++ ++ if (avctx->framerate.num > 0 && avctx->framerate.den > 0) ++ framerate = avctx->framerate.num / avctx->framerate.den; ++ else ++ framerate = 0; ++ ++ level = ff_av1_guess_level(avctx->bit_rate, priv->tier, ++ ctx->surface_width, ctx->surface_height, ++ priv->tile_rows * priv->tile_cols, ++ priv->tile_cols, framerate); ++ if (level) { ++ av_log(avctx, AV_LOG_VERBOSE, "Using level %s.\n", level->name); ++ sh->seq_level_idx[0] = level->level_idx; ++ } else { ++ av_log(avctx, AV_LOG_VERBOSE, "Stream will not conform to " ++ "any normal level, using maximum parameters level by default.\n"); ++ sh->seq_level_idx[0] = 31; ++ sh->seq_tier[0] = 1; ++ } ++ } ++ vseq->seq_profile = sh->seq_profile; ++ vseq->seq_level_idx = sh->seq_level_idx[0]; ++ vseq->seq_tier = sh->seq_tier[0]; ++ vseq->order_hint_bits_minus_1 = sh->order_hint_bits_minus_1; ++ vseq->intra_period = ctx->gop_size; ++ vseq->ip_period = ctx->b_per_p + 1; ++ ++ vseq->seq_fields.bits.enable_order_hint = sh->enable_order_hint; ++ ++ if (!(ctx->va_rc_mode & VA_RC_CQP)) { ++ vseq->bits_per_second = ctx->va_bit_rate; ++ vseq->seq_fields.bits.enable_cdef = sh->enable_cdef = 1; ++ } ++ ++ ret = vaapi_encode_av1_add_obu(avctx, obu, AV1_OBU_SEQUENCE_HEADER, &priv->sh); ++ if (ret < 0) ++ goto end; ++ ++ ret = vaapi_encode_av1_write_obu(avctx, priv->sh_data, &priv->sh_data_len, obu); ++ if (ret < 0) ++ goto end; ++ ++end: ++ ff_cbs_fragment_reset(obu); ++ return ret; ++} ++ ++static int vaapi_encode_av1_init_picture_params(AVCodecContext *avctx, ++ VAAPIEncodePicture *pic) ++{ ++ VAAPIEncodeContext *ctx = avctx->priv_data; ++ VAAPIEncodeAV1Context *priv = avctx->priv_data; ++ VAAPIEncodeAV1Picture *hpic = pic->priv_data; ++ AV1RawOBU *fh_obu = &priv->fh; ++ AV1RawFrameHeader *fh = &fh_obu->obu.frame.header; ++ VAEncPictureParameterBufferAV1 *vpic = pic->codec_picture_params; ++ CodedBitstreamFragment *obu = &priv->current_obu; ++ VAAPIEncodePicture *ref; ++ VAAPIEncodeAV1Picture *href; ++ int slot, i; ++ int ret; ++ static const int8_t default_loop_filter_ref_deltas[AV1_TOTAL_REFS_PER_FRAME] = ++ { 1, 0, 0, 0, -1, 0, -1, -1 }; ++ ++ memset(fh_obu, 0, sizeof(*fh_obu)); ++ pic->nb_slices = priv->tile_groups; ++ pic->non_independent_frame = pic->encode_order < pic->display_order; ++ fh_obu->header.obu_type = AV1_OBU_FRAME_HEADER; ++ fh_obu->header.obu_has_size_field = 1; ++ ++ switch (pic->type) { ++ case PICTURE_TYPE_IDR: ++ av_assert0(pic->nb_refs[0] == 0 || pic->nb_refs[1]); ++ fh->frame_type = AV1_FRAME_KEY; ++ fh->refresh_frame_flags = 0xFF; ++ fh->base_q_idx = priv->q_idx_idr; ++ hpic->slot = 0; ++ hpic->last_idr_frame = pic->display_order; ++ break; ++ case PICTURE_TYPE_P: ++ av_assert0(pic->nb_refs[0]); ++ fh->frame_type = AV1_FRAME_INTER; ++ fh->base_q_idx = priv->q_idx_p; ++ ref = pic->refs[0][pic->nb_refs[0] - 1]; ++ href = ref->priv_data; ++ hpic->slot = !href->slot; ++ hpic->last_idr_frame = href->last_idr_frame; ++ fh->refresh_frame_flags = 1 << hpic->slot; ++ ++ /** set the nearest frame in L0 as all reference frame. */ ++ for (i = 0; i < AV1_REFS_PER_FRAME; i++) { ++ fh->ref_frame_idx[i] = href->slot; ++ } ++ fh->primary_ref_frame = href->slot; ++ fh->ref_order_hint[href->slot] = ref->display_order - href->last_idr_frame; ++ vpic->ref_frame_ctrl_l0.fields.search_idx0 = AV1_REF_FRAME_LAST; ++ ++ /** set the 2nd nearest frame in L0 as Golden frame. */ ++ if (pic->nb_refs[0] > 1) { ++ ref = pic->refs[0][pic->nb_refs[0] - 2]; ++ href = ref->priv_data; ++ fh->ref_frame_idx[3] = href->slot; ++ fh->ref_order_hint[href->slot] = ref->display_order - href->last_idr_frame; ++ vpic->ref_frame_ctrl_l0.fields.search_idx1 = AV1_REF_FRAME_GOLDEN; ++ } ++ break; ++ case PICTURE_TYPE_B: ++ av_assert0(pic->nb_refs[0] && pic->nb_refs[1]); ++ fh->frame_type = AV1_FRAME_INTER; ++ fh->base_q_idx = priv->q_idx_b; ++ fh->refresh_frame_flags = 0x0; ++ fh->reference_select = 1; ++ ++ /** B frame will not be referenced, disable its recon frame. */ ++ vpic->picture_flags.bits.disable_frame_recon = 1; ++ ++ /** Use LAST_FRAME and BWDREF_FRAME for reference. */ ++ vpic->ref_frame_ctrl_l0.fields.search_idx0 = AV1_REF_FRAME_LAST; ++ vpic->ref_frame_ctrl_l1.fields.search_idx0 = AV1_REF_FRAME_BWDREF; ++ ++ ref = pic->refs[0][pic->nb_refs[0] - 1]; ++ href = ref->priv_data; ++ hpic->last_idr_frame = href->last_idr_frame; ++ fh->primary_ref_frame = href->slot; ++ fh->ref_order_hint[href->slot] = ref->display_order - href->last_idr_frame; ++ for (i = 0; i < AV1_REF_FRAME_GOLDEN; i++) { ++ fh->ref_frame_idx[i] = href->slot; ++ } ++ ++ ref = pic->refs[1][pic->nb_refs[1] - 1]; ++ href = ref->priv_data; ++ fh->ref_order_hint[href->slot] = ref->display_order - href->last_idr_frame; ++ for (i = AV1_REF_FRAME_GOLDEN; i < AV1_REFS_PER_FRAME; i++) { ++ fh->ref_frame_idx[i] = href->slot; ++ } ++ break; ++ default: ++ av_assert0(0 && "invalid picture type"); ++ } ++ ++ fh->show_frame = pic->display_order <= pic->encode_order; ++ fh->showable_frame = fh->frame_type != AV1_FRAME_KEY; ++ fh->frame_width_minus_1 = avctx->width - 1; ++ fh->frame_height_minus_1 = avctx->height - 1; ++ fh->render_width_minus_1 = fh->frame_width_minus_1; ++ fh->render_height_minus_1 = fh->frame_height_minus_1; ++ fh->order_hint = pic->display_order - hpic->last_idr_frame; ++ fh->tile_cols = priv->tile_cols; ++ fh->tile_rows = priv->tile_rows; ++ fh->tile_cols_log2 = priv->tile_cols_log2; ++ fh->tile_rows_log2 = priv->tile_rows_log2; ++ fh->uniform_tile_spacing_flag = priv->uniform_tile; ++ fh->tile_size_bytes_minus1 = priv->attr_ext2.bits.tile_size_bytes_minus1; ++ ++ /** ignore ONLY_4x4 mode for codedlossless is not fully implemented. */ ++ if (priv->attr_ext2.bits.tx_mode_support & 0x04) ++ fh->tx_mode = AV1_TX_MODE_SELECT; ++ else if (priv->attr_ext2.bits.tx_mode_support & 0x02) ++ fh->tx_mode = AV1_TX_MODE_LARGEST; ++ else { ++ av_log(avctx, AV_LOG_ERROR, "No available tx mode found.\n"); ++ return AVERROR(EINVAL); ++ } ++ ++ for (i = 0; i < fh->tile_cols; i++) ++ fh->width_in_sbs_minus_1[i] = vpic->width_in_sbs_minus_1[i] = priv->width_in_sbs_minus_1[i]; ++ ++ for (i = 0; i < fh->tile_rows; i++) ++ fh->height_in_sbs_minus_1[i] = vpic->height_in_sbs_minus_1[i] = priv->height_in_sbs_minus_1[i]; ++ ++ memcpy(fh->loop_filter_ref_deltas, default_loop_filter_ref_deltas, ++ AV1_TOTAL_REFS_PER_FRAME * sizeof(int8_t)); ++ ++ if (fh->frame_type == AV1_FRAME_KEY && fh->show_frame) { ++ fh->error_resilient_mode = 1; ++ } ++ ++ if (fh->frame_type == AV1_FRAME_KEY || fh->error_resilient_mode) ++ fh->primary_ref_frame = AV1_PRIMARY_REF_NONE; ++ ++ vpic->base_qindex = fh->base_q_idx; ++ vpic->frame_width_minus_1 = fh->frame_width_minus_1; ++ vpic->frame_height_minus_1 = fh->frame_height_minus_1; ++ vpic->primary_ref_frame = fh->primary_ref_frame; ++ vpic->reconstructed_frame = pic->recon_surface; ++ vpic->coded_buf = pic->output_buffer; ++ vpic->tile_cols = fh->tile_cols; ++ vpic->tile_rows = fh->tile_rows; ++ vpic->order_hint = fh->order_hint; ++#if VA_CHECK_VERSION(1, 15, 0) ++ vpic->refresh_frame_flags = fh->refresh_frame_flags; ++#endif ++ ++ vpic->picture_flags.bits.enable_frame_obu = 0; ++ vpic->picture_flags.bits.frame_type = fh->frame_type; ++ vpic->picture_flags.bits.reduced_tx_set = fh->reduced_tx_set; ++ vpic->picture_flags.bits.error_resilient_mode = fh->error_resilient_mode; ++ ++ /** let driver decide to use single or compound reference prediction mode. */ ++ vpic->mode_control_flags.bits.reference_mode = fh->reference_select ? 2 : 0; ++ vpic->mode_control_flags.bits.tx_mode = fh->tx_mode; ++ ++ vpic->tile_group_obu_hdr_info.bits.obu_has_size_field = 1; ++ ++ /** set reference. */ ++ for (i = 0; i < AV1_REFS_PER_FRAME; i++) ++ vpic->ref_frame_idx[i] = fh->ref_frame_idx[i]; ++ ++ for (i = 0; i < FF_ARRAY_ELEMS(vpic->reference_frames); i++) ++ vpic->reference_frames[i] = VA_INVALID_SURFACE; ++ ++ for (i = 0; i < MAX_REFERENCE_LIST_NUM; i++) { ++ for (int j = 0; j < pic->nb_refs[i]; j++) { ++ VAAPIEncodePicture *ref_pic = pic->refs[i][j]; ++ ++ slot = ((VAAPIEncodeAV1Picture*)ref_pic->priv_data)->slot; ++ av_assert0(vpic->reference_frames[slot] == VA_INVALID_SURFACE); ++ ++ vpic->reference_frames[slot] = ref_pic->recon_surface; ++ } ++ } ++ ++ fh_obu->obu_size_byte_len = priv->attr_ext2.bits.obu_size_bytes_minus1 + 1; ++ ret = vaapi_encode_av1_add_obu(avctx, obu, AV1_OBU_FRAME_HEADER, &priv->fh); ++ if (ret < 0) ++ goto end; ++ ++ ret = vaapi_encode_av1_write_obu(avctx, priv->fh_data, &priv->fh_data_len, obu); ++ if (ret < 0) ++ goto end; ++ ++ if (!(ctx->va_rc_mode & VA_RC_CQP)) { ++ vpic->min_base_qindex = av_clip(avctx->qmin, 1, AV1_MAX_QUANT); ++ vpic->max_base_qindex = av_clip(avctx->qmax, 1, AV1_MAX_QUANT); ++ ++ vpic->bit_offset_qindex = priv->qindex_offset; ++ vpic->bit_offset_loopfilter_params = priv->loopfilter_offset; ++ vpic->bit_offset_cdef_params = priv->cdef_start_offset; ++ vpic->size_in_bits_cdef_params = priv->cdef_param_size; ++ vpic->size_in_bits_frame_hdr_obu = priv->fh_data_len; ++ vpic->byte_offset_frame_hdr_obu_size = (((pic->type == PICTURE_TYPE_IDR) ? ++ priv->sh_data_len / 8 : 0) + ++ (fh_obu->header.obu_extension_flag ? ++ 2 : 1)); ++ } ++ ++end: ++ ff_cbs_fragment_reset(obu); ++ return ret; ++} ++ ++static int vaapi_encode_av1_init_slice_params(AVCodecContext *avctx, ++ VAAPIEncodePicture *pic, ++ VAAPIEncodeSlice *slice) ++{ ++ VAAPIEncodeAV1Context *priv = avctx->priv_data; ++ VAEncTileGroupBufferAV1 *vslice = slice->codec_slice_params; ++ CodedBitstreamAV1Context *cbctx = priv->cbc->priv_data; ++ int div; ++ ++ /** Set tile group info. */ ++ div = priv->tile_cols * priv->tile_rows / priv->tile_groups; ++ vslice->tg_start = slice->index * div; ++ if (slice->index == (priv->tile_groups - 1)) { ++ vslice->tg_end = priv->tile_cols * priv->tile_rows - 1; ++ cbctx->seen_frame_header = 0; ++ } else { ++ vslice->tg_end = (slice->index + 1) * div - 1; ++ } ++ ++ return 0; ++} ++ ++static int vaapi_encode_av1_write_picture_header(AVCodecContext *avctx, ++ VAAPIEncodePicture *pic, ++ char *data, size_t *data_len) ++{ ++ VAAPIEncodeAV1Context *priv = avctx->priv_data; ++ CodedBitstreamFragment *obu = &priv->current_obu; ++ CodedBitstreamAV1Context *cbctx = priv->cbc->priv_data; ++ AV1RawOBU *fh_obu = &priv->fh; ++ AV1RawFrameHeader *rep_fh = &fh_obu->obu.frame_header; ++ VAAPIEncodeAV1Picture *href; ++ int ret = 0; ++ ++ pic->tail_size = 0; ++ /** Pack repeat frame header. */ ++ if (pic->display_order > pic->encode_order) { ++ memset(fh_obu, 0, sizeof(*fh_obu)); ++ href = pic->refs[0][pic->nb_refs[0] - 1]->priv_data; ++ fh_obu->header.obu_type = AV1_OBU_FRAME_HEADER; ++ fh_obu->header.obu_has_size_field = 1; ++ ++ rep_fh->show_existing_frame = 1; ++ rep_fh->frame_to_show_map_idx = href->slot == 0; ++ rep_fh->frame_type = AV1_FRAME_INTER; ++ rep_fh->frame_width_minus_1 = avctx->width - 1; ++ rep_fh->frame_height_minus_1 = avctx->height - 1; ++ rep_fh->render_width_minus_1 = rep_fh->frame_width_minus_1; ++ rep_fh->render_height_minus_1 = rep_fh->frame_height_minus_1; ++ ++ cbctx->seen_frame_header = 0; ++ ++ ret = vaapi_encode_av1_add_obu(avctx, obu, AV1_OBU_FRAME_HEADER, &priv->fh); ++ if (ret < 0) ++ goto end; ++ ++ ret = vaapi_encode_av1_write_obu(avctx, pic->tail_data, &pic->tail_size, obu); ++ if (ret < 0) ++ goto end; ++ ++ pic->tail_size /= 8; ++ } ++ ++ memcpy(data, &priv->fh_data, MAX_PARAM_BUFFER_SIZE * sizeof(char)); ++ *data_len = priv->fh_data_len; ++ ++end: ++ ff_cbs_fragment_reset(obu); ++ return ret; ++} ++ ++static const VAAPIEncodeProfile vaapi_encode_av1_profiles[] = { ++ { FF_PROFILE_AV1_MAIN, 8, 3, 1, 1, VAProfileAV1Profile0 }, ++ { FF_PROFILE_AV1_MAIN, 10, 3, 1, 1, VAProfileAV1Profile0 }, ++ { FF_PROFILE_UNKNOWN } ++}; ++ ++static const VAAPIEncodeType vaapi_encode_type_av1 = { ++ .profiles = vaapi_encode_av1_profiles, ++ .flags = FLAG_B_PICTURES | FLAG_TIMESTAMP_NO_DELAY, ++ .default_quality = 25, ++ ++ .get_encoder_caps = &vaapi_encode_av1_get_encoder_caps, ++ .configure = &vaapi_encode_av1_configure, ++ ++ .sequence_header_type = VAEncPackedHeaderSequence, ++ .sequence_params_size = sizeof(VAEncSequenceParameterBufferAV1), ++ .init_sequence_params = &vaapi_encode_av1_init_sequence_params, ++ .write_sequence_header = &vaapi_encode_av1_write_sequence_header, ++ ++ .picture_priv_data_size = sizeof(VAAPIEncodeAV1Picture), ++ .picture_header_type = VAEncPackedHeaderPicture, ++ .picture_params_size = sizeof(VAEncPictureParameterBufferAV1), ++ .init_picture_params = &vaapi_encode_av1_init_picture_params, ++ .write_picture_header = &vaapi_encode_av1_write_picture_header, ++ ++ .slice_params_size = sizeof(VAEncTileGroupBufferAV1), ++ .init_slice_params = &vaapi_encode_av1_init_slice_params, ++}; ++ ++static av_cold int vaapi_encode_av1_init(AVCodecContext *avctx) ++{ ++ VAAPIEncodeContext *ctx = avctx->priv_data; ++ VAAPIEncodeAV1Context *priv = avctx->priv_data; ++ VAConfigAttrib attr; ++ VAStatus vas; ++ int ret; ++ ++ ctx->codec = &vaapi_encode_type_av1; ++ ++ ctx->desired_packed_headers = ++ VA_ENC_PACKED_HEADER_SEQUENCE | ++ VA_ENC_PACKED_HEADER_PICTURE; ++ ++ if (avctx->profile == FF_PROFILE_UNKNOWN) ++ avctx->profile = priv->profile; ++ if (avctx->level == FF_PROFILE_UNKNOWN) ++ avctx->level = priv->level; ++ ++ if (avctx->level != FF_PROFILE_UNKNOWN && avctx->level & ~0x1f) { ++ av_log(avctx, AV_LOG_ERROR, "Invalid level %d\n", avctx->level); ++ return AVERROR(EINVAL); ++ } ++ ++ ret = ff_vaapi_encode_init(avctx); ++ if (ret < 0) ++ return ret; ++ ++ attr.type = VAConfigAttribEncAV1; ++ vas = vaGetConfigAttributes(ctx->hwctx->display, ++ ctx->va_profile, ++ ctx->va_entrypoint, ++ &attr, 1); ++ if (vas != VA_STATUS_SUCCESS) { ++ av_log(avctx, AV_LOG_ERROR, "Failed to query " ++ "config attribute: %d (%s).\n", vas, vaErrorStr(vas)); ++ return AVERROR_EXTERNAL; ++ } else if (attr.value == VA_ATTRIB_NOT_SUPPORTED) { ++ priv->attr.value = 0; ++ av_log(avctx, AV_LOG_WARNING, "Attribute type:%d is not " ++ "supported.\n", attr.type); ++ } else { ++ priv->attr.value = attr.value; ++ } ++ ++ attr.type = VAConfigAttribEncAV1Ext1; ++ vas = vaGetConfigAttributes(ctx->hwctx->display, ++ ctx->va_profile, ++ ctx->va_entrypoint, ++ &attr, 1); ++ if (vas != VA_STATUS_SUCCESS) { ++ av_log(avctx, AV_LOG_ERROR, "Failed to query " ++ "config attribute: %d (%s).\n", vas, vaErrorStr(vas)); ++ return AVERROR_EXTERNAL; ++ } else if (attr.value == VA_ATTRIB_NOT_SUPPORTED) { ++ priv->attr_ext1.value = 0; ++ av_log(avctx, AV_LOG_WARNING, "Attribute type:%d is not " ++ "supported.\n", attr.type); ++ } else { ++ priv->attr_ext1.value = attr.value; ++ } ++ ++ /** This attr provides essential indicators, return error if not support. */ ++ attr.type = VAConfigAttribEncAV1Ext2; ++ vas = vaGetConfigAttributes(ctx->hwctx->display, ++ ctx->va_profile, ++ ctx->va_entrypoint, ++ &attr, 1); ++ if (vas != VA_STATUS_SUCCESS || attr.value == VA_ATTRIB_NOT_SUPPORTED) { ++ av_log(avctx, AV_LOG_ERROR, "Failed to query " ++ "config attribute: %d (%s).\n", vas, vaErrorStr(vas)); ++ return AVERROR_EXTERNAL; ++ } else { ++ priv->attr_ext2.value = attr.value; ++ } ++ ++ ret = vaapi_encode_av1_set_tile(avctx); ++ if (ret < 0) ++ return ret; ++ ++ return 0; ++} ++ ++static av_cold int vaapi_encode_av1_close(AVCodecContext *avctx) ++{ ++ VAAPIEncodeAV1Context *priv = avctx->priv_data; ++ ++ ff_cbs_fragment_free(&priv->current_obu); ++ ff_cbs_close(&priv->cbc); ++ ++ return ff_vaapi_encode_close(avctx); ++} ++ ++#define OFFSET(x) offsetof(VAAPIEncodeAV1Context, x) ++#define FLAGS (AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM) ++ ++static const AVOption vaapi_encode_av1_options[] = { ++ VAAPI_ENCODE_COMMON_OPTIONS, ++ VAAPI_ENCODE_RC_OPTIONS, ++ { "profile", "Set profile (seq_profile)", ++ OFFSET(profile), AV_OPT_TYPE_INT, ++ { .i64 = FF_PROFILE_UNKNOWN }, FF_PROFILE_UNKNOWN, 0xff, FLAGS, "profile" }, ++ ++#define PROFILE(name, value) name, NULL, 0, AV_OPT_TYPE_CONST, \ ++ { .i64 = value }, 0, 0, FLAGS, "profile" ++ { PROFILE("main", FF_PROFILE_AV1_MAIN) }, ++ { PROFILE("high", FF_PROFILE_AV1_HIGH) }, ++ { PROFILE("professional", FF_PROFILE_AV1_PROFESSIONAL) }, ++#undef PROFILE ++ ++ { "tier", "Set tier (seq_tier)", ++ OFFSET(tier), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, FLAGS, "tier" }, ++ { "main", NULL, 0, AV_OPT_TYPE_CONST, ++ { .i64 = 0 }, 0, 0, FLAGS, "tier" }, ++ { "high", NULL, 0, AV_OPT_TYPE_CONST, ++ { .i64 = 1 }, 0, 0, FLAGS, "tier" }, ++ { "level", "Set level (seq_level_idx)", ++ OFFSET(level), AV_OPT_TYPE_INT, ++ { .i64 = FF_PROFILE_UNKNOWN }, FF_PROFILE_UNKNOWN, 0x1f, FLAGS, "level" }, ++ ++#define LEVEL(name, value) name, NULL, 0, AV_OPT_TYPE_CONST, \ ++ { .i64 = value }, 0, 0, FLAGS, "level" ++ { LEVEL("2.0", 0) }, ++ { LEVEL("2.1", 1) }, ++ { LEVEL("3.0", 4) }, ++ { LEVEL("3.1", 5) }, ++ { LEVEL("4.0", 8) }, ++ { LEVEL("4.1", 9) }, ++ { LEVEL("5.0", 12) }, ++ { LEVEL("5.1", 13) }, ++ { LEVEL("5.2", 14) }, ++ { LEVEL("5.3", 15) }, ++ { LEVEL("6.0", 16) }, ++ { LEVEL("6.1", 17) }, ++ { LEVEL("6.2", 18) }, ++ { LEVEL("6.3", 19) }, ++#undef LEVEL ++ ++ { "tiles", "Tile columns x rows (Use minimal tile column/row number automatically by default)", ++ OFFSET(tile_cols), AV_OPT_TYPE_IMAGE_SIZE, { .str = NULL }, 0, 0, FLAGS }, ++ { "tile_groups", "Number of tile groups for encoding", ++ OFFSET(tile_groups), AV_OPT_TYPE_INT, { .i64 = 1 }, 1, AV1_MAX_TILE_ROWS * AV1_MAX_TILE_COLS, FLAGS }, ++ ++ { NULL }, ++}; ++ ++static const FFCodecDefault vaapi_encode_av1_defaults[] = { ++ { "b", "0" }, ++ { "bf", "2" }, ++ { "g", "120" }, ++ { "qmin", "1" }, ++ { "qmax", "255" }, ++ { NULL }, ++}; ++ ++static const AVClass vaapi_encode_av1_class = { ++ .class_name = "av1_vaapi", ++ .item_name = av_default_item_name, ++ .option = vaapi_encode_av1_options, ++ .version = LIBAVUTIL_VERSION_INT, ++}; ++ ++const FFCodec ff_av1_vaapi_encoder = { ++ .p.name = "av1_vaapi", ++ CODEC_LONG_NAME("AV1 (VAAPI)"), ++ .p.type = AVMEDIA_TYPE_VIDEO, ++ .p.id = AV_CODEC_ID_AV1, ++ .priv_data_size = sizeof(VAAPIEncodeAV1Context), ++ .init = &vaapi_encode_av1_init, ++ FF_CODEC_RECEIVE_PACKET_CB(&ff_vaapi_encode_receive_packet), ++ .close = &vaapi_encode_av1_close, ++ .p.priv_class = &vaapi_encode_av1_class, ++ .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE | ++ AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, ++ .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE | ++ FF_CODEC_CAP_INIT_CLEANUP, ++ .defaults = vaapi_encode_av1_defaults, ++ .p.pix_fmts = (const enum AVPixelFormat[]) { ++ AV_PIX_FMT_VAAPI, ++ AV_PIX_FMT_NONE, ++ }, ++ .hw_configs = ff_vaapi_encode_hw_configs, ++ .p.wrapper_name = "vaapi", ++}; +diff --git a/libavcodec/vaapi_encode_h264.c b/libavcodec/vaapi_encode_h264.c +index 645f6a9..c205d1e 100644 +--- a/libavcodec/vaapi_encode_h264.c ++++ b/libavcodec/vaapi_encode_h264.c +@@ -614,7 +614,7 @@ static int vaapi_encode_h264_init_picture_params(AVCodecContext *avctx, + VAAPIEncodePicture *prev = pic->prev; + VAAPIEncodeH264Picture *hprev = prev ? prev->priv_data : NULL; + VAEncPictureParameterBufferH264 *vpic = pic->codec_picture_params; +- int i; ++ int i, j = 0; + + if (pic->type == PICTURE_TYPE_IDR) { + av_assert0(pic->display_order == pic->encode_order); +@@ -715,24 +715,26 @@ static int vaapi_encode_h264_init_picture_params(AVCodecContext *avctx, + .TopFieldOrderCnt = hpic->pic_order_cnt, + .BottomFieldOrderCnt = hpic->pic_order_cnt, + }; +- +- for (i = 0; i < pic->nb_refs; i++) { +- VAAPIEncodePicture *ref = pic->refs[i]; +- VAAPIEncodeH264Picture *href; +- +- av_assert0(ref && ref->encode_order < pic->encode_order); +- href = ref->priv_data; +- +- vpic->ReferenceFrames[i] = (VAPictureH264) { +- .picture_id = ref->recon_surface, +- .frame_idx = href->frame_num, +- .flags = VA_PICTURE_H264_SHORT_TERM_REFERENCE, +- .TopFieldOrderCnt = href->pic_order_cnt, +- .BottomFieldOrderCnt = href->pic_order_cnt, +- }; ++ for (int k = 0; k < MAX_REFERENCE_LIST_NUM; k++) { ++ for (i = 0; i < pic->nb_refs[k]; i++) { ++ VAAPIEncodePicture *ref = pic->refs[k][i]; ++ VAAPIEncodeH264Picture *href; ++ ++ av_assert0(ref && ref->encode_order < pic->encode_order); ++ href = ref->priv_data; ++ ++ vpic->ReferenceFrames[j++] = (VAPictureH264) { ++ .picture_id = ref->recon_surface, ++ .frame_idx = href->frame_num, ++ .flags = VA_PICTURE_H264_SHORT_TERM_REFERENCE, ++ .TopFieldOrderCnt = href->pic_order_cnt, ++ .BottomFieldOrderCnt = href->pic_order_cnt, ++ }; ++ } + } +- for (; i < FF_ARRAY_ELEMS(vpic->ReferenceFrames); i++) { +- vpic->ReferenceFrames[i] = (VAPictureH264) { ++ ++ for (; j < FF_ARRAY_ELEMS(vpic->ReferenceFrames); j++) { ++ vpic->ReferenceFrames[j] = (VAPictureH264) { + .picture_id = VA_INVALID_ID, + .flags = VA_PICTURE_H264_INVALID, + }; +@@ -934,17 +936,17 @@ static int vaapi_encode_h264_init_slice_params(AVCodecContext *avctx, + + if (pic->type == PICTURE_TYPE_P) { + int need_rplm = 0; +- for (i = 0; i < pic->nb_refs; i++) { +- av_assert0(pic->refs[i]); +- if (pic->refs[i] != def_l0[i]) ++ for (i = 0; i < pic->nb_refs[0]; i++) { ++ av_assert0(pic->refs[0][i]); ++ if (pic->refs[0][i] != def_l0[i]) + need_rplm = 1; + } + + sh->ref_pic_list_modification_flag_l0 = need_rplm; + if (need_rplm) { + int pic_num = hpic->frame_num; +- for (i = 0; i < pic->nb_refs; i++) { +- href = pic->refs[i]->priv_data; ++ for (i = 0; i < pic->nb_refs[0]; i++) { ++ href = pic->refs[0][i]->priv_data; + av_assert0(href->frame_num != pic_num); + if (href->frame_num < pic_num) { + sh->rplm_l0[i].modification_of_pic_nums_idc = 0; +@@ -963,28 +965,29 @@ static int vaapi_encode_h264_init_slice_params(AVCodecContext *avctx, + } else { + int need_rplm_l0 = 0, need_rplm_l1 = 0; + int n0 = 0, n1 = 0; +- for (i = 0; i < pic->nb_refs; i++) { +- av_assert0(pic->refs[i]); +- href = pic->refs[i]->priv_data; +- av_assert0(href->pic_order_cnt != hpic->pic_order_cnt); +- if (href->pic_order_cnt < hpic->pic_order_cnt) { +- if (pic->refs[i] != def_l0[n0]) +- need_rplm_l0 = 1; +- ++n0; +- } else { +- if (pic->refs[i] != def_l1[n1]) +- need_rplm_l1 = 1; +- ++n1; +- } ++ for (i = 0; i < pic->nb_refs[0]; i++) { ++ av_assert0(pic->refs[0][i]); ++ href = pic->refs[0][i]->priv_data; ++ av_assert0(href->pic_order_cnt < hpic->pic_order_cnt); ++ if (pic->refs[0][i] != def_l0[n0]) ++ need_rplm_l0 = 1; ++ ++n0; ++ } ++ ++ for (i = 0; i < pic->nb_refs[1]; i++) { ++ av_assert0(pic->refs[1][i]); ++ href = pic->refs[1][i]->priv_data; ++ av_assert0(href->pic_order_cnt > hpic->pic_order_cnt); ++ if (pic->refs[1][i] != def_l1[n1]) ++ need_rplm_l1 = 1; ++ ++n1; + } + + sh->ref_pic_list_modification_flag_l0 = need_rplm_l0; + if (need_rplm_l0) { + int pic_num = hpic->frame_num; +- for (i = j = 0; i < pic->nb_refs; i++) { +- href = pic->refs[i]->priv_data; +- if (href->pic_order_cnt > hpic->pic_order_cnt) +- continue; ++ for (i = j = 0; i < pic->nb_refs[0]; i++) { ++ href = pic->refs[0][i]->priv_data; + av_assert0(href->frame_num != pic_num); + if (href->frame_num < pic_num) { + sh->rplm_l0[j].modification_of_pic_nums_idc = 0; +@@ -1005,10 +1008,8 @@ static int vaapi_encode_h264_init_slice_params(AVCodecContext *avctx, + sh->ref_pic_list_modification_flag_l1 = need_rplm_l1; + if (need_rplm_l1) { + int pic_num = hpic->frame_num; +- for (i = j = 0; i < pic->nb_refs; i++) { +- href = pic->refs[i]->priv_data; +- if (href->pic_order_cnt < hpic->pic_order_cnt) +- continue; ++ for (i = j = 0; i < pic->nb_refs[1]; i++) { ++ href = pic->refs[1][i]->priv_data; + av_assert0(href->frame_num != pic_num); + if (href->frame_num < pic_num) { + sh->rplm_l1[j].modification_of_pic_nums_idc = 0; +@@ -1048,14 +1049,13 @@ static int vaapi_encode_h264_init_slice_params(AVCodecContext *avctx, + vslice->RefPicList1[i].flags = VA_PICTURE_H264_INVALID; + } + +- av_assert0(pic->nb_refs <= 2); +- if (pic->nb_refs >= 1) { ++ if (pic->nb_refs[0]) { + // Backward reference for P- or B-frame. + av_assert0(pic->type == PICTURE_TYPE_P || + pic->type == PICTURE_TYPE_B); + vslice->RefPicList0[0] = vpic->ReferenceFrames[0]; + } +- if (pic->nb_refs >= 2) { ++ if (pic->nb_refs[1]) { + // Forward reference for B-frame. + av_assert0(pic->type == PICTURE_TYPE_B); + vslice->RefPicList1[0] = vpic->ReferenceFrames[1]; +diff --git a/libavcodec/vaapi_encode_h265.c b/libavcodec/vaapi_encode_h265.c +index aa7e532..f015e6f 100644 +--- a/libavcodec/vaapi_encode_h265.c ++++ b/libavcodec/vaapi_encode_h265.c +@@ -764,7 +764,7 @@ static int vaapi_encode_h265_init_picture_params(AVCodecContext *avctx, + VAAPIEncodePicture *prev = pic->prev; + VAAPIEncodeH265Picture *hprev = prev ? prev->priv_data : NULL; + VAEncPictureParameterBufferHEVC *vpic = pic->codec_picture_params; +- int i; ++ int i, j = 0; + + if (pic->type == PICTURE_TYPE_IDR) { + av_assert0(pic->display_order == pic->encode_order); +@@ -789,8 +789,8 @@ static int vaapi_encode_h265_init_picture_params(AVCodecContext *avctx, + hpic->pic_type = 1; + } else { + VAAPIEncodePicture *irap_ref; +- av_assert0(pic->refs[0] && pic->refs[1]); +- for (irap_ref = pic; irap_ref; irap_ref = irap_ref->refs[1]) { ++ av_assert0(pic->refs[0][0] && pic->refs[1][0]); ++ for (irap_ref = pic; irap_ref; irap_ref = irap_ref->refs[1][0]) { + if (irap_ref->type == PICTURE_TYPE_I) + break; + } +@@ -915,24 +915,27 @@ static int vaapi_encode_h265_init_picture_params(AVCodecContext *avctx, + .flags = 0, + }; + +- for (i = 0; i < pic->nb_refs; i++) { +- VAAPIEncodePicture *ref = pic->refs[i]; +- VAAPIEncodeH265Picture *href; +- +- av_assert0(ref && ref->encode_order < pic->encode_order); +- href = ref->priv_data; +- +- vpic->reference_frames[i] = (VAPictureHEVC) { +- .picture_id = ref->recon_surface, +- .pic_order_cnt = href->pic_order_cnt, +- .flags = (ref->display_order < pic->display_order ? +- VA_PICTURE_HEVC_RPS_ST_CURR_BEFORE : 0) | +- (ref->display_order > pic->display_order ? +- VA_PICTURE_HEVC_RPS_ST_CURR_AFTER : 0), +- }; ++ for (int k = 0; k < MAX_REFERENCE_LIST_NUM; k++) { ++ for (i = 0; i < pic->nb_refs[k]; i++) { ++ VAAPIEncodePicture *ref = pic->refs[k][i]; ++ VAAPIEncodeH265Picture *href; ++ ++ av_assert0(ref && ref->encode_order < pic->encode_order); ++ href = ref->priv_data; ++ ++ vpic->reference_frames[j++] = (VAPictureHEVC) { ++ .picture_id = ref->recon_surface, ++ .pic_order_cnt = href->pic_order_cnt, ++ .flags = (ref->display_order < pic->display_order ? ++ VA_PICTURE_HEVC_RPS_ST_CURR_BEFORE : 0) | ++ (ref->display_order > pic->display_order ? ++ VA_PICTURE_HEVC_RPS_ST_CURR_AFTER : 0), ++ }; ++ } + } +- for (; i < FF_ARRAY_ELEMS(vpic->reference_frames); i++) { +- vpic->reference_frames[i] = (VAPictureHEVC) { ++ ++ for (; j < FF_ARRAY_ELEMS(vpic->reference_frames); j++) { ++ vpic->reference_frames[j] = (VAPictureHEVC) { + .picture_id = VA_INVALID_ID, + .flags = VA_PICTURE_HEVC_INVALID, + }; +@@ -1016,21 +1019,33 @@ static int vaapi_encode_h265_init_slice_params(AVCodecContext *avctx, + memset(rps, 0, sizeof(*rps)); + + rps_pics = 0; +- for (i = 0; i < pic->nb_refs; i++) { +- strp = pic->refs[i]->priv_data; +- rps_poc[rps_pics] = strp->pic_order_cnt; +- rps_used[rps_pics] = 1; +- ++rps_pics; ++ for (i = 0; i < MAX_REFERENCE_LIST_NUM; i++) { ++ for (j = 0; j < pic->nb_refs[i]; j++) { ++ strp = pic->refs[i][j]->priv_data; ++ rps_poc[rps_pics] = strp->pic_order_cnt; ++ rps_used[rps_pics] = 1; ++ ++rps_pics; ++ } + } ++ + for (i = 0; i < pic->nb_dpb_pics; i++) { + if (pic->dpb[i] == pic) + continue; +- for (j = 0; j < pic->nb_refs; j++) { +- if (pic->dpb[i] == pic->refs[j]) ++ ++ for (j = 0; j < pic->nb_refs[0]; j++) { ++ if (pic->dpb[i] == pic->refs[0][j]) ++ break; ++ } ++ if (j < pic->nb_refs[0]) ++ continue; ++ ++ for (j = 0; j < pic->nb_refs[1]; j++) { ++ if (pic->dpb[i] == pic->refs[1][j]) + break; + } +- if (j < pic->nb_refs) ++ if (j < pic->nb_refs[1]) + continue; ++ + strp = pic->dpb[i]->priv_data; + rps_poc[rps_pics] = strp->pic_order_cnt; + rps_used[rps_pics] = 0; +@@ -1155,8 +1170,7 @@ static int vaapi_encode_h265_init_slice_params(AVCodecContext *avctx, + vslice->ref_pic_list1[i].flags = VA_PICTURE_HEVC_INVALID; + } + +- av_assert0(pic->nb_refs <= 2); +- if (pic->nb_refs >= 1) { ++ if (pic->nb_refs[0]) { + // Backward reference for P- or B-frame. + av_assert0(pic->type == PICTURE_TYPE_P || + pic->type == PICTURE_TYPE_B); +@@ -1165,7 +1179,7 @@ static int vaapi_encode_h265_init_slice_params(AVCodecContext *avctx, + // Reference for GPB B-frame, L0 == L1 + vslice->ref_pic_list1[0] = vpic->reference_frames[0]; + } +- if (pic->nb_refs >= 2) { ++ if (pic->nb_refs[1]) { + // Forward reference for B-frame. + av_assert0(pic->type == PICTURE_TYPE_B); + vslice->ref_pic_list1[0] = vpic->reference_frames[1]; +diff --git a/libavcodec/vaapi_encode_mpeg2.c b/libavcodec/vaapi_encode_mpeg2.c +index 9261d19..8000ae1 100644 +--- a/libavcodec/vaapi_encode_mpeg2.c ++++ b/libavcodec/vaapi_encode_mpeg2.c +@@ -458,12 +458,12 @@ static int vaapi_encode_mpeg2_init_picture_params(AVCodecContext *avctx, + break; + case PICTURE_TYPE_P: + vpic->picture_type = VAEncPictureTypePredictive; +- vpic->forward_reference_picture = pic->refs[0]->recon_surface; ++ vpic->forward_reference_picture = pic->refs[0][0]->recon_surface; + break; + case PICTURE_TYPE_B: + vpic->picture_type = VAEncPictureTypeBidirectional; +- vpic->forward_reference_picture = pic->refs[0]->recon_surface; +- vpic->backward_reference_picture = pic->refs[1]->recon_surface; ++ vpic->forward_reference_picture = pic->refs[0][0]->recon_surface; ++ vpic->backward_reference_picture = pic->refs[1][0]->recon_surface; + break; + default: + av_assert0(0 && "invalid picture type"); +diff --git a/libavcodec/vaapi_encode_vp8.c b/libavcodec/vaapi_encode_vp8.c +index ae6a8d3..b96e4cd 100644 +--- a/libavcodec/vaapi_encode_vp8.c ++++ b/libavcodec/vaapi_encode_vp8.c +@@ -86,7 +86,7 @@ static int vaapi_encode_vp8_init_picture_params(AVCodecContext *avctx, + switch (pic->type) { + case PICTURE_TYPE_IDR: + case PICTURE_TYPE_I: +- av_assert0(pic->nb_refs == 0); ++ av_assert0(pic->nb_refs[0] == 0 && pic->nb_refs[1] == 0); + vpic->ref_flags.bits.force_kf = 1; + vpic->ref_last_frame = + vpic->ref_gf_frame = +@@ -94,14 +94,14 @@ static int vaapi_encode_vp8_init_picture_params(AVCodecContext *avctx, + VA_INVALID_SURFACE; + break; + case PICTURE_TYPE_P: +- av_assert0(pic->nb_refs == 1); ++ av_assert0(!pic->nb_refs[1]); + vpic->ref_flags.bits.no_ref_last = 0; + vpic->ref_flags.bits.no_ref_gf = 1; + vpic->ref_flags.bits.no_ref_arf = 1; + vpic->ref_last_frame = + vpic->ref_gf_frame = + vpic->ref_arf_frame = +- pic->refs[0]->recon_surface; ++ pic->refs[0][0]->recon_surface; + break; + default: + av_assert0(0 && "invalid picture type"); +diff --git a/libavcodec/vaapi_encode_vp9.c b/libavcodec/vaapi_encode_vp9.c +index af1353c..d9e8ba6 100644 +--- a/libavcodec/vaapi_encode_vp9.c ++++ b/libavcodec/vaapi_encode_vp9.c +@@ -96,15 +96,15 @@ static int vaapi_encode_vp9_init_picture_params(AVCodecContext *avctx, + + switch (pic->type) { + case PICTURE_TYPE_IDR: +- av_assert0(pic->nb_refs == 0); ++ av_assert0(pic->nb_refs[0] == 0 && pic->nb_refs[1] == 0); + vpic->ref_flags.bits.force_kf = 1; + vpic->refresh_frame_flags = 0xff; + hpic->slot = 0; + break; + case PICTURE_TYPE_P: +- av_assert0(pic->nb_refs == 1); ++ av_assert0(!pic->nb_refs[1]); + { +- VAAPIEncodeVP9Picture *href = pic->refs[0]->priv_data; ++ VAAPIEncodeVP9Picture *href = pic->refs[0][0]->priv_data; + av_assert0(href->slot == 0 || href->slot == 1); + + if (ctx->max_b_depth > 0) { +@@ -120,10 +120,10 @@ static int vaapi_encode_vp9_init_picture_params(AVCodecContext *avctx, + } + break; + case PICTURE_TYPE_B: +- av_assert0(pic->nb_refs == 2); ++ av_assert0(pic->nb_refs[0] && pic->nb_refs[1]); + { +- VAAPIEncodeVP9Picture *href0 = pic->refs[0]->priv_data, +- *href1 = pic->refs[1]->priv_data; ++ VAAPIEncodeVP9Picture *href0 = pic->refs[0][0]->priv_data, ++ *href1 = pic->refs[1][0]->priv_data; + av_assert0(href0->slot < pic->b_depth + 1 && + href1->slot < pic->b_depth + 1); + +@@ -157,12 +157,14 @@ static int vaapi_encode_vp9_init_picture_params(AVCodecContext *avctx, + for (i = 0; i < FF_ARRAY_ELEMS(vpic->reference_frames); i++) + vpic->reference_frames[i] = VA_INVALID_SURFACE; + +- for (i = 0; i < pic->nb_refs; i++) { +- VAAPIEncodePicture *ref_pic = pic->refs[i]; +- int slot; +- slot = ((VAAPIEncodeVP9Picture*)ref_pic->priv_data)->slot; +- av_assert0(vpic->reference_frames[slot] == VA_INVALID_SURFACE); +- vpic->reference_frames[slot] = ref_pic->recon_surface; ++ for (i = 0; i < MAX_REFERENCE_LIST_NUM; i++) { ++ for (int j = 0; j < pic->nb_refs[i]; j++) { ++ VAAPIEncodePicture *ref_pic = pic->refs[i][j]; ++ int slot; ++ slot = ((VAAPIEncodeVP9Picture*)ref_pic->priv_data)->slot; ++ av_assert0(vpic->reference_frames[slot] == VA_INVALID_SURFACE); ++ vpic->reference_frames[slot] = ref_pic->recon_surface; ++ } + } + + vpic->pic_flags.bits.frame_type = (pic->type != PICTURE_TYPE_IDR); +-- +2.41.0 + diff --git a/ffmpeg-new-coder-errors.patch b/ffmpeg-new-coder-errors.patch new file mode 100644 index 0000000..a08b6a9 --- /dev/null +++ b/ffmpeg-new-coder-errors.patch @@ -0,0 +1,37 @@ +From: Jan Engelhardt +Date: 2016-04-10 23:23:53.138440254 +0200 + +Improve the error messages a bit to say what's really going on +(in light of a reduced build). + +--- + fftools/ffmpeg.c | 2 +- + fftools/ffmpeg_filter.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +Index: ffmpeg-6.0/fftools/ffmpeg.c +=================================================================== +--- ffmpeg-6.0.orig/fftools/ffmpeg.c ++++ ffmpeg-6.0/fftools/ffmpeg.c +@@ -2797,7 +2797,7 @@ static int init_input_stream(InputStream + if (ist->decoding_needed) { + const AVCodec *codec = ist->dec; + if (!codec) { +- snprintf(error, error_len, "Decoder (codec %s) not found for input stream #%d:%d", ++ snprintf(error, error_len, "This build of ffmpeg does not include a \"%s\" decoder needed for input stream #%d:%d.", + avcodec_get_name(ist->dec_ctx->codec_id), ist->file_index, ist->st->index); + return AVERROR(EINVAL); + } +Index: ffmpeg-6.0/fftools/ffmpeg_filter.c +=================================================================== +--- ffmpeg-6.0.orig/fftools/ffmpeg_filter.c ++++ ffmpeg-6.0/fftools/ffmpeg_filter.c +@@ -1064,7 +1064,7 @@ static int configure_input_filter(Filter + { + if (!ifilter->ist->dec) { + av_log(NULL, AV_LOG_ERROR, +- "No decoder for stream #%d:%d, filtering impossible\n", ++ "This build of ffmpeg does not have a suitable decoder for stream #%d:%d enabled, filtering impossible\n", + ifilter->ist->file_index, ifilter->ist->st->index); + return AVERROR_DECODER_NOT_FOUND; + } diff --git a/ffmpeg-support-evc-base-libraries.patch b/ffmpeg-support-evc-base-libraries.patch deleted file mode 100644 index add444f..0000000 --- a/ffmpeg-support-evc-base-libraries.patch +++ /dev/null @@ -1,73 +0,0 @@ -From 80bf83e3099652a3e7f8d1e8b6d902fea1ce4db9 Mon Sep 17 00:00:00 2001 -From: James Almer -Date: Sun, 24 Aug 2025 15:57:16 -0300 -Subject: [PATCH] configure: support linking to base profile libxev{d,e} - -Addresses issue #20328. - -Signed-off-by: James Almer ---- - configure | 16 ++++++++++++++-- - 1 file changed, 14 insertions(+), 2 deletions(-) - -diff --git a/configure b/configure -index aa41b2a7b3..5386ae8b9a 100755 ---- a/configure -+++ b/configure -@@ -299,7 +299,9 @@ External library support: - --enable-libx264 enable H.264 encoding via x264 [no] - --enable-libx265 enable HEVC encoding via x265 [no] - --enable-libxeve enable EVC encoding via libxeve [no] -+ --enable-libxeveb enable EVC encoding via libxeve (Base profile) [no] - --enable-libxevd enable EVC decoding via libxevd [no] -+ --enable-libxevdb enable EVC decoding via libxevd (Base profile) [no] - --enable-libxavs enable AVS encoding via xavs [no] - --enable-libxavs2 enable AVS2 encoding via xavs2 [no] - --enable-libxcb enable X11 grabbing using XCB [autodetect] -@@ -1992,7 +1994,9 @@ EXTERNAL_LIBRARY_LIST=" - libvvenc - libwebp - libxevd -+ libxevdb - libxeve -+ libxeveb - libxml2 - libzimg - libzmq -@@ -3669,8 +3673,8 @@ libx265_encoder_deps="libx265" - libx265_encoder_select="atsc_a53 dovi_rpuenc" - libxavs_encoder_deps="libxavs" - libxavs2_encoder_deps="libxavs2" --libxevd_decoder_deps="libxevd" --libxeve_encoder_deps="libxeve" -+libxevd_decoder_deps_any="libxevd libxevdb" -+libxeve_encoder_deps_any="libxeve libxeveb" - libxvid_encoder_deps="libxvid" - libzvbi_teletext_decoder_deps="libzvbi" - vapoursynth_demuxer_deps="vapoursynth" -@@ -4615,6 +4619,12 @@ enabled_all gnutls mbedtls && - enabled_all openssl mbedtls && - die "OpenSSL and mbedTLS must not be enabled at the same time." - -+enabled_all libxevd libxevdb && -+ die "libxevd and libxevdb must not be enabled at the same time." -+ -+enabled_all libxeve libxeveb && -+ die "libxeve and libxevdb must not be enabled at the same time." -+ - # Disable all the library-specific components if the library itself - # is disabled, see AVCODEC_LIST and following _LIST variables. - -@@ -7204,7 +7214,9 @@ enabled libx265 && require_pkg_config libx265 x265 x265.h x265_api_get - enabled libxavs && require libxavs "stdint.h xavs.h" xavs_encoder_encode "-lxavs $pthreads_extralibs $libm_extralibs" - enabled libxavs2 && require_pkg_config libxavs2 "xavs2 >= 1.3.0" "stdint.h xavs2.h" xavs2_api_get - enabled libxevd && require_pkg_config libxevd "xevd >= 0.4.1" "xevd.h" xevd_decode -+enabled libxevdb && require_pkg_config libxevdb "xevdb >= 0.4.1" "xevd.h" xevd_decode - enabled libxeve && require_pkg_config libxeve "xeve >= 0.5.1" "xeve.h" xeve_encode -+enabled libxeveb && require_pkg_config libxeveb "xeveb >= 0.5.1" "xeve.h" xeve_encode - enabled libxvid && require libxvid xvid.h xvid_global -lxvidcore - enabled libzimg && require_pkg_config libzimg "zimg >= 2.7.0" zimg.h zimg_get_api_version - enabled libzmq && require_pkg_config libzmq "libzmq >= 4.2.1" zmq.h zmq_ctx_new --- -2.49.1 - diff --git a/ffmpeg.spec b/ffmpeg.spec index fa9a894..e3fd439 100644 --- a/ffmpeg.spec +++ b/ffmpeg.spec @@ -1,129 +1,146 @@ -# For a complete build enable this -%bcond all_codecs 0 +# For a complete build enable these two +%bcond_with upstream_tarball +%bcond_with all_codecs # Break dependency cycles by disabling certain optional dependencies. -%bcond bootstrap 0 +%bcond_with bootstrap -# If building with all codecs, then set the pkg_suffix to %%nil. -# We can't handle this with a conditional, as srpm +# If you want to do a build with the upstream source tarball, then set the +# pkg_suffix to %%nil. We can't handle this with a conditional, as srpm # generation would not take it into account. %global pkg_suffix -free -# For alternative builds (do not enable in Fedora!) -%bcond freeworld_lavc 0 - -%if %{with freeworld_lavc} -# Freeworld builds enable all codecs -%global with_all_codecs 1 -# Freeworld builds do not need a package suffix -%global pkg_suffix %{nil} -%global basepkg_suffix -free -%endif - # Fails due to asm issue %ifarch %{ix86} %{arm} -%bcond lto 0 +%bcond_with lto %else -%bcond lto 1 +%bcond_without lto %endif %ifarch x86_64 -%bcond vpl 1 -%bcond vmaf 1 +%bcond_without vpl +%bcond_without vmaf %else -%bcond vpl 0 -%bcond vmaf 0 +%bcond_with vpl +%bcond_with vmaf %endif -%ifarch s390 s390x riscv64 -%bcond dc1394 0 -%bcond ffnvcodec 0 +%ifarch s390 s390x +%bcond_with dc1394 %else -%bcond dc1394 1 -%bcond ffnvcodec 1 +%bcond_without dc1394 %endif %if 0%{?rhel} -# Disable dependencies not available or wanted on RHEL/EPEL -%bcond chromaprint 0 -%bcond flite 0 +# Disable dependencies not offered in RHEL/EPEL +%bcond_with omxil %else + +# Disable some features because RHEL 9 packages are too old +%if 0%{?rhel} && 0%{?rhel} <= 9 +%bcond_with flite +%bcond_with lcms2 +%bcond_with placebo +%else +%bcond_without flite +%bcond_without lcms2 +%bcond_without placebo +%endif + +%bcond_without omxil + +%endif + # Break chromaprint dependency cycle (Fedora-only): # ffmpeg (libavcodec-free) → chromaprint → ffmpeg -%bcond chromaprint %{?with_bootstrap:0}%{!?with_bootstrap:1} -%bcond flite 1 -%endif - -%if 0%{?rhel} && 0%{?rhel} <= 9 -# Disable some features because RHEL 9 packages are too old -%bcond lcms2 0 -%bcond placebo 0 +%if %{with bootstrap} +%bcond_with chromaprint %else -%bcond lcms2 1 -%bcond placebo 1 +%bcond_without chromaprint %endif -%if 0%{?el10} -# Disable temporarily while we want for liblc3 to be upgraded -# Cf. https://issues.redhat.com/browse/RHEL-127169 -%bcond lc3 0 -%else -%bcond lc3 1 -%endif - -# For using an alternative build of EVC codecs -%bcond evc_main 0 %if %{with all_codecs} -%bcond rtmp 1 -%bcond vvc 1 -%bcond x264 1 -%bcond x265 1 +%bcond_without rtmp +%bcond_without x264 +%bcond_without x265 %else -%bcond rtmp 0 -%bcond vvc 0 -%bcond x264 0 -%bcond x265 0 +%bcond_with rtmp +%bcond_with x264 +%bcond_with x265 %endif %if %{without lto} %global _lto_cflags %{nil} %endif -# FIXME: GCC says there's incompatible pointer casts going on in libavdevice... -%global build_type_safety_c 2 +%if "%{__isa_bits}" == "64" +%global lib64_suffix ()(64bit) +%endif +%global openh264_soversion 7 -%global av_codec_soversion 62 -%global av_device_soversion 62 -%global av_filter_soversion 11 -%global av_format_soversion 62 -%global av_util_soversion 60 -%global swresample_soversion 6 -%global swscale_soversion 9 +%global av_codec_soversion 60 +%global av_device_soversion 60 +%global av_filter_soversion 9 +%global av_format_soversion 60 +%global av_util_soversion 58 +%global postproc_soversion 57 +%global swresample_soversion 4 +%global swscale_soversion 7 Name: ffmpeg %global pkg_name %{name}%{?pkg_suffix} -Version: 8.0.1 +Version: 6.0.1 Release: 2%{?dist} Summary: A complete solution to record, convert and stream audio and video License: GPL-3.0-or-later URL: https://ffmpeg.org/ -Source0: https://ffmpeg.org/releases/ffmpeg-%{version}.tar.xz -Source1: https://ffmpeg.org/releases/ffmpeg-%{version}.tar.xz.asc +Source0: ffmpeg%{?pkg_suffix}-%{version}.tar.xz +Source1: ffmpeg-dlopen-headers.tar.xz +Source2: https://ffmpeg.org/releases/ffmpeg-%{version}.tar.xz.asc # https://ffmpeg.org/ffmpeg-devel.asc # gpg2 --import --import-options import-export,import-minimal ffmpeg-devel.asc > ./ffmpeg.keyring -Source2: ffmpeg.keyring +Source3: ffmpeg.keyring +Source4: ffmpeg_free_sources Source20: enable_decoders Source21: enable_encoders +# Scripts for generating tarballs +Source90: ffmpeg_update_free_sources.sh +Source91: ffmpeg_gen_free_tarball.sh +Source92: ffmpeg_get_dlopen_headers.sh +Source93: ffmpeg_find_free_source_headers.sh # Fixes for reduced codec selection on free build Patch1: ffmpeg-codec-choice.patch +# Better error messages for free build +Patch2: ffmpeg-new-coder-errors.patch # Allow to build with fdk-aac-free # See https://bugzilla.redhat.com/show_bug.cgi?id=1501522#c112 -Patch2: ffmpeg-allow-fdk-aac-free.patch -# Support building with EVC base profile libraries -Patch3: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20329.patch#/ffmpeg-support-evc-base-libraries.patch +Patch3: ffmpeg-allow-fdk-aac-free.patch +# Backport upstream patches for libplacebo v5.264 +Patch4: 0001-avfilter-vf_libplacebo-wrap-deprecated-opts-in-FF_AP.patch +Patch5: 0001-avfilter-vf_libplacebo-remove-deprecated-field.patch +# Backport fix for segfault when passing non-existent filter option +# See: https://bugzilla.rpmfusion.org/show_bug.cgi?id=6773 +Patch6: 0001-fftools-ffmpeg_filter-initialize-the-o-to-silence-th.patch + +# Backport patches for enhanced rtmp support +# Cf. https://patchwork.ffmpeg.org/project/ffmpeg/list/?series=8926 +## From: https://patchwork.ffmpeg.org/series/8926/mbox/ +Patch8: FFmpeg-devel-v10-Support-enhanced-flv-in-FFmpeg.patch + +# Backport AV1 VA-API encode support +# Courtesy of GloriousEggroll +## Adapted from: https://patchwork.ffmpeg.org/project/ffmpeg/list/?series=9594 +Patch9: ffmpeg-ge-av1-vaapi-encode-support.patch + +# Drop openh264 runtime version checks +# https://patchwork.ffmpeg.org/project/ffmpeg/list/?series=10211 +Patch10: 0001-lavc-libopenh264-Drop-openh264-runtime-version-check.patch + +# Set up dlopen for openh264 +Patch1001: ffmpeg-dlopen-openh264.patch # Add first_dts getter to libavformat for Chromium # See: https://bugzilla.redhat.com/show_bug.cgi?id=2240127 @@ -136,6 +153,7 @@ Requires: libavdevice%{?pkg_suffix}%{_isa} = %{version}-%{release} Requires: libavfilter%{?pkg_suffix}%{_isa} = %{version}-%{release} Requires: libavformat%{?pkg_suffix}%{_isa} = %{version}-%{release} Requires: libavutil%{?pkg_suffix}%{_isa} = %{version}-%{release} +Requires: libpostproc%{?pkg_suffix}%{_isa} = %{version}-%{release} Requires: libswresample%{?pkg_suffix}%{_isa} = %{version}-%{release} Requires: libswscale%{?pkg_suffix}%{_isa} = %{version}-%{release} @@ -152,7 +170,6 @@ BuildRequires: gsm-devel BuildRequires: ladspa-devel BuildRequires: lame-devel BuildRequires: libgcrypt-devel -BuildRequires: libklvanc-devel BuildRequires: libmysofa-devel BuildRequires: libX11-devel BuildRequires: libXext-devel @@ -162,13 +179,10 @@ BuildRequires: nasm BuildRequires: perl(Pod::Man) BuildRequires: pkgconfig(alsa) BuildRequires: pkgconfig(aom) -BuildRequires: pkgconfig(aribb24) >= 1.0.3 BuildRequires: pkgconfig(bzip2) BuildRequires: pkgconfig(caca) BuildRequires: pkgconfig(codec2) BuildRequires: pkgconfig(dav1d) -BuildRequires: pkgconfig(dvdnav) -BuildRequires: pkgconfig(dvdread) BuildRequires: pkgconfig(ffnvcodec) BuildRequires: pkgconfig(flac) BuildRequires: pkgconfig(fontconfig) @@ -177,16 +191,11 @@ BuildRequires: pkgconfig(frei0r) BuildRequires: pkgconfig(fribidi) BuildRequires: pkgconfig(gl) BuildRequires: pkgconfig(gnutls) -BuildRequires: pkgconfig(harfbuzz) BuildRequires: pkgconfig(libilbc) BuildRequires: pkgconfig(jack) -%if %{with lc3} -BuildRequires: pkgconfig(lc3) >= 1.1.0 -%endif %if %{with lcms2} BuildRequires: pkgconfig(lcms2) >= 2.13 %endif -BuildRequires: pkgconfig(libaribcaption) >= 1.1.1 BuildRequires: pkgconfig(libass) BuildRequires: pkgconfig(libbluray) BuildRequires: pkgconfig(libbs2b) @@ -198,13 +207,15 @@ BuildRequires: pkgconfig(libchromaprint) BuildRequires: pkgconfig(libdrm) BuildRequires: pkgconfig(libjxl) >= 0.7.0 BuildRequires: pkgconfig(libmodplug) +%if %{with omxil} +BuildRequires: pkgconfig(libomxil-bellagio) +%endif BuildRequires: pkgconfig(libopenjp2) BuildRequires: pkgconfig(libopenmpt) %if %{with placebo} BuildRequires: pkgconfig(libplacebo) >= 4.192.0 %endif BuildRequires: pkgconfig(libpulse) -BuildRequires: pkgconfig(libqrencode) BuildRequires: pkgconfig(librabbitmq) BuildRequires: pkgconfig(librist) BuildRequires: pkgconfig(librsvg-2.0) @@ -218,15 +229,15 @@ BuildRequires: pkgconfig(libxml-2.0) BuildRequires: pkgconfig(libzmq) BuildRequires: pkgconfig(lilv-0) BuildRequires: pkgconfig(lv2) -BuildRequires: pkgconfig(oapv) +BuildRequires: pkgconfig(netcdf) BuildRequires: pkgconfig(ogg) BuildRequires: pkgconfig(openal) BuildRequires: pkgconfig(opencore-amrnb) BuildRequires: pkgconfig(OpenCL) -BuildRequires: pkgconfig(openh264) BuildRequires: pkgconfig(opus) BuildRequires: pkgconfig(rav1e) BuildRequires: pkgconfig(rubberband) +BuildRequires: pkgconfig(schroedinger-1.0) BuildRequires: pkgconfig(sdl2) BuildRequires: pkgconfig(shaderc) >= 2019.1 BuildRequires: pkgconfig(smbclient) @@ -244,7 +255,7 @@ BuildRequires: pkgconfig(vidstab) BuildRequires: pkgconfig(vorbis) BuildRequires: pkgconfig(vo-amrwbenc) BuildRequires: pkgconfig(vpx) -BuildRequires: pkgconfig(vulkan) >= 1.3.255 +BuildRequires: pkgconfig(vulkan) BuildRequires: pkgconfig(wavpack) BuildRequires: pkgconfig(xcb) BuildRequires: pkgconfig(xcb-render) @@ -268,13 +279,6 @@ BuildRequires: librtmp-devel %if %{with vpl} BuildRequires: pkgconfig(vpl) >= 2.6 %endif -%if %{with evc_main} -BuildRequires: pkgconfig(xevd) -BuildRequires: pkgconfig(xeve) -%else -BuildRequires: pkgconfig(xevdb) -BuildRequires: pkgconfig(xeveb) -%endif %if %{with x264} BuildRequires: pkgconfig(x264) %endif @@ -297,10 +301,6 @@ community or a corporation. This build of ffmpeg is limited in the number of codecs supported. %endif -%dnl -------------------------------------------------------------------------------- - -%if ! %{with freeworld_lavc} - %if "x%{?pkg_suffix}" != "x" %package -n %{pkg_name} Summary: A complete solution to record, convert and stream audio and video @@ -309,6 +309,7 @@ Requires: libavdevice%{?pkg_suffix}%{_isa} = %{version}-%{release} Requires: libavfilter%{?pkg_suffix}%{_isa} = %{version}-%{release} Requires: libavformat%{?pkg_suffix}%{_isa} = %{version}-%{release} Requires: libavutil%{?pkg_suffix}%{_isa} = %{version}-%{release} +Requires: libpostproc%{?pkg_suffix}%{_isa} = %{version}-%{release} Requires: libswresample%{?pkg_suffix}%{_isa} = %{version}-%{release} Requires: libswscale%{?pkg_suffix}%{_isa} = %{version}-%{release} @@ -327,18 +328,6 @@ This build of ffmpeg is limited in the number of codecs supported. #/ "x%%{?pkg_suffix}" != "x" %endif -%files -n %{pkg_name} -%doc CREDITS README.md -%{_bindir}/ffmpeg -%{_bindir}/ffplay -%{_bindir}/ffprobe -%{_mandir}/man1/ff*.1* -%dir %{_datadir}/%{name} -%{_datadir}/%{name}/ffprobe.xsd -%{_datadir}/%{name}/libvpx-*.ffpreset - -%dnl -------------------------------------------------------------------------------- - %package -n %{pkg_name}-devel Summary: Development package for %{name} Requires: libavcodec%{?pkg_suffix}-devel = %{version}-%{release} @@ -346,6 +335,7 @@ Requires: libavdevice%{?pkg_suffix}-devel = %{version}-%{release} Requires: libavfilter%{?pkg_suffix}-devel = %{version}-%{release} Requires: libavformat%{?pkg_suffix}-devel = %{version}-%{release} Requires: libavutil%{?pkg_suffix}-devel = %{version}-%{release} +Requires: libpostproc%{?pkg_suffix}-devel = %{version}-%{release} Requires: libswresample%{?pkg_suffix}-devel = %{version}-%{release} Requires: libswscale%{?pkg_suffix}-devel = %{version}-%{release} Requires: pkgconfig @@ -357,18 +347,14 @@ machines have created. It supports the most obscure ancient formats up to the cutting edge. No matter if they were designed by some standards committee, the community or a corporation. -%files -n %{pkg_name}-devel -%doc MAINTAINERS doc/APIchanges doc/*.txt -%doc _doc/examples - -%dnl -------------------------------------------------------------------------------- - %package -n libavcodec%{?pkg_suffix} Summary: FFmpeg codec library Requires: libavutil%{?pkg_suffix}%{_isa} = %{version}-%{release} Requires: libswresample%{?pkg_suffix}%{_isa} = %{version}-%{release} -# We require libopenh264 library, which has a dummy implementation and a real one -# In the event that this is being installed, we want to prefer openh264 if available +# We dlopen() openh264, so weak-depend on it... +## Note, we can do this because openh264 is provided in a default-enabled +## third party repository provided by Cisco. +Recommends: libopenh264.so.%{openh264_soversion}%{?lib64_suffix} Suggests: openh264%{_isa} %description -n libavcodec%{?pkg_suffix} @@ -380,12 +366,6 @@ subtitle streams, and several bitstream filters. This build of ffmpeg is limited in the number of codecs supported. %endif -%files -n libavcodec%{?pkg_suffix} -%license COPYING.GPLv2 LICENSE.md -%{_libdir}/libavcodec.so.%{av_codec_soversion}{,.*} - -%dnl -------------------------------------------------------------------------------- - %package -n libavcodec%{?pkg_suffix}-devel Summary: Development files for FFmpeg's codec library Requires: libavutil%{?pkg_suffix}-devel = %{version}-%{release} @@ -399,14 +379,6 @@ subtitle streams, and several bitstream filters. This subpackage contains the headers for FFmpeg libavcodec. -%files -n libavcodec%{?pkg_suffix}-devel -%{_includedir}/%{name}/libavcodec -%{_libdir}/pkgconfig/libavcodec.pc -%{_libdir}/libavcodec.so -%{_mandir}/man3/libavcodec.3* - -%dnl -------------------------------------------------------------------------------- - %package -n libavdevice%{?pkg_suffix} Summary: FFmpeg device library Requires: libavcodec%{?pkg_suffix}%{_isa} = %{version}-%{release} @@ -420,18 +392,13 @@ and rendering to many common multimedia input/output devices, and supports several input and output devices, including Video4Linux2, VfW, DShow, and ALSA. -%files -n libavdevice%{?pkg_suffix} -%license COPYING.GPLv2 LICENSE.md -%{_libdir}/libavdevice.so.%{av_device_soversion}{,.*} - -%dnl -------------------------------------------------------------------------------- - %package -n libavdevice%{?pkg_suffix}-devel Summary: Development files for FFmpeg's device library Requires: libavcodec%{?pkg_suffix}-devel = %{version}-%{release} Requires: libavfilter%{?pkg_suffix}-devel = %{version}-%{release} Requires: libavformat%{?pkg_suffix}-devel = %{version}-%{release} Requires: libavutil%{?pkg_suffix}-devel = %{version}-%{release} +Requires: libpostproc%{?pkg_suffix}-devel = %{version}-%{release} Requires: libswresample%{?pkg_suffix}-devel = %{version}-%{release} Requires: libswscale%{?pkg_suffix}-devel = %{version}-%{release} Requires: libavdevice%{?pkg_suffix}%{_isa} = %{version}-%{release} @@ -445,19 +412,12 @@ DShow, and ALSA. This subpackage contains the headers for FFmpeg libavdevice. -%files -n libavdevice%{?pkg_suffix}-devel -%{_includedir}/%{name}/libavdevice -%{_libdir}/pkgconfig/libavdevice.pc -%{_libdir}/libavdevice.so -%{_mandir}/man3/libavdevice.3* - -%dnl -------------------------------------------------------------------------------- - %package -n libavfilter%{?pkg_suffix} Summary: FFmpeg audio and video filtering library Requires: libavcodec%{?pkg_suffix}%{_isa} = %{version}-%{release} Requires: libavformat%{?pkg_suffix}%{_isa} = %{version}-%{release} Requires: libavutil%{?pkg_suffix}%{_isa} = %{version}-%{release} +Requires: libpostproc%{?pkg_suffix}%{_isa} = %{version}-%{release} Requires: libswresample%{?pkg_suffix}%{_isa} = %{version}-%{release} Requires: libswscale%{?pkg_suffix}%{_isa} = %{version}-%{release} @@ -465,17 +425,12 @@ Requires: libswscale%{?pkg_suffix}%{_isa} = %{version}-%{release} The libavfilter library provides a generic audio/video filtering framework containing several filters, sources and sinks. -%files -n libavfilter%{?pkg_suffix} -%license COPYING.GPLv2 LICENSE.md -%{_libdir}/libavfilter.so.%{av_filter_soversion}{,.*} - -%dnl -------------------------------------------------------------------------------- - %package -n libavfilter%{?pkg_suffix}-devel Summary: Development files for FFmpeg's audio/video filter library Requires: libavcodec%{?pkg_suffix}-devel = %{version}-%{release} Requires: libavformat%{?pkg_suffix}-devel = %{version}-%{release} Requires: libavutil%{?pkg_suffix}-devel = %{version}-%{release} +Requires: libpostproc%{?pkg_suffix}-devel = %{version}-%{release} Requires: libswresample%{?pkg_suffix}-devel = %{version}-%{release} Requires: libswscale%{?pkg_suffix}-devel = %{version}-%{release} Requires: libavfilter%{?pkg_suffix} = %{version}-%{release} @@ -487,14 +442,6 @@ framework containing several filters, sources and sinks. This subpackage contains the headers for FFmpeg libavfilter. -%files -n libavfilter%{?pkg_suffix}-devel -%{_includedir}/%{name}/libavfilter -%{_libdir}/pkgconfig/libavfilter.pc -%{_libdir}/libavfilter.so -%{_mandir}/man3/libavfilter.3* - -%dnl -------------------------------------------------------------------------------- - %package -n libavformat%{?pkg_suffix} Summary: FFmpeg's stream format library Requires: libavcodec%{?pkg_suffix}%{_isa} = %{version}-%{release} @@ -510,12 +457,6 @@ container formats. This build of ffmpeg is limited in the number of codecs supported. %endif -%files -n libavformat%{?pkg_suffix} -%license COPYING.GPLv2 LICENSE.md -%{_libdir}/libavformat.so.%{av_format_soversion}{,.*} - -%dnl -------------------------------------------------------------------------------- - %package -n libavformat%{?pkg_suffix}-devel Summary: Development files for FFmpeg's stream format library Requires: libavcodec%{?pkg_suffix}-devel = %{version}-%{release} @@ -532,18 +473,9 @@ container formats. This subpackage contains the headers for FFmpeg libavformat. -%files -n libavformat%{?pkg_suffix}-devel -%{_includedir}/%{name}/libavformat -%{_libdir}/pkgconfig/libavformat.pc -%{_libdir}/libavformat.so -%{_mandir}/man3/libavformat.3* - -%dnl -------------------------------------------------------------------------------- - %package -n libavutil%{?pkg_suffix} Summary: FFmpeg's utility library Group: System/Libraries -Obsoletes: libpostproc%{?pkg_suffix} < 8.0 %description -n libavutil%{?pkg_suffix} The libavutil library is a utility library to aid portable multimedia @@ -552,17 +484,10 @@ number generators, data structures, additional mathematics functions, cryptography and multimedia related functionality (like enumerations for pixel and sample formats). -%files -n libavutil%{?pkg_suffix} -%license COPYING.GPLv2 LICENSE.md -%{_libdir}/libavutil.so.%{av_util_soversion}{,.*} - -%dnl -------------------------------------------------------------------------------- - %package -n libavutil%{?pkg_suffix}-devel Summary: Development files for FFmpeg's utility library Requires: libavutil%{?pkg_suffix}%{_isa} = %{version}-%{release} Requires: pkgconfig -Obsoletes: libpostproc%{?pkg_suffix}-devel < 8.0 %description -n libavutil%{?pkg_suffix}-devel The libavutil library is a utility library to aid portable multimedia @@ -573,13 +498,27 @@ for pixel and sample formats). This subpackage contains the headers for FFmpeg libavutil. -%files -n libavutil%{?pkg_suffix}-devel -%{_includedir}/%{name}/libavutil -%{_libdir}/pkgconfig/libavutil.pc -%{_libdir}/libavutil.so -%{_mandir}/man3/libavutil.3* +%package -n libpostproc%{?pkg_suffix} +Summary: FFmpeg post-processing library +Requires: libavutil%{?pkg_suffix}%{_isa} = %{version}-%{release} -%dnl -------------------------------------------------------------------------------- +%description -n libpostproc%{?pkg_suffix} +A library with video postprocessing filters, such as deblocking and +deringing filters, noise reduction, automatic contrast and brightness +correction, linear/cubic interpolating deinterlacing. + +%package -n libpostproc%{?pkg_suffix}-devel +Summary: Development files for the FFmpeg post-processing library +Requires: libavutil%{?pkg_suffix}-devel = %{version}-%{release} +Requires: libpostproc%{?pkg_suffix}%{_isa} = %{version}-%{release} +Requires: pkgconfig + +%description -n libpostproc%{?pkg_suffix}-devel +A library with video postprocessing filters, such as deblocking and +deringing filters, noise reduction, automatic contrast and brightness +correction, linear/cubic interpolating deinterlacing. + +This subpackage contains the headers for FFmpeg libpostproc. %package -n libswresample%{?pkg_suffix} Summary: FFmpeg software resampling library @@ -589,12 +528,6 @@ Requires: libavutil%{?pkg_suffix}%{_isa} = %{version}-%{release} The libswresample library performs audio conversion between different sample rates, channel layout and channel formats. -%files -n libswresample%{?pkg_suffix} -%license COPYING.GPLv2 LICENSE.md -%{_libdir}/libswresample.so.%{swresample_soversion}{,.*} - -%dnl -------------------------------------------------------------------------------- - %package -n libswresample%{?pkg_suffix}-devel Summary: Development files for the FFmpeg software resampling library Requires: libavutil%{?pkg_suffix}-devel = %{version}-%{release} @@ -606,14 +539,6 @@ sample rates, channel layout and channel formats. This subpackage contains the headers for FFmpeg libswresample. -%files -n libswresample%{?pkg_suffix}-devel -%{_includedir}/%{name}/libswresample -%{_libdir}/pkgconfig/libswresample.pc -%{_libdir}/libswresample.so -%{_mandir}/man3/libswresample.3* - -%dnl -------------------------------------------------------------------------------- - %package -n libswscale%{?pkg_suffix} Summary: FFmpeg image scaling and colorspace/pixel conversion library Requires: libavutil%{?pkg_suffix}%{_isa} = %{version}-%{release} @@ -622,12 +547,6 @@ Requires: libavutil%{?pkg_suffix}%{_isa} = %{version}-%{release} The libswscale library performs image scaling and colorspace and pixel format conversion operations. -%files -n libswscale%{?pkg_suffix} -%license COPYING.GPLv2 LICENSE.md -%{_libdir}/libswscale.so.%{swscale_soversion}{,.*} - -%dnl -------------------------------------------------------------------------------- - %package -n libswscale%{?pkg_suffix}-devel Summary: Development files for FFmpeg's image scaling and colorspace library Provides: libswscale%{?pkg_suffix}-devel = %{version}-%{release} @@ -641,50 +560,12 @@ pixel format conversion operations. This subpackage contains the headers for FFmpeg libswscale. -%files -n libswscale%{?pkg_suffix}-devel -%{_includedir}/%{name}/libswscale -%{_libdir}/pkgconfig/libswscale.pc -%{_libdir}/libswscale.so -%{_mandir}/man3/libswscale.3* - -%endif -# freeworld_lavc bcond - -%dnl -------------------------------------------------------------------------------- - -%if %{with freeworld_lavc} -%package -n libavcodec-freeworld -Summary: FFmpeg codec library - freeworld overlay -Requires: libavutil%{?basepkg_suffix}%{_isa} >= %{version}-%{release} -Requires: libswresample%{?basepkg_suffix}%{_isa} >= %{version}-%{release} -Supplements: libavcodec%{?basepkg_suffix}%{_isa} >= %{version}-%{release} -# We require libopenh264 library, which has a dummy implementation and a real one -# In the event that this is being installed, we want to install this version -Requires: openh264%{_isa} - -%description -n libavcodec-freeworld -The libavcodec library provides a generic encoding/decoding framework -and contains multiple decoders and encoders for audio, video and -subtitle streams, and several bitstream filters. - -This build includes the full range of codecs offered by ffmpeg. - -%files -n libavcodec-freeworld -%{_sysconfdir}/ld.so.conf.d/%{name}-%{_lib}.conf -%{_libdir}/%{name}/libavcodec.so.%{av_codec_soversion}{,.*} - -# Re-enable ldconfig_scriptlets macros -%{!?ldconfig:%global ldconfig /sbin/ldconfig} -%ldconfig_scriptlets -n libavcodec-freeworld - -%endif - -%dnl -------------------------------------------------------------------------------- - %prep -%{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data='%{SOURCE0}' +%if %{with upstream_tarball} +%{gpgverify} --keyring='%{SOURCE3}' --signature='%{SOURCE2}' --data='%{SOURCE0}' +%endif -%autosetup -S git_am +%autosetup -a1 -S git_am install -m 0644 %{SOURCE20} enable_decoders install -m 0644 %{SOURCE21} enable_encoders # fix -O3 -g in host_cflags @@ -692,7 +573,7 @@ sed -i "s|check_host_cflags -O3|check_host_cflags %{optflags}|" configure install -m0755 -d _doc/examples cp -a doc/examples/{*.c,Makefile,README} _doc/examples/ -%conf +%build %set_build_flags # This is not a normal configure script, don't use %%configure @@ -708,42 +589,31 @@ cp -a doc/examples/{*.c,Makefile,README} _doc/examples/ --optflags="%{build_cflags}" \ --extra-ldflags="%{build_ldflags}" \ --disable-htmlpages \ - --disable-static \ - --disable-stripping \ --enable-pic \ + --disable-stripping \ --enable-shared \ + --disable-static \ --enable-gpl \ --enable-version3 \ - --enable-amf \ - --enable-avcodec \ - --enable-avdevice \ - --enable-avfilter \ - --enable-avformat \ - --enable-alsa \ + --enable-libsmbclient \ + --disable-openssl \ --enable-bzlib \ + --enable-frei0r \ %if %{with chromaprint} --enable-chromaprint \ %else --disable-chromaprint \ %endif - --disable-cuda-nvcc \ -%if %{with ffnvcodec} - --enable-cuvid \ -%endif - --disable-decklink \ - --enable-frei0r \ --enable-gcrypt \ - --enable-gmp \ --enable-gnutls \ - --enable-gray \ - --enable-iconv \ --enable-ladspa \ %if %{with lcms2} --enable-lcms2 \ %endif + --enable-libshaderc \ + --enable-vulkan \ + --disable-cuda-sdk \ --enable-libaom \ - --enable-libaribb24 \ - --enable-libaribcaption \ --enable-libass \ --enable-libbluray \ --enable-libbs2b \ @@ -751,12 +621,10 @@ cp -a doc/examples/{*.c,Makefile,README} _doc/examples/ --enable-libcdio \ --enable-libcodec2 \ --enable-libdav1d \ - --disable-libdavs2 \ %if %{with dc1394} --enable-libdc1394 \ %endif - --enable-libdvdnav \ - --enable-libdvdread \ + --enable-libdrm \ --enable-libfdk-aac \ %if %{with flite} --enable-libflite \ @@ -765,7 +633,6 @@ cp -a doc/examples/{*.c,Makefile,README} _doc/examples/ --enable-libfreetype \ --enable-libfribidi \ --enable-libgme \ - --enable-libharfbuzz \ --enable-libgsm \ %if %{with dc1394} --enable-libiec61883 \ @@ -773,21 +640,10 @@ cp -a doc/examples/{*.c,Makefile,README} _doc/examples/ --enable-libilbc \ --enable-libjack \ --enable-libjxl \ - --enable-libklvanc \ - --disable-liblensfun \ - --disable-liblcevc-dec \ -%if %{with lc3} - --enable-liblc3 \ -%endif --enable-libmodplug \ --enable-libmp3lame \ --enable-libmysofa \ - --disable-libnpp \ - --enable-libopencore-amrnb \ - --enable-libopencore-amrwb \ - --disable-libopencv \ - --enable-liboapv \ - --enable-libopenh264 \ + --enable-libopenh264-dlopen \ --enable-libopenjpeg \ --enable-libopenmpt \ --enable-libopus \ @@ -795,98 +651,66 @@ cp -a doc/examples/{*.c,Makefile,README} _doc/examples/ --enable-libplacebo \ %endif --enable-libpulse \ - --enable-libqrencode \ - --disable-libquirc \ --enable-librabbitmq \ --enable-librav1e \ --enable-librist \ --enable-librsvg \ -%if %{with librtmp} - --enable-librtmp \ -%endif --enable-librubberband \ - --enable-libshaderc \ - --disable-libshine \ - --enable-libsmbclient \ --enable-libsnappy \ --enable-libsvtav1 \ --enable-libsoxr \ --enable-libspeex \ - --enable-libsrt \ --enable-libssh \ - --disable-libtensorflow \ + --enable-libsrt \ --enable-libtesseract \ --enable-libtheora \ - --disable-libtorch \ - --disable-libuavs3d \ --enable-libtwolame \ - --enable-libv4l2 \ --enable-libvidstab \ %if %{with vmaf} --enable-libvmaf \ %endif - --enable-libvo-amrwbenc \ --enable-libvorbis \ + --enable-libv4l2 \ + --enable-libvpx \ + --enable-libwebp \ + --enable-libxml2 \ + --enable-libzimg \ + --enable-libzmq \ + --enable-libzvbi \ +%if %{with lto} + --enable-lto \ +%endif %if %{with vpl} --enable-libvpl \ %endif - --enable-libvpx \ - --enable-libwebp \ + --enable-lv2 \ + --enable-vaapi \ + --enable-vdpau \ + --enable-libopencore-amrnb \ + --enable-libopencore-amrwb \ + --enable-libvo-amrwbenc \ %if %{with x264} --enable-libx264 \ %endif %if %{with x265} --enable-libx265 \ %endif - --disable-libxavs2 \ - --disable-libxavs \ - --enable-libxcb \ - --enable-libxcb-shape \ - --enable-libxcb-shm \ - --enable-libxcb-xfixes \ -%if %{with evc_main} - --enable-libxeve \ - --enable-libxevd \ -%else - --enable-libxeveb \ - --enable-libxevdb \ +%if %{with librtmp} + --enable-librtmp \ %endif - --enable-libxml2 \ --enable-libxvid \ - --enable-libzimg \ - --enable-libzmq \ - --enable-libzvbi \ -%if %{with lto} - --enable-lto \ -%endif - --enable-lv2 \ - --enable-lzma \ - --enable-manpages \ -%if %{with ffnvcodec} - --enable-nvdec \ - --enable-nvenc \ -%endif --enable-openal \ - --disable-openssl \ + --enable-opencl \ + --enable-opengl \ --enable-pthreads \ - --enable-sdl2 \ - --enable-shared \ - --enable-swresample \ - --enable-swscale \ - --enable-v4l2-m2m \ - --enable-vaapi \ --enable-vapoursynth \ - --enable-vdpau \ - --enable-vulkan \ - --enable-xlib \ - --enable-zlib \ %if %{without all_codecs} --enable-muxers \ --enable-demuxers \ --enable-hwaccels \ --disable-encoders \ --disable-decoders \ - --disable-decoder="h264,hevc,vc1,vvc" \ + --disable-decoder="h264,hevc,vc1" \ --enable-encoder="$(perl -pe 's{^(\w*).*}{$1,}gs' %{buildroot}%{_sysconfdir}/ld.so.conf.d/%{name}-%{_lib}.conf -cp -pa %{buildroot}%{_libdir}/libavcodec.so.%{av_codec_soversion}{,.*} %{buildroot}%{_libdir}/%{name} -# Drop unneeded stuff -rm -f %{buildroot}%{_libdir}/*.* -rm -rf %{buildroot}%{_libdir}/pkgconfig -rm -rf %{buildroot}%{_includedir} -rm -rf %{buildroot}%{_bindir} -rm -rf %{buildroot}%{_datadir} -%endif +%ldconfig_scriptlets -n libavcodec%{?pkg_suffix} +%ldconfig_scriptlets -n libavdevice%{?pkg_suffix} +%ldconfig_scriptlets -n libavfilter%{?pkg_suffix} +%ldconfig_scriptlets -n libavformat%{?pkg_suffix} +%ldconfig_scriptlets -n libavutil%{?pkg_suffix} +%ldconfig_scriptlets -n libpostproc%{?pkg_suffix} +%ldconfig_scriptlets -n libswresample%{?pkg_suffix} +%ldconfig_scriptlets -n libswscle%{?pkg_suffix} +%files -n %{pkg_name} +%doc CREDITS README.md +%{_bindir}/ffmpeg +%{_bindir}/ffplay +%{_bindir}/ffprobe +%{_mandir}/man1/ff*.1* +%dir %{_datadir}/%{name} +%{_datadir}/%{name}/ffprobe.xsd +%{_datadir}/%{name}/libvpx-*.ffpreset + +%files -n %{pkg_name}-devel +%doc MAINTAINERS doc/APIchanges doc/*.txt +%doc _doc/examples + +%files -n libavcodec%{?pkg_suffix} +%license COPYING.GPLv2 LICENSE.md +%{_libdir}/libavcodec.so.%{av_codec_soversion}{,.*} + +%files -n libavcodec%{?pkg_suffix}-devel +%{_includedir}/%{name}/libavcodec +%{_libdir}/pkgconfig/libavcodec.pc +%{_libdir}/libavcodec.so +%{_mandir}/man3/libavcodec.3* + +%files -n libavdevice%{?pkg_suffix} +%license COPYING.GPLv2 LICENSE.md +%{_libdir}/libavdevice.so.%{av_device_soversion}{,.*} + +%files -n libavdevice%{?pkg_suffix}-devel +%{_includedir}/%{name}/libavdevice +%{_libdir}/pkgconfig/libavdevice.pc +%{_libdir}/libavdevice.so +%{_mandir}/man3/libavdevice.3* + +%files -n libavfilter%{?pkg_suffix} +%license COPYING.GPLv2 LICENSE.md +%{_libdir}/libavfilter.so.%{av_filter_soversion}{,.*} + +%files -n libavfilter%{?pkg_suffix}-devel +%{_includedir}/%{name}/libavfilter +%{_libdir}/pkgconfig/libavfilter.pc +%{_libdir}/libavfilter.so +%{_mandir}/man3/libavfilter.3* + +%files -n libavformat%{?pkg_suffix} +%license COPYING.GPLv2 LICENSE.md +%{_libdir}/libavformat.so.%{av_format_soversion}{,.*} + +%files -n libavformat%{?pkg_suffix}-devel +%{_includedir}/%{name}/libavformat +%{_libdir}/pkgconfig/libavformat.pc +%{_libdir}/libavformat.so +%{_mandir}/man3/libavformat.3* + +%files -n libavutil%{?pkg_suffix} +%license COPYING.GPLv2 LICENSE.md +%{_libdir}/libavutil.so.%{av_util_soversion}{,.*} + +%files -n libavutil%{?pkg_suffix}-devel +%{_includedir}/%{name}/libavutil +%{_libdir}/pkgconfig/libavutil.pc +%{_libdir}/libavutil.so +%{_mandir}/man3/libavutil.3* + +%files -n libpostproc%{?pkg_suffix} +%license COPYING.GPLv2 LICENSE.md +%{_libdir}/libpostproc.so.%{postproc_soversion}{,.*} + +%files -n libpostproc%{?pkg_suffix}-devel +%{_includedir}/%{name}/libpostproc +%{_libdir}/pkgconfig/libpostproc.pc +%{_libdir}/libpostproc.so + +%files -n libswresample%{?pkg_suffix} +%license COPYING.GPLv2 LICENSE.md +%{_libdir}/libswresample.so.%{swresample_soversion}{,.*} + +%files -n libswresample%{?pkg_suffix}-devel +%{_includedir}/%{name}/libswresample +%{_libdir}/pkgconfig/libswresample.pc +%{_libdir}/libswresample.so +%{_mandir}/man3/libswresample.3* + +%files -n libswscale%{?pkg_suffix} +%license COPYING.GPLv2 LICENSE.md +%{_libdir}/libswscale.so.%{swscale_soversion}{,.*} + +%files -n libswscale%{?pkg_suffix}-devel +%{_includedir}/%{name}/libswscale +%{_libdir}/pkgconfig/libswscale.pc +%{_libdir}/libswscale.so +%{_mandir}/man3/libswscale.3* %changelog -* Thu Dec 04 2025 Marcin Juszkiewicz - 8.0.1-2 -- disable dc1394 and ffnvcodec on risc-v - -* Fri Nov 21 2025 Dominik Mierzejewski - 8.0.1-1 -- Update to 8.0.1 (resolves rhbz#2416044) -- Split configure step to conf stage - -* Fri Nov 14 2025 Neal Gompa - 8.0-2 -- Disable lc3 only on RHEL 10 - -* Sun Nov 02 2025 Neal Gompa - 8.0-1 -- Rebase to version 8.0 - -* Sun Nov 02 2025 Dominik Mierzejewski - 7.1.2-3 -- Re-enable openal support (dropped by accident in commit 5917b714, resolves rhbz#2404091) - -* Thu Oct 02 2025 Robert-André Mauchin - 7.1.2-2 -- Rebuild for svt-av1 soname bump - -* Wed Sep 24 2025 Simone Caronni - 7.1.2-1 -- Update to 7.1.2. -- Enable VANC processing for SDI. -- Explicitly list all implicitly enabled/disabled options. - -* Tue Aug 26 2025 Neal Gompa - 7.1.1-10 -- Disable all subpackages except libavcodec-freeworld with the freeworld bcond - -* Mon Aug 25 2025 Neal Gompa - 7.1.1-9 -- Enable support for MPEG-5/EVC - -* Thu Aug 21 2025 Neal Gompa - 7.1.1-8 -- Reorganize spec to group subpackage definitions together -- Add freeworld conditional for third-party builds -- Drop unneeded scriptlets - -* Fri Aug 01 2025 Neal Gompa - 7.1.1-7 -- Always verify sources - -* Tue Jul 29 2025 Nicolas Chauvet - 7.1.1-6 -- Rebuilt for libplacebo - -* Wed Jul 23 2025 Fedora Release Engineering - 7.1.1-5 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild - -* Fri Jun 13 2025 Neal Gompa - 7.1.1-4 -- Switch to regular upstream sources for package build -- Enable more codecs - -* Sat Mar 22 2025 Songsong Zhang - 7.1.1-3 -- Add missing source files for riscv64 - -* Thu Mar 13 2025 Fabio Valentini - 7.1.1-2 -- Rebuild for noopenh264 2.6.0 - -* Thu Mar 06 2025 Dominik Mierzejewski - 7.1.1-1 -- Update to 7.1.1 (resolves rhbz#2349351) -- Enable LC3 codec via liblc3 -- Backport fix for CVE-2025-22921 (resolves rhbz#2346558) - -* Fri Feb 07 2025 Yaakov Selkowitz - 7.1-1 -- Rebase to 7.1 (rhbz#2273572) - -* Wed Feb 05 2025 Robert-André Mauchin - 7.0.2-13 -- Rebuilt for aom 3.11.0 - -* Sun Feb 02 2025 Sérgio Basto - 7.0.2-12 -- Rebuild for jpegxl (libjxl) 0.11.1 - -* Wed Jan 29 2025 Simone Caronni - 7.0.2-11 -- Rebuild for updated VapourSynth. - -* Thu Jan 16 2025 Fedora Release Engineering - 7.0.2-10 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild - -* Thu Jan 09 2025 Michel Lind - 7.0.2-9 -- Rebuilt for rubberband 4 - -* Tue Nov 12 2024 Sandro Mani - 7.0.2-8 -- Rebuild (tesseract) - -* Mon Oct 07 2024 Yaakov Selkowitz - 7.0.2-7 -- Properly enable aribb24/libaribcaption -- Disable VANC dependency as it depends on decklink - -* Mon Oct 07 2024 Neal Gompa - 7.0.2-6 -- Enable SDI data processing (Kernel Labs VANC) processing -- Enable Japanese DVD subtitles/teletext (aribb24/libaribcaption) - -* Mon Oct 07 2024 Yaakov Selkowitz - 7.0.2-5 -- Properly enable noopenh264 - -* Wed Oct 02 2024 Neal Gompa - 7.0.2-4 -- Fix chromaprint bcond - -* Wed Sep 25 2024 Michel Lind - 7.0.2-3 -- Disable omxil completely, it's now retired -- Rebuild for tesseract-5.4.1-3 (soversion change from 5.4.1 to just 5.4) - -* Fri Sep 20 2024 Neal Gompa - 7.0.2-2 -- Rebuild for newer ffnvcodec - -* Fri Sep 06 2024 Neal Gompa - 7.0.2-1 -- Rebase to 7.0.2 (rhbz#2273572) -- Drop OpenH264 dlopen headers as we use noopenh264 now -- Use modern bconds - -* Sat Aug 24 2024 Fabio Valentini - 6.1.2-1 -- Update to 6.1.2 - -* Sat Jul 20 2024 Neal Gompa - 6.1.1-19 -- Backport fixes for Mesa 24.0.6+ / 21.1.4+ changes for VA-API - -* Wed Jul 17 2024 Fedora Release Engineering - 6.1.1-18 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild - -* Tue Jul 16 2024 Nicolas Chauvet - 6.1.1-17 -- Rebuilt for libplacebo/vmaf - -* Wed Jun 19 2024 Dominik Mierzejewski - 6.1.1-16 -- Backport fix for CVE-2023-49528 - -* Thu Jun 13 2024 Sandro Mani - 6.1.1-15 -- Rebuild for tesseract-5.4.1 - -* Wed May 29 2024 Robert-André Mauchin - 6.1.1-14 -- Rebuild for svt-av1 2.1.0 - -* Wed May 22 2024 Simone Caronni - 6.1.1-13 -- Rebuild for updated VapourSynth. - -* Tue Apr 23 2024 Kalev Lember - 6.1.1-12 -- Stop using bundled openh264 headers in F40+ and build against noopenh264 -- Backport a fix to build with Vulkan headers >= 1.3.280.0 - -* Wed Mar 13 2024 Sérgio Basto - 6.1.1-11 -- Rebuild for jpegxl (libjxl) 0.10.2 - -* Tue Mar 12 2024 Dominik Mierzejewski - 6.1.1-10 -- Enable drawtext filter (requires libharfbuzz) - -* Wed Feb 14 2024 Sérgio Basto - 6.1.1-9 -- Rebuild for jpegxl (libjxl) 0.9.2 with soname bump - -* Wed Feb 07 2024 Pete Walter - 6.1.1-8 -- Rebuild for libvpx 1.14.x - -* Sun Jan 28 2024 Sandro Mani - 6.1.1-7 -- Rebuild (tesseract) - -* Wed Jan 24 2024 Fedora Release Engineering - 6.1.1-6 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild - -* Fri Jan 19 2024 Fedora Release Engineering - 6.1.1-5 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild - -* Mon Jan 15 2024 Neal Gompa - 6.1.1-4 -- Add missing files for some of the libraries to fix riscv64 builds - -* Fri Jan 12 2024 Fabio Valentini - 6.1.1-3 -- Rebuild for dav1d 1.3.0 - -* Fri Jan 05 2024 Florian Weimer - 6.1.1-2 -- Backport upstream patch to fix C compatibility issues - -* Thu Jan 04 2024 Neal Gompa - 6.1.1-1 -- Update to 6.1.1 - -* Thu Jan 04 2024 Neal Gompa - 6.1-1 -- Rebase to 6.1 - * Wed Dec 06 2023 Kalev Lember - 6.0.1-2 - Prefer openh264 over noopenh264 - Backport upstream patch to drop openh264 runtime version checks @@ -1150,44 +888,14 @@ rm -rf %{buildroot}%{_datadir} - Add ffmpeg chromium support patch (#2240127) - Use git to apply patches -* Fri Nov 10 2023 Neal Gompa - 6.0-16 +* Fri Nov 10 2023 Neal Gompa - 6.0-6 - Add patches to support enhanced RTMP and AV1 encoding through VA-API - Force AAC decoding through fdk-aac-free -* Sun Oct 08 2023 Dominik Mierzejewski - 6.0-15 +* Sun Oct 08 2023 Dominik Mierzejewski - 6.0-5 - Backport upstream patch to fix segfault when passing non-existent filter option (rfbz#6773) -* Sat Oct 07 2023 Sandro Mani - 6.0-14 -- Rebuild (tesseract) - -* Fri Sep 29 2023 Nicolas Chauvet - 6.0-13 -- Rebuilt for libplacebo - -* Fri Aug 25 2023 Dominik Mierzejewski - 6.0-12 -- Backport upstream patch to fix assembly with binutils 2.41. - -* Sat Aug 05 2023 Richard Shaw - 6.0-11 -- Rebuild for codec2. - -* Fri Jul 28 2023 Dominik Mierzejewski - 6.0-10 -- Rebuild for libplacebo - -* Wed Jul 19 2023 Fedora Release Engineering - 6.0-9 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild - -* Fri Jul 14 2023 Sandro Mani - 6.0-8 -- Rebuild (tesseract) - -* Sun Jun 18 2023 Sérgio Basto - 6.0-7 -- Mass rebuild for jpegxl-0.8.1 - -* Mon Jun 12 2023 Dominik Mierzejewski - 6.0-6 -- Rebuild for libdc1394 - -* Thu Apr 06 2023 Adam Williamson - 6.0-5 -- Rebuild (tesseract) again - * Mon Apr 03 2023 Neal Gompa - 6.0-4 - Include RISC-V support sources in the tarball diff --git a/ffmpeg_free_sources b/ffmpeg_free_sources new file mode 100644 index 0000000..0354de5 --- /dev/null +++ b/ffmpeg_free_sources @@ -0,0 +1,4051 @@ +CONTRIBUTING.md +COPYING.GPLv2 +COPYING.GPLv3 +COPYING.LGPLv2.1 +COPYING.LGPLv3 +CREDITS +Changelog +INSTALL.md +LICENSE.md +MAINTAINERS +Makefile +README.md +RELEASE +RELEASE_NOTES +VERSION +compat/atomics/gcc/stdatomic.h +compat/cuda/dynlink_loader.h +compat/va_copy.h +compat/w32dlfcn.h +configure +doc/APIchanges +doc/Doxyfile +doc/Makefile +doc/authors.texi +doc/bitstream_filters.texi +doc/bootstrap.min.css +doc/build_system.txt +doc/codecs.texi +doc/decoders.texi +doc/default.css +doc/demuxers.texi +doc/dev_community/community.md +doc/dev_community/resolution_process.md +doc/developer.texi +doc/devices.texi +doc/doxy-wrapper.sh +doc/encoders.texi +doc/errno.txt +doc/examples/Makefile +doc/examples/Makefile.example +doc/examples/README +doc/examples/avio_http_serve_files.c +doc/examples/avio_list_dir.c +doc/examples/avio_read_callback.c +doc/examples/decode_audio.c +doc/examples/decode_filter_audio.c +doc/examples/decode_filter_video.c +doc/examples/decode_video.c +doc/examples/demux_decode.c +doc/examples/encode_audio.c +doc/examples/encode_video.c +doc/examples/extract_mvs.c +doc/examples/filter_audio.c +doc/examples/hw_decode.c +doc/examples/mux.c +doc/examples/qsv_decode.c +doc/examples/qsv_transcode.c +doc/examples/remux.c +doc/examples/resample_audio.c +doc/examples/scale_video.c +doc/examples/show_metadata.c +doc/examples/transcode.c +doc/examples/transcode_aac.c +doc/examples/vaapi_encode.c +doc/examples/vaapi_transcode.c +doc/faq.texi +doc/fate.texi +doc/fate_config.sh.template +doc/ffmpeg-bitstream-filters.texi +doc/ffmpeg-codecs.texi +doc/ffmpeg-devices.texi +doc/ffmpeg-filters.texi +doc/ffmpeg-formats.texi +doc/ffmpeg-protocols.texi +doc/ffmpeg-resampler.texi +doc/ffmpeg-scaler.texi +doc/ffmpeg-utils.texi +doc/ffmpeg.texi +doc/ffmpeg.txt +doc/ffplay.texi +doc/ffprobe.texi +doc/ffprobe.xsd +doc/fftools-common-opts.texi +doc/filter_design.txt +doc/filters.texi +doc/formats.texi +doc/general.texi +doc/general_contents.texi +doc/git-howto.texi +doc/indevs.texi +doc/issue_tracker.txt +doc/lexicon +doc/libav-merge.txt +doc/libavcodec.texi +doc/libavdevice.texi +doc/libavfilter.texi +doc/libavformat.texi +doc/libavutil.texi +doc/libswresample.texi +doc/libswscale.texi +doc/mailing-list-faq.texi +doc/metadata.texi +doc/mips.txt +doc/multithreading.txt +doc/muxers.texi +doc/nut.texi +doc/optimization.txt +doc/outdevs.texi +doc/patchwork +doc/platform.texi +doc/print_options.c +doc/protocols.texi +doc/rate_distortion.txt +doc/resampler.texi +doc/scaler.texi +doc/snow.txt +doc/style.min.css +doc/swresample.txt +doc/swscale.txt +doc/t2h.init +doc/t2h.pm +doc/tablegen.txt +doc/texi2pod.pl +doc/texidep.pl +doc/transforms.md +doc/undefined.txt +doc/utils.texi +doc/writing_filters.txt +ffbuild/arch.mak +ffbuild/bin2c.c +ffbuild/common.mak +ffbuild/library.mak +ffbuild/libversion.sh +ffbuild/pkgconfig_generate.sh +ffbuild/version.sh +fftools/Makefile +fftools/cmdutils.c +fftools/cmdutils.h +fftools/ffmpeg.c +fftools/ffmpeg.h +fftools/ffmpeg_demux.c +fftools/ffmpeg_filter.c +fftools/ffmpeg_hw.c +fftools/ffmpeg_mux.c +fftools/ffmpeg_mux.h +fftools/ffmpeg_mux_init.c +fftools/ffmpeg_opt.c +fftools/ffplay.c +fftools/ffprobe.c +fftools/fopen_utf8.h +fftools/objpool.c +fftools/objpool.h +fftools/opt_common.c +fftools/opt_common.h +fftools/sync_queue.c +fftools/sync_queue.h +fftools/thread_queue.c +fftools/thread_queue.h +libavcodec/012v.c +libavcodec/4xm.c +libavcodec/8bps.c +libavcodec/8svx.c +libavcodec/Makefile +libavcodec/a64colors.h +libavcodec/a64multienc.c +libavcodec/a64tables.h +libavcodec/aac.h +libavcodec/aac_ac3_parser.c +libavcodec/aac_ac3_parser.h +libavcodec/aac_adtstoasc_bsf.c +libavcodec/aac_defines.h +libavcodec/aac_parser.c +libavcodec/aaccoder.c +libavcodec/aaccoder_trellis.h +libavcodec/aaccoder_twoloop.h +libavcodec/aacdec.c +libavcodec/aacdec_template.c +libavcodec/aacdectab.h +libavcodec/aacenc.c +libavcodec/aacenc.h +libavcodec/aacenc_is.c +libavcodec/aacenc_is.h +libavcodec/aacenc_ltp.c +libavcodec/aacenc_ltp.h +libavcodec/aacenc_pred.c +libavcodec/aacenc_pred.h +libavcodec/aacenc_quantization.h +libavcodec/aacenc_quantization_misc.h +libavcodec/aacenc_tns.c +libavcodec/aacenc_tns.h +libavcodec/aacenc_utils.h +libavcodec/aacenctab.c +libavcodec/aacenctab.h +libavcodec/aacps.c +libavcodec/aacps.h +libavcodec/aacps_common.c +libavcodec/aacps_float.c +libavcodec/aacps_tablegen.h +libavcodec/aacpsdata.c +libavcodec/aacpsdsp.h +libavcodec/aacpsdsp_float.c +libavcodec/aacpsdsp_template.c +libavcodec/aacpsy.c +libavcodec/aacsbr.c +libavcodec/aacsbr.h +libavcodec/aacsbr_template.c +libavcodec/aacsbrdata.h +libavcodec/aactab.c +libavcodec/aactab.h +libavcodec/aandcttab.c +libavcodec/aandcttab.h +libavcodec/aarch64/Makefile +libavcodec/aarch64/aacpsdsp_init_aarch64.c +libavcodec/aarch64/aacpsdsp_neon.S +libavcodec/aarch64/asm-offsets.h +libavcodec/aarch64/cabac.h +libavcodec/aarch64/fft_init_aarch64.c +libavcodec/aarch64/fft_neon.S +libavcodec/aarch64/fmtconvert_init.c +libavcodec/aarch64/fmtconvert_neon.S +libavcodec/aarch64/h264chroma_init_aarch64.c +libavcodec/aarch64/h264cmc_neon.S +libavcodec/aarch64/h264dsp_init_aarch64.c +libavcodec/aarch64/h264dsp_neon.S +libavcodec/aarch64/h264idct_neon.S +libavcodec/aarch64/h264pred_init.c +libavcodec/aarch64/h264pred_neon.S +libavcodec/aarch64/h264qpel_init_aarch64.c +libavcodec/aarch64/h264qpel_neon.S +libavcodec/aarch64/hpeldsp_init_aarch64.c +libavcodec/aarch64/hpeldsp_neon.S +libavcodec/aarch64/idct.h +libavcodec/aarch64/idctdsp_init_aarch64.c +libavcodec/aarch64/idctdsp_neon.S +libavcodec/aarch64/mdct_neon.S +libavcodec/aarch64/me_cmp_init_aarch64.c +libavcodec/aarch64/me_cmp_neon.S +libavcodec/aarch64/mpegaudiodsp_init.c +libavcodec/aarch64/mpegaudiodsp_neon.S +libavcodec/aarch64/neon.S +libavcodec/aarch64/neontest.c +libavcodec/aarch64/opusdsp_init.c +libavcodec/aarch64/opusdsp_neon.S +libavcodec/aarch64/pixblockdsp_init_aarch64.c +libavcodec/aarch64/pixblockdsp_neon.S +libavcodec/aarch64/sbrdsp_init_aarch64.c +libavcodec/aarch64/sbrdsp_neon.S +libavcodec/aarch64/simple_idct_neon.S +libavcodec/aarch64/synth_filter_init.c +libavcodec/aarch64/synth_filter_neon.S +libavcodec/aarch64/vc1dsp_init_aarch64.c +libavcodec/aarch64/vc1dsp_neon.S +libavcodec/aarch64/videodsp.S +libavcodec/aarch64/videodsp_init.c +libavcodec/aarch64/vorbisdsp_init.c +libavcodec/aarch64/vorbisdsp_neon.S +libavcodec/aarch64/vp8dsp.h +libavcodec/aarch64/vp8dsp_init_aarch64.c +libavcodec/aarch64/vp8dsp_neon.S +libavcodec/aarch64/vp9dsp_init.h +libavcodec/aarch64/vp9dsp_init_10bpp_aarch64.c +libavcodec/aarch64/vp9dsp_init_12bpp_aarch64.c +libavcodec/aarch64/vp9dsp_init_16bpp_aarch64_template.c +libavcodec/aarch64/vp9dsp_init_aarch64.c +libavcodec/aarch64/vp9itxfm_16bpp_neon.S +libavcodec/aarch64/vp9itxfm_neon.S +libavcodec/aarch64/vp9lpf_16bpp_neon.S +libavcodec/aarch64/vp9lpf_neon.S +libavcodec/aarch64/vp9mc_16bpp_neon.S +libavcodec/aarch64/vp9mc_aarch64.S +libavcodec/aarch64/vp9mc_neon.S +libavcodec/aasc.c +libavcodec/ac3.c +libavcodec/ac3.h +libavcodec/ac3_channel_layout_tab.c +libavcodec/ac3_channel_layout_tab.h +libavcodec/ac3_parser.c +libavcodec/ac3_parser.h +libavcodec/ac3_parser_internal.h +libavcodec/ac3dec.c +libavcodec/ac3dec.h +libavcodec/ac3dec_data.c +libavcodec/ac3dec_data.h +libavcodec/ac3dec_float.c +libavcodec/ac3defs.h +libavcodec/ac3dsp.c +libavcodec/ac3dsp.h +libavcodec/ac3enc.c +libavcodec/ac3enc.h +libavcodec/ac3enc_float.c +libavcodec/ac3enc_template.c +libavcodec/ac3tab.c +libavcodec/ac3tab.h +libavcodec/acelp_filters.c +libavcodec/acelp_filters.h +libavcodec/acelp_pitch_delay.c +libavcodec/acelp_pitch_delay.h +libavcodec/acelp_vectors.c +libavcodec/acelp_vectors.h +libavcodec/adpcm.c +libavcodec/adpcm.h +libavcodec/adpcm_data.c +libavcodec/adpcm_data.h +libavcodec/adpcmenc.c +libavcodec/adts_header.c +libavcodec/adts_header.h +libavcodec/adts_parser.c +libavcodec/adts_parser.h +libavcodec/adx.c +libavcodec/adx.h +libavcodec/adx_parser.c +libavcodec/adxdec.c +libavcodec/adxenc.c +libavcodec/alac.c +libavcodec/alac_data.c +libavcodec/alac_data.h +libavcodec/alacdsp.c +libavcodec/alacdsp.h +libavcodec/alacenc.c +libavcodec/aliaspixdec.c +libavcodec/aliaspixenc.c +libavcodec/allcodecs.c +libavcodec/alpha/Makefile +libavcodec/amfenc.c +libavcodec/amfenc.h +libavcodec/amfenc_av1.c +libavcodec/amfenc_h264.c +libavcodec/amfenc_hevc.c +libavcodec/amr.h +libavcodec/amr_parser.c +libavcodec/amrnbdata.h +libavcodec/amrnbdec.c +libavcodec/amrwbdata.h +libavcodec/amrwbdec.c +libavcodec/anm.c +libavcodec/ansi.c +libavcodec/apac.c +libavcodec/apedec.c +libavcodec/apng.h +libavcodec/arbc.c +libavcodec/argo.c +libavcodec/arm/Makefile +libavcodec/arm/aac.h +libavcodec/arm/aacpsdsp_init_arm.c +libavcodec/arm/aacpsdsp_neon.S +libavcodec/arm/ac3dsp_arm.S +libavcodec/arm/ac3dsp_armv6.S +libavcodec/arm/ac3dsp_init_arm.c +libavcodec/arm/ac3dsp_neon.S +libavcodec/arm/asm-offsets.h +libavcodec/arm/audiodsp_arm.h +libavcodec/arm/audiodsp_init_arm.c +libavcodec/arm/audiodsp_init_neon.c +libavcodec/arm/audiodsp_neon.S +libavcodec/arm/blockdsp_arm.h +libavcodec/arm/blockdsp_init_arm.c +libavcodec/arm/blockdsp_init_neon.c +libavcodec/arm/blockdsp_neon.S +libavcodec/arm/cabac.h +libavcodec/arm/dca.h +libavcodec/arm/fft_init_arm.c +libavcodec/arm/fft_neon.S +libavcodec/arm/fft_vfp.S +libavcodec/arm/flacdsp_arm.S +libavcodec/arm/flacdsp_init_arm.c +libavcodec/arm/fmtconvert_init_arm.c +libavcodec/arm/fmtconvert_neon.S +libavcodec/arm/fmtconvert_vfp.S +libavcodec/arm/g722dsp_init_arm.c +libavcodec/arm/g722dsp_neon.S +libavcodec/arm/h264chroma_init_arm.c +libavcodec/arm/h264cmc_neon.S +libavcodec/arm/h264dsp_init_arm.c +libavcodec/arm/h264dsp_neon.S +libavcodec/arm/h264idct_neon.S +libavcodec/arm/h264pred_init_arm.c +libavcodec/arm/h264pred_neon.S +libavcodec/arm/h264qpel_init_arm.c +libavcodec/arm/h264qpel_neon.S +libavcodec/arm/hpeldsp_arm.S +libavcodec/arm/hpeldsp_arm.h +libavcodec/arm/hpeldsp_armv6.S +libavcodec/arm/hpeldsp_init_arm.c +libavcodec/arm/hpeldsp_init_armv6.c +libavcodec/arm/hpeldsp_init_neon.c +libavcodec/arm/hpeldsp_neon.S +libavcodec/arm/idct.h +libavcodec/arm/idctdsp_arm.S +libavcodec/arm/idctdsp_arm.h +libavcodec/arm/idctdsp_armv6.S +libavcodec/arm/idctdsp_init_arm.c +libavcodec/arm/idctdsp_init_armv5te.c +libavcodec/arm/idctdsp_init_armv6.c +libavcodec/arm/idctdsp_init_neon.c +libavcodec/arm/idctdsp_neon.S +libavcodec/arm/int_neon.S +libavcodec/arm/jrevdct_arm.S +libavcodec/arm/lossless_audiodsp_init_arm.c +libavcodec/arm/lossless_audiodsp_neon.S +libavcodec/arm/mathops.h +libavcodec/arm/mdct_neon.S +libavcodec/arm/mdct_vfp.S +libavcodec/arm/me_cmp_armv6.S +libavcodec/arm/me_cmp_init_arm.c +libavcodec/arm/mlpdsp_armv5te.S +libavcodec/arm/mlpdsp_armv6.S +libavcodec/arm/mlpdsp_init_arm.c +libavcodec/arm/mpegaudiodsp_fixed_armv6.S +libavcodec/arm/mpegaudiodsp_init_arm.c +libavcodec/arm/mpegvideo_arm.c +libavcodec/arm/mpegvideo_arm.h +libavcodec/arm/mpegvideo_armv5te.c +libavcodec/arm/mpegvideo_armv5te_s.S +libavcodec/arm/mpegvideo_neon.S +libavcodec/arm/mpegvideoencdsp_armv6.S +libavcodec/arm/mpegvideoencdsp_init_arm.c +libavcodec/arm/neon.S +libavcodec/arm/neontest.c +libavcodec/arm/pixblockdsp_armv6.S +libavcodec/arm/pixblockdsp_init_arm.c +libavcodec/arm/pixblockdsp_neon.S +libavcodec/arm/rdft_init_arm.c +libavcodec/arm/rdft_neon.S +libavcodec/arm/sbcdsp_armv6.S +libavcodec/arm/sbcdsp_init_arm.c +libavcodec/arm/sbcdsp_neon.S +libavcodec/arm/sbrdsp_init_arm.c +libavcodec/arm/sbrdsp_neon.S +libavcodec/arm/simple_idct_arm.S +libavcodec/arm/simple_idct_armv5te.S +libavcodec/arm/simple_idct_armv6.S +libavcodec/arm/simple_idct_neon.S +libavcodec/arm/startcode.h +libavcodec/arm/startcode_armv6.S +libavcodec/arm/synth_filter_init_arm.c +libavcodec/arm/synth_filter_neon.S +libavcodec/arm/synth_filter_vfp.S +libavcodec/arm/vc1dsp.h +libavcodec/arm/vc1dsp_init_arm.c +libavcodec/arm/vc1dsp_init_neon.c +libavcodec/arm/vc1dsp_neon.S +libavcodec/arm/videodsp_arm.h +libavcodec/arm/videodsp_armv5te.S +libavcodec/arm/videodsp_init_arm.c +libavcodec/arm/videodsp_init_armv5te.c +libavcodec/arm/vorbisdsp_init_arm.c +libavcodec/arm/vorbisdsp_neon.S +libavcodec/arm/vp3dsp_init_arm.c +libavcodec/arm/vp3dsp_neon.S +libavcodec/arm/vp6dsp_init_arm.c +libavcodec/arm/vp6dsp_neon.S +libavcodec/arm/vp8.h +libavcodec/arm/vp8_armv6.S +libavcodec/arm/vp8dsp.h +libavcodec/arm/vp8dsp_armv6.S +libavcodec/arm/vp8dsp_init_arm.c +libavcodec/arm/vp8dsp_init_armv6.c +libavcodec/arm/vp8dsp_init_neon.c +libavcodec/arm/vp8dsp_neon.S +libavcodec/arm/vp9dsp_init.h +libavcodec/arm/vp9dsp_init_10bpp_arm.c +libavcodec/arm/vp9dsp_init_12bpp_arm.c +libavcodec/arm/vp9dsp_init_16bpp_arm_template.c +libavcodec/arm/vp9dsp_init_arm.c +libavcodec/arm/vp9itxfm_16bpp_neon.S +libavcodec/arm/vp9itxfm_neon.S +libavcodec/arm/vp9lpf_16bpp_neon.S +libavcodec/arm/vp9lpf_neon.S +libavcodec/arm/vp9mc_16bpp_neon.S +libavcodec/arm/vp9mc_neon.S +libavcodec/ass.c +libavcodec/ass.h +libavcodec/ass_split.c +libavcodec/ass_split.h +libavcodec/assdec.c +libavcodec/assenc.c +libavcodec/asv.c +libavcodec/asv.h +libavcodec/asvdec.c +libavcodec/asvenc.c +libavcodec/atrac.c +libavcodec/atrac.h +libavcodec/atrac1.c +libavcodec/atrac1data.h +libavcodec/atrac3.c +libavcodec/atrac3data.h +libavcodec/atrac3plus.c +libavcodec/atrac3plus.h +libavcodec/atrac3plus_data.h +libavcodec/atrac3plusdec.c +libavcodec/atrac3plusdsp.c +libavcodec/atsc_a53.c +libavcodec/atsc_a53.h +libavcodec/audio_frame_queue.c +libavcodec/audio_frame_queue.h +libavcodec/audiodsp.c +libavcodec/audiodsp.h +libavcodec/aura.c +libavcodec/av1.h +libavcodec/av1_frame_merge_bsf.c +libavcodec/av1_frame_split_bsf.c +libavcodec/av1_metadata_bsf.c +libavcodec/av1_parse.c +libavcodec/av1_parse.h +libavcodec/av1_parser.c +libavcodec/av1dec.c +libavcodec/av1dec.h +libavcodec/avcodec.c +libavcodec/avcodec.h +libavcodec/avdct.c +libavcodec/avdct.h +libavcodec/avfft.c +libavcodec/avfft.h +libavcodec/avpacket.c +libavcodec/avs2.c +libavcodec/avs2.h +libavcodec/avs2_parser.c +libavcodec/avs3.h +libavcodec/avs3_parser.c +libavcodec/bethsoftvideo.c +libavcodec/bethsoftvideo.h +libavcodec/bfi.c +libavcodec/bink.c +libavcodec/binkaudio.c +libavcodec/binkdata.h +libavcodec/binkdsp.c +libavcodec/binkdsp.h +libavcodec/bintext.c +libavcodec/bintext.h +libavcodec/bit_depth_template.c +libavcodec/bitpacked_dec.c +libavcodec/bitpacked_enc.c +libavcodec/bitstream.c +libavcodec/bitstream.h +libavcodec/bitstream_filters.c +libavcodec/bitstream_template.h +libavcodec/blockdsp.c +libavcodec/blockdsp.h +libavcodec/bmp.c +libavcodec/bmp.h +libavcodec/bmp_parser.c +libavcodec/bmpenc.c +libavcodec/bmvaudio.c +libavcodec/bmvvideo.c +libavcodec/bonk.c +libavcodec/brenderpix.c +libavcodec/bsf.c +libavcodec/bsf.h +libavcodec/bsf_internal.h +libavcodec/bswapdsp.c +libavcodec/bswapdsp.h +libavcodec/bytestream.h +libavcodec/c93.c +libavcodec/cabac.h +libavcodec/canopus.c +libavcodec/canopus.h +libavcodec/cavs.h +libavcodec/cavs_parser.c +libavcodec/cavsdsp.h +libavcodec/cbrt_data.c +libavcodec/cbrt_data.h +libavcodec/cbrt_tablegen.h +libavcodec/cbs.c +libavcodec/cbs.h +libavcodec/cbs_av1.c +libavcodec/cbs_av1.h +libavcodec/cbs_av1_syntax_template.c +libavcodec/cbs_bsf.c +libavcodec/cbs_bsf.h +libavcodec/cbs_h264.h +libavcodec/cbs_h2645.c +libavcodec/cbs_h2645.h +libavcodec/cbs_h264_syntax_template.c +libavcodec/cbs_h265.h +libavcodec/cbs_h265_syntax_template.c +libavcodec/cbs_internal.h +libavcodec/cbs_jpeg.c +libavcodec/cbs_jpeg.h +libavcodec/cbs_jpeg_syntax_template.c +libavcodec/cbs_mpeg2.c +libavcodec/cbs_mpeg2.h +libavcodec/cbs_mpeg2_syntax_template.c +libavcodec/cbs_sei.c +libavcodec/cbs_sei.h +libavcodec/cbs_sei_syntax_template.c +libavcodec/cbs_vp9.c +libavcodec/cbs_vp9.h +libavcodec/cbs_vp9_syntax_template.c +libavcodec/ccaption_dec.c +libavcodec/cdgraphics.c +libavcodec/cdtoons.c +libavcodec/cdxl.c +libavcodec/celp_filters.c +libavcodec/celp_filters.h +libavcodec/celp_math.c +libavcodec/celp_math.h +libavcodec/cga_data.c +libavcodec/cga_data.h +libavcodec/chomp_bsf.c +libavcodec/cinepak.c +libavcodec/cinepakenc.c +libavcodec/clearvideo.c +libavcodec/clearvideodata.h +libavcodec/cljrdec.c +libavcodec/cljrenc.c +libavcodec/codec.h +libavcodec/codec2utils.h +libavcodec/codec_desc.c +libavcodec/codec_desc.h +libavcodec/codec_id.h +libavcodec/codec_internal.h +libavcodec/codec_par.c +libavcodec/codec_par.h +libavcodec/cook.c +libavcodec/cook_parser.c +libavcodec/cookdata.h +libavcodec/copy_block.h +libavcodec/cpia.c +libavcodec/cri_parser.c +libavcodec/crystalhd.c +libavcodec/cscd.c +libavcodec/cyuv.c +libavcodec/d3d11va.c +libavcodec/d3d11va.h +libavcodec/dca.c +libavcodec/dca.h +libavcodec/dca_core.c +libavcodec/dca_core.h +libavcodec/dca_core_bsf.c +libavcodec/dca_exss.c +libavcodec/dca_exss.h +libavcodec/dca_lbr.c +libavcodec/dca_lbr.h +libavcodec/dca_parser.c +libavcodec/dca_sample_rate_tab.c +libavcodec/dca_sample_rate_tab.h +libavcodec/dca_syncwords.h +libavcodec/dca_xll.c +libavcodec/dca_xll.h +libavcodec/dcaadpcm.c +libavcodec/dcaadpcm.h +libavcodec/dcadata.c +libavcodec/dcadata.h +libavcodec/dcadct.c +libavcodec/dcadct.h +libavcodec/dcadec.c +libavcodec/dcadec.h +libavcodec/dcadsp.c +libavcodec/dcadsp.h +libavcodec/dcaenc.c +libavcodec/dcaenc.h +libavcodec/dcahuff.c +libavcodec/dcahuff.h +libavcodec/dcamath.h +libavcodec/dct.c +libavcodec/dct.h +libavcodec/dct32.h +libavcodec/dct32_fixed.c +libavcodec/dct32_float.c +libavcodec/dct32_template.c +libavcodec/dds.c +libavcodec/decode.c +libavcodec/decode.h +libavcodec/defs.h +libavcodec/dfa.c +libavcodec/dfpwmdec.c +libavcodec/dfpwmenc.c +libavcodec/dirac.c +libavcodec/dirac.h +libavcodec/dirac_arith.c +libavcodec/dirac_arith.h +libavcodec/dirac_dwt.c +libavcodec/dirac_dwt.h +libavcodec/dirac_dwt_template.c +libavcodec/dirac_parser.c +libavcodec/dirac_vlc.c +libavcodec/dirac_vlc.h +libavcodec/diracdec.c +libavcodec/diracdsp.c +libavcodec/diracdsp.h +libavcodec/diractab.c +libavcodec/diractab.h +libavcodec/dnxhd_parser.c +libavcodec/dnxhddata.c +libavcodec/dnxhddata.h +libavcodec/dnxhddec.c +libavcodec/dnxhdenc.c +libavcodec/dnxhdenc.h +libavcodec/dolby_e.c +libavcodec/dolby_e.h +libavcodec/dolby_e_parse.c +libavcodec/dolby_e_parser.c +libavcodec/dovi_rpu.h +libavcodec/dpcm.c +libavcodec/dpx.c +libavcodec/dpx_parser.c +libavcodec/dpxenc.c +libavcodec/dsd.c +libavcodec/dsd.h +libavcodec/dsddec.c +libavcodec/dsicinaudio.c +libavcodec/dsicinvideo.c +libavcodec/dss_sp.c +libavcodec/dts2pts_bsf.c +libavcodec/dump_extradata_bsf.c +libavcodec/dv.c +libavcodec/dv.h +libavcodec/dv_error_marker_bsf.c +libavcodec/dv_internal.h +libavcodec/dv_profile.c +libavcodec/dv_profile.h +libavcodec/dv_profile_internal.h +libavcodec/dv_tablegen.h +libavcodec/dvaudio.h +libavcodec/dvaudio_parser.c +libavcodec/dvaudiodec.c +libavcodec/dvbsub_parser.c +libavcodec/dvbsubdec.c +libavcodec/dvbsubenc.c +libavcodec/dvbtxt.h +libavcodec/dvd_nav_parser.c +libavcodec/dvdata.c +libavcodec/dvdata.h +libavcodec/dvdec.c +libavcodec/dvdsub.c +libavcodec/dvdsub.h +libavcodec/dvdsub_parser.c +libavcodec/dvdsubdec.c +libavcodec/dvdsubenc.c +libavcodec/dvenc.c +libavcodec/dxa.c +libavcodec/dxtory.c +libavcodec/dxva2.h +libavcodec/dynamic_hdr10_plus.c +libavcodec/dynamic_hdr10_plus.h +libavcodec/dynamic_hdr_vivid.c +libavcodec/dynamic_hdr_vivid.h +libavcodec/eac3_core_bsf.c +libavcodec/eac3_data.h +libavcodec/eac3dec.c +libavcodec/eac3enc.h +libavcodec/eacmv.c +libavcodec/eaidct.c +libavcodec/eaidct.h +libavcodec/eamad.c +libavcodec/eatgq.c +libavcodec/eatgv.c +libavcodec/eatqi.c +libavcodec/elbg.c +libavcodec/elbg.h +libavcodec/encode.c +libavcodec/encode.h +libavcodec/error_resilience.c +libavcodec/error_resilience.h +libavcodec/escape124.c +libavcodec/escape130.c +libavcodec/evrcdata.h +libavcodec/evrcdec.c +libavcodec/exif.c +libavcodec/exif.h +libavcodec/exr.c +libavcodec/exrdsp.c +libavcodec/exrdsp.h +libavcodec/exrenc.c +libavcodec/extract_extradata_bsf.c +libavcodec/faandct.c +libavcodec/faandct.h +libavcodec/faanidct.c +libavcodec/faanidct.h +libavcodec/faxcompr.c +libavcodec/faxcompr.h +libavcodec/fdctdsp.c +libavcodec/fdctdsp.h +libavcodec/fflcms2.c +libavcodec/fflcms2.h +libavcodec/fft-internal.h +libavcodec/fft.h +libavcodec/fft_fixed_32.c +libavcodec/fft_float.c +libavcodec/fft_init_table.c +libavcodec/fft_table.h +libavcodec/fft_template.c +libavcodec/ffv1.c +libavcodec/ffv1.h +libavcodec/ffv1_template.c +libavcodec/ffv1dec.c +libavcodec/ffv1dec_template.c +libavcodec/ffv1enc.c +libavcodec/ffv1enc_template.c +libavcodec/ffwavesynth.c +libavcodec/filter_units_bsf.c +libavcodec/fits.c +libavcodec/fits.h +libavcodec/fitsdec.c +libavcodec/flac.c +libavcodec/flac.h +libavcodec/flac_parse.h +libavcodec/flac_parser.c +libavcodec/flacdata.c +libavcodec/flacdata.h +libavcodec/flacdec.c +libavcodec/flacdsp.c +libavcodec/flacdsp.h +libavcodec/flacdsp_lpc_template.c +libavcodec/flacdsp_template.c +libavcodec/flacenc.c +libavcodec/flacencdsp.c +libavcodec/flacencdsp.h +libavcodec/flashsv.c +libavcodec/flashsv2enc.c +libavcodec/flashsvenc.c +libavcodec/flicvideo.c +libavcodec/float2half.c +libavcodec/flvdec.c +libavcodec/flvdec.h +libavcodec/flvenc.c +libavcodec/flvenc.h +libavcodec/fmtconvert.c +libavcodec/fmtconvert.h +libavcodec/fmvc.c +libavcodec/frame_thread_encoder.c +libavcodec/frame_thread_encoder.h +libavcodec/ftr.c +libavcodec/ftr_parser.c +libavcodec/g722.c +libavcodec/g722.h +libavcodec/g722dec.c +libavcodec/g722dsp.c +libavcodec/g722dsp.h +libavcodec/g722enc.c +libavcodec/g723_1.c +libavcodec/g723_1.h +libavcodec/g723_1_parser.c +libavcodec/g723_1dec.c +libavcodec/g723_1enc.c +libavcodec/g726.c +libavcodec/g729.h +libavcodec/g729_parser.c +libavcodec/g729data.h +libavcodec/g729dec.c +libavcodec/g729postfilter.c +libavcodec/g729postfilter.h +libavcodec/gdv.c +libavcodec/gemdec.c +libavcodec/get_bits.h +libavcodec/get_buffer.c +libavcodec/gif.c +libavcodec/gif.h +libavcodec/gif_parser.c +libavcodec/gifdec.c +libavcodec/golomb.c +libavcodec/golomb.h +libavcodec/gsm.h +libavcodec/gsm_parser.c +libavcodec/gsmdec.c +libavcodec/gsmdec_data.c +libavcodec/gsmdec_data.h +libavcodec/gsmdec_template.c +libavcodec/h261.c +libavcodec/h261.h +libavcodec/h261_parser.c +libavcodec/h261data.c +libavcodec/h261dec.c +libavcodec/h261enc.c +libavcodec/h261enc.h +libavcodec/h263.c +libavcodec/h263.h +libavcodec/h263_parser.c +libavcodec/h263data.c +libavcodec/h263data.h +libavcodec/h263dec.c +libavcodec/h263dec.h +libavcodec/h263dsp.c +libavcodec/h263dsp.h +libavcodec/h263enc.h +libavcodec/h264.h +libavcodec/h2645_parse.c +libavcodec/h2645_parse.h +libavcodec/h2645_sei.c +libavcodec/h2645_sei.h +libavcodec/h2645_vui.c +libavcodec/h2645_vui.h +libavcodec/h2645data.c +libavcodec/h2645data.h +libavcodec/h264_levels.c +libavcodec/h264_levels.h +libavcodec/h264_metadata_bsf.c +libavcodec/h264_mp4toannexb_bsf.c +libavcodec/h264_parse.c +libavcodec/h264_parse.h +libavcodec/h264_parser.c +libavcodec/h264_ps.c +libavcodec/h264_ps.h +libavcodec/h264_redundant_pps_bsf.c +libavcodec/h264_sei.c +libavcodec/h264_sei.h +libavcodec/h264addpx_template.c +libavcodec/h264chroma.c +libavcodec/h264chroma.h +libavcodec/h264chroma_template.c +libavcodec/h264data.c +libavcodec/h264data.h +libavcodec/h264dec.h +libavcodec/h264dsp.c +libavcodec/h264dsp.h +libavcodec/h264dsp_template.c +libavcodec/h264idct.c +libavcodec/h264idct.h +libavcodec/h264idct_template.c +libavcodec/h264pred.c +libavcodec/h264pred.h +libavcodec/h264pred_template.c +libavcodec/h264qpel.c +libavcodec/h264qpel.h +libavcodec/h264qpel_template.c +libavcodec/h265_metadata_bsf.c +libavcodec/h265_profile_level.c +libavcodec/h265_profile_level.h +libavcodec/h274.h +libavcodec/half2float.c +libavcodec/hap.c +libavcodec/hap.h +libavcodec/hapdec.c +libavcodec/hapenc.c +libavcodec/hapqa_extract_bsf.c +libavcodec/hca_data.h +libavcodec/hcadec.c +libavcodec/hcom.c +libavcodec/hdr_parser.c +libavcodec/hdrdec.c +libavcodec/hdrenc.c +libavcodec/hevc.h +libavcodec/hevc_data.c +libavcodec/hevc_data.h +libavcodec/hevc_mp4toannexb_bsf.c +libavcodec/hevc_parse.c +libavcodec/hevc_parse.h +libavcodec/hevc_parser.c +libavcodec/hevc_ps.c +libavcodec/hevc_ps.h +libavcodec/hevc_ps_enc.c +libavcodec/hevc_sei.c +libavcodec/hevc_sei.h +libavcodec/hevcdec.h +libavcodec/hevcdsp.h +libavcodec/hevcpred.h +libavcodec/hnm4video.c +libavcodec/hpel_template.c +libavcodec/hpeldsp.c +libavcodec/hpeldsp.h +libavcodec/hq_hqa.c +libavcodec/hq_hqa.h +libavcodec/hq_hqadata.c +libavcodec/hq_hqadsp.c +libavcodec/hq_hqadsp.h +libavcodec/hqx.c +libavcodec/hqx.h +libavcodec/hqxdsp.c +libavcodec/hqxdsp.h +libavcodec/hqxvlc.c +libavcodec/htmlsubtitles.c +libavcodec/htmlsubtitles.h +libavcodec/huffman.c +libavcodec/huffman.h +libavcodec/huffyuv.c +libavcodec/huffyuv.h +libavcodec/huffyuvdec.c +libavcodec/huffyuvdsp.c +libavcodec/huffyuvdsp.h +libavcodec/huffyuvenc.c +libavcodec/huffyuvencdsp.c +libavcodec/huffyuvencdsp.h +libavcodec/hwaccels.h +libavcodec/hwconfig.h +libavcodec/idcinvideo.c +libavcodec/idctdsp.c +libavcodec/idctdsp.h +libavcodec/iff.c +libavcodec/iirfilter.c +libavcodec/iirfilter.h +libavcodec/ilbcdata.h +libavcodec/ilbcdec.c +libavcodec/imc.c +libavcodec/imcdata.h +libavcodec/imgconvert.c +libavcodec/imx.c +libavcodec/imx_dump_header_bsf.c +libavcodec/indeo2.c +libavcodec/indeo2data.h +libavcodec/indeo3.c +libavcodec/indeo3data.h +libavcodec/indeo4.c +libavcodec/indeo4data.h +libavcodec/indeo5.c +libavcodec/indeo5data.h +libavcodec/intelh263dec.c +libavcodec/internal.h +libavcodec/interplayacm.c +libavcodec/interplayvideo.c +libavcodec/intrax8.c +libavcodec/intrax8.h +libavcodec/intrax8dsp.c +libavcodec/intrax8dsp.h +libavcodec/intrax8huf.h +libavcodec/ipu_parser.c +libavcodec/ituh263dec.c +libavcodec/ituh263enc.c +libavcodec/ivi.c +libavcodec/ivi.h +libavcodec/ivi_dsp.c +libavcodec/ivi_dsp.h +libavcodec/j2kenc.c +libavcodec/jacosub.h +libavcodec/jacosubdec.c +libavcodec/jfdctfst.c +libavcodec/jfdctint.c +libavcodec/jfdctint_template.c +libavcodec/jni.c +libavcodec/jni.h +libavcodec/jpeg2000.c +libavcodec/jpeg2000.h +libavcodec/jpeg2000_parser.c +libavcodec/jpeg2000dec.c +libavcodec/jpeg2000dsp.c +libavcodec/jpeg2000dsp.h +libavcodec/jpeg2000dwt.c +libavcodec/jpeg2000dwt.h +libavcodec/jpegls.c +libavcodec/jpegls.h +libavcodec/jpeglsdec.c +libavcodec/jpeglsdec.h +libavcodec/jpeglsenc.c +libavcodec/jpegquanttables.c +libavcodec/jpegquanttables.h +libavcodec/jpegtables.c +libavcodec/jpegtables.h +libavcodec/jpegtabs.h +libavcodec/jrevdct.c +libavcodec/jvdec.c +libavcodec/kbdwin.c +libavcodec/kbdwin.h +libavcodec/kgv1dec.c +libavcodec/kmvc.c +libavcodec/lagarith.c +libavcodec/lagarithrac.c +libavcodec/lagarithrac.h +libavcodec/latm_parser.c +libavcodec/lcl.h +libavcodec/lcldec.c +libavcodec/lclenc.c +libavcodec/libaom.c +libavcodec/libaom.h +libavcodec/libaomdec.c +libavcodec/libaomenc.c +libavcodec/libavcodec.v +libavcodec/libcodec2.c +libavcodec/libdav1d.c +libavcodec/libfdk-aacdec.c +libavcodec/libfdk-aacenc.c +libavcodec/libgsmdec.c +libavcodec/libgsmenc.c +libavcodec/libilbc.c +libavcodec/libjxl.c +libavcodec/libjxl.h +libavcodec/libjxldec.c +libavcodec/libjxlenc.c +libavcodec/libmp3lame.c +libavcodec/libopencore-amr.c +libavcodec/libopenh264.c +libavcodec/libopenh264.h +libavcodec/libopenh264dec.c +libavcodec/libopenh264enc.c +libavcodec/libopenjpegdec.c +libavcodec/libopenjpegenc.c +libavcodec/libopus.c +libavcodec/libopus.h +libavcodec/libopusdec.c +libavcodec/libopusenc.c +libavcodec/librav1e.c +libavcodec/librsvgdec.c +libavcodec/libspeexdec.c +libavcodec/libspeexenc.c +libavcodec/libsvtav1.c +libavcodec/libtheoraenc.c +libavcodec/libtwolame.c +libavcodec/libvo-amrwbenc.c +libavcodec/libvorbisdec.c +libavcodec/libvorbisenc.c +libavcodec/libvpx.c +libavcodec/libvpx.h +libavcodec/libvpxdec.c +libavcodec/libvpxenc.c +libavcodec/libwebpenc.c +libavcodec/libwebpenc_animencoder.c +libavcodec/libwebpenc_common.c +libavcodec/libwebpenc_common.h +libavcodec/libxvid.c +libavcodec/libzvbi-teletextdec.c +libavcodec/loco.c +libavcodec/log2_tab.c +libavcodec/loongarch/Makefile +libavcodec/lossless_audiodsp.c +libavcodec/lossless_audiodsp.h +libavcodec/lossless_videodsp.c +libavcodec/lossless_videodsp.h +libavcodec/lossless_videoencdsp.c +libavcodec/lossless_videoencdsp.h +libavcodec/lpc.c +libavcodec/lpc.h +libavcodec/lscrdec.c +libavcodec/lsp.c +libavcodec/lsp.h +libavcodec/lzw.c +libavcodec/lzw.h +libavcodec/lzwenc.c +libavcodec/m101.c +libavcodec/mace.c +libavcodec/mathops.h +libavcodec/mathtables.c +libavcodec/mdct_fixed_32.c +libavcodec/mdct_float.c +libavcodec/mdct_template.c +libavcodec/mdec.c +libavcodec/me_cmp.c +libavcodec/me_cmp.h +libavcodec/media100_to_mjpegb_bsf.c +libavcodec/mediacodec.c +libavcodec/mediacodec.h +libavcodec/metasound.c +libavcodec/metasound_data.h +libavcodec/metasound_twinvq_data.h +libavcodec/microdvddec.c +libavcodec/midivid.c +libavcodec/mimic.c +libavcodec/mips/Makefile +libavcodec/mips/amrwbdec_mips.h +libavcodec/mips/lsp_mips.h +libavcodec/misc4.c +libavcodec/misc4_parser.c +libavcodec/mjpeg.h +libavcodec/mjpeg2jpeg_bsf.c +libavcodec/mjpeg_parser.c +libavcodec/mjpega_dump_header_bsf.c +libavcodec/mjpegbdec.c +libavcodec/mjpegdec.c +libavcodec/mjpegdec.h +libavcodec/mjpegdec_common.c +libavcodec/mjpegenc.c +libavcodec/mjpegenc.h +libavcodec/mjpegenc_common.c +libavcodec/mjpegenc_common.h +libavcodec/mjpegenc_huffman.c +libavcodec/mjpegenc_huffman.h +libavcodec/mlp.c +libavcodec/mlp.h +libavcodec/mlp_parse.c +libavcodec/mlp_parse.h +libavcodec/mlp_parser.c +libavcodec/mlpdec.c +libavcodec/mlpdsp.c +libavcodec/mlpdsp.h +libavcodec/mlpenc.c +libavcodec/mmvideo.c +libavcodec/motion_est.c +libavcodec/motion_est.h +libavcodec/motion_est_template.c +libavcodec/motionpixels.c +libavcodec/motionpixels_tablegen.h +libavcodec/movsub_bsf.c +libavcodec/mp3_header_decompress_bsf.c +libavcodec/mpc.c +libavcodec/mpc.h +libavcodec/mpc7.c +libavcodec/mpc7data.h +libavcodec/mpc8.c +libavcodec/mpc8data.h +libavcodec/mpc8huff.h +libavcodec/mpcdata.h +libavcodec/mpeg12.c +libavcodec/mpeg12.h +libavcodec/mpeg12codecs.h +libavcodec/mpeg12data.c +libavcodec/mpeg12data.h +libavcodec/mpeg12dec.c +libavcodec/mpeg12dec.h +libavcodec/mpeg12enc.c +libavcodec/mpeg12enc.h +libavcodec/mpeg12framerate.c +libavcodec/mpeg12vlc.h +libavcodec/mpeg2_metadata_bsf.c +libavcodec/mpeg4_unpack_bframes_bsf.c +libavcodec/mpeg4audio.c +libavcodec/mpeg4audio.h +libavcodec/mpeg4audio_copy_pce.h +libavcodec/mpeg4audio_sample_rates.c +libavcodec/mpeg4audio_sample_rates.h +libavcodec/mpeg4data.h +libavcodec/mpeg4video.c +libavcodec/mpeg4video.h +libavcodec/mpeg4video_parser.c +libavcodec/mpeg4videodata.h +libavcodec/mpeg4videodec.c +libavcodec/mpeg4videodec.h +libavcodec/mpeg4videodefs.h +libavcodec/mpeg4videodsp.c +libavcodec/mpeg4videodsp.h +libavcodec/mpeg4videoenc.c +libavcodec/mpeg4videoenc.h +libavcodec/mpeg_er.c +libavcodec/mpeg_er.h +libavcodec/mpegaudio.c +libavcodec/mpegaudio.h +libavcodec/mpegaudio_parser.c +libavcodec/mpegaudio_tablegen.h +libavcodec/mpegaudiodata.c +libavcodec/mpegaudiodata.h +libavcodec/mpegaudiodec_common.c +libavcodec/mpegaudiodec_common_tablegen.h +libavcodec/mpegaudiodec_fixed.c +libavcodec/mpegaudiodec_float.c +libavcodec/mpegaudiodec_template.c +libavcodec/mpegaudiodecheader.c +libavcodec/mpegaudiodecheader.h +libavcodec/mpegaudiodsp.c +libavcodec/mpegaudiodsp.h +libavcodec/mpegaudiodsp_data.c +libavcodec/mpegaudiodsp_fixed.c +libavcodec/mpegaudiodsp_float.c +libavcodec/mpegaudiodsp_template.c +libavcodec/mpegaudioenc_fixed.c +libavcodec/mpegaudioenc_float.c +libavcodec/mpegaudioenc_template.c +libavcodec/mpegaudiotab.h +libavcodec/mpegaudiotabs.c +libavcodec/mpegaudiotabs.h +libavcodec/mpegpicture.c +libavcodec/mpegpicture.h +libavcodec/mpegutils.c +libavcodec/mpegutils.h +libavcodec/mpegvideo.c +libavcodec/mpegvideo.h +libavcodec/mpegvideo_dec.c +libavcodec/mpegvideo_enc.c +libavcodec/mpegvideo_motion.c +libavcodec/mpegvideo_parser.c +libavcodec/mpegvideodata.c +libavcodec/mpegvideodata.h +libavcodec/mpegvideodec.h +libavcodec/mpegvideoenc.h +libavcodec/mpegvideoencdsp.c +libavcodec/mpegvideoencdsp.h +libavcodec/mpl2dec.c +libavcodec/mpv_reconstruct_mb_template.c +libavcodec/mqc.c +libavcodec/mqc.h +libavcodec/mqcdec.c +libavcodec/mqcenc.c +libavcodec/mscc.c +libavcodec/msgsmdec.c +libavcodec/msgsmdec.h +libavcodec/msmpeg4.c +libavcodec/msmpeg4.h +libavcodec/msmpeg4_vc1_data.c +libavcodec/msmpeg4_vc1_data.h +libavcodec/msmpeg4data.c +libavcodec/msmpeg4data.h +libavcodec/msmpeg4dec.c +libavcodec/msmpeg4dec.h +libavcodec/msmpeg4enc.c +libavcodec/msmpeg4enc.h +libavcodec/msp2dec.c +libavcodec/msrle.c +libavcodec/msrledec.c +libavcodec/msrledec.h +libavcodec/mss1.c +libavcodec/mss12.c +libavcodec/mss12.h +libavcodec/mss3.c +libavcodec/mss34dsp.c +libavcodec/mss34dsp.h +libavcodec/mss4.c +libavcodec/msvideo1.c +libavcodec/msvideo1enc.c +libavcodec/mv30.c +libavcodec/mvcdec.c +libavcodec/mvha.c +libavcodec/mwsc.c +libavcodec/mxpegdec.c +libavcodec/nellymoser.c +libavcodec/nellymoser.h +libavcodec/nellymoserdec.c +libavcodec/nellymoserenc.c +libavcodec/neon/Makefile +libavcodec/neon/mpegvideo.c +libavcodec/noise_bsf.c +libavcodec/null.c +libavcodec/null_bsf.c +libavcodec/nuv.c +libavcodec/nvdec.c +libavcodec/nvdec.h +libavcodec/nvdec_av1.c +libavcodec/nvdec_mjpeg.c +libavcodec/nvdec_mpeg12.c +libavcodec/nvdec_mpeg4.c +libavcodec/nvdec_vp8.c +libavcodec/nvdec_vp9.c +libavcodec/nvenc.c +libavcodec/nvenc.h +libavcodec/nvenc_av1.c +libavcodec/nvenc_h264.c +libavcodec/nvenc_hevc.c +libavcodec/on2avc.c +libavcodec/on2avcdata.c +libavcodec/on2avcdata.h +libavcodec/options.c +libavcodec/options_table.h +libavcodec/opus.h +libavcodec/opus_celt.c +libavcodec/opus_celt.h +libavcodec/opus_metadata_bsf.c +libavcodec/opus_parse.c +libavcodec/opus_parse.h +libavcodec/opus_parser.c +libavcodec/opus_pvq.c +libavcodec/opus_pvq.h +libavcodec/opus_rc.c +libavcodec/opus_rc.h +libavcodec/opus_silk.c +libavcodec/opus_silk.h +libavcodec/opusdec.c +libavcodec/opusdec_celt.c +libavcodec/opusdsp.c +libavcodec/opusdsp.h +libavcodec/opusenc.c +libavcodec/opusenc.h +libavcodec/opusenc_psy.c +libavcodec/opusenc_psy.h +libavcodec/opusenc_utils.h +libavcodec/opustab.c +libavcodec/opustab.h +libavcodec/packet.h +libavcodec/packet_internal.h +libavcodec/paf.h +libavcodec/pafaudio.c +libavcodec/pafvideo.c +libavcodec/pamenc.c +libavcodec/parser.c +libavcodec/parser.h +libavcodec/parsers.c +libavcodec/pcm-bluray.c +libavcodec/pcm-dvd.c +libavcodec/pcm.c +libavcodec/pcm_rechunk_bsf.c +libavcodec/pcm_tablegen.h +libavcodec/pcx.c +libavcodec/pcxenc.c +libavcodec/pel_template.c +libavcodec/pgs_frame_merge_bsf.c +libavcodec/pgssubdec.c +libavcodec/pgxdec.c +libavcodec/photocd.c +libavcodec/pictordec.c +libavcodec/pixblockdsp.c +libavcodec/pixblockdsp.h +libavcodec/pixels.h +libavcodec/png.c +libavcodec/png.h +libavcodec/png_parser.c +libavcodec/pngdec.c +libavcodec/pngdsp.c +libavcodec/pngdsp.h +libavcodec/pngenc.c +libavcodec/pnm.c +libavcodec/pnm.h +libavcodec/pnm_parser.c +libavcodec/pnmdec.c +libavcodec/pnmenc.c +libavcodec/ppc/Makefile +libavcodec/ppc/asm.S +libavcodec/ppc/audiodsp.c +libavcodec/ppc/blockdsp.c +libavcodec/ppc/fdct.h +libavcodec/ppc/fdctdsp.c +libavcodec/ppc/fft_altivec.S +libavcodec/ppc/fft_init.c +libavcodec/ppc/fft_vsx.c +libavcodec/ppc/fft_vsx.h +libavcodec/ppc/fmtconvert_altivec.c +libavcodec/ppc/h264chroma_init.c +libavcodec/ppc/h264chroma_template.c +libavcodec/ppc/h264dsp.c +libavcodec/ppc/h264qpel.c +libavcodec/ppc/h264qpel_template.c +libavcodec/ppc/hpeldsp_altivec.c +libavcodec/ppc/hpeldsp_altivec.h +libavcodec/ppc/idctdsp.c +libavcodec/ppc/lossless_audiodsp_altivec.c +libavcodec/ppc/lossless_videodsp_altivec.c +libavcodec/ppc/mathops.h +libavcodec/ppc/me_cmp.c +libavcodec/ppc/mpeg4videodsp.c +libavcodec/ppc/mpegaudiodsp_altivec.c +libavcodec/ppc/mpegvideo_altivec.c +libavcodec/ppc/mpegvideoencdsp.c +libavcodec/ppc/pixblockdsp.c +libavcodec/ppc/svq1enc_altivec.c +libavcodec/ppc/vc1dsp_altivec.c +libavcodec/ppc/videodsp.c +libavcodec/ppc/vorbisdsp_altivec.c +libavcodec/ppc/vp3dsp_altivec.c +libavcodec/ppc/vp8dsp_altivec.c +libavcodec/profiles.c +libavcodec/profiles.h +libavcodec/prores_metadata_bsf.c +libavcodec/prosumer.c +libavcodec/psd.c +libavcodec/psymodel.c +libavcodec/psymodel.h +libavcodec/pthread.c +libavcodec/pthread_frame.c +libavcodec/pthread_internal.h +libavcodec/pthread_slice.c +libavcodec/ptx.c +libavcodec/put_bits.h +libavcodec/put_golomb.h +libavcodec/qcelpdata.h +libavcodec/qcelpdec.c +libavcodec/qdm2.c +libavcodec/qdm2_tablegen.h +libavcodec/qdm2data.h +libavcodec/qdmc.c +libavcodec/qdrw.c +libavcodec/qoi.h +libavcodec/qoi_parser.c +libavcodec/qoidec.c +libavcodec/qoienc.c +libavcodec/qpeg.c +libavcodec/qpel_template.c +libavcodec/qpeldsp.c +libavcodec/qpeldsp.h +libavcodec/qsv.c +libavcodec/qsv.h +libavcodec/qsv_api.c +libavcodec/qsv_internal.h +libavcodec/qsvdec.c +libavcodec/qsvenc.c +libavcodec/qsvenc.h +libavcodec/qsvenc_av1.c +libavcodec/qsvenc_h264.c +libavcodec/qsvenc_hevc.c +libavcodec/qsvenc_jpeg.c +libavcodec/qsvenc_mpeg2.c +libavcodec/qsvenc_vp9.c +libavcodec/qtrle.c +libavcodec/qtrleenc.c +libavcodec/r210dec.c +libavcodec/r210enc.c +libavcodec/ra144.c +libavcodec/ra144.h +libavcodec/ra144dec.c +libavcodec/ra144enc.c +libavcodec/ra288.c +libavcodec/ra288.h +libavcodec/rangecoder.c +libavcodec/rangecoder.h +libavcodec/rasc.c +libavcodec/ratecontrol.c +libavcodec/ratecontrol.h +libavcodec/raw.c +libavcodec/raw.h +libavcodec/rawdec.c +libavcodec/rawenc.c +libavcodec/rdft.c +libavcodec/rdft.h +libavcodec/realtextdec.c +libavcodec/rectangle.h +libavcodec/remove_extradata_bsf.c +libavcodec/reverse.c +libavcodec/riscv/Makefile +libavcodec/riscv/aacpsdsp_init.c +libavcodec/riscv/aacpsdsp_rvv.S +libavcodec/riscv/alacdsp_init.c +libavcodec/riscv/alacdsp_rvv.S +libavcodec/riscv/audiodsp_init.c +libavcodec/riscv/audiodsp_rvf.S +libavcodec/riscv/audiodsp_rvv.S +libavcodec/riscv/bswapdsp_init.c +libavcodec/riscv/bswapdsp_rvb.S +libavcodec/riscv/bswapdsp_rvv.S +libavcodec/riscv/fmtconvert_init.c +libavcodec/riscv/fmtconvert_rvv.S +libavcodec/riscv/idctdsp_init.c +libavcodec/riscv/idctdsp_rvv.S +libavcodec/riscv/opusdsp_init.c +libavcodec/riscv/opusdsp_rvv.S +libavcodec/riscv/pixblockdsp_init.c +libavcodec/riscv/pixblockdsp_rvi.S +libavcodec/riscv/pixblockdsp_rvv.S +libavcodec/riscv/vorbisdsp_init.c +libavcodec/riscv/vorbisdsp_rvv.S +libavcodec/rka.c +libavcodec/rl.c +libavcodec/rl.h +libavcodec/rl2.c +libavcodec/rle.c +libavcodec/rle.h +libavcodec/rnd_avg.h +libavcodec/roqaudioenc.c +libavcodec/roqvideo.c +libavcodec/roqvideo.h +libavcodec/roqvideodec.c +libavcodec/roqvideoenc.c +libavcodec/rpza.c +libavcodec/rpzaenc.c +libavcodec/rscc.c +libavcodec/rtjpeg.c +libavcodec/rtjpeg.h +libavcodec/rv10.c +libavcodec/rv10dec.h +libavcodec/rv10enc.c +libavcodec/rv10enc.h +libavcodec/rv20enc.c +libavcodec/rv34_parser.c +libavcodec/s302m.c +libavcodec/s302menc.c +libavcodec/samidec.c +libavcodec/sanm.c +libavcodec/sbc.c +libavcodec/sbc.h +libavcodec/sbc_parser.c +libavcodec/sbcdec.c +libavcodec/sbcdec_data.c +libavcodec/sbcdec_data.h +libavcodec/sbcdsp.c +libavcodec/sbcdsp.h +libavcodec/sbcdsp_data.c +libavcodec/sbcdsp_data.h +libavcodec/sbcenc.c +libavcodec/sbr.h +libavcodec/sbrdsp.c +libavcodec/sbrdsp.h +libavcodec/sbrdsp_template.c +libavcodec/screenpresso.c +libavcodec/sei.h +libavcodec/setts_bsf.c +libavcodec/sgi.h +libavcodec/sgidec.c +libavcodec/sgienc.c +libavcodec/sgirledec.c +libavcodec/shorten.c +libavcodec/simple_idct.c +libavcodec/simple_idct.h +libavcodec/simple_idct_template.c +libavcodec/sinewin.c +libavcodec/sinewin.h +libavcodec/sinewin_tablegen.h +libavcodec/sipr.c +libavcodec/sipr.h +libavcodec/sipr16k.c +libavcodec/sipr16kdata.h +libavcodec/sipr_parser.c +libavcodec/siprdata.h +libavcodec/siren.c +libavcodec/smacker.c +libavcodec/smc.c +libavcodec/smcenc.c +libavcodec/snappy.c +libavcodec/snappy.h +libavcodec/snow.c +libavcodec/snow.h +libavcodec/snow_dwt.c +libavcodec/snow_dwt.h +libavcodec/snowdata.h +libavcodec/snowdec.c +libavcodec/snowenc.c +libavcodec/sonic.c +libavcodec/sp5x.h +libavcodec/sp5xdec.c +libavcodec/speedhq.c +libavcodec/speedhq.h +libavcodec/speedhqdec.c +libavcodec/speedhqenc.c +libavcodec/speedhqenc.h +libavcodec/speexdata.h +libavcodec/speexdec.c +libavcodec/srtdec.c +libavcodec/srtenc.c +libavcodec/startcode.c +libavcodec/startcode.h +libavcodec/subviewerdec.c +libavcodec/sunrast.c +libavcodec/sunrast.h +libavcodec/sunrastenc.c +libavcodec/svq1.c +libavcodec/svq1.h +libavcodec/svq1_cb.h +libavcodec/svq1_vlc.h +libavcodec/svq1dec.c +libavcodec/svq1enc.c +libavcodec/svq1enc_cb.h +libavcodec/svq1encdsp.h +libavcodec/svq3.c +libavcodec/synth_filter.c +libavcodec/synth_filter.h +libavcodec/tak.c +libavcodec/tak.h +libavcodec/tak_parser.c +libavcodec/takdec.c +libavcodec/takdsp.c +libavcodec/takdsp.h +libavcodec/targa.c +libavcodec/targa.h +libavcodec/targa_y216dec.c +libavcodec/targaenc.c +libavcodec/tdsc.c +libavcodec/textdec.c +libavcodec/texturedsp.c +libavcodec/texturedsp.h +libavcodec/texturedsp_template.c +libavcodec/texturedspenc.c +libavcodec/thread.h +libavcodec/threadframe.h +libavcodec/tiertexseqv.c +libavcodec/tiff.c +libavcodec/tiff.h +libavcodec/tiff_common.c +libavcodec/tiff_common.h +libavcodec/tiff_data.h +libavcodec/tiffenc.c +libavcodec/tmv.c +libavcodec/to_upper4.c +libavcodec/to_upper4.h +libavcodec/tpeldsp.c +libavcodec/tpeldsp.h +libavcodec/trace_headers_bsf.c +libavcodec/truehd_core_bsf.c +libavcodec/truemotion1.c +libavcodec/truemotion1data.h +libavcodec/truemotion2.c +libavcodec/truemotion2rt.c +libavcodec/truespeech.c +libavcodec/truespeech_data.h +libavcodec/tscc.c +libavcodec/tscc2.c +libavcodec/tscc2data.h +libavcodec/tta.c +libavcodec/ttadata.c +libavcodec/ttadata.h +libavcodec/ttadsp.c +libavcodec/ttadsp.h +libavcodec/ttaenc.c +libavcodec/ttaencdsp.c +libavcodec/ttaencdsp.h +libavcodec/ttmlenc.c +libavcodec/ttmlenc.h +libavcodec/twinvq.c +libavcodec/twinvq.h +libavcodec/twinvq_data.h +libavcodec/twinvqdec.c +libavcodec/txd.c +libavcodec/ulti.c +libavcodec/ulti_cb.h +libavcodec/unary.h +libavcodec/utils.c +libavcodec/utvideo.h +libavcodec/utvideodec.c +libavcodec/utvideodsp.c +libavcodec/utvideodsp.h +libavcodec/utvideoenc.c +libavcodec/v210_template.c +libavcodec/v210dec.c +libavcodec/v210dec.h +libavcodec/v210dec_init.h +libavcodec/v210enc.c +libavcodec/v210enc.h +libavcodec/v210enc_init.h +libavcodec/v210x.c +libavcodec/v308dec.c +libavcodec/v308enc.c +libavcodec/v408dec.c +libavcodec/v408enc.c +libavcodec/v410dec.c +libavcodec/v410enc.c +libavcodec/v4l2_buffers.c +libavcodec/v4l2_buffers.h +libavcodec/v4l2_context.c +libavcodec/v4l2_context.h +libavcodec/v4l2_fmt.c +libavcodec/v4l2_fmt.h +libavcodec/v4l2_m2m.c +libavcodec/v4l2_m2m.h +libavcodec/v4l2_m2m_dec.c +libavcodec/v4l2_m2m_enc.c +libavcodec/vaapi_av1.c +libavcodec/vaapi_decode.c +libavcodec/vaapi_decode.h +libavcodec/vaapi_encode.c +libavcodec/vaapi_encode.h +libavcodec/vaapi_encode_h264.c +libavcodec/vaapi_encode_h265.c +libavcodec/vaapi_encode_mjpeg.c +libavcodec/vaapi_encode_mpeg2.c +libavcodec/vaapi_encode_vp8.c +libavcodec/vaapi_encode_vp9.c +libavcodec/vaapi_hevc.h +libavcodec/vaapi_mjpeg.c +libavcodec/vaapi_mpeg2.c +libavcodec/vaapi_mpeg4.c +libavcodec/vaapi_vp8.c +libavcodec/vaapi_vp9.c +libavcodec/vb.c +libavcodec/vble.c +libavcodec/vbn.h +libavcodec/vc1.c +libavcodec/vc1.h +libavcodec/vc1_common.h +libavcodec/vc1_parser.c +libavcodec/vc1_pred.h +libavcodec/vc1acdata.h +libavcodec/vc1data.c +libavcodec/vc1data.h +libavcodec/vc1dsp.c +libavcodec/vc1dsp.h +libavcodec/vc2enc.c +libavcodec/vc2enc_dwt.c +libavcodec/vc2enc_dwt.h +libavcodec/vcr1.c +libavcodec/vdpau.c +libavcodec/vdpau.h +libavcodec/vdpau_av1.c +libavcodec/vdpau_internal.h +libavcodec/vdpau_mpeg12.c +libavcodec/vdpau_mpeg4.c +libavcodec/vdpau_vp9.c +libavcodec/version.c +libavcodec/version.h +libavcodec/version_major.h +libavcodec/videodsp.c +libavcodec/videodsp.h +libavcodec/videodsp_template.c +libavcodec/videotoolbox.h +libavcodec/vima.c +libavcodec/vlc.c +libavcodec/vlc.h +libavcodec/vmdaudio.c +libavcodec/vmdvideo.c +libavcodec/vmnc.c +libavcodec/vorbis.c +libavcodec/vorbis.h +libavcodec/vorbis_data.c +libavcodec/vorbis_data.h +libavcodec/vorbis_enc_data.h +libavcodec/vorbis_parser.c +libavcodec/vorbis_parser.h +libavcodec/vorbis_parser_internal.h +libavcodec/vorbisdec.c +libavcodec/vorbisdsp.c +libavcodec/vorbisdsp.h +libavcodec/vorbisenc.c +libavcodec/vp3.c +libavcodec/vp3_parser.c +libavcodec/vp3data.h +libavcodec/vp3dsp.c +libavcodec/vp3dsp.h +libavcodec/vp4data.h +libavcodec/vp5.c +libavcodec/vp56.c +libavcodec/vp56.h +libavcodec/vp56data.c +libavcodec/vp56data.h +libavcodec/vp56dsp.c +libavcodec/vp56dsp.h +libavcodec/vp5data.h +libavcodec/vp6.c +libavcodec/vp6data.h +libavcodec/vp6dsp.c +libavcodec/vp8.c +libavcodec/vp8.h +libavcodec/vp89_rac.h +libavcodec/vp8_parser.c +libavcodec/vp8data.h +libavcodec/vp8dsp.c +libavcodec/vp8dsp.h +libavcodec/vp9.c +libavcodec/vp9.h +libavcodec/vp9_mc_template.c +libavcodec/vp9_metadata_bsf.c +libavcodec/vp9_parser.c +libavcodec/vp9_raw_reorder_bsf.c +libavcodec/vp9_superframe_bsf.c +libavcodec/vp9_superframe_split_bsf.c +libavcodec/vp9block.c +libavcodec/vp9data.c +libavcodec/vp9data.h +libavcodec/vp9dec.h +libavcodec/vp9dsp.c +libavcodec/vp9dsp.h +libavcodec/vp9dsp_10bpp.c +libavcodec/vp9dsp_12bpp.c +libavcodec/vp9dsp_8bpp.c +libavcodec/vp9dsp_template.c +libavcodec/vp9lpf.c +libavcodec/vp9mvs.c +libavcodec/vp9prob.c +libavcodec/vp9recon.c +libavcodec/vp9shared.h +libavcodec/vpx_rac.c +libavcodec/vpx_rac.h +libavcodec/vqavideo.c +libavcodec/vqcdec.c +libavcodec/wavarc.c +libavcodec/wavpack.c +libavcodec/wavpack.h +libavcodec/wavpackdata.c +libavcodec/wavpackenc.c +libavcodec/wavpackenc.h +libavcodec/wbmpdec.c +libavcodec/wbmpenc.c +libavcodec/wcmv.c +libavcodec/webp.c +libavcodec/webp_parser.c +libavcodec/webvttdec.c +libavcodec/webvttenc.c +libavcodec/wma.c +libavcodec/wma.h +libavcodec/wma_common.c +libavcodec/wma_common.h +libavcodec/wma_freqs.c +libavcodec/wma_freqs.h +libavcodec/wmadata.h +libavcodec/wmadec.c +libavcodec/wmaenc.c +libavcodec/wmavoice.c +libavcodec/wmavoice_data.h +libavcodec/wmv2.c +libavcodec/wmv2.h +libavcodec/wmv2data.c +libavcodec/wmv2data.h +libavcodec/wmv2dec.c +libavcodec/wmv2dec.h +libavcodec/wmv2dsp.c +libavcodec/wmv2dsp.h +libavcodec/wmv2enc.c +libavcodec/wmv2enc.h +libavcodec/wnv1.c +libavcodec/wrapped_avframe.c +libavcodec/ws-snd1.c +libavcodec/x86/Makefile +libavcodec/x86/aacencdsp.asm +libavcodec/x86/aacencdsp_init.c +libavcodec/x86/aacpsdsp.asm +libavcodec/x86/aacpsdsp_init.c +libavcodec/x86/ac3dsp.asm +libavcodec/x86/ac3dsp_downmix.asm +libavcodec/x86/ac3dsp_init.c +libavcodec/x86/alacdsp.asm +libavcodec/x86/alacdsp_init.c +libavcodec/x86/audiodsp.asm +libavcodec/x86/audiodsp_init.c +libavcodec/x86/blockdsp.asm +libavcodec/x86/blockdsp_init.c +libavcodec/x86/bswapdsp.asm +libavcodec/x86/bswapdsp_init.c +libavcodec/x86/cabac.h +libavcodec/x86/cavsdsp.c +libavcodec/x86/cavsidct.asm +libavcodec/x86/celt_pvq_init.c +libavcodec/x86/celt_pvq_search.asm +libavcodec/x86/cfhddsp.asm +libavcodec/x86/cfhddsp_init.c +libavcodec/x86/cfhdencdsp.asm +libavcodec/x86/cfhdencdsp_init.c +libavcodec/x86/constants.c +libavcodec/x86/constants.h +libavcodec/x86/dcadsp.asm +libavcodec/x86/dcadsp_init.c +libavcodec/x86/dct32.asm +libavcodec/x86/dct_init.c +libavcodec/x86/dirac_dwt.asm +libavcodec/x86/dirac_dwt_init.c +libavcodec/x86/diracdsp.asm +libavcodec/x86/diracdsp_init.c +libavcodec/x86/dnxhdenc.asm +libavcodec/x86/dnxhdenc_init.c +libavcodec/x86/exrdsp.asm +libavcodec/x86/exrdsp_init.c +libavcodec/x86/fdct.c +libavcodec/x86/fdct.h +libavcodec/x86/fdctdsp_init.c +libavcodec/x86/fft.asm +libavcodec/x86/fft.h +libavcodec/x86/fft_init.c +libavcodec/x86/flac_dsp_gpl.asm +libavcodec/x86/flacdsp.asm +libavcodec/x86/flacdsp_init.c +libavcodec/x86/flacencdsp_init.c +libavcodec/x86/fmtconvert.asm +libavcodec/x86/fmtconvert_init.c +libavcodec/x86/fpel.asm +libavcodec/x86/fpel.h +libavcodec/x86/g722dsp.asm +libavcodec/x86/g722dsp_init.c +libavcodec/x86/h263_loopfilter.asm +libavcodec/x86/h263dsp_init.c +libavcodec/x86/h264_cabac.c +libavcodec/x86/h264_chromamc.asm +libavcodec/x86/h264_chromamc_10bit.asm +libavcodec/x86/h264_deblock.asm +libavcodec/x86/h264_deblock_10bit.asm +libavcodec/x86/h264_idct.asm +libavcodec/x86/h264_idct_10bit.asm +libavcodec/x86/h264_intrapred.asm +libavcodec/x86/h264_intrapred_10bit.asm +libavcodec/x86/h264_intrapred_init.c +libavcodec/x86/h264_qpel.c +libavcodec/x86/h264_qpel_10bit.asm +libavcodec/x86/h264_qpel_8bit.asm +libavcodec/x86/h264_weight.asm +libavcodec/x86/h264_weight_10bit.asm +libavcodec/x86/h264chroma_init.c +libavcodec/x86/h264dsp_init.c +libavcodec/x86/hpeldsp.asm +libavcodec/x86/hpeldsp.h +libavcodec/x86/hpeldsp_init.c +libavcodec/x86/hpeldsp_rnd_template.c +libavcodec/x86/hpeldsp_vp3.asm +libavcodec/x86/hpeldsp_vp3_init.c +libavcodec/x86/huffyuvdsp.asm +libavcodec/x86/huffyuvdsp_init.c +libavcodec/x86/huffyuvdsp_template.asm +libavcodec/x86/huffyuvencdsp.asm +libavcodec/x86/huffyuvencdsp_init.c +libavcodec/x86/idctdsp.asm +libavcodec/x86/idctdsp.h +libavcodec/x86/idctdsp_init.c +libavcodec/x86/imdct36.asm +libavcodec/x86/inline_asm.h +libavcodec/x86/jpeg2000dsp.asm +libavcodec/x86/jpeg2000dsp_init.c +libavcodec/x86/lossless_audiodsp.asm +libavcodec/x86/lossless_audiodsp_init.c +libavcodec/x86/lossless_videodsp.asm +libavcodec/x86/lossless_videodsp_init.c +libavcodec/x86/lossless_videoencdsp.asm +libavcodec/x86/lossless_videoencdsp_init.c +libavcodec/x86/lpc.asm +libavcodec/x86/lpc_init.c +libavcodec/x86/mathops.h +libavcodec/x86/me_cmp.asm +libavcodec/x86/me_cmp_init.c +libavcodec/x86/mlpdsp.asm +libavcodec/x86/mlpdsp_init.c +libavcodec/x86/mpeg4videodsp.c +libavcodec/x86/mpegaudiodsp.c +libavcodec/x86/mpegvideo.c +libavcodec/x86/mpegvideoenc.c +libavcodec/x86/mpegvideoenc_qns_template.c +libavcodec/x86/mpegvideoenc_template.c +libavcodec/x86/mpegvideoencdsp.asm +libavcodec/x86/mpegvideoencdsp_init.c +libavcodec/x86/opusdsp.asm +libavcodec/x86/opusdsp_init.c +libavcodec/x86/pixblockdsp.asm +libavcodec/x86/pixblockdsp_init.c +libavcodec/x86/pngdsp.asm +libavcodec/x86/pngdsp_init.c +libavcodec/x86/qpel.asm +libavcodec/x86/qpeldsp.asm +libavcodec/x86/qpeldsp_init.c +libavcodec/x86/rnd_template.c +libavcodec/x86/sbcdsp.asm +libavcodec/x86/sbcdsp_init.c +libavcodec/x86/sbrdsp.asm +libavcodec/x86/sbrdsp_init.c +libavcodec/x86/simple_idct.asm +libavcodec/x86/simple_idct.h +libavcodec/x86/simple_idct10.asm +libavcodec/x86/simple_idct10_template.asm +libavcodec/x86/snowdsp.c +libavcodec/x86/svq1enc.asm +libavcodec/x86/svq1enc_init.c +libavcodec/x86/synth_filter.asm +libavcodec/x86/synth_filter_init.c +libavcodec/x86/takdsp.asm +libavcodec/x86/takdsp_init.c +libavcodec/x86/ttadsp.asm +libavcodec/x86/ttadsp_init.c +libavcodec/x86/ttaencdsp.asm +libavcodec/x86/ttaencdsp_init.c +libavcodec/x86/utvideodsp.asm +libavcodec/x86/utvideodsp_init.c +libavcodec/x86/v210-init.c +libavcodec/x86/v210.asm +libavcodec/x86/v210enc.asm +libavcodec/x86/v210enc_init.c +libavcodec/x86/vc1dsp.h +libavcodec/x86/vc1dsp_init.c +libavcodec/x86/vc1dsp_loopfilter.asm +libavcodec/x86/vc1dsp_mc.asm +libavcodec/x86/vc1dsp_mmx.c +libavcodec/x86/videodsp.asm +libavcodec/x86/videodsp_init.c +libavcodec/x86/vorbisdsp.asm +libavcodec/x86/vorbisdsp_init.c +libavcodec/x86/vp3dsp.asm +libavcodec/x86/vp3dsp_init.c +libavcodec/x86/vp6dsp.asm +libavcodec/x86/vp6dsp_init.c +libavcodec/x86/vp8dsp.asm +libavcodec/x86/vp8dsp_init.c +libavcodec/x86/vp8dsp_loopfilter.asm +libavcodec/x86/vp9dsp_init.c +libavcodec/x86/vp9dsp_init.h +libavcodec/x86/vp9dsp_init_10bpp.c +libavcodec/x86/vp9dsp_init_12bpp.c +libavcodec/x86/vp9dsp_init_16bpp.c +libavcodec/x86/vp9dsp_init_16bpp_template.c +libavcodec/x86/vp9intrapred.asm +libavcodec/x86/vp9intrapred_16bpp.asm +libavcodec/x86/vp9itxfm.asm +libavcodec/x86/vp9itxfm_16bpp.asm +libavcodec/x86/vp9itxfm_template.asm +libavcodec/x86/vp9lpf.asm +libavcodec/x86/vp9lpf_16bpp.asm +libavcodec/x86/vp9mc.asm +libavcodec/x86/vp9mc_16bpp.asm +libavcodec/x86/vpx_arith.h +libavcodec/x86/xvididct.asm +libavcodec/x86/xvididct.h +libavcodec/x86/xvididct_init.c +libavcodec/xan.c +libavcodec/xbm_parser.c +libavcodec/xbmdec.c +libavcodec/xbmenc.c +libavcodec/xface.c +libavcodec/xface.h +libavcodec/xfacedec.c +libavcodec/xfaceenc.c +libavcodec/xiph.c +libavcodec/xiph.h +libavcodec/xl.c +libavcodec/xma_parser.c +libavcodec/xpmdec.c +libavcodec/xsubdec.c +libavcodec/xsubenc.c +libavcodec/xvididct.c +libavcodec/xvididct.h +libavcodec/xvmc.h +libavcodec/xwd.h +libavcodec/xwd_parser.c +libavcodec/xwddec.c +libavcodec/xwdenc.c +libavcodec/xxan.c +libavcodec/y41pdec.c +libavcodec/y41penc.c +libavcodec/ylc.c +libavcodec/yop.c +libavcodec/yuv4dec.c +libavcodec/yuv4enc.c +libavcodec/zerocodec.c +libavcodec/zlib_wrapper.c +libavcodec/zlib_wrapper.h +libavcodec/zmbv.c +libavcodec/zmbvenc.c +libavdevice/Makefile +libavdevice/alldevices.c +libavdevice/alsa.c +libavdevice/alsa.h +libavdevice/alsa_dec.c +libavdevice/alsa_enc.c +libavdevice/avdevice.c +libavdevice/avdevice.h +libavdevice/caca.c +libavdevice/decklink_common.h +libavdevice/decklink_common_c.h +libavdevice/decklink_dec.h +libavdevice/decklink_enc.h +libavdevice/dshow_capture.h +libavdevice/fbdev_common.c +libavdevice/fbdev_common.h +libavdevice/fbdev_dec.c +libavdevice/fbdev_enc.c +libavdevice/iec61883.c +libavdevice/internal.h +libavdevice/jack.c +libavdevice/kmsgrab.c +libavdevice/lavfi.c +libavdevice/libavdevice.v +libavdevice/libcdio.c +libavdevice/libdc1394.c +libavdevice/openal-dec.c +libavdevice/opengl_enc.c +libavdevice/opengl_enc_shaders.h +libavdevice/oss.c +libavdevice/oss.h +libavdevice/oss_dec.c +libavdevice/oss_enc.c +libavdevice/pulse_audio_common.c +libavdevice/pulse_audio_common.h +libavdevice/pulse_audio_dec.c +libavdevice/pulse_audio_enc.c +libavdevice/sdl2.c +libavdevice/sndio.h +libavdevice/timefilter.c +libavdevice/timefilter.h +libavdevice/utils.c +libavdevice/v4l2-common.c +libavdevice/v4l2-common.h +libavdevice/v4l2.c +libavdevice/v4l2enc.c +libavdevice/version.c +libavdevice/version.h +libavdevice/version_major.h +libavdevice/xcbgrab.c +libavdevice/xv.c +libavfilter/Makefile +libavfilter/aarch64/Makefile +libavfilter/aarch64/vf_nlmeans_init.c +libavfilter/aarch64/vf_nlmeans_neon.S +libavfilter/aeval.c +libavfilter/af_acontrast.c +libavfilter/af_acopy.c +libavfilter/af_acrossover.c +libavfilter/af_acrusher.c +libavfilter/af_adeclick.c +libavfilter/af_adecorrelate.c +libavfilter/af_adelay.c +libavfilter/af_adenorm.c +libavfilter/af_aderivative.c +libavfilter/af_adrc.c +libavfilter/af_adynamicequalizer.c +libavfilter/af_adynamicsmooth.c +libavfilter/af_aecho.c +libavfilter/af_aemphasis.c +libavfilter/af_aexciter.c +libavfilter/af_afade.c +libavfilter/af_afftdn.c +libavfilter/af_afftfilt.c +libavfilter/af_afir.c +libavfilter/af_afir.h +libavfilter/af_afirdsp.h +libavfilter/af_aformat.c +libavfilter/af_afreqshift.c +libavfilter/af_afwtdn.c +libavfilter/af_agate.c +libavfilter/af_aiir.c +libavfilter/af_alimiter.c +libavfilter/af_amerge.c +libavfilter/af_amix.c +libavfilter/af_amultiply.c +libavfilter/af_anequalizer.c +libavfilter/af_anlmdn.c +libavfilter/af_anlmdndsp.h +libavfilter/af_anlms.c +libavfilter/af_anull.c +libavfilter/af_apad.c +libavfilter/af_aphaser.c +libavfilter/af_apsyclip.c +libavfilter/af_apulsator.c +libavfilter/af_aresample.c +libavfilter/af_arnndn.c +libavfilter/af_asdr.c +libavfilter/af_asetnsamples.c +libavfilter/af_asetrate.c +libavfilter/af_ashowinfo.c +libavfilter/af_asoftclip.c +libavfilter/af_aspectralstats.c +libavfilter/af_astats.c +libavfilter/af_asubboost.c +libavfilter/af_asupercut.c +libavfilter/af_atempo.c +libavfilter/af_atilt.c +libavfilter/af_axcorrelate.c +libavfilter/af_biquads.c +libavfilter/af_bs2b.c +libavfilter/af_channelmap.c +libavfilter/af_channelsplit.c +libavfilter/af_chorus.c +libavfilter/af_compand.c +libavfilter/af_compensationdelay.c +libavfilter/af_crossfeed.c +libavfilter/af_crystalizer.c +libavfilter/af_dcshift.c +libavfilter/af_deesser.c +libavfilter/af_dialoguenhance.c +libavfilter/af_drmeter.c +libavfilter/af_dynaudnorm.c +libavfilter/af_earwax.c +libavfilter/af_extrastereo.c +libavfilter/af_firequalizer.c +libavfilter/af_flanger.c +libavfilter/af_haas.c +libavfilter/af_hdcd.c +libavfilter/af_headphone.c +libavfilter/af_join.c +libavfilter/af_ladspa.c +libavfilter/af_loudnorm.c +libavfilter/af_lv2.c +libavfilter/af_mcompand.c +libavfilter/af_pan.c +libavfilter/af_replaygain.c +libavfilter/af_rubberband.c +libavfilter/af_sidechaincompress.c +libavfilter/af_silencedetect.c +libavfilter/af_silenceremove.c +libavfilter/af_sofalizer.c +libavfilter/af_speechnorm.c +libavfilter/af_stereotools.c +libavfilter/af_stereowiden.c +libavfilter/af_superequalizer.c +libavfilter/af_surround.c +libavfilter/af_tremolo.c +libavfilter/af_vibrato.c +libavfilter/af_virtualbass.c +libavfilter/af_volume.c +libavfilter/af_volume.h +libavfilter/af_volumedetect.c +libavfilter/afir_template.c +libavfilter/allfilters.c +libavfilter/asink_anullsink.c +libavfilter/asrc_afdelaysrc.c +libavfilter/asrc_afirsrc.c +libavfilter/asrc_anoisesrc.c +libavfilter/asrc_anullsrc.c +libavfilter/asrc_flite.c +libavfilter/asrc_hilbert.c +libavfilter/asrc_sinc.c +libavfilter/asrc_sine.c +libavfilter/atadenoise.h +libavfilter/audio.c +libavfilter/audio.h +libavfilter/avf_a3dscope.c +libavfilter/avf_abitscope.c +libavfilter/avf_ahistogram.c +libavfilter/avf_aphasemeter.c +libavfilter/avf_avectorscope.c +libavfilter/avf_concat.c +libavfilter/avf_showcqt.c +libavfilter/avf_showcqt.h +libavfilter/avf_showcwt.c +libavfilter/avf_showfreqs.c +libavfilter/avf_showspatial.c +libavfilter/avf_showspectrum.c +libavfilter/avf_showvolume.c +libavfilter/avf_showwaves.c +libavfilter/avfilter.c +libavfilter/avfilter.h +libavfilter/avfiltergraph.c +libavfilter/bbox.c +libavfilter/bbox.h +libavfilter/blend.h +libavfilter/blend_modes.c +libavfilter/boxblur.c +libavfilter/boxblur.h +libavfilter/bufferqueue.h +libavfilter/buffersink.c +libavfilter/buffersink.h +libavfilter/buffersrc.c +libavfilter/buffersrc.h +libavfilter/bwdif.h +libavfilter/colorchannelmixer_template.c +libavfilter/colorspace.c +libavfilter/colorspace.h +libavfilter/colorspacedsp.c +libavfilter/colorspacedsp.h +libavfilter/colorspacedsp_template.c +libavfilter/colorspacedsp_yuv2yuv_template.c +libavfilter/convolution.h +libavfilter/deshake.h +libavfilter/dnn/Makefile +libavfilter/dnn/dnn_backend_common.c +libavfilter/dnn/dnn_backend_common.h +libavfilter/dnn/dnn_backend_native.c +libavfilter/dnn/dnn_backend_native.h +libavfilter/dnn/dnn_backend_native_layer_avgpool.c +libavfilter/dnn/dnn_backend_native_layer_avgpool.h +libavfilter/dnn/dnn_backend_native_layer_conv2d.c +libavfilter/dnn/dnn_backend_native_layer_conv2d.h +libavfilter/dnn/dnn_backend_native_layer_dense.c +libavfilter/dnn/dnn_backend_native_layer_dense.h +libavfilter/dnn/dnn_backend_native_layer_depth2space.c +libavfilter/dnn/dnn_backend_native_layer_depth2space.h +libavfilter/dnn/dnn_backend_native_layer_mathbinary.c +libavfilter/dnn/dnn_backend_native_layer_mathbinary.h +libavfilter/dnn/dnn_backend_native_layer_mathunary.c +libavfilter/dnn/dnn_backend_native_layer_mathunary.h +libavfilter/dnn/dnn_backend_native_layer_maximum.c +libavfilter/dnn/dnn_backend_native_layer_maximum.h +libavfilter/dnn/dnn_backend_native_layer_pad.c +libavfilter/dnn/dnn_backend_native_layer_pad.h +libavfilter/dnn/dnn_backend_native_layers.c +libavfilter/dnn/dnn_backend_native_layers.h +libavfilter/dnn/dnn_backend_openvino.h +libavfilter/dnn/dnn_backend_tf.h +libavfilter/dnn/dnn_interface.c +libavfilter/dnn/dnn_io_proc.c +libavfilter/dnn/dnn_io_proc.h +libavfilter/dnn/queue.c +libavfilter/dnn/queue.h +libavfilter/dnn/safe_queue.c +libavfilter/dnn/safe_queue.h +libavfilter/dnn_filter_common.c +libavfilter/dnn_filter_common.h +libavfilter/dnn_interface.h +libavfilter/drawutils.c +libavfilter/drawutils.h +libavfilter/ebur128.c +libavfilter/ebur128.h +libavfilter/edge_common.c +libavfilter/edge_common.h +libavfilter/edge_template.c +libavfilter/f_bench.c +libavfilter/f_cue.c +libavfilter/f_drawgraph.c +libavfilter/f_ebur128.c +libavfilter/f_graphmonitor.c +libavfilter/f_interleave.c +libavfilter/f_latency.c +libavfilter/f_loop.c +libavfilter/f_metadata.c +libavfilter/f_perms.c +libavfilter/f_realtime.c +libavfilter/f_reverse.c +libavfilter/f_segment.c +libavfilter/f_select.c +libavfilter/f_sendcmd.c +libavfilter/f_sidedata.c +libavfilter/f_streamselect.c +libavfilter/f_zmq.c +libavfilter/fflcms2.c +libavfilter/fflcms2.h +libavfilter/fifo.c +libavfilter/filters.h +libavfilter/formats.c +libavfilter/formats.h +libavfilter/framepool.c +libavfilter/framepool.h +libavfilter/framequeue.c +libavfilter/framequeue.h +libavfilter/framerate.h +libavfilter/framesync.c +libavfilter/framesync.h +libavfilter/gblur.h +libavfilter/generate_wave_table.c +libavfilter/generate_wave_table.h +libavfilter/gradfun.h +libavfilter/graphdump.c +libavfilter/graphparser.c +libavfilter/hermite.h +libavfilter/hflip.h +libavfilter/internal.h +libavfilter/lavfutils.c +libavfilter/lavfutils.h +libavfilter/libavfilter.v +libavfilter/limiter.h +libavfilter/log2_tab.c +libavfilter/lswsutils.c +libavfilter/lswsutils.h +libavfilter/lut3d.h +libavfilter/maskedclamp.h +libavfilter/maskedmerge.h +libavfilter/median.h +libavfilter/median_template.c +libavfilter/motion_estimation.c +libavfilter/motion_estimation.h +libavfilter/opencl.c +libavfilter/opencl.h +libavfilter/opencl/avgblur.cl +libavfilter/opencl/colorkey.cl +libavfilter/opencl/colorspace_common.cl +libavfilter/opencl/convolution.cl +libavfilter/opencl/deshake.cl +libavfilter/opencl/neighbor.cl +libavfilter/opencl/nlmeans.cl +libavfilter/opencl/overlay.cl +libavfilter/opencl/pad.cl +libavfilter/opencl/remap.cl +libavfilter/opencl/tonemap.cl +libavfilter/opencl/transpose.cl +libavfilter/opencl/unsharp.cl +libavfilter/opencl/xfade.cl +libavfilter/opencl_source.h +libavfilter/palette.c +libavfilter/palette.h +libavfilter/phase_template.c +libavfilter/preserve_color.h +libavfilter/psnr.h +libavfilter/pthread.c +libavfilter/qp_table.c +libavfilter/qp_table.h +libavfilter/qsvvpp.c +libavfilter/qsvvpp.h +libavfilter/removegrain.h +libavfilter/scale_eval.c +libavfilter/scale_eval.h +libavfilter/scene_sad.c +libavfilter/scene_sad.h +libavfilter/setpts.c +libavfilter/settb.c +libavfilter/signature.h +libavfilter/signature_lookup.c +libavfilter/split.c +libavfilter/src_avsynctest.c +libavfilter/src_movie.c +libavfilter/ssim.h +libavfilter/stack_internal.c +libavfilter/stack_internal.h +libavfilter/stereo3d.h +libavfilter/thread.h +libavfilter/threshold.h +libavfilter/tinterlace.h +libavfilter/transform.c +libavfilter/transform.h +libavfilter/transpose.h +libavfilter/trim.c +libavfilter/unsharp.h +libavfilter/v360.h +libavfilter/vaapi_vpp.c +libavfilter/vaapi_vpp.h +libavfilter/vaf_spectrumsynth.c +libavfilter/version.c +libavfilter/version.h +libavfilter/version_major.h +libavfilter/vf_addroi.c +libavfilter/vf_alphamerge.c +libavfilter/vf_amplify.c +libavfilter/vf_aspect.c +libavfilter/vf_atadenoise.c +libavfilter/vf_avgblur.c +libavfilter/vf_avgblur_opencl.c +libavfilter/vf_avgblur_vulkan.c +libavfilter/vf_backgroundkey.c +libavfilter/vf_bbox.c +libavfilter/vf_bilateral.c +libavfilter/vf_bitplanenoise.c +libavfilter/vf_blackdetect.c +libavfilter/vf_blackframe.c +libavfilter/vf_blend.c +libavfilter/vf_blend_init.h +libavfilter/vf_blend_vulkan.c +libavfilter/vf_blockdetect.c +libavfilter/vf_blurdetect.c +libavfilter/vf_bm3d.c +libavfilter/vf_boxblur.c +libavfilter/vf_bwdif.c +libavfilter/vf_cas.c +libavfilter/vf_chromaber_vulkan.c +libavfilter/vf_chromakey.c +libavfilter/vf_chromanr.c +libavfilter/vf_chromashift.c +libavfilter/vf_ciescope.c +libavfilter/vf_codecview.c +libavfilter/vf_colorbalance.c +libavfilter/vf_colorchannelmixer.c +libavfilter/vf_colorconstancy.c +libavfilter/vf_colorcontrast.c +libavfilter/vf_colorcorrect.c +libavfilter/vf_colorize.c +libavfilter/vf_colorkey.c +libavfilter/vf_colorkey_opencl.c +libavfilter/vf_colorlevels.c +libavfilter/vf_colormap.c +libavfilter/vf_colormatrix.c +libavfilter/vf_colorspace.c +libavfilter/vf_colortemperature.c +libavfilter/vf_convolution.c +libavfilter/vf_convolution_opencl.c +libavfilter/vf_convolve.c +libavfilter/vf_copy.c +libavfilter/vf_corr.c +libavfilter/vf_cover_rect.c +libavfilter/vf_crop.c +libavfilter/vf_cropdetect.c +libavfilter/vf_curves.c +libavfilter/vf_datascope.c +libavfilter/vf_dblur.c +libavfilter/vf_dctdnoiz.c +libavfilter/vf_deband.c +libavfilter/vf_deblock.c +libavfilter/vf_decimate.c +libavfilter/vf_dedot.c +libavfilter/vf_deflicker.c +libavfilter/vf_deinterlace_vaapi.c +libavfilter/vf_dejudder.c +libavfilter/vf_delogo.c +libavfilter/vf_derain.c +libavfilter/vf_deshake.c +libavfilter/vf_deshake_opencl.c +libavfilter/vf_despill.c +libavfilter/vf_detelecine.c +libavfilter/vf_displace.c +libavfilter/vf_dnn_classify.c +libavfilter/vf_dnn_detect.c +libavfilter/vf_dnn_processing.c +libavfilter/vf_drawbox.c +libavfilter/vf_drawtext.c +libavfilter/vf_edgedetect.c +libavfilter/vf_elbg.c +libavfilter/vf_entropy.c +libavfilter/vf_epx.c +libavfilter/vf_eq.c +libavfilter/vf_eq.h +libavfilter/vf_estdif.c +libavfilter/vf_exposure.c +libavfilter/vf_extractplanes.c +libavfilter/vf_fade.c +libavfilter/vf_feedback.c +libavfilter/vf_fftdnoiz.c +libavfilter/vf_fftfilt.c +libavfilter/vf_field.c +libavfilter/vf_fieldhint.c +libavfilter/vf_fieldmatch.c +libavfilter/vf_fieldorder.c +libavfilter/vf_fillborders.c +libavfilter/vf_find_rect.c +libavfilter/vf_flip_vulkan.c +libavfilter/vf_floodfill.c +libavfilter/vf_format.c +libavfilter/vf_fps.c +libavfilter/vf_framepack.c +libavfilter/vf_framerate.c +libavfilter/vf_framestep.c +libavfilter/vf_freezedetect.c +libavfilter/vf_freezeframes.c +libavfilter/vf_frei0r.c +libavfilter/vf_fspp.c +libavfilter/vf_fspp.h +libavfilter/vf_gblur.c +libavfilter/vf_gblur_init.h +libavfilter/vf_gblur_vulkan.c +libavfilter/vf_geq.c +libavfilter/vf_gradfun.c +libavfilter/vf_grayworld.c +libavfilter/vf_guided.c +libavfilter/vf_hflip.c +libavfilter/vf_hflip_init.h +libavfilter/vf_histeq.c +libavfilter/vf_histogram.c +libavfilter/vf_hqdn3d.c +libavfilter/vf_hqdn3d.h +libavfilter/vf_hqx.c +libavfilter/vf_hsvkey.c +libavfilter/vf_hue.c +libavfilter/vf_huesaturation.c +libavfilter/vf_hwdownload.c +libavfilter/vf_hwmap.c +libavfilter/vf_hwupload.c +libavfilter/vf_hwupload_cuda.c +libavfilter/vf_hysteresis.c +libavfilter/vf_iccdetect.c +libavfilter/vf_iccgen.c +libavfilter/vf_identity.c +libavfilter/vf_idet.c +libavfilter/vf_idet.h +libavfilter/vf_il.c +libavfilter/vf_kerndeint.c +libavfilter/vf_lagfun.c +libavfilter/vf_lenscorrection.c +libavfilter/vf_libplacebo.c +libavfilter/vf_libvmaf.c +libavfilter/vf_limitdiff.c +libavfilter/vf_limiter.c +libavfilter/vf_lumakey.c +libavfilter/vf_lut.c +libavfilter/vf_lut2.c +libavfilter/vf_lut3d.c +libavfilter/vf_maskedclamp.c +libavfilter/vf_maskedmerge.c +libavfilter/vf_maskedminmax.c +libavfilter/vf_maskedthreshold.c +libavfilter/vf_maskfun.c +libavfilter/vf_median.c +libavfilter/vf_mergeplanes.c +libavfilter/vf_mestimate.c +libavfilter/vf_midequalizer.c +libavfilter/vf_minterpolate.c +libavfilter/vf_misc_vaapi.c +libavfilter/vf_mix.c +libavfilter/vf_monochrome.c +libavfilter/vf_morpho.c +libavfilter/vf_mpdecimate.c +libavfilter/vf_multiply.c +libavfilter/vf_negate.c +libavfilter/vf_neighbor.c +libavfilter/vf_neighbor_opencl.c +libavfilter/vf_nlmeans.c +libavfilter/vf_nlmeans.h +libavfilter/vf_nlmeans_init.h +libavfilter/vf_nlmeans_opencl.c +libavfilter/vf_nnedi.c +libavfilter/vf_noise.c +libavfilter/vf_noise.h +libavfilter/vf_normalize.c +libavfilter/vf_null.c +libavfilter/vf_ocr.c +libavfilter/vf_overlay.c +libavfilter/vf_overlay.h +libavfilter/vf_overlay_opencl.c +libavfilter/vf_overlay_qsv.c +libavfilter/vf_overlay_vaapi.c +libavfilter/vf_overlay_vulkan.c +libavfilter/vf_owdenoise.c +libavfilter/vf_pad.c +libavfilter/vf_pad_opencl.c +libavfilter/vf_palettegen.c +libavfilter/vf_paletteuse.c +libavfilter/vf_perspective.c +libavfilter/vf_phase.c +libavfilter/vf_photosensitivity.c +libavfilter/vf_pixdesctest.c +libavfilter/vf_pixelize.c +libavfilter/vf_pp.c +libavfilter/vf_pp7.c +libavfilter/vf_pp7.h +libavfilter/vf_premultiply.c +libavfilter/vf_procamp_vaapi.c +libavfilter/vf_program_opencl.c +libavfilter/vf_pseudocolor.c +libavfilter/vf_psnr.c +libavfilter/vf_pullup.c +libavfilter/vf_pullup.h +libavfilter/vf_qp.c +libavfilter/vf_random.c +libavfilter/vf_readeia608.c +libavfilter/vf_readvitc.c +libavfilter/vf_remap.c +libavfilter/vf_remap_opencl.c +libavfilter/vf_removegrain.c +libavfilter/vf_removelogo.c +libavfilter/vf_repeatfields.c +libavfilter/vf_rotate.c +libavfilter/vf_sab.c +libavfilter/vf_scale.c +libavfilter/vf_scale_cuda.h +libavfilter/vf_scale_vaapi.c +libavfilter/vf_scale_vulkan.c +libavfilter/vf_scdet.c +libavfilter/vf_scroll.c +libavfilter/vf_selectivecolor.c +libavfilter/vf_separatefields.c +libavfilter/vf_setparams.c +libavfilter/vf_shear.c +libavfilter/vf_showinfo.c +libavfilter/vf_showpalette.c +libavfilter/vf_shuffleframes.c +libavfilter/vf_shufflepixels.c +libavfilter/vf_shuffleplanes.c +libavfilter/vf_signalstats.c +libavfilter/vf_signature.c +libavfilter/vf_siti.c +libavfilter/vf_smartblur.c +libavfilter/vf_spp.c +libavfilter/vf_spp.h +libavfilter/vf_sr.c +libavfilter/vf_ssim.c +libavfilter/vf_ssim360.c +libavfilter/vf_stack.c +libavfilter/vf_stack_qsv.c +libavfilter/vf_stack_vaapi.c +libavfilter/vf_stereo3d.c +libavfilter/vf_subtitles.c +libavfilter/vf_super2xsai.c +libavfilter/vf_swaprect.c +libavfilter/vf_swapuv.c +libavfilter/vf_telecine.c +libavfilter/vf_threshold.c +libavfilter/vf_threshold_init.h +libavfilter/vf_thumbnail.c +libavfilter/vf_tile.c +libavfilter/vf_tinterlace.c +libavfilter/vf_tmidequalizer.c +libavfilter/vf_tonemap.c +libavfilter/vf_tonemap_opencl.c +libavfilter/vf_tonemap_vaapi.c +libavfilter/vf_tpad.c +libavfilter/vf_transpose.c +libavfilter/vf_transpose_opencl.c +libavfilter/vf_transpose_vaapi.c +libavfilter/vf_transpose_vulkan.c +libavfilter/vf_unsharp.c +libavfilter/vf_unsharp_opencl.c +libavfilter/vf_untile.c +libavfilter/vf_v360.c +libavfilter/vf_vaguedenoiser.c +libavfilter/vf_varblur.c +libavfilter/vf_vectorscope.c +libavfilter/vf_vflip.c +libavfilter/vf_vfrdet.c +libavfilter/vf_vibrance.c +libavfilter/vf_vidstabdetect.c +libavfilter/vf_vidstabtransform.c +libavfilter/vf_vif.c +libavfilter/vf_vignette.c +libavfilter/vf_vmafmotion.c +libavfilter/vf_vpp_qsv.c +libavfilter/vf_w3fdif.c +libavfilter/vf_waveform.c +libavfilter/vf_weave.c +libavfilter/vf_xbr.c +libavfilter/vf_xfade.c +libavfilter/vf_xfade_opencl.c +libavfilter/vf_xmedian.c +libavfilter/vf_yadif.c +libavfilter/vf_yaepblur.c +libavfilter/vf_zoompan.c +libavfilter/vf_zscale.c +libavfilter/video.c +libavfilter/video.h +libavfilter/vidstabutils.c +libavfilter/vidstabutils.h +libavfilter/vmaf_motion.h +libavfilter/vsink_nullsink.c +libavfilter/vsrc_cellauto.c +libavfilter/vsrc_gradients.c +libavfilter/vsrc_life.c +libavfilter/vsrc_mandelbrot.c +libavfilter/vsrc_mptestsrc.c +libavfilter/vsrc_sierpinski.c +libavfilter/vsrc_testsrc.c +libavfilter/vulkan.c +libavfilter/vulkan.h +libavfilter/vulkan_filter.c +libavfilter/vulkan_filter.h +libavfilter/w3fdif.h +libavfilter/window_func.h +libavfilter/x86/Makefile +libavfilter/x86/af_afir.asm +libavfilter/x86/af_afir_init.c +libavfilter/x86/af_anlmdn.asm +libavfilter/x86/af_anlmdn_init.c +libavfilter/x86/af_volume.asm +libavfilter/x86/af_volume_init.c +libavfilter/x86/avf_showcqt.asm +libavfilter/x86/avf_showcqt_init.c +libavfilter/x86/colorspacedsp.asm +libavfilter/x86/colorspacedsp_init.c +libavfilter/x86/scene_sad.asm +libavfilter/x86/scene_sad_init.c +libavfilter/x86/vf_atadenoise.asm +libavfilter/x86/vf_atadenoise_init.c +libavfilter/x86/vf_blend.asm +libavfilter/x86/vf_blend_init.c +libavfilter/x86/vf_bwdif.asm +libavfilter/x86/vf_bwdif_init.c +libavfilter/x86/vf_convolution.asm +libavfilter/x86/vf_convolution_init.c +libavfilter/x86/vf_eq.asm +libavfilter/x86/vf_eq_init.c +libavfilter/x86/vf_framerate.asm +libavfilter/x86/vf_framerate_init.c +libavfilter/x86/vf_fspp.asm +libavfilter/x86/vf_fspp_init.c +libavfilter/x86/vf_gblur.asm +libavfilter/x86/vf_gblur_init.c +libavfilter/x86/vf_gradfun.asm +libavfilter/x86/vf_gradfun_init.c +libavfilter/x86/vf_hflip.asm +libavfilter/x86/vf_hflip_init.c +libavfilter/x86/vf_hqdn3d.asm +libavfilter/x86/vf_hqdn3d_init.c +libavfilter/x86/vf_idet.asm +libavfilter/x86/vf_idet_init.c +libavfilter/x86/vf_interlace.asm +libavfilter/x86/vf_limiter.asm +libavfilter/x86/vf_limiter_init.c +libavfilter/x86/vf_lut3d.asm +libavfilter/x86/vf_lut3d_init.c +libavfilter/x86/vf_maskedclamp.asm +libavfilter/x86/vf_maskedclamp_init.c +libavfilter/x86/vf_maskedmerge.asm +libavfilter/x86/vf_maskedmerge_init.c +libavfilter/x86/vf_nlmeans.asm +libavfilter/x86/vf_nlmeans_init.c +libavfilter/x86/vf_noise.c +libavfilter/x86/vf_overlay.asm +libavfilter/x86/vf_overlay_init.c +libavfilter/x86/vf_pp7.asm +libavfilter/x86/vf_pp7_init.c +libavfilter/x86/vf_psnr.asm +libavfilter/x86/vf_psnr_init.c +libavfilter/x86/vf_pullup.asm +libavfilter/x86/vf_pullup_init.c +libavfilter/x86/vf_removegrain.asm +libavfilter/x86/vf_removegrain_init.c +libavfilter/x86/vf_spp.c +libavfilter/x86/vf_ssim.asm +libavfilter/x86/vf_ssim_init.c +libavfilter/x86/vf_stereo3d.asm +libavfilter/x86/vf_stereo3d_init.c +libavfilter/x86/vf_threshold.asm +libavfilter/x86/vf_threshold_init.c +libavfilter/x86/vf_tinterlace_init.c +libavfilter/x86/vf_transpose.asm +libavfilter/x86/vf_transpose_init.c +libavfilter/x86/vf_v360.asm +libavfilter/x86/vf_v360_init.c +libavfilter/x86/vf_w3fdif.asm +libavfilter/x86/vf_w3fdif_init.c +libavfilter/x86/vf_yadif.asm +libavfilter/x86/vf_yadif_init.c +libavfilter/x86/yadif-10.asm +libavfilter/x86/yadif-16.asm +libavfilter/yadif.h +libavfilter/yadif_common.c +libavformat/3dostr.c +libavformat/4xm.c +libavformat/Makefile +libavformat/a64.c +libavformat/aacdec.c +libavformat/aadec.c +libavformat/aaxdec.c +libavformat/ac3_channel_layout_tab.c +libavformat/ac3dec.c +libavformat/acedec.c +libavformat/acm.c +libavformat/act.c +libavformat/adp.c +libavformat/ads.c +libavformat/adtsenc.c +libavformat/adxdec.c +libavformat/aea.c +libavformat/afc.c +libavformat/aiff.c +libavformat/aiff.h +libavformat/aiffdec.c +libavformat/aiffenc.c +libavformat/aixdec.c +libavformat/allformats.c +libavformat/alp.c +libavformat/amr.c +libavformat/amvenc.c +libavformat/anm.c +libavformat/apac.c +libavformat/apc.c +libavformat/ape.c +libavformat/apetag.c +libavformat/apetag.h +libavformat/apm.c +libavformat/apngdec.c +libavformat/apngenc.c +libavformat/aptxdec.c +libavformat/aqtitledec.c +libavformat/argo_asf.c +libavformat/argo_asf.h +libavformat/argo_brp.c +libavformat/argo_cvg.c +libavformat/asf.c +libavformat/asf.h +libavformat/asf_tags.c +libavformat/asfcrypt.c +libavformat/asfcrypt.h +libavformat/asfdec_f.c +libavformat/asfdec_o.c +libavformat/asfenc.c +libavformat/assdec.c +libavformat/assenc.c +libavformat/ast.c +libavformat/ast.h +libavformat/astdec.c +libavformat/astenc.c +libavformat/async.c +libavformat/au.c +libavformat/av1.c +libavformat/av1.h +libavformat/av1dec.c +libavformat/avc.c +libavformat/avc.h +libavformat/avformat.c +libavformat/avformat.h +libavformat/avi.h +libavformat/avidec.c +libavformat/avienc.c +libavformat/avio.c +libavformat/avio.h +libavformat/avio_internal.h +libavformat/aviobuf.c +libavformat/avlanguage.c +libavformat/avlanguage.h +libavformat/avr.c +libavformat/avs.c +libavformat/avs2dec.c +libavformat/avs3dec.c +libavformat/bethsoftvid.c +libavformat/bfi.c +libavformat/bink.c +libavformat/binka.c +libavformat/bintext.c +libavformat/bit.c +libavformat/bluray.c +libavformat/bmv.c +libavformat/boadec.c +libavformat/bonk.c +libavformat/brstm.c +libavformat/c93.c +libavformat/cache.c +libavformat/caf.c +libavformat/caf.h +libavformat/cafdec.c +libavformat/cafenc.c +libavformat/cavsvideodec.c +libavformat/cdg.c +libavformat/cdxl.c +libavformat/chromaprint.c +libavformat/cinedec.c +libavformat/codec2.c +libavformat/concat.c +libavformat/concatdec.c +libavformat/crcenc.c +libavformat/crypto.c +libavformat/dash.c +libavformat/dash.h +libavformat/dashdec.c +libavformat/dashenc.c +libavformat/data_uri.c +libavformat/dauddec.c +libavformat/daudenc.c +libavformat/dca_sample_rate_tab.c +libavformat/dcstr.c +libavformat/demux.c +libavformat/demux.h +libavformat/demux_utils.c +libavformat/derf.c +libavformat/dfa.c +libavformat/dfpwmdec.c +libavformat/dhav.c +libavformat/diracdec.c +libavformat/dnxhddec.c +libavformat/dovi_isom.c +libavformat/dovi_isom.h +libavformat/dsfdec.c +libavformat/dsicin.c +libavformat/dss.c +libavformat/dtsdec.c +libavformat/dtshddec.c +libavformat/dump.c +libavformat/dv.c +libavformat/dv.h +libavformat/dvbsub.c +libavformat/dvbtxt.c +libavformat/dvenc.c +libavformat/dxa.c +libavformat/eacdata.c +libavformat/electronicarts.c +libavformat/epafdec.c +libavformat/ffmeta.h +libavformat/ffmetadec.c +libavformat/ffmetaenc.c +libavformat/fifo.c +libavformat/fifo_test.c +libavformat/file.c +libavformat/filmstripdec.c +libavformat/filmstripenc.c +libavformat/fitsdec.c +libavformat/fitsenc.c +libavformat/flac_picture.c +libavformat/flac_picture.h +libavformat/flacdec.c +libavformat/flacenc.c +libavformat/flacenc.h +libavformat/flacenc_header.c +libavformat/flic.c +libavformat/flv.h +libavformat/flvdec.c +libavformat/flvenc.c +libavformat/format.c +libavformat/framecrcenc.c +libavformat/framehash.c +libavformat/frmdec.c +libavformat/fsb.c +libavformat/ftp.c +libavformat/fwse.c +libavformat/g722.c +libavformat/g723_1.c +libavformat/g726.c +libavformat/g729dec.c +libavformat/gdv.c +libavformat/genh.c +libavformat/gif.c +libavformat/gifdec.c +libavformat/golomb_tab.c +libavformat/gopher.c +libavformat/gsmdec.c +libavformat/gxf.c +libavformat/gxf.h +libavformat/gxfenc.c +libavformat/h261dec.c +libavformat/h263dec.c +libavformat/h264dec.c +libavformat/hashenc.c +libavformat/hca.c +libavformat/hcom.c +libavformat/hdsenc.c +libavformat/hevc.c +libavformat/hevc.h +libavformat/hevcdec.c +libavformat/hls.c +libavformat/hls_sample_encryption.c +libavformat/hls_sample_encryption.h +libavformat/hlsenc.c +libavformat/hlsplaylist.c +libavformat/hlsplaylist.h +libavformat/hlsproto.c +libavformat/hnm.c +libavformat/http.c +libavformat/http.h +libavformat/httpauth.c +libavformat/httpauth.h +libavformat/icecast.c +libavformat/icodec.c +libavformat/icoenc.c +libavformat/id3v1.c +libavformat/id3v1.h +libavformat/id3v2.c +libavformat/id3v2.h +libavformat/id3v2enc.c +libavformat/idcin.c +libavformat/idroqdec.c +libavformat/idroqenc.c +libavformat/iff.c +libavformat/ifv.c +libavformat/ilbc.c +libavformat/imf.h +libavformat/imf_cpl.c +libavformat/imfdec.c +libavformat/img2.c +libavformat/img2.h +libavformat/img2_alias_pix.c +libavformat/img2_brender_pix.c +libavformat/img2dec.c +libavformat/img2enc.c +libavformat/imx.c +libavformat/ingenientdec.c +libavformat/internal.h +libavformat/ip.c +libavformat/ip.h +libavformat/ipfsgateway.c +libavformat/ipmovie.c +libavformat/ipudec.c +libavformat/ircam.c +libavformat/ircam.h +libavformat/ircamdec.c +libavformat/ircamenc.c +libavformat/isom.c +libavformat/isom.h +libavformat/isom_tags.c +libavformat/iss.c +libavformat/iv8.c +libavformat/ivfdec.c +libavformat/ivfenc.c +libavformat/jacosubdec.c +libavformat/jacosubenc.c +libavformat/jpegtables.c +libavformat/jpegxl_probe.c +libavformat/jpegxl_probe.h +libavformat/jvdec.c +libavformat/kvag.c +libavformat/lafdec.c +libavformat/latmenc.c +libavformat/libamqp.c +libavformat/libavformat.v +libavformat/libgme.c +libavformat/libmodplug.c +libavformat/libopenmpt.c +libavformat/librist.c +libavformat/libsmbclient.c +libavformat/libsrt.c +libavformat/libssh.c +libavformat/libzmq.c +libavformat/lmlm4.c +libavformat/loasdec.c +libavformat/log2_tab.c +libavformat/lrc.c +libavformat/lrc.h +libavformat/lrcdec.c +libavformat/lrcenc.c +libavformat/luodatdec.c +libavformat/lvfdec.c +libavformat/lxfdec.c +libavformat/m4vdec.c +libavformat/matroska.c +libavformat/matroska.h +libavformat/matroskadec.c +libavformat/matroskaenc.c +libavformat/mca.c +libavformat/mccdec.c +libavformat/md5proto.c +libavformat/metadata.c +libavformat/metadata.h +libavformat/mgsts.c +libavformat/microdvddec.c +libavformat/microdvdenc.c +libavformat/mj2kdec.c +libavformat/mkvtimestamp_v2.c +libavformat/mlpdec.c +libavformat/mlvdec.c +libavformat/mm.c +libavformat/mmf.c +libavformat/mms.c +libavformat/mms.h +libavformat/mmsh.c +libavformat/mmst.c +libavformat/mods.c +libavformat/moflex.c +libavformat/mov.c +libavformat/mov_chan.c +libavformat/mov_chan.h +libavformat/mov_esds.c +libavformat/movenc.c +libavformat/movenc.h +libavformat/movenc_ttml.c +libavformat/movenc_ttml.h +libavformat/movenccenc.c +libavformat/movenccenc.h +libavformat/movenchint.c +libavformat/mp3dec.c +libavformat/mp3enc.c +libavformat/mpc.c +libavformat/mpc8.c +libavformat/mpeg.c +libavformat/mpeg.h +libavformat/mpeg4audio_sample_rates.c +libavformat/mpegaudiotabs.c +libavformat/mpegenc.c +libavformat/mpegts.c +libavformat/mpegts.h +libavformat/mpegtsenc.c +libavformat/mpegvideodec.c +libavformat/mpjpeg.c +libavformat/mpjpegdec.c +libavformat/mpl2dec.c +libavformat/mpsubdec.c +libavformat/msf.c +libavformat/msnwc_tcp.c +libavformat/mspdec.c +libavformat/mtaf.c +libavformat/mtv.c +libavformat/musx.c +libavformat/mux.c +libavformat/mux.h +libavformat/mux_utils.c +libavformat/mvdec.c +libavformat/mvi.c +libavformat/mxf.c +libavformat/mxf.h +libavformat/mxfdec.c +libavformat/mxfenc.c +libavformat/mxg.c +libavformat/ncdec.c +libavformat/network.c +libavformat/network.h +libavformat/nistspheredec.c +libavformat/nspdec.c +libavformat/nsvdec.c +libavformat/nullenc.c +libavformat/nut.c +libavformat/nut.h +libavformat/nutdec.c +libavformat/nutenc.c +libavformat/nuv.c +libavformat/oggdec.c +libavformat/oggdec.h +libavformat/oggenc.c +libavformat/oggparsecelt.c +libavformat/oggparsedirac.c +libavformat/oggparseflac.c +libavformat/oggparseogm.c +libavformat/oggparseopus.c +libavformat/oggparseskeleton.c +libavformat/oggparsespeex.c +libavformat/oggparsetheora.c +libavformat/oggparsevorbis.c +libavformat/oggparsevp8.c +libavformat/oma.c +libavformat/oma.h +libavformat/omadec.c +libavformat/omaenc.c +libavformat/options.c +libavformat/options_table.h +libavformat/os_support.c +libavformat/os_support.h +libavformat/paf.c +libavformat/pcm.c +libavformat/pcm.h +libavformat/pcmdec.c +libavformat/pcmenc.c +libavformat/pjsdec.c +libavformat/pmpdec.c +libavformat/pp_bnk.c +libavformat/prompeg.c +libavformat/protocols.c +libavformat/psxstr.c +libavformat/pva.c +libavformat/pvfdec.c +libavformat/qcp.c +libavformat/qtpalette.c +libavformat/qtpalette.h +libavformat/r3d.c +libavformat/rawdec.c +libavformat/rawdec.h +libavformat/rawenc.c +libavformat/rawenc.h +libavformat/rawutils.c +libavformat/rawutils.h +libavformat/rawvideodec.c +libavformat/rdt.c +libavformat/rdt.h +libavformat/realtextdec.c +libavformat/redspark.c +libavformat/replaygain.c +libavformat/replaygain.h +libavformat/riff.c +libavformat/riff.h +libavformat/riffdec.c +libavformat/riffenc.c +libavformat/rka.c +libavformat/rl2.c +libavformat/rm.c +libavformat/rm.h +libavformat/rmdec.c +libavformat/rmenc.c +libavformat/rmsipr.c +libavformat/rmsipr.h +libavformat/rpl.c +libavformat/rsd.c +libavformat/rso.c +libavformat/rso.h +libavformat/rsodec.c +libavformat/rsoenc.c +libavformat/rtmp.h +libavformat/rtmpcrypt.c +libavformat/rtmpcrypt.h +libavformat/rtmpdh.c +libavformat/rtmpdh.h +libavformat/rtmpdigest.c +libavformat/rtmphttp.c +libavformat/rtmppkt.c +libavformat/rtmppkt.h +libavformat/rtmpproto.c +libavformat/rtp.c +libavformat/rtp.h +libavformat/rtpdec.c +libavformat/rtpdec.h +libavformat/rtpdec_ac3.c +libavformat/rtpdec_amr.c +libavformat/rtpdec_asf.c +libavformat/rtpdec_dv.c +libavformat/rtpdec_formats.h +libavformat/rtpdec_g726.c +libavformat/rtpdec_h261.c +libavformat/rtpdec_h263.c +libavformat/rtpdec_h263_rfc2190.c +libavformat/rtpdec_h264.c +libavformat/rtpdec_hevc.c +libavformat/rtpdec_ilbc.c +libavformat/rtpdec_jpeg.c +libavformat/rtpdec_latm.c +libavformat/rtpdec_mpa_robust.c +libavformat/rtpdec_mpeg12.c +libavformat/rtpdec_mpeg4.c +libavformat/rtpdec_mpegts.c +libavformat/rtpdec_qcelp.c +libavformat/rtpdec_qdm2.c +libavformat/rtpdec_qt.c +libavformat/rtpdec_rfc4175.c +libavformat/rtpdec_svq3.c +libavformat/rtpdec_vc2hq.c +libavformat/rtpdec_vp8.c +libavformat/rtpdec_vp9.c +libavformat/rtpdec_xiph.c +libavformat/rtpenc.c +libavformat/rtpenc.h +libavformat/rtpenc_aac.c +libavformat/rtpenc_amr.c +libavformat/rtpenc_chain.c +libavformat/rtpenc_chain.h +libavformat/rtpenc_h261.c +libavformat/rtpenc_h263.c +libavformat/rtpenc_h263_rfc2190.c +libavformat/rtpenc_h264_hevc.c +libavformat/rtpenc_jpeg.c +libavformat/rtpenc_latm.c +libavformat/rtpenc_mpegts.c +libavformat/rtpenc_mpv.c +libavformat/rtpenc_rfc4175.c +libavformat/rtpenc_vc2hq.c +libavformat/rtpenc_vp8.c +libavformat/rtpenc_vp9.c +libavformat/rtpenc_xiph.c +libavformat/rtpproto.c +libavformat/rtpproto.h +libavformat/rtsp.c +libavformat/rtsp.h +libavformat/rtspcodes.h +libavformat/rtspdec.c +libavformat/rtspenc.c +libavformat/s337m.c +libavformat/samidec.c +libavformat/sapdec.c +libavformat/sapenc.c +libavformat/sauce.c +libavformat/sauce.h +libavformat/sbcdec.c +libavformat/sbgdec.c +libavformat/sccdec.c +libavformat/sccenc.c +libavformat/scd.c +libavformat/sdns.c +libavformat/sdp.c +libavformat/sdr2.c +libavformat/sdsdec.c +libavformat/sdxdec.c +libavformat/seek.c +libavformat/segafilm.c +libavformat/segafilmenc.c +libavformat/segment.c +libavformat/serdec.c +libavformat/sga.c +libavformat/shortendec.c +libavformat/sierravmd.c +libavformat/siff.c +libavformat/smacker.c +libavformat/smjpeg.c +libavformat/smjpeg.h +libavformat/smjpegdec.c +libavformat/smjpegenc.c +libavformat/smoothstreamingenc.c +libavformat/smush.c +libavformat/sol.c +libavformat/sox.h +libavformat/soxdec.c +libavformat/soxenc.c +libavformat/spdif.c +libavformat/spdif.h +libavformat/spdifdec.c +libavformat/spdifenc.c +libavformat/srtdec.c +libavformat/srtenc.c +libavformat/srtp.c +libavformat/srtp.h +libavformat/srtpproto.c +libavformat/stldec.c +libavformat/subfile.c +libavformat/subtitles.c +libavformat/subtitles.h +libavformat/subviewer1dec.c +libavformat/subviewerdec.c +libavformat/supdec.c +libavformat/supenc.c +libavformat/svag.c +libavformat/svs.c +libavformat/swf.c +libavformat/swf.h +libavformat/swfdec.c +libavformat/swfenc.c +libavformat/takdec.c +libavformat/tcp.c +libavformat/tedcaptionsdec.c +libavformat/tee.c +libavformat/tee_common.c +libavformat/tee_common.h +libavformat/teeproto.c +libavformat/thp.c +libavformat/tiertexseq.c +libavformat/tls.c +libavformat/tls.h +libavformat/tls_gnutls.c +libavformat/tmv.c +libavformat/to_upper4.c +libavformat/tta.c +libavformat/ttaenc.c +libavformat/ttmlenc.c +libavformat/ttmlenc.h +libavformat/tty.c +libavformat/txd.c +libavformat/ty.c +libavformat/udp.c +libavformat/uncodedframecrcenc.c +libavformat/unix.c +libavformat/url.c +libavformat/url.h +libavformat/urldecode.c +libavformat/urldecode.h +libavformat/utils.c +libavformat/vag.c +libavformat/vapoursynth.c +libavformat/vc1dec.c +libavformat/vc1test.c +libavformat/vc1testenc.c +libavformat/version.c +libavformat/version.h +libavformat/version_major.h +libavformat/vividas.c +libavformat/vivo.c +libavformat/voc.c +libavformat/voc.h +libavformat/voc_packet.c +libavformat/vocdec.c +libavformat/vocenc.c +libavformat/vorbiscomment.c +libavformat/vorbiscomment.h +libavformat/vpcc.c +libavformat/vpcc.h +libavformat/vpk.c +libavformat/vplayerdec.c +libavformat/vqf.c +libavformat/w64.c +libavformat/w64.h +libavformat/wady.c +libavformat/wavarc.c +libavformat/wavdec.c +libavformat/wavenc.c +libavformat/wc3movie.c +libavformat/webm_chunk.c +libavformat/webmdashenc.c +libavformat/webpenc.c +libavformat/webvttdec.c +libavformat/webvttenc.c +libavformat/westwood_aud.c +libavformat/westwood_audenc.c +libavformat/westwood_vqa.c +libavformat/wsddec.c +libavformat/wtv.h +libavformat/wtv_common.c +libavformat/wtvdec.c +libavformat/wtvenc.c +libavformat/wv.c +libavformat/wv.h +libavformat/wvdec.c +libavformat/wvedec.c +libavformat/wvenc.c +libavformat/xa.c +libavformat/xmd.c +libavformat/xmv.c +libavformat/xvag.c +libavformat/xwma.c +libavformat/yop.c +libavformat/yuv4mpeg.h +libavformat/yuv4mpegdec.c +libavformat/yuv4mpegenc.c +libavutil/Makefile +libavutil/aarch64/Makefile +libavutil/aarch64/asm.S +libavutil/aarch64/bswap.h +libavutil/aarch64/cpu.c +libavutil/aarch64/cpu.h +libavutil/aarch64/float_dsp_init.c +libavutil/aarch64/float_dsp_neon.S +libavutil/aarch64/neontest.h +libavutil/aarch64/timer.h +libavutil/aarch64/tx_float_init.c +libavutil/aarch64/tx_float_neon.S +libavutil/adler32.c +libavutil/adler32.h +libavutil/aes.c +libavutil/aes.h +libavutil/aes_ctr.c +libavutil/aes_ctr.h +libavutil/aes_internal.h +libavutil/ambient_viewing_environment.c +libavutil/ambient_viewing_environment.h +libavutil/arm/Makefile +libavutil/arm/asm.S +libavutil/arm/bswap.h +libavutil/arm/cpu.c +libavutil/arm/cpu.h +libavutil/arm/float_dsp_arm.h +libavutil/arm/float_dsp_init_arm.c +libavutil/arm/float_dsp_init_vfp.c +libavutil/arm/float_dsp_neon.S +libavutil/arm/float_dsp_vfp.S +libavutil/arm/intmath.h +libavutil/arm/intreadwrite.h +libavutil/arm/timer.h +libavutil/attributes.h +libavutil/attributes_internal.h +libavutil/audio_fifo.c +libavutil/audio_fifo.h +libavutil/avassert.h +libavutil/avsscanf.c +libavutil/avstring.c +libavutil/avstring.h +libavutil/avutil.h +libavutil/base64.c +libavutil/base64.h +libavutil/bfin/timer.h +libavutil/blowfish.c +libavutil/blowfish.h +libavutil/bprint.c +libavutil/bprint.h +libavutil/bswap.h +libavutil/buffer.c +libavutil/buffer.h +libavutil/buffer_internal.h +libavutil/camellia.c +libavutil/camellia.h +libavutil/cast5.c +libavutil/cast5.h +libavutil/channel_layout.c +libavutil/channel_layout.h +libavutil/colorspace.h +libavutil/common.h +libavutil/cpu.c +libavutil/cpu.h +libavutil/cpu_internal.h +libavutil/crc.c +libavutil/crc.h +libavutil/csp.c +libavutil/csp.h +libavutil/cuda_check.h +libavutil/des.c +libavutil/des.h +libavutil/detection_bbox.c +libavutil/detection_bbox.h +libavutil/dict.c +libavutil/dict.h +libavutil/dict_internal.h +libavutil/display.c +libavutil/display.h +libavutil/dovi_meta.c +libavutil/dovi_meta.h +libavutil/downmix_info.c +libavutil/downmix_info.h +libavutil/dynarray.h +libavutil/encryption_info.c +libavutil/encryption_info.h +libavutil/error.c +libavutil/error.h +libavutil/eval.c +libavutil/eval.h +libavutil/ffmath.h +libavutil/fifo.c +libavutil/fifo.h +libavutil/file.c +libavutil/file.h +libavutil/file_open.c +libavutil/file_open.h +libavutil/film_grain_params.c +libavutil/film_grain_params.h +libavutil/fixed_dsp.c +libavutil/fixed_dsp.h +libavutil/float2half.c +libavutil/float2half.h +libavutil/float_dsp.c +libavutil/float_dsp.h +libavutil/frame.c +libavutil/frame.h +libavutil/getenv_utf8.h +libavutil/half2float.c +libavutil/half2float.h +libavutil/hash.c +libavutil/hash.h +libavutil/hdr_dynamic_metadata.c +libavutil/hdr_dynamic_metadata.h +libavutil/hdr_dynamic_vivid_metadata.c +libavutil/hdr_dynamic_vivid_metadata.h +libavutil/hmac.c +libavutil/hmac.h +libavutil/hwcontext.c +libavutil/hwcontext.h +libavutil/hwcontext_cuda.c +libavutil/hwcontext_cuda.h +libavutil/hwcontext_cuda_internal.h +libavutil/hwcontext_d3d11va.h +libavutil/hwcontext_drm.c +libavutil/hwcontext_drm.h +libavutil/hwcontext_dxva2.h +libavutil/hwcontext_internal.h +libavutil/hwcontext_mediacodec.h +libavutil/hwcontext_opencl.c +libavutil/hwcontext_opencl.h +libavutil/hwcontext_qsv.c +libavutil/hwcontext_qsv.h +libavutil/hwcontext_stub.c +libavutil/hwcontext_vaapi.c +libavutil/hwcontext_vaapi.h +libavutil/hwcontext_vdpau.c +libavutil/hwcontext_vdpau.h +libavutil/hwcontext_videotoolbox.h +libavutil/hwcontext_vulkan.c +libavutil/hwcontext_vulkan.h +libavutil/imgutils.c +libavutil/imgutils.h +libavutil/imgutils_internal.h +libavutil/integer.c +libavutil/integer.h +libavutil/internal.h +libavutil/intfloat.h +libavutil/intmath.c +libavutil/intmath.h +libavutil/intreadwrite.h +libavutil/lfg.c +libavutil/lfg.h +libavutil/libavutil.v +libavutil/libm.h +libavutil/lls.c +libavutil/lls.h +libavutil/log.c +libavutil/log.h +libavutil/log2_tab.c +libavutil/loongarch/Makefile +libavutil/loongarch/cpu.c +libavutil/loongarch/cpu.h +libavutil/lzo.c +libavutil/lzo.h +libavutil/macos_kperf.h +libavutil/macros.h +libavutil/mastering_display_metadata.c +libavutil/mastering_display_metadata.h +libavutil/mathematics.c +libavutil/mathematics.h +libavutil/md5.c +libavutil/md5.h +libavutil/mem.c +libavutil/mem.h +libavutil/mem_internal.h +libavutil/mips/Makefile +libavutil/motion_vector.h +libavutil/murmur3.c +libavutil/murmur3.h +libavutil/objc.h +libavutil/opt.c +libavutil/opt.h +libavutil/parseutils.c +libavutil/parseutils.h +libavutil/pca.h +libavutil/pixdesc.c +libavutil/pixdesc.h +libavutil/pixelutils.c +libavutil/pixelutils.h +libavutil/pixfmt.h +libavutil/ppc/Makefile +libavutil/ppc/cpu.c +libavutil/ppc/cpu.h +libavutil/ppc/float_dsp_altivec.c +libavutil/ppc/float_dsp_altivec.h +libavutil/ppc/float_dsp_init.c +libavutil/ppc/float_dsp_vsx.c +libavutil/ppc/float_dsp_vsx.h +libavutil/ppc/intreadwrite.h +libavutil/ppc/timer.h +libavutil/ppc/util_altivec.h +libavutil/qsort.h +libavutil/random_seed.c +libavutil/random_seed.h +libavutil/rational.c +libavutil/rational.h +libavutil/rc4.c +libavutil/rc4.h +libavutil/replaygain.h +libavutil/reverse.c +libavutil/reverse.h +libavutil/ripemd.c +libavutil/ripemd.h +libavutil/riscv/Makefile +libavutil/riscv/asm.S +libavutil/riscv/bswap.h +libavutil/riscv/cpu.c +libavutil/riscv/cpu.h +libavutil/riscv/fixed_dsp_init.c +libavutil/riscv/fixed_dsp_rvv.S +libavutil/riscv/float_dsp_init.c +libavutil/riscv/float_dsp_rvv.S +libavutil/riscv/intmath.h +libavutil/riscv/timer.h +libavutil/samplefmt.c +libavutil/samplefmt.h +libavutil/sha.c +libavutil/sha.h +libavutil/sha512.c +libavutil/sha512.h +libavutil/slicethread.c +libavutil/slicethread.h +libavutil/softfloat.h +libavutil/softfloat_ieee754.h +libavutil/softfloat_tables.h +libavutil/spherical.c +libavutil/spherical.h +libavutil/stereo3d.c +libavutil/stereo3d.h +libavutil/tablegen.h +libavutil/tea.c +libavutil/tea.h +libavutil/thread.h +libavutil/threadmessage.c +libavutil/threadmessage.h +libavutil/time.c +libavutil/time.h +libavutil/time_internal.h +libavutil/timecode.c +libavutil/timecode.h +libavutil/timer.h +libavutil/timestamp.h +libavutil/tree.c +libavutil/tree.h +libavutil/twofish.c +libavutil/twofish.h +libavutil/tx.c +libavutil/tx.h +libavutil/tx_double.c +libavutil/tx_float.c +libavutil/tx_int32.c +libavutil/tx_priv.h +libavutil/tx_template.c +libavutil/utils.c +libavutil/uuid.c +libavutil/uuid.h +libavutil/version.c +libavutil/version.h +libavutil/version_major.h +libavutil/video_enc_params.c +libavutil/video_enc_params.h +libavutil/vulkan.c +libavutil/vulkan.h +libavutil/vulkan_functions.h +libavutil/vulkan_glslang.c +libavutil/vulkan_loader.h +libavutil/vulkan_shaderc.c +libavutil/wchar_filename.h +libavutil/x86/Makefile +libavutil/x86/asm.h +libavutil/x86/bswap.h +libavutil/x86/cpu.c +libavutil/x86/cpu.h +libavutil/x86/cpuid.asm +libavutil/x86/emms.asm +libavutil/x86/emms.h +libavutil/x86/fixed_dsp.asm +libavutil/x86/fixed_dsp_init.c +libavutil/x86/float_dsp.asm +libavutil/x86/float_dsp_init.c +libavutil/x86/imgutils.asm +libavutil/x86/imgutils_init.c +libavutil/x86/intmath.h +libavutil/x86/intreadwrite.h +libavutil/x86/lls.asm +libavutil/x86/lls_init.c +libavutil/x86/pixelutils.asm +libavutil/x86/pixelutils.h +libavutil/x86/pixelutils_init.c +libavutil/x86/timer.h +libavutil/x86/tx_float.asm +libavutil/x86/tx_float_init.c +libavutil/x86/x86inc.asm +libavutil/x86/x86util.asm +libavutil/xga_font_data.c +libavutil/xga_font_data.h +libavutil/xtea.c +libavutil/xtea.h +libpostproc/Makefile +libpostproc/libpostproc.v +libpostproc/postprocess.c +libpostproc/postprocess.h +libpostproc/postprocess_altivec_template.c +libpostproc/postprocess_internal.h +libpostproc/postprocess_template.c +libpostproc/version.c +libpostproc/version.h +libpostproc/version_major.h +libswresample/Makefile +libswresample/aarch64/Makefile +libswresample/aarch64/audio_convert_init.c +libswresample/aarch64/audio_convert_neon.S +libswresample/aarch64/resample.S +libswresample/aarch64/resample_init.c +libswresample/arm/Makefile +libswresample/arm/audio_convert_init.c +libswresample/arm/audio_convert_neon.S +libswresample/arm/resample.S +libswresample/arm/resample_init.c +libswresample/audioconvert.c +libswresample/audioconvert.h +libswresample/dither.c +libswresample/dither_template.c +libswresample/libswresample.v +libswresample/log2_tab.c +libswresample/noise_shaping_data.c +libswresample/options.c +libswresample/rematrix.c +libswresample/rematrix_template.c +libswresample/resample.c +libswresample/resample.h +libswresample/resample_dsp.c +libswresample/resample_template.c +libswresample/soxr_resample.c +libswresample/swresample.c +libswresample/swresample.h +libswresample/swresample_frame.c +libswresample/swresample_internal.h +libswresample/version.c +libswresample/version.h +libswresample/version_major.h +libswresample/x86/Makefile +libswresample/x86/audio_convert.asm +libswresample/x86/audio_convert_init.c +libswresample/x86/rematrix.asm +libswresample/x86/rematrix_init.c +libswresample/x86/resample.asm +libswresample/x86/resample_init.c +libswscale/Makefile +libswscale/aarch64/Makefile +libswscale/aarch64/hscale.S +libswscale/aarch64/output.S +libswscale/aarch64/rgb2rgb.c +libswscale/aarch64/rgb2rgb_neon.S +libswscale/aarch64/swscale.c +libswscale/aarch64/swscale_unscaled.c +libswscale/aarch64/yuv2rgb_neon.S +libswscale/alphablend.c +libswscale/arm/Makefile +libswscale/arm/hscale.S +libswscale/arm/output.S +libswscale/arm/rgb2yuv_neon_16.S +libswscale/arm/rgb2yuv_neon_32.S +libswscale/arm/swscale.c +libswscale/arm/swscale_unscaled.c +libswscale/arm/yuv2rgb_neon.S +libswscale/bayer_template.c +libswscale/gamma.c +libswscale/half2float.c +libswscale/hscale.c +libswscale/hscale_fast_bilinear.c +libswscale/input.c +libswscale/libswscale.v +libswscale/log2_tab.c +libswscale/options.c +libswscale/output.c +libswscale/ppc/Makefile +libswscale/ppc/swscale_altivec.c +libswscale/ppc/swscale_ppc_template.c +libswscale/ppc/swscale_vsx.c +libswscale/ppc/yuv2rgb_altivec.c +libswscale/ppc/yuv2rgb_altivec.h +libswscale/ppc/yuv2yuv_altivec.c +libswscale/rgb2rgb.c +libswscale/rgb2rgb.h +libswscale/rgb2rgb_template.c +libswscale/riscv/Makefile +libswscale/riscv/rgb2rgb.c +libswscale/riscv/rgb2rgb_rvv.S +libswscale/slice.c +libswscale/swscale.c +libswscale/swscale.h +libswscale/swscale_internal.h +libswscale/swscale_unscaled.c +libswscale/utils.c +libswscale/version.c +libswscale/version.h +libswscale/version_major.h +libswscale/vscale.c +libswscale/x86/Makefile +libswscale/x86/hscale_fast_bilinear_simd.c +libswscale/x86/input.asm +libswscale/x86/output.asm +libswscale/x86/rgb2rgb.c +libswscale/x86/rgb2rgb_template.c +libswscale/x86/rgb_2_rgb.asm +libswscale/x86/scale.asm +libswscale/x86/scale_avx2.asm +libswscale/x86/swscale.c +libswscale/x86/swscale_template.c +libswscale/x86/yuv2rgb.c +libswscale/x86/yuv2rgb_template.c +libswscale/x86/yuv2yuvX.asm +libswscale/x86/yuv_2_rgb.asm +libswscale/yuv2rgb.c +presets/libvpx-1080p.ffpreset +presets/libvpx-1080p50_60.ffpreset +presets/libvpx-360p.ffpreset +presets/libvpx-720p.ffpreset +presets/libvpx-720p50_60.ffpreset +tests/Makefile +tests/api/Makefile +tests/checkasm/Makefile +tests/checkasm/aacpsdsp.c +tests/checkasm/aarch64/checkasm.S +tests/checkasm/af_afir.c +tests/checkasm/alacdsp.c +tests/checkasm/arm/checkasm.S +tests/checkasm/audiodsp.c +tests/checkasm/av_tx.c +tests/checkasm/blockdsp.c +tests/checkasm/bswapdsp.c +tests/checkasm/checkasm.c +tests/checkasm/checkasm.h +tests/checkasm/exrdsp.c +tests/checkasm/fixed_dsp.c +tests/checkasm/flacdsp.c +tests/checkasm/float_dsp.c +tests/checkasm/fmtconvert.c +tests/checkasm/g722dsp.c +tests/checkasm/huffyuvdsp.c +tests/checkasm/idctdsp.c +tests/checkasm/jpeg2000dsp.c +tests/checkasm/llviddsp.c +tests/checkasm/llviddspenc.c +tests/checkasm/lpc.c +tests/checkasm/motion.c +tests/checkasm/opusdsp.c +tests/checkasm/pixblockdsp.c +tests/checkasm/riscv/checkasm.S +tests/checkasm/sbrdsp.c +tests/checkasm/sw_gbrp.c +tests/checkasm/sw_rgb.c +tests/checkasm/sw_scale.c +tests/checkasm/synth_filter.c +tests/checkasm/utvideodsp.c +tests/checkasm/v210dec.c +tests/checkasm/v210enc.c +tests/checkasm/vf_blend.c +tests/checkasm/vf_colorspace.c +tests/checkasm/vf_convolution.c +tests/checkasm/vf_eq.c +tests/checkasm/vf_gblur.c +tests/checkasm/vf_hflip.c +tests/checkasm/vf_nlmeans.c +tests/checkasm/vf_threshold.c +tests/checkasm/videodsp.c +tests/checkasm/vorbisdsp.c +tests/checkasm/vp8dsp.c +tests/checkasm/vp9dsp.c +tests/checkasm/x86/checkasm.asm +tests/fate/aac.mak +tests/fate/ac3.mak +tests/fate/acodec.mak +tests/fate/adpcm.mak +tests/fate/alac.mak +tests/fate/als.mak +tests/fate/amrnb.mak +tests/fate/amrwb.mak +tests/fate/api.mak +tests/fate/apng.mak +tests/fate/atrac.mak +tests/fate/audio.mak +tests/fate/bmp.mak +tests/fate/build.mak +tests/fate/caf.mak +tests/fate/canopus.mak +tests/fate/cbs.mak +tests/fate/cdxl.mak +tests/fate/checkasm.mak +tests/fate/concatdec.mak +tests/fate/cover-art.mak +tests/fate/dca.mak +tests/fate/demux.mak +tests/fate/dfa.mak +tests/fate/dnn.mak +tests/fate/dnxhd.mak +tests/fate/dpcm.mak +tests/fate/dvvideo.mak +tests/fate/ea.mak +tests/fate/exif.mak +tests/fate/ffmpeg.mak +tests/fate/ffprobe.mak +tests/fate/fft.mak +tests/fate/fifo-muxer.mak +tests/fate/filter-audio.mak +tests/fate/filter-video.mak +tests/fate/fits.mak +tests/fate/flac.mak +tests/fate/flvenc.mak +tests/fate/gapless.mak +tests/fate/gif.mak +tests/fate/h264.mak +tests/fate/hap.mak +tests/fate/hevc.mak +tests/fate/hlsenc.mak +tests/fate/hw.mak +tests/fate/id3v2.mak +tests/fate/image.mak +tests/fate/imf.mak +tests/fate/indeo.mak +tests/fate/lavf-audio.mak +tests/fate/lavf-container.mak +tests/fate/lavf-image.mak +tests/fate/lavf-image2pipe.mak +tests/fate/lavf-video.mak +tests/fate/libavcodec.mak +tests/fate/libavdevice.mak +tests/fate/libavformat.mak +tests/fate/libavutil.mak +tests/fate/libswresample.mak +tests/fate/libswscale.mak +tests/fate/lossless-audio.mak +tests/fate/lossless-video.mak +tests/fate/matroska.mak +tests/fate/microsoft.mak +tests/fate/monkeysaudio.mak +tests/fate/mov.mak +tests/fate/mp3.mak +tests/fate/mpc.mak +tests/fate/mpeg4.mak +tests/fate/mpegps.mak +tests/fate/mpegts.mak +tests/fate/mxf.mak +tests/fate/oma.mak +tests/fate/opus.mak +tests/fate/pcm.mak +tests/fate/pixfmt.mak +tests/fate/pixlet.mak +tests/fate/probe.mak +tests/fate/prores.mak +tests/fate/qt.mak +tests/fate/qtrle.mak +tests/fate/real.mak +tests/fate/screen.mak +tests/fate/seek.mak +tests/fate/segafilm.mak +tests/fate/segment.mak +tests/fate/source-check.sh +tests/fate/source.mak +tests/fate/spdif.mak +tests/fate/speedhq.mak +tests/fate/subtitles.mak +tests/fate/truehd.mak +tests/fate/utvideo.mak +tests/fate/vbn.mak +tests/fate/vcodec.mak +tests/fate/video.mak +tests/fate/voice.mak +tests/fate/vorbis.mak +tests/fate/vpx.mak +tests/fate/vqf.mak +tests/fate/wavpack.mak +tests/fate/webm-dash-manifest.mak +tests/fate/wma.mak +tests/fate/xvid.mak +tools/Makefile +tools/aviocat.c +tools/cl2c +tools/crypto_bench.c +tools/cws2fws.c +tools/decode_simple.c +tools/decode_simple.h +tools/enum_options.c +tools/ffescape.c +tools/ffeval.c +tools/ffhash.c +tools/fourcc2pixfmt.c +tools/graph2dot.c +tools/ismindex.c +tools/pktdumper.c +tools/probetest.c +tools/qt-faststart.c +tools/scale_slice_test.c +tools/seek_print.c +tools/sidxindex.c +tools/sofa2wavs.c +tools/trasher.c +tools/uncoded_frame.c +tools/venc_data_dump.c +tools/zmqsend.c diff --git a/ffmpeg_gen_free_tarball.sh b/ffmpeg_gen_free_tarball.sh new file mode 100755 index 0000000..f4710fe --- /dev/null +++ b/ffmpeg_gen_free_tarball.sh @@ -0,0 +1,130 @@ +#!/bin/bash +# +# Copyright (c) 2022 Andreas Schneider +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# shellcheck disable=2181 + +export LC_COLLATE="C.UTF-8" + +FF_PKGNAME="ffmpeg" +FF_PKGNAME_SUFFIX="-free" +FF_VERSION="$(rpmspec -P ./*.spec | grep ^Version | sed -e 's/Version:[ ]*//g')" +FF_TARBALL_URL="https://ffmpeg.org/releases/${FF_PKGNAME}-${FF_VERSION}.tar.xz" +FF_TARBALL="$(basename "${FF_TARBALL_URL}")" +FF_GPG_ARMOR_FILE="${FF_TARBALL}.asc" +FF_PKG_DIR="$(pwd)" +FF_KEYRING="${FF_PKG_DIR}/ffmpeg.keyring" +FF_TMPDIR=$(mktemp --tmpdir -d ffmpeg-XXXXXXXX) +FF_PATH="${FF_TMPDIR}/${FF_PKGNAME}-${FF_VERSION}" + +cleanup_tmpdir() { + # shellcheck disable=2164 + popd 2>/dev/null + rm -rf "${FF_TMPDIR}" +} +trap cleanup_tmpdir SIGINT + +cleanup_and_exit() +{ + cleanup_tmpdir + + if test "$1" = 0 -o -z "$1"; then + exit 0 + else + # shellcheck disable=2086 + exit ${1} + fi +} + +if [[ ! -w "${FF_TARBALL}" ]]; then + echo ">>> Downloading tarball" + wget "${FF_TARBALL_URL}" +fi +if [[ ! -w "${FF_TARBALL}.asc" ]]; then + echo ">>> Downloading signature" + wget "${FF_TARBALL_URL}.asc" +fi + +echo ">>> Verifying ${FF_TARBALL} GPG signature" +gpgv2 --quiet --keyring "${FF_KEYRING}" "${FF_GPG_ARMOR_FILE}" "${FF_TARBALL}" +if [ $? -ne 0 ]; then + echo "ERROR: GPG signature verification failed" + cleanup_and_exit 1 +fi +echo + +echo ">>> Unpacking ${FF_TARBALL}" + +tar -xf "${FF_TARBALL}" -C "${FF_TMPDIR}" +if [ $? -ne 0 ]; then + echo "ERROR: Failed to unpack ${FF_TARBALL}" + cleanup_and_exit 1 +fi + +if [[ ! -r ffmpeg_free_sources ]]; then + echo "ERROR: ffmpeg_free_sources doesn't exist!" + cleanup_and_exit 1 +fi +readarray -t keepfiles < ffmpeg_free_sources + +pushd "${FF_PATH}" || cleanup_and_exit 1 + +echo +echo ">>> Cleaning up sources for new tarball ..." + +# Get file list from ffmpeg +mapfile -d '' filelist < <(find ./ -type f -printf '%P\0') + +# Sort arrays +readarray -t keepfiles_sorted < <(printf '%s\0' "${keepfiles[@]}" | sort -z | xargs -0n1) +readarray -t filelist_sorted < <(printf '%s\0' "${filelist[@]}" | sort -z | xargs -0n1) + +# Compare arrays and remove files which are left over +comm -2 -3 -z <(printf '%s\0' "${filelist_sorted[@]}") <(printf '%s\0' "${keepfiles_sorted[@]}") | xargs -0 rm -f + +readarray -t removed_files < <(comm -1 -3 -z <(printf '%s\0' "${filelist_sorted[@]}") <(printf '%s\0' "${keepfiles_sorted[@]}") | xargs -0n1) +if [[ "${#removed_files[@]}" -ge 1 ]]; then + if [[ "${#removed_files[@]}" -eq 1 ]] && [[ -z "${removed_files[0]}" ]]; then + echo "... done" + else + echo "File not in upstream tarball anymore (please cleanup 'ffmpeg_free_sources'):" + for f in "${removed_files[@]}"; do + if [[ -z "${f}" ]]; then + continue + fi + echo " * ${f}" + done + fi +fi +echo + +popd || cleanup_and_exit 1 # /FF_PATH + +pushd "${FF_TMPDIR}" || cleanup_and_exit 1 + +echo ">>> Create new tarball ${FF_PKGNAME}${FF_PKGNAME_SUFFIX}-${FF_VERSION}.tar.xz ..." +tar -cJf "${FF_PKG_DIR}/${FF_PKGNAME}${FF_PKGNAME_SUFFIX}-${FF_VERSION}.tar.xz" "${FF_PKGNAME}-${FF_VERSION}" +if [ $? -ne 0 ]; then + echo "ERROR: Creating tarball failed" + cleanup_and_exit 1 +fi + +popd || cleanup_and_exit 1 # /FF_TMPDIR + +du -sh "${FF_PKGNAME}${FF_PKGNAME_SUFFIX}-${FF_VERSION}.tar.xz" +echo + +cleanup_and_exit 0 diff --git a/ffmpeg_update_free_sources.sh b/ffmpeg_update_free_sources.sh new file mode 100755 index 0000000..7dc5c9c --- /dev/null +++ b/ffmpeg_update_free_sources.sh @@ -0,0 +1,60 @@ +#!/bin/bash +# +# Copyright (c) 2022 Andreas Schneider +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# shellcheck disable=2181 + +export LC_COLLATE="C.UTF-8" + +cleanup_and_exit() +{ + if test "$1" = 0 -o -z "$1"; then + exit 0 + else + # shellcheck disable=2086 + exit ${1} + fi +} + +echo ">>> Collect information from ${1}" +build_log="$(readlink -f "${1}")" +if [[ -z "${build_log}" ]] || [[ ! -r "${build_log}" ]]; then + echo "Build log doesn't exist: %{build_log}" + cleanup_and_exit 1 +fi + +asm_files="$(grep "^gcc.*\.c$" "${build_log}" | awk 'NF>1{print $NF}' | sort)" +c_files="$(grep "^nasm.*\.asm$" "${build_log}" | awk 'NF>1{print $NF}' | sort)" + +# shellcheck disable=2206 +new_sources=(${asm_files} + ${c_files}) + +# Sort arrays +readarray -t new_sources_sorted < <(printf '%s\0' "${new_sources[@]}" | sort -z | xargs -0n1) + +# Create a backup for a diff +cp -a ffmpeg_free_sources ffmpeg_free_sources.orig +cp -a ffmpeg_free_sources ffmpeg_free_sources.new +printf "%s\n" "${new_sources_sorted[@]}" >> ffmpeg_free_sources.new +# Update ffmpeg_free_sources +echo ">>> Updating ffmpeg_free_sources" +sort < ffmpeg_free_sources.new | uniq | sed '/^$/d' > ffmpeg_free_sources +echo ">>> Differences in file list" +diff -u ffmpeg_free_sources.orig ffmpeg_free_sources +rm -f ffmpeg_free_sources.new + +cleanup_and_exit 0 diff --git a/sources b/sources index 193e4da..c3587ce 100644 --- a/sources +++ b/sources @@ -1,3 +1,4 @@ -SHA512 (ffmpeg-8.0.1.tar.xz) = 7af5cd1c7ba04f8d7ea1b54b64b9c235f2a606dc0c18d25cfdf20958bcad4851d3265b4894fc6ba5dd205c2309971c7e7fb890ee1d64e0a41a3faf159f77957f -SHA512 (ffmpeg-8.0.1.tar.xz.asc) = f56e9e89ecdf9f12e3dae90b52289e5d09bfbfc0f6e13aaf17da9330c138fdb62b132f856c2fd16f5d9f5d6bcf1725602c8781c3e5f07bda6ce1306c379792ab +SHA512 (ffmpeg-free-6.0.1.tar.xz) = da4aa6db92fbbfdda9fc64249a0c826ae5de33cacbed5ebbfbbe9a30d57ae6f79b61496fcf151dc504d646efd44ba63722220be0b718dd8ffdaa5b2510d92a97 +SHA512 (ffmpeg-6.0.1.tar.xz.asc) = 314f9ef996b85bc93c9fb823d582697c7415ac35f56bfc9cd906893491c8076df90bd852cf6e5e757b1fa94bd415ed108488c1220add49eb1f4854fc253c178c +SHA512 (ffmpeg-dlopen-headers.tar.xz) = 97e6986fc2bb9dfa4516135a76b04d27ceb52ff96f0af21a6169919aeefefb4d2e2e24a771959689cdbec385f5d71614ba661223c67c0e94089a6dd823a30099 SHA512 (ffmpeg.keyring) = 9b36506835db36f776b7ddb53ad6fa9e915e6ca2f9c7cfebe8eb45513e1036a985283590a840ca313a111bf35dc3731f68885aaafb1fb7011ec433cc119e5165