[vlc-commits] [Git][videolan/vlc][master] 4 commits: deinterlace: only rely on x86inc.asm ARCH_X86_64 define

Steve Lhomme (@robUx4) gitlab at videolan.org
Tue Nov 19 09:43:06 UTC 2024



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
d80c0f81 by Steve Lhomme at 2024-11-19T09:14:25+00:00
deinterlace: only rely on x86inc.asm ARCH_X86_64 define

- - - - -
24fc5b7d by Steve Lhomme at 2024-11-19T09:14:25+00:00
configure: remove unused ARCH_X86_32 asm define

- - - - -
65a7f017 by Steve Lhomme at 2024-11-19T09:14:25+00:00
meson: add nasm support

- - - - -
400dc10a by Steve Lhomme at 2024-11-19T09:14:25+00:00
meson: add yadif assembler to deinterlacer

- - - - -


7 changed files:

- config.h.meson
- configure.ac
- doc/standalone/buildsystem.md
- meson.build
- modules/meson.build
- modules/video_filter/deinterlace/yadif_x86.asm
- modules/video_filter/meson.build


Changes:

=====================================
config.h.meson
=====================================
@@ -473,6 +473,9 @@
 /* Define to 1 if you have the `writev' function. */
 #mesondefine HAVE_WRITEV
 
+/* Use external asm on x86. */
+#mesondefine HAVE_X86ASM
+
 /* Define to 1 if you have the <xlocale.h> header file. */
 #mesondefine HAVE_XLOCALE_H
 


=====================================
configure.ac
=====================================
@@ -118,11 +118,11 @@ X86ASMFLAGS=""
 case "${host_cpu}" in
     i?86)
     X86ASMFLAGS="-f elf32"
-    X86ASMDEFS="-DARCH_X86_32=1 -DARCH_X86_64=0"
+    X86ASMDEFS="-DARCH_X86_64=0"
         ;;
     x86_64)
     X86ASMFLAGS="-f elf64"
-    X86ASMDEFS="-DARCH_X86_32=0 -DARCH_X86_64=1"
+    X86ASMDEFS="-DARCH_X86_64=1"
         ;;
 esac
 
@@ -411,7 +411,7 @@ int foo() { return my_array[0]; }
     AC_LIBOBJ([gai_strerror])
     AC_CHECK_FUNCS([if_nametoindex])
     X86ASMFLAGS="-f aout"
-    X86ASMDEFS="-DARCH_X86_32=1 -DARCH_X86_64=0 -DPREFIX"
+    X86ASMDEFS="-DARCH_X86_64=0 -DPREFIX"
     ;;
   *emscripten*)
     SYS=emscripten


=====================================
doc/standalone/buildsystem.md
=====================================
@@ -120,6 +120,9 @@ Currently the modules dict accepts the following keys:
 @param 	objc_args
 		Additional flags to pass to the Objective-C compiler.
 
+ at param 	nasm_args
+		Additional flags to pass to the NASM compiler.
+
 @param  link_args
 		Additional flags to pass to the dynamic linker. Do _not_ use this to specify
 		additional libraries to link with, use the `dependencies` instead.


=====================================
meson.build
=====================================
@@ -102,6 +102,25 @@ if host_system == 'darwin'
     add_languages('objc', native: false)
 endif
 
+if host_machine.cpu_family().startswith('x86')
+    if add_languages('nasm', native: false, required: false)
+        vlc_nasm_args = []
+        if host_machine.cpu_family() == 'x86'
+            vlc_nasm_args += ['-DARCH_X86_64=0']
+            if host_system in ['darwin', 'windows']
+                vlc_nasm_args += ['-DPREFIX']
+            endif
+        else
+            vlc_nasm_args += ['-DARCH_X86_64=1']
+            if host_system == 'darwin'
+                vlc_nasm_args += ['-DPREFIX']
+            endif
+        endif
+        add_project_arguments(vlc_nasm_args, language: ['nasm'])
+        cdata.set('HAVE_X86ASM', 1)
+    endif
+endif
+
 # Rust build system
 cargo_bin = find_program('cargo', required: get_option('rust'))
 


=====================================
modules/meson.build
=====================================
@@ -377,6 +377,7 @@ foreach module : vlc_modules
         'c_args',
         'cpp_args',
         'objc_args',
+        'nasm_args',
         'extra_files',
         'enabled',
     ]
@@ -413,6 +414,7 @@ foreach module : vlc_modules
         c_args: [module.get('c_args', []), common_args],
         cpp_args: [module.get('cpp_args', []), common_args],
         objc_args: [module.get('objc_args', []), common_args],
+        nasm_args: [module.get('nasm_args', []), []],
         extra_files: module.get('extra_files', []),
         build_by_default: true,
         install: true,


=====================================
modules/video_filter/deinterlace/yadif_x86.asm
=====================================
@@ -213,7 +213,7 @@ SECTION .text
 %endmacro
 
 %macro YADIF 0
-%if ARCH_X86_32
+%if ARCH_X86_64 == 0
 cglobal yadif_filter_line, 4, 6, 8, 112, dst, prev, cur, next, w, prefs, \
                                         mrefs, parity, mode
 %else
@@ -222,7 +222,7 @@ cglobal yadif_filter_line, 4, 7, 8,  80, dst, prev, cur, next, w, prefs, \
 %endif
     cmp      DWORD wm, 0
     jle .ret
-%if ARCH_X86_32
+%if ARCH_X86_64 == 0
     LEA            r4, pb_1
   %define pb_1 rsp + 80
   %define pw_1 rsp + 96
@@ -249,7 +249,7 @@ cglobal yadif_filter_line, 4, 7, 8,  80, dst, prev, cur, next, w, prefs, \
 
 .ret:
     RET
-%if ARCH_X86_32
+%if ARCH_X86_64 == 0
   %undef pb_1
   %undef pw_1
 %endif


=====================================
modules/video_filter/meson.build
=====================================
@@ -290,9 +290,7 @@ vlc_modules += {
 }
 
 # deinterlace filter
-vlc_modules += {
-    'name' : 'deinterlace',
-    'sources' : files(
+deinterlace_sources = files(
         'deinterlace/deinterlace.c',
         'deinterlace/merge.c',
         'deinterlace/helpers.c',
@@ -301,9 +299,18 @@ vlc_modules += {
         'deinterlace/algo_yadif.c',
         'deinterlace/algo_phosphor.c',
         'deinterlace/algo_ivtc.c',
-    ),
-    # Inline ASM doesn't build with -O0
-    # bring back if needed when inline ASM is supported 'c_args' : ['-O2'],
+    )
+deinterlace_cargs=[]
+if cdata.has('HAVE_X86ASM')
+    deinterlace_sources+=files('deinterlace/yadif_x86.asm')
+    # inline ASM doesn't build with -O0
+    deinterlace_cargs+=['-O2']
+endif
+vlc_modules += {
+    'name' : 'deinterlace',
+    'sources' : deinterlace_sources,
+    'c_args' : deinterlace_cargs,
+    'include_directories' : include_directories('../../extras/include/x86'),
     'link_with' : [deinterlacecommon_lib]
 }
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/bee0a17a3efa76723418b659b94f6880b2b304c3...400dc10ad45a130f3615fb17e76a6266c90d2d5f

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/bee0a17a3efa76723418b659b94f6880b2b304c3...400dc10ad45a130f3615fb17e76a6266c90d2d5f
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list