31 h->present = !
s->fg_characteristics_cancel_flag;
33 h->model_id =
s->fg_model_id;
34 h->separate_colour_description_present_flag =
s->fg_separate_colour_description_present_flag;
35 if (
h->separate_colour_description_present_flag) {
36 h->bit_depth_luma =
s->fg_bit_depth_luma_minus8 + 8;
37 h->bit_depth_chroma =
s->fg_bit_depth_chroma_minus8 + 8;
38 h->full_range =
s->fg_full_range_flag;
39 h->color_primaries =
s->fg_colour_primaries;
40 h->transfer_characteristics =
s->fg_transfer_characteristics;
41 h->matrix_coeffs =
s->fg_matrix_coeffs;
45 "No active SPS for film_grain_characteristics.\n");
48 h->bit_depth_luma =
sps->bit_depth;
49 h->bit_depth_chroma =
sps->bit_depth;
50 h->full_range =
sps->r->vui.vui_full_range_flag;
51 h->color_primaries =
sps->r->vui.vui_colour_primaries;
52 h->transfer_characteristics =
sps->r->vui.vui_transfer_characteristics;
53 h->matrix_coeffs =
sps->r->vui.vui_matrix_coeffs ;
56 h->blending_mode_id =
s->fg_blending_mode_id;
57 h->log2_scale_factor =
s->fg_log2_scale_factor;
59 for (
int c = 0;
c < 3;
c++) {
60 h->comp_model_present_flag[
c] =
s->fg_comp_model_present_flag[
c];
61 if (
h->comp_model_present_flag[
c]) {
62 h->num_intensity_intervals[
c] =
s->fg_num_intensity_intervals_minus1[
c] + 1;
63 h->num_model_values[
c] =
s->fg_num_model_values_minus1[
c] + 1;
65 if (
h->num_model_values[
c] > 6)
68 for (
int i = 0;
i <
h->num_intensity_intervals[
c];
i++) {
69 h->intensity_interval_lower_bound[
c][
i] =
s->fg_intensity_interval_lower_bound[
c][
i];
70 h->intensity_interval_upper_bound[
c][
i] =
s->fg_intensity_interval_upper_bound[
c][
i];
71 for (
int j = 0; j <
h->num_model_values[
c]; j++)
72 h->comp_model_value[
c][
i][j] =
s->fg_comp_model_value[
c][
i][j];
77 h->persistence_flag =
s->fg_characteristics_persistence_flag;
86 h->hash_type =
s->dph_sei_hash_type;
87 if (
h->hash_type == 0)
88 memcpy(
h->md5,
s->dph_sei_picture_md5,
sizeof(
h->md5));
89 else if (
h->hash_type == 1)
90 memcpy(
h->crc,
s->dph_sei_picture_crc,
sizeof(
h->crc));
91 else if (
h->hash_type == 2)
92 memcpy(
h->checksum,
s->dph_sei_picture_checksum,
sizeof(
h->checksum));
99 int degrees[] = { 0, 0x8000, 0x4000, 0xC000 };
101 h->present = !
s->display_orientation_cancel_flag;
103 if (
s->display_orientation_transform_type > 7)
107 if (
s->display_orientation_transform_type == 1 ||
108 s->display_orientation_transform_type == 3 ||
109 s->display_orientation_transform_type == 4 ||
110 s->display_orientation_transform_type == 6) {
115 h->anticlockwise_rotation = degrees[
s->display_orientation_transform_type >> 1];
124 h->max_content_light_level =
s->max_content_light_level;
125 h->max_pic_average_light_level =
s->max_pic_average_light_level;
132 if (
s->ffi_source_scan_type > 3)
136 if (
s->ffi_field_pic_flag) {
137 if (
s->ffi_bottom_field_flag)
142 h->display_elemental_periods =
s->ffi_display_elemental_periods_minus1 + 1;
145 h->source_scan_type =
s->ffi_source_scan_type;
146 h->duplicate_flag =
s->ffi_duplicate_flag;
154 h->ambient_illuminance =
s->ambient_illuminance;
155 h->ambient_light_x =
s->ambient_light_x;
156 h->ambient_light_y =
s->ambient_light_y;
165 for (
int c = 0;
c < 3;
c++) {
166 h->display_primaries[
c][0] =
s->display_primaries_x[
c];
167 h->display_primaries[
c][1] =
s->display_primaries_y[
c];
170 h->white_point[0] =
s->white_point_x;
171 h->white_point[1] =
s->white_point_y;
173 h->max_luminance =
s->max_display_mastering_luminance;
174 h->min_luminance =
s->min_display_mastering_luminance;
186 for (
int i = 0;
i <
sei->message_list.nb_messages;
i++) {
189 void *payload =
message->payload;
191 switch (
message->payload_type) {
195 if (!
c->film_grain_characteristics)
227 "PREFIX" :
"SUFFIX",
message->payload_type);
244 dst->picture_hash.present = 0;
245 dst->frame_field_info.present = 0;
252 s->picture_hash.present = 0;
253 s->frame_field_info.present = 0;