The branch, master has been updated
via f24474dcfc719e29dc87e6483d6187ea233f4e0f (commit)
via 593b4269027ea6d514b8505d317f6f131693c84e (commit)
via 9bd10fa32cce741fd0dd900ab9db28cc00e3c9b7 (commit)
via 5e210f0552b29c7c369662e12674e724441ac069 (commit)
via a282500087591ef5a22942d204f5743afa2265d4 (commit)
via d7173e982ec815dcf70999c8683c465b99ce249c (commit)
via 173988aa0c2b8710e47a0b4d3651b1fe6d2166ce (commit)
via 5d7e4b7496bc5f6327202d4ed53052311abded2f (commit)
from 5d3538b8dc5d969dcdbc419d5b6903f776845efb (commit)
- Log -----------------------------------------------------------------
commit f24474dcfc719e29dc87e6483d6187ea233f4e0f
Author: Nicolas Gaullier <[email protected]>
AuthorDate: Tue Aug 12 12:35:18 2025 +0200
Commit: Michael Niedermayer <[email protected]>
CommitDate: Tue Sep 2 16:05:46 2025 +0200
avcodec/aac_ac3_parser: do not override the profile set by the decoder
Parsing the ADTS header is not enough to detect HE-AAC v1/v2.
Regression since 64bb91fd3b5a00a8849531c7e8dd207f2a626096.
Fixes #11600
Signed-off-by: Nicolas Gaullier <[email protected]>
Signed-off-by: Michael Niedermayer <[email protected]>
diff --git a/libavcodec/aac_ac3_parser.c b/libavcodec/aac_ac3_parser.c
index b49ce0277c..51c801214c 100644
--- a/libavcodec/aac_ac3_parser.c
+++ b/libavcodec/aac_ac3_parser.c
@@ -152,7 +152,8 @@ get_next:
ff_adts_header_parse_buf(buf, &hdr) < 0)
return i;
- avctx->profile = hdr.object_type - 1;
+ if (avctx->profile == AV_PROFILE_UNKNOWN)
+ avctx->profile = hdr.object_type - 1;
/* ADTS does not support USAC */
s1->key_frame = 1;
bit_rate = hdr.bit_rate;
commit 593b4269027ea6d514b8505d317f6f131693c84e
Author: Nicolas Gaullier <[email protected]>
AuthorDate: Tue Aug 12 12:35:17 2025 +0200
Commit: Michael Niedermayer <[email protected]>
CommitDate: Tue Sep 2 16:05:46 2025 +0200
avcodec/aac_ac3_parser: simplify
Use ff_adts_header_parse_buf() wrapper to simplify as GetBitContext is
no longer needed (it was introduced for USAC).
Partially reverts 64bb91fd3b5a00a8849531c7e8dd207f2a626096.
Signed-off-by: Nicolas Gaullier <[email protected]>
Signed-off-by: Michael Niedermayer <[email protected]>
diff --git a/libavcodec/aac_ac3_parser.c b/libavcodec/aac_ac3_parser.c
index ced640dd28..b49ce0277c 100644
--- a/libavcodec/aac_ac3_parser.c
+++ b/libavcodec/aac_ac3_parser.c
@@ -147,11 +147,9 @@ get_next:
} else {
#if CONFIG_AAC_PARSER
AACADTSHeaderInfo hdr;
- GetBitContext gb;
- init_get_bits8(&gb, buf, buf_size);
if (buf_size < AV_AAC_ADTS_HEADER_SIZE ||
- ff_adts_header_parse(&gb, &hdr) < 0)
+ ff_adts_header_parse_buf(buf, &hdr) < 0)
return i;
avctx->profile = hdr.object_type - 1;
commit 9bd10fa32cce741fd0dd900ab9db28cc00e3c9b7
Author: Nicolas Gaullier <[email protected]>
AuthorDate: Tue Aug 12 12:35:16 2025 +0200
Commit: Michael Niedermayer <[email protected]>
CommitDate: Tue Sep 2 16:05:46 2025 +0200
avcodec/aac_ac3_parser: remove unused USAC/ADTS code
ff_adts_header_parse() parse the object_type from a 2 bits field.
See also 696ea1c2236842572df88d573e24a39be3f19c98.
Partially reverts 64bb91fd3b5a00a8849531c7e8dd207f2a626096.
Signed-off-by: Nicolas Gaullier <[email protected]>
Signed-off-by: Michael Niedermayer <[email protected]>
diff --git a/libavcodec/aac_ac3_parser.c b/libavcodec/aac_ac3_parser.c
index e10ce13a3b..ced640dd28 100644
--- a/libavcodec/aac_ac3_parser.c
+++ b/libavcodec/aac_ac3_parser.c
@@ -155,7 +155,8 @@ get_next:
return i;
avctx->profile = hdr.object_type - 1;
- s1->key_frame = (avctx->profile == AV_PROFILE_AAC_USAC) ?
get_bits1(&gb) : 1;
+ /* ADTS does not support USAC */
+ s1->key_frame = 1;
bit_rate = hdr.bit_rate;
#endif
}
commit 5e210f0552b29c7c369662e12674e724441ac069
Author: Maryla Ustarroz-Calonge <[email protected]>
AuthorDate: Mon Aug 11 13:57:03 2025 +0200
Commit: Michael Niedermayer <[email protected]>
CommitDate: Tue Sep 2 16:05:45 2025 +0200
avcodec/libaom: Add test for HDR10+ metadata support
Signed-off-by: Maryla Ustarroz-Calonge <[email protected]>
Signed-off-by: Michael Niedermayer <[email protected]>
diff --git a/tests/Makefile b/tests/Makefile
index 3f4dbaabfd..3eef290e41 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -162,6 +162,7 @@ include $(SRC_PATH)/tests/fate/apng.mak
include $(SRC_PATH)/tests/fate/apv.mak
include $(SRC_PATH)/tests/fate/atrac.mak
include $(SRC_PATH)/tests/fate/audio.mak
+include $(SRC_PATH)/tests/fate/av1.mak
include $(SRC_PATH)/tests/fate/bmp.mak
include $(SRC_PATH)/tests/fate/build.mak
include $(SRC_PATH)/tests/fate/caf.mak
diff --git a/tests/fate/av1.mak b/tests/fate/av1.mak
new file mode 100644
index 0000000000..81072be5b8
--- /dev/null
+++ b/tests/fate/av1.mak
@@ -0,0 +1,7 @@
+# Tests that reading and writing with codec libaom-av1 preserves HDR10+
metadata.
+FATE_AV1_FFMPEG_FFPROBE-$(call ENCDEC, LIBAOM_AV1 VP9, IVF MATROSKA) +=
fate-libaom-hdr10-plus
+fate-libaom-hdr10-plus: CMD = enc_external
$(TARGET_SAMPLES)/mkv/hdr10_plus_vp9_sample.webm ivf "-map 0 -c:v libaom-av1
-cpu-used 8" "-show_frames -show_entries frame=side_data_list -codec:v
libaom-av1"
+
+FATE_SAMPLES_FFMPEG_FFPROBE += $(FATE_AV1_FFMPEG_FFPROBE-yes)
+
+fate-av1: $(FATE_AV1_FFMPEG_FFPROBE-yes)
diff --git a/tests/ref/fate/libaom-hdr10-plus b/tests/ref/fate/libaom-hdr10-plus
new file mode 100644
index 0000000000..ae9618937b
--- /dev/null
+++ b/tests/ref/fate/libaom-hdr10-plus
@@ -0,0 +1,44 @@
+[FRAME]
+[SIDE_DATA]
+side_data_type=HDR Dynamic Metadata SMPTE2094-40 (HDR10+)
+application version=1
+num_windows=1
+targeted_system_display_maximum_luminance=400/1
+maxscl=3340/100000
+maxscl=2870/100000
+maxscl=2720/100000
+average_maxrgb=510/100000
+num_distribution_maxrgb_percentiles=9
+distribution_maxrgb_percentage=1
+distribution_maxrgb_percentile=30/100000
+distribution_maxrgb_percentage=5
+distribution_maxrgb_percentile=2940/100000
+distribution_maxrgb_percentage=10
+distribution_maxrgb_percentile=255/100000
+distribution_maxrgb_percentage=25
+distribution_maxrgb_percentile=70/100000
+distribution_maxrgb_percentage=50
+distribution_maxrgb_percentile=1340/100000
+distribution_maxrgb_percentage=75
+distribution_maxrgb_percentile=1600/100000
+distribution_maxrgb_percentage=90
+distribution_maxrgb_percentile=1850/100000
+distribution_maxrgb_percentage=95
+distribution_maxrgb_percentile=1950/100000
+distribution_maxrgb_percentage=99
+distribution_maxrgb_percentile=2940/100000
+fraction_bright_pixels=1/1000
+knee_point_x=0/4095
+knee_point_y=0/4095
+num_bezier_curve_anchors=9
+bezier_curve_anchors=102/1023
+bezier_curve_anchors=205/1023
+bezier_curve_anchors=307/1023
+bezier_curve_anchors=410/1023
+bezier_curve_anchors=512/1023
+bezier_curve_anchors=614/1023
+bezier_curve_anchors=717/1023
+bezier_curve_anchors=819/1023
+bezier_curve_anchors=922/1023
+[/SIDE_DATA]
+[/FRAME]
commit a282500087591ef5a22942d204f5743afa2265d4
Author: Maryla Ustarroz-Calonge <[email protected]>
AuthorDate: Mon Aug 11 13:57:02 2025 +0200
Commit: Michael Niedermayer <[email protected]>
CommitDate: Tue Sep 2 15:56:56 2025 +0200
avcodec/libaom: Add HDR10+ metadata support
Signed-off-by: Maryla Ustarroz-Calonge <[email protected]>
Signed-off-by: Michael Niedermayer <[email protected]>
diff --git a/Changelog b/Changelog
index 96d616991d..aaab8d9b54 100644
--- a/Changelog
+++ b/Changelog
@@ -39,6 +39,8 @@ version 8.0:
- AV1 Vulkan encoder
- ProRes RAW decoder
- ProRes RAW Vulkan hwaccel
+- ffprobe -codec option
+- HDR10+ metadata passthrough when decoding/encoding with libaom-av1
version 7.1:
diff --git a/libavcodec/libaomdec.c b/libavcodec/libaomdec.c
index 69eec8b089..cf5986baf4 100644
--- a/libavcodec/libaomdec.c
+++ b/libavcodec/libaomdec.c
@@ -28,11 +28,14 @@
#include "libavutil/common.h"
#include "libavutil/cpu.h"
+#include "libavutil/hdr_dynamic_metadata.h"
#include "libavutil/imgutils.h"
#include "avcodec.h"
+#include "bytestream.h"
#include "codec_internal.h"
#include "decode.h"
+#include "itut35.h"
#include "libaom.h"
#include "profiles.h"
@@ -137,6 +140,61 @@ static int set_pix_fmt(AVCodecContext *avctx, struct
aom_image *img)
}
}
+static int decode_metadata_itu_t_t35(AVFrame *frame,
+ const uint8_t *buffer, size_t buffer_size)
+{
+ if (buffer_size < 6)
+ return AVERROR(EINVAL);
+
+ GetByteContext bc;
+ bytestream2_init(&bc, buffer, buffer_size);
+
+ const int country_code = bytestream2_get_byteu(&bc);
+ const int provider_code = bytestream2_get_be16u(&bc);
+ const int provider_oriented_code = bytestream2_get_be16u(&bc);
+ const int application_identifier = bytestream2_get_byteu(&bc);
+
+ // See "HDR10+ AV1 Metadata Handling Specification" v1.0.1, Section 2.1.
+ if (country_code == ITU_T_T35_COUNTRY_CODE_US
+ && provider_code == ITU_T_T35_PROVIDER_CODE_SAMSUNG
+ && provider_oriented_code == 0x0001
+ && application_identifier == 0x04) {
+ // HDR10+
+ AVDynamicHDRPlus *hdr_plus =
av_dynamic_hdr_plus_create_side_data(frame);
+ if (!hdr_plus)
+ return AVERROR(ENOMEM);
+
+ int res = av_dynamic_hdr_plus_from_t35(hdr_plus, bc.buffer,
+
bytestream2_get_bytes_left(&bc));
+ if (res < 0)
+ return res;
+ }
+
+ return 0;
+}
+
+static int decode_metadata(AVFrame *frame, const struct aom_image *img)
+{
+ const size_t num_metadata = aom_img_num_metadata(img);
+ for (size_t i = 0; i < num_metadata; ++i) {
+ const aom_metadata_t *metadata = aom_img_get_metadata(img, i);
+ if (!metadata)
+ continue;
+
+ switch (metadata->type) {
+ case OBU_METADATA_TYPE_ITUT_T35: {
+ int res = decode_metadata_itu_t_t35(frame, metadata->payload,
metadata->sz);
+ if (res < 0)
+ return res;
+ break;
+ }
+ default:
+ break;
+ }
+ }
+ return 0;
+}
+
static int aom_decode(AVCodecContext *avctx, AVFrame *picture,
int *got_frame, AVPacket *avpkt)
{
@@ -215,6 +273,11 @@ static int aom_decode(AVCodecContext *avctx, AVFrame
*picture,
av_image_copy(picture->data, picture->linesize, planes,
stride, avctx->pix_fmt, img->d_w, img->d_h);
}
+ ret = decode_metadata(picture, img);
+ if (ret < 0) {
+ av_log(avctx, AV_LOG_ERROR, "Failed to decode metadata\n");
+ return ret;
+ }
*got_frame = 1;
}
return avpkt->size;
diff --git a/libavcodec/libaomenc.c b/libavcodec/libaomenc.c
index 46f8d60e46..5d265a54d1 100644
--- a/libavcodec/libaomenc.c
+++ b/libavcodec/libaomenc.c
@@ -33,6 +33,7 @@
#include "libavutil/base64.h"
#include "libavutil/common.h"
#include "libavutil/cpu.h"
+#include "libavutil/hdr_dynamic_metadata.h"
#include "libavutil/imgutils.h"
#include "libavutil/mathematics.h"
#include "libavutil/mem.h"
@@ -42,10 +43,12 @@
#include "av1.h"
#include "avcodec.h"
#include "bsf.h"
+#include "bytestream.h"
#include "codec_internal.h"
#include "dovi_rpu.h"
#include "encode.h"
#include "internal.h"
+#include "itut35.h"
#include "libaom.h"
#include "packet_internal.h"
#include "profiles.h"
@@ -328,6 +331,53 @@ static av_cold int codecctl_int(AVCodecContext *avctx,
return 0;
}
+static int add_hdr_plus(AVCodecContext *avctx, struct aom_image *img, const
AVFrame *frame)
+{
+ // Check for HDR10+
+ AVFrameSideData *side_data =
+ av_frame_get_side_data(frame, AV_FRAME_DATA_DYNAMIC_HDR_PLUS);
+ if (!side_data)
+ return 0;
+
+ size_t payload_size;
+ AVDynamicHDRPlus *hdr_plus = (AVDynamicHDRPlus *)side_data->buf->data;
+ int res = av_dynamic_hdr_plus_to_t35(hdr_plus, NULL, &payload_size);
+ if (res < 0) {
+ log_encoder_error(avctx, "Error finding the size of HDR10+");
+ return res;
+ }
+
+ uint8_t *hdr_plus_buf;
+ // Extra bytes for the country code, provider code, provider oriented code
and app id.
+ const size_t hdr_plus_buf_size = payload_size + 6;
+ hdr_plus_buf = av_malloc(hdr_plus_buf_size);
+ if (!hdr_plus_buf)
+ return AVERROR(ENOMEM);
+
+ uint8_t *payload = hdr_plus_buf;
+ // See "HDR10+ AV1 Metadata Handling Specification" v1.0.1, Section 2.1.
+ bytestream_put_byte(&payload, ITU_T_T35_COUNTRY_CODE_US);
+ bytestream_put_be16(&payload, ITU_T_T35_PROVIDER_CODE_SAMSUNG);
+ bytestream_put_be16(&payload, 0x0001); // provider_oriented_code
+ bytestream_put_byte(&payload, 0x04); // application_identifier
+
+ res = av_dynamic_hdr_plus_to_t35(hdr_plus, &payload, &payload_size);
+ if (res < 0) {
+ av_free(hdr_plus_buf);
+ log_encoder_error(avctx, "Error encoding HDR10+ from side data");
+ return res;
+ }
+
+ res = aom_img_add_metadata(img, OBU_METADATA_TYPE_ITUT_T35,
+ hdr_plus_buf, hdr_plus_buf_size,
AOM_MIF_ANY_FRAME);
+ av_free(hdr_plus_buf);
+ if (res < 0) {
+ log_encoder_error(avctx, "Error adding HDR10+ to aom_img");
+ return res;
+ }
+ return 0;
+}
+
#if defined(AOM_CTRL_AV1E_GET_NUM_OPERATING_POINTS) && \
defined(AOM_CTRL_AV1E_GET_SEQ_LEVEL_IDX) && \
defined(AOM_CTRL_AV1E_GET_TARGET_SEQ_LEVEL_IDX)
@@ -1234,6 +1284,7 @@ static int aom_encode(AVCodecContext *avctx, AVPacket
*pkt,
if (frame) {
rawimg = &ctx->rawimg;
+ aom_img_remove_metadata(rawimg);
rawimg->planes[AOM_PLANE_Y] = frame->data[0];
rawimg->planes[AOM_PLANE_U] = frame->data[1];
rawimg->planes[AOM_PLANE_V] = frame->data[2];
@@ -1284,6 +1335,10 @@ static int aom_encode(AVCodecContext *avctx, AVPacket
*pkt,
if (frame->pict_type == AV_PICTURE_TYPE_I)
flags |= AOM_EFLAG_FORCE_KF;
+
+ res = add_hdr_plus(avctx, rawimg, frame);
+ if (res < 0)
+ return res;
}
res = aom_codec_encode(&ctx->encoder, rawimg, timestamp, duration, flags);
commit d7173e982ec815dcf70999c8683c465b99ce249c
Author: Patrick Wang <[email protected]>
AuthorDate: Fri Aug 29 02:58:16 2025 +0800
Commit: Michael Niedermayer <[email protected]>
CommitDate: Tue Sep 2 15:56:27 2025 +0200
fftools/ffmpeg: fix gracefully shutdown
d119ae2fd82a494d9430ff4d4fc262961a68c598 removed the loop-breaking condition
received_sigterm.
Thus, signals no longer gracefully shutdown ffmpeg.
Fixes: #10834
Signed-off-by: Patrick Wang <[email protected]>
Signed-off-by: Michael Niedermayer <[email protected]>
diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index de607cac93..cbeefb71d6 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -806,8 +806,6 @@ static int check_keyboard_interaction(int64_t cur_time)
{
int i, key;
static int64_t last_time;
- if (received_nb_signals)
- return AVERROR_EXIT;
/* read_key() returns 0 on EOF */
if (cur_time - last_time >= 100000) {
key = read_key();
@@ -891,6 +889,9 @@ static int transcode(Scheduler *sch)
while (!sch_wait(sch, stats_period, &transcode_ts)) {
int64_t cur_time= av_gettime_relative();
+ if (received_nb_signals)
+ break;
+
/* if 'q' pressed, exits */
if (stdin_interaction)
if (check_keyboard_interaction(cur_time) < 0)
commit 173988aa0c2b8710e47a0b4d3651b1fe6d2166ce
Author: Zsolt Vadasz <[email protected]>
AuthorDate: Fri Aug 29 20:19:53 2025 +0000
Commit: Michael Niedermayer <[email protected]>
CommitDate: Tue Sep 2 15:56:23 2025 +0200
libavfilter/vf_minterpolate: Use local variable in array
Signed-off-by: Zsolt Vadasz <[email protected]>
Signed-off-by: Michael Niedermayer <[email protected]>
diff --git a/libavfilter/vf_minterpolate.c b/libavfilter/vf_minterpolate.c
index 2406259056..ba5c512e03 100644
--- a/libavfilter/vf_minterpolate.c
+++ b/libavfilter/vf_minterpolate.c
@@ -918,9 +918,9 @@ static void set_frame_data(MIContext *mi_ctx, int alpha,
AVFrame *avf_out)
int x_mv, y_mv;
int weight_sum = 0;
int i, val = 0;
- PixelMVS *pixel_mvs = &mi_ctx->pixel_mvs[x + y *
avf_out->width];
- PixelWeights *pixel_weights = &mi_ctx->pixel_weights[x + y *
avf_out->width];
- PixelRefs *pixel_refs = &mi_ctx->pixel_refs[x + y *
avf_out->width];
+ PixelMVS *pixel_mvs = &mi_ctx->pixel_mvs[x + y * width];
+ PixelWeights *pixel_weights = &mi_ctx->pixel_weights[x + y *
width];
+ PixelRefs *pixel_refs = &mi_ctx->pixel_refs[x + y * width];
for (i = 0; i < pixel_refs->nb; i++)
weight_sum += pixel_weights->weights[i];
commit 5d7e4b7496bc5f6327202d4ed53052311abded2f
Author: Zsolt Vadasz <[email protected]>
AuthorDate: Fri Aug 29 20:19:47 2025 +0000
Commit: Michael Niedermayer <[email protected]>
CommitDate: Tue Sep 2 15:56:02 2025 +0200
libavfilter/vf_minterpolate: Hoist hot loop in `set_frame_data`
Signed-off-by: Zsolt Vadasz <[email protected]>
Signed-off-by: Michael Niedermayer <[email protected]>
diff --git a/libavfilter/vf_minterpolate.c b/libavfilter/vf_minterpolate.c
index d034783bc5..2406259056 100644
--- a/libavfilter/vf_minterpolate.c
+++ b/libavfilter/vf_minterpolate.c
@@ -939,17 +939,20 @@ static void set_frame_data(MIContext *mi_ctx, int alpha,
AVFrame *avf_out)
weight_sum = ALPHA_MAX;
}
- for (i = 0; i < pixel_refs->nb; i++) {
- Frame *frame = &mi_ctx->frames[pixel_refs->refs[i]];
- if (chroma) {
+ if (chroma) {
+ for (i = 0; i < pixel_refs->nb; i++) {
+ Frame *frame = &mi_ctx->frames[pixel_refs->refs[i]];
x_mv = (x >> mi_ctx->log2_chroma_w) +
pixel_mvs->mvs[i][0] / (1 << mi_ctx->log2_chroma_w);
y_mv = (y >> mi_ctx->log2_chroma_h) +
pixel_mvs->mvs[i][1] / (1 << mi_ctx->log2_chroma_h);
- } else {
+ val += pixel_weights->weights[i] *
frame->avf->data[plane][x_mv + y_mv * frame->avf->linesize[plane]];
+ }
+ } else {
+ for (i = 0; i < pixel_refs->nb; i++) {
+ Frame *frame = &mi_ctx->frames[pixel_refs->refs[i]];
x_mv = x + pixel_mvs->mvs[i][0];
y_mv = y + pixel_mvs->mvs[i][1];
+ val += pixel_weights->weights[i] *
frame->avf->data[plane][x_mv + y_mv * frame->avf->linesize[plane]];
}
-
- val += pixel_weights->weights[i] *
frame->avf->data[plane][x_mv + y_mv * frame->avf->linesize[plane]];
}
val = ROUNDED_DIV(val, weight_sum);
-----------------------------------------------------------------------
Summary of changes:
Changelog | 2 +
fftools/ffmpeg.c | 5 +-
libavcodec/aac_ac3_parser.c | 10 ++--
libavcodec/libaomdec.c | 63 ++++++++++++++++++++++
libavcodec/libaomenc.c | 55 +++++++++++++++++++
libavfilter/vf_minterpolate.c | 21 ++++----
tests/Makefile | 1 +
tests/fate/av1.mak | 7 +++
...{hevc-hdr10-plus-metadata => libaom-hdr10-plus} | 18 -------
9 files changed, 148 insertions(+), 34 deletions(-)
create mode 100644 tests/fate/av1.mak
copy tests/ref/fate/{hevc-hdr10-plus-metadata => libaom-hdr10-plus} (77%)
hooks/post-receive
--
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]