FFmpeg
Data Structures | Macros | Enumerations | Functions | Variables
vf_libplacebo.c File Reference
#include "libavutil/file.h"
#include "libavutil/opt.h"
#include "internal.h"
#include "vulkan_filter.h"
#include "scale_eval.h"
#include <libplacebo/renderer.h>
#include <libplacebo/utils/libav.h>
#include <libplacebo/vulkan.h>

Go to the source code of this file.

Data Structures

struct  LibplaceboContext
 

Macros

#define OFFSET(x)   offsetof(LibplaceboContext, x)
 
#define STATIC   (AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_VIDEO_PARAM)
 
#define DYNAMIC   (STATIC | AV_OPT_FLAG_RUNTIME_PARAM)
 

Enumerations

enum  {
  TONE_MAP_AUTO, TONE_MAP_CLIP, TONE_MAP_BT2390, TONE_MAP_BT2446A,
  TONE_MAP_SPLINE, TONE_MAP_REINHARD, TONE_MAP_MOBIUS, TONE_MAP_HABLE,
  TONE_MAP_GAMMA, TONE_MAP_LINEAR, TONE_MAP_COUNT
}
 

Functions

static enum pl_log_level get_log_level (void)
 
static void pl_av_log (void *log_ctx, enum pl_log_level level, const char *msg)
 
static int parse_shader (AVFilterContext *avctx, const void *shader, size_t len)
 
static int find_scaler (AVFilterContext *avctx, const struct pl_filter_config **opt, const char *name)
 
static int libplacebo_init (AVFilterContext *avctx)
 
static int init_vulkan (AVFilterContext *avctx)
 
static void libplacebo_uninit (AVFilterContext *avctx)
 
static int process_frames (AVFilterContext *avctx, AVFrame *out, AVFrame *in)
 
static int filter_frame (AVFilterLink *link, AVFrame *in)
 
static int libplacebo_config_output (AVFilterLink *outlink)
 
 AVFILTER_DEFINE_CLASS (libplacebo)
 

Variables

static const struct pl_tone_map_function *const tonemapping_funcs [TONE_MAP_COUNT]
 
static const AVOption libplacebo_options []
 
static const AVFilterPad libplacebo_inputs []
 
static const AVFilterPad libplacebo_outputs []
 
const AVFilter ff_vf_libplacebo
 

Macro Definition Documentation

◆ OFFSET

#define OFFSET (   x)    offsetof(LibplaceboContext, x)

Definition at line 564 of file vf_libplacebo.c.

◆ STATIC

Definition at line 565 of file vf_libplacebo.c.

◆ DYNAMIC

#define DYNAMIC   (STATIC | AV_OPT_FLAG_RUNTIME_PARAM)

Definition at line 566 of file vf_libplacebo.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
TONE_MAP_AUTO 
TONE_MAP_CLIP 
TONE_MAP_BT2390 
TONE_MAP_BT2446A 
TONE_MAP_SPLINE 
TONE_MAP_REINHARD 
TONE_MAP_MOBIUS 
TONE_MAP_HABLE 
TONE_MAP_GAMMA 
TONE_MAP_LINEAR 
TONE_MAP_COUNT 

Definition at line 29 of file vf_libplacebo.c.

Function Documentation

◆ get_log_level()

static enum pl_log_level get_log_level ( void  )
inlinestatic

Definition at line 151 of file vf_libplacebo.c.

Referenced by filter_frame(), and libplacebo_init().

◆ pl_av_log()

static void pl_av_log ( void *  log_ctx,
enum pl_log_level  level,
const char *  msg 
)
static

Definition at line 163 of file vf_libplacebo.c.

Referenced by libplacebo_init().

◆ parse_shader()

static int parse_shader ( AVFilterContext avctx,
const void *  shader,
size_t  len 
)
static

Definition at line 180 of file vf_libplacebo.c.

Referenced by init_vulkan().

◆ find_scaler()

static int find_scaler ( AVFilterContext avctx,
const struct pl_filter_config **  opt,
const char *  name 
)
static

Definition at line 195 of file vf_libplacebo.c.

Referenced by process_frames().

◆ libplacebo_init()

static int libplacebo_init ( AVFilterContext avctx)
static

Definition at line 218 of file vf_libplacebo.c.

◆ init_vulkan()

static int init_vulkan ( AVFilterContext avctx)
static

Definition at line 236 of file vf_libplacebo.c.

Referenced by filter_frame().

◆ libplacebo_uninit()

static void libplacebo_uninit ( AVFilterContext avctx)
static

Definition at line 296 of file vf_libplacebo.c.

◆ process_frames()

static int process_frames ( AVFilterContext avctx,
AVFrame out,
AVFrame in 
)
static

Definition at line 310 of file vf_libplacebo.c.

Referenced by filter_frame().

◆ filter_frame()

static int filter_frame ( AVFilterLink link,
AVFrame in 
)
static

Definition at line 441 of file vf_libplacebo.c.

◆ libplacebo_config_output()

static int libplacebo_config_output ( AVFilterLink outlink)
static

Definition at line 508 of file vf_libplacebo.c.

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( libplacebo  )

