diff options
author | sdrik <sdrik@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2009-03-17 19:53:36 +0000 |
---|---|---|
committer | sdrik <sdrik@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2009-03-17 19:53:36 +0000 |
commit | 0ddee949daa642b8d3dfdfb147f57a949bcaccb6 (patch) | |
tree | a935ae69df854343faa4a4dab12c06cdead4d403 /libswscale | |
parent | baf5ee6d67308aea8b45db1b2ea6ff0fa5d9a4fc (diff) |
Add a fillPlane function to fill a plane with one constant value
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28986 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libswscale')
-rw-r--r-- | libswscale/swscale.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/libswscale/swscale.c b/libswscale/swscale.c index 8728e2bb6c..391a39f667 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -953,6 +953,15 @@ static inline void yuv2rgbXinC_full(SwsContext *c, int16_t *lumFilter, int16_t * } } +static void fillPlane(uint8_t* plane, int stride, int width, int height, int y, uint8_t val){ + int i; + uint8_t *ptr = plane + stride*y; + for (i=0; i<height; i++){ + memset(ptr, val, width); + ptr += stride; + } +} + //Note: we have C, X86, MMX, MMX2, 3DNOW versions, there is no 3DNOW+MMX2 one //Plain C versions #if !HAVE_MMX || defined (RUNTIME_CPUDETECT) || !CONFIG_GPL @@ -1934,14 +1943,8 @@ static int planarCopy(SwsContext *c, uint8_t* src[], int srcStride[], int srcSli if ((isGray(c->srcFormat) || isGray(c->dstFormat)) && plane>0) { - if (!isGray(c->dstFormat)){ - int i; - uint8_t *ptr = dst[plane] + dstStride[plane]*y; - for (i=0; i<height; i++){ - memset(ptr, 128, length); - ptr += dstStride[plane]; - } - } + if (!isGray(c->dstFormat)) + fillPlane(dst[plane], dstStride[plane], length, height, y, 128); } else { |