Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions How to build.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,18 +113,16 @@ To build the library with OpenCL support, run \
`git clone https://github.com/FFmpeg/FFmpeg ffmpeg` \
`cd ffmpeg`

#### Checkout FFmpeg version 6.0 tag
`git checkout -b n6.0 n6.0`
#### Checkout FFmpeg version n7.1 tag
`git checkout -b n7.1 n7.1`

#### Copy vf_raisr.c to ffmpeg libavfilter folder
`cp ../Video-Super-Resolution-Library/ffmpeg/vf_raisr.c libavfilter/` \
To use raisr_opencl you need to copy vf_raisr_opencl.c as well \
`cp ../Video-Super-Resolution-Library/ffmpeg/vf_raisr_opencl.c libavfilter/`

#### Apply patch
`git am ../Video-Super-Resolution-Library/ffmpeg/0001-ffmpeg-raisr-filter.patch` \
To use raisr_opencl you need to apply patch 0002 as well \
`git am ../Video-Super-Resolution-Library/ffmpeg/0002-libavfilter-raisr_opencl-Add-raisr_opencl-filter.patch`
`git am ../Video-Super-Resolution-Library/ffmpeg/0001-Upgrade-Raisr-ffmpeg-plugin-to-n7.1-from-n6.1.1.patch`

#### Configure FFmpeg
When `DCMAKE_INSTALL_PREFIX` isn't used, the ffmpeg configure command is as: \
Expand Down
2 changes: 1 addition & 1 deletion docker/Flex/Dockerfile.ubuntu22.04
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ ARG GMMLIB_VER=22.4.1
ARG LIBVA2_VER=2.22.0
ARG LIBVA_UTILS_VER=2.22.0
ARG MEDIA_DRIVER_VER=24.2.5
ARG FFMPEG_VER="n6.1.1"
ARG FFMPEG_VER="n7.1"

ARG SVT_AV1_REPO=https://gitlab.com/AOMediaCodec/SVT-AV1/-/archive/${SVT_AV1_VER}/SVT-AV1-${SVT_AV1_VER}.tar.gz
ARG SVT_VP9_REPO=https://github.com/OpenVisualCloud/SVT-VP9/archive/refs/tags/${SVT_VP9_VER}.tar.gz
Expand Down
2 changes: 1 addition & 1 deletion docker/Xeon/Dockerfile.centos9
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ FROM quay.io/centos/centos:stream9 AS build
ARG DL_PREFIX=/opt
ARG PREFIX=/opt/build
ARG LD_LIBRARY_PATH="/opt/build/lib:/opt/build/lib64:/usr/local/lib:/usr/local/lib64"
ARG FFMPEG_COMMIT_ID="n6.1.1"
ARG FFMPEG_COMMIT_ID="n7.1"
ENV TZ="Europe/Warsaw"

ARG ONEAPI_LINK="https://registrationcenter-download.intel.com/akdlm/IRC_NAS/046b1402-c5b8-4753-9500-33ffb665123f/l_ipp_oneapi_p_2021.10.1.16_offline.sh"
Expand Down
2 changes: 1 addition & 1 deletion docker/Xeon/Dockerfile.rockylinux9
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ RUN echo "ERROR!" && exit 1
ARG DL_PREFIX=/opt
ARG PREFIX=/opt/build
ARG LD_LIBRARY_PATH="/opt/build/lib:/opt/build/lib64:/usr/local/lib:/usr/local/lib64"
ARG FFMPEG_COMMIT_ID="n6.1.1"
ARG FFMPEG_COMMIT_ID="n7.1"
ENV TZ="Europe/Warsaw"

ARG NASM_RPM_LINK="https://rpmfind.net/linux/centos-stream/9-stream/CRB/x86_64/os/Packages/nasm-2.15.03-7.el9.x86_64.rpm"
Expand Down
2 changes: 1 addition & 1 deletion docker/Xeon/Dockerfile.rockylinux9-mini
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ FROM ${IMAGE_CACHE_REGISTRY}/${IMAGE_NAME} AS build
ARG DL_PREFIX=/opt
ARG PREFIX=/opt/build
ARG LD_LIBRARY_PATH="/opt/build/lib:/opt/build/lib64:/usr/local/lib:/usr/local/lib64"
ARG FFMPEG_COMMIT_ID="n6.1.1"
ARG FFMPEG_COMMIT_ID="n7.1"
ENV TZ="Europe/Warsaw"

