[FFmpeg-cvslog] avfilter/vf_zscale: add support for grayscale formats

2025-03-20 Thread James Almer
ffmpeg | branch: master | James Almer  | Mon Mar 17 00:29:47 
2025 -0300| [0ce405afb8df221b3a975a30b5c229449c8ed7da] | committer: James Almer

avfilter/vf_zscale: add support for grayscale formats

Signed-off-by: James Almer 

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

 libavfilter/vf_zscale.c | 12 +---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/libavfilter/vf_zscale.c b/libavfilter/vf_zscale.c
index 5fe6e555e7..d913f7d99c 100644
--- a/libavfilter/vf_zscale.c
+++ b/libavfilter/vf_zscale.c
@@ -206,11 +206,12 @@ static int query_formats(const AVFilterContext *ctx,
 AV_PIX_FMT_YUVA420P10, AV_PIX_FMT_YUVA422P10, AV_PIX_FMT_YUVA444P10,
 AV_PIX_FMT_YUVA444P12, AV_PIX_FMT_YUVA422P12,
 AV_PIX_FMT_YUVA420P16, AV_PIX_FMT_YUVA422P16, AV_PIX_FMT_YUVA444P16,
+AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY9, AV_PIX_FMT_GRAY10,
 AV_PIX_FMT_GBRP, AV_PIX_FMT_GBRP9, AV_PIX_FMT_GBRP10,
 AV_PIX_FMT_GBRP12, AV_PIX_FMT_GBRP14, AV_PIX_FMT_GBRP16,
 AV_PIX_FMT_GBRAP, AV_PIX_FMT_GBRAP10, AV_PIX_FMT_GBRAP12, 
AV_PIX_FMT_GBRAP14, AV_PIX_FMT_GBRAP16,
-AV_PIX_FMT_GBRPF16, AV_PIX_FMT_GBRAPF16,
-AV_PIX_FMT_GBRPF32, AV_PIX_FMT_GBRAPF32,
+AV_PIX_FMT_GRAYF16, AV_PIX_FMT_GBRPF16, AV_PIX_FMT_GBRAPF16,
+AV_PIX_FMT_GRAYF32, AV_PIX_FMT_GBRPF32, AV_PIX_FMT_GBRAPF32,
 AV_PIX_FMT_NONE
 };
 int ret;
@@ -585,7 +586,8 @@ static void format_init(zimg_image_format *format, AVFrame 
*frame, const AVPixFm
 format->depth = desc->comp[0].depth;
 format->pixel_type = (desc->flags & AV_PIX_FMT_FLAG_FLOAT) ? 
(desc->comp[0].depth > 16 ? ZIMG_PIXEL_FLOAT : ZIMG_PIXEL_HALF)
: 
(desc->comp[0].depth > 8  ? ZIMG_PIXEL_WORD  : ZIMG_PIXEL_BYTE);
-format->color_family = (desc->flags & AV_PIX_FMT_FLAG_RGB) ? 
ZIMG_COLOR_RGB : ZIMG_COLOR_YUV;
+format->color_family = (desc->flags & AV_PIX_FMT_FLAG_RGB) ? ZIMG_COLOR_RGB
+   : 
(desc->nb_components > 1 ? ZIMG_COLOR_YUV : ZIMG_COLOR_GREY);
 format->matrix_coefficients = (desc->flags & AV_PIX_FMT_FLAG_RGB) ? 
ZIMG_MATRIX_RGB : colorspace == -1 ? convert_matrix(frame->colorspace) : 
colorspace;
 format->color_primaries = primaries == -1 ? 
convert_primaries(frame->color_primaries) : primaries;
 format->transfer_characteristics = transfer == -1 ? 
convert_trc(frame->color_trc) : transfer;
@@ -738,14 +740,18 @@ static int filter_slice(AVFilterContext *ctx, void *data, 
int job_nr, int n_jobs
 
 p = td->desc->comp[i].plane;
 
+if (i < td->desc->nb_components) {
 src_buf.plane[i].data = td->in->data[p];
 src_buf.plane[i].stride = td->in->linesize[p];
 src_buf.plane[i].mask = -1;
+}
 
 p = td->odesc->comp[i].plane;
+if (i < td->odesc->nb_components) {
 dst_buf.plane[i].data = td->out->data[p] + td->out->linesize[p] * 
(out_slice_start >> vsamp);
 dst_buf.plane[i].stride = td->out->linesize[p];
 dst_buf.plane[i].mask = -1;
+}
 }
 if (!s->graph[job_nr])
 return AVERROR(EINVAL);

___
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/h261enc: Don't use (size_t)-1

2025-03-20 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Mon Mar 17 09:53:42 2025 +0100| [fbcc943b22534517670d287f35eebe40896f771f] | 
committer: Andreas Rheinhardt

avcodec/h261enc: Don't use (size_t)-1

Fixes "runtime error: addition of unsigned offset to 0x765a09523a90
overflowed to 0x765a09523a8e". This fixes all H.261 tests when run
under UBsan.

Signed-off-by: Andreas Rheinhardt 

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

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

diff --git a/libavcodec/h261enc.c b/libavcodec/h261enc.c
index 36436ee60f..5e6d5d1f9c 100644
--- a/libavcodec/h261enc.c
+++ b/libavcodec/h261enc.c
@@ -337,7 +337,7 @@ static av_cold void h261_encode_init_static(void)
 uni_h261_rl_len_last[UNI_AC_ENC_INDEX(run, 64 - level)] = len + 2;
 }
 
