[vlc-devel] [PATCH 1/2] picture: add a commonly used plane_SwapUV	function
    Steve Lhomme 
    robux4 at videolabs.io
       
    Fri Dec 15 13:09:56 CET 2017
    
    
  
---
 include/vlc_picture.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)
diff --git a/include/vlc_picture.h b/include/vlc_picture.h
index 74f156fbbd..1ab8fef14f 100644
--- a/include/vlc_picture.h
+++ b/include/vlc_picture.h
@@ -254,6 +254,18 @@ enum
 #define A_PIXELS     p[A_PLANE].p_pixels
 #define A_PITCH      p[A_PLANE].i_pitch
 
+
+/*****************************************************************************
+ * plane helper funcions
+ *****************************************************************************/
+
+static inline void plane_SwapUV(plane_t p[PICTURE_PLANE_MAX])
+{
+    uint8_t *buf = p[V_PLANE].p_pixels;
+    p[V_PLANE].p_pixels = p[U_PLANE].p_pixels;
+    p[U_PLANE].p_pixels = buf;
+}
+
 /**@}*/
 
 #endif /* VLC_PICTURE_H */
-- 
2.14.2
    
    
More information about the vlc-devel
mailing list