aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-06-13 20:59:24 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-06-13 20:59:24 +0200
commit043bcdcdb00ebcbae80d7a9f78b763b33b9f0d15 (patch)
tree102944b3e0bac255795c6ae47a2c741cf8391317
parent1df441eaa81b7ceaafa4c896a08cbe93a81a75fa (diff)
downloadffmpeg-043bcdcdb00ebcbae80d7a9f78b763b33b9f0d15.tar.gz
avcodec/svq1enc: fix encoding of small widths
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/svq1enc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/svq1enc.c b/libavcodec/svq1enc.c
index 7631f053da..26e7aeaa9c 100644
--- a/libavcodec/svq1enc.c
+++ b/libavcodec/svq1enc.c
@@ -252,7 +252,7 @@ static int svq1_encode_plane(SVQ1EncContext *s, int plane,
int block_width, block_height;
int level;
int threshold[6];
- uint8_t *src = s->scratchbuf + stride * 16;
+ uint8_t *src = s->scratchbuf + stride * 32;
const int lambda = (f->quality * f->quality) >>
(2 * FF_LAMBDA_SHIFT);
@@ -427,12 +427,12 @@ static int svq1_encode_plane(SVQ1EncContext *s, int plane,
dxy = (mx & 1) + 2 * (my & 1);
- s->hdsp.put_pixels_tab[0][dxy](temp + 16,
+ s->hdsp.put_pixels_tab[0][dxy](temp + 16*stride,
ref + (mx >> 1) +
stride * (my >> 1),
stride, 16);
- score[1] += encode_block(s, src + 16 * x, temp + 16,
+ score[1] += encode_block(s, src + 16 * x, temp + 16*stride,
decoded, stride, 5, 64, lambda, 0);
best = score[1] <= score[0];
@@ -586,7 +586,7 @@ static int svq1_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
(ret = ff_get_buffer(avctx, s->last_picture, 0)) < 0) {
return ret;
}
- s->scratchbuf = av_malloc(s->current_picture->linesize[0] * 16 * 2);
+ s->scratchbuf = av_malloc(s->current_picture->linesize[0] * 16 * 3);
}
FFSWAP(AVFrame*, s->current_picture, s->last_picture);