Inline assembly has no place in the general C code and the utility
of this microoptimization is doubtful.
---
This is a troll patch, I did not bother to benchmark.
libavcodec/msmpeg4.c | 27 +--------------------------
1 file changed, 1 insertion(+), 26 deletions(-)
diff --git a/libavcodec/msmpeg4.c b/libavcodec/msmpeg4.c
index 95b5c93..caad6a4 100644
--- a/libavcodec/msmpeg4.c
+++ b/libavcodec/msmpeg4.c
@@ -218,31 +218,6 @@ int ff_msmpeg4_pred_dc(MpegEncContext *s, int n,
b=c=1024;
}
- /* XXX: the following solution consumes divisions, but it does not
- necessitate to modify mpegvideo.c. The problem comes from the
- fact they decided to store the quantized DC (which would lead
- to problems if Q could vary !) */
-#if ARCH_X86 && HAVE_7REGS && HAVE_EBX_AVAILABLE
- __asm__ volatile(
- "movl %3, %%eax \n\t"
- "shrl $1, %%eax \n\t"
- "addl %%eax, %2 \n\t"
- "addl %%eax, %1 \n\t"
- "addl %0, %%eax \n\t"
- "mull %4 \n\t"
- "movl %%edx, %0 \n\t"
- "movl %1, %%eax \n\t"
- "mull %4 \n\t"
- "movl %%edx, %1 \n\t"
- "movl %2, %%eax \n\t"
- "mull %4 \n\t"
- "movl %%edx, %2 \n\t"
- : "+b" (a), "+c" (b), "+D" (c)
- : "g" (scale), "S" (ff_inverse[scale])
- : "%eax", "%edx"
- );
-#else
- /* Divisions are costly everywhere; optimize the most common case. */
if (scale == 8) {
a = (a + (8 >> 1)) / 8;
b = (b + (8 >> 1)) / 8;
@@ -252,7 +227,7 @@ int ff_msmpeg4_pred_dc(MpegEncContext *s, int n,
b = FASTDIV((b + (scale >> 1)), scale);
c = FASTDIV((c + (scale >> 1)), scale);
}
-#endif
+
/* XXX: WARNING: they did not choose the same test as MPEG4. This
is very important ! */
if(s->msmpeg4_version>3){
--
1.8.3.2
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel