FFmpeg  4.3
vf_eq.h
Go to the documentation of this file.
1 /*
2  * Original MPlayer filters by Richard Felker, Hampa Hug, Daniel Moreno,
3  * and Michael Niedermeyer.
4  *
5  * Copyright (c) 2014 James Darnley <james.darnley@gmail.com>
6  * Copyright (c) 2015 Arwa Arif <arwaarif1994@gmail.com>
7  *
8  * This file is part of FFmpeg.
9  *
10  * FFmpeg is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * FFmpeg is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License along
21  * with FFmpeg; if not, write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23  */
24 
25 #ifndef AVFILTER_EQ_H
26 #define AVFILTER_EQ_H
27 
28 #include "avfilter.h"
29 #include "libavutil/eval.h"
30 
31 static const char *const var_names[] = {
32  "n", // frame count
33  "pos", // frame position
34  "r", // frame rate
35  "t", // timestamp expressed in seconds
36  NULL
37 };
38 
39 enum var_name {
45 };
46 
47 typedef struct EQParameters {
48  void (*adjust)(struct EQParameters *eq, uint8_t *dst, int dst_stride,
49  const uint8_t *src, int src_stride, int w, int h);
50 
51  uint8_t lut[256];
52 
54  int lut_clean;
55 
56 } EQParameters;
57 
58 typedef struct EQContext {
59  const AVClass *class;
60 
62 
65  double contrast;
66 
69  double brightness;
70 
73  double saturation;
74 
75  char *gamma_expr;
77  double gamma;
78 
81  double gamma_weight;
82 
83  char *gamma_r_expr;
85  double gamma_r;
86 
87  char *gamma_g_expr;
89  double gamma_g;
90 
91  char *gamma_b_expr;
93  double gamma_b;
94 
95  double var_values[VAR_NB];
96 
97  void (*process)(struct EQParameters *par, uint8_t *dst, int dst_stride,
98  const uint8_t *src, int src_stride, int w, int h);
99 
101 } EQContext;
102 
103 void ff_eq_init(EQContext *eq);
105 
106 #endif /* AVFILTER_EQ_H */
EQParameters::gamma_weight
double gamma_weight
Definition: vf_eq.h:53
EQContext::gamma_expr
char * gamma_expr
Definition: vf_eq.h:75
EQParameters::gamma
double gamma
Definition: vf_eq.h:53
EQContext::gamma_pexpr
AVExpr * gamma_pexpr
Definition: vf_eq.h:76
EQContext::EvalMode
EvalMode
Definition: vf_eq.h:100
VAR_POS
@ VAR_POS
Definition: vf_eq.h:41
EQContext::gamma_weight
double gamma_weight
Definition: vf_eq.h:81
EQContext::param
EQParameters param[3]
Definition: vf_eq.h:61
EQContext::brightness_expr
char * brightness_expr
Definition: vf_eq.h:67
eq
#define eq(A, B)
Definition: vf_xbr.c:91
VAR_NB
@ VAR_NB
Definition: vf_eq.h:44
VAR_R
@ VAR_R
Definition: vf_eq.h:42
EQContext::saturation_pexpr
AVExpr * saturation_pexpr
Definition: vf_eq.h:72
EQParameters
Definition: vf_eq.h:47
AVExpr
Definition: eval.c:157
EQContext::gamma_g_expr
char * gamma_g_expr
Definition: vf_eq.h:87
AVClass
Describe the class of an AVClass context structure.
Definition: log.h:67
EQContext::brightness
double brightness
Definition: vf_eq.h:69
EQContext::saturation
double saturation
Definition: vf_eq.h:73
NULL
#define NULL
Definition: coverity.c:32
ff_eq_init_x86
void ff_eq_init_x86(EQContext *eq)
Definition: vf_eq_init.c:65
EQContext::gamma_weight_expr
char * gamma_weight_expr
Definition: vf_eq.h:79
src
#define src
Definition: vp8dsp.c:254
EQContext::gamma_weight_pexpr
AVExpr * gamma_weight_pexpr
Definition: vf_eq.h:80
EQContext::eval_mode
enum EQContext::EvalMode eval_mode
var_names
static const char *const var_names[]
Definition: vf_eq.h:31
VAR_N
@ VAR_N
Definition: vf_eq.h:40
EQContext::gamma_r
double gamma_r
Definition: vf_eq.h:85
eval.h
var_name
var_name
Definition: aeval.c:46
EQContext
Definition: vf_eq.h:58
EQParameters::contrast
double contrast
Definition: vf_eq.h:53
EQContext::saturation_expr
char * saturation_expr
Definition: vf_eq.h:71
EQContext::contrast
double contrast
Definition: vf_eq.h:65
EQContext::gamma_b_expr
char * gamma_b_expr
Definition: vf_eq.h:91
EQContext::contrast_pexpr
AVExpr * contrast_pexpr
Definition: vf_eq.h:64
VAR_T
@ VAR_T
Definition: vf_eq.h:43
EQParameters::adjust
void(* adjust)(struct EQParameters *eq, uint8_t *dst, int dst_stride, const uint8_t *src, int src_stride, int w, int h)
Definition: vf_eq.h:48
uint8_t
uint8_t
Definition: audio_convert.c:194
EQContext::EVAL_MODE_NB
@ EVAL_MODE_NB
Definition: vf_eq.h:100
ff_eq_init
void ff_eq_init(EQContext *eq)
Definition: vf_eq.c:177
EQContext::gamma_b
double gamma_b
Definition: vf_eq.h:93
EQParameters::brightness
double brightness
Definition: vf_eq.h:53
w
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
Definition: fate.txt:150
EQParameters::lut
uint8_t lut[256]
Definition: vf_eq.h:51
void
typedef void(RENAME(mix_any_func_type))
Definition: rematrix_template.c:52
avfilter.h
EQContext::var_values
double var_values[VAR_NB]
Definition: vf_eq.h:95
EQContext::contrast_expr
char * contrast_expr
Definition: vf_eq.h:63
EQContext::brightness_pexpr
AVExpr * brightness_pexpr
Definition: vf_eq.h:68
EQContext::gamma_g
double gamma_g
Definition: vf_eq.h:89
EQContext::EVAL_MODE_FRAME
@ EVAL_MODE_FRAME
Definition: vf_eq.h:100
EQParameters::lut_clean
int lut_clean
Definition: vf_eq.h:54
EQContext::EVAL_MODE_INIT
@ EVAL_MODE_INIT
Definition: vf_eq.h:100
EQContext::gamma_g_pexpr
AVExpr * gamma_g_pexpr
Definition: vf_eq.h:88
EQContext::gamma_r_expr
char * gamma_r_expr
Definition: vf_eq.h:83
EQContext::gamma
double gamma
Definition: vf_eq.h:77
EQContext::gamma_b_pexpr
AVExpr * gamma_b_pexpr
Definition: vf_eq.h:92
EQContext::process
void(* process)(struct EQParameters *par, uint8_t *dst, int dst_stride, const uint8_t *src, int src_stride, int w, int h)
Definition: vf_eq.h:97
h
h
Definition: vp9dsp_template.c:2038
EQContext::gamma_r_pexpr
AVExpr * gamma_r_pexpr
Definition: vf_eq.h:84