summaryrefslogtreecommitdiff
path: root/libavcodec/ffv1enc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-01-06 22:03:57 +0100
committerMichael Niedermayer <michaelni@gmx.at>2015-01-06 22:05:06 +0100
commit3b3782d74e5a5827e4a52f0be990decd6a303654 (patch)
treef2c0f8efc9d4e06603d5f808d8a68934bfaac27f /libavcodec/ffv1enc.c
parentf4cc19cdd082aa07db2f6fd1c5fbc2b674a74a63 (diff)
parent0352ff102d62ee94e79e0baaf64d5ad4e66f907b (diff)
Merge commit '0352ff102d62ee94e79e0baaf64d5ad4e66f907b'
* commit '0352ff102d62ee94e79e0baaf64d5ad4e66f907b': ffv1: const correctness for encode_rgb_frame() Conflicts: libavcodec/ffv1enc.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/ffv1enc.c')
-rw-r--r--libavcodec/ffv1enc.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/libavcodec/ffv1enc.c b/libavcodec/ffv1enc.c
index cf2a13dc6b..4b16a168db 100644
--- a/libavcodec/ffv1enc.c
+++ b/libavcodec/ffv1enc.c
@@ -405,7 +405,8 @@ static int encode_plane(FFV1Context *s, uint8_t *src, int w, int h,
return 0;
}
-static int encode_rgb_frame(FFV1Context *s, uint8_t *src[3], int w, int h, const int stride[3])
+static int encode_rgb_frame(FFV1Context *s, const uint8_t *src[3],
+ int w, int h, const int stride[3])
{
int x, y, p, i;
const int ring_size = s->avctx->context_model ? 3 : 2;
@@ -427,15 +428,15 @@ static int encode_rgb_frame(FFV1Context *s, uint8_t *src[3], int w, int h, const
for (x = 0; x < w; x++) {
int b, g, r, av_uninit(a);
if (lbd) {
- unsigned v = *((uint32_t*)(src[0] + x*4 + stride[0]*y));
+ unsigned v = *((const uint32_t*)(src[0] + x*4 + stride[0]*y));
b = v & 0xFF;
g = (v >> 8) & 0xFF;
r = (v >> 16) & 0xFF;
a = v >> 24;
} else {
- b = *((uint16_t*)(src[0] + x*2 + stride[0]*y));
- g = *((uint16_t*)(src[1] + x*2 + stride[1]*y));
- r = *((uint16_t*)(src[2] + x*2 + stride[2]*y));
+ b = *((const uint16_t *)(src[0] + x*2 + stride[0]*y));
+ g = *((const uint16_t *)(src[1] + x*2 + stride[1]*y));
+ r = *((const uint16_t *)(src[2] + x*2 + stride[2]*y));
}
if (s->slice_coding_mode != 1) {
@@ -1110,9 +1111,9 @@ static int encode_slice(AVCodecContext *c, void *arg)
const int ps = av_pix_fmt_desc_get(c->pix_fmt)->comp[0].step_minus1 + 1;
int ret;
RangeCoder c_bak = fs->c;
- uint8_t *planes[3] = {p->data[0] + ps*x + y*p->linesize[0],
- p->data[1] + ps*x + y*p->linesize[1],
- p->data[2] + ps*x + y*p->linesize[2]};
+ const uint8_t *planes[3] = {p->data[0] + ps*x + y*p->linesize[0],
+ p->data[1] + ps*x + y*p->linesize[1],
+ p->data[2] + ps*x + y*p->linesize[2]};
fs->slice_coding_mode = 0;
if (f->version > 3) {