[vlc-commits] video chroma: add a Nv12 copy function which outputs I420

Felix Paul Kühne git at videolan.org
Thu Jun 25 17:25:32 CEST 2015


vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Tue Feb  3 11:32:51 2015 +0100| [13404416122224654b7edc4354badb85c2902c0c] | committer: Felix Paul Kühne

video chroma: add a Nv12 copy function which outputs I420

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=13404416122224654b7edc4354badb85c2902c0c
---

 modules/video_chroma/copy.c |   12 ++++++++++++
 modules/video_chroma/copy.h |    3 +++
 2 files changed, 15 insertions(+)

diff --git a/modules/video_chroma/copy.c b/modules/video_chroma/copy.c
index ce3e39d..ea61889 100644
--- a/modules/video_chroma/copy.c
+++ b/modules/video_chroma/copy.c
@@ -438,6 +438,18 @@ void CopyFromNv12ToNv12(picture_t *dst, uint8_t *src[2], size_t src_pitch[2],
               width, height/2);
 }
 
+void CopyFromNv12ToI420(picture_t *dst, uint8_t *src[2], size_t src_pitch[2],
+                        unsigned width, unsigned height)
+{
+    CopyPlane(dst->p[0].p_pixels, dst->p[0].i_pitch,
+              src[0], src_pitch[0],
+              width, height);
+    SplitPlanes(dst->p[1].p_pixels, dst->p[1].i_pitch,
+                dst->p[2].p_pixels, dst->p[2].i_pitch,
+                src[1], src_pitch[1],
+                width/2, height/2);
+}
+
 void CopyFromYv12(picture_t *dst, uint8_t *src[3], size_t src_pitch[3],
                   unsigned width, unsigned height,
                   copy_cache_t *cache)
diff --git a/modules/video_chroma/copy.h b/modules/video_chroma/copy.h
index d1e49f2..38a3a38 100644
--- a/modules/video_chroma/copy.h
+++ b/modules/video_chroma/copy.h
@@ -47,4 +47,7 @@ void CopyFromNv12ToNv12(picture_t *dst, uint8_t *src[2], size_t src_pitch[2],
                         unsigned width, unsigned height,
                         copy_cache_t *cache);
 
+void CopyFromNv12ToI420(picture_t *dst, uint8_t *src[2], size_t src_pitch[2],
+                        unsigned width, unsigned height);
+
 #endif



More information about the vlc-commits mailing list