|
FFmpeg
|
Go to the source code of this file.
Macros | |
| #define | CHECK(cond) |
| #define | CHECK_SIGNED(q) |
| #define | CHECK_UNSIGNED(q) |
| #define | ISO21496_HEADER_SIZE 5 |
| #define | ISO21496_FLAG_MULTICHANNEL (1 << 7) |
| #define | ISO21496_FLAG_USE_BASE_CG (1 << 6) |
| #define | ISO21496_FLAG_RESERVED 0x3f |
Functions | |
| static void | gain_map_params_default (AVGainMapParams *p) |
| int | av_gain_map_params_validate (const AVGainMapParams *p) |
| Returns >= 0 if the given AVGainMapParams struct contains valid data; or a negative AVERROR otherwise. | |
| static size_t | iso21496_payload_size (int nb_channels) |
| static int | make_q (int64_t num, uint32_t den, AVRational *out) |
| static int | get_sq (GetByteContext *gb, AVRational *out) |
| static int | get_uq (GetByteContext *gb, AVRational *out) |
| int | av_gain_map_params_from_iso21496 (AVGainMapParams *restrict p, const uint8_t *data, size_t size) |
| static void | put_q (PutByteContext *pb, AVRational q) |
| int | av_gain_map_params_to_iso21496 (const AVGainMapParams *p, uint8_t *buf) |
| Serialize an AVGainMapParams as an ISO 21496-1 gain map metadata blob. | |
| int | av_gain_map_channels_identical (const AVGainMapParams *p) |
| Returns 1 if all channels of the gain map have identical parameters, 0 otherwise. | |
| AVGainMapParams * | av_gain_map_params_alloc (size_t *size) |
| Allocate an AVGainMapParams structure and initialize it to default values. | |
| AVGainMapParams * | av_gain_map_params_create_side_data (AVFrameSideData ***fsd, int *nb_sd) |
| Allocate and add an AVGainMapParams structure to an existing AVFrameSideData array as AV_FRAME_DATA_GAIN_MAP_PARAMS side data. | |
| #define CHECK | ( | cond | ) |
Definition at line 43 of file gain_map.c.
Referenced by av_gain_map_params_validate().
| #define CHECK_SIGNED | ( | q | ) |
Definition at line 44 of file gain_map.c.
Referenced by av_gain_map_params_validate().
| #define CHECK_UNSIGNED | ( | q | ) |
| #define ISO21496_HEADER_SIZE 5 |
Definition at line 76 of file gain_map.c.
| #define ISO21496_FLAG_MULTICHANNEL (1 << 7) |
Definition at line 78 of file gain_map.c.
Referenced by av_gain_map_params_from_iso21496(), and av_gain_map_params_to_iso21496().
| #define ISO21496_FLAG_USE_BASE_CG (1 << 6) |
Definition at line 79 of file gain_map.c.
Referenced by av_gain_map_params_from_iso21496(), and av_gain_map_params_to_iso21496().
| #define ISO21496_FLAG_RESERVED 0x3f |
Definition at line 80 of file gain_map.c.
Referenced by av_gain_map_params_from_iso21496().
|
static |
Definition at line 23 of file gain_map.c.
Referenced by av_gain_map_params_alloc(), and av_gain_map_params_create_side_data().
| int av_gain_map_params_validate | ( | const AVGainMapParams * | p | ) |
Returns >= 0 if the given AVGainMapParams struct contains valid data; or a negative AVERROR otherwise.
Note: The ISO spec declares these as signed, but a negative value makes no numeric sense and would result in infinities in the middle of the valid signal range; so just constrain them to be unsigned as a safeguard. Note that the Adobe hdrgm spec explicitly requires them to be nonnegative as well, so this avoids an inconsistency.
Definition at line 47 of file gain_map.c.
Referenced by av_gain_map_params_from_iso21496(), av_gain_map_params_to_iso21496(), ff_gain_map_params_check_xmp(), ff_mjpeg_add_gain_map_size(), and process_frame().
|
static |
Definition at line 82 of file gain_map.c.
Referenced by av_gain_map_params_from_iso21496().
|
static |
Definition at line 87 of file gain_map.c.
|
static |
Definition at line 97 of file gain_map.c.
Referenced by av_gain_map_params_from_iso21496().
|
static |
Definition at line 104 of file gain_map.c.
Referenced by av_gain_map_params_from_iso21496().
| int av_gain_map_params_from_iso21496 | ( | AVGainMapParams *restrict | p, |
| const uint8_t * | data, | ||
| size_t | size ) |
While the spec does not require reserved bits to be 0, older versions of the ISO 21496-1 draft specification had extra flags that got removed from the final publication, so conservatively error out just in case; unless the writer version is >0 in which case these may be genuine additions to later revisions of the published spec, the validity of ignoring which is already guarded by the minimum_version check.
Definition at line 111 of file gain_map.c.
Referenced by mjpeg_decode_app(), and mov_parse_heif_layered_video_tmap().
|
static |
Definition at line 171 of file gain_map.c.
Referenced by av_gain_map_params_to_iso21496().
| int av_gain_map_params_to_iso21496 | ( | const AVGainMapParams * | p, |
| uint8_t * | buf ) |
Serialize an AVGainMapParams as an ISO 21496-1 gain map metadata blob.
The output starts at the minimum_version field; the caller should prepend whatever identifier its container requires.
| p | parameters to serialize |
| buf | Byte buffer to fill with the serialized data. Must contain at least AV_GAIN_MAP_MAX_PAYLOAD_SIZE bytes. |
Definition at line 177 of file gain_map.c.
Referenced by jpeg_put_comments().
| int av_gain_map_channels_identical | ( | const AVGainMapParams * | p | ) |
Returns 1 if all channels of the gain map have identical parameters, 0 otherwise.
Definition at line 215 of file gain_map.c.
Referenced by av_gain_map_params_to_iso21496(), and ff_gain_map_params_check_xmp().
| AVGainMapParams * av_gain_map_params_alloc | ( | size_t * | size | ) |
Allocate an AVGainMapParams structure and initialize it to default values.
The resulting pointer must be freed using av_free().
| size | if non-NULL, set to sizeof(AVGainMapParams) |
Definition at line 224 of file gain_map.c.
Referenced by init(), mjpeg_decode_app(), mov_parse_heif_layered_video_auxl_gmap(), and mov_parse_heif_layered_video_tmap().
| AVGainMapParams * av_gain_map_params_create_side_data | ( | AVFrameSideData *** | sd, |
| int * | nb_sd ) |
Allocate and add an AVGainMapParams structure to an existing AVFrameSideData array as AV_FRAME_DATA_GAIN_MAP_PARAMS side data.
Definition at line 238 of file gain_map.c.
Referenced by process_frame().