Skip to content

Commit fe84b2a

Browse files
lrgirdwoclaude
andcommitted
ffmpeg_dec: enable FFmpeg asm + repoint to sof-hifi for Xtensa HiFi float_dsp
Activate the Xtensa HiFi AVFloatDSPContext kernels (lgirdwood/FFmpeg sof-hifi, ff_float_dsp_init_xtensa) in the ffmpeg_dec module build: - ffmpeg.cmake: stop passing --disable-asm to FFmpeg configure. FFmpeg treats every per-arch optimisation dir -- including our C-intrinsic libavutil/xtensa/ -- as "asm"; --disable-asm forces arch=c and drops them (ARCH_XTENSA=0). There is no Xtensa assembly, so leaving asm enabled is safe and is what makes ARCH_XTENSA=1 and builds ff_float_dsp_init_xtensa. - west.yml: bump ffmpeg to sof-hifi @ a600a78acd (adds libavutil/xtensa HiFi float_dsp on top of the av_tx table cap). Verified: pristine ptl (intel_adsp/ace30/ptl) AAC build (FLAC+AAC) reconfigures FFmpeg with ARCH_XTENSA=1, compiles libavutil/xtensa/float_dsp_init.o, links it into ffmpeg_dec.llext with no errors or dangerous relocations. Under the Zephyr-SDK GCC the kernels run as the scalar C fallback (GCC lacks xt_hifi4.h); the xtfloatx2 SIMD path activates with an xt-clang/XCC build for the ace30 core. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 10f174f commit fe84b2a

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

src/audio/ffmpeg_dec/ffmpeg.cmake

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,12 @@ ExternalProject_Add(ffmpeg_ext
180180
--prefix=${FFMPEG_INSTALL_DIR}
181181
--enable-cross-compile --target-os=none --arch=xtensa
182182
--cross-prefix=${_ff_cross_prefix} --cc=${CMAKE_C_COMPILER}
183-
--disable-asm --disable-all --disable-everything --disable-autodetect
183+
# NOTE: do NOT pass --disable-asm. FFmpeg treats every per-arch
184+
# optimisation dir (incl. our C-intrinsic libavutil/xtensa/) as
185+
# "asm"; --disable-asm forces arch=c and drops them. There is no
186+
# Xtensa assembly, so leaving asm enabled is safe (HiFi kernels are
187+
# C intrinsics) and is required to build ff_float_dsp_init_xtensa.
188+
--disable-all --disable-everything --disable-autodetect
184189
--disable-programs --disable-doc --disable-network
185190
--disable-avformat --disable-avdevice ${_ff_avfilter_cfg}
186191
--disable-swscale --disable-postproc

west.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,13 @@ manifest:
6666

6767
# FFmpeg (libavcodec) source for the ffmpeg_dec module. Cross-built by
6868
# src/audio/ffmpeg_dec/ffmpeg.cmake, enabling only the Kconfig-selected
69-
# decoders. SOF fork branch sof-ffmpeg-dec (release/7.1 + the av_tx table-size
70-
# cap that drops the module .bss from ~17MB to ~415KB). Bump to move versions.
69+
# decoders. SOF fork branch sof-hifi (release/7.1 + av_tx table-size cap that drops
70+
# the module .bss from ~17MB to ~415KB, + Xtensa HiFi float_dsp). Bump to move
71+
# versions.
7172
- name: ffmpeg
7273
repo-path: FFmpeg
7374
path: modules/audio/ffmpeg
74-
revision: bc25d8d606e63c1ae8663fc0523adad908bc29e5
75+
revision: a600a78acded219a98c426af0e353e6f2d689b9d
7576
remote: ffmpeg
7677

7778
# libshine: small fixed-point MP3 encoder for FFMPEG_ENC_MP3 (FFmpeg has no

0 commit comments

Comments
 (0)