ARG NASM_RPM_LINK="https://rpmfind.net/linux/centos-stream/9-stream/CRB/x86_64/os/Packages/nasm-2.15.03-7.el9.x86_64.rpm"
Expand Down
13 changes: 11 additions & 2 deletions docker/Xeon/Dockerfile.ubuntu18.04
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ ARG DL_PREFIX=/opt
ARG LD_LIBRARY_PATH="/opt/build/lib:/opt/build/lib64:${LD_LIBRARY_PATH}"
ENV DEBIAN_FRONTEND="noninteractive"
ENV TZ="Europe/Warsaw"
ARG FFMPEG_COMMIT_ID="n6.1.1"
ARG FFMPEG_COMMIT_ID="n7.1"

WORKDIR ${DL_PREFIX}/ffmpeg
SHELL ["/bin/bash", "-ex", "-o", "pipefail", "-c"]
Expand All @@ -25,7 +25,6 @@ RUN rm /etc/apt/sources.list.d/oneAPI.list && \
apt-get install --no-install-recommends -y \
git tar ca-certificates \
libx265-dev \
libx264-dev \
zlib1g-dev \
nasm \
gcc-9 \
Expand All @@ -40,6 +39,16 @@ RUN rm /etc/apt/sources.list.d/oneAPI.list && \
tar -zx --strip-components=1 -C "${DL_PREFIX}/ffmpeg"


# build and install x264 from source
WORKDIR ${DL_PREFIX}
RUN git clone https://github.com/mirror/x264 -b stable --depth 1

WORKDIR ${DL_PREFIX}/x264
RUN ./configure --enable-shared && \
make -j "$(nproc)" && \
make install && \
ldconfig

COPY . ${DL_PREFIX}/Video-Super-Resolution-Library

WORKDIR ${DL_PREFIX}/Video-Super-Resolution-Library
Expand Down
2 changes: 1 addition & 1 deletion docker/Xeon/Dockerfile.ubuntu20.04
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ ARG DL_PREFIX=/opt
ARG LD_LIBRARY_PATH="/opt/build/lib:/opt/build/lib64:${LD_LIBRARY_PATH}"
ENV DEBIAN_FRONTEND="noninteractive"
ENV TZ="Europe/Warsaw"
ARG FFMPEG_COMMIT_ID="n6.1.1"
ARG FFMPEG_COMMIT_ID="n7.1"

WORKDIR ${DL_PREFIX}/ffmpeg
SHELL ["/bin/bash", "-ex", "-o", "pipefail", "-c"]
Expand Down
2 changes: 1 addition & 1 deletion docker/Xeon/Dockerfile.ubuntu22.04
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ ARG DL_PREFIX=/opt
ARG LD_LIBRARY_PATH="/opt/build/lib:/opt/build/lib64:${LD_LIBRARY_PATH}"
ENV DEBIAN_FRONTEND="noninteractive"
ENV TZ="Europe/Warsaw"
ARG FFMPEG_COMMIT_ID="n6.1.1"
ARG FFMPEG_COMMIT_ID="n7.1"

WORKDIR ${DL_PREFIX}/ffmpeg
SHELL ["/bin/bash", "-ex", "-o", "pipefail", "-c"]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,36 +1,44 @@
From 467d3dded4549645b16710807562e84a075739c5 Mon Sep 17 00:00:00 2001
From d2cd96acaaa6211ea8d8aa5025fb9e655f78b212 Mon Sep 17 00:00:00 2001
From: Xiaoxia Liang <[email protected]>
Date: Mon, 24 Jul 2023 11:49:13 +0800
Subject: [PATCH 1/2] FFmpeg Raisr filter for n6.0.
Date: Thu, 3 Apr 2025 17:40:44 +0000
Subject: [PATCH] Upgrade Raisr ffmpeg plugin to n7.1 from n6.1.1

Signed-off-by: Xiaoxia Liang <[email protected]>
---
configure | 12 ++++++++++++
libavfilter/Makefile | 1 +
libavfilter/allfilters.c | 1 +
3 files changed, 14 insertions(+)
configure | 13 +++++++++++++
libavfilter/Makefile | 2 ++
libavfilter/allfilters.c | 2 ++
3 files changed, 17 insertions(+)

