Revision 6f903d8e

View differences:

libavcodec/msmpeg4.c
411 411
       necessitate to modify mpegvideo.c. The problem comes from the
412 412
       fact they decided to store the quantized DC (which would lead
413 413
       to problems if Q could vary !) */
414
#ifdef ARCH_X86
415
    /* using 16bit divisions as they are large enough and 2x as fast */
416
    asm volatile(
417
        "movl %3, %%eax		\n\t"
418
	"shrl $1, %%eax		\n\t"
419
	"addl %%eax, %2		\n\t"
420
	"addl %%eax, %1		\n\t"
421
	"addl %0, %%eax		\n\t"
422
	"xorl %%edx, %%edx	\n\t"
423
        "divw %w3		\n\t"
424
	"movzwl %%ax, %0	\n\t"
425
	"movl %1, %%eax		\n\t"
426
	"xorl %%edx, %%edx	\n\t"
427
        "divw %w3		\n\t"
428
	"movzwl %%ax, %1	\n\t"
429
	"movl %2, %%eax		\n\t"
430
	"xorl %%edx, %%edx	\n\t"
431
        "divw %w3		\n\t"
432
	"movzwl %%ax, %2	\n\t"
433
        : "+r" (a), "+r" (b), "+r" (c)
434
	: "r" (scale)
435
	: "%eax", "%edx"
436
    );
437
#else    
414 438
    a = (a + (scale >> 1)) / scale;
415 439
    b = (b + (scale >> 1)) / scale;
416 440
    c = (c + (scale >> 1)) / scale;
417

  
441
#endif
418 442
    /* XXX: WARNING: they did not choose the same test as MPEG4. This
419 443
       is very important ! */
420 444
    if (abs(a - b) <= abs(b - c)) {

Also available in: Unified diff