提交 6d695d7a 编写于 作者: R Reimar Döffinger 提交者: Michael Niedermayer

Fix nonsense non-mod16 AMV flipping code.

It is obviously nonsense since it produces wrong results
or even crashes (crashes should be encode-only though).
Fixes trac issue #1092.
Signed-off-by: NReimar Döffinger <Reimar.Doeffinger@gmx.de>
Signed-off-by: NMichael Niedermayer <michaelni@gmx.at>
上级 527f5cbf
......@@ -552,7 +552,7 @@ static int amv_encode_picture(AVCodecContext *avctx, AVPacket *pkt,
//picture should be flipped upside-down
for(i=0; i < 3; i++) {
int vsample = i ? 2 >> chroma_v_shift : 2;
pic->data[i] += (pic->linesize[i] * (vsample * (8 * s->mb_height -((s->height/V_MAX)&7)) - 1 ));
pic->data[i] += pic->linesize[i] * (vsample * s->height / V_MAX - 1);
pic->linesize[i] *= -1;
}
ret = ff_MPV_encode_picture(avctx, pkt, pic, got_packet);
......
......@@ -1110,10 +1110,6 @@ static int load_input_picture(MpegEncContext *s, const AVFrame *pic_arg)
uint8_t *src = pic_arg->data[i];
uint8_t *dst = pic->f->data[i];
if (s->codec_id == AV_CODEC_ID_AMV && !(s->avctx->flags & CODEC_FLAG_EMU_EDGE)) {
h = ((s->height + 15)/16*16) >> v_shift;
}
if (!s->avctx->rc_buffer_size)
dst += INPLACE_OFFSET;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册