Revision 28748a91

View differences:

libavcodec/i386/cavsdsp_mmx.c
32 32
 *
33 33
 ****************************************************************************/
34 34

  
35
#define SUMSUB_BA( a, b ) \
36
    "paddw "#b", "#a" \n\t"\
37
    "paddw "#b", "#b" \n\t"\
38
    "psubw "#a", "#b" \n\t"
39

  
40
#define SBUTTERFLY(a,b,t,n)\
41
    "movq " #a ", " #t "              \n\t" /* abcd */\
42
    "punpckl" #n " " #b ", " #a "     \n\t" /* aebf */\
43
    "punpckh" #n " " #b ", " #t "     \n\t" /* cgdh */
44

  
45
#define TRANSPOSE4(a,b,c,d,t)\
46
    SBUTTERFLY(a,b,t,wd) /* a=aebf t=cgdh */\
47
    SBUTTERFLY(c,d,b,wd) /* c=imjn b=kolp */\
48
    SBUTTERFLY(a,c,d,dq) /* a=aeim d=bfjn */\
49
    SBUTTERFLY(t,b,c,dq) /* t=cgko c=dhlp */
50

  
51 35
static inline void cavs_idct8_1d(int16_t *block, uint64_t bias)
52 36
{
53 37
    asm volatile(
libavcodec/i386/dsputil_mmx.c
203 203
#undef DEF
204 204
#undef PAVGB
205 205

  
206
#define SBUTTERFLY(a,b,t,n,m)\
207
    "mov" #m " " #a ", " #t "         \n\t" /* abcd */\
208
    "punpckl" #n " " #b ", " #a "     \n\t" /* aebf */\
209
    "punpckh" #n " " #b ", " #t "     \n\t" /* cgdh */\
210

  
211
#define TRANSPOSE4(a,b,c,d,t)\
212
    SBUTTERFLY(a,b,t,wd,q) /* a=aebf t=cgdh */\
213
    SBUTTERFLY(c,d,b,wd,q) /* c=imjn b=kolp */\
214
    SBUTTERFLY(a,c,d,dq,q) /* a=aeim d=bfjn */\
215
    SBUTTERFLY(t,b,c,dq,q) /* t=cgko c=dhlp */
216

  
217 206
/***********************************/
218 207
/* standard MMX */
219 208

  
......
1545 1534
#define DIFF_PIXELS_4x8(p1,p2,stride,temp) DIFF_PIXELS_8(d, q,   %%mm,  p1, p2, stride, temp)
1546 1535
#define DIFF_PIXELS_8x8(p1,p2,stride,temp) DIFF_PIXELS_8(q, dqa, %%xmm, p1, p2, stride, temp)
1547 1536

  
1548
#ifdef ARCH_X86_64
1549
// permutes 01234567 -> 05736421
1550
#define TRANSPOSE8(a,b,c,d,e,f,g,h,t)\
1551
    SBUTTERFLY(a,b,%%xmm8,wd,dqa)\
1552
    SBUTTERFLY(c,d,b,wd,dqa)\
1553
    SBUTTERFLY(e,f,d,wd,dqa)\
1554
    SBUTTERFLY(g,h,f,wd,dqa)\
1555
    SBUTTERFLY(a,c,h,dq,dqa)\
1556
    SBUTTERFLY(%%xmm8,b,c,dq,dqa)\
1557
    SBUTTERFLY(e,g,b,dq,dqa)\
1558
    SBUTTERFLY(d,f,g,dq,dqa)\
1559
    SBUTTERFLY(a,e,f,qdq,dqa)\
1560
    SBUTTERFLY(%%xmm8,d,e,qdq,dqa)\
1561
    SBUTTERFLY(h,b,d,qdq,dqa)\
1562
    SBUTTERFLY(c,g,b,qdq,dqa)\
1563
    "movdqa %%xmm8, "#g"              \n\t"
1564
#else
1565
#define TRANSPOSE8(a,b,c,d,e,f,g,h,t)\
1566
    "movdqa "#h", "#t"                \n\t"\
1567
    SBUTTERFLY(a,b,h,wd,dqa)\
1568
    "movdqa "#h", 16"#t"              \n\t"\
1569
    "movdqa "#t", "#h"                \n\t"\
1570
    SBUTTERFLY(c,d,b,wd,dqa)\
1571
    SBUTTERFLY(e,f,d,wd,dqa)\
1572
    SBUTTERFLY(g,h,f,wd,dqa)\
1573
    SBUTTERFLY(a,c,h,dq,dqa)\
1574
    "movdqa "#h", "#t"                \n\t"\
1575
    "movdqa 16"#t", "#h"              \n\t"\
1576
    SBUTTERFLY(h,b,c,dq,dqa)\
1577
    SBUTTERFLY(e,g,b,dq,dqa)\
1578
    SBUTTERFLY(d,f,g,dq,dqa)\
1579
    SBUTTERFLY(a,e,f,qdq,dqa)\
1580
    SBUTTERFLY(h,d,e,qdq,dqa)\
1581
    "movdqa "#h", 16"#t"              \n\t"\
1582
    "movdqa "#t", "#h"                \n\t"\
1583
    SBUTTERFLY(h,b,d,qdq,dqa)\
1584
    SBUTTERFLY(c,g,b,qdq,dqa)\
1585
    "movdqa 16"#t", "#g"              \n\t"
1586
#endif
1587

  
1588 1537
#define LBUTTERFLY2(a1,b1,a2,b2)\
1589 1538
    "paddw " #b1 ", " #a1 "           \n\t"\
1590 1539
    "paddw " #b2 ", " #a2 "           \n\t"\
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 */
libavcodec/i386/h264dsp_mmx.c
23 23
/***********************************/
24 24
/* IDCT */
25 25

  
26
/* in/out: mma=mma+mmb, mmb=mmb-mma */
27
#define SUMSUB_BA( a, b ) \
28
    "paddw "#b", "#a" \n\t"\
29
    "paddw "#b", "#b" \n\t"\
30
    "psubw "#a", "#b" \n\t"
31

  
32 26
#define SUMSUB_BADC( a, b, c, d ) \
33 27
    "paddw "#b", "#a" \n\t"\
34 28
    "paddw "#d", "#c" \n\t"\

Also available in: Unified diff