Changes of Revision 2

ffmpeg-3.changes Changed
x
 
1
@@ -1,4 +1,9 @@
2
 -------------------------------------------------------------------
3
+Sun Oct  1 15:31:56 UTC 2023 - Manfred Hollstein <manfred.h@gmx.net>
4
+
5
+- Add ffmpeg-x86-mathops.patch
6
+
7
+-------------------------------------------------------------------
8
 Fri Mar  3 03:03:03 UTC 2023 - olaf@aepfle.de
9
 
10
 - Version update to 3.4.12
11
ffmpeg-3.spec Changed
9
 
1
@@ -72,6 +72,7 @@
2
 Patch4:         ffmpeg-codec-choice.diff
3
 Patch6:         0001-opusenc-psy-disable-stereo-searches.patch
4
 Patch7:         ffmpeg-fix-build-fdk-aac2.patch
5
+Patch8:         ffmpeg-x86-mathops.patch
6
 BuildRequires:  ladspa-devel
7
 BuildRequires:  libgsm-devel
8
 BuildRequires:  libmp3lame-devel
9
ffmpeg-x86-mathops.patch Added
61
 
1
@@ -0,0 +1,59 @@
2
+diff -rup a/libavcodec/x86/mathops.h b/libavcodec/x86/mathops.h
3
+--- a/libavcodec/x86/mathops.h 2023-10-01 13:02:26.829463017 +0200
4
++++ b/libavcodec/x86/mathops.h 2023-10-01 13:05:19.219502582 +0200
5
+@@ -35,12 +35,20 @@
6
+ static av_always_inline av_const int MULL(int a, int b, unsigned shift)
7
+ {
8
+     int rt, dummy;
9
++    if (__builtin_constant_p(shift))
10
+     __asm__ (
11
+         "imull %3               \n\t"
12
+         "shrdl %4, %%edx, %%eax \n\t"
13
+         :"=a"(rt), "=d"(dummy)
14
+-        :"a"(a), "rm"(b), "ci"((uint8_t)shift)
15
++        :"a"(a), "rm"(b), "i"(shift & 0x1F)
16
+     );
17
++    else
18
++        __asm__ (
19
++            "imull %3               \n\t"
20
++            "shrdl %4, %%edx, %%eax \n\t"
21
++            :"=a"(rt), "=d"(dummy)
22
++            :"a"(a), "rm"(b), "c"((uint8_t)shift)
23
++        );
24
+     return rt;
25
+ }
26
+ 
27
+@@ -113,19 +121,31 @@ __asm__ volatile(\
28
+ // avoid +32 for shift optimization (gcc should do that ...)
29
+ #define NEG_SSR32 NEG_SSR32
30
+ static inline  int32_t NEG_SSR32( int32_t a, int8_t s){
31
++    if (__builtin_constant_p(s))
32
+     __asm__ ("sarl %1, %0\n\t"
33
+          : "+r" (a)
34
+-         : "ic" ((uint8_t)(-s))
35
++         : "i" (-s & 0x1F)
36
+     );
37
++    else
38
++        __asm__ ("sarl %1, %0\n\t"
39
++               : "+r" (a)
40
++               : "c" ((uint8_t)(-s))
41
++        );
42
+     return a;
43
+ }
44
+ 
45
+ #define NEG_USR32 NEG_USR32
46
+ static inline uint32_t NEG_USR32(uint32_t a, int8_t s){
47
++    if (__builtin_constant_p(s))
48
+     __asm__ ("shrl %1, %0\n\t"
49
+          : "+r" (a)
50
+-         : "ic" ((uint8_t)(-s))
51
++         : "i" (-s & 0x1F)
52
+     );
53
++    else
54
++        __asm__ ("shrl %1, %0\n\t"
55
++               : "+r" (a)
56
++               : "c" ((uint8_t)(-s))
57
++        );
58
+     return a;
59
+ }
60
+ 
61