Variable Documentation

◆ tonemapping_funcs

const struct pl_tone_map_function* const tonemapping_funcs[TONE_MAP_COUNT]
static
Initial value:
= {
[TONE_MAP_AUTO] = &pl_tone_map_auto,
[TONE_MAP_CLIP] = &pl_tone_map_clip,
[TONE_MAP_BT2390] = &pl_tone_map_bt2390,
[TONE_MAP_BT2446A] = &pl_tone_map_bt2446a,
[TONE_MAP_SPLINE] = &pl_tone_map_spline,
[TONE_MAP_REINHARD] = &pl_tone_map_reinhard,
[TONE_MAP_MOBIUS] = &pl_tone_map_mobius,
[TONE_MAP_HABLE] = &pl_tone_map_hable,
[TONE_MAP_GAMMA] = &pl_tone_map_gamma,
[TONE_MAP_LINEAR] = &pl_tone_map_linear,
}

Definition at line 43 of file vf_libplacebo.c.

Referenced by process_frames().

◆ libplacebo_options

const AVOption libplacebo_options[]
static

Definition at line 568 of file vf_libplacebo.c.

◆ libplacebo_inputs

const AVFilterPad libplacebo_inputs[]
static
Initial value:
= {
{
.name = "default",
.filter_frame = &filter_frame,
.config_props = &ff_vk_filter_config_input,
},
}

Definition at line 732 of file vf_libplacebo.c.

◆ libplacebo_outputs

const AVFilterPad libplacebo_outputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = &libplacebo_config_output,
},
}

Definition at line 741 of file vf_libplacebo.c.

◆ ff_vf_libplacebo

const AVFilter ff_vf_libplacebo
Initial value:
= {
.name = "libplacebo",
.description = NULL_IF_CONFIG_SMALL("Apply various GPU filters from libplacebo"),
.priv_size = sizeof(LibplaceboContext),
.priv_class = &libplacebo_class,
.flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
}

Definition at line 749 of file vf_libplacebo.c.

FF_FILTER_FLAG_HWFRAME_AWARE
#define FF_FILTER_FLAG_HWFRAME_AWARE
The filter is aware of hardware frames, and any hardware frame context should not be automatically pr...
Definition: internal.h:370
TONE_MAP_SPLINE
@ TONE_MAP_SPLINE
Definition: vf_libplacebo.c:34
LibplaceboContext
Definition: vf_libplacebo.c:56
TONE_MAP_HABLE
@ TONE_MAP_HABLE
Definition: vf_libplacebo.c:37
AV_PIX_FMT_VULKAN
@ AV_PIX_FMT_VULKAN
Vulkan hardware images.
Definition: pixfmt.h:348
init
static int init
Definition: av_tx.c:47
libplacebo_config_output
static int libplacebo_config_output(AVFilterLink *outlink)
Definition: vf_libplacebo.c:508
TONE_MAP_BT2390
@ TONE_MAP_BT2390
Definition: vf_libplacebo.c:32
filter_frame
static int filter_frame(AVFilterLink *link, AVFrame *in)
Definition: vf_libplacebo.c:441
TONE_MAP_REINHARD
@ TONE_MAP_REINHARD
Definition: vf_libplacebo.c:35
TONE_MAP_CLIP
@ TONE_MAP_CLIP
Definition: vf_libplacebo.c:31
TONE_MAP_BT2446A
@ TONE_MAP_BT2446A
Definition: vf_libplacebo.c:33
libplacebo_inputs
static const AVFilterPad libplacebo_inputs[]
Definition: vf_libplacebo.c:732
libplacebo_uninit
static void libplacebo_uninit(AVFilterContext *avctx)
Definition: vf_libplacebo.c:296
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:190
TONE_MAP_MOBIUS
@ TONE_MAP_MOBIUS
Definition: vf_libplacebo.c:36
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:117
process_command
static int process_command(AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
Definition: af_acrusher.c:306
ff_filter_process_command
int ff_filter_process_command(AVFilterContext *ctx, const char *cmd, const char *arg, char *res, int res_len, int flags)
Generic processing of user supplied commands that are set in the same way as the filter options.
Definition: avfilter.c:863
FILTER_SINGLE_PIXFMT
#define FILTER_SINGLE_PIXFMT(pix_fmt_)
Definition: internal.h:180
TONE_MAP_AUTO
@ TONE_MAP_AUTO
Definition: vf_libplacebo.c:30
libplacebo_outputs
static const AVFilterPad libplacebo_outputs[]
Definition: vf_libplacebo.c:741
ff_vk_filter_config_input
int ff_vk_filter_config_input(AVFilterLink *inlink)
Definition: vulkan_filter.c:52
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
TONE_MAP_LINEAR
@ TONE_MAP_LINEAR
Definition: vf_libplacebo.c:39
TONE_MAP_GAMMA
@ TONE_MAP_GAMMA
Definition: vf_libplacebo.c:38
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:191
uninit
static av_cold int uninit(AVCodecContext *avctx)
Definition: crystalhd.c:285
libplacebo_init
static int libplacebo_init(AVFilterContext *avctx)
Definition: vf_libplacebo.c:218