[FFmpeg-cvslog] avcodec/mpegvideo: dont overwrite emu_edge buffer
Michael Niedermayer
git at videolan.org
Sat Jun 28 07:20:11 CEST 2014
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Jun 28 06:28:21 2014 +0200| [504475f38ef049996c2c7954de00e92668a05de5] | committer: Michael Niedermayer
avcodec/mpegvideo: dont overwrite emu_edge buffer
Fixes vsynth3 fate failures on mips
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=504475f38ef049996c2c7954de00e92668a05de5
---
libavcodec/mpegvideo.c | 3 ++-
libavcodec/mpegvideo_enc.c | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index 4d1a70f..ef8905a 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -450,7 +450,8 @@ static int frame_size_alloc(MpegEncContext *s, int linesize)
// VC1 computes luma and chroma simultaneously and needs 19X19 + 9x9
// at uvlinesize. It supports only YUV420 so 24x24 is enough
// linesize * interlaced * MBsize
- FF_ALLOCZ_OR_GOTO(s->avctx, s->edge_emu_buffer, alloc_size * 4 * 24,
+ // we also use this buffer for encoding in encode_mb_internal() needig an additional 32 lines
+ FF_ALLOCZ_OR_GOTO(s->avctx, s->edge_emu_buffer, alloc_size * 4 * 68,
fail);
FF_ALLOCZ_OR_GOTO(s->avctx, s->me.scratchpad, alloc_size * 4 * 16 * 2,
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index 925721a..b8a243f 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -2024,7 +2024,7 @@ static av_always_inline void encode_mb_internal(MpegEncContext *s,
(mb_y * mb_block_height * wrap_c) + mb_x * mb_block_width;
if((mb_x * 16 + 16 > s->width || mb_y * 16 + 16 > s->height) && s->codec_id != AV_CODEC_ID_AMV){
- uint8_t *ebuf = s->edge_emu_buffer + 32;
+ uint8_t *ebuf = s->edge_emu_buffer + 36 * wrap_y;
int cw = (s->width + s->chroma_x_shift) >> s->chroma_x_shift;
int ch = (s->height + s->chroma_y_shift) >> s->chroma_y_shift;
s->vdsp.emulated_edge_mc(ebuf, ptr_y,
More information about the ffmpeg-cvslog
mailing list