diff --git a/configure b/configure
index b6616f00b6..f87716611b 100755
index d77a55b653..2f90d21aa0 100755
--- a/configure
+++ b/configure
@@ -240,6 +240,7 @@ External library support:
@@ -241,6 +241,7 @@ External library support:
--enable-libgsm enable GSM de/encoding via libgsm [no]
--enable-libiec61883 enable iec61883 via libiec61883 [no]
--enable-libilbc enable iLBC de/encoding via libilbc [no]
+ --enable-libipp enable Intel IPP libary based scalin
--enable-libjack enable JACK audio sound server [no]
--enable-libjxl enable JPEG XL de/encoding via libjxl [no]
--enable-libklvanc enable Kernel Labs VANC processing [no]
@@ -1823,6 +1824,7 @@ EXTERNAL_LIBRARY_LIST="
@@ -1926,6 +1927,7 @@ EXTERNAL_LIBRARY_LIST="
libgsm
libiec61883
libilbc
+ libipp
libjack
libjxl
libklvanc
@@ -6667,6 +6669,16 @@ enabled libopus && {
@@ -3962,6 +3964,7 @@ transpose_opencl_filter_deps="opencl"
transpose_vaapi_filter_deps="vaapi VAProcPipelineCaps_rotation_flags"
transpose_vt_filter_deps="videotoolbox VTPixelRotationSessionCreate"
transpose_vulkan_filter_deps="vulkan spirv_compiler"
+raisr_opencl_filter_deps="opencl"
unsharp_opencl_filter_deps="opencl"
uspp_filter_deps="gpl avcodec"
vaguedenoiser_filter_deps="gpl"
@@ -6978,6 +6981,16 @@ enabled libopus && {
}
}
enabled libplacebo && require_pkg_config libplacebo "libplacebo >= 4.192.0" libplacebo/vulkan.h pl_vulkan_create
Expand All @@ -45,31 +53,41 @@ index b6616f00b6..f87716611b 100755
+ die "ERROR: Intel IPP not found"
+fi
enabled libpulse && require_pkg_config libpulse libpulse pulse/pulseaudio.h pa_context_new
enabled librabbitmq && require_pkg_config librabbitmq "librabbitmq >= 0.7.1" amqp.h amqp_new_connection
enabled librav1e && require_pkg_config librav1e "rav1e >= 0.5.0" rav1e.h rav1e_context_new
enabled libqrencode && require_pkg_config libqrencode libqrencode qrencode.h QRcode_encodeString
enabled libquirc && require libquirc quirc.h quirc_decode -lquirc
diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index b3d3d981dd..13126f7f48 100644
index 91487afb21..dbf1114d78 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -425,6 +425,7 @@ OBJS-$(CONFIG_PSEUDOCOLOR_FILTER) += vf_pseudocolor.o
OBJS-$(CONFIG_PSNR_FILTER) += vf_psnr.o framesync.o
@@ -440,6 +440,7 @@ OBJS-$(CONFIG_PSNR_FILTER) += vf_psnr.o framesync.o
OBJS-$(CONFIG_PULLUP_FILTER) += vf_pullup.o
OBJS-$(CONFIG_QP_FILTER) += vf_qp.o
OBJS-$(CONFIG_QUIRC_FILTER) += vf_quirc.o
+OBJS-$(CONFIG_RAISR_FILTER) += vf_raisr.o
OBJS-$(CONFIG_RANDOM_FILTER) += vf_random.o
OBJS-$(CONFIG_READEIA608_FILTER) += vf_readeia608.o
OBJS-$(CONFIG_READVITC_FILTER) += vf_readvitc.o
@@ -563,6 +564,7 @@ OBJS-$(CONFIG_XBR_FILTER) += vf_xbr.o
OBJS-$(CONFIG_XCORRELATE_FILTER) += vf_convolve.o framesync.o
OBJS-$(CONFIG_XFADE_FILTER) += vf_xfade.o
OBJS-$(CONFIG_XFADE_OPENCL_FILTER) += vf_xfade_opencl.o opencl.o opencl/xfade.o
+OBJS-$(CONFIG_RAISR_OPENCL_FILTER) += vf_raisr_opencl.o opencl.o
OBJS-$(CONFIG_XFADE_VULKAN_FILTER) += vf_xfade_vulkan.o vulkan.o vulkan_filter.o
OBJS-$(CONFIG_XMEDIAN_FILTER) += vf_xmedian.o framesync.o
OBJS-$(CONFIG_XPSNR_FILTER) += vf_xpsnr.o framesync.o
diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
index d7db46c2af..0dc81faaed 100644
index 9819f0f95b..92a384ca68 100644
--- a/libavfilter/allfilters.c
+++ b/libavfilter/allfilters.c
@@ -401,6 +401,7 @@ extern const AVFilter ff_vf_pseudocolor;
extern const AVFilter ff_vf_psnr;
extern const AVFilter ff_vf_pullup;
@@ -415,6 +415,8 @@ extern const AVFilter ff_vf_pullup;
extern const AVFilter ff_vf_qp;
extern const AVFilter ff_vf_qrencode;
extern const AVFilter ff_vf_quirc;
+extern const AVFilter ff_vf_raisr;
+extern const AVFilter ff_vf_raisr_opencl;
extern const AVFilter ff_vf_random;
extern const AVFilter ff_vf_readeia608;
extern const AVFilter ff_vf_readvitc;
--
2.34.1

