2017-04-30 16:34:06 +02:00
|
|
|
/*
|
|
|
|
* HEVC Supplementary Enhancement Information messages
|
|
|
|
*
|
|
|
|
* This file is part of FFmpeg.
|
|
|
|
*
|
|
|
|
* FFmpeg is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* FFmpeg is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with FFmpeg; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef AVCODEC_HEVC_SEI_H
|
|
|
|
#define AVCODEC_HEVC_SEI_H
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
#include "get_bits.h"
|
2021-01-21 16:38:58 +02:00
|
|
|
#include "sei.h"
|
2017-04-30 16:34:06 +02:00
|
|
|
|
|
|
|
|
2020-01-23 15:24:17 +02:00
|
|
|
typedef enum {
|
|
|
|
HEVC_SEI_PIC_STRUCT_FRAME_DOUBLING = 7,
|
|
|
|
HEVC_SEI_PIC_STRUCT_FRAME_TRIPLING = 8
|
|
|
|
} HEVC_SEI_PicStructType;
|
|
|
|
|
2017-04-30 16:34:06 +02:00
|
|
|
typedef struct HEVCSEIPictureHash {
|
|
|
|
uint8_t md5[3][16];
|
|
|
|
uint8_t is_md5;
|
|
|
|
} HEVCSEIPictureHash;
|
|
|
|
|
|
|
|
typedef struct HEVCSEIFramePacking {
|
|
|
|
int present;
|
|
|
|
int arrangement_type;
|
|
|
|
int content_interpretation_type;
|
|
|
|
int quincunx_subsampling;
|
2017-09-25 15:09:21 +02:00
|
|
|
int current_frame_is_frame0_flag;
|
2017-04-30 16:34:06 +02:00
|
|
|
} HEVCSEIFramePacking;
|
|
|
|
|
|
|
|
typedef struct HEVCSEIDisplayOrientation {
|
|
|
|
int present;
|
|
|
|
int anticlockwise_rotation;
|
|
|
|
int hflip, vflip;
|
|
|
|
} HEVCSEIDisplayOrientation;
|
|
|
|
|
|
|
|
typedef struct HEVCSEIPictureTiming {
|
|
|
|
int picture_struct;
|
|
|
|
} HEVCSEIPictureTiming;
|
|
|
|
|
|
|
|
typedef struct HEVCSEIA53Caption {
|
2019-12-20 03:17:21 +02:00
|
|
|
AVBufferRef *buf_ref;
|
2017-04-30 16:34:06 +02:00
|
|
|
} HEVCSEIA53Caption;
|
|
|
|
|
2020-06-11 04:25:47 +02:00
|
|
|
typedef struct HEVCSEIUnregistered {
|
|
|
|
AVBufferRef **buf_ref;
|
|
|
|
int nb_buf_ref;
|
|
|
|
} HEVCSEIUnregistered;
|
|
|
|
|
2017-04-30 16:34:06 +02:00
|
|
|
typedef struct HEVCSEIMasteringDisplay {
|
|
|
|
int present;
|
|
|
|
uint16_t display_primaries[3][2];
|
|
|
|
uint16_t white_point[2];
|
|
|
|
uint32_t max_luminance;
|
|
|
|
uint32_t min_luminance;
|
|
|
|
} HEVCSEIMasteringDisplay;
|
|
|
|
|
2020-11-23 23:29:34 +02:00
|
|
|
typedef struct HEVCSEIDynamicHDRPlus {
|
|
|
|
AVBufferRef *info;
|
|
|
|
} HEVCSEIDynamicHDRPlus;
|
|
|
|
|
2017-04-30 16:34:06 +02:00
|
|
|
typedef struct HEVCSEIContentLight {
|
|
|
|
int present;
|
|
|
|
uint16_t max_content_light_level;
|
|
|
|
uint16_t max_pic_average_light_level;
|
|
|
|
} HEVCSEIContentLight;
|
|
|
|
|
2017-06-09 23:35:22 +02:00
|
|
|
typedef struct HEVCSEIAlternativeTransfer {
|
|
|
|
int present;
|
|
|
|
int preferred_transfer_characteristics;
|
|
|
|
} HEVCSEIAlternativeTransfer;
|
|
|
|
|
2020-06-15 14:55:17 +02:00
|
|
|
typedef struct HEVCSEITimeCode {
|
|
|
|
int present;
|
|
|
|
uint8_t num_clock_ts;
|
|
|
|
uint8_t clock_timestamp_flag[3];
|
|
|
|
uint8_t units_field_based_flag[3];
|
|
|
|
uint8_t counting_type[3];
|
|
|
|
uint8_t full_timestamp_flag[3];
|
|
|
|
uint8_t discontinuity_flag[3];
|
|
|
|
uint8_t cnt_dropped_flag[3];
|
|
|
|
uint16_t n_frames[3];
|
|
|
|
uint8_t seconds_value[3];
|
|
|
|
uint8_t minutes_value[3];
|
|
|
|
uint8_t hours_value[3];
|
|
|
|
uint8_t seconds_flag[3];
|
|
|
|
uint8_t minutes_flag[3];
|
|
|
|
uint8_t hours_flag[3];
|
|
|
|
uint8_t time_offset_length[3];
|
|
|
|
int32_t time_offset_value[3];
|
|
|
|
} HEVCSEITimeCode;
|
|
|
|
|
2017-10-31 17:27:57 +02:00
|
|
|
typedef struct HEVCSEI {
|
2017-04-30 16:34:06 +02:00
|
|
|
HEVCSEIPictureHash picture_hash;
|
|
|
|
HEVCSEIFramePacking frame_packing;
|
|
|
|
HEVCSEIDisplayOrientation display_orientation;
|
|
|
|
HEVCSEIPictureTiming picture_timing;
|
|
|
|
HEVCSEIA53Caption a53_caption;
|
2020-06-11 04:25:47 +02:00
|
|
|
HEVCSEIUnregistered unregistered;
|
2017-04-30 16:34:06 +02:00
|
|
|
HEVCSEIMasteringDisplay mastering_display;
|
2020-11-23 23:29:34 +02:00
|
|
|
HEVCSEIDynamicHDRPlus dynamic_hdr_plus;
|
2017-04-30 16:34:06 +02:00
|
|
|
HEVCSEIContentLight content_light;
|
|
|
|
int active_seq_parameter_set_id;
|
2017-06-09 23:35:22 +02:00
|
|
|
HEVCSEIAlternativeTransfer alternative_transfer;
|
2020-06-15 14:55:17 +02:00
|
|
|
HEVCSEITimeCode timecode;
|
2017-10-31 17:27:57 +02:00
|
|
|
} HEVCSEI;
|
2017-04-30 16:34:06 +02:00
|
|
|
|
|
|
|
struct HEVCParamSets;
|
|
|
|
|
2017-10-31 17:27:57 +02:00
|
|
|
int ff_hevc_decode_nal_sei(GetBitContext *gb, void *logctx, HEVCSEI *s,
|
2017-04-30 16:34:06 +02:00
|
|
|
const struct HEVCParamSets *ps, int type);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Reset SEI values that are stored on the Context.
|
|
|
|
* e.g. Caption data that was extracted during NAL
|
|
|
|
* parsing.
|
|
|
|
*
|
|
|
|
* @param s HEVCContext.
|
|
|
|
*/
|
2017-10-31 17:27:57 +02:00
|
|
|
void ff_hevc_reset_sei(HEVCSEI *s);
|
2017-04-30 16:34:06 +02:00
|
|
|
|
|
|
|
#endif /* AVCODEC_HEVC_SEI_H */
|