-for (size_t i = 1;; i++) {
+for (ptrdiff_t i = 1;; i++) {
 // sign-one MV codes; diff -16..-1, 16..31
 mv_codes[32 - i][0] = mv_codes[-i][0] = (ff_h261_mv_tab[i][0] << 1) | 
1 /* sign */;
 mv_codes[32 - i][1] = mv_codes[-i][1] = ff_h261_mv_tab[i][1] + 1;

___
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] avdevice/sdl2: Suppress macro redefinition warning

2025-03-20 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Tue Mar 18 10:40:00 2025 +0100| [e5d62e20c8d84207f7bc63009751572285a16127] | 
committer: Andreas Rheinhardt

avdevice/sdl2: Suppress macro redefinition warning

SDL2's headers #define HAVE_PTHREAD_SETNAME_NP (to one here);
we also have a config define which leads the compiler to
warn about this when the values are distinct (as they are here).
Suppress this warning by including config.h before SDL.h.
The latter will then redefine our define which doesn't matter
and which does not lead to warnings because compilers don't warn
about system headers by default (depending upon -Wsystem-headers).

Signed-off-by: Andreas Rheinhardt 

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

 libavdevice/sdl2.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavdevice/sdl2.c b/libavdevice/sdl2.c
index 491c8dafe8..35b0bf4d35 100644
--- a/libavdevice/sdl2.c
+++ b/libavdevice/sdl2.c
@@ -23,6 +23,8 @@
  * libSDL2 output device
  */
 
+#include "config.h"
+
 #include 
 #include 
 

___
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] swscale/tests/swscale: Fix potential buffer overflow

2025-03-20 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Tue Mar 18 16:16:33 2025 +0100| [65154ba99442134a2f732f2213699fc38dc6727a] | 
committer: Andreas Rheinhardt

swscale/tests/swscale: Fix potential buffer overflow

The field width in a %s directive gives the amount of characters
to read from the input and not the size of the receiving buffer;
the latter must be of course also have space for the trailing \0
which has been forgotten here. The commit adds it (and fixes a
-Wfortify-source warning from Clang).

Signed-off-by: Andreas Rheinhardt 

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

 libswscale/tests/swscale.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libswscale/tests/swscale.c b/libswscale/tests/swscale.c
