[FFmpeg-cvslog] sws: move fillPlane16() to header so it can be used from more than 1 place

Michael Niedermayer git at videolan.org
Tue Oct 30 18:55:09 CET 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Oct 30 18:39:44 2012 +0100| [70c25c62051f018cb2d2c2b51bd2d631a4c61650] | committer: Michael Niedermayer

sws: move fillPlane16() to header so it can be used from more than 1 place

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=70c25c62051f018cb2d2c2b51bd2d631a4c61650
---

 libswscale/swscale_internal.h |   21 +++++++++++++++++++++
 libswscale/swscale_unscaled.c |   20 --------------------
 2 files changed, 21 insertions(+), 20 deletions(-)

diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h
index b3f20cc..7795f67 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<<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 */
diff --git a/libswscale/swscale_unscaled.c b/libswscale/swscale_unscaled.c
index ba0303c..f35d1ba 100644
--- a/libswscale/swscale_unscaled.c
+++ b/libswscale/swscale_unscaled.c
@@ -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)



More information about the ffmpeg-cvslog mailing list