summaryrefslogtreecommitdiff
path: root/libavfilter/vf_normalize.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2019-10-07 12:17:14 +0200
committerPaul B Mahol <onemda@gmail.com>2019-10-07 12:17:14 +0200
commitc303d0979fb050008974182784b633e8184f0be7 (patch)
treeb5c38398edd69093b3db175351df5780e9776e9a /libavfilter/vf_normalize.c
parent651a0f63080f4073c324594188841a15da13e9ce (diff)
avfilter/vf_normalize: typedef all structs
Diffstat (limited to 'libavfilter/vf_normalize.c')
-rw-r--r--libavfilter/vf_normalize.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/libavfilter/vf_normalize.c b/libavfilter/vf_normalize.c
index 48eea59e64..c955aeb7d2 100644
--- a/libavfilter/vf_normalize.c
+++ b/libavfilter/vf_normalize.c
@@ -81,6 +81,17 @@
#include "internal.h"
#include "video.h"
+typedef struct NormalizeHistory {
+ uint8_t *history; // History entries.
+ uint32_t history_sum; // Sum of history entries.
+} NormalizeHistory;
+
+typedef struct NormalizeLocal {
+ uint8_t in; // Original input byte value for this frame.
+ float smoothed; // Smoothed input value [0,255].
+ float out; // Output value [0,255]
+} NormalizeLocal;
+
typedef struct NormalizeContext {
const AVClass *class;
@@ -98,10 +109,7 @@ typedef struct NormalizeContext {
int frame_num; // Increments on each frame, starting from 0.
// Per-extremum, per-channel history, for temporal smoothing.
- struct {
- uint8_t *history; // History entries.
- uint32_t history_sum; // Sum of history entries.
- } min[3], max[3]; // Min and max for each channel in {R,G,B}.
+ NormalizeHistory min[3], max[3]; // Min and max for each channel in {R,G,B}.
uint8_t *history_mem; // Single allocation for above history entries
} NormalizeContext;
@@ -126,11 +134,7 @@ AVFILTER_DEFINE_CLASS(normalize);
static void normalize(NormalizeContext *s, AVFrame *in, AVFrame *out)
{
// Per-extremum, per-channel local variables.
- struct {
- uint8_t in; // Original input byte value for this frame.
- float smoothed; // Smoothed input value [0,255].
- float out; // Output value [0,255].
- } min[3], max[3]; // Min and max for each channel in {R,G,B}.
+ NormalizeLocal min[3], max[3]; // Min and max for each channel in {R,G,B}.
float rgb_min_smoothed; // Min input range for linked normalization
float rgb_max_smoothed; // Max input range for linked normalization