[packages/xavs2] - updated to 1.4 - added x86 patch to restore IA32 compatibility in quant8 code

qboosh qboosh at pld-linux.org
Sun Apr 9 10:20:22 CEST 2023


commit 78efc24cbce7073fadb51a5d1df65c9adad439c8
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sun Apr 9 10:22:51 2023 +0200

    - updated to 1.4
    - added x86 patch to restore IA32 compatibility in quant8 code

 xavs2-asm-arch.patch |  8 ++++----
 xavs2-x86.patch      | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 xavs2.spec           | 10 +++++----
 3 files changed, 67 insertions(+), 8 deletions(-)
---
diff --git a/xavs2.spec b/xavs2.spec
index 3880a47..cccc544 100644
--- a/xavs2.spec
+++ b/xavs2.spec
@@ -7,15 +7,16 @@
 Summary:	Open-source encoder of AVS2-P2/IEEE1857.4 video coding standard
 Summary(pl.UTF-8):	Koder standardu kodowania obrazu AVS2-P2/IEEE1857.4 o otwartych źródłach
 Name:		xavs2
-Version:	1.3
-Release:	2
+Version:	1.4
+Release:	1
 License:	GPL v2+
 Group:		Libraries
-#Source0Download: https://github.com/pkuvcl/xavs2/releases
+#Source0Download: https://github.com/pkuvcl/xavs2/tags
 Source0:	https://github.com/pkuvcl/xavs2/archive/%{version}/%{name}-%{version}.tar.gz
-# Source0-md5:	14995147d36e633f1155c8fea7269bea
+# Source0-md5:	b776941aad474fed23da1d1eb0c0b720
 Patch0:		%{name}-asm-arch.patch
 Patch1:		%{name}-opt.patch
+Patch2:		%{name}-x86.patch
 URL:		https://github.com/pkuvcl/xavs2
 %{?with_opencl:BuildRequires:	OpenCL-devel}
 %{?with_lsmash:BuildRequires:	l-smash-devel >= 1.5}
@@ -61,6 +62,7 @@ Statyczna biblioteka xavs2.
 %setup -q
 %patch0 -p1
 %patch1 -p1
+%patch2 -p1
 
 %build
 cd build/linux
diff --git a/xavs2-asm-arch.patch b/xavs2-asm-arch.patch
index 1159d4f..8260b59 100644
--- a/xavs2-asm-arch.patch
+++ b/xavs2-asm-arch.patch
@@ -53,12 +53,12 @@
      /* SSE 128bit */
      if (cpuid & XAVS2_CPU_SSE42) {
          pf->transpose_coeff_scan[LUMA_4x4][0] = coeff_scan_4x4_xy_sse128;
---- xavs2-1.3/source/common/intra.c.orig	2018-12-20 04:20:35.000000000 +0100
-+++ xavs2-1.3/source/common/intra.c	2019-07-29 20:13:42.964003401 +0200
-@@ -1918,7 +1918,7 @@
+--- xavs2-1.4/source/common/intra.c.orig	2023-04-09 08:05:35.401489788 +0200
++++ xavs2-1.4/source/common/intra.c	2023-04-09 08:06:31.667851633 +0200
+@@ -1926,7 +1926,7 @@ void xavs2_intra_pred_init(uint32_t cpui
      ipred[INTRA_ANG_Y_32]  = intra_pred_ang_y_32_c;
  
-     // TODO: 8bit����½Ƕ�7��9��11���ܲ�һ��   20170716 
+     // TODO: 8bit����½Ƕ�7��9��11���ܲ�һ��   20170716
 -#if HAVE_MMX
 +#if HAVE_MMX && ARCH_X86_64 /* only 64-bit asm for now */
      if (cpuid & XAVS2_CPU_SSE42) {
diff --git a/xavs2-x86.patch b/xavs2-x86.patch
new file mode 100644
index 0000000..52912d3
--- /dev/null
+++ b/xavs2-x86.patch
@@ -0,0 +1,57 @@
+--- xavs2-1.4/source/common/x86/quant8.asm.orig	2023-04-09 09:12:17.196476871 +0200
++++ xavs2-1.4/source/common/x86/quant8.asm	2023-04-09 09:13:53.645954359 +0200
+@@ -48,9 +48,15 @@ cextern pd_n32768
+ INIT_XMM sse4
+ cglobal quant, 2,3,8
+ ;{
++%if ARCH_X86_64
+     movq        m4, r2mp              ; m4[0] = scale
+     movq        m5, r3mp              ; m5[0] = shift
+     movq        m6, r4mp              ; m6[0] = add
++%else
++    movd        m4, r2mp              ; m4[0] = scale
++    movd        m5, r3mp              ; m5[0] = shift
++    movd        m6, r4mp              ; m6[0] = add
++%endif
+     mov         r2, r1                ; r2    = i_coef
+     shr         r1, 3                 ; r1    = i_coef/8
+     pxor        m7, m7                ; m7 <-- num_non_zero = 0
+@@ -86,9 +92,15 @@ cglobal quant, 2,3,8
+                                       ;
+     packuswb    m7, m7                ;
+     psadbw      m7, m0                ;
++%if ARCH_X86_64
+     movifnidn  rax, r2                ; eax <-- i_coef
+     movq        r1, m7                ;
+     sub        rax, r1                ; return value: num_non_zero
++%else
++    movifnidn  eax, r2                ; eax <-- i_coef
++    movd        r1, m7                ;
++    sub        eax, r1                ; return value: num_non_zero
++%endif
+     RET                               ; return
+ ;}
+ 
+@@ -103,13 +103,22 @@ INIT_XMM sse4
+ cglobal dequant, 2,4,7
+ ;{
+     mov         r3, r3mp              ; r3  <-- shift
++%if ARCH_X86_64
+     movq        m4, r2mp              ; m4[0] = scale
+     movq        m6, r3                ; m6[0] = shift
++%else
++    movd        m4, r2mp              ; m4[0] = scale
++    movd        m6, r3                ; m6[0] = shift
++%endif
+     dec         r3                    ; r3d <-- shift - 1
+     xor         r2, r2                ; r2 <-- 0
+     shr         r1, 4                 ; r1    = i_coef/16
+     bts         r2, r3                ; r2 <-- add = 1 < (shift - 1)
++%if ARCH_X86_64
+     movq        m5, r2                ; m5[0] = add
++%else
++    movd        m5, r2                ; m5[0] = add
++%endif
+     pshufd      m4, m4, 0             ; m4[3210] = scale
+     pshufd      m5, m5, 0             ; m5[3210] = add
+                                       ;
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/xavs2.git/commitdiff/78efc24cbce7073fadb51a5d1df65c9adad439c8



More information about the pld-cvs-commit mailing list