Mercurial > mplayer.hg
annotate libmpcodecs/native/mmx.h @ 36406:c918845d0d9a
mplayer: Fix a crash seeking with -chapter and -ass
When seeking to chapter on startup the mpctx->d_sub member
is not yet initialized. Do not access it in that case.
The commit r31293 that introduced that code explains that
it is for handling backward seeking correctly. So it should
not be needed on startup forward seek situation.
author | al |
---|---|
date | Fri, 08 Nov 2013 21:06:40 +0000 |
parents | bbb6ebec87a0 |
children |
rev | line source |
---|---|
30421
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
27757
diff
changeset
|
1 /* |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
27757
diff
changeset
|
2 * This file is part of MPlayer. |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
27757
diff
changeset
|
3 * |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
27757
diff
changeset
|
4 * MPlayer is free software; you can redistribute it and/or modify |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
27757
diff
changeset
|
5 * it under the terms of the GNU General Public License as published by |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
27757
diff
changeset
|
6 * the Free Software Foundation; either version 2 of the License, or |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
27757
diff
changeset
|
7 * (at your option) any later version. |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
27757
diff
changeset
|
8 * |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
27757
diff
changeset
|
9 * MPlayer is distributed in the hope that it will be useful, |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
27757
diff
changeset
|
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
27757
diff
changeset
|
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
27757
diff
changeset
|
12 * GNU General Public License for more details. |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
27757
diff
changeset
|
13 * |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
27757
diff
changeset
|
14 * You should have received a copy of the GNU General Public License along |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
27757
diff
changeset
|
15 * with MPlayer; if not, write to the Free Software Foundation, Inc., |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
27757
diff
changeset
|
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
27757
diff
changeset
|
17 */ |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
27757
diff
changeset
|
18 |
26029 | 19 #ifndef MPLAYER_MMX_H |
20 #define MPLAYER_MMX_H | |
20821
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
21 |
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
22 typedef union { |
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
23 long long q; /* Quadword (64-bit) value */ |
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
24 unsigned long long uq; /* Unsigned Quadword */ |
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
25 int d[2]; /* 2 Doubleword (32-bit) values */ |
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
26 unsigned int ud[2]; /* 2 Unsigned Doubleword */ |
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
27 short w[4]; /* 4 Word (16-bit) values */ |
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
28 unsigned short uw[4]; /* 4 Unsigned Word */ |
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
29 char b[8]; /* 8 Byte (8-bit) values */ |
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
30 unsigned char ub[8]; /* 8 Unsigned Byte */ |
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
31 float s[2]; /* Single-precision (32-bit) value */ |
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
32 } mmx_t; /* On an 8-byte (64-bit) boundary */ |
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
33 |
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
34 |
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
35 #define movq_m2r(var, reg) mmx_m2r(movq, var, reg) |
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
36 #define movq_r2m(reg, var) mmx_r2m(movq, reg, var) |
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
37 #define movq_r2r(regs, regd) mmx_r2r(movq, regs, regd) |
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
38 |
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
39 #define punpcklwd_m2r(var, reg) mmx_m2r(punpcklwd, var, reg) |
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
40 #define punpcklwd_r2r(regs, regd) mmx_r2r(punpcklwd, regs, regd) |
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
41 |
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
42 #define punpckhwd_m2r(var, reg) mmx_m2r(punpckhwd, var, reg) |
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
43 #define punpckhwd_r2r(regs, regd) mmx_r2r(punpckhwd, regs, regd) |
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
44 |
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
45 #define punpcklbw_r2r(regs, regd) mmx_r2r(punpcklbw, regs, regd) |
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
46 #define punpckhbw_r2r(regs, regd) mmx_r2r(punpckhbw, regs, regd) |
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
47 #define punpckhdq_r2r(regs, regd) mmx_r2r(punpckhdq, regs, regd) |
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
48 #define punpckldq_r2r(regs, regd) mmx_r2r(punpckldq, regs, regd) |
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
49 |
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
50 #define psubw_m2r(var, reg) mmx_m2r(psubw, var, reg) |
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
51 #define psubw_r2r(regs, regd) mmx_r2r(psubw, regs, regd) |
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
52 #define psubsw_r2r(regs, regd) mmx_r2r(psubsw, regs, regd) |
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
53 |
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
54 #define pmaddwd_r2r(regs, regd) mmx_r2r(pmaddwd, regs, regd) |
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
55 #define paddw_m2r(var, reg) mmx_m2r(paddw, var, reg) |
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
56 #define paddw_r2r(regs, regd) mmx_r2r(paddw, regs, regd) |
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
57 |
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
58 #define psrad_i2r(imm, reg) mmx_i2r(psrad, imm, reg) |
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
59 |
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
60 #define psllw_i2r(imm, reg) mmx_i2r(psllw, imm, reg) |
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
61 |
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
62 #define pmulhw_r2r(regs, regd) mmx_r2r(pmulhw, regs, regd) |
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
63 #define pmulhw_m2r(var, reg) mmx_m2r(pmulhw, var, reg) |
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
64 |
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
65 #define psraw_i2r(imm, reg) mmx_i2r(psraw, imm, reg) |
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
66 |
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
67 #define packssdw_r2r(regs, regd) mmx_r2r(packssdw, regs, regd) |
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
68 #define packuswb_r2r(regs, regd) mmx_r2r(packuswb, regs, regd) |
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
69 |
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
70 #define pxor_r2r(regs, regd) mmx_r2r(pxor, regs, regd) |
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
71 |
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
72 #define pcmpgtw_r2r(regs, regd) mmx_r2r(pcmpgtw, regs, regd) |
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
73 |
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
74 #define por_r2r(regs, regd) mmx_r2r(por, regs, regd) |
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
75 |
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
76 |
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
77 #define mmx_i2r(op,imm,reg) \ |
27757
b5a46071062a
Replace all occurrences of '__volatile__' and '__volatile' by plain 'volatile'.
diego
parents:
26029
diff
changeset
|
78 __asm__ volatile (#op " %0, %%" #reg \ |
20821
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
79 : /* nothing */ \ |
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
80 : "i" (imm) ) |
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
81 |
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
82 #define mmx_m2r(op, mem, reg) \ |
27757
b5a46071062a
Replace all occurrences of '__volatile__' and '__volatile' by plain 'volatile'.
diego
parents:
26029
diff
changeset
|
83 __asm__ volatile (#op " %0, %%" #reg \ |
20821
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
84 : /* nothing */ \ |
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
85 : "m" (mem)) |
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
86 |
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
87 #define mmx_r2m(op, reg, mem) \ |
27757
b5a46071062a
Replace all occurrences of '__volatile__' and '__volatile' by plain 'volatile'.
diego
parents:
26029
diff
changeset
|
88 __asm__ volatile (#op " %%" #reg ", %0" \ |
20821
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
89 : "=m" (mem) \ |
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
90 : /* nothing */ ) |
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
91 |
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
92 #define mmx_r2r(op, regs, regd) \ |
27757
b5a46071062a
Replace all occurrences of '__volatile__' and '__volatile' by plain 'volatile'.
diego
parents:
26029
diff
changeset
|
93 __asm__ volatile (#op " %" #regs ", %" #regd) |
20821
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
94 |
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
95 |
27757
b5a46071062a
Replace all occurrences of '__volatile__' and '__volatile' by plain 'volatile'.
diego
parents:
26029
diff
changeset
|
96 #define emms() __asm__ volatile ("emms") |
20821
ac142b1ac1cd
Remove mmx.h, the licensing status was doubtful, and put a minimal
diego
parents:
diff
changeset
|
97 |
26029 | 98 #endif /* MPLAYER_MMX_H */ |