From 70c25c62051f018cb2d2c2b51bd2d631a4c61650 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Tue, 30 Oct 2012 18:39:44 +0100 Subject: sws: move fillPlane16() to header so it can be used from more than 1 place Signed-off-by: Michael Niedermayer --- libswscale/swscale_internal.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'libswscale/swscale_internal.h') diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h index b3f20ccca0..7795f67a84 100644 --- a/libswscale/swscale_internal.h +++ b/libswscale/swscale_internal.h @@ -30,6 +30,7 @@ #include "libavutil/avassert.h" #include "libavutil/avutil.h" #include "libavutil/common.h" +#include "libavutil/intreadwrite.h" #include "libavutil/log.h" #include "libavutil/pixfmt.h" #include "libavutil/pixdesc.h" @@ -769,4 +770,24 @@ void ff_sws_init_output_funcs(SwsContext *c, void ff_sws_init_swScale_altivec(SwsContext *c); void ff_sws_init_swScale_mmx(SwsContext *c); +static inline void fillPlane16(uint8_t *plane, int stride, int width, int height, int y, + int alpha, int bits, const int big_endian) +{ + int i, j; + uint8_t *ptr = plane + stride * y; + int v = alpha ? 0xFFFF>>(15-bits) : (1<