changeset 7957:31fd09cc9ba2

passing picture_type (might be usefull for postprocessing)
author michael
date Tue, 29 Oct 2002 11:26:26 +0000
parents 2d04cdfd7186
children 2a5def1e08d7
files libmpcodecs/mp_image.h libmpcodecs/vd_ffmpeg.c libmpcodecs/vd_libmpeg2.c
diffstat 3 files changed, 23 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/mp_image.h	Tue Oct 29 11:21:43 2002 +0000
+++ b/libmpcodecs/mp_image.h	Tue Oct 29 11:26:26 2002 +0000
@@ -75,6 +75,7 @@
     unsigned int stride[MP_MAX_PLANES];
     int* qscale;
     int qstride;
+    int pict_type; // 0->unknown, 1->I, 2->P, 3->B
     int num_planes;
     /* these are only used by planar formats Y,U(Cb),V(Cr) */
     int chroma_width;
--- a/libmpcodecs/vd_ffmpeg.c	Tue Oct 29 11:21:43 2002 +0000
+++ b/libmpcodecs/vd_ffmpeg.c	Tue Oct 29 11:26:26 2002 +0000
@@ -630,6 +630,17 @@
     mpi->qscale=&quant_store[0][0];
     mpi->qstride=MBC+1;
 #endif
+
+    {
+        static int last_non_b_type= 0;
+
+	if(avctx->pict_type == B_TYPE)
+	    mpi->pict_type= B_TYPE;
+	else{
+	    mpi->pict_type= last_non_b_type;
+	    last_non_b_type= avctx->pict_type;
+	}
+    }
     
     return mpi;
 }
--- a/libmpcodecs/vd_libmpeg2.c	Tue Oct 29 11:21:43 2002 +0000
+++ b/libmpcodecs/vd_libmpeg2.c	Tue Oct 29 11:26:26 2002 +0000
@@ -290,5 +290,16 @@
 	if(ret) mpi=ret;
 //    }
 
+    if(mpi){
+        static int last_non_b_type= 0;
+
+	if(picture->picture_coding_type == B_TYPE)
+	    mpi->pict_type= B_TYPE;
+	else{
+	    mpi->pict_type= last_non_b_type;
+	    last_non_b_type= picture->picture_coding_type;
+	}
+    }
+
     return mpi;
 }