FFmpeg
Data Structures | Macros | Functions | Variables
vf_sharpen_npp.c File Reference
#include <nppi.h>
#include <nppi_filtering_functions.h>
#include "internal.h"
#include "libavutil/pixdesc.h"
#include "libavutil/cuda_check.h"
#include "libavutil/hwcontext.h"
#include "libavutil/hwcontext_cuda_internal.h"
#include "libavutil/opt.h"

Go to the source code of this file.

Data Structures

struct  NPPSharpenContext
 

Macros

#define CHECK_CU(x)   FF_CUDA_CHECK_DL(ctx, device_hwctx->internal->cuda_dl, x)
 
#define OFFSET(x)   offsetof(NPPSharpenContext, x)
 
#define FLAGS   (AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_VIDEO_PARAM)
 

Functions

static int nppsharpen_init (AVFilterContext *ctx)
 
static int nppsharpen_config (AVFilterContext *ctx, int width, int height)
 
static void nppsharpen_uninit (AVFilterContext *ctx)
 
static int nppsharpen_config_props (AVFilterLink *outlink)
 
static int nppsharpen_sharpen (AVFilterContext *ctx, AVFrame *out, AVFrame *in)
 
static int nppsharpen_filter_frame (AVFilterLink *link, AVFrame *in)
 

Variables

static enum AVPixelFormat supported_formats []
 
static const AVOption options []
 
static const AVClass nppsharpen_class
 
static const AVFilterPad nppsharpen_inputs []
 
static const AVFilterPad nppsharpen_outputs []
 
const AVFilter ff_vf_sharpen_npp
 

Detailed Description

NPP sharpen video filter

Definition in file vf_sharpen_npp.c.

Macro Definition Documentation

◆ CHECK_CU

#define CHECK_CU (   x)    FF_CUDA_CHECK_DL(ctx, device_hwctx->internal->cuda_dl, x)

Definition at line 34 of file vf_sharpen_npp.c.

◆ OFFSET

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

Definition at line 228 of file vf_sharpen_npp.c.

◆ FLAGS

Definition at line 229 of file vf_sharpen_npp.c.

Function Documentation

◆ nppsharpen_init()

static int nppsharpen_init ( AVFilterContext ctx)
static

Definition at line 51 of file vf_sharpen_npp.c.

◆ nppsharpen_config()

static int nppsharpen_config ( AVFilterContext ctx,
int  width,
int  height 
)
static

Definition at line 71 of file vf_sharpen_npp.c.

Referenced by nppsharpen_config_props().

◆ nppsharpen_uninit()

static void nppsharpen_uninit ( AVFilterContext ctx)
static

Definition at line 125 of file vf_sharpen_npp.c.

◆ nppsharpen_config_props()

static int nppsharpen_config_props ( AVFilterLink outlink)
static

Definition at line 134 of file vf_sharpen_npp.c.

◆ nppsharpen_sharpen()

static int nppsharpen_sharpen ( AVFilterContext ctx,
AVFrame out,
AVFrame in 
)
static

Definition at line 153 of file vf_sharpen_npp.c.

Referenced by nppsharpen_filter_frame().

◆ nppsharpen_filter_frame()

static int nppsharpen_filter_frame ( AVFilterLink link,
AVFrame in 
)
static

Definition at line 177 of file vf_sharpen_npp.c.

Variable Documentation

◆ supported_formats

enum AVPixelFormat supported_formats[]
static
Initial value:

Definition at line 36 of file vf_sharpen_npp.c.

Referenced by nppsharpen_config().

◆ options

const AVOption options[]
static
Initial value:
= {
{ "border_type", "Type of operation to be performed on image border", OFFSET(border_type), AV_OPT_TYPE_INT, { .i64 = NPP_BORDER_REPLICATE }, NPP_BORDER_REPLICATE, NPP_BORDER_REPLICATE, FLAGS, .unit = "border_type" },
{ "replicate", "replicate pixels", 0, AV_OPT_TYPE_CONST, { .i64 = NPP_BORDER_REPLICATE }, 0, 0, FLAGS, .unit = "border_type" },
{NULL},
}

Definition at line 230 of file vf_sharpen_npp.c.

◆ nppsharpen_class

const AVClass nppsharpen_class
static
Initial value:
= {
.class_name = "nppsharpen",
.item_name = av_default_item_name,
.option = options,
}

Definition at line 236 of file vf_sharpen_npp.c.

◆ nppsharpen_inputs

const AVFilterPad nppsharpen_inputs[]
static
Initial value:
= {{
.name = "default",
.filter_frame = nppsharpen_filter_frame,
}}

Definition at line 243 of file vf_sharpen_npp.c.

◆ nppsharpen_outputs

const AVFilterPad nppsharpen_outputs[]
static
Initial value:
= {{
.name = "default",
.config_props = nppsharpen_config_props,
}}

Definition at line 249 of file vf_sharpen_npp.c.

◆ ff_vf_sharpen_npp

const AVFilter ff_vf_sharpen_npp
Initial value:
= {
.name = "sharpen_npp",
.description = NULL_IF_CONFIG_SMALL("NVIDIA Performance Primitives video "
"sharpening filter."),
.init = nppsharpen_init,
.uninit = nppsharpen_uninit,
.priv_size = sizeof(NPPSharpenContext),
.priv_class = &nppsharpen_class,
.flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
}

Definition at line 255 of file vf_sharpen_npp.c.

AV_PIX_FMT_CUDA
@ AV_PIX_FMT_CUDA
HW acceleration through CUDA.
Definition: pixfmt.h:260
options
static const AVOption options[]
Definition: vf_sharpen_npp.c:230
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:351
FLAGS
#define FLAGS
Definition: vf_sharpen_npp.c:229
nppsharpen_inputs
static const AVFilterPad nppsharpen_inputs[]
Definition: vf_sharpen_npp.c:243
nppsharpen_uninit
static void nppsharpen_uninit(AVFilterContext *ctx)
Definition: vf_sharpen_npp.c:125
OFFSET
#define OFFSET(x)
Definition: vf_sharpen_npp.c:228
nppsharpen_filter_frame
static int nppsharpen_filter_frame(AVFilterLink *link, AVFrame *in)
Definition: vf_sharpen_npp.c:177
nppsharpen_init
static int nppsharpen_init(AVFilterContext *ctx)
Definition: vf_sharpen_npp.c:51
AV_PIX_FMT_YUV420P
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:73
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:182
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
NULL
#define NULL
Definition: coverity.c:32
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:237
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:106
NPPSharpenContext
Definition: vf_sharpen_npp.c:41
FILTER_SINGLE_PIXFMT
#define FILTER_SINGLE_PIXFMT(pix_fmt_)
Definition: internal.h:172
nppsharpen_config_props
static int nppsharpen_config_props(AVFilterLink *outlink)
Definition: vf_sharpen_npp.c:134
nppsharpen_outputs
static const AVFilterPad nppsharpen_outputs[]
Definition: vf_sharpen_npp.c:249
nppsharpen_class
static const AVClass nppsharpen_class
Definition: vf_sharpen_npp.c:236
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:235
AV_PIX_FMT_YUV444P
@ AV_PIX_FMT_YUV444P
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition: pixfmt.h:78
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:183
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Definition: opt.h:244