diff --git a/libavcodec/mjpegenc.c b/libavcodec/mjpegenc.c index e33e75fbc8..7a87f24271 100644 --- a/libavcodec/mjpegenc.c +++ b/libavcodec/mjpegenc.c @@ -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); diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index f27ef7bc74..9f36c8f3b7 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -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;