[FFmpeg-cvslog] swscale.c:remove fill_plane9or10() use fillPlane16()

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:40:55 2012 +0100| [4d2f1d8c930a596f33cf3b26182e9098fe274967] | committer: Michael Niedermayer

swscale.c:remove fill_plane9or10() use fillPlane16()

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

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

 libswscale/swscale.c |   33 ++++-----------------------------
 1 file changed, 4 insertions(+), 29 deletions(-)

diff --git a/libswscale/swscale.c b/libswscale/swscale.c
index 71fb989..632e85a 100644
--- a/libswscale/swscale.c
+++ b/libswscale/swscale.c
@@ -62,28 +62,6 @@ static av_always_inline void fillPlane(uint8_t *plane, int stride, int width,
     }
 }
 
-static void fill_plane9or10(uint8_t *plane, int stride, int width,
-                            int height, int y, uint8_t val,
-                            const int dst_depth, const int big_endian)
-{
-    int i, j;
-    uint16_t *dst = (uint16_t *) (plane + stride * y);
-#define FILL8TO9_OR_10(wfunc) \
-    for (i = 0; i < height; i++) { \
-        for (j = 0; j < width; j++) { \
-            wfunc(&dst[j], (val << (dst_depth - 8)) |  \
-                               (val >> (16 - dst_depth))); \
-        } \
-        dst += stride / 2; \
-    }
-    if (big_endian) {
-        FILL8TO9_OR_10(AV_WB16);
-    } else {
-        FILL8TO9_OR_10(AV_WL16);
-    }
-}
-
-
 static void hScale16To19_c(SwsContext *c, int16_t *_dst, int dstW,
                            const uint8_t *_src, const int16_t *filter,
                            const int32_t *filterPos, int filterSize)
@@ -681,18 +659,15 @@ static int swScale(SwsContext *c, const uint8_t *src[],
             }
         }
     }
-
     if (isPlanar(dstFormat) && isALPHA(dstFormat) && !alpPixBuf) {
         int length = dstW;
         int height = dstY - lastDstY;
-        if (is16BPS(c->dstFormat))
-            length *= 2;
 
-        if (is9_OR_10BPS(dstFormat)) {
+        if (is16BPS(dstFormat) || isNBPS(dstFormat)) {
             const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(dstFormat);
-            fill_plane9or10(dst[3], dstStride[3], length, height, lastDstY,
-                            255, desc->comp[3].depth_minus1 + 1,
-                            isBE(dstFormat));
+            fillPlane16(dst[3], dstStride[3], length, height, lastDstY,
+                    1, desc->comp[3].depth_minus1,
+                    isBE(dstFormat));
         } else
             fillPlane(dst[3], dstStride[3], length, height, lastDstY, 255);
     }



More information about the ffmpeg-cvslog mailing list