diff mpegvideo.c @ 1370:45d761c387cd libavcodec

default for slices is display order again optional support for field slices & slices in coded order and single component slices for svq1 (unfinished)
author michaelni
date Sun, 20 Jul 2003 14:48:05 +0000
parents 8a150a66d2d9
children b47a402bbe7f
line wrap: on
line diff
--- a/mpegvideo.c	Fri Jul 18 11:47:14 2003 +0000
+++ b/mpegvideo.c	Sun Jul 20 14:48:05 2003 +0000
@@ -2726,10 +2726,25 @@
  */
 void ff_draw_horiz_band(MpegEncContext *s, int y, int h){
     if (s->avctx->draw_horiz_band) {
+        AVFrame *src;
         uint8_t *src_ptr[3];
         int offset[4];
+        
+        if(s->picture_structure != PICT_FRAME){
+            h <<= 1;
+            y <<= 1;
+            if(s->first_field  && !(s->avctx->slice_flags&SLICE_FLAG_ALLOW_FIELD)) return;
+        }
+
         h= FFMIN(h, s->height - y);
 
+        if(s->pict_type==B_TYPE || s->low_delay || (s->avctx->slice_flags&SLICE_FLAG_CODED_ORDER)) 
+            src= (AVFrame*)s->current_picture_ptr;
+        else if(s->last_picture_ptr)
+            src= (AVFrame*)s->last_picture_ptr;
+        else
+            return;
+            
         if(s->pict_type==B_TYPE && s->picture_structure == PICT_FRAME && s->out_format != FMT_H264){
             offset[0]=
             offset[1]=
@@ -2744,8 +2759,8 @@
 
         emms_c();
 
-        s->avctx->draw_horiz_band(s->avctx, (AVFrame*)s->current_picture_ptr, offset,
-                               y, s->width, h);
+        s->avctx->draw_horiz_band(s->avctx, src, offset,
+                                  y, s->picture_structure, h);
     }
 }