Go to the documentation of this file.
60 #define OFFSET(x) offsetof(CellAutoContext, x)
61 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
75 {
"random_seed",
"set the seed for filling the initial grid randomly",
OFFSET(random_seed),
AV_OPT_TYPE_INT64, {.i64 = -1}, -1, UINT32_MAX,
FLAGS },
76 {
"seed",
"set the seed for filling the initial grid randomly",
OFFSET(random_seed),
AV_OPT_TYPE_INT64, {.i64 = -1}, -1, UINT32_MAX,
FLAGS },
96 for (
i = 0;
i <
s->w;
i++)
97 line[
i] = row[
i] ?
'@' :
' ';
110 w = strlen(
s->pattern);
116 "The specified width is %d which cannot contain the provided string width of %d\n",
132 for (
i = (
s->w -
w)/2;;
i++) {
134 if (*p ==
'\n' || !*p)
149 &
s->file_buf, &
s->file_bufsize, 0,
ctx);
157 memcpy(
s->pattern,
s->file_buf,
s->file_bufsize);
158 s->pattern[
s->file_bufsize] = 0;
168 if (!
s->w && !
s->filename && !
s->pattern)
171 if (
s->filename &&
s->pattern) {
179 }
else if (
s->pattern) {
189 if (
s->random_seed == -1)
194 for (
i = 0;
i <
s->w;
i++) {
196 if (r <= s->random_fill_ratio)
202 "s:%dx%d r:%d/%d rule:%d stitch:%d scroll:%d full:%d seed:%"PRId64
"\n",
203 s->w,
s->h,
s->frame_rate.num,
s->frame_rate.den,
204 s->rule,
s->stitch,
s->scroll,
s->start_full,
233 uint8_t *row, *prev_row =
s->buf +
s->buf_row_idx *
s->w;
236 s->buf_prev_row_idx =
s->buf_row_idx;
237 s->buf_row_idx =
s->buf_row_idx ==
s->h-1 ? 0 :
s->buf_row_idx+1;
238 row =
s->buf +
s->w *
s->buf_row_idx;
240 for (
i = 0;
i <
s->w;
i++) {
242 pos[NW] =
i-1 < 0 ?
s->w-1 :
i-1;
244 pos[NE] =
i+1 ==
s->w ? 0 :
i+1;
245 v = prev_row[
pos[NW]]<<2 | prev_row[
pos[
N]]<<1 | prev_row[
pos[NE]];
248 v|=
i-1 >= 0 ? prev_row[
i-1]<<2 : 0;
249 v|= prev_row[
i ]<<1 ;
250 v|=
i+1 <
s->w ? prev_row[
i+1] : 0;
252 row[
i] = !!(
s->rule & (1<<v));
253 ff_dlog(
ctx,
"i:%d context:%c%c%c -> cell:%d\n",
i,
254 v&4?
'@':
' ', v&2?
'@':
' ', v&1?
'@':
' ', row[
i]);
263 int i, j, k, row_idx = 0;
266 if (
s->scroll &&
s->generation >=
s->h)
268 row_idx = (
s->buf_row_idx + 1) %
s->h;
275 for (k = 0, j = 0; j <
s->w; j++) {
276 byte |= row[j]<<(7-k++);
277 if (k==8 || j ==
s->w-1) {
283 row_idx = (row_idx + 1) %
s->h;
295 if (
s->generation == 0 &&
s->start_full) {
297 for (
i = 0;
i <
s->h-1;
i++)
303 picref->
pts =
s->pts++;
306 show_cellauto_row(outlink->
src);
332 .description =
NULL_IF_CONFIG_SMALL(
"Create pattern generated by an elementary cellular automaton."),
334 .priv_class = &cellauto_class,
AVFrame * ff_get_video_buffer(AVFilterLink *link, int w, int h)
Request a picture buffer with a specific set of permissions.
int64_t generation
the generation number, starting from 0
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
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.
@ AV_OPT_TYPE_VIDEO_RATE
offset must point to AVRational
This structure describes decoded (raw) audio or video data.
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
void * av_mallocz_array(size_t nmemb, size_t size)
Allocate a memory block for an array with av_mallocz().
#define AV_LOG_VERBOSE
Detailed information.
const char * name
Filter name.
static int init_pattern_from_file(AVFilterContext *ctx)
A link between two filters.
static av_cold int init(AVFilterContext *ctx)
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
uint32_t av_get_random_seed(void)
Get a seed to use in conjunction with random functions.
int av_file_map(const char *filename, uint8_t **bufptr, size_t *size, int log_offset, void *log_ctx)
Read the file with name filename, and put its content in a newly allocated buffer or map it with mmap...
void * priv
private data for use by the filter
int av_opt_set(void *obj, const char *name, const char *val, int search_flags)
A filter pad used for either input or output.
static int config_props(AVFilterLink *outlink)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static int request_frame(AVFilterLink *outlink)
AVFilter ff_vsrc_cellauto
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[]
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
void av_file_unmap(uint8_t *bufptr, size_t size)
Unmap or free the buffer bufptr created by av_file_map().
Describe the class of an AVClass context structure.
Rational number (pair of numerator and denominator).
@ AV_PIX_FMT_MONOBLACK
Y , 1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb.
@ AV_OPT_TYPE_IMAGE_SIZE
offset must point to two consecutive integers
static void evolve(AVFilterContext *ctx)
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
static const AVFilterPad cellauto_outputs[]
Context structure for the Lagged Fibonacci PRNG.
AVFILTER_DEFINE_CLASS(cellauto)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
AVFilterContext * src
source filter
static av_const int av_isgraph(int c)
Locale-independent conversion of ASCII isgraph.
static void fill_picture(AVFilterContext *ctx, AVFrame *picref)
static int query_formats(AVFilterContext *ctx)
#define i(width, name, range_min, range_max)
int w
agreed upon image width
static av_always_inline AVRational av_inv_q(AVRational q)
Invert a rational.
const char * name
Pad name.
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
AVRational sample_aspect_ratio
Sample aspect ratio for the video frame, 0/1 if unknown/unspecified.
static av_cold void uninit(AVFilterContext *ctx)
int h
agreed upon image height
static int init_pattern_from_string(AVFilterContext *ctx)
AVRational time_base
Define the time base used by the PTS of the frames/samples which will pass through this link.
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
static const AVOption cellauto_options[]