1 /*
2 * HEVC Parameter Set encoding
3 *
4 * This file is part of FFmpeg.
5 *
6 * FFmpeg is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * FFmpeg is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with FFmpeg; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
24
26 {
28
32 for (
i = 0;
i < 32;
i++)
40 }
41
43 {
45
48
49 for (
i = 0;
i < max_num_sub_layers - 1;
i++) {
52 }
53
54 if (max_num_sub_layers > 1)
55 for (
i = max_num_sub_layers - 1;
i < 8;
i++)
57
58 for (
i = 0;
i < max_num_sub_layers - 1;
i++) {
63 }
64 }
65
67 uint8_t *buf, int buf_size)
68 {
71
77 put_bits(&pb, 1,
vps->vps_temporal_id_nesting_flag);
78 put_bits(&pb, 16, 0xffff);
// reserved
79
81
82 put_bits(&pb, 1,
vps->vps_sub_layer_ordering_info_present_flag);
83 for (
i =
vps->vps_sub_layer_ordering_info_present_flag ? 0 :
vps->vps_max_layers - 1;
84 i < vps->vps_max_sub_layers;
i++) {
88 }
89
92
93 if (
vps->vps_num_layer_sets > 1) {
96 }
97
98 put_bits(&pb, 1,
vps->vps_timing_info_present_flag);
99 if (
vps->vps_timing_info_present_flag) {
102 put_bits(&pb, 1,
vps->vps_poc_proportional_to_timing_flag);
103 if (
vps->vps_poc_proportional_to_timing_flag)
105
107 if (
vps->vps_num_hrd_parameters) {
110 }
111 }
112
113 put_bits(&pb, 1, 0);
// extension flag
114
117
119
120 return data_size;
121 }