FFmpeg  4.3
Data Structures | Macros | Enumerations | Functions | Variables
vf_histeq.c File Reference
#include "libavutil/common.h"
#include "libavutil/internal.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "avfilter.h"
#include "drawutils.h"
#include "formats.h"
#include "internal.h"
#include "video.h"

Go to the source code of this file.

Data Structures

struct  HisteqContext
 

Macros

#define LCG_A   4096
 
#define LCG_C   150889
 
#define LCG_M   714025
 
#define LCG(x)   (((x) * LCG_A + LCG_C) % LCG_M)
 
#define LCG_SEED   739187
 
#define OFFSET(x)   offsetof(HisteqContext, x)
 
#define FLAGS   AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 
#define CONST(name, help, val, unit)   { name, help, 0, AV_OPT_TYPE_CONST, {.i64=val}, INT_MIN, INT_MAX, FLAGS, unit }
 
#define R   0
 
#define G   1
 
#define B   2
 
#define A   3
 
#define GET_RGB_VALUES(r, g, b, src, map)
 

Enumerations

enum  HisteqAntibanding { HISTEQ_ANTIBANDING_NONE = 0, HISTEQ_ANTIBANDING_WEAK = 1, HISTEQ_ANTIBANDING_STRONG = 2, HISTEQ_ANTIBANDING_NB }
 

Functions

 AVFILTER_DEFINE_CLASS (histeq)
 
static av_cold int init (AVFilterContext *ctx)
 
static int query_formats (AVFilterContext *ctx)
 
static int config_input (AVFilterLink *inlink)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *inpic)
 

Variables

static const AVOption histeq_options []
 
static const AVFilterPad histeq_inputs []
 
static const AVFilterPad histeq_outputs []
 
AVFilter ff_vf_histeq
 

Detailed Description

Histogram equalization filter, based on the VirtualDub filter by Donald A. Graft <neuron2 AT home DOT com>. Implements global automatic contrast adjustment by means of histogram equalization.

Definition in file vf_histeq.c.

Macro Definition Documentation

◆ LCG_A

#define LCG_A   4096

Definition at line 44 of file vf_histeq.c.

◆ LCG_C

#define LCG_C   150889

Definition at line 45 of file vf_histeq.c.

◆ LCG_M

#define LCG_M   714025

Definition at line 46 of file vf_histeq.c.

◆ LCG

#define LCG (   x)    (((x) * LCG_A + LCG_C) % LCG_M)

Definition at line 47 of file vf_histeq.c.

◆ LCG_SEED

#define LCG_SEED   739187

Definition at line 48 of file vf_histeq.c.

◆ OFFSET

#define OFFSET (   x)    offsetof(HisteqContext, x)

Definition at line 69 of file vf_histeq.c.

◆ FLAGS

Definition at line 70 of file vf_histeq.c.

◆ CONST

#define CONST (   name,
  help,
  val,
  unit 
)    { name, help, 0, AV_OPT_TYPE_CONST, {.i64=val}, INT_MIN, INT_MAX, FLAGS, unit }

Definition at line 71 of file vf_histeq.c.

◆ R

#define R   0

Definition at line 121 of file vf_histeq.c.

◆ G

#define G   1

Definition at line 122 of file vf_histeq.c.

◆ B

#define B   2

Definition at line 123 of file vf_histeq.c.

◆ A

#define A   3

Definition at line 124 of file vf_histeq.c.

◆ GET_RGB_VALUES

#define GET_RGB_VALUES (   r,
  g,
  b,
  src,
  map 
)
Value:
do { \
r = src[x + map[R]]; \
g = src[x + map[G]]; \
b = src[x + map[B]]; \
} while (0)

Definition at line 126 of file vf_histeq.c.

Enumeration Type Documentation

◆ HisteqAntibanding

Enumerator
HISTEQ_ANTIBANDING_NONE 
HISTEQ_ANTIBANDING_WEAK 
HISTEQ_ANTIBANDING_STRONG 
HISTEQ_ANTIBANDING_NB 

Definition at line 50 of file vf_histeq.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( histeq  )

◆ init()

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 85 of file vf_histeq.c.

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 96 of file vf_histeq.c.

◆ config_input()

