[FFmpeg-cvslog] lavc/vvc: Fix pps_single_slice_picture

2025-03-02 Thread Frank Plowman
ffmpeg | branch: master | Frank Plowman  | Sun Feb 23 
12:04:48 2025 +| [600ad36949a70c0187aa671469ebd81212528d61] | committer: 
Nuo Mi

lavc/vvc: Fix pps_single_slice_picture

Signed-off-by: Frank Plowman 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=600ad36949a70c0187aa671469ebd81212528d61
---

 libavcodec/vvc/ps.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/vvc/ps.c b/libavcodec/vvc/ps.c
index 9b8af5524b..e8c312d8ac 100644
--- a/libavcodec/vvc/ps.c
+++ b/libavcodec/vvc/ps.c
@@ -417,9 +417,10 @@ static int pps_add_ctus(VVCPPS *pps, int *off, const int 
rx, const int ry,
 
 static void pps_single_slice_picture(VVCPPS *pps, int *off)
 {
+pps->num_ctus_in_slice[0] = 0;
 for (int j = 0; j < pps->r->num_tile_rows; j++) {
 for (int i = 0; i < pps->r->num_tile_columns; i++) {
-pps->num_ctus_in_slice[0] = pps_add_ctus(pps, off,
+pps->num_ctus_in_slice[0] += pps_add_ctus(pps, off,
 pps->col_bd[i], pps->row_bd[j],
 pps->r->col_width_val[i], pps->r->row_height_val[j]);
 }

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-cvslog] Tag n7.1.1 : FFmpeg 7.1.1 release

2025-03-02 Thread git
[ffmpeg] [branch: refs/tags/n7.1.1]
Tag:a1328e68877e12ab5a6e5d92a84aefa566783ea5
> http://git.videolan.org/gitweb.cgi/ffmpeg.git?a=tag;h=a1328e68877e12ab5a6e5d92a84aefa566783ea5

Tagger: Michael Niedermayer 
Date:   Mon Mar  3 01:28:50 2025 +0100

FFmpeg 7.1.1 release
___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-cvslog] configure: update copyright year

2025-03-02 Thread Lynne
ffmpeg | branch: release/7.1 | Lynne  | Wed Jan  1 18:03:33 2025 
+0900| [db69d06eeeab4f46da15030a80d539efb4503ca8] | committer: Michael 
Niedermayer

configure: update copyright year

On 01/01/2025 19:05, Peter Ross wrote:
> FFmpeg turns 25 this year.

(cherry picked from commit d3aa99a4f436e89773246339d9d363587a1d21df)
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=db69d06eeeab4f46da15030a80d539efb4503ca8
---

 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index 9c013505f2..ffa407d53d 100755
--- a/configure
+++ b/configure
@@ -8191,7 +8191,7 @@ cat > $TMPH 

[FFmpeg-cvslog] [ffmpeg-web] branch master updated. ffba7d5 web: Update for 7.1.1

2025-03-02 Thread ffmpeg-git
The branch, master has been updated
   via  ffba7d5d9a58b85615051a807c7d229ad165a01d (commit)
  from  fa782f7959a28ce823205d3cf24c512c1fbcc3b0 (commit)


- Log -
commit ffba7d5d9a58b85615051a807c7d229ad165a01d
Author: Michael Niedermayer 
AuthorDate: Mon Mar 3 01:50:01 2025 +0100
Commit: Michael Niedermayer 
CommitDate: Mon Mar 3 01:50:01 2025 +0100

web: Update for 7.1.1

diff --git a/src/download b/src/download
index de7a7ac..14cfefe 100644
--- a/src/download
+++ b/src/download
@@ -1,10 +1,10 @@
 
 
   
-https://ffmpeg.org/releases/ffmpeg-7.1.tar.xz"; class="btn 
btn-success">
+https://ffmpeg.org/releases/ffmpeg-7.1.1.tar.xz"; class="btn 
btn-success">
   
   Download Source Code
-  ffmpeg-7.1.tar.xz
+  ffmpeg-7.1.1.tar.xz
 
 
 More releases
@@ -308,10 +308,10 @@ gpg: Good signature from "FFmpeg release signing key 
Changelog
+  https://git.ffmpeg.org/gitweb/ffmpeg.git/shortlog/n7.1.1";>Changelog
   https://git.ffmpeg.org/gitweb/ffmpeg.git/blob/refs/heads/release/7.1:/RELEASE_NOTES";>Release
 Notes
  

diff --git a/src/security b/src/security
index fef6a0b..a8f0ee3 100644
--- a/src/security
+++ b/src/security
@@ -8,6 +8,26 @@ Fixes following vulnerabilities:
 CVE-2025-1373, 43be8d07281caca2e88bfd8ee2333633e1fb1a13, ticket/11460 never 
affected a release
 
 
+
+FFmpeg 7.1
+
+7.1.1
+
+Fixes following vulnerabilities:
+
+
+CVE-2025-0518, b827ac49b770635fc666f8543cb9585e1bc6308b / 
b5b6391d64807578ab872dc58fb8aa621dcfc38a
+
+
+7.1
+
+Fixes following vulnerabilities:
+
+
+CVE-2024-7055 3faadbe2a27e74ff5bb5f7904ec27bb1f5287dc8
+
+
+
 FFmpeg 7.0
 
 7.0.2

---

Summary of changes:
 src/download | 22 +++---
 src/security | 20 
 2 files changed, 31 insertions(+), 11 deletions(-)


hooks/post-receive
-- 

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-cvslog] avformat/hls: Partially revert "reduce default max reload to 3"

2025-03-02 Thread softworkz
ffmpeg | branch: release/7.1 | softworkz  | Thu Feb 27 
16:36:56 2025 +| [a8a3fc84afa21de2d704101244f5ad5d88be3421] | committer: 
Michael Niedermayer

avformat/hls: Partially revert "reduce default max reload to 3"

(setting to 100 as a reasonable compromise)

The change has caused regressions for many users and consumers.
Playlist reloads only happen when a playlist doesn't indicate that it
has ended (via #EXT-X-ENDLIST), which means that the addition of future
segments is still expected.
It is well possible that an HLS server is temporarily unable to serve
further segments but resumes after some time, either indicating a
discontinuity or even by fully catching up.
With a segment length of 3s, a max_reload value of 1000 corresponds to
a duration of 50 minutes which appears to be a reasonable default.

Signed-off-by: Michael Niedermayer 
(cherry picked from commit ace9f03a6c0a58b84a02701df1b6e5d5ac1d1b8e)
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a8a3fc84afa21de2d704101244f5ad5d88be3421
---

 libavformat/hls.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/hls.c b/libavformat/hls.c
index fbc88c8f88..b96c5ab9d2 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -2633,7 +2633,7 @@ static const AVOption hls_options[] = {
 {"extension_picky", "Be picky with all extensions matching",
 OFFSET(extension_picky), AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, FLAGS},
 {"max_reload", "Maximum number of times a insufficient list is attempted 
to be reloaded",
-OFFSET(max_reload), AV_OPT_TYPE_INT, {.i64 = 3}, 0, INT_MAX, FLAGS},
+OFFSET(max_reload), AV_OPT_TYPE_INT, {.i64 = 100}, 0, INT_MAX, FLAGS},
 {"m3u8_hold_counters", "The maximum number of times to load m3u8 when it 
refreshes without new segments",
 OFFSET(m3u8_hold_counters), AV_OPT_TYPE_INT, {.i64 = 1000}, 0, 
INT_MAX, FLAGS},
 {"http_persistent", "Use persistent HTTP connections",

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-cvslog] Prepare for 7.1.1

2025-03-02 Thread Michael Niedermayer
ffmpeg | branch: release/7.1 | Michael Niedermayer  | 
Sun Mar  2 16:29:39 2025 +0100| [68af2cc3feb8c78aec2722c728fd87f03515fa7c] | 
committer: Michael Niedermayer

Prepare for 7.1.1

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=68af2cc3feb8c78aec2722c728fd87f03515fa7c
---

 Changelog| 2 ++
 RELEASE  | 2 +-
 doc/Doxyfile | 2 +-
 3 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/Changelog b/Changelog
index 4247ece409..4b35e446cd 100644
--- a/Changelog
+++ b/Changelog
@@ -2,6 +2,8 @@ Entries are sorted chronologically from oldest to youngest 
within each release,
 releases are sorted from youngest to oldest.
 
 version 7.1.1:
+ avformat/hls: Partially revert "reduce default max reload to 3"
+ avformat/mov: (v4) fix get_eia608_packet
  avformat/iff: Check that we have a stream in read_dst_frame()
  avcodec/aac/aacdec_lpd: Limit get_unary()
  avcodec/aac/aacdec_usac: Simplify decode_usac_scale_factors()
diff --git a/RELEASE b/RELEASE
index 0f0fefae5a..21c8c7b46b 100644
--- a/RELEASE
+++ b/RELEASE
@@ -1 +1 @@
-7.1
+7.1.1
diff --git a/doc/Doxyfile b/doc/Doxyfile
index c6dc306197..16f3a78735 100644
--- a/doc/Doxyfile
+++ b/doc/Doxyfile
@@ -38,7 +38,7 @@ PROJECT_NAME   = FFmpeg
 # could be handy for archiving the generated documentation or if some version
 # control system is used.
 
-PROJECT_NUMBER = 7.1
+PROJECT_NUMBER = 7.1.1
 
 # Using the PROJECT_BRIEF tag one can provide an optional one line description
 # for a project that appears at the top of each page and should give viewer a

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-cvslog] avutil/timecode: add ff_timecode_set_smpte

2025-03-02 Thread Timo Rothenpieler
ffmpeg | branch: master | Timo Rothenpieler  | Sun Feb 
23 00:53:09 2025 +0100| [9d5d51bd129cfb7cdb085aa4b474711d4a35] | committer: 
Timo Rothenpieler

avutil/timecode: add ff_timecode_set_smpte

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9d5d51bd129cfb7cdb085aa4b474711d4a35
---

 libavutil/Makefile|  1 +
 libavutil/timecode.c  | 27 +++
 libavutil/timecode_internal.c | 51 +++
 libavutil/timecode_internal.h | 51 +++
 4 files changed, 106 insertions(+), 24 deletions(-)

diff --git a/libavutil/Makefile b/libavutil/Makefile
index b2b3b9c156..aea10ba635 100644
--- a/libavutil/Makefile
+++ b/libavutil/Makefile
@@ -180,6 +180,7 @@ OBJS = adler32.o
\
threadmessage.o  \
time.o   \
timecode.o   \
+   timecode_internal.o  \
timestamp.o  \
tree.o   \
twofish.o\
diff --git a/libavutil/timecode.c b/libavutil/timecode.c
index f454466f97..bca16b6ac2 100644
--- a/libavutil/timecode.c
+++ b/libavutil/timecode.c
@@ -29,6 +29,7 @@
 #include 
 #include "common.h"
 #include "timecode.h"
+#include "timecode_internal.h"
 #include "log.h"
 #include "error.h"
 
@@ -127,32 +128,10 @@ char *av_timecode_make_string(const AVTimecode *tc, char 
*buf, int framenum_arg)
 return buf;
 }
 
