changeset 2019:7de4eceac32f

mpeg2-interlaced patch by Ivan Kalvatchev <iive@yahoo.com>
author arpi
date Sat, 29 Sep 2001 21:40:24 +0000
parents dd0499b304dc
children dc21c5f373c4
files dec_video.c libmpeg2/decode.c
diffstat 2 files changed, 26 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/dec_video.c	Sat Sep 29 20:34:52 2001 +0000
+++ b/dec_video.c	Sat Sep 29 21:40:24 2001 +0000
@@ -556,8 +556,10 @@
 	blit_frame=2;
     } else {
 	// software decoding:
-	mpeg2_decode_data(video_out, start, start+in_size,drop_frame); // decode
-	if(!drop_frame) blit_frame=1;
+	if(
+	mpeg2_decode_data(video_out, start, start+in_size,drop_frame) > 0 // decode
+	&& (!drop_frame)
+	   ) blit_frame=1;
     }
     break;
   case VFM_RAW:
--- a/libmpeg2/decode.c	Sat Sep 29 20:34:52 2001 +0000
+++ b/libmpeg2/decode.c	Sat Sep 29 21:40:24 2001 +0000
@@ -182,12 +182,10 @@
         
 //        if(picture->picture_structure != FRAME_PICTURE) printf("Field! %d  \n",picture->second_field);
         
-	if(!framedrop)
-	if (((picture->picture_structure == FRAME_PICTURE) ||
-		 (picture->second_field))
-           ) {
+	    if(picture->picture_structure == FRAME_PICTURE) 
+	    {
 #ifdef MPEG12_POSTPROC
-	       if(picture->pp_options){
+	       if( (picture->pp_options) && (!framedrop) ){
                     // apply OpenDivX postprocess filter
             	    int stride[3];
             	    stride[0]=picture->coded_picture_width;
@@ -201,20 +199,23 @@
 		    output->draw_slice (frames[3].base, stride, 
                         picture->display_picture_width,
                         picture->display_picture_height, 0, 0);
-	       }// else
-#endif
-#if 0
-		if (picture->picture_coding_type != B_TYPE) {
+	       } 
+#endif	    
+	    }else{
+	       if( (picture->second_field) && (!framedrop) )
+	       {
             	    int stride[3];
             	    stride[0]=picture->coded_picture_width;
             	    stride[1]=stride[2]=stride[0]/2;
-		    output->draw_slice (picture->forward_reference_frame->base,
+		    output->draw_slice ((picture->picture_coding_type == B_TYPE) ?
+			    picture->current_frame->base :
+			    picture->forward_reference_frame->base,
 			stride, 
                         picture->display_picture_width,
                         picture->display_picture_height, 0, 0);
-                }
-#endif
-	}
+                }else
+		is_frame_done=0;// we don't draw top fields
+    	    }
 #ifdef ARCH_X86
 	if (config.flags & MM_ACCEL_X86_MMX) emms();
 #endif
@@ -273,14 +274,16 @@
 		}
 	    }
 
-#if 1
 #ifdef MPEG12_POSTPROC
-	            if(picture->pp_options)
-			picture->current_frame->copy=NULL; else
+            if(picture->pp_options)
+		picture->current_frame->copy=NULL; 
+	    else
 #endif
-		    picture->current_frame->copy=copy_slice;
-#endif
-	    if(framedrop) picture->current_frame->copy=NULL;
+	    picture->current_frame->copy=copy_slice;
+
+
+	    if ((framedrop) || (picture->picture_structure != FRAME_PICTURE) )
+		picture->current_frame->copy=NULL;
 	    picture->current_frame->vo=output;
 	    picture->slice=0;