diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-07-26 09:09:44 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-08-05 03:21:41 +0200 |
commit | 5828e8209f48f206c42b69e314a6988b50e98924 (patch) | |
tree | b1ce7a4fdbafb8e2ec3706340736812dae042016 /libavcodec/proresenc_anatoliy.c | |
parent | cee40a945abc3568e270899eefb8bf6cf7e5ab3c (diff) | |
download | ffmpeg-5828e8209f48f206c42b69e314a6988b50e98924.tar.gz |
avcodec: Constify frame->data pointers for encoders where possible
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/proresenc_anatoliy.c')
-rw-r--r-- | libavcodec/proresenc_anatoliy.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c index 95c0f1c244..cfc735bcec 100644 --- a/libavcodec/proresenc_anatoliy.c +++ b/libavcodec/proresenc_anatoliy.c @@ -305,7 +305,7 @@ static void encode_ac_coeffs(PutBitContext *pb, } } -static void get(uint8_t *pixels, int stride, int16_t* block) +static void get(const uint8_t *pixels, int stride, int16_t* block) { int i; @@ -317,13 +317,13 @@ static void get(uint8_t *pixels, int stride, int16_t* block) } } -static void fdct_get(FDCTDSPContext *fdsp, uint8_t *pixels, int stride, int16_t* block) +static void fdct_get(FDCTDSPContext *fdsp, const uint8_t *pixels, int stride, int16_t* block) { get(pixels, stride, block); fdsp->fdct(block); } -static void calc_plane_dct(FDCTDSPContext *fdsp, uint8_t *src, int16_t * blocks, int src_stride, int mb_count, int chroma, int is_422) +static void calc_plane_dct(FDCTDSPContext *fdsp, const uint8_t *src, int16_t * blocks, int src_stride, int mb_count, int chroma, int is_422) { int16_t *block; int i; @@ -473,7 +473,7 @@ static av_always_inline int encode_alpha_slice_data(AVCodecContext *avctx, int8_ } } -static inline void subimage_with_fill_template(uint16_t *src, unsigned x, unsigned y, +static inline void subimage_with_fill_template(const uint16_t *src, unsigned x, unsigned y, unsigned stride, unsigned width, unsigned height, uint16_t *dst, unsigned dst_width, unsigned dst_height, int is_alpha_plane, int is_interlaced, int is_top_field) @@ -521,7 +521,7 @@ static inline void subimage_with_fill_template(uint16_t *src, unsigned x, unsign } } -static void subimage_with_fill(uint16_t *src, unsigned x, unsigned y, +static void subimage_with_fill(const uint16_t *src, unsigned x, unsigned y, unsigned stride, unsigned width, unsigned height, uint16_t *dst, unsigned dst_width, unsigned dst_height, int is_interlaced, int is_top_field) { @@ -529,7 +529,7 @@ static void subimage_with_fill(uint16_t *src, unsigned x, unsigned y, } /* reorganize alpha data and convert 10b -> 16b */ -static void subimage_alpha_with_fill(uint16_t *src, unsigned x, unsigned y, +static void subimage_alpha_with_fill(const uint16_t *src, unsigned x, unsigned y, unsigned stride, unsigned width, unsigned height, uint16_t *dst, unsigned dst_width, unsigned dst_height, int is_interlaced, int is_top_field) { @@ -544,7 +544,7 @@ static int encode_slice(AVCodecContext *avctx, const AVFrame *pic, int mb_x, ProresContext* ctx = avctx->priv_data; int hdr_size = 6 + (ctx->need_alpha * 2); /* v data size is write when there is alpha */ int ret = 0, slice_size; - uint8_t *dest_y, *dest_u, *dest_v; + const uint8_t *dest_y, *dest_u, *dest_v; unsigned y_data_size = 0, u_data_size = 0, v_data_size = 0, a_data_size = 0; FDCTDSPContext *fdsp = &ctx->fdsp; int tgt_bits = (mb_count * bitrate_table[avctx->profile]) >> 2; @@ -577,13 +577,13 @@ static int encode_slice(AVCodecContext *avctx, const AVFrame *pic, int mb_x, } if (unsafe) { - subimage_with_fill((uint16_t *) pic->data[0], mb_x << 4, mb_y << 4, + subimage_with_fill((const uint16_t *) pic->data[0], mb_x << 4, mb_y << 4, luma_stride, avctx->width, avctx->height, (uint16_t *) ctx->fill_y, mb_count << 4, 16, is_interlaced, is_top_field); - subimage_with_fill((uint16_t *) pic->data[1], mb_x << (4 - ctx->is_422), mb_y << 4, + subimage_with_fill((const uint16_t *) pic->data[1], mb_x << (4 - ctx->is_422), mb_y << 4, chroma_stride, avctx->width >> ctx->is_422, avctx->height, (uint16_t *) ctx->fill_u, mb_count << (4 - ctx->is_422), 16, is_interlaced, is_top_field); - subimage_with_fill((uint16_t *) pic->data[2], mb_x << (4 - ctx->is_422), mb_y << 4, + subimage_with_fill((const uint16_t *) pic->data[2], mb_x << (4 - ctx->is_422), mb_y << 4, chroma_stride, avctx->width >> ctx->is_422, avctx->height, (uint16_t *) ctx->fill_v, mb_count << (4 - ctx->is_422), 16, is_interlaced, is_top_field); @@ -640,7 +640,7 @@ static int encode_slice(AVCodecContext *avctx, const AVFrame *pic, int mb_x, if (ctx->need_alpha) { AV_WB16(buf + 6, v_data_size); /* write v data size only if there is alpha */ - subimage_alpha_with_fill((uint16_t *) pic->data[3], mb_x << 4, mb_y << 4, + subimage_alpha_with_fill((const uint16_t *) pic->data[3], mb_x << 4, mb_y << 4, alpha_stride, avctx->width, avctx->height, (uint16_t *) ctx->fill_a, mb_count << 4, 16, is_interlaced, is_top_field); ret = encode_alpha_slice_data(avctx, ctx->fill_a, mb_count, |