diff --git a/.devcontainer b/.devcontainer index 917b290bbfab5..d47cc027b4293 160000 --- a/.devcontainer +++ b/.devcontainer @@ -1 +1 @@ -Subproject commit 917b290bbfab57727a7d039a7fa4ac71044200ef +Subproject commit d47cc027b4293eb09454599c395ecb4f2a6a5b58 diff --git a/.github/workflows/xpbuild.yml b/.github/workflows/xpbuild.yml index 961bdb6d449c0..0caf558fd59fc 100644 --- a/.github/workflows/xpbuild.yml +++ b/.github/workflows/xpbuild.yml @@ -1,4 +1,7 @@ name: Build +permissions: + contents: read + pull-requests: write on: push: branches: [ "dev" ] @@ -7,19 +10,16 @@ on: workflow_dispatch: jobs: linux: - uses: externpro/externpro/.github/workflows/build-linux.yml@25.05.2 + permissions: + contents: read + pull-requests: write + packages: write + uses: externpro/externpro/.github/workflows/build-linux.yml@25.07.3 with: cmake-workflow-preset: LinuxRelease - runon: ubuntu-latest - secrets: inherit - linux-arm64: - uses: externpro/externpro/.github/workflows/build-linux.yml@25.05.2 - with: - cmake-workflow-preset: LinuxRelease - runon: ubuntu-24.04-arm secrets: inherit macos: - uses: externpro/externpro/.github/workflows/build-macos.yml@25.05.2 + uses: externpro/externpro/.github/workflows/build-macos.yml@25.07.3 with: cmake-workflow-preset: DarwinRelease secrets: inherit diff --git a/.github/workflows/xprelease.yml b/.github/workflows/xprelease.yml index 273199e97dd28..86b6f88b58bbd 100644 --- a/.github/workflows/xprelease.yml +++ b/.github/workflows/xprelease.yml @@ -9,10 +9,9 @@ on: jobs: # Upload build artifacts as release assets release-from-build: - uses: externpro/externpro/.github/workflows/release-from-build.yml@25.05.2 + uses: externpro/externpro/.github/workflows/release-from-build.yml@25.07.3 with: workflow_run_url: ${{ github.event.inputs.workflow_run_url }} - artifact_pattern: "*.tar.xz" permissions: contents: write id-token: write diff --git a/CMakeLists.txt b/CMakeLists.txt index c7882991e0757..b1c8966582573 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,8 +1,6 @@ cmake_minimum_required(VERSION 3.31) set(CMAKE_PROJECT_TOP_LEVEL_INCLUDES .devcontainer/cmake/xproinc.cmake) project(FFmpeg) -include(GNUInstallDirs) -include(xpflags) set(libs # libraries, in linking order # https://github.com/FFmpeg/FFmpeg/blob/n2.6.2/configure#L2667-L2675 avdevice @@ -18,17 +16,15 @@ string(JOIN "\n" EXT1 "# https://github.com/FFmpeg/FFmpeg/blob/n2.6.2/configure#L2667-L2675" "# TRICKY ffmpeg_all_libs used by FFmpeg-targets.cmake" "set(ffmpeg_all_libs ${libs})" - "# FFMPEG_LIBRARIES - the FFmpeg libraries" - "set(FFMPEG_LIBRARIES \${ffmpeg_all_libs})" - "list(TRANSFORM FFMPEG_LIBRARIES PREPEND ffmpeg::)" - "list(APPEND reqVars FFMPEG_LIBRARIES)" "" ) -if(NOT DEFINED XP_INSTALL_CMAKEDIR) - set(XP_INSTALL_CMAKEDIR ${CMAKE_INSTALL_DATADIR}/cmake) -endif() set(targetsFile ${PROJECT_NAME}-targets) -xpPackageDevel(TARGETS_FILE ${targetsFile} DEPS openh264) +xpExternPackage(NAMESPACE ffmpeg + TARGETS_FILE ${targetsFile} LIBRARIES ${libs} + BASE n4.3.1 XPDIFF "native(unix)" DEPS openh264 PVT_DEPS yasm + DESC "complete, cross-platform solution to record, convert and stream audio and video (pre-release: no windows package)" + LICENSE "[LGPL-2.1](https://www.ffmpeg.org/legal.html 'LGPL version 2.1 or later')" + ) install(FILES cmake/${targetsFile}.cmake DESTINATION ${XP_INSTALL_CMAKEDIR}) string(TOLOWER ${PROJECT_NAME} prj) if(CMAKE_SYSTEM_NAME STREQUAL "Windows") diff --git a/libavcodec/x86/mathops.h b/libavcodec/x86/mathops.h index 6298f5ed1983b..ca7e2dffc1076 100644 --- a/libavcodec/x86/mathops.h +++ b/libavcodec/x86/mathops.h @@ -35,12 +35,20 @@ static av_always_inline av_const int MULL(int a, int b, unsigned shift) { int rt, dummy; + if (__builtin_constant_p(shift)) __asm__ ( "imull %3 \n\t" "shrdl %4, %%edx, %%eax \n\t" :"=a"(rt), "=d"(dummy) - :"a"(a), "rm"(b), "ci"((uint8_t)shift) + :"a"(a), "rm"(b), "i"(shift & 0x1F) ); + else + __asm__ ( + "imull %3 \n\t" + "shrdl %4, %%edx, %%eax \n\t" + :"=a"(rt), "=d"(dummy) + :"a"(a), "rm"(b), "c"((uint8_t)shift) + ); return rt; } @@ -113,19 +121,31 @@ __asm__ volatile(\ // avoid +32 for shift optimization (gcc should do that ...) #define NEG_SSR32 NEG_SSR32 static inline int32_t NEG_SSR32( int32_t a, int8_t s){ + if (__builtin_constant_p(s)) __asm__ ("sarl %1, %0\n\t" : "+r" (a) - : "ic" ((uint8_t)(-s)) + : "i" (-s & 0x1F) ); + else + __asm__ ("sarl %1, %0\n\t" + : "+r" (a) + : "c" ((uint8_t)(-s)) + ); return a; } #define NEG_USR32 NEG_USR32 static inline uint32_t NEG_USR32(uint32_t a, int8_t s){ + if (__builtin_constant_p(s)) __asm__ ("shrl %1, %0\n\t" : "+r" (a) - : "ic" ((uint8_t)(-s)) + : "i" (-s & 0x1F) ); + else + __asm__ ("shrl %1, %0\n\t" + : "+r" (a) + : "c" ((uint8_t)(-s)) + ); return a; }