1 /*
2 * This file is part of FFmpeg.
3 *
4 * FFmpeg is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * FFmpeg is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with FFmpeg; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18
21
24 #include "cbs.h"
27 #include "vvc.h"
28
29 #define IS_H266_SLICE(nut) (nut <= VVC_RASL_NUT || (nut >= VVC_IDR_W_RADL && nut <= VVC_GDR_NUT))
30
33
35
38
41 {
44
45 // If an AUD is present, it must be the first NAL unit.
48 ff_cbs_delete_unit(pu, 0);
53 int pic_type = 0, temporal_id = 8, layer_id = 0;
56 if (!nal)
57 continue;
67 pic_type < 2)
68 pic_type = 2;
70 pic_type < 1)
71 pic_type = 1;
72 if (!first_slice) {
73 first_slice = slice;
75 sh_picture_header_in_slice_header_flag)
78 break;
79 }
80 }
81 }
85 }
86
89 .nuh_layer_id = layer_id,
90 .nuh_temporal_id_plus1 = temporal_id + 1,
91 };
92 aud->aud_pic_type = pic_type;
93 aud->aud_irap_or_gdr_flag =
ph->ph_gdr_or_irap_pic_flag;
94
96 if (err < 0) {
98 return err;
99 }
100 }
101
102 /* TODO: implement more metadata parsing, like VUI, Levels etc. */
103 //for (i = 0; i < pu->nb_units; i++) {
104 // if (pu->units[i].type == VVC_SPS_NUT) {
105 // }
106 //}
107 return 0;
108 }
109
112 .fragment_name = "access unit",
113 .unit_name = "NAL unit",
115 };
116
118 {
120 }
121
122 #define OFFSET(x) offsetof(H266MetadataContext, x)
123 #define FLAGS (AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_BSF_PARAM)
127
129 };
130
136 };
137
140 };
141
143 .
p.
name =
"vvc_metadata",
150 };