I will look into this patch soon as I already have a patch
for actual arm64 cpu feature detection and we also need to
make sure that this update does not break browsers.

On 23/02/24 17:11 -0500, Brad Smith wrote:
> Here is an update to libvpx 1.14.0.
> 
> 
> 2024-01-18 v1.14.0 "Venetian Duck"
> 
>   This release drops support for old C compilers, such as Visual Studio 2012
>   and older, that disallow mixing variable declarations and statements (a C99
>   feature). It adds support for run-time CPU feature detection for Arm
>   platforms, as well as support for darwin23 (macOS 14).
> 
>   - Upgrading:
>     This release is ABI incompatible with the previous release.
> 
>     Various new features for rate control library for real-time: SVC parallel
>     encoding, loopfilter level, support for frame dropping, and screen 
> content.
> 
>     New callback function send_tpl_gop_stats for vp9 external rate control
>     library, which can be used to transmit TPL stats for a group of pictures. 
> A
>     public header vpx_tpl.h is added for the definition of TPL stats used in
>     this callback.
> 
>     libwebm is upgraded to libwebm-1.0.0.29-9-g1930e3c.
> 
>   - Enhancement:
>     Improvements on Neon optimizations: VoD: 12-35% speed up for bitdepth 8,
>     68%-151% speed up for high bitdepth.
>     Improvements on AVX2 and SSE optimizations.
>     Improvements on LSX optimizations for LoongArch.
>     42-49% speedup on speed 0 VoD encoding.
>     Android API level predicates.
> 
>   - Bug fixes:
>     Fix to missing prototypes from the rtcd header.
>     Fix to segfault when total size is enlarged but width is smaller.
>     Fix to the build for arm64ec using MSVC.
>     Fix to copy BLOCK_8X8's mi to PICK_MODE_CONTEXT::mic.
>     Fix to -Wshadow warnings.
>     Fix to heap overflow in vpx_get4x4sse_cs_neon.
>     Fix to buffer overrun in highbd Neon subpel variance filters.
>     Added bitexact encode test script.
>     Fix to -Wl,-z,defs with Clang's sanitizers.
>     Fix to decoder stability after error & continued decoding.
>     Fix to mismatch of VP9 encode with NEON intrinsics with C only version.
>     Fix to Arm64 MSVC compile vpx_highbd_fdct4x4_neon.
>     Fix to fragments count before use.
>     Fix to a case where target bandwidth is 0 for SVC.
>     Fix mask in vp9_quantize_avx2,highbd_get_max_lane_eob.
>     Fix to int overflow in vp9_calc_pframe_target_size_one_pass_cbr.
>     Fix to integer overflow in vp8,ratectrl.c.
>     Fix to interger overflow in vp9 svc.
>     Fix to avg_frame_bandwidth overflow.
>     Fix to per frame qp for temporal layers.
>     Fix to unsigned integer overflow in sse computation.
>     Fix to uninitialized mesh feature for BEST mode.
>     Fix to overflow in highbd temporal_filter.
>     Fix to unaligned loads w/w==4 in vpx_convolve_copy_neon.
>     Skip arm64_neon.h workaround w/VS >= 2019.
>     Fix to c vs avx mismatch of diamond_search_sad().
>     Fix to c vs intrinsic mismatch of vpx_hadamard_32x32() function.
>     Fix to a bug in vpx_hadamard_32x32_neon().
>     Fix to Clang -Wunreachable-code-aggressive warnings.
>     Fix to a bug in vpx_highbd_hadamard_32x32_neon().
>     Fix to -Wunreachable-code in mfqe_partition.
>     Force mode search on 64x64 if no mode is selected.
>     Fix to ubsan failure caused by left shift of negative.
>     Fix to integer overflow in calc_pframe_target_size.
>     Fix to float-cast-overflow in vp8_change_config().
>     Fix to a null ptr before use.
>     Conditionally skip using inter frames in speed features.
>     Remove invalid reference frames.
>     Disable intra mode search speed features conditionally.
>     Set nonrd keyframe under dynamic change of deadline for rtc.
>     Fix to scaled reference offsets.
>     Set skip_recode=0 in nonrd_pick_sb_modes.
>     Fix to an edge case when downsizing to one.
>     Fix to a bug in frame scaling.
>     Fix to pred buffer stride.
>     Fix to a bug in simple motion search.
>     Update frame size in actual encoding.
> 
> 
> Index: Makefile
> ===================================================================
> RCS file: /cvs/ports/multimedia/libvpx/Makefile,v
> retrieving revision 1.54
> diff -u -p -u -p -r1.54 Makefile
> --- Makefile  8 Feb 2024 13:39:39 -0000       1.54
> +++ Makefile  22 Feb 2024 07:59:17 -0000
> @@ -2,13 +2,11 @@ COMMENT=    Google VP8/VP9 video codec
>  
>  GH_ACCOUNT=  webmproject
>  GH_PROJECT=  libvpx
> -GH_TAGNAME=  v1.13.1
> +GH_TAGNAME=  v1.14.0
>  EPOCH=               0
>  CATEGORIES=  multimedia
>  
> -REVISION=    1
> -
> -SHARED_LIBS= vpx     16.0
> +SHARED_LIBS= vpx     17.0
>  
>  HOMEPAGE=    https://www.webmproject.org/
>  
> @@ -36,7 +34,6 @@ CONFIGURE_ARGS+=--enable-shared \
>               --enable-runtime-cpu-detect \
>               --enable-vp9-highbitdepth \
>               --prefix=${PREFIX} \
> -             --enable-optimizations \
>               --enable-unit-tests \
>               --enable-decode-perf-tests \
>               --enable-encode-perf-tests
> Index: distinfo
> ===================================================================
> RCS file: /cvs/ports/multimedia/libvpx/distinfo,v
> retrieving revision 1.23
> diff -u -p -u -p -r1.23 distinfo
> --- distinfo  2 Oct 2023 18:11:05 -0000       1.23
> +++ distinfo  22 Feb 2024 07:59:17 -0000
> @@ -1,2 +1,2 @@
> -SHA256 (libvpx-1.13.1.tar.gz) = ANroBGVWcnKr0Hf1k1X5WskdeAmi0wBvms4mN91CnRQ=
> -SIZE (libvpx-1.13.1.tar.gz) = 5515662
> +SHA256 (libvpx-1.14.0.tar.gz) = XyHS2ycHHIpG8XJZKKECJ65Fxc0crTcn5Kr75HbjIfo=
> +SIZE (libvpx-1.14.0.tar.gz) = 5606471
> Index: patches/patch-build_make_Makefile
> ===================================================================
> RCS file: /cvs/ports/multimedia/libvpx/patches/patch-build_make_Makefile,v
> retrieving revision 1.17
> diff -u -p -u -p -r1.17 patch-build_make_Makefile
> --- patches/patch-build_make_Makefile 4 Oct 2022 11:30:19 -0000       1.17
> +++ patches/patch-build_make_Makefile 22 Feb 2024 07:59:17 -0000
> @@ -1,17 +1,18 @@
>  Index: build/make/Makefile
>  --- build/make/Makefile.orig
>  +++ build/make/Makefile
> -@@ -312,8 +312,7 @@ define so_template
> +@@ -333,9 +333,7 @@ define so_template
>   # This needs further abstraction for dealing with non-GNU linkers.
>   $(1):
>       $(if $(quiet),@echo "    [LD] $$@")
>  -    $(qexec)$$(LD) -shared $$(LDFLAGS) \
> --            -Wl,--no-undefined -Wl,-soname,$$(SONAME) \
> +-            $(NO_UNDEFINED) \
> +-            -Wl,-soname,$$(SONAME) \
>  +    $(qexec)$$(LD) -shared -fPIC $$(LDFLAGS) \
>               -Wl,--version-script,$$(EXPORTS_FILE) -o $$@ \
>               $$(filter %.o,$$^) $$(extralibs)
>   endef
> -@@ -398,7 +397,7 @@ LIBS=$(call enabled,LIBS)
> +@@ -420,7 +418,7 @@ LIBS=$(call enabled,LIBS)
>   .libs: $(LIBS)
>       @touch $@
>   $(foreach lib,$(filter %_g.a,$(LIBS)),$(eval $(call 
> archive_template,$(lib))))
> Index: patches/patch-build_make_configure_sh
> ===================================================================
> RCS file: /cvs/ports/multimedia/libvpx/patches/patch-build_make_configure_sh,v
> retrieving revision 1.10
> diff -u -p -u -p -r1.10 patch-build_make_configure_sh
> --- patches/patch-build_make_configure_sh     8 Feb 2024 12:33:18 -0000       
> 1.10
> +++ patches/patch-build_make_configure_sh     22 Feb 2024 07:59:17 -0000
> @@ -1,7 +1,7 @@
>  Index: build/make/configure.sh
>  --- build/make/configure.sh.orig
>  +++ build/make/configure.sh
> -@@ -700,8 +700,8 @@ post_process_cmdline() {
> +@@ -701,8 +701,8 @@ post_process_cmdline() {
>   }
>   
>   setup_gnu_toolchain() {
> @@ -12,7 +12,7 @@ Index: build/make/configure.sh
>     AR=${AR:-${CROSS}ar}
>     LD=${LD:-${CROSS}${link_with_cc:-ld}}
>     AS=${AS:-${CROSS}as}
> -@@ -745,7 +745,7 @@ check_xcode_minimum_version() {
> +@@ -746,7 +746,7 @@ check_xcode_minimum_version() {
>   
>   process_common_toolchain() {
>     if [ -z "$toolchain" ]; then
> @@ -21,7 +21,7 @@ Index: build/make/configure.sh
>       # detect tgt_isa
>       case "$gcctarget" in
>         aarch64*)
> -@@ -988,7 +988,7 @@ process_common_toolchain() {
> +@@ -1012,7 +1012,7 @@ EOF
>   
>         case ${tgt_cc} in
>           gcc)
> @@ -30,7 +30,7 @@ Index: build/make/configure.sh
>             setup_gnu_toolchain
>             arch_int=${tgt_isa##armv}
>             arch_int=${arch_int%%te}
> -@@ -1203,7 +1203,7 @@ EOF
> +@@ -1230,7 +1230,7 @@ EOF
>         esac
>         ;;
>       mips*)
> @@ -39,7 +39,7 @@ Index: build/make/configure.sh
>         setup_gnu_toolchain
>         tune_cflags="-mtune="
>         if enabled dspr2; then
> -@@ -1254,7 +1254,7 @@ EOF
> +@@ -1281,7 +1281,7 @@ EOF
>         check_add_asflags -KPIC
>         ;;
>       ppc64le*)
> @@ -48,7 +48,7 @@ Index: build/make/configure.sh
>         setup_gnu_toolchain
>         # Do not enable vsx by default.
>         # https://bugs.chromium.org/p/webm/issues/detail?id=1522
> -@@ -1311,7 +1311,7 @@ EOF
> +@@ -1338,7 +1338,7 @@ EOF
>             esac
>             ;;
>           gcc*)
> @@ -57,7 +57,7 @@ Index: build/make/configure.sh
>             tune_cflags="-march="
>             setup_gnu_toolchain
>             #for 32 bit x86 builds, -O3 did not turn on this flag
> -@@ -1442,7 +1442,7 @@ EOF
> +@@ -1469,7 +1469,7 @@ EOF
>         esac
>         ;;
>       loongarch*)
> @@ -66,7 +66,7 @@ Index: build/make/configure.sh
>         setup_gnu_toolchain
>   
>         enabled lsx && check_inline_asm lsx '"vadd.b $vr0, $vr1, $vr1"'
> -@@ -1451,7 +1451,7 @@ EOF
> +@@ -1478,7 +1478,7 @@ EOF
>         enabled lasx && soft_enable runtime_cpu_detect
>         ;;
>       *-gcc|generic-gnu)
> Index: patches/patch-configure
> ===================================================================
> RCS file: /cvs/ports/multimedia/libvpx/patches/patch-configure,v
> retrieving revision 1.25
> diff -u -p -u -p -r1.25 patch-configure
> --- patches/patch-configure   9 Apr 2023 06:15:33 -0000       1.25
> +++ patches/patch-configure   22 Feb 2024 07:59:17 -0000
> @@ -1,7 +1,7 @@
>  Index: configure
>  --- configure.orig
>  +++ configure
> -@@ -123,7 +123,9 @@ all_platforms="${all_platforms} loongarch32-linux-gcc"
> +@@ -126,7 +126,9 @@ all_platforms="${all_platforms} loongarch32-linux-gcc"
>   all_platforms="${all_platforms} loongarch64-linux-gcc"
>   all_platforms="${all_platforms} mips32-linux-gcc"
>   all_platforms="${all_platforms} mips64-linux-gcc"
> @@ -11,7 +11,7 @@ Index: configure
>   all_platforms="${all_platforms} sparc-solaris-gcc"
>   all_platforms="${all_platforms} x86-android-gcc"
>   all_platforms="${all_platforms} x86-darwin8-gcc"
> -@@ -183,7 +185,7 @@ for t in ${all_targets}; do
> +@@ -187,7 +189,7 @@ for t in ${all_targets}; do
>       [ -f "${source_path}/${t}.mk" ] && enable_feature ${t}
>   done
>   
> @@ -20,7 +20,7 @@ Index: configure
>     die "diff missing: Try installing diffutils via your package manager."
>   fi
>   
> -@@ -198,19 +200,6 @@ if [ "`cd \"${source_path}\" && pwd`" != "`pwd`" ]; th
> +@@ -202,19 +204,6 @@ if [ "`cd \"${source_path}\" && pwd`" != "`pwd`" ]; th
>     fi
>   fi
>   
> @@ -40,7 +40,7 @@ Index: configure
>   # disable codecs when their source directory does not exist
>   [ -d "${source_path}/vp8" ] || disable_codec vp8
>   [ -d "${source_path}/vp9" ] || disable_codec vp9
> -@@ -548,7 +537,7 @@ process_detect() {
> +@@ -560,7 +549,7 @@ process_detect() {
>           # here rather than at option parse time because the target 
> auto-detect
>           # magic happens after the command line has been parsed.
>           case "${tgt_os}" in
> Index: patches/patch-examples_mk
> ===================================================================
> RCS file: /cvs/ports/multimedia/libvpx/patches/patch-examples_mk,v
> retrieving revision 1.11
> diff -u -p -u -p -r1.11 patch-examples_mk
> --- patches/patch-examples_mk 11 Mar 2022 19:39:22 -0000      1.11
> +++ patches/patch-examples_mk 22 Feb 2024 07:59:17 -0000
> @@ -1,7 +1,7 @@
>  Index: examples.mk
>  --- examples.mk.orig
>  +++ examples.mk
> -@@ -334,7 +334,7 @@ else
> +@@ -333,7 +333,7 @@ else
>   SHARED_LIB_SUF=.so
>   endif
>   endif
> Index: patches/patch-libs_mk
> ===================================================================
> RCS file: /cvs/ports/multimedia/libvpx/patches/patch-libs_mk,v
> retrieving revision 1.24
> diff -u -p -u -p -r1.24 patch-libs_mk
> --- patches/patch-libs_mk     8 Feb 2024 13:39:39 -0000       1.24
> +++ patches/patch-libs_mk     22 Feb 2024 07:59:17 -0000
> @@ -1,7 +1,7 @@
>  Index: libs.mk
>  --- libs.mk.orig
>  +++ libs.mk
> -@@ -335,22 +335,17 @@ EXPORT_FILE             := libvpx.def
> +@@ -336,22 +336,17 @@ EXPORT_FILE             := libvpx.def
>   LIBVPX_SO_SYMLINKS      :=
>   LIBVPX_SO_IMPLIB        := libvpx_dll.a
>   else
> @@ -25,7 +25,7 @@ Index: libs.mk
>   $(BUILD_PFX)$(LIBVPX_SO): EXPORTS_FILE = $(EXPORT_FILE)
>   
>   libvpx.def: $(call enabled,CODEC_EXPORTS)
> -@@ -373,15 +368,7 @@ $(1): $(2)
> +@@ -374,15 +369,7 @@ $(1): $(2)
>       $(qexec)ln -sf $(2) $$@
>   endef
>   
> @@ -41,16 +41,16 @@ Index: libs.mk
>   INSTALL-LIBS-$(CONFIG_SHARED) += $(LIBSUBDIR)/$(LIBVPX_SO)
>   INSTALL-LIBS-$(CONFIG_SHARED) += $(if 
> $(LIBVPX_SO_IMPLIB),$(LIBSUBDIR)/$(LIBVPX_SO_IMPLIB))
>   
> -@@ -544,7 +531,7 @@ testdata: $(LIBVPX_TEST_DATA)
> +@@ -545,7 +532,7 @@ testdata: $(LIBVPX_TEST_DATA)
>               set -e;\
>               echo "Checking test data:";\
>               for f in $(call enabled,LIBVPX_TEST_DATA); do\
>  -                grep $$f $(SRC_PATH_BARE)/test/test-data.sha1 |\
>  +                grep $$f $(SRC_PATH_BARE)/test/test-data.sha1 | tr -d '*' |\
> -                     (cd $(LIBVPX_TEST_DATA_PATH); $${sha1sum} -c);\
> +                     (cd "$(LIBVPX_TEST_DATA_PATH)"; $${sha1sum} -c);\
>               done; \
>           else\
> -@@ -656,7 +643,7 @@ BINS-yes += $(LIBVPX_TEST_BIN)
> +@@ -657,7 +644,7 @@ BINS-yes += $(LIBVPX_TEST_BIN)
>   
>   CODEC_LIB=$(if $(CONFIG_DEBUG_LIBS),vpx_g,vpx)
>   CODEC_LIB_SUF=$(if $(CONFIG_SHARED),$(SHARED_LIB_SUF),.a)
> @@ -59,7 +59,7 @@ Index: libs.mk
>   $(LIBVPX_TEST_BIN): $(TEST_LIBS)
>   $(eval $(call linkerxx_template,$(LIBVPX_TEST_BIN), \
>                 $(LIBVPX_TEST_OBJS) \
> -@@ -715,6 +702,8 @@ test_shard.$(1) test_shard_ndc.$(1): $(LIBVPX_TEST_BIN
> +@@ -716,6 +703,8 @@ test_shard.$(1) test_shard_ndc.$(1): $(LIBVPX_TEST_BIN
>       @set -e; \
>        export GTEST_SHARD_INDEX=$(1); \
>        export GTEST_TOTAL_SHARDS=$(2); \
> Index: patches/patch-vpx_ports_aarch32_cpudetect_c
> ===================================================================
> RCS file: patches/patch-vpx_ports_aarch32_cpudetect_c
> diff -N patches/patch-vpx_ports_aarch32_cpudetect_c
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-vpx_ports_aarch32_cpudetect_c       22 Feb 2024 07:59:17 
> -0000
> @@ -0,0 +1,23 @@
> +Allow ARM CPU runtime detection code to build on OpenBSD.
> +
> +Index: vpx_ports/aarch32_cpudetect.c
> +--- vpx_ports/aarch32_cpudetect.c.orig
> ++++ vpx_ports/aarch32_cpudetect.c
> +@@ -12,7 +12,7 @@
> + #include "./vpx_config.h"
> + #include "arm_cpudetect.h"
> + 
> +-#if !CONFIG_RUNTIME_CPU_DETECT
> ++#if !CONFIG_RUNTIME_CPU_DETECT || defined(__OpenBSD__)
> + 
> + static int arm_get_cpu_caps(void) {
> +   // This function should actually be a no-op. There is no way to adjust 
> any of
> +@@ -25,7 +25,7 @@ static int arm_get_cpu_caps(void) {
> +   return flags;
> + }
> + 
> +-#elif defined(_MSC_VER)  // end !CONFIG_RUNTIME_CPU_DETECT
> ++#elif defined(_MSC_VER)  // end !CONFIG_RUNTIME_CPU_DETECT || __OpenBSD__
> + 
> + static int arm_get_cpu_caps(void) {
> +   int flags = 0;
> Index: patches/patch-vpx_ports_aarch64_cpudetect_c
> ===================================================================
> RCS file: patches/patch-vpx_ports_aarch64_cpudetect_c
> diff -N patches/patch-vpx_ports_aarch64_cpudetect_c
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-vpx_ports_aarch64_cpudetect_c       22 Feb 2024 07:59:17 
> -0000
> @@ -0,0 +1,23 @@
> +Allow ARM CPU runtime detection code to build on OpenBSD.
> +
> +Index: vpx_ports/aarch64_cpudetect.c
> +--- vpx_ports/aarch64_cpudetect.c.orig
> ++++ vpx_ports/aarch64_cpudetect.c
> +@@ -15,7 +15,7 @@
> + #include <sys/sysctl.h>
> + #endif
> + 
> +-#if !CONFIG_RUNTIME_CPU_DETECT
> ++#if !CONFIG_RUNTIME_CPU_DETECT || defined(__OpenBSD__)
> + 
> + static int arm_get_cpu_caps(void) {
> +   // This function should actually be a no-op. There is no way to adjust 
> any of
> +@@ -28,7 +28,7 @@ static int arm_get_cpu_caps(void) {
> +   return flags;
> + }
> + 
> +-#elif defined(__APPLE__)  // end !CONFIG_RUNTIME_CPU_DETECT
> ++#elif defined(__APPLE__)  // end !CONFIG_RUNTIME_CPU_DETECT || __OpenBSD__
> + 
> + // sysctlbyname() parameter documentation for instruction set 
> characteristics:
> + // 
> https://developer.apple.com/documentation/kernel/1387446-sysctlbyname/determining_instruction_set_characteristics
> Index: patches/patch-vpx_ports_arm_cpudetect_c
> ===================================================================
> RCS file: patches/patch-vpx_ports_arm_cpudetect_c
> diff -N patches/patch-vpx_ports_arm_cpudetect_c
> --- patches/patch-vpx_ports_arm_cpudetect_c   13 Mar 2022 13:50:53 -0000      
> 1.4
> +++ /dev/null 1 Jan 1970 00:00:00 -0000
> @@ -1,23 +0,0 @@
> -Allow ARM CPU runtime detection code to build on OpenBSD.
> -
> -Index: vpx_ports/arm_cpudetect.c
> ---- vpx_ports/arm_cpudetect.c.orig
> -+++ vpx_ports/arm_cpudetect.c
> -@@ -38,7 +38,7 @@ static int arm_cpu_env_mask(void) {
> -   return env && *env ? (int)strtol(env, NULL, 0) : ~0;
> - }
> - 
> --#if !CONFIG_RUNTIME_CPU_DETECT
> -+#if !CONFIG_RUNTIME_CPU_DETECT || defined(__OpenBSD__)
> - 
> - int arm_cpu_caps(void) {
> -   /* This function should actually be a no-op. There is no way to adjust 
> any of
> -@@ -56,7 +56,7 @@ int arm_cpu_caps(void) {
> -   return flags & mask;
> - }
> - 
> --#elif defined(_MSC_VER) /* end !CONFIG_RUNTIME_CPU_DETECT */
> -+#elif defined(_MSC_VER) /* end !CONFIG_RUNTIME_CPU_DETECT || __OpenBSD__ */
> - /*For GetExceptionCode() and EXCEPTION_ILLEGAL_INSTRUCTION.*/
> - #ifndef WIN32_LEAN_AND_MEAN
> - #define WIN32_LEAN_AND_MEAN
> Index: pkg/PLIST
> ===================================================================
> RCS file: /cvs/ports/multimedia/libvpx/pkg/PLIST,v
> retrieving revision 1.10
> diff -u -p -u -p -r1.10 PLIST
> --- pkg/PLIST 11 Mar 2022 19:39:22 -0000      1.10
> +++ pkg/PLIST 22 Feb 2024 07:59:17 -0000
> @@ -11,6 +11,7 @@ include/vpx/vpx_ext_ratectrl.h
>  include/vpx/vpx_frame_buffer.h
>  include/vpx/vpx_image.h
>  include/vpx/vpx_integer.h
> +include/vpx/vpx_tpl.h
>  @static-lib lib/libvpx.a
>  @lib lib/libvpx.so.${LIBvpx_VERSION}
>  lib/pkgconfig/vpx.pc
> 

-- 
Regards,
Robert Nagy

Reply via email to