[vlc-commits] chroma:copy: inline picture_SwapUV() so it can be used anywhere
Steve Lhomme
git at videolan.org
Tue Feb 20 14:01:41 CET 2018
vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue Feb 20 13:52:24 2018 +0100| [d5a928e93bbc845e247500eb947466f1f07d13d1] | committer: Steve Lhomme
chroma:copy: inline picture_SwapUV() so it can be used anywhere
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d5a928e93bbc845e247500eb947466f1f07d13d1
---
modules/video_chroma/copy.c | 11 +----------
modules/video_chroma/copy.h | 9 ++++++++-
2 files changed, 9 insertions(+), 11 deletions(-)
diff --git a/modules/video_chroma/copy.c b/modules/video_chroma/copy.c
index a60eaa944c..da7344ed69 100644
--- a/modules/video_chroma/copy.c
+++ b/modules/video_chroma/copy.c
@@ -777,15 +777,6 @@ void Copy420_P_to_P(picture_t *dst, const uint8_t *src[static 3],
src[2], src_pitch[2], height / 2);
}
-void picture_SwapUV(picture_t *picture)
-{
- assert(picture->i_planes == 3);
-
- plane_t tmp_plane = picture->p[U_PLANE];
- picture->p[U_PLANE] = picture->p[V_PLANE];
- picture->p[V_PLANE] = tmp_plane;
-}
-
int picture_UpdatePlanes(picture_t *picture, uint8_t *data, unsigned pitch)
{
/* fill in buffer info in first plane */
@@ -833,7 +824,7 @@ int picture_UpdatePlanes(picture_t *picture, uint8_t *data, unsigned pitch)
}
/* The dx/d3d buffer is always allocated as YV12 */
if (vlc_fourcc_AreUVPlanesSwapped(picture->format.i_chroma, VLC_CODEC_YV12))
- plane_SwapUV( picture->p );
+ plane_SwapUV( picture );
}
return VLC_SUCCESS;
}
diff --git a/modules/video_chroma/copy.h b/modules/video_chroma/copy.h
index f332f6d429..f9407a1bb4 100644
--- a/modules/video_chroma/copy.h
+++ b/modules/video_chroma/copy.h
@@ -74,7 +74,14 @@ void CopyFromI420_10ToP010(picture_t *dst, const uint8_t *src[static 3],
*
* It just swap the planes information without doing any copy.
*/
-void picture_SwapUV(picture_t *picture);
+static inline void picture_SwapUV(picture_t *picture)
+{
+ assert(picture->i_planes == 3);
+
+ plane_t tmp_plane = picture->p[U_PLANE];
+ picture->p[U_PLANE] = picture->p[V_PLANE];
+ picture->p[V_PLANE] = tmp_plane;
+}
/**
* This functions sets the internal plane pointers/dimensions for the given
More information about the vlc-commits
mailing list