50 changes: 0 additions & 50 deletions ffmpeg/0002-libavfilter-raisr_opencl-Add-raisr_opencl-filter.patch

This file was deleted.

1 change: 0 additions & 1 deletion ffmpeg/vf_raisr.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
#include "libavutil/pixfmt.h"
#include "avfilter.h"
#include "formats.h"
#include "internal.h"
#include "video.h"
#include "raisr/RaisrHandler.h"
#include "raisr/RaisrDefaults.h"
Expand Down
7 changes: 4 additions & 3 deletions ffmpeg/vf_raisr_opencl.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include "raisr/RaisrDefaults.h"
#include "libavutil/opt.h"
#include "avfilter.h"
#include "internal.h"
#include "opencl.h"
#include "libavutil/pixdesc.h"
#include "video.h"
Expand Down Expand Up @@ -157,8 +156,9 @@ static int raisr_filter_config_input(AVFilterLink *inlink)
{
AVHWFramesContext *input_frames;
int err;
FilterLink *inl = ff_filter_link(inlink);

input_frames = (AVHWFramesContext*)inlink->hw_frames_ctx->data;
input_frames = (AVHWFramesContext*)inl->hw_frames_ctx->data;
if (input_frames->format != AV_PIX_FMT_OPENCL)
return AVERROR(EINVAL);

Expand All @@ -178,6 +178,7 @@ static int raisr_opencl_config_output(AVFilterLink *outlink)
{
AVFilterContext *avctx = outlink->src;
AVFilterLink *inlink = avctx->inputs[0];
FilterLink *inl = ff_filter_link(inlink);
RaisrOpenCLContext *ctx = avctx->priv;
AVHWFramesContext *input_frames;
const AVPixFmtDescriptor *desc;
Expand All @@ -187,7 +188,7 @@ static int raisr_opencl_config_output(AVFilterLink *outlink)
if (err < 0)
return err;

input_frames = (AVHWFramesContext*)inlink->hw_frames_ctx->data;
input_frames = (AVHWFramesContext*)inl->hw_frames_ctx->data;
ctx->sw_format = (enum AVPixelFormat)input_frames->sw_format;
desc = av_pix_fmt_desc_get(ctx->sw_format);
if (desc && desc->comp[0].depth != ctx->bits) {
Expand Down
4 changes: 2 additions & 2 deletions scripts/01_pull_resources.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ if [ ! -d "ffmpeg" ];then
fi

pushd ffmpeg
git checkout -b n6.0 n6.0
git am ../Video-Super-Resolution-Library/ffmpeg/0001-ffmpeg-raisr-filter.patch
git checkout -b n7.1 n7.1
git am ../Video-Super-Resolution-Library/ffmpeg/0001-Upgrade-Raisr-ffmpeg-plugin-to-n7.1-from-n6.1.1.patch
popd

# pull nasm used for build x264
Expand Down
Loading