28 #include "libavutil/common.h"
29 #include "libavutil/opt.h"
30 #include "libavutil/pixdesc.h"
62 "type:%s start_frame:%d nb_frames:%d\n",
100 int slice_h = frame->
height / nb_jobs;
101 int slice_start = jobnr * slice_h;
102 int slice_end = (jobnr == nb_jobs - 1) ? frame->
height : (jobnr + 1) * slice_h;
105 for (i = slice_start; i <
slice_end; i++) {
107 for (j = 0; j < frame->
width * s->
bpp; j++) {
111 *p = (*p * s->
factor + 32768) >> 16;
125 int slice_start = jobnr * slice_h;
126 int slice_end = (jobnr == nb_jobs - 1) ? frame->
height : (jobnr + 1) * slice_h;
129 for (plane = 1; plane < 3; plane++) {
130 for (i = slice_start; i <
slice_end; i++) {
136 *p = ((*p - 128) * s->
factor + 8421367) >> 16;
150 if (s->
factor < UINT16_MAX) {
155 if (frame->
data[1] && frame->
data[2]) {
171 #define OFFSET(x) offsetof(FadeContext, x)
172 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM
177 {
"start_frame",
"Number of the first frame to which to apply the effect.",
179 {
"nb_frames",
"Number of frames to which the effect should be applied.",
216 .priv_class = &fade_class,
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
This structure describes decoded (raw) audio or video data.
static const AVFilterPad avfilter_vf_fade_outputs[]
const char * name
Filter name.
packed RGB 8:8:8, 24bpp, RGBRGB...
void * priv
private data for use by the filter
static const AVFilterPad outputs[]
void av_log(void *avcl, int level, const char *fmt,...) av_printf_format(3
Send the specified message to the log if the level is less than or equal to the current av_log_level...
AVFrame * ff_null_get_video_buffer(AVFilterLink *link, int w, int h)
static int config_props(AVFilterLink *inlink)
uint8_t log2_chroma_w
Amount to shift the luma width right to find the chroma width.
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
int nb_threads
Maximum number of threads used by filters in this graph.
#define AV_LOG_VERBOSE
Detailed information.
static const AVOption options[]
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
A link between two filters.
static int query_formats(AVFilterContext *ctx)
int width
width and height of the video frame
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
uint8_t log2_chroma_h
Amount to shift the luma height right to find the chroma height.
static av_cold int init(AVFilterContext *ctx)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
AVPixelFormat
Pixel format.
int av_get_bits_per_pixel(const AVPixFmtDescriptor *pixdesc)
Return the number of bits per pixel used by the pixel format described by pixdesc.
static int filter_slice_chroma(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
static const AVFilterPad avfilter_vf_fade_inputs[]
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
int format
agreed upon media format
if(ac->has_optimized_func)
Main libavfilter public API header.
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
AVFilterLink ** outputs
array of pointers to output links
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
packed RGB 8:8:8, 24bpp, BGRBGR...
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV422P and setting color_...
Describe the class of an AVClass context structure.
static int filter_slice_luma(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
static const AVFilterPad inputs[]
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
AVFilterContext * dst
dest filter
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV444P and setting color_...
AVFilterInternal * internal
An opaque struct for libavfilter internal use.
planar YUV 4:4:0 full scale (JPEG), deprecated in favor of PIX_FMT_YUV440P and setting color_range ...
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
struct AVFilterGraph * graph
filtergraph this filter belongs to
avfilter_execute_func * execute
struct AVFilterPad AVFilterPad
static int slice_end(AVCodecContext *avctx, AVFrame *pict)
Handle slice ends.
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV420P and setting color_...
static const AVClass fade_class
av_default_item_name
Return the context name.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.