Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-05-03 08:35:49 +0300
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-05-06 06:19:49 +0300
commit8cd57648d113827da046a5361c2497a3e4413acb (patch)
tree5b9fd4c730084ce02f9ffadf2891dbe87e60a2ad /libavfilter
parent364fab1fdcf9fe9490302352b755713679143e7c (diff)
avfilter/vf_eq: Move ff_nlmeans_init into a header
This removes a dependency of checkasm on lavfi/vf_eq.o and also allows to inline ff_eq_init() irrespectively of interposing. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavfilter')
-rw-r--r--libavfilter/vf_eq.c27
-rw-r--r--libavfilter/vf_eq.h26
2 files changed, 25 insertions, 28 deletions
diff --git a/libavfilter/vf_eq.c b/libavfilter/vf_eq.c
index 80ab21efb3..46636dd29d 100644
--- a/libavfilter/vf_eq.c
+++ b/libavfilter/vf_eq.c
@@ -74,26 +74,6 @@ static void apply_lut(EQParameters *param, uint8_t *dst, int dst_stride,
}
}
-static void process_c(EQParameters *param, uint8_t *dst, int dst_stride,
- const uint8_t *src, int src_stride, int w, int h)
-{
- int x, y, pel;
-
- int contrast = (int) (param->contrast * 256 * 16);
- int brightness = ((int) (100.0 * param->brightness + 100.0) * 511) / 200 - 128 - contrast / 32;
-
- for (y = 0; y < h; y++) {
- for (x = 0; x < w; x++) {
- pel = ((src[y * src_stride + x] * contrast) >> 12) + brightness;
-
- if (pel & ~255)
- pel = (-pel) >> 31;
-
- dst[y * dst_stride + x] = pel;
- }
- }
-}
-
static void check_values(EQParameters *param, EQContext *eq)
{
if (param->contrast == 1.0 && param->brightness == 0.0 && param->gamma == 1.0)
@@ -174,13 +154,6 @@ static int set_expr(AVExpr **pexpr, const char *expr, const char *option, void *
return 0;
}
-void ff_eq_init(EQContext *eq)
-{
- eq->process = process_c;
- if (ARCH_X86)
- ff_eq_init_x86(eq);
-}
-
static int initialize(AVFilterContext *ctx)
{
EQContext *eq = ctx->priv;
diff --git a/libavfilter/vf_eq.h b/libavfilter/vf_eq.h
index cd0cd75f08..a5756977d2 100644
--- a/libavfilter/vf_eq.h
+++ b/libavfilter/vf_eq.h
@@ -100,7 +100,31 @@ typedef struct EQContext {
enum EvalMode { EVAL_MODE_INIT, EVAL_MODE_FRAME, EVAL_MODE_NB } eval_mode;
} EQContext;
-void ff_eq_init(EQContext *eq);
+static void process_c(EQParameters *param, uint8_t *dst, int dst_stride,
+ const uint8_t *src, int src_stride, int w, int h)
+{
+ int contrast = (int) (param->contrast * 256 * 16);
+ int brightness = ((int) (100.0 * param->brightness + 100.0) * 511) / 200 - 128 - contrast / 32;
+
+ for (int y = 0; y < h; y++) {
+ for (int x = 0; x < w; x++) {
+ int pel = ((src[y * src_stride + x] * contrast) >> 12) + brightness;
+
+ if (pel & ~255)
+ pel = (-pel) >> 31;
+
+ dst[y * dst_stride + x] = pel;
+ }
+ }
+}
+
void ff_eq_init_x86(EQContext *eq);
+static av_unused void ff_eq_init(EQContext *eq)
+{
+ eq->process = process_c;
+ if (ARCH_X86)
+ ff_eq_init_x86(eq);
+}
+
#endif /* AVFILTER_EQ_H */