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
This commit is contained in:
Michael Niedermayer 2007-12-21 10:01:04 +00:00
parent 91fd7398f4
commit 815c81c0a7

View File

@ -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)