32 h->present = !
s->fg_characteristics_cancel_flag;
34 h->model_id =
s->fg_model_id;
35 h->separate_colour_description_present_flag =
s->fg_separate_colour_description_present_flag;
36 if (
h->separate_colour_description_present_flag) {
37 h->bit_depth_luma =
s->fg_bit_depth_luma_minus8 + 8;
38 h->bit_depth_chroma =
s->fg_bit_depth_chroma_minus8 + 8;
39 h->full_range =
s->fg_full_range_flag;
40 h->color_primaries =
s->fg_colour_primaries;
41 h->transfer_characteristics =
s->fg_transfer_characteristics;
42 h->matrix_coeffs =
s->fg_matrix_coeffs;
46 "No active SPS for film_grain_characteristics.\n");
49 h->bit_depth_luma =
sps->bit_depth;
50 h->bit_depth_chroma =
sps->bit_depth;
51 h->full_range =
sps->r->vui.vui_full_range_flag;
52 h->color_primaries =
sps->r->vui.vui_colour_primaries;
53 h->transfer_characteristics =
sps->r->vui.vui_transfer_characteristics;
54 h->matrix_coeffs =
sps->r->vui.vui_matrix_coeffs ;
57 h->blending_mode_id =
s->fg_blending_mode_id;
58 h->log2_scale_factor =
s->fg_log2_scale_factor;
60 for (
int c = 0;
c < 3;
c++) {
61 h->comp_model_present_flag[
c] =
s->fg_comp_model_present_flag[
c];
62 if (
h->comp_model_present_flag[
c]) {
63 h->num_intensity_intervals[
c] =
s->fg_num_intensity_intervals_minus1[
c] + 1;
64 h->num_model_values[
c] =
s->fg_num_model_values_minus1[
c] + 1;
66 if (
h->num_model_values[
c] > 6)
69 for (
int i = 0;
i <
h->num_intensity_intervals[
c];
i++) {
70 h->intensity_interval_lower_bound[
c][
i] =
s->fg_intensity_interval_lower_bound[
c][
i];
71 h->intensity_interval_upper_bound[
c][
i] =
s->fg_intensity_interval_upper_bound[
c][
i];
72 for (
int j = 0; j <
h->num_model_values[
c]; j++)
73 h->comp_model_value[
c][
i][j] =
s->fg_comp_model_value[
c][
i][j];
78 h->persistence_flag =
s->fg_characteristics_persistence_flag;
87 h->hash_type =
s->dph_sei_hash_type;
88 if (
h->hash_type == 0)
89 memcpy(
h->md5,
s->dph_sei_picture_md5,
sizeof(
h->md5));
90 else if (
h->hash_type == 1)
91 memcpy(
h->crc,
s->dph_sei_picture_crc,
sizeof(
h->crc));
92 else if (
h->hash_type == 2)
93 memcpy(
h->checksum,
s->dph_sei_picture_checksum,
sizeof(
h->checksum));
100 int degrees[] = { 0, 0x8000, 0x4000, 0xC000 };
102 h->present = !
s->display_orientation_cancel_flag;
104 if (
s->display_orientation_transform_type > 7)
108 if (
s->display_orientation_transform_type == 1 ||
109 s->display_orientation_transform_type == 3 ||
110 s->display_orientation_transform_type == 4 ||
111 s->display_orientation_transform_type == 6) {
116 h->anticlockwise_rotation = degrees[
s->display_orientation_transform_type >> 1];
125 h->max_content_light_level =
s->max_content_light_level;
126 h->max_pic_average_light_level =
s->max_pic_average_light_level;
133 if (
s->ffi_source_scan_type > 3)
137 if (
s->ffi_field_pic_flag) {
138 if (
s->ffi_bottom_field_flag)
143 h->display_elemental_periods =
s->ffi_display_elemental_periods_minus1 + 1;
146 h->source_scan_type =
s->ffi_source_scan_type;
147 h->duplicate_flag =
s->ffi_duplicate_flag;
155 h->ambient_illuminance =
s->ambient_illuminance;
156 h->ambient_light_x =
s->ambient_light_x;
157 h->ambient_light_y =
s->ambient_light_y;
166 for (
int c = 0;
c < 3;
c++) {
167 h->display_primaries[
c][0] =
s->display_primaries_x[
c];
168 h->display_primaries[
c][1] =
s->display_primaries_y[
c];
171 h->white_point[0] =
s->white_point_x;
172 h->white_point[1] =
s->white_point_y;
174 h->max_luminance =
s->max_display_mastering_luminance;
175 h->min_luminance =
s->min_display_mastering_luminance;
184 int offset = (
s->itu_t_t35_country_code == 0xff) + 1;
208 for (
int i = 0;
i <
sei->message_list.nb_messages;
i++) {
211 void *payload =
message->payload;
213 switch (
message->payload_type) {
217 if (!
c->film_grain_characteristics)
257 "PREFIX" :
"SUFFIX",
message->payload_type);
274 dst->picture_hash.present = 0;
275 dst->frame_field_info.present = 0;
282 s->picture_hash.present = 0;
283 s->frame_field_info.present = 0;
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
static av_always_inline void bytestream2_init(GetByteContext *g, const uint8_t *buf, int buf_size)
#define i(width, name, range_min, range_max)
static int FUNC sei(CodedBitstreamContext *ctx, RWContext *rw, H264RawSEI *current)
static int FUNC sps(CodedBitstreamContext *ctx, RWContext *rw, H264RawSPS *current)
static const uint16_t fc[]
@ AV_PICTURE_STRUCTURE_BOTTOM_FIELD
coded as bottom field
@ AV_PICTURE_STRUCTURE_TOP_FIELD
coded as top field
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define av_err2str(errnum)
Convenience macro, the return value should be used only directly in function arguments but never stan...
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
#define AV_LOG_WARNING
Something somehow does not look correct.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
void ff_h2645_sei_reset(H2645SEI *s)
int ff_h2645_sei_ctx_replace(H2645SEI *dst, const H2645SEI *src)
int ff_h2645_sei_message_decode(H2645SEI *h, enum SEIType type, enum AVCodecID codec_id, GetBitContext *gb, GetByteContext *gbyte, void *logctx)
Decode a single SEI message.
@ FF_H2645_SEI_MESSAGE_UNHANDLED
void av_refstruct_unref(void *objp)
Decrement the reference count of the underlying object and automatically free the object if there are...
static void * av_refstruct_allocz(size_t size)
Equivalent to av_refstruct_alloc_ext(size, 0, NULL, NULL)
@ SEI_TYPE_DECODED_PICTURE_HASH
@ SEI_TYPE_USER_DATA_REGISTERED_ITU_T_T35
@ SEI_TYPE_DISPLAY_ORIENTATION
@ SEI_TYPE_FRAME_FIELD_INFO
@ SEI_TYPE_USER_DATA_UNREGISTERED
@ SEI_TYPE_FILM_GRAIN_CHARACTERISTICS
@ SEI_TYPE_CONTENT_LIGHT_LEVEL_INFO
@ SEI_TYPE_AMBIENT_VIEWING_ENVIRONMENT
@ SEI_TYPE_MASTERING_DISPLAY_COLOUR_VOLUME
static int decode_ambient_viewing_environment(H2645SEIAmbientViewingEnvironment *h, const SEIRawAmbientViewingEnvironment *s)
static int decode_display_orientation(H2645SEIDisplayOrientation *h, const SEIRawDisplayOrientation *s)
static int decode_mastering_display_colour_volume(H2645SEIMasteringDisplay *h, const SEIRawMasteringDisplayColourVolume *s)
void ff_vvc_sei_reset(VVCSEI *s)
static int decode_user_data_registered_itu_t_t35(H2645SEI *sei, const SEIRawUserDataRegistered *s, const VVCFrameContext *fc)
static int decode_user_data_uregistered(H2645SEI *sei, const SEIRawUserDataUnregistered *s, const VVCFrameContext *fc)
int ff_vvc_sei_decode(VVCSEI *s, const H266RawSEI *sei, const struct VVCFrameContext *fc)
static int decode_content_light_level_info(H2645SEIContentLight *h, const SEIRawContentLightLevelInfo *s)
static int decode_frame_field_info(H274SEIFrameFieldInfo *h, const SEIRawFrameFieldInformation *s)
static int decode_film_grain_characteristics(H2645SEIFilmGrainCharacteristics *h, const SEIRawFilmGrainCharacteristics *s, const VVCFrameContext *fc)
static int decode_decoded_picture_hash(H274SEIPictureHash *h, const SEIRawDecodedPictureHash *s)
int ff_vvc_sei_replace(VVCSEI *dst, const VVCSEI *src)