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_ST2094_40, TONE_MAP_ST2094_10,
  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 void libplacebo_uninit (AVFilterContext *avctx)
 
static int libplacebo_init (AVFilterContext *avctx)
 
static int init_vulkan (AVFilterContext *avctx)
 
static int process_frames (AVFilterContext *avctx, AVFrame *out, AVFrame *in)
 
static int filter_frame (AVFilterLink *link, AVFrame *in)
 
static int libplacebo_query_format (AVFilterContext *ctx)
 
static int libplacebo_config_input (AVFilterLink *inlink)
 
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 686 of file vf_libplacebo.c.

◆ STATIC

Definition at line 687 of file vf_libplacebo.c.

◆ DYNAMIC

#define DYNAMIC   (STATIC | AV_OPT_FLAG_RUNTIME_PARAM)

Definition at line 688 of file vf_libplacebo.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
TONE_MAP_AUTO 
TONE_MAP_CLIP 
TONE_MAP_ST2094_40 
TONE_MAP_ST2094_10 
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 158 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 170 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 187 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 202 of file vf_libplacebo.c.

Referenced by process_frames().

◆ libplacebo_uninit()

static void libplacebo_uninit ( AVFilterContext avctx)
static

Definition at line 331 of file vf_libplacebo.c.

Referenced by libplacebo_init().

◆ libplacebo_init()

static int libplacebo_init ( AVFilterContext avctx)
static

Definition at line 227 of file vf_libplacebo.c.

◆ init_vulkan()

static int init_vulkan ( AVFilterContext avctx)
static

Definition at line 257 of file vf_libplacebo.c.

Referenced by libplacebo_query_format().

◆ process_frames()

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

Definition at line 346 of file vf_libplacebo.c.

Referenced by filter_frame().

◆ filter_frame()

static int filter_frame ( AVFilterLink link,
AVFrame in 
)
static

Definition at line 489 of file vf_libplacebo.c.

◆ libplacebo_query_format()

static int libplacebo_query_format ( AVFilterContext ctx)
static

Definition at line 554 of file vf_libplacebo.c.

◆ libplacebo_config_input()

static int libplacebo_config_input ( AVFilterLink inlink)
static

Definition at line 617 of file vf_libplacebo.c.

◆ libplacebo_config_output()

static int libplacebo_config_output ( AVFilterLink outlink)
static

Definition at line 631 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 45 of file vf_libplacebo.c.

Referenced by process_frames().

◆ libplacebo_options

const AVOption libplacebo_options[]
static

Definition at line 690 of file vf_libplacebo.c.

◆ libplacebo_inputs

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

Definition at line 858 of file vf_libplacebo.c.

◆ libplacebo_outputs

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

Definition at line 867 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 875 of file vf_libplacebo.c.

libplacebo_query_format
static int libplacebo_query_format(AVFilterContext *ctx)
Definition: vf_libplacebo.c:554
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:374
TONE_MAP_BT2446A
@ TONE_MAP_BT2446A
Definition: vf_libplacebo.c:35
FILTER_QUERY_FUNC
#define FILTER_QUERY_FUNC(func)
Definition: internal.h:171
LibplaceboContext
Definition: vf_libplacebo.c:62
libplacebo_config_output
static int libplacebo_config_output(AVFilterLink *outlink)
Definition: vf_libplacebo.c:631
TONE_MAP_AUTO
@ TONE_MAP_AUTO
Definition: vf_libplacebo.c:30
filter_frame
static int filter_frame(AVFilterLink *link, AVFrame *in)
Definition: vf_libplacebo.c:489
TONE_MAP_MOBIUS
@ TONE_MAP_MOBIUS
Definition: vf_libplacebo.c:38
libplacebo_inputs
static const AVFilterPad libplacebo_inputs[]
Definition: vf_libplacebo.c:858
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts_bsf.c:365
libplacebo_uninit
static void libplacebo_uninit(AVFilterContext *avctx)
Definition: vf_libplacebo.c:331
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:194
TONE_MAP_REINHARD
@ TONE_MAP_REINHARD
Definition: vf_libplacebo.c:37
TONE_MAP_GAMMA
@ TONE_MAP_GAMMA
Definition: vf_libplacebo.c:40
libplacebo_config_input
static int libplacebo_config_input(AVFilterLink *inlink)
Definition: vf_libplacebo.c:617
TONE_MAP_HABLE
@ TONE_MAP_HABLE
Definition: vf_libplacebo.c:39
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:115
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:842
TONE_MAP_CLIP
@ TONE_MAP_CLIP
Definition: vf_libplacebo.c:31
libplacebo_outputs
static const AVFilterPad libplacebo_outputs[]
Definition: vf_libplacebo.c:867
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
TONE_MAP_LINEAR
@ TONE_MAP_LINEAR
Definition: vf_libplacebo.c:41
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:195
TONE_MAP_SPLINE
@ TONE_MAP_SPLINE
Definition: vf_libplacebo.c:36
uninit
static av_cold int uninit(AVCodecContext *avctx)
Definition: crystalhd.c:285
libplacebo_init
static int libplacebo_init(AVFilterContext *avctx)
Definition: vf_libplacebo.c:227
TONE_MAP_BT2390
@ TONE_MAP_BT2390
Definition: vf_libplacebo.c:34