# HG changeset patch # User michael # Date 1066766131 0 # Node ID 26c6ecba99a16c4baea20c571b4f9a36130e8cb5 # Parent 85028cd13cf1d8b86cefa90a190c2a2624fbd805 dynamic alloc of picture structs instead of putting them in MpegEncContext diff -r 85028cd13cf1 -r 26c6ecba99a1 mpegvideo.c --- a/mpegvideo.c Tue Oct 21 01:00:31 2003 +0000 +++ b/mpegvideo.c Tue Oct 21 19:55:31 2003 +0000 @@ -444,6 +444,8 @@ CHECKED_ALLOCZ(s->lambda_table, mb_array_size * sizeof(int)) } + CHECKED_ALLOCZ(s->picture, MAX_PICTURE_COUNT * sizeof(Picture)) + CHECKED_ALLOCZ(s->error_status_table, mb_array_size*sizeof(uint8_t)) if (s->out_format == FMT_H263 || s->encoding) { @@ -562,6 +564,7 @@ for(i=0; ipicture[i]); } + av_freep(&s->picture); avcodec_default_free_buffers(s->avctx); s->context_initialized = 0; s->last_picture_ptr= diff -r 85028cd13cf1 -r 26c6ecba99a1 mpegvideo.h --- a/mpegvideo.h Tue Oct 21 01:00:31 2003 +0000 +++ b/mpegvideo.h Tue Oct 21 19:55:31 2003 +0000 @@ -301,7 +301,7 @@ int mb_num; ///< number of MBs of a picture int linesize; ///< line size, in bytes, may be different from width int uvlinesize; ///< line size, for chroma in bytes, may be different from width - Picture picture[MAX_PICTURE_COUNT]; ///< main picture buffer + Picture *picture; ///< main picture buffer Picture *input_picture[MAX_PICTURE_COUNT]; ///< next pictures on display order for encoding Picture *reordered_input_picture[MAX_PICTURE_COUNT]; ///< pointer to the next pictures in codedorder for encoding