static int config_input ( AVFilterLink inlink)
static

Definition at line 109 of file vf_histeq.c.

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame inpic 
)
static

Definition at line 132 of file vf_histeq.c.

Variable Documentation

◆ histeq_options

const AVOption histeq_options[]
static
Initial value:
= {
{ "strength", "set the strength", OFFSET(strength), AV_OPT_TYPE_FLOAT, {.dbl=0.2}, 0, 1, FLAGS },
{ "intensity", "set the intensity", OFFSET(intensity), AV_OPT_TYPE_FLOAT, {.dbl=0.21}, 0, 1, FLAGS },
{ "antibanding", "set the antibanding level", OFFSET(antibanding), AV_OPT_TYPE_INT, {.i64=HISTEQ_ANTIBANDING_NONE}, 0, HISTEQ_ANTIBANDING_NB-1, FLAGS, "antibanding" },
CONST("none", "apply no antibanding", HISTEQ_ANTIBANDING_NONE, "antibanding"),
CONST("weak", "apply weak antibanding", HISTEQ_ANTIBANDING_WEAK, "antibanding"),
CONST("strong", "apply strong antibanding", HISTEQ_ANTIBANDING_STRONG, "antibanding"),
{ NULL }
}

Definition at line 73 of file vf_histeq.c.

◆ histeq_inputs

const AVFilterPad histeq_inputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_input,
.filter_frame = filter_frame,
},
{ NULL }
}

Definition at line 255 of file vf_histeq.c.

◆ histeq_outputs

const AVFilterPad histeq_outputs[]
static
Initial value:
= {
{
.name = "default",
},
{ NULL }
}

Definition at line 265 of file vf_histeq.c.

◆ ff_vf_histeq

AVFilter ff_vf_histeq
Initial value:
= {
.name = "histeq",
.description = NULL_IF_CONFIG_SMALL("Apply global color histogram equalization."),
.priv_size = sizeof(HisteqContext),
.init = init,
.priv_class = &histeq_class,
}

Definition at line 273 of file vf_histeq.c.

HISTEQ_ANTIBANDING_WEAK
@ HISTEQ_ANTIBANDING_WEAK
Definition: vf_histeq.c:52
B
#define B
Definition: vf_histeq.c:123
x
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
Definition: fate.txt:150
histeq_outputs
static const AVFilterPad histeq_outputs[]
Definition: vf_histeq.c:265
outputs
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
NULL
#define NULL
Definition: coverity.c:32
init
static av_cold int init(AVFilterContext *ctx)
Definition: vf_histeq.c:85
src
#define src
Definition: vp8dsp.c:254
inputs
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
Definition: filter_design.txt:243
HISTEQ_ANTIBANDING_NONE
@ HISTEQ_ANTIBANDING_NONE
Definition: vf_histeq.c:51
CONST
#define CONST(name, help, val, unit)
Definition: vf_histeq.c:71
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:186
histeq_inputs
static const AVFilterPad histeq_inputs[]
Definition: vf_histeq.c:255
query_formats
static int query_formats(AVFilterContext *ctx)
Definition: vf_histeq.c:96
HisteqContext
Definition: vf_histeq.c:57
AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
#define AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
Some filters support a generic "enable" expression option that can be used to enable or disable a fil...
Definition: avfilter.h:125
AV_OPT_TYPE_FLOAT
@ AV_OPT_TYPE_FLOAT
Definition: opt.h:226
R
#define R
Definition: vf_histeq.c:121
config_input
static int config_input(AVFilterLink *inlink)
Definition: vf_histeq.c:109
OFFSET
#define OFFSET(x)
Definition: vf_histeq.c:69
G
#define G
Definition: vf_histeq.c:122
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:223
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *inpic)
Definition: vf_histeq.c:132
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
FLAGS
#define FLAGS
Definition: vf_histeq.c:70
map
const VDPAUPixFmtMap * map
Definition: hwcontext_vdpau.c:85
HISTEQ_ANTIBANDING_STRONG
@ HISTEQ_ANTIBANDING_STRONG
Definition: vf_histeq.c:53
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:564
HISTEQ_ANTIBANDING_NB
@ HISTEQ_ANTIBANDING_NB
Definition: vf_histeq.c:54