Skip to content

Commit

Permalink
Enable compilation of deinterlace and scale filters
Browse files Browse the repository at this point in the history
These are used to implement deinterlacing in FFMPEG codecs. Both yadif
and VA-API filters are enabled, to allow both sw-only and hw-accelerated
deinterlacing/scaling.
  • Loading branch information
Michael Goffioul authored and hmtheboy154 committed Jan 22, 2024
1 parent da32be9 commit b7a2312
Show file tree
Hide file tree
Showing 9 changed files with 54 additions and 22 deletions.
12 changes: 6 additions & 6 deletions android/config-x86-x86.mak
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CONFIG_ANDROID=yes
avdevice_FFLIBS=avformat avcodec swresample avutil
avfilter_FFLIBS=avutil
avfilter_FFLIBS=swscale avutil
swscale_FFLIBS=avutil
postproc_FFLIBS=avutil
avformat_FFLIBS=avcodec swresample avutil
Expand Down Expand Up @@ -643,7 +643,7 @@ CONFIG_HWACCELS=yes
CONFIG_PARSERS=yes
!CONFIG_INDEVS=yes
!CONFIG_OUTDEVS=yes
!CONFIG_FILTERS=yes
CONFIG_FILTERS=yes
CONFIG_DEMUXERS=yes
CONFIG_MUXERS=yes
CONFIG_PROTOCOLS=yes
Expand Down Expand Up @@ -1940,7 +1940,7 @@ CONFIG_XMA_PARSER=yes
!CONFIG_DEFLATE_FILTER=yes
!CONFIG_DEFLICKER_FILTER=yes
!CONFIG_DEINTERLACE_QSV_FILTER=yes
!CONFIG_DEINTERLACE_VAAPI_FILTER=yes
CONFIG_DEINTERLACE_VAAPI_FILTER=yes
!CONFIG_DEJUDDER_FILTER=yes
!CONFIG_DELOGO_FILTER=yes
!CONFIG_DENOISE_VAAPI_FILTER=yes
Expand Down Expand Up @@ -2116,11 +2116,11 @@ CONFIG_XMA_PARSER=yes
!CONFIG_ROBERTS_OPENCL_FILTER=yes
!CONFIG_ROTATE_FILTER=yes
!CONFIG_SAB_FILTER=yes
!CONFIG_SCALE_FILTER=yes
CONFIG_SCALE_FILTER=yes
!CONFIG_SCALE_CUDA_FILTER=yes
!CONFIG_SCALE_NPP_FILTER=yes
!CONFIG_SCALE_QSV_FILTER=yes
!CONFIG_SCALE_VAAPI_FILTER=yes
CONFIG_SCALE_VAAPI_FILTER=yes
!CONFIG_SCALE_VULKAN_FILTER=yes
!CONFIG_SCALE2REF_FILTER=yes
!CONFIG_SCALE2REF_NPP_FILTER=yes
Expand Down Expand Up @@ -2215,7 +2215,7 @@ CONFIG_XMA_PARSER=yes
!CONFIG_XFADE_OPENCL_FILTER=yes
!CONFIG_XMEDIAN_FILTER=yes
!CONFIG_XSTACK_FILTER=yes
!CONFIG_YADIF_FILTER=yes
CONFIG_YADIF_FILTER=yes
!CONFIG_YADIF_CUDA_FILTER=yes
!CONFIG_YADIF_VIDEOTOOLBOX_FILTER=yes
!CONFIG_YAEPBLUR_FILTER=yes
Expand Down
12 changes: 6 additions & 6 deletions android/config-x86_64-x86_64.mak
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CONFIG_ANDROID=yes
avdevice_FFLIBS=avformat avcodec swresample avutil
avfilter_FFLIBS=avutil
avfilter_FFLIBS=swscale avutil
swscale_FFLIBS=avutil
postproc_FFLIBS=avutil
avformat_FFLIBS=avcodec swresample avutil
Expand Down Expand Up @@ -643,7 +643,7 @@ CONFIG_HWACCELS=yes
CONFIG_PARSERS=yes
!CONFIG_INDEVS=yes
!CONFIG_OUTDEVS=yes
!CONFIG_FILTERS=yes
CONFIG_FILTERS=yes
CONFIG_DEMUXERS=yes
CONFIG_MUXERS=yes
CONFIG_PROTOCOLS=yes
Expand Down Expand Up @@ -1940,7 +1940,7 @@ CONFIG_XMA_PARSER=yes
!CONFIG_DEFLATE_FILTER=yes
!CONFIG_DEFLICKER_FILTER=yes
!CONFIG_DEINTERLACE_QSV_FILTER=yes
!CONFIG_DEINTERLACE_VAAPI_FILTER=yes
CONFIG_DEINTERLACE_VAAPI_FILTER=yes
!CONFIG_DEJUDDER_FILTER=yes
!CONFIG_DELOGO_FILTER=yes
!CONFIG_DENOISE_VAAPI_FILTER=yes
Expand Down Expand Up @@ -2116,11 +2116,11 @@ CONFIG_XMA_PARSER=yes
!CONFIG_ROBERTS_OPENCL_FILTER=yes
!CONFIG_ROTATE_FILTER=yes
!CONFIG_SAB_FILTER=yes
!CONFIG_SCALE_FILTER=yes
CONFIG_SCALE_FILTER=yes
!CONFIG_SCALE_CUDA_FILTER=yes
!CONFIG_SCALE_NPP_FILTER=yes
!CONFIG_SCALE_QSV_FILTER=yes
!CONFIG_SCALE_VAAPI_FILTER=yes
CONFIG_SCALE_VAAPI_FILTER=yes
!CONFIG_SCALE_VULKAN_FILTER=yes
!CONFIG_SCALE2REF_FILTER=yes
!CONFIG_SCALE2REF_NPP_FILTER=yes
Expand Down Expand Up @@ -2215,7 +2215,7 @@ CONFIG_XMA_PARSER=yes
!CONFIG_XFADE_OPENCL_FILTER=yes
!CONFIG_XMEDIAN_FILTER=yes
!CONFIG_XSTACK_FILTER=yes
!CONFIG_YADIF_FILTER=yes
CONFIG_YADIF_FILTER=yes
!CONFIG_YADIF_CUDA_FILTER=yes
!CONFIG_YADIF_VIDEOTOOLBOX_FILTER=yes
!CONFIG_YAEPBLUR_FILTER=yes
Expand Down
4 changes: 2 additions & 2 deletions android/include/config-x86-x86.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* Automatically generated by configure - do not modify! */
#ifndef FFMPEG_CONFIG_H
#define FFMPEG_CONFIG_H
#define FFMPEG_CONFIGURATION "--arch=x86 --cpu=i686 --build_suffix= --cross-prefix=/android/sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/linux-x86_64/bin/i686-linux-android31- --enable-cross-compile --target-os=android --cc=/android/sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/linux-x86_64/bin/i686-linux-android31-clang --cxx=/android/sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/linux-x86_64/bin/i686-linux-android31-clang++ --disable-static --enable-shared --enable-optimizations --disable-doc --disable-symver --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-avdevice --disable-devices --disable-filters --disable-demuxer=srt --disable-demuxer=microdvd --disable-demuxer=jacosub --disable-demuxer=sami --disable-demuxer=realtext --disable-demuxer=dts --disable-demuxer=subviewer --disable-demuxer=subviewer1 --disable-demuxer=pjs --disable-demuxer=vplayer --disable-demuxer=mpl2 --disable-decoder=ass --disable-decoder=srt --disable-decoder=subrip --disable-decoder=microdvd --disable-decoder=jacosub --disable-decoder=sami --disable-decoder=realtext --disable-decoder=movtext --disable-decoder=subviewer --disable-decoder=subviewer1 --disable-decoder=pjs --disable-decoder=vplayer --disable-decoder=mpl2 --disable-v4l2_m2m --disable-txtpages --disable-htmlpages --disable-vulkan --disable-cuda-llvm --enable-zlib --enable-pic --disable-debug --nm=/android/sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-nm --strip=/android/sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip --ar=/android/sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar --ranlib=/android/sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ranlib --x86asmexe=/android/sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/linux-x86_64/bin/yasm"
#define FFMPEG_CONFIGURATION "--arch=x86 --cpu=i686 --build_suffix= --cross-prefix=/home/goffioul/Software/android-sdk-linux/ndk/23.1.7779620//toolchains/llvm/prebuilt/linux-x86_64/bin/i686-linux-android31- --enable-cross-compile --target-os=android --cc=/home/goffioul/Software/android-sdk-linux/ndk/23.1.7779620//toolchains/llvm/prebuilt/linux-x86_64/bin/i686-linux-android31-clang --cxx=/home/goffioul/Software/android-sdk-linux/ndk/23.1.7779620//toolchains/llvm/prebuilt/linux-x86_64/bin/i686-linux-android31-clang++ --disable-static --enable-shared --enable-optimizations --disable-doc --disable-symver --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-avdevice --disable-devices --disable-filters --disable-demuxer=srt --disable-demuxer=microdvd --disable-demuxer=jacosub --disable-demuxer=sami --disable-demuxer=realtext --disable-demuxer=dts --disable-demuxer=subviewer --disable-demuxer=subviewer1 --disable-demuxer=pjs --disable-demuxer=vplayer --disable-demuxer=mpl2 --disable-decoder=ass --disable-decoder=srt --disable-decoder=subrip --disable-decoder=microdvd --disable-decoder=jacosub --disable-decoder=sami --disable-decoder=realtext --disable-decoder=movtext --disable-decoder=subviewer --disable-decoder=subviewer1 --disable-decoder=pjs --disable-decoder=vplayer --disable-decoder=mpl2 --disable-v4l2_m2m --enable-filter=scale --enable-filter=yadif --enable-filter=scale_vaapi --enable-filter=deinterlace_vaapi --enable-zlib --enable-pic --disable-debug --nm=/home/goffioul/Software/android-sdk-linux/ndk/23.1.7779620//toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-nm --strip=/home/goffioul/Software/android-sdk-linux/ndk/23.1.7779620//toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip --ar=/home/goffioul/Software/android-sdk-linux/ndk/23.1.7779620//toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar --ranlib=/home/goffioul/Software/android-sdk-linux/ndk/23.1.7779620//toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ranlib --x86asmexe=/home/goffioul/Software/android-sdk-linux/ndk/23.1.7779620//toolchains/llvm/prebuilt/linux-x86_64/bin/yasm"
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
#define CONFIG_THIS_YEAR 2022
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
Expand Down Expand Up @@ -1841,7 +1841,7 @@
#define CONFIG_PARSERS 1
#define CONFIG_INDEVS 0
#define CONFIG_OUTDEVS 0
#define CONFIG_FILTERS 0
#define CONFIG_FILTERS 1
#define CONFIG_DEMUXERS 1
#define CONFIG_MUXERS 1
#define CONFIG_PROTOCOLS 1
Expand Down
2 changes: 1 addition & 1 deletion android/include/config-x86.asm
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@
%define CONFIG_PARSERS 1
%define CONFIG_INDEVS 0
%define CONFIG_OUTDEVS 0
%define CONFIG_FILTERS 0
%define CONFIG_FILTERS 1
%define CONFIG_DEMUXERS 1
%define CONFIG_MUXERS 1
%define CONFIG_PROTOCOLS 1
Expand Down
4 changes: 2 additions & 2 deletions android/include/config-x86_64-x86_64.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* Automatically generated by configure - do not modify! */
#ifndef FFMPEG_CONFIG_H
#define FFMPEG_CONFIG_H
#define FFMPEG_CONFIGURATION "--arch=x86_64 --cpu=generic --build_suffix= --cross-prefix=/android/sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android31- --enable-cross-compile --target-os=android --cc=/android/sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android31-clang --cxx=/android/sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android31-clang++ --disable-static --enable-shared --enable-optimizations --disable-doc --disable-symver --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-avdevice --disable-devices --disable-filters --disable-demuxer=srt --disable-demuxer=microdvd --disable-demuxer=jacosub --disable-demuxer=sami --disable-demuxer=realtext --disable-demuxer=dts --disable-demuxer=subviewer --disable-demuxer=subviewer1 --disable-demuxer=pjs --disable-demuxer=vplayer --disable-demuxer=mpl2 --disable-decoder=ass --disable-decoder=srt --disable-decoder=subrip --disable-decoder=microdvd --disable-decoder=jacosub --disable-decoder=sami --disable-decoder=realtext --disable-decoder=movtext --disable-decoder=subviewer --disable-decoder=subviewer1 --disable-decoder=pjs --disable-decoder=vplayer --disable-decoder=mpl2 --disable-v4l2_m2m --disable-txtpages --disable-htmlpages --disable-vulkan --disable-cuda-llvm --enable-zlib --enable-pic --disable-debug --nm=/android/sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-nm --strip=/android/sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip --ar=/android/sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar --ranlib=/android/sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ranlib --x86asmexe=/android/sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/linux-x86_64/bin/yasm"
#define FFMPEG_CONFIGURATION "--arch=x86_64 --cpu=generic --build_suffix= --cross-prefix=/home/goffioul/Software/android-sdk-linux/ndk/23.1.7779620//toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android31- --enable-cross-compile --target-os=android --cc=/home/goffioul/Software/android-sdk-linux/ndk/23.1.7779620//toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android31-clang --cxx=/home/goffioul/Software/android-sdk-linux/ndk/23.1.7779620//toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android31-clang++ --disable-static --enable-shared --enable-optimizations --disable-doc --disable-symver --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-avdevice --disable-devices --disable-filters --disable-demuxer=srt --disable-demuxer=microdvd --disable-demuxer=jacosub --disable-demuxer=sami --disable-demuxer=realtext --disable-demuxer=dts --disable-demuxer=subviewer --disable-demuxer=subviewer1 --disable-demuxer=pjs --disable-demuxer=vplayer --disable-demuxer=mpl2 --disable-decoder=ass --disable-decoder=srt --disable-decoder=subrip --disable-decoder=microdvd --disable-decoder=jacosub --disable-decoder=sami --disable-decoder=realtext --disable-decoder=movtext --disable-decoder=subviewer --disable-decoder=subviewer1 --disable-decoder=pjs --disable-decoder=vplayer --disable-decoder=mpl2 --disable-v4l2_m2m --enable-filter=scale --enable-filter=yadif --enable-filter=scale_vaapi --enable-filter=deinterlace_vaapi --enable-zlib --enable-pic --disable-debug --nm=/home/goffioul/Software/android-sdk-linux/ndk/23.1.7779620//toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-nm --strip=/home/goffioul/Software/android-sdk-linux/ndk/23.1.7779620//toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip --ar=/home/goffioul/Software/android-sdk-linux/ndk/23.1.7779620//toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar --ranlib=/home/goffioul/Software/android-sdk-linux/ndk/23.1.7779620//toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ranlib --x86asmexe=/home/goffioul/Software/android-sdk-linux/ndk/23.1.7779620//toolchains/llvm/prebuilt/linux-x86_64/bin/yasm"
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
#define CONFIG_THIS_YEAR 2022
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
Expand Down Expand Up @@ -1841,7 +1841,7 @@
#define CONFIG_PARSERS 1
#define CONFIG_INDEVS 0
#define CONFIG_OUTDEVS 0
#define CONFIG_FILTERS 0
#define CONFIG_FILTERS 1
#define CONFIG_DEMUXERS 1
#define CONFIG_MUXERS 1
#define CONFIG_PROTOCOLS 1
Expand Down
2 changes: 1 addition & 1 deletion android/include/config-x86_64.asm
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@
%define CONFIG_PARSERS 1
%define CONFIG_INDEVS 0
%define CONFIG_OUTDEVS 0
%define CONFIG_FILTERS 0
%define CONFIG_FILTERS 1
%define CONFIG_DEMUXERS 1
%define CONFIG_MUXERS 1
%define CONFIG_PROTOCOLS 1
Expand Down
8 changes: 4 additions & 4 deletions android/include/config_components.h
Original file line number Diff line number Diff line change
Expand Up @@ -1198,7 +1198,7 @@
#define CONFIG_DEFLATE_FILTER 0
#define CONFIG_DEFLICKER_FILTER 0
#define CONFIG_DEINTERLACE_QSV_FILTER 0
#define CONFIG_DEINTERLACE_VAAPI_FILTER 0
#define CONFIG_DEINTERLACE_VAAPI_FILTER 1
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DENOISE_VAAPI_FILTER 0
Expand Down Expand Up @@ -1374,11 +1374,11 @@
#define CONFIG_ROBERTS_OPENCL_FILTER 0
#define CONFIG_ROTATE_FILTER 0
#define CONFIG_SAB_FILTER 0
#define CONFIG_SCALE_FILTER 0
#define CONFIG_SCALE_FILTER 1
#define CONFIG_SCALE_CUDA_FILTER 0
#define CONFIG_SCALE_NPP_FILTER 0
#define CONFIG_SCALE_QSV_FILTER 0
#define CONFIG_SCALE_VAAPI_FILTER 0
#define CONFIG_SCALE_VAAPI_FILTER 1
#define CONFIG_SCALE_VULKAN_FILTER 0
#define CONFIG_SCALE2REF_FILTER 0
#define CONFIG_SCALE2REF_NPP_FILTER 0
Expand Down Expand Up @@ -1473,7 +1473,7 @@
#define CONFIG_XFADE_OPENCL_FILTER 0
#define CONFIG_XMEDIAN_FILTER 0
#define CONFIG_XSTACK_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_YADIF_FILTER 1
#define CONFIG_YADIF_CUDA_FILTER 0
#define CONFIG_YADIF_VIDEOTOOLBOX_FILTER 0
#define CONFIG_YAEPBLUR_FILTER 0
Expand Down
10 changes: 10 additions & 0 deletions android/include/libavfilter/filter_list.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
static const AVFilter * const filter_list[] = {
&ff_vf_deinterlace_vaapi,
&ff_vf_scale,
&ff_vf_scale_vaapi,
&ff_vf_yadif,
&ff_asrc_abuffer,
&ff_vsrc_buffer,
&ff_asink_abuffer,
&ff_vsink_buffer,
NULL };
22 changes: 22 additions & 0 deletions libavfilter/Android.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
LOCAL_PATH := $(call my-dir)
SRC_PATH := $(FFMPEG_DIR)

FFMPEG_MULTILIB := 32
include $(LOCAL_PATH)/../android/build.mk

ifeq ($(CONFIG_VAAPI),yes)
LOCAL_SHARED_LIBRARIES += libva
endif

LOCAL_MULTILIB := $(FFMPEG_MULTILIB)
include $(BUILD_SHARED_LIBRARY)

FFMPEG_MULTILIB := 64
include $(LOCAL_PATH)/../android/build.mk

ifeq ($(CONFIG_VAAPI),yes)
LOCAL_SHARED_LIBRARIES += libva
endif

LOCAL_MULTILIB := $(FFMPEG_MULTILIB)
include $(BUILD_SHARED_LIBRARY)

0 comments on commit b7a2312

Please sign in to comment.