|
FFmpeg
|
Filter to compute an HDR gain map from a base and alternate rendition. More...
#include <float.h>#include <math.h>#include "libavutil/csp.h"#include "libavutil/gain_map.h"#include "libavutil/internal.h"#include "libavutil/mastering_display_metadata.h"#include "libavutil/mem.h"#include "libavutil/opt.h"#include "libavutil/pixdesc.h"#include "avfilter.h"#include "colorspace.h"#include "filters.h"#include "formats.h"#include "framesync.h"#include "video.h"Go to the source code of this file.
Data Structures | |
| struct | GainMapEOTF |
| struct | GainMapContext |
| struct | ThreadData |
| Used for passing data between threads. More... | |
Macros | |
| #define | SDR_DIFFUSE_WHITE 203.0 |
| #define | GAINMAP_LUT_SIZE 1025 |
| #define | OFFSET(x) |
| #define | FLAGS AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_VIDEO_PARAM |
| #define | GAIN(a, b) |
Enumerations | |
| enum | GainMapColorspace { GAINMAP_CSP_BASE , GAINMAP_CSP_ALT , GAINMAP_CSP_NB } |
| enum | GainMapMode { GAINMAP_RGB , GAINMAP_LUMA , GAINMAP_MAXRGB , GAINMAP_MODE_NB } |
| enum | GainMapMeasure { MEASURE_MIN = 1 << 0 , MEASURE_MAX = 1 << 1 , MEASURE_GAMMA = 1 << 2 , MEASURE_RANGE = MEASURE_MIN | MEASURE_MAX , MEASURE_ALL = MEASURE_RANGE | MEASURE_GAMMA } |
Variables | |
| static const AVOption | gainmap_options [] |
| static const int | gbr_order [3] = { 2, 0, 1 } |
| static const AVFilterPad | gainmap_inputs [] |
| static const AVFilterPad | gainmap_outputs [] |
| const FFFilter | ff_vf_gainmap |
Filter to compute an HDR gain map from a base and alternate rendition.
Definition in file vf_gainmap.c.
| #define SDR_DIFFUSE_WHITE 203.0 |
Definition at line 42 of file vf_gainmap.c.
Referenced by frame_luminance(), get_pixel(), setup_colorspace(), and update_eotf().
| #define GAINMAP_LUT_SIZE 1025 |
Definition at line 70 of file vf_gainmap.c.
Referenced by get_pixel(), and update_eotf().
| #define OFFSET | ( | x | ) |
Definition at line 121 of file vf_gainmap.c.
| #define FLAGS AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_VIDEO_PARAM |
Definition at line 122 of file vf_gainmap.c.
Referenced by slice_internal().
| enum GainMapColorspace |
| Enumerator | |
|---|---|
| GAINMAP_CSP_BASE | apply the map in the base rendition's space |
| GAINMAP_CSP_ALT | apply it in the alternate rendition's space |
| GAINMAP_CSP_NB | |
Definition at line 44 of file vf_gainmap.c.
| enum GainMapMode |
| Enumerator | |
|---|---|
| GAINMAP_RGB | one channel per component |
| GAINMAP_LUMA | single channel, from the luminance |
| GAINMAP_MAXRGB | single channel, from max(R,G,B) |
| GAINMAP_MODE_NB | |
Definition at line 50 of file vf_gainmap.c.
| enum GainMapMeasure |
| Enumerator | |
|---|---|
| MEASURE_MIN | |
| MEASURE_MAX | |
| MEASURE_GAMMA | |
| MEASURE_RANGE | |
| MEASURE_ALL | |
Definition at line 57 of file vf_gainmap.c.
| FRAMESYNC_DEFINE_CLASS | ( | gainmap | , |
| GainMapContext | , | ||
| fs | ) |
|
static |
Definition at line 145 of file vf_gainmap.c.
Referenced by choose_quant_params(), and setup_colorspace().
|
static |
Definition at line 161 of file vf_gainmap.c.
Referenced by choose_quant_params(), init(), and setup_colorspace().
|
static |
Definition at line 180 of file vf_gainmap.c.
Referenced by choose_quant_params(), init(), and setup_colorspace().
|
static |
Definition at line 189 of file vf_gainmap.c.
|
static |
Definition at line 231 of file vf_gainmap.c.
Definition at line 250 of file vf_gainmap.c.
Referenced by setup_colorspace().
|
static |
Definition at line 268 of file vf_gainmap.c.
Referenced by setup_colorspace().
|
static |
Definition at line 309 of file vf_gainmap.c.
Referenced by setup_colorspace().
|
static |
Definition at line 315 of file vf_gainmap.c.
Referenced by process_frame().
|
static |
Definition at line 392 of file vf_gainmap.c.
Referenced by slice_internal(), and slice_quant().
|
static |
Definition at line 399 of file vf_gainmap.c.
Referenced by slice_internal().
|
static |
Definition at line 439 of file vf_gainmap.c.
Referenced by slice_gain(), and slice_gain_quant().
|
static |
Definition at line 529 of file vf_gainmap.c.
Referenced by process_frame().
|
static |
Definition at line 534 of file vf_gainmap.c.
Referenced by process_frame().
|
static |
Definition at line 539 of file vf_gainmap.c.
Referenced by process_frame().
|
static |
Choose gamma such that mean_quant ^ gamma = 0.5; clamp to a sane value range of [1/8, 8] to prevent degenerate encodings. A gamma of >8 would collapse half the encoding space into a single 8-bit value, at which point we're losing more then gaining, and a value of <1/8 limits the amount by which a single high outlier pixel can determine the overall encoding gamma.
We also clamp the mean to [0.01, 0.99] to prevent numerical explosion in the case that the mean is very close to 0 or 1. This is a looser bound than the final gamma clamp, so the exact values chosen do not matter as much.
Definition at line 570 of file vf_gainmap.c.
Referenced by process_frame().
|
static |
Definition at line 619 of file vf_gainmap.c.
|
static |
Definition at line 692 of file vf_gainmap.c.
|
static |
Definition at line 727 of file vf_gainmap.c.
|
static |
Definition at line 733 of file vf_gainmap.c.
|
static |
Definition at line 124 of file vf_gainmap.c.
|
static |
Definition at line 436 of file vf_gainmap.c.
|
static |
Definition at line 742 of file vf_gainmap.c.
|
static |
Definition at line 753 of file vf_gainmap.c.
| const FFFilter ff_vf_gainmap |
Definition at line 761 of file vf_gainmap.c.