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

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: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Reimar Döffinger 2012-04-28 23:37:08 +02:00 committed by Michael Niedermayer
parent 527f5cbf64
commit 6d695d7acc
2 changed files with 1 additions and 5 deletions

View File

@ -552,7 +552,7 @@ static int amv_encode_picture(AVCodecContext *avctx, AVPacket *pkt,
//picture should be flipped upside-down //picture should be flipped upside-down
for(i=0; i < 3; i++) { for(i=0; i < 3; i++) {
int vsample = i ? 2 >> chroma_v_shift : 2; 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; pic->linesize[i] *= -1;
} }
ret = ff_MPV_encode_picture(avctx, pkt, pic, got_packet); ret = ff_MPV_encode_picture(avctx, pkt, pic, got_packet);

View File

@ -1110,10 +1110,6 @@ static int load_input_picture(MpegEncContext *s, const AVFrame *pic_arg)
uint8_t *src = pic_arg->data[i]; uint8_t *src = pic_arg->data[i];
uint8_t *dst = pic->f->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) if (!s->avctx->rc_buffer_size)
dst += INPLACE_OFFSET; dst += INPLACE_OFFSET;