From c2fa28243135e6f38b2a866f0390766a0af9d861 Mon Sep 17 00:00:00 2001 From: Ian Leonard Date: Mon, 7 Aug 2017 23:54:09 -0700 Subject: [PATCH 1/3] ffmpeg: update to 3.2.7 Removes the x86 optimization disables from the SOFT_FLOAT portion. There are no i386 profiles that do not use hard float, so these options accomplish nothing. Target-os=linux rules out dxva2 and vda, so disable statements are unnecessary. For x86-64 users of libffmpeg-full, optimize around performance instead of size. Remove patented flag requirement from mp2 and mp3 audio files in libffmpeg-custom per expiration. Tidies up some of the configure steps where only one option is being changed or cosmetic consistency. Signed-off-by: Ian Leonard --- multimedia/ffmpeg/Config.in | 5 +--- multimedia/ffmpeg/Makefile | 53 ++++++++++++------------------------- 2 files changed, 18 insertions(+), 40 deletions(-) diff --git a/multimedia/ffmpeg/Config.in b/multimedia/ffmpeg/Config.in index cd0d5f885..f1029a6c8 100644 --- a/multimedia/ffmpeg/Config.in +++ b/multimedia/ffmpeg/Config.in @@ -141,7 +141,6 @@ config FFMPEG_CUSTOM_SELECT_libfdk-aac config FFMPEG_CUSTOM_SELECT_libmp3lame bool "Libmp3lame" - depends on FFMPEG_CUSTOM_PATENTED depends on PACKAGE_lame-lib select FFMPEG_CUSTOM_DECODER_mp3 select FFMPEG_CUSTOM_MUXER_mp3 @@ -253,11 +252,9 @@ config FFMPEG_CUSTOM_DECODER_jpegls config FFMPEG_CUSTOM_DECODER_mp2 bool "MP2 (MPEG Audio Layer 2)" - depends on FFMPEG_CUSTOM_PATENTED config FFMPEG_CUSTOM_DECODER_mp3 - bool "MP3 (MPEG Audio Layer 2)" - depends on FFMPEG_CUSTOM_PATENTED + bool "MP3 (MPEG Audio Layer 3)" config FFMPEG_CUSTOM_DECODER_mpegvideo bool "MPEG Video" diff --git a/multimedia/ffmpeg/Makefile b/multimedia/ffmpeg/Makefile index f7a8ebbaf..b875b54ff 100644 --- a/multimedia/ffmpeg/Makefile +++ b/multimedia/ffmpeg/Makefile @@ -9,13 +9,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ffmpeg -PKG_VERSION:=3.2.6 -PKG_RELEASE:=2 +PKG_VERSION:=3.2.7 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://ffmpeg.org/releases/ -PKG_MD5SUM:=7a35bd97bd7253305bf5c0af5f9dd3ce -PKG_HASH:=3751cebb5c71a861288267769114d12b966a7703a686a325d90a93707f3a6d9f +PKG_HASH:=28e75fc32485a88035a7ebf0a956a1e5c7e93b440dd4bbd6bc30c7268cf34fe9 PKG_MAINTAINER:=Ted Hess , \ Ian Leonard @@ -150,7 +149,7 @@ FFMPEG_MINI_DEMUXERS:= \ ogg \ FFMPEG_MINI_PROTOCOLS:= \ - file \ + file FFMPEG_AUDIO_DECODERS:= \ aac \ @@ -380,34 +379,16 @@ FFMPEG_CONFIGURE:= \ --disable-doc \ --disable-debug \ \ - --disable-dxva2 \ --disable-lzma \ --disable-vaapi \ - --disable-vda \ --disable-vdpau \ --disable-outdevs ifeq ($(CONFIG_SOFT_FLOAT),y) -FFMPEG_CONFIGURE += \ +FFMPEG_CONFIGURE+= \ --disable-altivec \ --disable-vsx \ --disable-power8 \ - --disable-amd3dnow \ - --disable-amd3dnowext \ - --disable-mmx \ - --disable-mmxext \ - --disable-sse \ - --disable-sse2 \ - --disable-sse3 \ - --disable-ssse3 \ - --disable-sse4 \ - --disable-sse42 \ - --disable-avx \ - --disable-xop \ - --disable-fma3 \ - --disable-fma4 \ - --disable-avx2 \ - --disable-aesni \ --disable-armv5te \ --disable-armv6 \ --disable-armv6t2 \ @@ -421,37 +402,33 @@ FFMPEG_CONFIGURE += \ --disable-runtime-cpudetect else ifneq ($(findstring arm,$(CONFIG_ARCH)),) -FFMPEG_CONFIGURE += \ +FFMPEG_CONFIGURE+= \ --disable-runtime-cpudetect # XXX: GitHub issue 3320 ppc cpu with fpu but no altivec (WNDR4700) else ifneq ($(findstring powerpc,$(CONFIG_ARCH)),) -FFMPEG_CONFIGURE += \ +FFMPEG_CONFIGURE+= \ --disable-altivec endif # selectively disable optimizations according to arch/cpu type ifneq ($(findstring arm,$(CONFIG_ARCH)),) ifneq ($(findstring vfp,$(CONFIG_TARGET_OPTIMIZATION)),) - FFMPEG_CONFIGURE+= \ - --enable-vfp + FFMPEG_CONFIGURE+= --enable-vfp else - FFMPEG_CONFIGURE+= \ - --disable-vfp + FFMPEG_CONFIGURE+= --disable-vfp endif ifneq ($(findstring neon,$(CONFIG_TARGET_OPTIMIZATION)),) FFMPEG_CONFIGURE+= \ --enable-neon \ --enable-vfp else - FFMPEG_CONFIGURE+= \ - --disable-neon + FFMPEG_CONFIGURE+= --disable-neon endif endif ifneq ($(CONFIG_YASM),y) -FFMPEG_CONFIGURE += \ - --disable-yasm +FFMPEG_CONFIGURE+= --disable-yasm endif @@ -465,8 +442,12 @@ ifeq ($(BUILD_VARIANT),full) \ $(if $(CONFIG_PACKAGE_shine),--enable-libshine) else + ifeq ($(ARCH),x86_64) + FFMPEG_CONFIGURE+= --enable-hardcoded-tables + else + FFMPEG_CONFIGURE+= --enable-small + endif FFMPEG_CONFIGURE+= \ - --enable-small \ --enable-gpl \ \ $(if $(CONFIG_PACKAGE_lame-lib),--enable-libmp3lame) \ @@ -597,7 +578,7 @@ ifeq ($(BUILD_VARIANT),mini) endif ifneq ($(CONFIG_TARGET_x86),) - TARGET_CFLAGS += -fomit-frame-pointer + TARGET_CFLAGS+= -fomit-frame-pointer endif define Build/Configure From 3998494f28ddfeca6083c6aa591c875fd5477bf7 Mon Sep 17 00:00:00 2001 From: Ian Leonard Date: Tue, 8 Aug 2017 00:06:04 -0700 Subject: [PATCH 2/3] ffmpeg: let ffmpeg choose necessary parsers for audio-dec and custom This change allows ffmpeg's configure script to determine the necessary parsers based on selected decoders & encoders. For libffmpeg-audio-dec, this changes from our selecting: aac, ac3, flac, mpegaudio, opus and aac_latm to ffmpeg's configure script selecting: aac_latm, ac3, flac, mpegaudio for minor space savings and a simpler Makefile to manage on our end. In libffmpeg-custom, don't select any parsers when choosing decoders/encoders. I'm undecided on removing the parser selection in its entirety here. Signed-off-by: Ian Leonard --- multimedia/ffmpeg/Config.in | 12 ------------ multimedia/ffmpeg/Makefile | 9 --------- 2 files changed, 21 deletions(-) diff --git a/multimedia/ffmpeg/Config.in b/multimedia/ffmpeg/Config.in index f1029a6c8..70c8ede24 100644 --- a/multimedia/ffmpeg/Config.in +++ b/multimedia/ffmpeg/Config.in @@ -119,12 +119,6 @@ config FFMPEG_CUSTOM_AUDIO_DEC_SUPPORT select FFMPEG_CUSTOM_DEMUXER_sdp select FFMPEG_CUSTOM_DEMUXER_wav select FFMPEG_CUSTOM_DEMUXER_wv - select FFMPEG_CUSTOM_PARSER_aac - select FFMPEG_CUSTOM_PARSER_aac_latm - select FFMPEG_CUSTOM_PARSER_ac3 - select FFMPEG_CUSTOM_PARSER_flac - select FFMPEG_CUSTOM_PARSER_mpegaudio - select FFMPEG_CUSTOM_PARSER_opus select FFMPEG_CUSTOM_PROTOCOL_file select FFMPEG_CUSTOM_PROTOCOL_http select FFMPEG_CUSTOM_PROTOCOL_rtp @@ -160,14 +154,12 @@ config FFMPEG_CUSTOM_SELECT_libx264 select FFMPEG_CUSTOM_DECODER_h264 select FFMPEG_CUSTOM_MUXER_h264 select FFMPEG_CUSTOM_DEMUXER_h264 - select FFMPEG_CUSTOM_PARSER_h264 comment "Encoders" config FFMPEG_CUSTOM_ENCODER_ac3 bool "AC3" depends on FFMPEG_CUSTOM_PATENTED - select FFMPEG_CUSTOM_PARSER_ac3 config FFMPEG_CUSTOM_ENCODER_jpegls bool "JPEG-LS" @@ -204,7 +196,6 @@ comment "Decoders" config FFMPEG_CUSTOM_DECODER_aac bool "AAC (Advanced Audio Coding)" depends on FFMPEG_CUSTOM_PATENTED - select FFMPEG_CUSTOM_PARSER_aac config FFMPEG_CUSTOM_SELECT_adpcm bool "ADPCM (multiple types)" @@ -212,7 +203,6 @@ config FFMPEG_CUSTOM_SELECT_adpcm config FFMPEG_CUSTOM_DECODER_ac3 bool "AC3" depends on FFMPEG_CUSTOM_PATENTED - select FFMPEG_CUSTOM_PARSER_ac3 config FFMPEG_CUSTOM_DECODER_alac bool "ALAC" @@ -234,7 +224,6 @@ config FFMPEG_CUSTOM_DECODER_atrac3 config FFMPEG_CUSTOM_DECODER_flac bool "FLAC" - select FFMPEG_CUSTOM_PARSER_flac config FFMPEG_CUSTOM_DECODER_gif bool "GIF" @@ -392,7 +381,6 @@ config FFMPEG_CUSTOM_DEMUXER_mov config FFMPEG_CUSTOM_DEMUXER_mp3 bool "MP3 (MPEG Audio Layer 3)" - select FFMPEG_CUSTOM_PARSER_mpegaudio config FFMPEG_CUSTOM_DEMUXER_mpegvideo bool "MPEG Video" diff --git a/multimedia/ffmpeg/Makefile b/multimedia/ffmpeg/Makefile index b875b54ff..4f58b717b 100644 --- a/multimedia/ffmpeg/Makefile +++ b/multimedia/ffmpeg/Makefile @@ -199,14 +199,6 @@ FFMPEG_AUDIO_DEMUXERS:= \ wav \ wv \ -FFMPEG_AUDIO_PARSERS:= \ - aac \ - aac_latm \ - ac3 \ - flac \ - mpegaudio \ - opus \ - FFMPEG_AUDIO_PROTOCOLS:= \ file http icecast rtp tcp udp @@ -549,7 +541,6 @@ ifeq ($(BUILD_VARIANT),audio-dec) --disable-everything \ $(call FFMPEG_ENABLE,decoder,$(FFMPEG_AUDIO_DECODERS)) \ $(call FFMPEG_ENABLE,demuxer,$(FFMPEG_AUDIO_DEMUXERS)) \ - $(call FFMPEG_ENABLE,parser,$(FFMPEG_AUDIO_PARSERS)) \ $(call FFMPEG_ENABLE,protocol,$(FFMPEG_AUDIO_PROTOCOLS)) \ --disable-decoder=pcm_bluray,pcm_dvd \ From adc293d3d961118f2211a7cbd7251b4cd43eb7c3 Mon Sep 17 00:00:00 2001 From: Ian Leonard Date: Tue, 8 Aug 2017 00:09:21 -0700 Subject: [PATCH 3/3] ffmpeg: enable lto build for arm and x86_64 This toggles on Link-Time Optimization for arm and x86-64. Compile tested on arm/bcm47xx, arm/mvebu, arm/imx6 and x86-64/generic (Also compile tested on mips/ar71xx where it failed so this change is currently for specific arches.) Size savings for libffmpeg were 2-3% when measured with libffmpeg-full and libffmpeg-mini. Signed-off-by: Ian Leonard --- multimedia/ffmpeg/Makefile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/multimedia/ffmpeg/Makefile b/multimedia/ffmpeg/Makefile index 4f58b717b..9dda6a73f 100644 --- a/multimedia/ffmpeg/Makefile +++ b/multimedia/ffmpeg/Makefile @@ -404,6 +404,8 @@ endif # selectively disable optimizations according to arch/cpu type ifneq ($(findstring arm,$(CONFIG_ARCH)),) + FFMPEG_CONFIGURE+= --enable-lto + ifneq ($(findstring vfp,$(CONFIG_TARGET_OPTIMIZATION)),) FFMPEG_CONFIGURE+= --enable-vfp else @@ -419,6 +421,10 @@ ifneq ($(findstring arm,$(CONFIG_ARCH)),) endif +ifeq ($(ARCH),x86_64) + FFMPEG_CONFIGURE+= --enable-lto +endif + ifneq ($(CONFIG_YASM),y) FFMPEG_CONFIGURE+= --disable-yasm