diff libmpcodecs/vf.c @ 14715:1fab95e4513c

Improved NV12/NV21 support. - Fixed PlanarToNV12Wrapper() and made it handle NV21. - Added yuv2nv12XinC() to handle software scaling. - Added NV12/NV21 handling to various places. - Removed NV12 from vf_hue and vf_spp as they don't look like they can actually handle it.
author syrjala
date Wed, 16 Feb 2005 23:47:00 +0000
parents c9ff4fe2caaf
children 5723c4b2a2ea
line wrap: on
line diff
--- a/libmpcodecs/vf.c	Wed Feb 16 20:32:26 2005 +0000
+++ b/libmpcodecs/vf.c	Wed Feb 16 23:47:00 2005 +0000
@@ -356,6 +356,7 @@
 	      //if(!mpi->stride[0]) 
 	      mpi->stride[0]=mpi->width;
 	      //if(!mpi->stride[1]) 
+	      if(mpi->num_planes > 2){
 	      mpi->stride[1]=mpi->stride[2]=mpi->chroma_width;
 	      if(mpi->flags&MP_IMGFLAG_SWAPPED){
 	          // I420/IYUV  (Y,U,V)
@@ -366,6 +367,11 @@
 	          mpi->planes[2]=mpi->planes[0]+mpi->width*mpi->height;
 	          mpi->planes[1]=mpi->planes[2]+mpi->chroma_width*mpi->chroma_height;
 	      }
+	      } else {
+	          // NV12/NV21
+	          mpi->stride[1]=mpi->chroma_width;
+	          mpi->planes[1]=mpi->planes[0]+mpi->width*mpi->height;
+	      }
 	  } else {
 	      //if(!mpi->stride[0]) 
 	      mpi->stride[0]=mpi->width*mpi->bpp/8;