diff h263dec.c @ 553:18ad513d92fe libavcodec

direct rendering method 1 support
author michaelni
date Sun, 14 Jul 2002 18:37:35 +0000
parents 8f8f4885d874
children 762c67fd4078
line wrap: on
line diff
--- a/h263dec.c	Sun Jul 14 18:36:24 2002 +0000
+++ b/h263dec.c	Sun Jul 14 18:37:35 2002 +0000
@@ -89,7 +89,7 @@
     }
     s->codec_id= avctx->codec->id;
     avctx->mbskip_table= s->mbskip_table;
-    
+
     /* for h263, we allocate the images after having read the header */
     if (avctx->codec->id != CODEC_ID_H263 && avctx->codec->id != CODEC_ID_MPEG4)
         if (MPV_common_init(s) < 0)
@@ -155,21 +155,22 @@
         ret = h263_decode_picture_header(s);
     }
 
+       
         /* After H263 & mpeg4 header decode we have the height, width,*/
         /* and other parameters. So then we could init the picture   */
         /* FIXME: By the way H263 decoder is evolving it should have */
         /* an H263EncContext                                         */
+    if (s->width != avctx->width || s->height != avctx->height) {
+        /* H.263 could change picture size any time */
+        MPV_common_end(s);
+        s->context_initialized=0;
+    }
     if (!s->context_initialized) {
         avctx->width = s->width;
         avctx->height = s->height;
         avctx->aspect_ratio_info= s->aspect_ratio_info;
         if (MPV_common_init(s) < 0)
             return -1;
-    } else if (s->width != avctx->width || s->height != avctx->height) {
-        /* H.263 could change picture size any time */
-        MPV_common_end(s);
-        if (MPV_common_init(s) < 0)
-            return -1;
     }
 
     if(ret==FRAME_SKIPED) return buf_size;
@@ -190,7 +191,7 @@
             s->next_p_frame_damaged=0;
     }
 
-    MPV_frame_start(s);
+    MPV_frame_start(s, avctx);
 
 #ifdef DEBUG
     printf("qscale=%d\n", s->qscale);
@@ -459,7 +460,7 @@
     NULL,
     h263_decode_end,
     h263_decode_frame,
-    CODEC_CAP_DRAW_HORIZ_BAND,
+    CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
 };
 
 AVCodec h263_decoder = {
@@ -471,7 +472,7 @@
     NULL,
     h263_decode_end,
     h263_decode_frame,
-    CODEC_CAP_DRAW_HORIZ_BAND,
+    CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
 };
 
 AVCodec msmpeg4v1_decoder = {
@@ -483,7 +484,7 @@
     NULL,
     h263_decode_end,
     h263_decode_frame,
-    CODEC_CAP_DRAW_HORIZ_BAND,
+    CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
 };
 
 AVCodec msmpeg4v2_decoder = {
@@ -495,7 +496,7 @@
     NULL,
     h263_decode_end,
     h263_decode_frame,
-    CODEC_CAP_DRAW_HORIZ_BAND,
+    CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
 };
 
 AVCodec msmpeg4v3_decoder = {
@@ -507,7 +508,7 @@
     NULL,
     h263_decode_end,
     h263_decode_frame,
-    CODEC_CAP_DRAW_HORIZ_BAND,
+    CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
 };
 
 AVCodec wmv1_decoder = {
@@ -519,7 +520,7 @@
     NULL,
     h263_decode_end,
     h263_decode_frame,
-    CODEC_CAP_DRAW_HORIZ_BAND,
+    CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
 };
 
 AVCodec wmv2_decoder = {
@@ -531,7 +532,7 @@
     NULL,
     h263_decode_end,
     h263_decode_frame,
-    CODEC_CAP_DRAW_HORIZ_BAND,
+    CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
 };
 
 AVCodec h263i_decoder = {
@@ -543,6 +544,6 @@
     NULL,
     h263_decode_end,
     h263_decode_frame,
-    CODEC_CAP_DRAW_HORIZ_BAND,
+    CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
 };