This is an automated email from the git hooks/post-receive script. Git pushed a commit to branch master in repository ffmpeg.
commit 5f15c067fe1b912e7ab0d3909cefca7c08e154e0 Author: Andreas Rheinhardt <[email protected]> AuthorDate: Tue Jan 6 16:55:43 2026 +0100 Commit: Andreas Rheinhardt <[email protected]> CommitDate: Sat Jan 10 22:47:22 2026 +0100 avcodec/pngdsp: Constify Also constify ff_png_filter_row(). Signed-off-by: Andreas Rheinhardt <[email protected]> --- libavcodec/png.h | 2 +- libavcodec/pngdec.c | 4 ++-- libavcodec/pngdsp.c | 7 ++++--- libavcodec/pngdsp.h | 11 ++++++----- libavcodec/x86/pngdsp_init.c | 12 ++++++------ 5 files changed, 19 insertions(+), 17 deletions(-) diff --git a/libavcodec/png.h b/libavcodec/png.h index 903f217aed..1e2cf11d1c 100644 --- a/libavcodec/png.h +++ b/libavcodec/png.h @@ -58,6 +58,6 @@ int ff_png_get_nb_channels(int color_type); int ff_png_pass_row_size(int pass, int bits_per_pixel, int width); void ff_png_filter_row(PNGDSPContext *dsp, uint8_t *dst, int filter_type, - uint8_t *src, uint8_t *last, int size, int bpp); + const uint8_t *src, const uint8_t *last, int size, int bpp); #endif /* AVCODEC_PNG_H */ diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c index 3651da265f..723f2aec4d 100644 --- a/libavcodec/pngdec.c +++ b/libavcodec/pngdec.c @@ -257,7 +257,7 @@ static void png_put_interlaced_row(uint8_t *dst, int width, /* NOTE: 'dst' can be equal to 'last' */ void ff_png_filter_row(PNGDSPContext *dsp, uint8_t *dst, int filter_type, - uint8_t *src, uint8_t *last, int size, int bpp) + const uint8_t *src, const uint8_t *last, int size, int bpp) { int i, p, r, g, b, a; @@ -271,7 +271,7 @@ void ff_png_filter_row(PNGDSPContext *dsp, uint8_t *dst, int filter_type, if (bpp == 4) { p = *(int *)dst; for (; i < size; i += bpp) { - unsigned s = *(int *)(src + i); + unsigned s = *(const int *)(src + i); p = ((s & 0x7f7f7f7f) + (p & 0x7f7f7f7f)) ^ ((s ^ p) & 0x80808080); *(int *)(dst + i) = p; } diff --git a/libavcodec/pngdsp.c b/libavcodec/pngdsp.c index e7afce8772..c74b4a56c3 100644 --- a/libavcodec/pngdsp.c +++ b/libavcodec/pngdsp.c @@ -42,7 +42,8 @@ typedef uint32_t uint_native; #define pb_7f (~(uint_native)0 / 255 * 0x7f) #define pb_80 (~(uint_native)0 / 255 * 0x80) -static void add_bytes_l2_c(uint8_t *dst, uint8_t *src1, uint8_t *src2, int w) +static void add_bytes_l2_c(uint8_t *dst, const uint8_t *src1, + const uint8_t *src2, int w) { long i; for (i = 0; i <= w - (int) sizeof(uint_native); i += sizeof(uint_native)) { @@ -54,8 +55,8 @@ static void add_bytes_l2_c(uint8_t *dst, uint8_t *src1, uint8_t *src2, int w) dst[i] = src1[i] + src2[i]; } -void ff_add_png_paeth_prediction(uint8_t *dst, uint8_t *src, uint8_t *top, - int w, int bpp) +void ff_add_png_paeth_prediction(uint8_t *dst, const uint8_t *src, + const uint8_t *top, int w, int bpp) { for (int i = 0; i < w; ++i) { int a, b, c, p, pa, pb, pc; diff --git a/libavcodec/pngdsp.h b/libavcodec/pngdsp.h index a32ffb88af..f2c4b4708f 100644 --- a/libavcodec/pngdsp.h +++ b/libavcodec/pngdsp.h @@ -28,16 +28,17 @@ typedef struct PNGDSPContext { void (*add_bytes_l2)(uint8_t *dst, - uint8_t *src1 /* align 16 */, - uint8_t *src2, int w); + const uint8_t *src1 /* align 16 */, + const uint8_t *src2, int w); /* this might write to dst[w] */ - void (*add_paeth_prediction)(uint8_t *dst, uint8_t *src, - uint8_t *top, int w, int bpp); + void (*add_paeth_prediction)(uint8_t *dst, const uint8_t *src, + const uint8_t *top, int w, int bpp); } PNGDSPContext; FF_VISIBILITY_PUSH_HIDDEN -void ff_add_png_paeth_prediction(uint8_t *dst, uint8_t *src, uint8_t *top, int w, int bpp); +void ff_add_png_paeth_prediction(uint8_t *dst, const uint8_t *src, + const uint8_t *top, int w, int bpp); void ff_pngdsp_init(PNGDSPContext *dsp); void ff_pngdsp_init_x86(PNGDSPContext *dsp); diff --git a/libavcodec/x86/pngdsp_init.c b/libavcodec/x86/pngdsp_init.c index e2cd5effe3..0af58640b8 100644 --- a/libavcodec/x86/pngdsp_init.c +++ b/libavcodec/x86/pngdsp_init.c @@ -24,12 +24,12 @@ #include "libavutil/x86/cpu.h" #include "libavcodec/pngdsp.h" -void ff_add_png_paeth_prediction_mmxext(uint8_t *dst, uint8_t *src, - uint8_t *top, int w, int bpp); -void ff_add_png_paeth_prediction_ssse3(uint8_t *dst, uint8_t *src, - uint8_t *top, int w, int bpp); -void ff_add_bytes_l2_sse2(uint8_t *dst, uint8_t *src1, - uint8_t *src2, int w); +void ff_add_png_paeth_prediction_mmxext(uint8_t *dst, const uint8_t *src, + const uint8_t *top, int w, int bpp); +void ff_add_png_paeth_prediction_ssse3(uint8_t *dst, const uint8_t *src, + const uint8_t *top, int w, int bpp); +void ff_add_bytes_l2_sse2(uint8_t *dst, const uint8_t *src1, + const uint8_t *src2, int w); av_cold void ff_pngdsp_init_x86(PNGDSPContext *dsp) { _______________________________________________ ffmpeg-cvslog mailing list -- [email protected] To unsubscribe send an email to [email protected]
