negative linesize support (so mplayer -flip works)
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 5 Jan 2003 17:59:26 +0000 (17:59 +0000)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 5 Jan 2003 17:59:26 +0000 (17:59 +0000)
Originally committed as revision 1395 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavcodec/mpegvideo.c
libavcodec/mpegvideo.h

index ce3c435044f1f30b7e55aa512f06885e9580e701..8206df470ee3a959b97a2c9e7b3ec603e0b6a675 100644 (file)
@@ -382,7 +382,8 @@ int MPV_common_init(MpegEncContext *s)
                      + (toupper((s->avctx->fourcc>>16)&0xFF)<<16) 
                      + (toupper((s->avctx->fourcc>>24)&0xFF)<<24);
 
-    CHECKED_ALLOCZ(s->edge_emu_buffer, (s->width+64)*2*17*2); //(width + edge + align)*interlaced*MBsize*tolerance
+    CHECKED_ALLOCZ(s->allocated_edge_emu_buffer, (s->width+64)*2*17*2); //(width + edge + align)*interlaced*MBsize*tolerance
+    s->edge_emu_buffer= s->allocated_edge_emu_buffer + (s->width+64)*2*17;
 
     s->avctx->coded_frame= (AVFrame*)&s->current_picture;
 
@@ -513,7 +514,7 @@ void MPV_common_end(MpegEncContext *s)
     av_freep(&s->bitstream_buffer);
     av_freep(&s->tex_pb_buffer);
     av_freep(&s->pb2_buffer);
-    av_freep(&s->edge_emu_buffer);
+    av_freep(&s->allocated_edge_emu_buffer); s->edge_emu_buffer= NULL;
     av_freep(&s->co_located_type_table);
     av_freep(&s->field_mv_table);
     av_freep(&s->field_select_table);
index 6d794d8626ddb844ec85e14732af45135c135cb4..e6909817aa7d29c6bf057f0e8cb9bcee60fa344d 100644 (file)
@@ -232,7 +232,8 @@ typedef struct MpegEncContext {
     UINT8 *mbintra_table;       /* used to avoid setting {ac, dc, cbp}-pred stuff to zero on inter MB decoding */
     UINT8 *cbp_table;           /* used to store cbp, ac_pred for partitioned decoding */
     UINT8 *pred_dir_table;      /* used to store pred_dir for partitioned decoding */
-    UINT8 *edge_emu_buffer;
+    uint8_t *allocated_edge_emu_buffer;
+    uint8_t *edge_emu_buffer;     /* points into the middle of allocated_edge_emu_buffer */ 
 
     int qscale;                 /* QP */
     float frame_qscale;         /* qscale from the frame level rc FIXME remove*/