summaryrefslogtreecommitdiff
path: root/libavcodec/pngenc.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/pngenc.c')
-rw-r--r--libavcodec/pngenc.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/libavcodec/pngenc.c b/libavcodec/pngenc.c
index c86cf5a862..ca9873f673 100644
--- a/libavcodec/pngenc.c
+++ b/libavcodec/pngenc.c
@@ -120,7 +120,7 @@ static void png_get_interlaced_row(uint8_t *dst, int row_size,
}
}
-static void sub_png_paeth_prediction(uint8_t *dst, uint8_t *src, uint8_t *top,
+static void sub_png_paeth_prediction(uint8_t *dst, const uint8_t *src, const uint8_t *top,
int w, int bpp)
{
int i;
@@ -165,7 +165,7 @@ static void sub_left_prediction(PNGEncContext *c, uint8_t *dst, const uint8_t *s
}
static void png_filter_row(PNGEncContext *c, uint8_t *dst, int filter_type,
- uint8_t *src, uint8_t *top, int size, int bpp)
+ const uint8_t *src, const uint8_t *top, int size, int bpp)
{
int i;
@@ -194,7 +194,7 @@ static void png_filter_row(PNGEncContext *c, uint8_t *dst, int filter_type,
}
static uint8_t *png_choose_filter(PNGEncContext *s, uint8_t *dst,
- uint8_t *src, uint8_t *top, int size, int bpp)
+ const uint8_t *src, const uint8_t *top, int size, int bpp)
{
int pred = s->filter_type;
av_assert0(bpp || !pred);
@@ -486,7 +486,7 @@ static int encode_frame(AVCodecContext *avctx, const AVFrame *pict)
const AVFrame *const p = pict;
int y, len, ret;
int row_size, pass_row_size;
- uint8_t *ptr, *top, *crow_buf, *crow;
+ uint8_t *crow_buf, *crow;
uint8_t *crow_base = NULL;
uint8_t *progressive_buf = NULL;
uint8_t *top_buf = NULL;
@@ -520,10 +520,10 @@ static int encode_frame(AVCodecContext *avctx, const AVFrame *pict)
* output */
pass_row_size = ff_png_pass_row_size(pass, s->bits_per_pixel, pict->width);
if (pass_row_size > 0) {
- top = NULL;
+ uint8_t *top = NULL;
for (y = 0; y < pict->height; y++)
if ((ff_png_pass_ymask[pass] << (y & 7)) & 0x80) {
- ptr = p->data[0] + y * p->linesize[0];
+ const uint8_t *ptr = p->data[0] + y * p->linesize[0];
FFSWAP(uint8_t *, progressive_buf, top_buf);
png_get_interlaced_row(progressive_buf, pass_row_size,
s->bits_per_pixel, pass,
@@ -536,9 +536,9 @@ static int encode_frame(AVCodecContext *avctx, const AVFrame *pict)
}
}
} else {
- top = NULL;
+ const uint8_t *top = NULL;
for (y = 0; y < pict->height; y++) {
- ptr = p->data[0] + y * p->linesize[0];
+ const uint8_t *ptr = p->data[0] + y * p->linesize[0];
crow = png_choose_filter(s, crow_buf, ptr, top,
row_size, s->bits_per_pixel >> 3);
png_write_row(avctx, crow, row_size + 1);
@@ -723,7 +723,7 @@ static int apng_do_inverse_blend(AVFrame *output, const AVFrame *input,
}
for (y = topmost_y; y < bottommost_y; ++y) {
- uint8_t *foreground = input->data[0] + input_linesize * y + bpp * leftmost_x;
+ const uint8_t *foreground = input->data[0] + input_linesize * y + bpp * leftmost_x;
uint8_t *background = output->data[0] + output_linesize * y + bpp * leftmost_x;
output_data = output->data[0] + output_linesize * (y - topmost_y);
for (x = leftmost_x; x < rightmost_x; ++x, foreground += bpp, background += bpp, output_data += bpp) {