[vlc-devel] [PATCH 1/2] video chroma: add a Nv12 copy function which outputs I420

Felix Paul Kühne fkuehne at videolan.org
Tue Feb 3 11:46:21 CET 2015


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

diff --git a/modules/video_chroma/copy.c b/modules/video_chroma/copy.c
index cc98c92..cac547e 100644
--- a/modules/video_chroma/copy.c
+++ b/modules/video_chroma/copy.c
@@ -400,6 +400,18 @@ void CopyFromNv12(picture_t *dst, uint8_t *src[2], size_t src_pitch[2],
                 width/2, 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 39dbf1e..1f01093 100644
--- a/modules/video_chroma/copy.h
+++ b/modules/video_chroma/copy.h
@@ -37,6 +37,8 @@ void CopyCleanCache(copy_cache_t *cache);
 void CopyFromNv12(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);
 void CopyFromYv12(picture_t *dst, uint8_t *src[3], size_t src_pitch[3],
                   unsigned width, unsigned height,
                   copy_cache_t *cache);
-- 
1.9.3 (Apple Git-50)




More information about the vlc-devel mailing list