Browse Source

avcodec/mpegvideo: dont overwrite emu_edge buffer

Fixes vsynth3 fate failures on mips

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n2.3
Michael Niedermayer 11 years ago
parent
commit
504475f38e
2 changed files with 3 additions and 2 deletions
  1. +2
    -1
      libavcodec/mpegvideo.c
  2. +1
    -1
      libavcodec/mpegvideo_enc.c

+ 2
- 1
libavcodec/mpegvideo.c View File

@@ -450,7 +450,8 @@ static int frame_size_alloc(MpegEncContext *s, int linesize)
// VC1 computes luma and chroma simultaneously and needs 19X19 + 9x9 // VC1 computes luma and chroma simultaneously and needs 19X19 + 9x9
// at uvlinesize. It supports only YUV420 so 24x24 is enough // at uvlinesize. It supports only YUV420 so 24x24 is enough
// linesize * interlaced * MBsize // 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); fail);


FF_ALLOCZ_OR_GOTO(s->avctx, s->me.scratchpad, alloc_size * 4 * 16 * 2, FF_ALLOCZ_OR_GOTO(s->avctx, s->me.scratchpad, alloc_size * 4 * 16 * 2,


+ 1
- 1
libavcodec/mpegvideo_enc.c View File

@@ -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; (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){ 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 cw = (s->width + s->chroma_x_shift) >> s->chroma_x_shift;
int ch = (s->height + s->chroma_y_shift) >> s->chroma_y_shift; int ch = (s->height + s->chroma_y_shift) >> s->chroma_y_shift;
s->vdsp.emulated_edge_mc(ebuf, ptr_y, s->vdsp.emulated_edge_mc(ebuf, ptr_y,


Loading…
Cancel
Save