Go to the documentation of this file.
52 #define OFFSET(x) offsetof(GradientsContext, x)
53 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
96 const float y = 1.f -
x;
98 return (
lrint(c0[0] * y +
c1[0] *
x)) << 0 |
99 (
lrint(c0[1] * y +
c1[1] *
x)) << 8 |
100 (
lrint(c0[2] * y +
c1[2] *
x)) << 16 |
101 (
lrint(c0[3] * y +
c1[3] *
x)) << 24;
106 const float y = 1.f -
x;
108 return (
llrint((c0[0] * y +
c1[0] *
x) * 256)) << 0 |
109 (
llrint((c0[1] * y +
c1[1] *
x) * 256)) << 16 |
110 (
llrint((c0[2] * y +
c1[2] *
x) * 256)) << 32 |
111 (
llrint((c0[3] * y +
c1[3] *
x) * 256)) << 48;
119 if (nb_colors == 1 ||
step <= 0.0) {
120 return arr[0][0] | (arr[0][1] << 8) | (arr[0][2] << 16) | (arr[0][3] << 24);
121 }
else if (
step >= 1.0) {
123 return arr[
i][0] | (arr[
i][1] << 8) | (arr[
i][2] << 16) | (arr[
i][3] << 24);
126 scl =
step * (nb_colors - 1);
137 if (nb_colors == 1 ||
step <= 0.0) {
138 return ((uint64_t)arr[0][0] << 8) | ((uint64_t)arr[0][1] << 24) | ((uint64_t)arr[0][2] << 40) | ((uint64_t)arr[0][3] << 56);
139 }
else if (
step >= 1.0) {
141 return ((uint64_t)arr[
i][0] << 8) | ((uint64_t)arr[
i][1] << 24) | ((uint64_t)arr[
i][2] << 40) | ((uint64_t)arr[
i][3] << 56);
144 scl =
step * (nb_colors - 1);
150 static float project(
float origin_x,
float origin_y,
151 float dest_x,
float dest_y,
152 int point_x,
int point_y)
155 float od_x = dest_x - origin_x;
156 float od_y = dest_y - origin_y;
159 float od_s_q = od_x * od_x + od_y * od_y;
162 float op_x = point_x - origin_x;
163 float op_y = point_y - origin_y;
164 float op_x_od = op_x * od_x + op_y * od_y;
167 return av_clipf(op_x_od / od_s_q, 0.
f, 1.
f);
176 const int start = (
height * job ) / nb_jobs;
177 const int end = (
height * (job+1)) / nb_jobs;
178 const int linesize =
frame->linesize[0] / 4;
179 uint32_t *dst = (uint32_t *)
frame->data[0] + start * linesize;
181 for (
int y = start; y <
end; y++) {
199 const int start = (
height * job ) / nb_jobs;
200 const int end = (
height * (job+1)) / nb_jobs;
201 const int linesize =
frame->linesize[0] / 8;
202 uint64_t *dst = (uint64_t *)
frame->data[0] + start * linesize;
204 for (
int y = start; y <
end; y++) {
233 if (
s->x0 < 0 ||
s->x0 >=
s->w)
235 if (
s->y0 < 0 ||
s->y0 >=
s->h)
237 if (
s->x1 < 0 ||
s->x1 >=
s->w)
239 if (
s->y1 < 0 ||
s->y1 >=
s->h)
250 float angle = fmodf(
s->pts / 100.f, 2.f *
M_PI);
251 const float w2 =
s->w / 2.f;
252 const float h2 =
s->h / 2.f;
254 s->fx0 = (
s->x0 - w2) *
cosf(angle) - (
s->y0 - h2) *
sinf(angle) + w2;
255 s->fy0 = (
s->x0 - w2) *
sinf(angle) + (
s->y0 - h2) *
cosf(angle) + h2;
257 s->fx1 = (
s->x1 - w2) *
cosf(angle) - (
s->y1 - h2) *
sinf(angle) + w2;
258 s->fy1 = (
s->x1 - w2) *
sinf(angle) + (
s->y1 - h2) *
cosf(angle) + h2;
285 .priv_class = &gradients_class,
AVFrame * ff_get_video_buffer(AVFilterLink *link, int w, int h)
Request a picture buffer with a specific set of permissions.
AVPixelFormat
Pixel format.
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
static int query_formats(AVFilterContext *ctx)
av_cold void av_lfg_init(AVLFG *c, unsigned int seed)
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
@ AV_OPT_TYPE_VIDEO_RATE
offset must point to AVRational
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_cold int end(AVCodecContext *avctx)
This structure describes decoded (raw) audio or video data.
trying all byte sequences megabyte in length and selecting the best looking sequence will yield cases to try But a word about which is also called distortion Distortion can be quantified by almost any quality measurement one chooses the sum of squared differences is used but more complex methods that consider psychovisual effects can be used as well It makes no difference in this discussion First step
const char * name
Filter name.
AVFormatInternal * internal
An opaque field for libavformat internal usage.
A link between two filters.
uint32_t av_get_random_seed(void)
Get a seed to use in conjunction with random functions.
AVFilter ff_vsrc_gradients
FFmpeg Automated Testing Environment ************************************Introduction Using FATE from your FFmpeg source directory Submitting the results to the FFmpeg result aggregation server Uploading new samples to the fate suite FATE makefile targets and variables Makefile targets Makefile variables Examples Introduction **************FATE is an extended regression suite on the client side and a means for results aggregation and presentation on the server side The first part of this document explains how you can use FATE from your FFmpeg source directory to test your ffmpeg binary The second part describes how you can run FATE to submit the results to FFmpeg’s FATE server In any way you can have a look at the publicly viewable FATE results by visiting this as it can be seen if some test on some platform broke with their recent contribution This usually happens on the platforms the developers could not test on The second part of this document describes how you can run FATE to submit your results to FFmpeg’s FATE server If you want to submit your results be sure to check that your combination of OS and compiler is not already listed on the above mentioned website In the third part you can find a comprehensive listing of FATE makefile targets and variables Using FATE from your FFmpeg source directory **********************************************If you want to run FATE on your machine you need to have the samples in place You can get the samples via the build target fate rsync Use this command from the top level source this will cause FATE to fail NOTE To use a custom wrapper to run the pass ‘ target exec’ to ‘configure’ or set the TARGET_EXEC Make variable Submitting the results to the FFmpeg result aggregation server ****************************************************************To submit your results to the server you should run fate through the shell script ‘tests fate sh’ from the FFmpeg sources This script needs to be invoked with a configuration file as its first argument tests fate sh path to fate_config A configuration file template with comments describing the individual configuration variables can be found at ‘doc fate_config sh template’ Create a configuration that suits your based on the configuration template The ‘slot’ configuration variable can be any string that is not yet but it is suggested that you name it adhering to the following pattern ‘ARCH OS COMPILER COMPILER VERSION’ The configuration file itself will be sourced in a shell therefore all shell features may be used This enables you to setup the environment as you need it for your build For your first test runs the ‘fate_recv’ variable should be empty or commented out This will run everything as normal except that it will omit the submission of the results to the server The following files should be present in $workdir as specified in the configuration it may help to try out the ‘ssh’ command with one or more ‘ v’ options You should get detailed output concerning your SSH configuration and the authentication process The only thing left is to automate the execution of the fate sh script and the synchronisation of the samples directory Uploading new samples to the fate suite *****************************************If you need a sample uploaded send a mail to samples request This is for developers who have an account on the fate suite server If you upload new please make sure they are as small as space on each network bandwidth and so on benefit from smaller test cases Also keep in mind older checkouts use existing sample that means in practice generally do not remove or overwrite files as it likely would break older checkouts or releases Also all needed samples for a commit should be ideally before the push If you need an account for frequently uploading samples or you wish to help others by doing that send a mail to ffmpeg devel rsync vauL Duo x
static uint32_t lerp_colors(uint8_t arr[3][4], int nb_colors, float step)
static int config_output(AVFilterLink *inlink)
A filter pad used for either input or output.
static unsigned int av_lfg_get(AVLFG *c)
Get the next random unsigned 32-bit number using an ALFG.
static const AVFilterPad outputs[]
static enum AVPixelFormat pix_fmts[]
static const AVOption gradients_options[]
static uint64_t lerp_colors16(uint8_t arr[3][4], int nb_colors, float step)
@ AV_PIX_FMT_RGBA
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
#define AV_PIX_FMT_RGBA64
Describe the class of an AVClass context structure.
Rational number (pair of numerator and denominator).
static const AVFilterPad gradients_outputs[]
@ AV_OPT_TYPE_IMAGE_SIZE
offset must point to two consecutive integers
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
Context structure for the Lagged Fibonacci PRNG.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
AVFilterContext * src
source filter
static int draw_gradients_slice(AVFilterContext *ctx, void *arg, int job, int nb_jobs)
#define i(width, name, range_min, range_max)
int ff_filter_get_nb_threads(AVFilterContext *ctx)
Get number of threads for current filter instance.
static av_always_inline AVRational av_inv_q(AVRational q)
Invert a rational.
const char * name
Pad name.
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
AVFILTER_DEFINE_CLASS(gradients)
FFmpeg Automated Testing Environment ************************************Introduction Using FATE from your FFmpeg source directory Submitting the results to the FFmpeg result aggregation server Uploading new samples to the fate suite FATE makefile targets and variables Makefile targets Makefile variables Examples Introduction **************FATE is an extended regression suite on the client side and a means for results aggregation and presentation on the server side The first part of this document explains how you can use FATE from your FFmpeg source directory to test your ffmpeg binary The second part describes how you can run FATE to submit the results to FFmpeg’s FATE server In any way you can have a look at the publicly viewable FATE results by visiting this as it can be seen if some test on some platform broke with their recent contribution This usually happens on the platforms the developers could not test on The second part of this document describes how you can run FATE to submit your results to FFmpeg’s FATE server If you want to submit your results be sure to check that your combination of OS and compiler is not already listed on the above mentioned website In the third part you can find a comprehensive listing of FATE makefile targets and variables Using FATE from your FFmpeg source directory **********************************************If you want to run FATE on your machine you need to have the samples in place You can get the samples via the build target fate rsync Use this command from the top level source this will cause FATE to fail NOTE To use a custom wrapper to run the pass ‘ target exec’ to ‘configure’ or set the TARGET_EXEC Make variable Submitting the results to the FFmpeg result aggregation server ****************************************************************To submit your results to the server you should run fate through the shell script ‘tests fate sh’ from the FFmpeg sources This script needs to be invoked with a configuration file as its first argument tests fate sh path to fate_config A configuration file template with comments describing the individual configuration variables can be found at ‘doc fate_config sh template’ Create a configuration that suits your based on the configuration template The ‘slot’ configuration variable can be any string that is not yet but it is suggested that you name it adhering to the following pattern ‘ARCH OS COMPILER COMPILER VERSION’ The configuration file itself will be sourced in a shell therefore all shell features may be used This enables you to setup the environment as you need it for your build For your first test runs the ‘fate_recv’ variable should be empty or commented out This will run everything as normal except that it will omit the submission of the results to the server The following files should be present in $workdir as specified in the configuration it may help to try out the ‘ssh’ command with one or more ‘ v’ options You should get detailed output concerning your SSH configuration and the authentication process The only thing left is to automate the execution of the fate sh script and the synchronisation of the samples directory Uploading new samples to the fate suite *****************************************If you need a sample uploaded send a mail to samples request This is for developers who have an account on the fate suite server If you upload new please make sure they are as small as space on each network bandwidth and so on benefit from smaller test cases Also keep in mind older checkouts use existing sample that means in practice generally do not remove or overwrite files as it likely would break older checkouts or releases Also all needed samples for a commit should be ideally before the push If you need an account for frequently uploading samples or you wish to help others by doing that send a mail to ffmpeg devel rsync vauL Duo ug o o w
int h
agreed upon image height
static uint64_t lerp_color16(uint8_t c0[4], uint8_t c1[4], float x)
static int gradients_request_frame(AVFilterLink *outlink)
static const int factor[16]
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
int(* draw_slice)(AVFilterContext *ctx, void *arg, int job, int nb_jobs)
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
#define flags(name, subs,...)
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...
static float project(float origin_x, float origin_y, float dest_x, float dest_y, int point_x, int point_y)
static uint32_t lerp_color(uint8_t c0[4], uint8_t c1[4], float x)
static int draw_gradients_slice16(AVFilterContext *ctx, void *arg, int job, int nb_jobs)