1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

Merge commit '0352ff102d62ee94e79e0baaf64d5ad4e66f907b'

* commit '0352ff102d62ee94e79e0baaf64d5ad4e66f907b':
  ffv1: const correctness for encode_rgb_frame()

Conflicts:
	libavcodec/ffv1enc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2015-01-06 22:03:57 +01:00
commit 3b3782d74e

View File

@ -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) {