Skip to contentSkip to conversation

ffmpeg: don't use hardcoded lookup tables

PATCH In review Ross Burton 2 participants 3 messages Jul 19, 2019 – Jul 20, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 ffmpeg: don't use hardcoded lookup tables

ffmpeg can generate lookup tables at build time instead of runtime, but this is no longer a recommended option. The size impact is significant (12% of the total libavcodec size, nearly 2MB), the runtime impact of dynamic tables isn't too costly, and only a few codecs actually use the pre-generated tables (MP3, notably).

---
 meta/recipes-multimedia/ffmpeg/ffmpeg_4.1.3.bb | 1 -
 1 file changed, 1 deletion(-)
meta/recipes-multimedia/ffmpeg/ffmpeg_4.1.3.bb +0 -1
index 147388d9b7c..6d230c33169 100644
@@ -106,7 +106,6 @@ EXTRA_OECONF = " \
     --extra-cflags="${TARGET_CFLAGS} ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" \
     --extra-ldflags="${TARGET_LDFLAGS}" \
     --sysroot="${STAGING_DIR_TARGET}" \
-    --enable-hardcoded-tables \
     ${EXTRA_FFCONF} \
     --libdir=${libdir} \
     --shlibdir=${libdir} \
Signature · 1 line
2.20.1
#1 lore raw

PATCH 2/2 ffmpeg: upgrade to 4.1.4

Add a PACKAGECONFIG for the use of XCB and enable by default if X11 is in DISTRO_FEATURES.

---
 .../ffmpeg/{ffmpeg_4.1.3.bb => ffmpeg_4.1.4.bb}       | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)
 rename meta/recipes-multimedia/ffmpeg/{ffmpeg_4.1.3.bb => ffmpeg_4.1.4.bb} (96%)
meta/recipes-multimedia/ffmpeg/ffmpeg_4.1.4.bb renamed from meta/recipes-multimedia/ffmpeg/ffmpeg_4.1.3.bb +4 -7
similarity index 96%
rename from meta/recipes-multimedia/ffmpeg/ffmpeg_4.1.3.bb
rename to meta/recipes-multimedia/ffmpeg/ffmpeg_4.1.4.bb
index 6d230c33169..884973d237c 100644
@@ -26,8 +26,8 @@ LIC_FILES_CHKSUM = "file://COPYING.GPLv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
 SRC_URI = "https://www.ffmpeg.org/releases/${BP}.tar.xz \
            file://mips64_cpu_detection.patch \
            "
-SRC_URI[md5sum] = "dcc20dd2682ea01c678b7b8324339d43"
-SRC_URI[sha256sum] = "0c3020452880581a8face91595b239198078645e7d7184273b8bcc7758beb63d"
+SRC_URI[md5sum] = "5307931aeb7aaee5e1509d9996040661"
+SRC_URI[sha256sum] = "f1f049a82fcfbf156564e73a3935d7e750891fab2abf302e735104fd4050a7e1"
 
 # Build fails when thumb is enabled: https://bugzilla.yoctoproject.org/show_bug.cgi?id=7717
 ARM_INSTRUCTION_SET_armv4 = "arm"
@@ -44,7 +44,7 @@ inherit autotools pkgconfig
 
 PACKAGECONFIG ??= "avdevice avfilter avcodec avformat swresample swscale postproc avresample \
                    bzlib gpl lzma theora x264 \
-                   ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'xv', '', d)}"
+                   ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'xv xcb', '', d)}"
 
 # libraries to build in addition to avutil
 PACKAGECONFIG[avdevice] = "--enable-avdevice,--disable-avdevice"
@@ -73,6 +73,7 @@ PACKAGECONFIG[vaapi] = "--enable-vaapi,--disable-vaapi,libva"
 PACKAGECONFIG[vdpau] = "--enable-vdpau,--disable-vdpau,libvdpau"
 PACKAGECONFIG[vpx] = "--enable-libvpx,--disable-libvpx,libvpx"
 PACKAGECONFIG[x264] = "--enable-libx264,--disable-libx264,x264"
+PACKAGECONFIG[xcb] = "--enable-libxcb,--disable-libxcb,libxcb"
 PACKAGECONFIG[xv] = "--enable-outdev=xv,--disable-outdev=xv,libxv"
 
 # Check codecs that require --enable-nonfree
@@ -89,10 +90,6 @@ EXTRA_OECONF = " \
     --enable-pic \
     --enable-shared \
     --enable-pthreads \
-    --disable-libxcb \
-    --disable-libxcb-shm \
-    --disable-libxcb-xfixes \
-    --disable-libxcb-shape \
     ${@bb.utils.contains('USE_NONFREE', 'yes', '--enable-nonfree', '', d)} \
     \
     --cross-prefix=${TARGET_PREFIX} \
Signature · 1 line
2.20.1
#2 lore raw
In reply to Ross Burton
Quoted 6 lines · Ross Burton

ffmpeg can generate lookup tables at build time instead of runtime, but this is no longer a recommended option. The size impact is significant (12% of the total libavcodec size, nearly 2MB), the runtime impact of dynamic tables isn't too costly, and only a few codecs actually use the pre-generated tables (MP3, notably).

I think it will be good to understand the performance impact with some low end non-x86 device
as for now, it will be better to turn this into a packageconfig knob instead of just removing the
option

Quoted 26 lines
---
 meta/recipes-multimedia/ffmpeg/ffmpeg_4.1.3.bb | 1 -
 1 file changed, 1 deletion(-)
meta/recipes-multimedia/ffmpeg/ffmpeg_4.1.3.bb +0 -2
index 147388d9b7c..6d230c33169 100644
@@ -106,7 +106,6 @@ EXTRA_OECONF = " \
     --extra-cflags="${TARGET_CFLAGS} ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" \
     --extra-ldflags="${TARGET_LDFLAGS}" \
     --sysroot="${STAGING_DIR_TARGET}" \
-    --enable-hardcoded-tables \
     ${EXTRA_FFCONF} \
     --libdir=${libdir} \
     --shlibdir=${libdir} \
--

2.20.1

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core