56 #define OFFSET(x) offsetof(SierpinskiContext, x) 57 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM 92 while (pos_x != 0 && pos_y != 0) {
93 if (
FFABS(pos_x % 3) == 1 &&
FFABS(pos_y % 3) == 1)
109 const int start = (height * job ) / nb_jobs;
110 const int end = (height * (job+1)) / nb_jobs;
113 for (
int y = start; y <
end; y++) {
114 for (
int x = 0; x <
width; x++) {
116 AV_WL32(&dst[x*4], 0x00000000);
118 AV_WL32(&dst[x*4], 0xFFFFFFFF);
134 const int start = (height * job ) / nb_jobs;
135 const int end = (height * (job+1)) / nb_jobs;
138 for (
int y = start; y <
end; y++) {
139 for (
int x = 0; x <
width; x++) {
141 AV_WL32(&dst[x*4], 0x00000000);
143 AV_WL32(&dst[x*4], 0xFFFFFFFF);
184 s->
dest_y += (
int)((rnd >> 16) % mod) - s->
jump;
227 .
name =
"sierpinski",
230 .priv_class = &sierpinski_class,
Context structure for the Lagged Fibonacci PRNG.
This structure describes decoded (raw) audio or video data.
Main libavfilter public API header.
static int draw_carpet_slice(AVFilterContext *ctx, void *arg, int job, int nb_jobs)
AVFilter ff_vsrc_sierpinski
int h
agreed upon image height
AVFrame * ff_get_video_buffer(AVFilterLink *link, int w, int h)
Request a picture buffer with a specific set of permissions.
static int config_output(AVFilterLink *inlink)
const char * name
Pad name.
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
static av_cold int end(AVCodecContext *avctx)
int(* draw_slice)(AVFilterContext *ctx, void *arg, int job, int nb_jobs)
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
static int sierpinski_request_frame(AVFilterLink *link)
static int draw_triangle_slice(AVFilterContext *ctx, void *arg, int job, int nb_jobs)
A filter pad used for either input or output.
A link between two filters.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
void * priv
private data for use by the filter
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
AVRational time_base
Define the time base used by the PTS of the frames/samples which will pass through this link...
static const AVFilterPad sierpinski_outputs[]
#define AV_PIX_FMT_0BGR32
int w
agreed upon image width
int av_image_check_size(unsigned int w, unsigned int h, int log_offset, void *log_ctx)
Check if the given dimension of an image is valid, meaning that all bytes of the image can be address...
int ff_filter_get_nb_threads(AVFilterContext *ctx)
Get number of threads for current filter instance.
static const AVOption sierpinski_options[]
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
#define FFABS(a)
Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable ...
AVFilterContext * src
source filter
static const AVFilterPad outputs[]
AVFILTER_DEFINE_CLASS(sierpinski)
static int query_formats(AVFilterContext *ctx)
static void draw_sierpinski(AVFilterContext *ctx, AVFrame *frame)
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
static int mod(int a, int b)
Modulo operation with only positive remainders.
AVRational sample_aspect_ratio
Sample aspect ratio for the video frame, 0/1 if unknown/unspecified.
static unsigned int av_lfg_get(AVLFG *c)
Get the next random unsigned 32-bit number using an ALFG.
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several inputs
Describe the class of an AVClass context structure.
Rational number (pair of numerator and denominator).
offset must point to AVRational
const char * name
Filter name.
av_cold void av_lfg_init(AVLFG *c, unsigned int seed)
AVRational sample_aspect_ratio
agreed upon sample aspect ratio
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a link
offset must point to two consecutive integers
AVFilterLink ** outputs
array of pointers to output links
static enum AVPixelFormat pix_fmts[]
#define flags(name, subs,...)
AVFilterInternal * internal
An opaque struct for libavfilter internal use.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
The exact code depends on how similar the blocks are and how related they are to the and needs to apply these operations to the correct inlink or outlink if there are several Macros are available to factor that when no extra processing is inlink
static av_always_inline AVRational av_inv_q(AVRational q)
Invert a rational.
avfilter_execute_func * execute
static int fill_sierpinski(SierpinskiContext *s, int x, int y)
uint32_t av_get_random_seed(void)
Get a seed to use in conjunction with random functions.
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later.That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another.Frame references ownership and permissions
AVPixelFormat
Pixel format.