diff mpegvideo.c @ 1098:b7f267d168b7 libavcodec

mpeg2 field pictures + sliced mode (doesnt work with mplayer though, dunno why)
author michaelni
date Wed, 05 Mar 2003 20:03:15 +0000
parents 5e6e505d8997
children 988b180afd31
line wrap: on
line diff
--- a/mpegvideo.c	Wed Mar 05 17:53:33 2003 +0000
+++ b/mpegvideo.c	Wed Mar 05 20:03:15 2003 +0000
@@ -2051,7 +2051,7 @@
         }else
             s->mb_skiped= 0;
 
-        if(s->pict_type==B_TYPE && s->avctx->draw_horiz_band){
+        if(s->pict_type==B_TYPE && s->avctx->draw_horiz_band && s->picture_structure==PICT_FRAME){ //FIXME precalc
             dest_y  = s->current_picture.data[0] + mb_x * 16;
             dest_cb = s->current_picture.data[1] + mb_x * 8;
             dest_cr = s->current_picture.data[2] + mb_x * 8;
@@ -2356,17 +2356,18 @@
 
 #endif //CONFIG_ENCODERS
 
-void ff_draw_horiz_band(MpegEncContext *s){
+/**
+ *
+ * @param h is the normal height, this will be reduced automatically if needed for the last row
+ */
+void ff_draw_horiz_band(MpegEncContext *s, int y, int h){
     if (    s->avctx->draw_horiz_band 
         && (s->last_picture.data[0] || s->low_delay) ) {
         uint8_t *src_ptr[3];
-        int y, h, offset;
-        y = s->mb_y * 16;
-        h = s->height - y;
-        if (h > 16)
-            h = 16;
-
-        if(s->pict_type==B_TYPE)
+        int offset;
+        h= FFMIN(h, s->height - y);
+
+        if(s->pict_type==B_TYPE && s->picture_structure == PICT_FRAME)
             offset = 0;
         else
             offset = y * s->linesize;