[FFmpeg-cvslog] lavc/vvc: Stricter bound on pps_exp_slice_height_in_ctus_minus1

2025-03-09 Thread Frank Plowman
ffmpeg | branch: master | Frank Plowman  | Sun Mar  2 
12:12:38 2025 +| [20a6eb1ca3439581adf6367bfcc4d72eb2987cd9] | committer: 
Nuo Mi

lavc/vvc: Stricter bound on pps_exp_slice_height_in_ctus_minus1

When pps_num_exp_slices_in_tile[i] is nonzero, the ith tile is made up
of pps_num_exp_slices_in_tile[i] slices stacked atop one another, where
the height of the jth slice in the ith tile is given by
pps_exp_slice_height_in_ctus_minus1[i][j].  The sum of the heights of
the slices in the tile should not exceed the height of the tile itself.

Signed-off-by: Frank Plowman 

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

 libavcodec/cbs_h266_syntax_template.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/cbs_h266_syntax_template.c 
b/libavcodec/cbs_h266_syntax_template.c
index 58211026bb..2e440e70f9 100644
--- a/libavcodec/cbs_h266_syntax_template.c
+++ b/libavcodec/cbs_h266_syntax_template.c
@@ -2020,7 +2020,7 @@ static int FUNC(pps) (CodedBitstreamContext *ctx, 
RWContext *rw,
 for (j = 0; j < current->pps_num_exp_slices_in_tile[i];
  j++) {
 ues(pps_exp_slice_height_in_ctus_minus1[i][j], 0,
-current->row_height_val[tile_y] - 1, 2,
+remaining_height_in_ctbs_y - 1, 2,
 i, j);
 slice_height_in_ctus =
 current->

___
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/wmaenc: Don't unnecessarily reset AVPacket.size

2025-03-09 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Sat May 25 02:41:32 2024 +0200| [87e5da90674b17d50e4cce9bae5037dbf1e7f1ff] | 
committer: Andreas Rheinhardt

avcodec/wmaenc: Don't unnecessarily reset AVPacket.size

The packet is unreferenced generically lateron anyway.

Signed-off-by: Andreas Rheinhardt 

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

 libavcodec/wmaenc.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/libavcodec/wmaenc.c b/libavcodec/wmaenc.c
index 09435c1585..889306aebd 100644
--- a/libavcodec/wmaenc.c
+++ b/libavcodec/wmaenc.c
@@ -415,7 +415,6 @@ static int encode_superframe(AVCodecContext *avctx, 
AVPacket *avpkt,
 error = encode_frame(s, s->coefs, avpkt->data, avpkt->size, 
total_gain++);
 if (error > 0) {
 av_log(avctx, AV_LOG_ERROR, "Invalid input data or requested bitrate 
too low, cannot encode\n");
-avpkt->size = 0;
 return AVERROR(EINVAL);
 }
 av_assert0((put_bits_count(&s->pb) & 7) == 0);

___
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/wma: Mark ff_wma_end() as av_cold

2025-03-09 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Sat May 25 00:48:51 2024 +0200| [196ee9fc862de9a0822d7892daab67054cc4f53f] | 
committer: Andreas Rheinhardt

avcodec/wma: Mark ff_wma_end() as av_cold

Signed-off-by: Andreas Rheinhardt 

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

 libavcodec/wma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/wma.c b/libavcodec/wma.c
index da9c914b57..257184c0d8 100644
--- a/libavcodec/wma.c
+++ b/libavcodec/wma.c
@@ -364,7 +364,7 @@ int ff_wma_total_gain_to_bits(int total_gain)
 return  9;
 }
 
-int ff_wma_end(AVCodecContext *avctx)
+av_cold int ff_wma_end(AVCodecContext *avctx)
 {
 WMACodecContext *s = avctx->priv_data;
 int i;

___
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/vp8: Move codec-specific init code out of common init

2025-03-09 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Thu Mar  6 18:00:28 2025 +0100| [4040dc0782f2bc9307a3a93d93c4af37db512b19] | 
committer: Andreas Rheinhardt

avcodec/vp8: Move codec-specific init code out of common init

While just at it, also move the init functions inside
the #if CONFIG_VP?_DECODER (to avoid linking failures).
While just at it, also declare these init functions
as av_cold and uninline the remaining common init function.

Reviewed-by: Peter Ross 
Signed-off-by: Andreas Rheinhardt 

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

 libavcodec/vp8.c | 48 
 1 file changed, 24 insertions(+), 24 deletions(-)

diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
index 6337fa173b..be8dbde91e 100644
--- a/libavcodec/vp8.c
+++ b/libavcodec/vp8.c
@@ -2858,8 +2858,7 @@ av_cold int ff_vp8_decode_free(AVCodecContext *avctx)
 return 0;
 }
 
-static av_always_inline
-int vp78_decode_init(AVCodecContext *avctx, int is_vp7)
+static av_cold void vp78_decode_init(AVCodecContext *avctx)
 {
 VP8Context *s = avctx->priv_data;
 
@@ -2870,37 +2869,25 @@ int vp78_decode_init(AVCodecContext *avctx, int is_vp7)
 ff_videodsp_init(&s->vdsp, 8);
 
 ff_vp78dsp_init(&s->vp8dsp);
-if (CONFIG_VP7_DECODER && is_vp7) {
-ff_h264_pred_init(&s->hpc, AV_CODEC_ID_VP7, 8, 1);
-ff_vp7dsp_init(&s->vp8dsp);
-s->decode_mb_row_no_filter = vp7_decode_mb_row_no_filter;
-s->filter_mb_row   = vp7_filter_mb_row;
-} else if (CONFIG_VP8_DECODER && !is_vp7) {
-ff_h264_pred_init(&s->hpc, AV_CODEC_ID_VP8, 8, 1);
-ff_vp8dsp_init(&s->vp8dsp);
-s->decode_mb_row_no_filter = vp8_decode_mb_row_no_filter;
-s->filter_mb_row   = vp8_filter_mb_row;
-}
 
 /* does not change for VP8 */
 memcpy(s->prob[0].scan, ff_zigzag_scan, sizeof(s->prob[0].scan));
-
-return 0;
 }
 
-#if CONFIG_VP7_DECODER
-static int vp7_decode_init(AVCodecContext *avctx)
-{
-return vp78_decode_init(avctx, IS_VP7);
-}
-#endif /* CONFIG_VP7_DECODER */
-
+#if CONFIG_VP8_DECODER
 av_cold int ff_vp8_decode_init(AVCodecContext *avctx)
 {
-return vp78_decode_init(avctx, IS_VP8);
+VP8Context *s = avctx->priv_data;
+
+vp78_decode_init(avctx);
+ff_h264_pred_init(&s->hpc, AV_CODEC_ID_VP8, 8, 1);
+ff_vp8dsp_init(&s->vp8dsp);
+s->decode_mb_row_no_filter = vp8_decode_mb_row_no_filter;
+s->filter_mb_row   = vp8_filter_mb_row;
+
+return 0;
 }
 
-#if CONFIG_VP8_DECODER
 #if HAVE_THREADS
 static void vp8_replace_frame(VP8Frame *dst, const VP8Frame *src)
 {
@@ -2944,6 +2931,19 @@ static int 
vp8_decode_update_thread_context(AVCodecContext *dst,
 #endif /* CONFIG_VP8_DECODER */
 
 #if CONFIG_VP7_DECODER
+av_cold static int vp7_decode_init(AVCodecContext *avctx)
+{
+VP8Context *s = avctx->priv_data;
+
+vp78_decode_init(avctx);
+ff_h264_pred_init(&s->hpc, AV_CODEC_ID_VP7, 8, 1);
+ff_vp7dsp_init(&s->vp8dsp);
+s->decode_mb_row_no_filter = vp7_decode_mb_row_no_filter;
+s->filter_mb_row   = vp7_filter_mb_row;
+
+return 0;
+}
+
 const FFCodec ff_vp7_decoder = {
 .p.name= "vp7",
 CODEC_LONG_NAME("On2 VP7"),

___
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/vp8: Move VPx specific functions inside #if CONFIG_VPx block

2025-03-09 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Thu Mar  6 18:16:50 2025 +0100| [a41baa743d1c79bc0b76dc7312e4a155f4537f40] | 
committer: Andreas Rheinhardt

avcodec/vp8: Move VPx specific functions inside #if CONFIG_VPx block

where appropriate. Avoids including ff_vp8_decode_frame()
when the VP8 decoder is disabled.

Reviewed-by: Peter Ross 
Signed-off-by: Andreas Rheinhardt 

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

 libavcodec/vp8.c | 74 +++-
 1 file changed, 36 insertions(+), 38 deletions(-)

diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
index be8dbde91e..77f7b4d4df 100644
--- a/libavcodec/vp8.c
+++ b/libavcodec/vp8.c
@@ -2512,18 +2512,6 @@ static av_always_inline int 
decode_mb_row_no_filter(AVCodecContext *avctx, void
 return 0;
 }
 
-static int vp7_decode_mb_row_no_filter(AVCodecContext *avctx, void *tdata,
-int jobnr, int threadnr)
-{
-return decode_mb_row_no_filter(avctx, tdata, jobnr, threadnr, 1);
-}
-
-static int vp8_decode_mb_row_no_filter(AVCodecContext *avctx, void *tdata,
-int jobnr, int threadnr)
-{
-return decode_mb_row_no_filter(avctx, tdata, jobnr, threadnr, 0);
-}
-
 static av_always_inline void filter_mb_row(AVCodecContext *avctx, void *tdata,
   int jobnr, int threadnr, int is_vp7)
 {
@@ -2583,18 +2571,6 @@ static av_always_inline void 
filter_mb_row(AVCodecContext *avctx, void *tdata,
 }
 }
 
-static void vp7_filter_mb_row(AVCodecContext *avctx, void *tdata,
-  int jobnr, int threadnr)
-{
-filter_mb_row(avctx, tdata, jobnr, threadnr, 1);
-}
-
-static void vp8_filter_mb_row(AVCodecContext *avctx, void *tdata,
-  int jobnr, int threadnr)
-{
-filter_mb_row(avctx, tdata, jobnr, threadnr, 0);
-}
-
 static av_always_inline
 int vp78_decode_mb_row_sliced(AVCodecContext *avctx, void *tdata, int jobnr,
   int threadnr, int is_vp7)
@@ -2837,20 +2813,6 @@ err:
 return ret;
 }
 
-int ff_vp8_decode_frame(AVCodecContext *avctx, AVFrame *frame,
-int *got_frame, AVPacket *avpkt)
-{
-return vp78_decode_frame(avctx, frame, got_frame, avpkt, IS_VP8);
-}
-
-#if CONFIG_VP7_DECODER
-static int vp7_decode_frame(AVCodecContext *avctx, AVFrame *frame,
-int *got_frame, AVPacket *avpkt)
-{
-return vp78_decode_frame(avctx, frame, got_frame, avpkt, IS_VP7);
-}
-#endif /* CONFIG_VP7_DECODER */
-
 av_cold int ff_vp8_decode_free(AVCodecContext *avctx)
 {
 vp8_decode_flush_impl(avctx, 1);
@@ -2875,6 +2837,24 @@ static av_cold void vp78_decode_init(AVCodecContext 
*avctx)
 }
 
 #if CONFIG_VP8_DECODER
+static int vp8_decode_mb_row_no_filter(AVCodecContext *avctx, void *tdata,
+int jobnr, int threadnr)
+{
+return decode_mb_row_no_filter(avctx, tdata, jobnr, threadnr, 0);
+}
+
+static void vp8_filter_mb_row(AVCodecContext *avctx, void *tdata,
+  int jobnr, int threadnr)
+{
+filter_mb_row(avctx, tdata, jobnr, threadnr, 0);
+}
+
+int ff_vp8_decode_frame(AVCodecContext *avctx, AVFrame *frame,
+int *got_frame, AVPacket *avpkt)
+{
+return vp78_decode_frame(avctx, frame, got_frame, avpkt, IS_VP8);
+}
+
 av_cold int ff_vp8_decode_init(AVCodecContext *avctx)
 {
 VP8Context *s = avctx->priv_data;
@@ -2931,6 +2911,24 @@ static int 
vp8_decode_update_thread_context(AVCodecContext *dst,
 #endif /* CONFIG_VP8_DECODER */
 
 #if CONFIG_VP7_DECODER
+static int vp7_decode_mb_row_no_filter(AVCodecContext *avctx, void *tdata,
+int jobnr, int threadnr)
+{
+return decode_mb_row_no_filter(avctx, tdata, jobnr, threadnr, 1);
+}
+
+static void vp7_filter_mb_row(AVCodecContext *avctx, void *tdata,
+  int jobnr, int threadnr)
+{
+filter_mb_row(avctx, tdata, jobnr, threadnr, 1);
+}
+
+static int vp7_decode_frame(AVCodecContext *avctx, AVFrame *frame,
+int *got_frame, AVPacket *avpkt)
+{
+return vp78_decode_frame(avctx, frame, got_frame, avpkt, IS_VP7);
+}
+
 av_cold static int vp7_decode_init(AVCodecContext *avctx)
 {
 VP8Context *s = avctx->priv_data;

___
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/vp8: Remove always-false hwaccel checks for VP7

2025-03-09 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Thu Mar  6 18:20:32 2025 +0100| [0349ae3ec4c2d381b0ce163b4195ecbba422a484] | 
committer: Andreas Rheinhardt

avcodec/vp8: Remove always-false hwaccel checks for VP7

Reviewed-by: Peter Ross 
Signed-off-by: Andreas Rheinhardt 

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

 libavcodec/vp8.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
index 77f7b4d4df..348744efd6 100644
--- a/libavcodec/vp8.c
+++ b/libavcodec/vp8.c
@@ -2727,7 +2727,7 @@ int vp78_decode_frame(AVCodecContext *avctx, AVFrame 
*rframe, int *got_frame,
 if (!is_vp7 && !s->actually_webp)
 ff_thread_finish_setup(avctx);
 
-if (avctx->hwaccel) {
+if (!is_vp7 && avctx->hwaccel) {
 const FFHWAccel *hwaccel = ffhwaccel(avctx->hwaccel);
 ret = hwaccel->start_frame(avctx, avpkt->data, avpkt->size);
 if (ret < 0)

___
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/vp8: Fix wrong #endif comment

2025-03-09 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Thu Mar  6 17:56:08 2025 +0100| [b6602a17e14982441081b7164c48ef68fc8e43e2] | 
committer: Andreas Rheinhardt

avcodec/vp8: Fix wrong #endif comment

Reviewed-by: Peter Ross 
Signed-off-by: Andreas Rheinhardt 

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

 libavcodec/vp8.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
index 3651688c10..6337fa173b 100644
--- a/libavcodec/vp8.c
+++ b/libavcodec/vp8.c
@@ -2984,4 +2984,4 @@ const FFCodec ff_vp8_decoder = {
NULL
},
 };
-#endif /* CONFIG_VP7_DECODER */
+#endif /* CONFIG_VP8_DECODER */

___
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".