]> git.sesse.net Git - ffmpeg/commitdiff
sws: move fillPlane16() to header so it can be used from more than 1 place
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 30 Oct 2012 17:39:44 +0000 (18:39 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 30 Oct 2012 17:51:21 +0000 (18:51 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libswscale/swscale_internal.h
libswscale/swscale_unscaled.c

index b3f20ccca053c07b6aadc6fa439b89a30f75b3d1..7795f67a8492901384e5a56de954db5c27353dfe 100644 (file)
@@ -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<<bits);
+    for (i = 0; i < height; i++) {
+#define FILL(wfunc) \
+        for (j = 0; j < width; j++) {\
+            wfunc(ptr+2*j, v);\
+        }
+        if (big_endian) {
+            FILL(AV_WB16);
+        } else {
+            FILL(AV_WL16);
+        }
+        ptr += stride;
+    }
+}
+
 #endif /* SWSCALE_SWSCALE_INTERNAL_H */
index ba0303c252b7fc33843a31218c162698a8a00190..f35d1ba3522d9d2f31c4b443ff3a4bc7cb3d47e0 100644 (file)
@@ -139,26 +139,6 @@ static void fillPlane(uint8_t *plane, int stride, int width, int height, int y,
     }
 }
 
-static 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<<bits);
-    for (i = 0; i < height; i++) {
-#define FILL(wfunc) \
-        for (j = 0; j < width; j++) {\
-            wfunc(ptr+2*j, v);\
-        }
-        if (big_endian) {
-            FILL(AV_WB16);
-        } else {
-            FILL(AV_WL16);
-        }
-        ptr += stride;
-    }
-}
-
 static void copyPlane(const uint8_t *src, int srcStride,
                       int srcSliceY, int srcSliceH, int width,
                       uint8_t *dst, int dstStride)