Go to the documentation of this file.
47 #define LCG(x) (((x) * LCG_A + LCG_C) % LCG_M)
48 #define LCG_SEED 739187
69 #define OFFSET(x) offsetof(HisteqContext, x)
70 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
71 #define CONST(name, help, val, unit) { name, help, 0, AV_OPT_TYPE_CONST, {.i64=val}, INT_MIN, INT_MAX, FLAGS, unit }
90 "strength:%0.3f intensity:%0.3f antibanding:%d\n",
126 #define GET_RGB_VALUES(r, g, b, src, map) do { \
127 r = src[x + map[R]]; \
128 g = src[x + map[G]]; \
129 b = src[x + map[B]]; \
137 int strength = histeq->
strength * 1000;
138 int intensity = histeq->
intensity * 1000;
139 int x, y,
i, luthi, lutlo, lut, luma, oluma, m;
141 unsigned int r,
g,
b, jran;
158 dst = outpic->
data[0];
159 for (y = 0; y <
inlink->h; y++) {
162 luma = (55 *
r + 182 *
g + 19 *
b) >> 8;
171 for (
x = 0;
x < 256;
x++)
178 for (
x = 1;
x < 256;
x++)
187 for (
x = 0;
x < 256;
x++)
188 histeq->
LUT[
x] = (strength * histeq->
LUT[
x]) / 255 +
189 ((255 - strength) *
x) / 255;
195 dst = outpic->
data[0];
196 for (y = 0; y <
inlink->h; y++) {
200 for (
i = 0;
i < histeq->
bpp; ++
i)
204 lut = histeq->
LUT[luma];
208 (histeq->
LUT[luma] + histeq->
LUT[luma - 1]) / 2 :
209 histeq->
LUT[luma - 1];
215 (histeq->
LUT[luma] + histeq->
LUT[luma + 1]) / 2 :
216 histeq->
LUT[luma + 1];
220 if (lutlo != luthi) {
222 lut = lutlo + ((luthi - lutlo + 1) * jran) /
LCG_M;
227 if (((m =
FFMAX3(
r,
g,
b)) * lut) / luma > 255) {
232 r = (
r * lut) / luma;
233 g = (
g * lut) / luma;
234 b = (
b * lut) / luma;
239 oluma = av_clip_uint8((55 *
r + 182 *
g + 19 *
b) >> 8);
247 for (
x = 0;
x < 256;
x++)
281 .priv_class = &histeq_class,
@ HISTEQ_ANTIBANDING_WEAK
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 const AVOption histeq_options[]
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)
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
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
This structure describes decoded (raw) audio or video data.
#define AV_LOG_VERBOSE
Detailed information.
@ AV_PIX_FMT_BGR24
packed RGB 8:8:8, 24bpp, BGRBGR...
@ AV_PIX_FMT_BGRA
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
int av_get_bits_per_pixel(const AVPixFmtDescriptor *pixdesc)
Return the number of bits per pixel used by the pixel format described by pixdesc.
const char * name
Filter name.
A link between two filters.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
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
A filter pad used for either input or output.
static const AVFilterPad histeq_outputs[]
#define GET_RGB_VALUES(r, g, b, src, map)
static const AVFilterPad outputs[]
static enum AVPixelFormat pix_fmts[]
@ AV_PIX_FMT_RGBA
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
Describe the class of an AVClass context structure.
int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
Copy only "metadata" fields from src to dst.
static av_cold int init(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
@ AV_PIX_FMT_ABGR
packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
@ HISTEQ_ANTIBANDING_NONE
#define CONST(name, help, val, unit)
@ AV_PIX_FMT_RGB24
packed RGB 8:8:8, 24bpp, RGBRGB...
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
int in_histogram[256]
input histogram
uint8_t rgba_map[4]
components position
static const AVFilterPad histeq_inputs[]
static int query_formats(AVFilterContext *ctx)
int antibanding
HisteqAntibanding.
#define AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
Some filters support a generic "enable" expression option that can be used to enable or disable a fil...
@ AV_PIX_FMT_ARGB
packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
#define i(width, name, range_min, range_max)
int w
agreed upon image width
static int config_input(AVFilterLink *inlink)
int out_histogram[256]
output histogram
const char * name
Pad name.
int LUT[256]
lookup table derived from histogram[]
int h
agreed upon image height
AVFILTER_DEFINE_CLASS(histeq)
static int filter_frame(AVFilterLink *inlink, AVFrame *inpic)
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
int ff_fill_rgba_map(uint8_t *rgba_map, enum AVPixelFormat pix_fmt)
@ HISTEQ_ANTIBANDING_STRONG
#define flags(name, subs,...)
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.