index 2e83197694..096573f8c3 100644
--- a/libswscale/tests/swscale.c
+++ b/libswscale/tests/swscale.c
@@ -297,7 +297,7 @@ static int run_file_tests(const AVFrame *ref, FILE *fp, 
struct options opts)
 int ret;
 
 while (fgets(buf, sizeof(buf), fp)) {
-char src_fmt_str[20], dst_fmt_str[20];
+char src_fmt_str[21], dst_fmt_str[21];
 enum AVPixelFormat src_fmt;
 enum AVPixelFormat dst_fmt;
 int sw, sh, dw, dh, mse[4];

___
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/csp: Improve enum range comparisons

2025-03-20 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Tue Mar 18 15:48:03 2025 +0100| [dff498fddfaee28c825af324daa2ec8ce6a9] | 
committer: Andreas Rheinhardt

avutil/csp: Improve enum range comparisons

The underlying integer type of an enumeration is
implementation-defined (see C11, 6.7.2.2 (4)); GCC defaults
to unsigned if there are no negative values like for all enums
from pixfmt.h except enum AVPixelFormat.

This means that tests like "if (csp >= AVCOL_SPC_NB)" for
invalid colorspaces need not work as expected (namely if
enum AVColorSpace is signed). It also means that testing
for such an enum variable to be >= 0 may be tautologically
true. Clang emits a -Wtautological-unsigned-enum-zero-compare
warning for this.

Fix both of these issues by casting to unsigned.
Also do the same in libswscale/format.c.

Signed-off-by: Andreas Rheinhardt 

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

 libavutil/csp.c | 14 +++---
 libswscale/format.c |  4 ++--
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/libavutil/csp.c b/libavutil/csp.c
index d69599f513..75ac871616 100644
--- a/libavutil/csp.c
+++ b/libavutil/csp.c
@@ -59,7 +59,7 @@ const struct AVLumaCoefficients 
*av_csp_luma_coeffs_from_avcsp(enum AVColorSpace
 {
 const AVLumaCoefficients *coeffs;
 
-if (csp >= AVCOL_SPC_NB)
+if ((unsigned)csp >= AVCOL_SPC_NB)
 return NULL;
 coeffs = &luma_coefficients[csp];
 if (!coeffs->cr.num)
@@ -91,7 +91,7 @@ const AVColorPrimariesDesc 
*av_csp_primaries_desc_from_id(enum AVColorPrimaries
 {
 const AVColorPrimariesDesc *p;
 
-if (prm >= AVCOL_PRI_NB)
+if ((unsigned)prm >= AVCOL_PRI_NB)
 return NULL;
 p = &color_primaries[prm];
 if (!p->prim.r.x.num)
@@ -149,7 +149,7 @@ static const double approximate_gamma[AVCOL_TRC_NB] = {
 double av_csp_approximate_trc_gamma(enum AVColorTransferCharacteristic trc)
 {
 double gamma;
-if (trc >= AVCOL_TRC_NB)
+if ((unsigned)trc >= AVCOL_TRC_NB)
 return 0.0;
 gamma = approximate_gamma[trc];
 if (gamma > 0)
@@ -399,7 +399,7 @@ static const av_csp_trc_function trc_funcs[AVCOL_TRC_NB] = {
 
 av_csp_trc_function av_csp_trc_func_from_id(enum AVColorTransferCharacteristic 
trc)
 {
-if (trc >= AVCOL_TRC_NB)
+if ((unsigned)trc >= AVCOL_TRC_NB)
 return NULL;
 return trc_funcs[trc];
 }
@@ -425,7 +425,7 @@ static const av_csp_trc_function 
trc_inv_funcs[AVCOL_TRC_NB] = {
 
 av_csp_trc_function av_csp_trc_func_inv_from_id(enum 
AVColorTransferCharacteristic trc)
 {
-if (trc >= AVCOL_TRC_NB)
+if ((unsigned)trc >= AVCOL_TRC_NB)
 return NULL;
 return trc_inv_funcs[trc];
 }
@@ -604,7 +604,7 @@ static const av_csp_eotf_function eotf_funcs[AVCOL_TRC_NB] 
= {
 
 av_csp_eotf_function av_csp_itu_eotf(enum AVColorTransferCharacteristic trc)
 {
-if (trc < 0 || trc >= AVCOL_TRC_NB)
+if ((unsigned)trc >= AVCOL_TRC_NB)
 return NULL;
 return eotf_funcs[trc];
 }
@@ -630,7 +630,7 @@ static const av_csp_eotf_function 
eotf_inv_funcs[AVCOL_TRC_NB] = {
 
 av_csp_eotf_function av_csp_itu_eotf_inv(enum AVColorTransferCharacteristic 
trc)
 {
-if (trc < 0 || trc >= AVCOL_TRC_NB)
+if ((unsigned)trc >= AVCOL_TRC_NB)
 return NULL;
 return eotf_inv_funcs[trc];
 }
diff --git a/libswscale/format.c b/libswscale/format.c
index cdffb3e863..b859af7b04 100644
--- a/libswscale/format.c
+++ b/libswscale/format.c
@@ -537,12 +537,12 @@ int sws_test_transfer(enum AVColorTransferCharacteristic 
trc, int output)
 
 static int test_range(enum AVColorRange range)
 {
-return range >= 0 && range < AVCOL_RANGE_NB;
+return (unsigned)range < AVCOL_RANGE_NB;
 }
 
 static int test_loc(enum AVChromaLocation loc)
 {
-return loc >= 0 && loc < AVCHROMA_LOC_NB;
+return (unsigned)loc < AVCHROMA_LOC_NB;
 }
 
 int ff_test_fmt(const SwsFormat *fmt, int output)

___
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/sanm: codec4/5/33/34 decoder

2025-03-20 Thread Manuel Lauss
ffmpeg | branch: master | Manuel Lauss  | Wed Mar 12 
16:16:29 2025 +0100| [fb951b26fde6ee6328b9b20bde8a92a8a8b5b423] | committer: 
Manuel Lauss

avcodec/sanm: codec4/5/33/34 decoder

This codec works on 4x4 pixel tiles, which can be generated and read
from the datastream.  They're both identical, codec5 misses a tile
index to skip the current tile.
Codecs33/34 are the same as 4/5 but with a different tileset generator.
Used only in Rebel Assault 1.

Signed-off-by: Manuel Lauss 

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

 libavcodec/sanm.c | 229 ++
 1 file changed, 229 insertions(+)

diff --git a/libavcodec/sanm.c b/libavcodec/sanm.c
index 95ff8596ab..5bb35df9e0 100644
--- a/libavcodec/sanm.c
+++ b/libavcodec/sanm.c
@@ -293,6 +293,8 @@ typedef struct SANMVideoContext {
 int8_t p8x8glyphs[NGLYPHS][64];
 uint8_t c47itbl[0x1];
 uint8_t c23lut[256];
+uint8_t c4tbl[2][256][16];
+uint16_t c4param;
 } SANMVideoContext;
 
 typedef struct SANMFrameHeader {
@@ -480,6 +482,142 @@ static av_cold int init_buffers(SANMVideoContext *ctx)
 return 0;
 }
 
+static void codec33_gen_tiles(SANMVideoContext *ctx, int8_t param1)
+{
+uint8_t *dst = &(ctx->c4tbl[0][0][0]);
+int i, j, k, l, m, n, o, p;
+
+for (i = 0; i < 8; i++) {
+for (k = 0; k < 8; k++) {
+j = i + param1;
+l = k + param1;
+p = (j + k) / 2;
+j = (j + p) / 2;
+m = l / 2;
+n = (i + param1);
+o = (k + param1);
+
+*dst++ = p; *dst++ = p; *dst++ = j; *dst++ = n;
+*dst++ = p; *dst++ = p; *dst++ = j; *dst++ = i;
+*dst++ = m; *dst++ = m; *dst++ = p; *dst++ = j;
+*dst++ = l; *dst++ = l; *dst++ = m; *dst++ = p;
+}
+}
+
+for (i = 0; i < 8; i++) {
+for (k = 0; k < 8; k++) {
+j = i + param1;
+l = k + param1;
+n = ((j + l) / 2);
+m = ((l + n) / 2);
+
+*dst++ = j; *dst++ = j; *dst++ = j; *dst++ = j;
+*dst++ = n; *dst++ = n; *dst++ = n; *dst++ = n;
+*dst++ = m; *dst++ = m; *dst++ = m; *dst++ = m;
+*dst++ = l; *dst++ = l; *dst++ = l; *dst++ = l;
+}
+}
+
+for (i = 0; i < 8; i++) {
+for (k = 0; k < 8; k++) {
+j = i + param1;
+l = k + param1;
+m = (j + l) / 2;
+n = (j + m) / 2;
+o = m / 2;
+p = j & 0xff;
+
+*dst++ = p; *dst++ = p; *dst++ = n; *dst++ = m;
+*dst++ = p; *dst++ = p; *dst++ = n; *dst++ = m;
+*dst++ = n; *dst++ = n; *dst++ = m; *dst++ = o;
+*dst++ = m; *dst++ = m; *dst++ = o; *dst++ = l;
+}
+}
+
+for (i = 0; i < 8; i++) {
+for (k = 0; k < 8; k++) {
+j = i + param1;
+l = k + param1;
+m = (j + l) / 2;
+n = m / 2;
+
+*dst++ = j; *dst++ = m; *dst++ = n; *dst++ = l;
+*dst++ = j; *dst++ = m; *dst++ = n; *dst++ = l;
+*dst++ = j; *dst++ = m; *dst++ = n; *dst++ = l;
+*dst++ = j; *dst++ = m; *dst++ = n; *dst++ = l;
+}
+}
+}
+
+static void codec4_gen_tiles(SANMVideoContext *ctx, uint16_t param1)
+{
+uint8_t *dst = &(ctx->c4tbl[0][0][0]);
+int i, j, k, l, m, n, o;
+
+for (i = 1; i < 16; i += 2) {
+for (k = 0; k < 16; k++) {
+j = i + param1;
+l = k + param1;
+m = (j + l) / 2;
+n = (j + m) / 2;
+o = (l + m) / 2;
+if (j == m || l == m) {
+*dst++ = l; *dst++ = j; *dst++ = l; *dst++ = j;
+*dst++ = j; *dst++ = l; *dst++ = j; *dst++ = j;
+*dst++ = l; *dst++ = j; *dst++ = l; *dst++ = j;
+*dst++ = l; *dst++ = l; *dst++ = j; *dst++ = l;
+} else {
+*dst++ = m; *dst++ = m; *dst++ = n; *dst++ = j;
+*dst++ = m; *dst++ = m; *dst++ = n; *dst++ = j;
+*dst++ = o; *dst++ = o; *dst++ = m; *dst++ = n;
+*dst++ = l; *dst++ = l; *dst++ = o; *dst++ = m;
+}
+}
+}
+
+for (i = 0; i < 16; i += 2) {
+for (k = 0; k < 16; k++) {
+j = i + param1;
+l = k + param1;
+m = (j + l) / 2;
+n = (j + m) / 2;
+o = (l + m) / 2;
+if (m == j || m == l) {
+*dst++ = j; *dst++ = j; *dst++ = l; *dst++ = j;
+*dst++ = j; *dst++ = j; *dst++ = j; *dst++ = l;
+*dst++ = l; *dst++ = j; *dst++ = l; *dst++ = l;
+*dst++ = j; *dst++ = l; *dst++ = j; *dst++ = l;
+} else {
+*dst++ = j; *dst++ = j; *dst++ = n; *dst++ = m;
+*dst++ = j; *dst++ = j; *dst++ = n; *dst++ = m;
+*dst++ = n; *dst++ = n; *dst++ = m; *dst++ =

[FFmpeg-cvslog] avcodec/webvttdec: update documentation

2025-03-20 Thread Leon Grutters
ffmpeg | branch: master | Leon Grutters  | Tue Mar 
18 15:59:17 2025 +0100| [76f09ab647d19d78d9e630a675396cde9aa729cb] | committer: 
Andreas Rheinhardt

avcodec/webvttdec: update documentation

The previous link lead to a 404 page as that page doesn't exist anymore.

Signed-off-by: Leon Grutters 
Signed-off-by: Andreas Rheinhardt 

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

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

diff --git a/libavcodec/webvttdec.c b/libavcodec/webvttdec.c
index 35bdbe805d..733fdee685 100644
--- a/libavcodec/webvttdec.c
+++ b/libavcodec/webvttdec.c
@@ -21,7 +21,7 @@
 /**
  * @file
  * WebVTT subtitle decoder
- * @see http://dev.w3.org/html5/webvtt/
+ * @see https://www.w3.org/TR/webvtt1/
  * @todo need to support extended markups and cue settings
  */
 

___
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/hevc/hevcdec: Simplify access to luma plane

2025-03-20 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Mon Mar 17 20:01:22 2025 +0100| [b857bf942c265869d9fb91953ae68a95a978475a] | 
committer: Andreas Rheinhardt

avcodec/hevc/hevcdec: Simplify access to luma plane

It is always set and does not use subsampling.

Signed-off-by: Andreas Rheinhardt 

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

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

diff --git a/libavcodec/hevc/hevcdec.c b/libavcodec/hevc/hevcdec.c
index 20ef821819..e0ca1b9690 100644
--- a/libavcodec/hevc/hevcdec.c
+++ b/libavcodec/hevc/hevcdec.c
@@ -2125,7 +2125,7 @@ static void hls_prediction_unit(HEVCLocalContext *lc,
 const RefPicList *refPicList = s->cur_frame->refPicList;
 const HEVCFrame *ref0 = NULL, *ref1 = NULL;
 const int *linesize = s->cur_frame->f->linesize;
-uint8_t *dst0 = POS(0, x0, y0);
+uint8_t *dst0 = s->cur_frame->f->data[0] + y0 * linesize[0] + (x0 << 
sps->pixel_shift);
 uint8_t *dst1 = POS(1, x0, y0);
 uint8_t *dst2 = POS(2, x0, y0);
 int log2_min_cb_size = sps->log2_min_cb_size;

___
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/snow: Don't add to NULL

2025-03-20 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Mon Mar 17 09:59:36 2025 +0100| [02c16b48c5827b9383004ad5a727742b30614fe7] | 
committer: Andreas Rheinhardt

avcodec/snow: Don't add to NULL

It is undefined behavior.
Fixes "runtime error: applying non-zero offset 8 to null pointer".
Fixes the Snow vsynth FATE-tests.

Signed-off-by: Andreas Rheinhardt 

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

 libavcodec/snow.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/snow.h b/libavcodec/snow.h
index ff7ebc1c58..9b19e70bd5 100644
--- a/libavcodec/snow.h
+++ b/libavcodec/snow.h
@@ -272,7 +272,8 @@ static av_always_inline void add_yblock(SnowContext *s, int 
sliced, slice_buffer
 
 if(!sliced && offset_dst)
 dst += src_x + src_y*dst_stride;
-dst8+= src_x + src_y*src_stride;
+if (sliced || add)
+dst8+= src_x + src_y*src_stride;
 //src += src_x + src_y*src_stride;
 
 ptmp= tmp + 3*tmp_step;

___
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/proresenc_kostya: Don't cast const away needlessly

2025-03-20 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Mon Mar 17 13:20:49 2025 +0100| [45052573723549d0cc54f63da28dea0d3a8c859b] | 
committer: Andreas Rheinhardt

avcodec/proresenc_kostya: Don't cast const away needlessly

The parameter passed here is unused, so just pass NULL.

Signed-off-by: Andreas Rheinhardt 

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

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

diff --git a/libavcodec/proresenc_kostya.c b/libavcodec/proresenc_kostya.c
index ca26c59a4a..b98bc5c195 100644
--- a/libavcodec/proresenc_kostya.c
+++ b/libavcodec/proresenc_kostya.c
@@ -1033,7 +1033,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket 
*pkt,
 
 // slices
 if (!ctx->force_quant) {
-ret = avctx->execute2(avctx, find_quant_thread, (void*)pic, NULL,
+ret = avctx->execute2(avctx, find_quant_thread, NULL, NULL,
   ctx->mb_height);
 if (ret)
 return ret;

___
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/svq1enc: Don't add to NULL

2025-03-20 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Mon Mar 17 10:10:32 2025 +0100| [d76ae08048680811bf8a0891a29248c379545ac1] | 
committer: Andreas Rheinhardt

avcodec/svq1enc: Don't add to NULL

It is undefined behavior. Pass a dummy buffer instead.
Fixes "runtime error: applying non-zero offset 1024 to null pointer".
affected the SVQ1 vsynth FATE tests.

Signed-off-by: Andreas Rheinhardt 

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

 libavcodec/svq1enc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/svq1enc.c b/libavcodec/svq1enc.c
index 40e3fd0045..cf0ab64d79 100644
--- a/libavcodec/svq1enc.c
+++ b/libavcodec/svq1enc.c
@@ -444,8 +444,8 @@ static int svq1_encode_plane(SVQ1EncContext *s, int plane,
 put_bits(&s->reorder_pb[5], SVQ1_BLOCK_INTRA_LEN, 
SVQ1_BLOCK_INTRA_CODE);
 score[0] = SVQ1_BLOCK_INTRA_LEN * lambda;
 }
-score[0] += encode_block(s, src + 16 * x, NULL, temp, stride,
- 5, 64, lambda, 1);
+score[0] += encode_block(s, src + 16 * x, src + 16 * x /* 
unused */,
+ temp, stride, 5, 64, lambda, 1);
 for (i = 0; i < 6; i++) {
 count[0][i] = put_bits_count(&s->reorder_pb[i]);
 flush_put_bits(&s->reorder_pb[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".