diff options
author | syrjala <syrjala@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2005-02-16 23:47:00 +0000 |
---|---|---|
committer | syrjala <syrjala@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2005-02-16 23:47:00 +0000 |
commit | c260a1139d5990a9cdcf0d678a7e6c99978b98c1 (patch) | |
tree | a0407fc7df675be723f5149c17de76a22d72d4b5 /libmpcodecs | |
parent | 078b83809052f0ef6b5d46f0fc572f7a5ef3d5ee (diff) | |
download | mpv-c260a1139d5990a9cdcf0d678a7e6c99978b98c1.tar.bz2 mpv-c260a1139d5990a9cdcf0d678a7e6c99978b98c1.tar.xz |
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.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@14716 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs')
-rw-r--r-- | libmpcodecs/vf.c | 6 | ||||
-rw-r--r-- | libmpcodecs/vf_eq.c | 1 | ||||
-rw-r--r-- | libmpcodecs/vf_hue.c | 1 | ||||
-rw-r--r-- | libmpcodecs/vf_scale.c | 4 | ||||
-rw-r--r-- | libmpcodecs/vf_spp.c | 2 |
5 files changed, 11 insertions, 3 deletions
diff --git a/libmpcodecs/vf.c b/libmpcodecs/vf.c index bd591163d6..0bebfcc49e 100644 --- a/libmpcodecs/vf.c +++ b/libmpcodecs/vf.c @@ -356,6 +356,7 @@ mp_image_t* vf_get_image(vf_instance_t* vf, unsigned int outfmt, int mp_imgtype, //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 @@ mp_image_t* vf_get_image(vf_instance_t* vf, unsigned int outfmt, int mp_imgtype, 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; diff --git a/libmpcodecs/vf_eq.c b/libmpcodecs/vf_eq.c index d7adeea1ff..5b27e5250c 100644 --- a/libmpcodecs/vf_eq.c +++ b/libmpcodecs/vf_eq.c @@ -188,6 +188,7 @@ static int query_format(struct vf_instance_s* vf, unsigned int fmt) case IMGFMT_Y800: case IMGFMT_Y8: case IMGFMT_NV12: + case IMGFMT_NV21: case IMGFMT_444P: case IMGFMT_422P: case IMGFMT_411P: diff --git a/libmpcodecs/vf_hue.c b/libmpcodecs/vf_hue.c index b7952d9536..f1e8b4d642 100644 --- a/libmpcodecs/vf_hue.c +++ b/libmpcodecs/vf_hue.c @@ -130,7 +130,6 @@ static int query_format(struct vf_instance_s* vf, unsigned int fmt) case IMGFMT_I420: case IMGFMT_IYUV: case IMGFMT_CLPL: - case IMGFMT_NV12: case IMGFMT_444P: case IMGFMT_422P: case IMGFMT_411P: diff --git a/libmpcodecs/vf_scale.c b/libmpcodecs/vf_scale.c index 17416bb14b..98d1ba89f7 100644 --- a/libmpcodecs/vf_scale.c +++ b/libmpcodecs/vf_scale.c @@ -56,6 +56,8 @@ static unsigned int outfmt_list[]={ IMGFMT_YVU9, IMGFMT_IF09, IMGFMT_411P, + IMGFMT_NV12, + IMGFMT_NV21, IMGFMT_YUY2, IMGFMT_UYVY, // RGB and grayscale (Y8 and Y800): @@ -175,6 +177,8 @@ static int config(struct vf_instance_s* vf, case IMGFMT_YV12: /* YV12 needs w & h rounded to 2 */ case IMGFMT_I420: case IMGFMT_IYUV: + case IMGFMT_NV12: + case IMGFMT_NV21: vf->priv->h = (vf->priv->h + 1) & ~1; case IMGFMT_YUY2: /* YUY2 needs w rounded to 2 */ case IMGFMT_UYVY: diff --git a/libmpcodecs/vf_spp.c b/libmpcodecs/vf_spp.c index 4a19153479..dce9e4f649 100644 --- a/libmpcodecs/vf_spp.c +++ b/libmpcodecs/vf_spp.c @@ -528,7 +528,6 @@ static int query_format(struct vf_instance_s* vf, unsigned int fmt){ case IMGFMT_CLPL: case IMGFMT_Y800: case IMGFMT_Y8: - case IMGFMT_NV12: case IMGFMT_444P: case IMGFMT_422P: case IMGFMT_411P: @@ -546,7 +545,6 @@ static unsigned int fmt_list[]={ IMGFMT_CLPL, IMGFMT_Y800, IMGFMT_Y8, - IMGFMT_NV12, IMGFMT_444P, IMGFMT_422P, IMGFMT_411P, |