-static unsigned bcd2uint(uint8_t bcd)
-{
-   unsigned low  = bcd & 0xf;
-   unsigned high = bcd >> 4;
-   if (low > 9 || high > 9)
-   return 0;
-   return low + 10*high;
-}
-
 char *av_timecode_make_smpte_tc_string2(char *buf, AVRational rate, uint32_t 
tcsmpte, int prevent_df, int skip_field)
 {
-unsigned hh   = bcd2uint(tcsmpte & 0x3f);// 6-bit hours
-unsigned mm   = bcd2uint(tcsmpte>>8  & 0x7f);// 7-bit minutes
-unsigned ss   = bcd2uint(tcsmpte>>16 & 0x7f);// 7-bit seconds
-unsigned ff   = bcd2uint(tcsmpte>>24 & 0x3f);// 6-bit frames
-unsigned drop = tcsmpte & 1<<30 && !prevent_df;  // 1-bit drop if not 
arbitrary bit
-
-if (av_cmp_q(rate, (AVRational) {30, 1}) == 1) {
-ff <<= 1;
-if (!skip_field) {
-if (av_cmp_q(rate, (AVRational) {50, 1}) == 0)
-ff += !!(tcsmpte & 1 << 7);
-else
-ff += !!(tcsmpte & 1 << 23);
-}
-}
+unsigned hh, mm, ss, ff, drop;
+ff_timecode_set_smpte(&drop, &hh, &mm, &ss, &ff, rate, tcsmpte, 
prevent_df, skip_field);
 
 snprintf(buf, AV_TIMECODE_STR_SIZE, "%02u:%02u:%02u%c%02u",
  hh, mm, ss, drop ? ';' : ':', ff);
diff --git a/libavutil/timecode_internal.c b/libavutil/timecode_internal.c
new file mode 100644
index 00..259ebf1664
--- /dev/null
+++ b/libavutil/timecode_internal.c
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2006 Smartjog S.A.S, Baptiste Coudurier 

+ * Copyright (c) 2011-2012 Smartjog S.A.S, Clément Bœsch 

+ *
+ * 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 "timecode_internal.h"
+
+static unsigned bcd2uint(uint8_t bcd)
+{
+   unsigned low  = bcd & 0xf;
+   unsigned high = bcd >> 4;
+   if (low > 9 || high > 9)
+   return 0;
+   return low + 10*high;
+}
+
+void ff_timecode_set_smpte(unsigned *drop, unsigned *hh, unsigned *mm, 
unsigned *ss, unsigned *ff,
+   AVRational rate, uint32_t tcsmpte, int prevent_df, 
int skip_field)
+{
+*hh   = bcd2uint(tcsmpte & 0x3f);// 6-bit hours
+*mm   = bcd2uint(tcsmpte>>8  & 0x7f);// 7-bit minutes
+*ss   = bcd2uint(tcsmpte>>16 & 0x7f);// 7-bit seconds
+*ff   = bcd2uint(tcsmpte>>24 & 0x3f);// 6-bit frames
+*drop = tcsmpte & 1<<30 && !prevent_df;  // 1-bit drop if not arbitrary bit
+
+if (av_cmp_q(rate, (AVRational) {30, 1}) == 1) {
+*ff <<= 1;
+if (!skip_field) {
+if (av_cmp_q(rate, (AVRational) 

[FFmpeg-cvslog] avcodec/utils: use new ff_timecode_set_smpte function

2025-03-02 Thread Timo Rothenpieler
ffmpeg | branch: master | Timo Rothenpieler  | Sun Feb 
23 00:54:23 2025 +0100| [31ca6c1bfe5d08f7b726394318cf74c378b93912] | committer: 
Timo Rothenpieler

avcodec/utils: use new ff_timecode_set_smpte function

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=31ca6c1bfe5d08f7b726394318cf74c378b93912
---

 libavcodec/Makefile|  2 ++
 libavcodec/timecode_internal.c | 19 +++
 libavcodec/utils.c | 29 +++--
 3 files changed, 24 insertions(+), 26 deletions(-)

diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 499f826635..e3ccbf1838 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -64,6 +64,8 @@ OBJS = ac3_parser.o   
  \
vorbis_parser.o  \
xiph.o   \
 
+SHLIBOBJS = timecode_internal.o \
+
 # subsystems
 include $(SRC_PATH)/libavcodec/aac/Makefile
 include $(SRC_PATH)/libavcodec/hevc/Makefile
diff --git a/libavcodec/timecode_internal.c b/libavcodec/timecode_internal.c
new file mode 100644
index 00..8682bb1b2e
--- /dev/null
+++ b/libavcodec/timecode_internal.c
@@ -0,0 +1,19 @@
+/*
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "libavutil/timecode_internal.c"
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index dd846b4ae9..0aa5a6f55e 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -33,6 +33,7 @@
 #include "libavutil/pixdesc.h"
 #include "libavutil/imgutils.h"
 #include "libavutil/pixfmt.h"
+#include "libavutil/timecode_internal.h"
 #include "avcodec.h"
 #include "codec.h"
 #include "codec_desc.h"
@@ -968,15 +969,6 @@ AVCPBProperties *av_cpb_properties_alloc(size_t *size)
 return props;
 }
 
-static unsigned bcd2uint(uint8_t bcd)
-{
-unsigned low  = bcd & 0xf;
-unsigned high = bcd >> 4;
-if (low > 9 || high > 9)
-return 0;
-return low + 10*high;
-}
-
 int ff_alloc_timecode_sei(const AVFrame *frame, AVRational rate, size_t 
prefix_len,
  void **data, size_t *sei_size)
 {
@@ -1006,23 +998,8 @@ int ff_alloc_timecode_sei(const AVFrame *frame, 
AVRational rate, size_t prefix_l
 put_bits(&pb, 2, m); // num_clock_ts
 
 for (int j = 1; j <= m; j++) {
-uint32_t tcsmpte = tc[j];
-unsigned hh   = bcd2uint(tcsmpte & 0x3f);// 6-bit hours
-unsigned mm   = bcd2uint(tcsmpte>>8  & 0x7f);// 7-bit minutes
-unsigned ss   = bcd2uint(tcsmpte>>16 & 0x7f);// 7-bit seconds
-unsigned ff   = bcd2uint(tcsmpte>>24 & 0x3f);// 6-bit frames
-unsigned drop = tcsmpte & 1<<30 && !0;  // 1-bit drop if not arbitrary 
bit
-
-/* Calculate frame number of HEVC by SMPTE ST 12-1:2014 Sec 12.2 if 
rate > 30FPS */
-if (av_cmp_q(rate, (AVRational) {30, 1}) == 1) {
-unsigned pc;
-ff *= 2;
-if (av_cmp_q(rate, (AVRational) {50, 1}) == 0)
-pc = !!(tcsmpte & 1 << 7);
-else
-pc = !!(tcsmpte & 1 << 23);
-ff = (ff + pc) & 0x7f;
-}
+unsigned hh, mm, ss, ff, drop;
+ff_timecode_set_smpte(&drop, &hh, &mm, &ss, &ff, rate, tc[j], 0, 0);
 
 put_bits(&pb, 1, 1); // clock_timestamp_flag
 put_bits(&pb, 1, 1); // units_field_based_flag

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-cvslog] avcodec/nvenc: factor out mastering display data into its own function

2025-03-02 Thread Timo Rothenpieler
ffmpeg | branch: master | Timo Rothenpieler  | Sun Feb 
23 01:36:59 2025 +0100| [5c5be37daff4f4ecbe0c20d6a9f0fdad6eadc9c8] | committer: 
Timo Rothenpieler

avcodec/nvenc: factor out mastering display data into its own function

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5c5be37daff4f4ecbe0c20d6a9f0fdad6eadc9c8
---

 libavcodec/nvenc.c | 137 +
 1 file changed, 76 insertions(+), 61 deletions(-)

diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c
index 7ae1e7c8d7..97d05ed63a 100644
--- a/libavcodec/nvenc.c
+++ b/libavcodec/nvenc.c
@@ -2960,6 +2960,78 @@ static void reconfig_encoder(AVCodecContext *avctx, 
const AVFrame *frame)
 }
 }
 
+#ifdef NVENC_HAVE_HEVC_AND_AV1_MASTERING_METADATA
+static int nvenc_set_mastering_display_data(AVCodecContext *avctx, const 
AVFrame *frame, NV_ENC_PIC_PARAMS *pic_params,
+MASTERING_DISPLAY_INFO 
*mastering_disp_info, CONTENT_LIGHT_LEVEL *content_light_level)
+{
+NvencContext *ctx = avctx->priv_data;
+
+if (ctx->mdm || ctx->cll) {
+const AVFrameSideData *sd_mdm = av_frame_get_side_data(frame, 
AV_FRAME_DATA_MASTERING_DISPLAY_METADATA);
+const AVFrameSideData *sd_cll = av_frame_get_side_data(frame, 
AV_FRAME_DATA_CONTENT_LIGHT_LEVEL);
+const int chroma_den   = (avctx->codec->id == AV_CODEC_ID_AV1) ? 1 << 
16 : 5;
+const int max_luma_den = (avctx->codec->id == AV_CODEC_ID_AV1) ? 1 << 
8  : 1;
+const int min_luma_den = (avctx->codec->id == AV_CODEC_ID_AV1) ? 1 << 
14 : 1;
+
+if (!sd_mdm)
+sd_mdm = av_frame_side_data_get(avctx->decoded_side_data,
+avctx->nb_decoded_side_data,
+
AV_FRAME_DATA_MASTERING_DISPLAY_METADATA);
+if (!sd_cll)
+sd_cll = av_frame_side_data_get(avctx->decoded_side_data,
+avctx->nb_decoded_side_data,
+AV_FRAME_DATA_CONTENT_LIGHT_LEVEL);
+
+if (sd_mdm) {
+const AVMasteringDisplayMetadata *mdm = 
(AVMasteringDisplayMetadata *)sd_mdm->data;
+
+mastering_disp_info->r.x = 
av_rescale(mdm->display_primaries[0][0].num, chroma_den,
+  
mdm->display_primaries[0][0].den);
+mastering_disp_info->r.y = 
av_rescale(mdm->display_primaries[0][1].num, chroma_den,
+  
mdm->display_primaries[0][1].den);
+mastering_disp_info->g.x = 
av_rescale(mdm->display_primaries[1][0].num, chroma_den,
+  
mdm->display_primaries[1][0].den);
+mastering_disp_info->g.y = 
av_rescale(mdm->display_primaries[1][1].num, chroma_den,
+  
mdm->display_primaries[1][1].den);
+mastering_disp_info->b.x = 
av_rescale(mdm->display_primaries[2][0].num, chroma_den,
+  
mdm->display_primaries[2][0].den);
+mastering_disp_info->b.y = 
av_rescale(mdm->display_primaries[2][1].num, chroma_den,
+  
mdm->display_primaries[2][1].den);
+mastering_disp_info->whitePoint.x = 
av_rescale(mdm->white_point[0].num, chroma_den,
+   
mdm->white_point[0].den);
+mastering_disp_info->whitePoint.y = 
av_rescale(mdm->white_point[1].num, chroma_den,
+   
mdm->white_point[1].den);
+mastering_disp_info->maxLuma   = 
av_rescale(mdm->max_luminance.num, max_luma_den,
+
mdm->max_luminance.den);
+mastering_disp_info->minLuma   = 
av_rescale(mdm->min_luminance.num, min_luma_den,
+
mdm->min_luminance.den);
+
+if (avctx->codec->id == AV_CODEC_ID_HEVC)
+pic_params->codecPicParams.hevcPicParams.pMasteringDisplay = 
mastering_disp_info;
+else if (avctx->codec->id == AV_CODEC_ID_AV1)
+pic_params->codecPicParams.av1PicParams.pMasteringDisplay  = 
mastering_disp_info;
+else
+return AVERROR_BUG;
+}
+if (sd_cll) {
+const AVContentLightMetadata *cll = (AVContentLightMetadata 
*)sd_cll->data;
+
+content_light_level->maxContentLightLevel= cll->MaxCLL;
+content_light_level->maxPicAverageLightLevel = cll->MaxFALL;
+
+if (avctx->codec->id == AV_CODEC_ID_HEVC)
+pic_params->codecPicParams.hevcPicParams.pMaxCll = 
content_light_level;
+else if (avctx->codec->id == AV_CODEC_ID_AV1)
+pic_params->codecPicParams.av1PicParams.pMaxCl

[FFmpeg-cvslog] avcodec/nvenc: add time code writing for h264

2025-03-02 Thread Timo Rothenpieler
ffmpeg | branch: master | Timo Rothenpieler  | Sun Feb 
23 01:11:13 2025 +0100| [e567dca12f27482dc1bd43bcf06d2fd054263f1d] | committer: 
Timo Rothenpieler

avcodec/nvenc: add time code writing for h264

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e567dca12f27482dc1bd43bcf06d2fd054263f1d
---

 libavcodec/nvenc.c  | 62 ++---
 libavcodec/nvenc.h  |  1 +
 libavcodec/nvenc_h264.c |  3 +++
 3 files changed, 63 insertions(+), 3 deletions(-)

diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c
index f9221174f0..7ae1e7c8d7 100644
--- a/libavcodec/nvenc.c
+++ b/libavcodec/nvenc.c
@@ -34,6 +34,7 @@
 #include "libavutil/imgutils.h"
 #include "libavutil/mem.h"
 #include "libavutil/pixdesc.h"
+#include "libavutil/timecode_internal.h"
 #include "libavutil/mathematics.h"
 #include "libavutil/mastering_display_metadata.h"
 #include "atsc_a53.h"
@@ -1417,6 +1418,11 @@ static av_cold int 
nvenc_setup_h264_config(AVCodecContext *avctx)
 }
 #endif
 
+#ifdef NVENC_HAVE_TIME_CODE
+if (ctx->s12m_tc)
+h264->enableTimeCode = 1;
+#endif
+
 return 0;
 }
 
@@ -2420,7 +2426,52 @@ static int nvenc_upload_frame(AVCodecContext *avctx, 
const AVFrame *frame,
 }
 }
 
-static void nvenc_codec_specific_pic_params(AVCodecContext *avctx,
+#ifdef NVENC_HAVE_TIME_CODE
+static void nvenc_fill_time_code(AVCodecContext *avctx, const AVFrame *frame, 
NV_ENC_TIME_CODE *time_code)
+{
+AVFrameSideData *sd = av_frame_get_side_data(frame, 
AV_FRAME_DATA_S12M_TIMECODE);
+
+if (sd) {
+uint32_t *tc = (uint32_t*)sd->data;
+int cnt = FFMIN(tc[0], FF_ARRAY_ELEMS(time_code->clockTimestamp));
+
+switch (cnt) {
+case 0:
+time_code->displayPicStruct = NV_ENC_PIC_STRUCT_DISPLAY_FRAME;
+time_code->skipClockTimestampInsertion = 1;
+break;
+case 2:
+time_code->displayPicStruct = 
NV_ENC_PIC_STRUCT_DISPLAY_FRAME_DOUBLING;
+break;
+case 3:
+time_code->displayPicStruct = 
NV_ENC_PIC_STRUCT_DISPLAY_FRAME_TRIPLING;
+break;
+default:
+time_code->displayPicStruct = NV_ENC_PIC_STRUCT_DISPLAY_FRAME;
+break;
+}
+
+for (int i = 0; i < cnt; i++) {
+unsigned hh, mm, ss, ff, drop;
+ff_timecode_set_smpte(&drop, &hh, &mm, &ss, &ff, avctx->framerate, 
tc[i + 1], 0, 0);
+
+time_code->clockTimestamp[i].countingType = 0;
+time_code->clockTimestamp[i].discontinuityFlag = 0;
+time_code->clockTimestamp[i].cntDroppedFrames = drop;
+time_code->clockTimestamp[i].nFrames = ff;
+time_code->clockTimestamp[i].secondsValue = ss;
+time_code->clockTimestamp[i].minutesValue = mm;
+time_code->clockTimestamp[i].hoursValue = hh;
+time_code->clockTimestamp[i].timeOffset = 0;
+}
+} else {
+time_code->displayPicStruct = NV_ENC_PIC_STRUCT_DISPLAY_FRAME;
+time_code->skipClockTimestampInsertion = 1;
+}
+}
+#endif
+
+static void nvenc_codec_specific_pic_params(AVCodecContext *avctx, const 
AVFrame *frame,
 NV_ENC_PIC_PARAMS *params,
 NV_ENC_SEI_PAYLOAD *sei_data,
 int sei_count)
@@ -2438,6 +2489,11 @@ static void 
nvenc_codec_specific_pic_params(AVCodecContext *avctx,
 params->codecPicParams.h264PicParams.seiPayloadArrayCnt = 
sei_count;
 }
 
+#ifdef NVENC_HAVE_TIME_CODE
+if (ctx->s12m_tc)
+nvenc_fill_time_code(avctx, frame, 
¶ms->codecPicParams.h264PicParams.timeCode);
+#endif
+
   break;
 case AV_CODEC_ID_HEVC:
 params->codecPicParams.hevcPicParams.sliceMode =
@@ -2739,7 +2795,7 @@ static int prepare_sei_data_array(AVCodecContext *avctx, 
const AVFrame *frame)
 }
 }
 
-if (ctx->s12m_tc && av_frame_get_side_data(frame, 
AV_FRAME_DATA_S12M_TIMECODE)) {
+if (ctx->s12m_tc && avctx->codec->id != AV_CODEC_ID_H264 && 
av_frame_get_side_data(frame, AV_FRAME_DATA_S12M_TIMECODE)) {
 void *tc_data = NULL;
 size_t tc_size = 0;
 
@@ -3046,7 +3102,7 @@ static int nvenc_send_frame(AVCodecContext *avctx, const 
AVFrame *frame)
 if (res < 0)
 return res;
 
-nvenc_codec_specific_pic_params(avctx, &pic_params, ctx->sei_data, 
sei_count);
+nvenc_codec_specific_pic_params(avctx, frame, &pic_params, 
ctx->sei_data, sei_count);
 } else {
 pic_params.encodePicFlags = NV_ENC_PIC_FLAG_EOS;
 }
diff --git a/libavcodec/nvenc.h b/libavcodec/nvenc.h
index dbd18cac12..e035e123c6 100644
--- a/libavcodec/nvenc.h
+++ b/libavcodec/nvenc.h
@@ -96,6 +96,7 @@ typedef void ID3D11Device;
 #define NVENC_HAVE_LOOKAHEAD_LEVEL
 #define NVENC_HAVE_UHQ_TUNING
 #define NVENC_HAVE_UNIDIR_B
+#define NVENC_HAVE_TI

[FFmpeg-cvslog] lavc/vvcdec: fix undefined reference to ff_h2645_pixel_aspect

2025-03-02 Thread Nuo Mi
ffmpeg | branch: master | Nuo Mi  | Sun Feb 23 21:37:19 
2025 +0800| [dede00f003c51a8cbe8407df4a7063a07644a6a2] | committer: Nuo Mi

lavc/vvcdec: fix undefined reference to ff_h2645_pixel_aspect

This issue was introduced by commit bb8e95b650de30d6e07196761d1fc61857f5462d

Reproduce steps:
./configure --enable-ffmpeg --disable-everything --enable-decoder=vvc 
--enable-parser=vvc --enable-demuxer=vvc --enable-protocol=file,pipe 
--enable-encoder=rawvideo,wrapped_avframe --enable-muxer=rawvideo,md5,null && 
make -j

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=dede00f003c51a8cbe8407df4a7063a07644a6a2
---

 libavcodec/vvc/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavcodec/vvc/Makefile b/libavcodec/vvc/Makefile
index 6a28d32bc2..d1d78933d1 100644
--- a/libavcodec/vvc/Makefile
+++ b/libavcodec/vvc/Makefile
@@ -15,3 +15,4 @@ OBJS-$(CONFIG_VVC_DECODER)  +=  vvc/dec.o   \
 vvc/ps.o\
 vvc/refs.o  \
 vvc/thread.o\
+h2645data.o \

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".