[SCM] libav/experimental: 30% faster h264_chroma_mc8_c(), this also prevents a possible out of array read.
siretart at users.alioth.debian.org
siretart at users.alioth.debian.org
Sun Jun 30 16:10:45 UTC 2013
The following commit has been merged in the experimental branch:
commit 815c81c0a732c38675733dbb501d7a5c5fce556e
Author: Michael Niedermayer <michaelni at gmx.at>
Date: Fri Dec 21 10:01:04 2007 +0000
30% faster h264_chroma_mc8_c(), this also prevents a possible out of
array read.
Originally committed as revision 11288 to svn://svn.ffmpeg.org/ffmpeg/trunk
diff --git a/libavcodec/dsputil.c b/libavcodec/dsputil.c
index 6104eb9..e3b5db7 100644
--- a/libavcodec/dsputil.c
+++ b/libavcodec/dsputil.c
@@ -1478,6 +1478,7 @@ static void OPNAME ## h264_chroma_mc8_c(uint8_t *dst/*align 8*/, uint8_t *src/*a
\
assert(x<8 && y<8 && x>=0 && y>=0);\
\
+ if(D){\
for(i=0; i<h; i++)\
{\
OP(dst[0], (A*src[0] + B*src[1] + C*src[stride+0] + D*src[stride+1]));\
@@ -1491,6 +1492,23 @@ static void OPNAME ## h264_chroma_mc8_c(uint8_t *dst/*align 8*/, uint8_t *src/*a
dst+= stride;\
src+= stride;\
}\
+ }else{\
+ const int E= B+C;\
+ const int step= C ? stride : 1;\
+ for(i=0; i<h; i++)\
+ {\
+ OP(dst[0], (A*src[0] + E*src[step+0]));\
+ OP(dst[1], (A*src[1] + E*src[step+1]));\
+ OP(dst[2], (A*src[2] + E*src[step+2]));\
+ OP(dst[3], (A*src[3] + E*src[step+3]));\
+ OP(dst[4], (A*src[4] + E*src[step+4]));\
+ OP(dst[5], (A*src[5] + E*src[step+5]));\
+ OP(dst[6], (A*src[6] + E*src[step+6]));\
+ OP(dst[7], (A*src[7] + E*src[step+7]));\
+ dst+= stride;\
+ src+= stride;\
+ }\
+ }\
}
#define op_avg(a, b) a = (((a)+(((b) + 32)>>6)+1)>>1)
--
Libav/FFmpeg packaging
More information about the pkg-multimedia-commits
mailing list