Commit 93a319f1 authored by Loren Merritt's avatar Loren Merritt

asm implementation of mid_pred.

20% faster huffyuv decoding, 4% faster ffv1.

Originally committed as revision 6254 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 2a2311be
...@@ -235,7 +235,22 @@ static inline int av_log2_16bit(unsigned int v) ...@@ -235,7 +235,22 @@ static inline int av_log2_16bit(unsigned int v)
/* median of 3 */ /* median of 3 */
static inline int mid_pred(int a, int b, int c) static inline int mid_pred(int a, int b, int c)
{ {
#if 0 #if (defined(ARCH_X86) && __CPU__ >= 686 || defined(ARCH_X86_64)) && !defined(RUNTIME_CPUDETECT)
int i=a, j=a;
asm volatile(
"cmp %4, %2 \n\t"
"cmovg %4, %0 \n\t"
"cmovl %4, %1 \n\t"
"cmp %4, %3 \n\t"
"cmovg %3, %0 \n\t"
"cmovl %3, %1 \n\t"
"cmp %3, %2 \n\t"
"cmovl %1, %0 \n\t"
:"+&r"(i), "+&r"(j)
:"r"(a), "r"(b), "r"(c)
);
return i;
#elif 0
int t= (a-b)&((a-b)>>31); int t= (a-b)&((a-b)>>31);
a-=t; a-=t;
b+=t; b+=t;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment