Commit 8a02a803 authored by Anton Khirnov's avatar Anton Khirnov

lavfi: add an NVIDIA NPP-based scaling filter

parent 98114d70
......@@ -52,6 +52,7 @@ version <next>:
- G.723.1 muxer and encoder
- compressed SWF
- VAAPI-accelerated format conversion and scaling
- libnpp/CUDA-accelerated format conversion and scaling
version 11:
......
......@@ -195,6 +195,7 @@ External library support:
--enable-libkvazaar enable HEVC encoding via libkvazaar [no]
--enable-libmfx enable HW acceleration through libmfx
--enable-libmp3lame enable MP3 encoding via libmp3lame [no]
--enable-libnpp enable NVIDIA Performance Primitives-based code [no]
--enable-libopencore-amrnb enable AMR-NB de/encoding via libopencore-amrnb [no]
--enable-libopencore-amrwb enable AMR-WB decoding via libopencore-amrwb [no]
--enable-libopencv enable video filtering via libopencv [no]
......@@ -1222,6 +1223,7 @@ EXTERNAL_LIBRARY_LIST="
libkvazaar
libmfx
libmp3lame
libnpp
libopencore_amrnb
libopencore_amrwb
libopencv
......@@ -2359,6 +2361,7 @@ interlace_filter_deps="gpl"
ocv_filter_deps="libopencv"
resample_filter_deps="avresample"
scale_filter_deps="swscale"
scale_npp_filter_deps="cuda libnpp"
scale_vaapi_filter_deps="vaapi VAProcPipelineParameterBuffer"
# examples
......@@ -4024,6 +4027,7 @@ die_license_disabled gpl x11grab
die_license_disabled nonfree cuda
die_license_disabled nonfree libfaac
die_license_disabled nonfree libfdk_aac
die_license_disabled nonfree libnpp
die_license_disabled nonfree nvenc
die_license_disabled nonfree openssl
......@@ -4520,6 +4524,7 @@ enabled libilbc && require libilbc ilbc.h WebRtcIlbcfix_InitDecode -li
enabled libkvazaar && require_pkg_config "kvazaar >= 0.8.1" kvazaar.h kvz_api_get
enabled libmfx && require_pkg_config libmfx "mfx/mfxvideo.h" MFXInit
enabled libmp3lame && require "libmp3lame >= 3.98.3" lame/lame.h lame_set_VBR_quality -lmp3lame
enabled libnpp && require libnpp npp.h nppGetLibVersion -lnppi -lnppc
enabled libopencore_amrnb && require libopencore_amrnb opencore-amrnb/interf_dec.h Decoder_Interface_init -lopencore-amrnb
enabled libopencore_amrwb && require libopencore_amrwb opencore-amrwb/dec_if.h D_IF_init -lopencore-amrwb
enabled libopencv && require_pkg_config opencv opencv/cv.h cvCreateImageHeader
......
......@@ -2181,6 +2181,44 @@ scale="trunc(3/2*iw/hsub)*hsub:trunc(3/2*ih/vsub)*vsub"
scale=w='min(500\, iw*3/2):h=-1'
@end example
@section scale_npp
Use the NVIDIA Performance Primitives (libnpp) to perform scaling and/or pixel
format conversion on CUDA video frames. Setting the output width and height
works in the same way as for the @var{scale} filter.
The following additional options are accepted:
@table @option
@item format
The pixel format of the output CUDA frames. If set to the string "same" (the
default), the input format will be kept. Note that automatic format negotiation
and conversion is not yet supported for hardware frames
@item interp_algo
The interpolation algorithm used for resizing. One of the following:
@table @option
@item nn
Nearest neighbour.
@item linear
@item cubic
@item cubic2p_bspline
2-parameter cubic (B=1, C=0)
@item cubic2p_catmullrom
2-parameter cubic (B=0, C=1/2)
@item cubic2p_b05c03
2-parameter cubic (B=1/2, C=3/10)
@item super
Supersampling
@item lanczos
@end table
@end table
@section select
Select frames to pass in output.
......
......@@ -71,6 +71,7 @@ OBJS-$(CONFIG_OVERLAY_FILTER) += vf_overlay.o
OBJS-$(CONFIG_PAD_FILTER) += vf_pad.o
OBJS-$(CONFIG_PIXDESCTEST_FILTER) += vf_pixdesctest.o
OBJS-$(CONFIG_SCALE_FILTER) += vf_scale.o
OBJS-$(CONFIG_SCALE_NPP_FILTER) += vf_scale_npp.o
OBJS-$(CONFIG_SCALE_VAAPI_FILTER) += vf_scale_vaapi.o
OBJS-$(CONFIG_SELECT_FILTER) += vf_select.o
OBJS-$(CONFIG_SETDAR_FILTER) += vf_aspect.o
......
......@@ -97,6 +97,7 @@ void avfilter_register_all(void)
REGISTER_FILTER(PAD, pad, vf);
REGISTER_FILTER(PIXDESCTEST, pixdesctest, vf);
REGISTER_FILTER(SCALE, scale, vf);
REGISTER_FILTER(SCALE_NPP, scale_npp, vf);
REGISTER_FILTER(SCALE_VAAPI, scale_vaapi, vf);
REGISTER_FILTER(SELECT, select, vf);
REGISTER_FILTER(SETDAR, setdar, vf);
......
......@@ -30,7 +30,7 @@
#include "libavutil/version.h"
#define LIBAVFILTER_VERSION_MAJOR 6
#define LIBAVFILTER_VERSION_MINOR 3
#define LIBAVFILTER_VERSION_MINOR 4
#define LIBAVFILTER_VERSION_MICRO 0
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment