Revision 28748a91 libavcodec/i386/dsputil_mmx.h

View differences:

libavcodec/i386/dsputil_mmx.h
52 52
extern const double ff_pd_1[2];
53 53
extern const double ff_pd_2[2];
54 54

  
55
/* in/out: mma=mma+mmb, mmb=mmb-mma */
56
#define SUMSUB_BA( a, b ) \
57
    "paddw "#b", "#a" \n\t"\
58
    "paddw "#b", "#b" \n\t"\
59
    "psubw "#a", "#b" \n\t"
60

  
61
#define SBUTTERFLY(a,b,t,n,m)\
62
    "mov" #m " " #a ", " #t "         \n\t" /* abcd */\
63
    "punpckl" #n " " #b ", " #a "     \n\t" /* aebf */\
64
    "punpckh" #n " " #b ", " #t "     \n\t" /* cgdh */\
65

  
66
#define TRANSPOSE4(a,b,c,d,t)\
67
    SBUTTERFLY(a,b,t,wd,q) /* a=aebf t=cgdh */\
68
    SBUTTERFLY(c,d,b,wd,q) /* c=imjn b=kolp */\
69
    SBUTTERFLY(a,c,d,dq,q) /* a=aeim d=bfjn */\
70
    SBUTTERFLY(t,b,c,dq,q) /* t=cgko c=dhlp */
71

  
72
#ifdef ARCH_X86_64
73
// permutes 01234567 -> 05736421
74
#define TRANSPOSE8(a,b,c,d,e,f,g,h,t)\
75
    SBUTTERFLY(a,b,%%xmm8,wd,dqa)\
76
    SBUTTERFLY(c,d,b,wd,dqa)\
77
    SBUTTERFLY(e,f,d,wd,dqa)\
78
    SBUTTERFLY(g,h,f,wd,dqa)\
79
    SBUTTERFLY(a,c,h,dq,dqa)\
80
    SBUTTERFLY(%%xmm8,b,c,dq,dqa)\
81
    SBUTTERFLY(e,g,b,dq,dqa)\
82
    SBUTTERFLY(d,f,g,dq,dqa)\
83
    SBUTTERFLY(a,e,f,qdq,dqa)\
84
    SBUTTERFLY(%%xmm8,d,e,qdq,dqa)\
85
    SBUTTERFLY(h,b,d,qdq,dqa)\
86
    SBUTTERFLY(c,g,b,qdq,dqa)\
87
    "movdqa %%xmm8, "#g"              \n\t"
88
#else
89
#define TRANSPOSE8(a,b,c,d,e,f,g,h,t)\
90
    "movdqa "#h", "#t"                \n\t"\
91
    SBUTTERFLY(a,b,h,wd,dqa)\
92
    "movdqa "#h", 16"#t"              \n\t"\
93
    "movdqa "#t", "#h"                \n\t"\
94
    SBUTTERFLY(c,d,b,wd,dqa)\
95
    SBUTTERFLY(e,f,d,wd,dqa)\
96
    SBUTTERFLY(g,h,f,wd,dqa)\
97
    SBUTTERFLY(a,c,h,dq,dqa)\
98
    "movdqa "#h", "#t"                \n\t"\
99
    "movdqa 16"#t", "#h"              \n\t"\
100
    SBUTTERFLY(h,b,c,dq,dqa)\
101
    SBUTTERFLY(e,g,b,dq,dqa)\
102
    SBUTTERFLY(d,f,g,dq,dqa)\
103
    SBUTTERFLY(a,e,f,qdq,dqa)\
104
    SBUTTERFLY(h,d,e,qdq,dqa)\
105
    "movdqa "#h", 16"#t"              \n\t"\
106
    "movdqa "#t", "#h"                \n\t"\
107
    SBUTTERFLY(h,b,d,qdq,dqa)\
108
    SBUTTERFLY(c,g,b,qdq,dqa)\
109
    "movdqa 16"#t", "#g"              \n\t"
110
#endif
111

  
55 112
#endif /* FFMPEG_DSPUTIL_MMX_H */

Also available in: Unified diff