aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-12-10 06:39:57 +0100
committerMichael Niedermayer <michaelni@gmx.at>2011-12-10 06:39:57 +0100
commit02ce07f8c479f68f3fe2af142ee9af98ff005f67 (patch)
treec295b0be234201ab7e1953c7502c6638edde5d18
parent02acfb1c01135542540045a8fb5b7dc16377476c (diff)
downloadffmpeg-02ce07f8c479f68f3fe2af142ee9af98ff005f67.tar.gz
amvenc: support videos with heights that are not a multiple of 16.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/mpegvideo_enc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index 7195e200e4..16139ec51f 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -903,6 +903,10 @@ static int load_input_picture(MpegEncContext *s, AVFrame *pic_arg){
uint8_t *src= pic_arg->data[i];
uint8_t *dst= pic->data[i];
+ if(s->codec_id == 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;
@@ -1558,7 +1562,7 @@ static av_always_inline void encode_mb_internal(MpegEncContext *s, int motion_x,
ptr_cb = s->new_picture.f.data[1] + (mb_y * mb_block_height * wrap_c) + mb_x * 8;
ptr_cr = s->new_picture.f.data[2] + (mb_y * mb_block_height * wrap_c) + mb_x * 8;
- if(mb_x*16+16 > s->width || mb_y*16+16 > s->height){
+ if((mb_x*16+16 > s->width || mb_y*16+16 > s->height) && s->codec_id != CODEC_ID_AMV){
uint8_t *ebuf= s->edge_emu_buffer + 32;
s->dsp.emulated_edge_mc(ebuf , ptr_y , wrap_y,16,16,mb_x*16,mb_y*16, s->width , s->height);
ptr_y= ebuf;