comparison dsputil.h @ 4999:0c4bf6b7d1c6 libavcodec

use DECLARE_ALIGNED from mem.h (which is included through common.h)
author alex
date Sun, 13 May 2007 14:01:15 +0000
parents 689490842cf5
children 4dbe6578f811
comparison
equal deleted inserted replaced
4998:8508554c4391 4999:0c4bf6b7d1c6
468 468
469 /* should be defined by architectures supporting 469 /* should be defined by architectures supporting
470 one or more MultiMedia extension */ 470 one or more MultiMedia extension */
471 int mm_support(void); 471 int mm_support(void);
472 472
473 #ifdef __GNUC__ 473 #define DECLARE_ALIGNED_16(t, v) DECLARE_ALIGNED(16, t, v)
474 #define DECLARE_ALIGNED_16(t,v) t v __attribute__ ((aligned (16)))
475 #else
476 #define DECLARE_ALIGNED_16(t,v) __declspec(align(16)) t v
477 #endif
478 474
479 #if defined(HAVE_MMX) 475 #if defined(HAVE_MMX)
480 476
481 #undef emms_c 477 #undef emms_c
482 478
505 {\ 501 {\
506 if (mm_flags & MM_MMX)\ 502 if (mm_flags & MM_MMX)\
507 emms();\ 503 emms();\
508 } 504 }
509 505
510 #ifdef __GNUC__ 506 #define DECLARE_ALIGNED_8(t, v) DECLARE_ALIGNED(8, t, v)
511 #define DECLARE_ALIGNED_8(t,v) t v __attribute__ ((aligned (8)))
512 #else
513 #define DECLARE_ALIGNED_8(t,v) __declspec(align(8)) t v
514 #endif
515 507
516 #define STRIDE_ALIGN 8 508 #define STRIDE_ALIGN 8
517 509
518 void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx); 510 void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx);
519 void dsputil_init_pix_mmx(DSPContext* c, AVCodecContext *avctx); 511 void dsputil_init_pix_mmx(DSPContext* c, AVCodecContext *avctx);
520 512
521 #elif defined(ARCH_ARMV4L) 513 #elif defined(ARCH_ARMV4L)
522 514
523 /* This is to use 4 bytes read to the IDCT pointers for some 'zero' 515 /* This is to use 4 bytes read to the IDCT pointers for some 'zero'
524 line optimizations */ 516 line optimizations */
525 #define DECLARE_ALIGNED_8(t,v) t v __attribute__ ((aligned (4))) 517 #define DECLARE_ALIGNED_8(t, v) DECLARE_ALIGNED(4, t, v)
526 #define STRIDE_ALIGN 4 518 #define STRIDE_ALIGN 4
527 519
528 #define MM_IWMMXT 0x0100 /* XScale IWMMXT */ 520 #define MM_IWMMXT 0x0100 /* XScale IWMMXT */
529 521
530 extern int mm_flags; 522 extern int mm_flags;
532 void dsputil_init_armv4l(DSPContext* c, AVCodecContext *avctx); 524 void dsputil_init_armv4l(DSPContext* c, AVCodecContext *avctx);
533 525
534 #elif defined(HAVE_MLIB) 526 #elif defined(HAVE_MLIB)
535 527
536 /* SPARC/VIS IDCT needs 8-byte aligned DCT blocks */ 528 /* SPARC/VIS IDCT needs 8-byte aligned DCT blocks */
537 #define DECLARE_ALIGNED_8(t,v) t v __attribute__ ((aligned (8))) 529 #define DECLARE_ALIGNED_8(t, v) DECLARE_ALIGNED(8, t, v)
538 #define STRIDE_ALIGN 8 530 #define STRIDE_ALIGN 8
539 531
540 void dsputil_init_mlib(DSPContext* c, AVCodecContext *avctx); 532 void dsputil_init_mlib(DSPContext* c, AVCodecContext *avctx);
541 533
542 #elif defined(ARCH_SPARC) 534 #elif defined(ARCH_SPARC)
543 535
544 /* SPARC/VIS IDCT needs 8-byte aligned DCT blocks */ 536 /* SPARC/VIS IDCT needs 8-byte aligned DCT blocks */
545 #define DECLARE_ALIGNED_8(t,v) t v __attribute__ ((aligned (8))) 537 #define DECLARE_ALIGNED_8(t, v) DECLARE_ALIGNED(8, t, v)
546 #define STRIDE_ALIGN 8 538 #define STRIDE_ALIGN 8
547 void dsputil_init_vis(DSPContext* c, AVCodecContext *avctx); 539 void dsputil_init_vis(DSPContext* c, AVCodecContext *avctx);
548 540
549 #elif defined(ARCH_ALPHA) 541 #elif defined(ARCH_ALPHA)
550 542
551 #define DECLARE_ALIGNED_8(t,v) t v __attribute__ ((aligned (8))) 543 #define DECLARE_ALIGNED_8(t, v) DECLARE_ALIGNED(8, t, v)
552 #define STRIDE_ALIGN 8 544 #define STRIDE_ALIGN 8
553 545
554 void dsputil_init_alpha(DSPContext* c, AVCodecContext *avctx); 546 void dsputil_init_alpha(DSPContext* c, AVCodecContext *avctx);
555 547
556 #elif defined(ARCH_POWERPC) 548 #elif defined(ARCH_POWERPC)
563 #define pixel altivec_pixel 555 #define pixel altivec_pixel
564 #include <altivec.h> 556 #include <altivec.h>
565 #undef pixel 557 #undef pixel
566 #endif 558 #endif
567 559
568 #define DECLARE_ALIGNED_8(t,v) t v __attribute__ ((aligned (16))) 560 #define DECLARE_ALIGNED_8(t, v) DECLARE_ALIGNED(16, t, v)
569 #define STRIDE_ALIGN 16 561 #define STRIDE_ALIGN 16
570 562
571 void dsputil_init_ppc(DSPContext* c, AVCodecContext *avctx); 563 void dsputil_init_ppc(DSPContext* c, AVCodecContext *avctx);
572 564
573 #elif defined(HAVE_MMI) 565 #elif defined(HAVE_MMI)
574 566
575 #define DECLARE_ALIGNED_8(t,v) t v __attribute__ ((aligned (16))) 567 #define DECLARE_ALIGNED_8(t, v) DECLARE_ALIGNED(16, t, v)
576 #define STRIDE_ALIGN 16 568 #define STRIDE_ALIGN 16
577 569
578 void dsputil_init_mmi(DSPContext* c, AVCodecContext *avctx); 570 void dsputil_init_mmi(DSPContext* c, AVCodecContext *avctx);
579 571
580 #elif defined(ARCH_SH4) 572 #elif defined(ARCH_SH4)
581 573
582 #define DECLARE_ALIGNED_8(t,v) t v __attribute__ ((aligned (8))) 574 #define DECLARE_ALIGNED_8(t, v) DECLARE_ALIGNED(8, t, v)
583 #define STRIDE_ALIGN 8 575 #define STRIDE_ALIGN 8
584 576
585 void dsputil_init_sh4(DSPContext* c, AVCodecContext *avctx); 577 void dsputil_init_sh4(DSPContext* c, AVCodecContext *avctx);
586 578
587 #elif defined(ARCH_BFIN) 579 #elif defined(ARCH_BFIN)
588 580
589 #define DECLARE_ALIGNED_8(t,v) t v __attribute__ ((aligned (8))) 581 #define DECLARE_ALIGNED_8(t, v) DECLARE_ALIGNED(8, t, v)
590 #define STRIDE_ALIGN 8 582 #define STRIDE_ALIGN 8
591 583
592 void dsputil_init_bfin(DSPContext* c, AVCodecContext *avctx); 584 void dsputil_init_bfin(DSPContext* c, AVCodecContext *avctx);
593 585
594 #else 586 #else
595 587
596 #define DECLARE_ALIGNED_8(t,v) t v __attribute__ ((aligned (8))) 588 #define DECLARE_ALIGNED_8(t, v) DECLARE_ALIGNED(8, t, v)
597 #define STRIDE_ALIGN 8 589 #define STRIDE_ALIGN 8
598 590
599 #endif 591 #endif
600 592
601 /* PSNR */ 593 /* PSNR */