comparison 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
comparison
equal deleted inserted replaced
14714:c840f4309043 14715:1fab95e4513c
354 if(mpi->flags&MP_IMGFLAG_PLANAR){ 354 if(mpi->flags&MP_IMGFLAG_PLANAR){
355 // YV12/I420/YVU9/IF09. feel free to add other planar formats here... 355 // YV12/I420/YVU9/IF09. feel free to add other planar formats here...
356 //if(!mpi->stride[0]) 356 //if(!mpi->stride[0])
357 mpi->stride[0]=mpi->width; 357 mpi->stride[0]=mpi->width;
358 //if(!mpi->stride[1]) 358 //if(!mpi->stride[1])
359 if(mpi->num_planes > 2){
359 mpi->stride[1]=mpi->stride[2]=mpi->chroma_width; 360 mpi->stride[1]=mpi->stride[2]=mpi->chroma_width;
360 if(mpi->flags&MP_IMGFLAG_SWAPPED){ 361 if(mpi->flags&MP_IMGFLAG_SWAPPED){
361 // I420/IYUV (Y,U,V) 362 // I420/IYUV (Y,U,V)
362 mpi->planes[1]=mpi->planes[0]+mpi->width*mpi->height; 363 mpi->planes[1]=mpi->planes[0]+mpi->width*mpi->height;
363 mpi->planes[2]=mpi->planes[1]+mpi->chroma_width*mpi->chroma_height; 364 mpi->planes[2]=mpi->planes[1]+mpi->chroma_width*mpi->chroma_height;
364 } else { 365 } else {
365 // YV12,YVU9,IF09 (Y,V,U) 366 // YV12,YVU9,IF09 (Y,V,U)
366 mpi->planes[2]=mpi->planes[0]+mpi->width*mpi->height; 367 mpi->planes[2]=mpi->planes[0]+mpi->width*mpi->height;
367 mpi->planes[1]=mpi->planes[2]+mpi->chroma_width*mpi->chroma_height; 368 mpi->planes[1]=mpi->planes[2]+mpi->chroma_width*mpi->chroma_height;
369 }
370 } else {
371 // NV12/NV21
372 mpi->stride[1]=mpi->chroma_width;
373 mpi->planes[1]=mpi->planes[0]+mpi->width*mpi->height;
368 } 374 }
369 } else { 375 } else {
370 //if(!mpi->stride[0]) 376 //if(!mpi->stride[0])
371 mpi->stride[0]=mpi->width*mpi->bpp/8; 377 mpi->stride[0]=mpi->width*mpi->bpp/8;
372 } 378 }