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/zmbvenc.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/zmbvenc.c')
-rw-r--r-- | libavcodec/zmbvenc.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/libavcodec/zmbvenc.c b/libavcodec/zmbvenc.c index c63f411eb5..cc8578afea 100644 --- a/libavcodec/zmbvenc.c +++ b/libavcodec/zmbvenc.c @@ -84,8 +84,8 @@ typedef struct ZmbvEncContext { /** Block comparing function * XXX should be optimized and moved to DSPContext */ -static inline int block_cmp(ZmbvEncContext *c, uint8_t *src, int stride, - uint8_t *src2, int stride2, int bw, int bh, +static inline int block_cmp(ZmbvEncContext *c, const uint8_t *src, int stride, + const uint8_t *src2, int stride2, int bw, int bh, int *xored) { int sum = 0; @@ -119,7 +119,7 @@ static inline int block_cmp(ZmbvEncContext *c, uint8_t *src, int stride, /** Motion estimation function * TODO make better ME decisions */ -static int zmbv_me(ZmbvEncContext *c, uint8_t *src, int sstride, uint8_t *prev, +static int zmbv_me(ZmbvEncContext *c, const uint8_t *src, int sstride, const uint8_t *prev, int pstride, int x, int y, int *mx, int *my, int *xored) { int dx, dy, txored, tv, bv, bw, bh; @@ -171,7 +171,8 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, ZmbvEncContext * const c = avctx->priv_data; z_stream *const zstream = &c->zstream.zstream; const AVFrame * const p = pict; - uint8_t *src, *prev, *buf; + const uint8_t *src; + uint8_t *prev, *buf; uint32_t *palptr; int keyframe, chpal; int fl; @@ -218,7 +219,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, } }else{ int x, y, bh2, bw2, xored; - uint8_t *tsrc, *tprev; + const uint8_t *tsrc, *tprev; uint8_t *mv; int mx = 0, my = 0; |