2 * Routines for H.264 dissection
3 * Copyright 2007 - 2009, Anders Broman <anders.broman[at]ericsson.com>
7 * Wireshark - Network traffic analyzer
8 * By Gerald Combs <gerald@wireshark.org>
9 * Copyright 1998 Gerald Combs
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 2
14 * of the License, or (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26 * http://www.ietf.org/rfc/rfc3984.txt?number=3984
27 * http://www.itu.int/rec/T-REC-H.264/en
36 #include <epan/packet.h>
37 #include <epan/asn1.h>
38 #include <epan/strutil.h>
39 #include <epan/expert.h>
40 #include <epan/prefs.h>
41 #include <epan/wmem/wmem.h>
43 /* Initialize the protocol and registered fields */
44 static int proto_h264
= -1;
45 static int hf_h264_type
= -1;
46 static int hf_h264_nal_f_bit
= -1;
47 static int hf_h264_nal_nri
= -1;
48 static int hf_h264_start_bit
= -1;
49 static int hf_h264_forbidden_bit
= -1;
50 static int hf_h264_end_bit
= -1;
51 static int hf_h264_profile
= -1;
52 static int hf_h264_profile_idc
= -1;
53 static int hf_h264_rbsp_stop_bit
= -1;
54 static int hf_h264_rbsp_trailing_bits
= -1;
55 static int hf_h264_constraint_set0_flag
= -1;
56 static int hf_h264_constraint_set1_flag
= -1;
57 static int hf_h264_constraint_set2_flag
= -1;
58 static int hf_h264_constraint_set3_flag
= -1;
59 static int hf_h264_reserved_zero_4bits
= -1;
60 static int hf_h264_level_idc
= -1;
61 static int hf_h264_nal_unit
= -1;
62 static int hf_h264_forbidden_zero_bit
= -1;
63 static int hf_h264_nal_ref_idc
= -1;
64 static int hf_h264_nal_unit_type
= -1;
65 static int hf_h264_seq_parameter_set_id
= -1;
66 static int hf_h264_chroma_format_idc
= -1;
67 static int hf_h264_residual_colour_transform_flag
= -1;
68 static int hf_h264_bit_depth_luma_minus8
= -1;
69 static int hf_h264_bit_depth_chroma_minus8
= -1;
70 static int hf_h264_qpprime_y_zero_transform_bypass_flag
= -1;
71 static int hf_h264_seq_scaling_matrix_present_flag
= -1;
72 static int hf_h264_log2_max_frame_num_minus4
= -1;
73 static int hf_h264_pic_order_cnt_type
= -1;
74 static int hf_h264_log2_max_pic_order_cnt_lsb_minus4
= -1;
75 static int hf_h264_delta_pic_order_always_zero_flag
= -1;
76 static int hf_h264_offset_for_non_ref_pic
= -1;
77 static int hf_h264_offset_for_top_to_bottom_field
= -1;
78 static int hf_h264_num_ref_frames_in_pic_order_cnt_cycle
= -1;
79 static int hf_h264_offset_for_ref_frame
= -1;
80 static int hf_h264_num_ref_frames
= -1;
81 static int hf_h264_gaps_in_frame_num_value_allowed_flag
= -1;
82 static int hf_h264_pic_width_in_mbs_minus1
= -1;
83 static int hf_h264_pic_height_in_map_units_minus1
= -1;
84 static int hf_h264_frame_mbs_only_flag
= -1;
85 static int hf_h264_mb_adaptive_frame_field_flag
= -1;
86 static int hf_h264_direct_8x8_inference_flag
= -1;
87 static int hf_h264_frame_cropping_flag
= -1;
88 static int hf_h264_frame_crop_left_offset
= -1;
89 static int hf_h264_frame_crop_right_offset
= -1;
90 static int hf_h264_frame_crop_top_offset
= -1;
91 static int hf_h264_frame_crop_bottom_offset
= -1;
92 static int hf_h264_vui_parameters_present_flag
= -1;
93 static int hf_h264_pic_parameter_set_id
= -1;
94 static int hf_h264_entropy_coding_mode_flag
= -1;
95 static int hf_h264_pic_order_present_flag
= -1;
96 static int hf_h264_num_slice_groups_minus1
= -1;
97 static int hf_h264_slice_group_map_type
= -1;
98 static int hf_h264_num_ref_idx_l0_active_minus1
= -1;
99 static int hf_h264_num_ref_idx_l1_active_minus1
= -1;
100 static int hf_h264_weighted_pred_flag
= -1;
101 static int hf_h264_weighted_bipred_idc
= -1;
102 static int hf_h264_pic_init_qp_minus26
= -1;
103 static int hf_h264_pic_init_qs_minus26
= -1;
104 static int hf_h264_chroma_qp_index_offset
= -1;
105 static int hf_h264_deblocking_filter_control_present_flag
= -1;
106 static int hf_h264_constrained_intra_pred_flag
= -1;
107 static int hf_h264_redundant_pic_cnt_present_flag
= -1;
108 static int hf_h264_transform_8x8_mode_flag
= -1;
109 static int hf_h264_pic_scaling_matrix_present_flag
= -1;
110 static int hf_h264_second_chroma_qp_index_offset
= -1;
111 static int hf_h264_par_profile
= -1;
112 static int hf_h264_par_profile_b
= -1;
113 static int hf_h264_par_profile_m
= -1;
114 static int hf_h264_par_profile_e
= -1;
115 static int hf_h264_par_profile_h
= -1;
116 static int hf_h264_par_profile_h10
= -1;
117 static int hf_h264_par_profile_h4_2_2
= -1;
118 static int hf_h264_par_profile_h4_4_4
= -1;
119 /* static int hf_h264_par_add_mode_sup = -1; */
120 static int hf_h264_par_AdditionalModesSupported
= -1;
121 static int hf_h264_par_add_mode_sup_rcdo
= -1;
122 static int hf_h264_par_ProfileIOP
= -1;
123 static int hf_h264_par_constraint_set0_flag
= -1;
124 static int hf_h264_par_constraint_set1_flag
= -1;
125 static int hf_h264_par_constraint_set2_flag
= -1;
128 static int hf_h264_aspect_ratio_info_present_flag
= -1;
129 static int hf_h264_aspect_ratio_idc
= -1;
130 static int hf_h264_sar_width
= -1;
131 static int hf_h264_sar_height
= -1;
132 static int hf_h264_overscan_info_present_flag
= -1;
133 static int hf_h264_overscan_appropriate_flag
= -1;
134 static int hf_h264_video_signal_type_present_flag
= -1;
135 static int hf_h264_video_format
= -1;
136 static int hf_h264_video_full_range_flag
= -1;
137 static int hf_h264_colour_description_present_flag
= -1;
138 static int hf_h264_colour_primaries
= -1;
139 static int hf_h264_transfer_characteristics
= -1;
140 static int hf_h264_matrix_coefficients
= -1;
141 static int hf_h264_chroma_loc_info_present_flag
= -1;
142 static int hf_h264_chroma_sample_loc_type_top_field
= -1;
143 static int hf_h264_chroma_sample_loc_type_bottom_field
= -1;
144 static int hf_h264_timing_info_present_flag
= -1;
145 static int hf_h264_num_units_in_tick
= -1;
146 static int hf_h264_time_scale
= -1;
147 static int hf_h264_fixed_frame_rate_flag
= -1;
148 static int hf_h264_nal_hrd_parameters_present_flag
= -1;
149 static int hf_h264_vcl_hrd_parameters_present_flag
= -1;
150 static int hf_h264_low_delay_hrd_flag
= -1;
151 static int hf_h264_pic_struct_present_flag
= -1;
152 static int hf_h264_bitstream_restriction_flag
= -1;
153 static int hf_h264_motion_vectors_over_pic_boundaries_flag
= -1;
154 static int hf_h264_max_bytes_per_pic_denom
= -1;
155 static int hf_h264_max_bits_per_mb_denom
= -1;
156 static int hf_h264_log2_max_mv_length_horizontal
= -1;
157 static int hf_h264_log2_max_mv_length_vertical
= -1;
158 static int hf_h264_num_reorder_frames
= -1;
159 static int hf_h264_max_dec_frame_buffering
= -1;
160 static int hf_h264_cpb_cnt_minus1
= -1;
161 static int hf_h264_bit_rate_scale
= -1;
162 static int hf_h264_cpb_size_scale
= -1;
163 static int hf_h264_bit_rate_value_minus1
= -1;
164 static int hf_h264_cpb_size_value_minus1
= -1;
165 static int hf_h264_cbr_flag
= -1;
166 static int hf_h264_initial_cpb_removal_delay_length_minus1
= -1;
167 static int hf_h264_cpb_removal_delay_length_minus1
= -1;
168 static int hf_h264_dpb_output_delay_length_minus11
= -1;
169 static int hf_h264_time_offset_length
= -1;
171 static int hf_h264_first_mb_in_slice
= -1;
172 static int hf_h264_slice_type
= -1;
173 static int hf_h264_slice_id
= -1;
174 static int hf_h264_payloadsize
= -1;
175 static int hf_h264_payloadtype
= -1;
176 /* static int hf_h264_frame_num = -1; */
178 /* Initialize the subtree pointers */
179 static int ett_h264
= -1;
180 static int ett_h264_profile
= -1;
181 static int ett_h264_nal
= -1;
182 static int ett_h264_fua
= -1;
183 static int ett_h264_stream
= -1;
184 static int ett_h264_nal_unit
= -1;
185 static int ett_h264_par_profile
= -1;
186 static int ett_h264_par_AdditionalModesSupported
= -1;
187 static int ett_h264_par_ProfileIOP
= -1;
189 static expert_field ei_h264_undecoded
= EI_INIT
;
191 /* The dynamic payload type range which will be dissected as H.264 */
193 #define RTP_PT_DEFAULT_RANGE "0"
194 static range_t
*temp_dynamic_payload_type_range
= NULL
;
196 static dissector_handle_t h264_handle
;
198 /* syntax tables in subclause 7.3 is equal to
199 * ue(v), me(v), se(v), or te(v).
206 } h264_golomb_descriptors
;
209 static const true_false_string h264_f_bit_vals
= {
210 "Bit errors or other syntax violations",
211 "No bit errors or other syntax violations"
214 static const true_false_string h264_start_bit_vals
= {
215 "the first packet of FU-A picture",
216 "Not the first packet of FU-A picture"
219 static const true_false_string h264_end_bit_vals
= {
220 "the last packet of FU-A picture",
221 "Not the last packet of FU-A picture"
225 static const true_false_string h264_forbidden_bit_vals
= {
226 "Forbidden Bit of FU-A",
227 "Not Forbidden Bit of FU-A"
231 #define H264_SEQ_PAR_SET 7
232 #define H264_PIC_PAR_SET 8
234 static const value_string h264_type_values
[] = {
236 { 1, "NAL unit - Coded slice of a non-IDR picture" }, /* Single NAL unit packet per H.264 */
237 { 2, "NAL unit - Coded slice data partition A" },
238 { 3, "NAL unit - Coded slice data partition B" },
239 { 4, "NAL unit - Coded slice data partition C" },
240 { 5, "NAL unit - Coded slice of an IDR picture" },
241 { 6, "NAL unit - Supplemental enhancement information (SEI)" },
242 { H264_SEQ_PAR_SET
, "NAL unit - Sequence parameter set" }, /* 7 */
243 { H264_PIC_PAR_SET
, "NAL unit - Picture parameter set" }, /* 8 */
244 { 9, "NAL unit - Access unit delimiter" },
245 { 10, "NAL unit - End of sequence" },
246 { 11, "NAL unit - End of stream" },
247 { 12, "NAL unit - Filler data" },
248 { 13, "NAL unit - Sequence parameter set extension" },
249 { 14, "NAL unit - Reserved" },
250 { 15, "NAL unit - Reserved" },
251 { 16, "NAL unit - Reserved" },
252 { 17, "NAL unit - Reserved" },
253 { 18, "NAL unit - Reserved" },
254 { 19, "NAL unit - Coded slice of an auxiliary coded picture without partitioning" },
255 { 20, "NAL unit - Reserved" },
256 { 21, "NAL unit - Reserved" },
257 { 22, "NAL unit - Reserved" },
258 { 23, "NAL unit - Reserved" },
259 { 24, "STAP-A" }, /* Single-time aggregation packet */
260 { 25, "STAP-B" }, /* Single-time aggregation packet */
261 { 26, "MTAP16" }, /* Multi-time aggregation packet */
262 { 27, "MTAP24" }, /* Multi-time aggregation packet */
263 { 28, "FU-A" }, /* Fragmentation unit */
264 { 29, "FU-B" }, /* Fragmentation unit */
271 static const value_string h264_profile_idc_values
[] = {
272 { 66, "Baseline profile" },
273 { 77, "Main profile" },
274 { 88, "Extended profile" },
275 { 100, "High profile" },
276 { 110, "High 10 profile" },
277 { 122, "High 4:2:2 profile" },
278 { 144, "High 4:4:4 profile" },
282 /* Table A-1 - Level limits */
283 static const value_string h264_level_bitrate_values
[] = {
302 static const value_string h264_nal_unit_type_vals
[] = {
303 { 0, "Unspecified" },
304 { 1, "Coded slice of a non-IDR picture" },
305 { 2, "Coded slice data partition A" },
306 { 3, "Coded slice data partition B" },
307 { 4, "Coded slice data partition C" },
308 { 5, "Coded slice of an IDR picture" },
309 { 6, "Supplemental enhancement information (SEI)" },
310 { 7, "Sequence parameter set" },
311 { 8, "Picture parameter set" },
312 { 9, "Access unit delimiter" },
313 { 10, "End of sequence" },
314 { 11, "End of stream" },
315 { 12, "Filler data" },
316 { 13, "Sequence parameter set extension" },
322 { 19, "Coded slice of an auxiliary coded picture without partitioning" },
327 { 24, "Unspecified" },
328 { 25, "Unspecified" },
329 { 26, "Unspecified" },
330 { 27, "Unspecified" },
332 { 29, "Unspecified" },
333 { 30, "Unspecified" },
334 { 31, "Unspecified" },
338 static const value_string h264_slice_group_map_type_vals
[] = {
339 { 0, "Interleaved slice groups" },
340 { 1, "Dispersed slice group mapping" },
341 { 2, "One or more foreground slice groups and a leftover slice group" },
342 { 3, "Changing slice groups" },
343 { 4, "Changing slice groups" },
344 { 5, "Changing slice groups" },
345 { 6, "Explicit assignment of a slice group to each slice group map unit" },
349 /* Table 7-6 Name association to slice_type */
350 static const value_string h264_slice_type_vals
[] = {
351 { 0, "P (P slice)" },
352 { 1, "B (B slice)" },
353 { 2, "I (I slice)" },
354 { 3, "SP (SP slice)" },
355 { 4, "SI (SI slice)" },
356 { 5, "P (P slice)" },
357 { 6, "B (B slice)" },
358 { 7, "I (I slice)" },
359 { 8, "SP (SP slice)" },
360 { 9, "SI (SI slice)" },
364 /* byte_aligned( ) is specified as follows.
365 * - If the current position in the bitstream is on a byte boundary, i.e.,
366 * the next bit in the bitstream is the first bit in a byte,
367 * the return value of byte_aligned( ) is equal to TRUE.
368 * - Otherwise, the return value of byte_aligned( ) is equal to FALSE.
371 h264_byte_aligned(int bit_offset
)
379 /* Expect a tvb and a bit offset into the tvb
380 * returns the value and bit_offset
382 #define cVALS(x) (const value_string*)(x)
385 dissect_h264_exp_golomb_code(proto_tree
*tree
, int hf_index
, tvbuff_t
*tvb
, gint
*start_bit_offset
, h264_golomb_descriptors descriptor
)
386 /*(tvbuff_t *tvb, gint *start_bit_offset) */
388 gint leading_zero_bits
, bit_offset
, start_offset
;
389 guint32 codenum
, mask
, value
, tmp
;
395 header_field_info
*hf_field
= NULL
;
397 start_offset
= *start_bit_offset
>>3;
400 hf_field
= proto_registrar_get_nth(hf_index
);
402 bit_offset
= *start_bit_offset
;
404 /* prepare the string */
405 str
= (char *)wmem_alloc(wmem_packet_scope(), 256);
407 for (bit
=0; bit
<((int)(bit_offset
&0x07)); bit
++) {
408 if (bit
&& (!(bit
%4))) {
409 g_strlcat(str
, " ", 256);
411 g_strlcat(str
,".", 256);
415 leading_zero_bits
= -1;
416 for (b
= 0; !b
; leading_zero_bits
++) {
417 if (bit
&& (!(bit
%4))) {
418 g_strlcat(str
, " ", 256);
420 if (bit
&& (!(bit
%8))) {
421 g_strlcat(str
, " ", 256);
423 b
= tvb_get_bits8(tvb
, bit_offset
, 1);
425 g_strlcat(str
, "1", 256);
427 g_strlcat(str
, "0", 256);
433 if (leading_zero_bits
== 0) {
435 *start_bit_offset
= bit_offset
;
436 for (; bit
%8; bit
++) {
437 if (bit
&& (!(bit
%4))) {
438 g_strlcat(str
, " ", 256);
440 g_strlcat(str
,".", 256);
443 g_strlcat(str
," = ", 256);
444 g_strlcat(str
, hf_field
->name
, 256);
445 switch (descriptor
) {
447 /* if the syntax element is coded as se(v),
448 * the value of the syntax element is derived by invoking the
449 * mapping process for signed Exp-Golomb codes as specified in
450 * subclause 9.1.1 with codeNum as the input.
452 if (hf_field
->type
== FT_INT32
) {
453 if (hf_field
->strings
) {
454 proto_tree_add_int_format(tree
, hf_index
, tvb
, start_offset
, 1, codenum
,
457 val_to_str_const(codenum
, cVALS(hf_field
->strings
), "Unknown "),
460 switch (hf_field
->display
) {
462 proto_tree_add_int_format(tree
, hf_index
, tvb
, start_offset
, 1, codenum
,
468 DISSECTOR_ASSERT_NOT_REACHED();
477 if (hf_field
->type
== FT_UINT32
) {
478 if (hf_field
->strings
) {
479 proto_tree_add_uint_format(tree
, hf_index
, tvb
, start_offset
, 1, codenum
,
482 val_to_str_const(codenum
, cVALS(hf_field
->strings
), "Unknown "),
485 switch (hf_field
->display
) {
487 proto_tree_add_uint_format(tree
, hf_index
, tvb
, start_offset
, 1, codenum
,
493 proto_tree_add_uint_format(tree
, hf_index
, tvb
, start_offset
, 1, codenum
,
499 DISSECTOR_ASSERT_NOT_REACHED();
504 /* Only allow guint32 */
505 DISSECTOR_ASSERT_NOT_REACHED();
512 Syntax elements coded as ue(v), me(v), or se(v) are Exp-Golomb-coded. Syntax elements coded as te(v) are truncated
513 Exp-Golomb-coded. The parsing process for these syntax elements begins with reading the bits starting at the current
514 location in the bitstream up to and including the first non-zero bit, and counting the number of leading bits that are
515 equal to 0. This process is specified as follows:
516 leadingZeroBits = -1;
517 for (b = 0; !b; leadingZeroBits++)
519 The variable codeNum is then assigned as follows:
520 codeNum = 2leadingZeroBits - 1 + read_bits( leadingZeroBits )
521 where the value returned from read_bits( leadingZeroBits ) is interpreted as a binary representation of an unsigned
522 integer with most significant bit written first.
525 codenum
= codenum
<< leading_zero_bits
;
527 if (leading_zero_bits
> 32)
528 DISSECTOR_ASSERT_NOT_REACHED();
529 else if (leading_zero_bits
> 16)
530 value
= tvb_get_bits32(tvb
, bit_offset
, leading_zero_bits
, ENC_BIG_ENDIAN
);
531 else if (leading_zero_bits
> 8)
532 value
= tvb_get_bits16(tvb
, bit_offset
, leading_zero_bits
, ENC_BIG_ENDIAN
);
534 value
= tvb_get_bits8(tvb
, bit_offset
, leading_zero_bits
);
535 codenum
= (codenum
-1) + value
;
536 bit_offset
= bit_offset
+ leading_zero_bits
;
538 /* read the bits for the int */
539 for (i
=0; i
<leading_zero_bits
; i
++) {
540 if (bit
&& (!(bit
%4))) {
541 g_strlcat(str
, " ", 256);
543 if (bit
&& (!(bit
%8))) {
544 g_strlcat(str
, " ", 256);
549 g_strlcat(str
, "1", 256);
551 g_strlcat(str
, "0", 256);
555 for ( ; bit
%8; bit
++) {
556 if (bit
&& (!(bit
%4))) {
557 g_strlcat(str
, " ", 256);
559 g_strlcat(str
,".", 256);
562 switch (descriptor
) {
564 /* if the syntax element is coded as se(v),
565 * the value of the syntax element is derived by invoking the
566 * mapping process for signed Exp-Golomb codes as specified in
567 * subclause 9.1.1 with codeNum as the input.
571 se_value
= (codenum
+ 1) >> 1;
572 if (!(se_value
& 1)) {
573 se_value
= - se_value
;
581 g_strlcat(str
," = ", 256);
582 g_strlcat(str
, hf_field
->name
, 256);
583 switch (descriptor
) {
585 g_strlcat(str
,"(se(v))", 256);
586 /* if the syntax element is coded as se(v),
587 * the value of the syntax element is derived by invoking the
588 * mapping process for signed Exp-Golomb codes as specified in
589 * subclause 9.1.1 with codeNum as the input.
595 if ((hf_field
->type
== FT_UINT32
) && (descriptor
== H264_UE_V
)) {
596 if (hf_field
->strings
) {
597 proto_tree_add_uint_format(tree
, hf_index
, tvb
, start_offset
, 1, codenum
,
600 val_to_str_const(codenum
, cVALS(hf_field
->strings
), "Unknown "),
603 switch (hf_field
->display
) {
605 proto_tree_add_uint_format(tree
, hf_index
, tvb
, start_offset
, 1, codenum
,
611 proto_tree_add_uint_format(tree
, hf_index
, tvb
, start_offset
, 1, codenum
,
617 DISSECTOR_ASSERT_NOT_REACHED();
621 } else if ((hf_field
->type
== FT_INT32
) && (descriptor
== H264_SE_V
)) {
622 if (hf_field
->strings
) {
623 proto_tree_add_int_format(tree
, hf_index
, tvb
, start_offset
, 1, codenum
,
626 val_to_str_const(codenum
, cVALS(hf_field
->strings
), "Unknown "),
629 switch (hf_field
->display
) {
631 proto_tree_add_int_format(tree
, hf_index
, tvb
, start_offset
, 1, codenum
,
637 DISSECTOR_ASSERT_NOT_REACHED();
641 *start_bit_offset
= bit_offset
;
645 /* Only allow guint32 */
646 DISSECTOR_ASSERT_NOT_REACHED();
650 *start_bit_offset
= bit_offset
;
654 /* This function is adapted to parsing NAL units from SDP data where the
655 * base64 coding may add extra padding
659 more_rbsp_data(proto_tree
*tree _U_
, tvbuff_t
*tvb
, packet_info
*pinfo _U_
, gint bit_offset
)
662 int remaining_length
;
666 /* XXX might not be the best way of doing things but:
667 * Serch from the end of the tvb for the first '1' bit
668 * assuming that it's the RTBSP stop bit
671 /* Set offset to the byte we are treating */
672 offset
= bit_offset
>>3;
673 remaining_length
= tvb_length_remaining(tvb
, offset
);
674 /* If there is more then 2 bytes left there *should* be more data */
675 if (remaining_length
>2) {
678 /* Start from last bit */
679 last_one_bit
= (tvb_length(tvb
) << 3);
683 b
= tvb_get_bits8(tvb
, last_one_bit
, 1);
686 if (last_one_bit
== bit_offset
) {
694 dissect_h264_rbsp_trailing_bits(proto_tree
*tree
, tvbuff_t
*tvb
, packet_info
*pinfo _U_
, gint bit_offset
)
696 gint remaining_bits
=0;
698 proto_tree_add_bits_item(tree
, hf_h264_rbsp_stop_bit
, tvb
, bit_offset
, 1, ENC_BIG_ENDIAN
);
701 if ((bit_offset
&0x7) != 0) {
702 remaining_bits
= 8 - (bit_offset
&0x7);
703 proto_tree_add_bits_item(tree
, hf_h264_rbsp_trailing_bits
, tvb
, bit_offset
, remaining_bits
, ENC_BIG_ENDIAN
);
706 return bit_offset
+remaining_bits
;
710 * 7.3.3 Slice header syntax
712 * XXX Just parse a few bytes
715 dissect_h264_slice_header(proto_tree
*tree
, tvbuff_t
*tvb
, packet_info
*pinfo _U_
, gint bit_offset
)
717 /* first_mb_in_slice 2 ue(v) */
718 dissect_h264_exp_golomb_code(tree
, hf_h264_first_mb_in_slice
, tvb
, &bit_offset
, H264_UE_V
);
720 /* slice_type 2 ue(v) */
721 dissect_h264_exp_golomb_code(tree
, hf_h264_slice_type
, tvb
, &bit_offset
, H264_UE_V
);
723 /* pic_parameter_set_id 2 ue(v) */
724 dissect_h264_exp_golomb_code(tree
, hf_h264_pic_parameter_set_id
, tvb
, &bit_offset
, H264_UE_V
);
726 /* frame_num 2 u(v) */
728 * represented by log2_max_frame_num_minus4 + 4 bits in
730 * proto_tree_add_bits_item(tree, hf_h264_frame_num, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
736 /* 7.3.2.1.1 Scaling list syntax
738 * scaling_list( scalingList, sizeOfScalingList, useDefaultScalingMatrixFlag )
742 dissect_h264_scaling_list(proto_tree *tree, tvbuff_t *tvb, gint bit_offset, int hf_index_scalinglist,
743 guint8 sizeOfScalingList, int hf_index_usedefaultscalingmatrixflag)
746 guint8 lastScale = 8;
747 guint8 nextScale = 8:
750 for (j = 0; j < sizeOfScalingList; j++) {
751 if (nextScale != 0) {
752 / delta_scale 0 | 1 se(v) /
753 delta_scale = dissect_h264_exp_golomb_code(tree, hf_h264_delta_scale, tvb, &bit_offset);
754 nextScale = ( lastScale + delta_scale + 256 ) % 256;
755 useDefaultScalingMatrixFlag = ( j == 0 && nextScale == 0 );
757 scalingList[ j ] = ( nextScale == 0 ) ? lastScale : nextScale
758 lastScale = scalingList[ j ]
762 /* E.1.2 HRD parameters syntax */
764 dissect_h264_hrd_parameters(proto_tree
*tree
, tvbuff_t
*tvb
, packet_info
*pinfo _U_
, gint bit_offset
)
766 guint8 cpb_cnt_minus1
;
770 /* cpb_cnt_minus1 0 ue(v) */
771 cpb_cnt_minus1
= dissect_h264_exp_golomb_code(tree
, hf_h264_cpb_cnt_minus1
, tvb
, &bit_offset
, H264_UE_V
);
773 /* bit_rate_scale 0 u(4) */
774 proto_tree_add_bits_item(tree
, hf_h264_bit_rate_scale
, tvb
, bit_offset
, 4, ENC_BIG_ENDIAN
);
775 bit_offset
= bit_offset
+ 4;
777 /* cpb_size_scale 0 u(4) */
778 proto_tree_add_bits_item(tree
, hf_h264_cpb_size_scale
, tvb
, bit_offset
, 4, ENC_BIG_ENDIAN
);
779 bit_offset
= bit_offset
+ 4;
780 /* for (SchedSelIdx = 0; SchedSelIdx <= cpb_cnt_minus1; SchedSelIdx++) { */
781 for (SchedSelIdx
= 0; SchedSelIdx
<= cpb_cnt_minus1
; SchedSelIdx
++) {
783 /* bit_rate_value_minus1[ SchedSelIdx ] 0 ue(v) */
784 dissect_h264_exp_golomb_code(tree
, hf_h264_bit_rate_value_minus1
, tvb
, &bit_offset
, H264_UE_V
);
786 /* cpb_size_value_minus1[ SchedSelIdx ] 0 ue(v)*/
787 dissect_h264_exp_golomb_code(tree
, hf_h264_cpb_size_value_minus1
, tvb
, &bit_offset
, H264_UE_V
);
789 /* cbr_flag[ SchedSelIdx ] 0 u(1) */
790 proto_tree_add_bits_item(tree
, hf_h264_cbr_flag
, tvb
, bit_offset
, 1, ENC_BIG_ENDIAN
);
793 /* initial_cpb_removal_delay_length_minus1 0 u(5) */
794 proto_tree_add_bits_item(tree
, hf_h264_initial_cpb_removal_delay_length_minus1
, tvb
, bit_offset
, 5, ENC_BIG_ENDIAN
);
795 bit_offset
= bit_offset
+ 5;
797 /* cpb_removal_delay_length_minus1 0 u(5) */
798 proto_tree_add_bits_item(tree
, hf_h264_cpb_removal_delay_length_minus1
, tvb
, bit_offset
, 5, ENC_BIG_ENDIAN
);
799 bit_offset
= bit_offset
+ 5;
801 /* dpb_output_delay_length_minus1 0 u(5) */
802 proto_tree_add_bits_item(tree
, hf_h264_dpb_output_delay_length_minus11
, tvb
, bit_offset
, 5, ENC_BIG_ENDIAN
);
803 bit_offset
= bit_offset
+ 5;
805 /* time_offset_length 0 u(5) */
806 proto_tree_add_bits_item(tree
, hf_h264_time_offset_length
, tvb
, bit_offset
, 5, ENC_BIG_ENDIAN
);
807 bit_offset
= bit_offset
+ 5;
812 #define EXTENDED_SAR 255
814 /* E.1.1 VUI parameters syntax */
816 /* Table E-2 - Meaning of video_format */
817 static const value_string h264_video_format_vals
[] = {
818 { 22, "reserved_sei_message)" },
824 { 5, "Unspecified video format" },
831 dissect_h264_vui_parameters(proto_tree
*tree
, tvbuff_t
*tvb
, packet_info
*pinfo
, gint bit_offset
)
834 guint8 aspect_ratio_info_present_flag
, aspect_ratio_idc
, overscan_info_present_flag
;
835 guint8 video_signal_type_present_flag
, colour_description_present_flag
, chroma_loc_info_present_flag
;
836 guint8 timing_info_present_flag
, nal_hrd_parameters_present_flag
, vcl_hrd_parameters_present_flag
;
837 guint8 bitstream_restriction_flag
;
839 /* vui_parameters( ) {
840 * aspect_ratio_info_present_flag 0 u(1)
842 aspect_ratio_info_present_flag
= tvb_get_bits8(tvb
, bit_offset
, 1);
843 proto_tree_add_bits_item(tree
, hf_h264_aspect_ratio_info_present_flag
, tvb
, bit_offset
, 1, ENC_BIG_ENDIAN
);
846 if (aspect_ratio_info_present_flag
) {
847 /* aspect_ratio_idc 0 u(8) */
848 aspect_ratio_idc
= tvb_get_bits8(tvb
, bit_offset
, 8);
849 proto_tree_add_bits_item(tree
, hf_h264_aspect_ratio_idc
, tvb
, bit_offset
, 8, ENC_BIG_ENDIAN
);
850 bit_offset
= bit_offset
+ 8;
852 if (aspect_ratio_idc
== EXTENDED_SAR
) {
853 /* sar_width 0 u(16) */
854 proto_tree_add_bits_item(tree
, hf_h264_sar_width
, tvb
, bit_offset
, 16, ENC_BIG_ENDIAN
);
855 bit_offset
= bit_offset
+ 16;
857 /* sar_height 0 u(16) */
858 proto_tree_add_bits_item(tree
, hf_h264_sar_height
, tvb
, bit_offset
, 16, ENC_BIG_ENDIAN
);
859 bit_offset
= bit_offset
+ 16;
862 /* overscan_info_present_flag 0 u(1) */
863 overscan_info_present_flag
= tvb_get_bits8(tvb
, bit_offset
, 1);
864 proto_tree_add_bits_item(tree
, hf_h264_overscan_info_present_flag
, tvb
, bit_offset
, 1, ENC_BIG_ENDIAN
);
867 if (overscan_info_present_flag
) {
868 /* overscan_appropriate_flag 0 u(1) */
869 proto_tree_add_bits_item(tree
, hf_h264_overscan_appropriate_flag
, tvb
, bit_offset
, 1, ENC_BIG_ENDIAN
);
873 /* video_signal_type_present_flag 0 u(1) */
874 video_signal_type_present_flag
= tvb_get_bits8(tvb
, bit_offset
, 1);
875 proto_tree_add_bits_item(tree
, hf_h264_video_signal_type_present_flag
, tvb
, bit_offset
, 1, ENC_BIG_ENDIAN
);
878 if (video_signal_type_present_flag
) {
879 /* video_format 0 u(3) > */
880 proto_tree_add_bits_item(tree
, hf_h264_video_format
, tvb
, bit_offset
, 3, ENC_BIG_ENDIAN
);
881 bit_offset
= bit_offset
+ 3;
883 /* video_full_range_flag 0 u(1)*/
884 proto_tree_add_bits_item(tree
, hf_h264_video_full_range_flag
, tvb
, bit_offset
, 1, ENC_BIG_ENDIAN
);
887 /* colour_description_present_flag 0 u(1) */
888 colour_description_present_flag
= tvb_get_bits8(tvb
, bit_offset
, 1);
889 proto_tree_add_bits_item(tree
, hf_h264_colour_description_present_flag
, tvb
, bit_offset
, 1, ENC_BIG_ENDIAN
);
892 if (colour_description_present_flag
) {
893 /* colour_primaries 0 u(8) */
894 proto_tree_add_bits_item(tree
, hf_h264_colour_primaries
, tvb
, bit_offset
, 8, ENC_BIG_ENDIAN
);
895 bit_offset
= bit_offset
+ 8;
897 /* transfer_characteristics 0 u(8) */
898 proto_tree_add_bits_item(tree
, hf_h264_transfer_characteristics
, tvb
, bit_offset
, 8, ENC_BIG_ENDIAN
);
899 bit_offset
= bit_offset
+ 8;
901 /* matrix_coefficients 0 u(8)*/
902 proto_tree_add_bits_item(tree
, hf_h264_matrix_coefficients
, tvb
, bit_offset
, 8, ENC_BIG_ENDIAN
);
903 bit_offset
= bit_offset
+ 8;
907 /* chroma_loc_info_present_flag 0 u(1) */
908 chroma_loc_info_present_flag
= tvb_get_bits8(tvb
, bit_offset
, 1);
909 proto_tree_add_bits_item(tree
, hf_h264_chroma_loc_info_present_flag
, tvb
, bit_offset
, 1, ENC_BIG_ENDIAN
);
912 if (chroma_loc_info_present_flag
) {
913 /* chroma_sample_loc_type_top_field 0 ue(v) */
914 dissect_h264_exp_golomb_code(tree
, hf_h264_chroma_sample_loc_type_top_field
, tvb
, &bit_offset
, H264_UE_V
);
916 /* chroma_sample_loc_type_bottom_field 0 ue(v) */
917 dissect_h264_exp_golomb_code(tree
, hf_h264_chroma_sample_loc_type_bottom_field
, tvb
, &bit_offset
, H264_UE_V
);
920 /* timing_info_present_flag 0 u(1) */
921 timing_info_present_flag
= tvb_get_bits8(tvb
, bit_offset
, 1);
922 proto_tree_add_bits_item(tree
, hf_h264_timing_info_present_flag
, tvb
, bit_offset
, 1, ENC_BIG_ENDIAN
);
925 if (timing_info_present_flag
) {
926 /* num_units_in_tick 0 u(32) */
927 proto_tree_add_bits_item(tree
, hf_h264_num_units_in_tick
, tvb
, bit_offset
, 32, ENC_BIG_ENDIAN
);
928 bit_offset
= bit_offset
+ 32;
930 /* time_scale 0 u(32) */
931 proto_tree_add_bits_item(tree
, hf_h264_time_scale
, tvb
, bit_offset
, 32, ENC_BIG_ENDIAN
);
932 bit_offset
= bit_offset
+ 32;
934 /* fixed_frame_rate_flag 0 u(1) */
935 proto_tree_add_bits_item(tree
, hf_h264_fixed_frame_rate_flag
, tvb
, bit_offset
, 1, ENC_BIG_ENDIAN
);
938 /* nal_hrd_parameters_present_flag 0 u(1) */
939 nal_hrd_parameters_present_flag
= tvb_get_bits8(tvb
, bit_offset
, 1);
940 proto_tree_add_bits_item(tree
, hf_h264_nal_hrd_parameters_present_flag
, tvb
, bit_offset
, 1, ENC_BIG_ENDIAN
);
943 if (nal_hrd_parameters_present_flag
) {
944 /* hrd_parameters( ) */
945 bit_offset
= dissect_h264_hrd_parameters(tree
, tvb
, pinfo
, bit_offset
);
948 /* vcl_hrd_parameters_present_flag 0 u(1) */
949 vcl_hrd_parameters_present_flag
= tvb_get_bits8(tvb
, bit_offset
, 1);
950 proto_tree_add_bits_item(tree
, hf_h264_vcl_hrd_parameters_present_flag
, tvb
, bit_offset
, 1, ENC_BIG_ENDIAN
);
953 if (vcl_hrd_parameters_present_flag
) {
954 /* hrd_parameters( ) */
955 bit_offset
= dissect_h264_hrd_parameters(tree
, tvb
, pinfo
, bit_offset
);
957 if (nal_hrd_parameters_present_flag
|| vcl_hrd_parameters_present_flag
) {
958 /* low_delay_hrd_flag 0 u(1) */
959 proto_tree_add_bits_item(tree
, hf_h264_low_delay_hrd_flag
, tvb
, bit_offset
, 1, ENC_BIG_ENDIAN
);
962 /* pic_struct_present_flag 0 u(1) */
963 proto_tree_add_bits_item(tree
, hf_h264_pic_struct_present_flag
, tvb
, bit_offset
, 1, ENC_BIG_ENDIAN
);
966 /* bitstream_restriction_flag 0 u(1) */
967 bitstream_restriction_flag
= tvb_get_bits8(tvb
, bit_offset
, 1);
968 proto_tree_add_bits_item(tree
, hf_h264_bitstream_restriction_flag
, tvb
, bit_offset
, 1, ENC_BIG_ENDIAN
);
971 if (bitstream_restriction_flag
) {
972 /* motion_vectors_over_pic_boundaries_flag 0 u(1) */
973 proto_tree_add_bits_item(tree
, hf_h264_motion_vectors_over_pic_boundaries_flag
, tvb
, bit_offset
, 1, ENC_BIG_ENDIAN
);
976 /* max_bytes_per_pic_denom 0 ue(v) */
977 dissect_h264_exp_golomb_code(tree
, hf_h264_max_bytes_per_pic_denom
, tvb
, &bit_offset
, H264_UE_V
);
979 /* max_bits_per_mb_denom 0 ue(v) */
980 dissect_h264_exp_golomb_code(tree
, hf_h264_max_bits_per_mb_denom
, tvb
, &bit_offset
, H264_UE_V
);
982 /* log2_max_mv_length_horizontal 0 ue(v) */
983 dissect_h264_exp_golomb_code(tree
, hf_h264_log2_max_mv_length_horizontal
, tvb
, &bit_offset
, H264_UE_V
);
985 /* log2_max_mv_length_vertical 0 ue(v) */
986 dissect_h264_exp_golomb_code(tree
, hf_h264_log2_max_mv_length_vertical
, tvb
, &bit_offset
, H264_UE_V
);
988 /* num_reorder_frames 0 ue(v) */
989 dissect_h264_exp_golomb_code(tree
, hf_h264_num_reorder_frames
, tvb
, &bit_offset
, H264_UE_V
);
991 /* max_dec_frame_buffering 0 ue(v) */
992 dissect_h264_exp_golomb_code(tree
, hf_h264_max_dec_frame_buffering
, tvb
, &bit_offset
, H264_UE_V
);
998 /* Used To dissect SDP parameter (H.264)profile */
1000 dissect_h264_profile(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
)
1002 proto_item
*item
, *level_item
;
1003 proto_tree
*h264_profile_tree
;
1005 guint8 constraint_set3_flag
;
1008 item
= proto_tree_add_item(tree
, hf_h264_profile
, tvb
, offset
, -1, ENC_NA
);
1009 h264_profile_tree
= proto_item_add_subtree(item
, ett_h264_profile
);
1011 proto_tree_add_item(h264_profile_tree
, hf_h264_profile_idc
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1014 constraint_set3_flag
= (tvb_get_guint8(tvb
, offset
)&0x10)>>4;
1015 proto_tree_add_item(h264_profile_tree
, hf_h264_constraint_set0_flag
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1016 proto_tree_add_item(h264_profile_tree
, hf_h264_constraint_set1_flag
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1017 proto_tree_add_item(h264_profile_tree
, hf_h264_constraint_set2_flag
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1018 proto_tree_add_item(h264_profile_tree
, hf_h264_constraint_set3_flag
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1019 proto_tree_add_item(h264_profile_tree
, hf_h264_reserved_zero_4bits
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1022 /* A level to which the bitstream conforms shall be indicated by the syntax element level_idc as follows.
1023 * - If level_idc is equal to 11 and constraint_set3_flag is equal to 1, the indicated level is level 1b.
1024 * - Otherwise (level_idc is not equal to 11 or constraint_set3_flag is not equal to 1), level_idc shall
1025 * be set equal to a value of ten times the level number specified in Table A-1 and constraint_set3_flag
1026 * shall be set equal to 0.
1029 level_idc
= tvb_get_guint8(tvb
, offset
);
1030 level_item
= proto_tree_add_item(h264_profile_tree
, hf_h264_level_idc
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1031 if ((level_idc
== 11) && (constraint_set3_flag
== 1)) {
1032 proto_item_append_text(level_item
," [Level 1b (128kb/s)]");
1034 proto_item_append_text(level_item
," [Level %.1f %s]", ((double)level_idc
/10), val_to_str_const(level_idc
, h264_level_bitrate_values
, "Unknown "));
1039 * 7.3.1 NAL unit syntax
1040 * Un escape the NAL tvb
1043 * nal_unit( NumBytesInNALunit ) { C Descriptor
1044 * forbidden_zero_bit All f(1)
1045 * nal_ref_idc All u(2)
1046 * nal_unit_type All u(5)
1047 * NumBytesInRBSP = 0
1048 * for (i = 1; i < NumBytesInNALunit; i++) {
1049 * if (i + 2 < NumBytesInNALunit && next_bits( 24 ) = = 0x000003 ) {
1050 * rbsp_byte[ NumBytesInRBSP++ ] All b(8)
1051 * rbsp_byte[ NumBytesInRBSP++ ] All b(8)
1053 * emulation_prevention_three_byte / * equal to 0x03 * / All f(8)
1055 * rbsp_byte[ NumBytesInRBSP++ ] All b(8)
1061 dissect_h265_unescap_nal_unit(tvbuff_t
*tvb
, packet_info
*pinfo
, int offset
)
1064 int length
= tvb_length_remaining(tvb
, offset
);
1065 int NumBytesInRBSP
= 0;
1069 buff
= (gchar
*)wmem_alloc(pinfo
->pool
, length
);
1070 for (i
= 0; i
< length
; i
++) {
1071 if ((i
+ 2 < length
) && (tvb_get_ntoh24(tvb
, offset
) == 0x000003)) {
1072 buff
[NumBytesInRBSP
++] = tvb_get_guint8(tvb
, offset
);
1073 buff
[NumBytesInRBSP
++] = tvb_get_guint8(tvb
, offset
+1);
1077 buff
[ NumBytesInRBSP
++] = tvb_get_guint8(tvb
, offset
);
1082 tvb_rbsp
= tvb_new_child_real_data(tvb
, buff
, NumBytesInRBSP
, NumBytesInRBSP
);
1083 add_new_data_source(pinfo
, tvb_rbsp
, "Unescaped RSP Data");
1089 * 7.3.2.8 Slice layer without partitioning RBSP syntax
1090 * slice_layer_without_partitioning_rbsp( )
1094 dissect_h264_slice_layer_without_partitioning_rbsp(proto_tree
*tree
, tvbuff_t
*tvb
, packet_info
*pinfo
, gint offset
)
1098 bit_offset
= offset
<<3;
1100 /* slice_header( ) 2 */
1101 bit_offset
= dissect_h264_slice_header(tree
, tvb
, pinfo
, bit_offset
);
1102 proto_tree_add_expert(tree
, pinfo
, &ei_h264_undecoded
, tvb
, bit_offset
>>3, -1);
1104 /* slice_data( ) * all categories of slice_data( ) syntax * 2 | 3 | 4 */
1105 /* rbsp_slice_trailing_bits( ) */
1109 * 7.3.2.9.1 Slice data partition A RBSP syntax
1110 * slice_data_partition_a_layer_rbsp( )
1113 dissect_h264_slice_data_partition_a_layer_rbsp(proto_tree
*tree
, tvbuff_t
*tvb
, packet_info
*pinfo _U_
, gint offset
)
1117 bit_offset
= offset
<<3;
1119 /* slice_header( ) 2 */
1120 bit_offset
= dissect_h264_slice_header(tree
, tvb
, pinfo
, bit_offset
);
1122 /* slice_id All ue(v) */
1123 dissect_h264_exp_golomb_code(tree
, hf_h264_slice_id
, tvb
, &bit_offset
, H264_UE_V
);
1124 proto_tree_add_expert(tree
, pinfo
, &ei_h264_undecoded
, tvb
, bit_offset
>>3, -1);
1126 /* slice_data( ) * only category 2 parts of slice_data( ) syntax * 2*/
1127 /* rbsp_slice_trailing_bits( )*/
1131 * 7.3.2.9.2 Slice data partition B RBSP syntax
1132 * slice_data_partition_b_layer_rbsp(
1135 dissect_h264_slice_data_partition_b_layer_rbsp(proto_tree
*tree
, tvbuff_t
*tvb
, packet_info
*pinfo _U_
, gint offset
)
1139 bit_offset
= offset
<<3;
1141 /* slice_id All ue(v) */
1142 dissect_h264_exp_golomb_code(tree
, hf_h264_slice_id
, tvb
, &bit_offset
, H264_UE_V
);
1143 /* if (redundant_pic_cnt_present_flag) */
1144 /* redundant_pic_cnt All ue(v) */
1145 /* slice_data( ) * only category 3 parts of slice_data( ) syntax * 3 */
1146 /* rbsp_slice_trailing_bits( ) 3 */
1147 proto_tree_add_expert(tree
, pinfo
, &ei_h264_undecoded
, tvb
, bit_offset
>>3, -1);
1152 * 7.3.2.9.3 Slice data partition C RBSP syntax
1153 * slice_data_partition_c_layer_rbsp( )
1156 dissect_h264_slice_data_partition_c_layer_rbsp(proto_tree
*tree
, tvbuff_t
*tvb
, packet_info
*pinfo _U_
, gint offset
)
1160 bit_offset
= offset
<<3;
1162 /* slice_id All ue(v) */
1163 dissect_h264_exp_golomb_code(tree
, hf_h264_slice_id
, tvb
, &bit_offset
, H264_UE_V
);
1164 /* if (redundant_pic_cnt_present_flag) */
1165 /* redundant_pic_cnt All ue(v) */
1166 /* slice_data( ) * only category 4 parts of slice_data( ) syntax * 4 */
1167 /* rbsp_slice_trailing_bits( ) 4 */
1168 proto_tree_add_expert(tree
, pinfo
, &ei_h264_undecoded
, tvb
, bit_offset
>>3, -1);
1171 /* D.1.6 User data unregistered SEI message syntax */
1174 h264_user_data_unregistered(proto_tree
*tree
, tvbuff_t
*tvb
, packet_info
*pinfo _U_
, gint bit_offset
, guint32 payloadSize
)
1176 /* user_data_unregistered( payloadSize ) { C Descriptor */
1177 /* uuid_iso_iec_11578 5 u(128)
1178 * uuid_iso_iec_11578 shall have a value specified as a UUID
1179 * according to the procedures of ISO/IEC 11578:1996 Annex A.
1181 proto_tree_add_text(tree
, tvb
, bit_offset
>>3, 16, "uuid_iso_iec_1157");
1183 /* for (i = 16; i < payloadSize; i++)
1184 * user_data_payload_byte 5 b(8)
1186 proto_tree_add_text(tree
, tvb
, bit_offset
>>3, payloadSize
-16, "user_data_payload");
1187 bit_offset
+=(payloadSize
-16)<<3;
1192 /* D.1 SEI payload syntax */
1193 static const value_string h264_sei_payload_vals
[] = {
1194 { 0, "buffering_period" },
1195 { 1, "pic_timing" },
1196 { 2, "pan_scan_rect" },
1197 { 3, "filler_payload" },
1198 { 4, "user_data_registered_itu_t_t35" },
1199 { 5, "user_data_unregistered" },
1200 { 6, "recovery_point" },
1201 { 7, "dec_ref_pic_marking_repetition" },
1203 { 9, "scene_inf)" },
1204 { 10, "sub_seq_info)" },
1205 { 11, "sub_seq_layer_characteristics" },
1206 { 12, "sub_seq_characteristics" },
1207 { 13, "full_frame_freeze_release" },
1208 { 14, "full_frame_freeze_release" },
1209 { 15, "full_frame_snapshot" },
1210 { 16, "progressive_refinement_segment_start" },
1211 { 17, "progressive_refinement_segment_end" },
1212 { 18, "motion_constrained_slice_group_set" },
1213 { 19, "film_grain_characteristics)" },
1214 { 20, "deblocking_filter_display_preference)" },
1215 { 21, "stereo_video_info)" },
1216 { 22, "reserved_sei_message)" },
1221 h264_sei_payload(proto_tree
*tree
, tvbuff_t
*tvb
, packet_info
*pinfo _U_
, gint bit_offset
, guint32 payloadType
, guint32 payloadSize
)
1223 /* sei_payload( payloadType, payloadSize ) { C Descriptor */
1224 if (payloadType
== 0) {
1225 /* buffering_period( payloadSize ) 5 */
1226 bit_offset
= bit_offset
+(payloadSize
<<3);
1228 } else if (payloadType
== 1) {
1229 /* pic_timing( payloadSize ) 5 */
1230 } else if (payloadType
== 2) {
1231 /* pan_scan_rect( payloadSize ) 5 */
1232 } else if (payloadType
== 3) {
1233 /* filler_payload( payloadSize ) 5 */
1234 } else if (payloadType
== 4) {
1235 /* user_data_registered_itu_t_t35( payloadSize ) 5 */
1237 } else if (payloadType
== 5) {
1238 /* user_data_unregistered( payloadSize ) 5 */
1239 bit_offset
= h264_user_data_unregistered( tree
, tvb
, pinfo
, bit_offset
, payloadSize
);
1240 } else if (payloadType
== 6) {
1241 /* recovery_point( payloadSize ) 5 */
1242 bit_offset
= bit_offset
+(payloadSize
<<3);
1243 } else if (payloadType
== 7) {
1244 /* dec_ref_pic_marking_repetition( payloadSize ) 5 */
1245 bit_offset
= bit_offset
+(payloadSize
<<3);
1248 else if (payloadType
== 8)
1249 spare_pic( payloadSize
) 5
1250 else if (payloadType
== 9)
1251 scene_info( payloadSize
) 5
1252 else if (payloadType
== 10)
1253 sub_seq_info( payloadSize
) 5
1254 else if (payloadType
== 11)
1255 sub_seq_layer_characteristics( payloadSize
) 5
1256 else if (payloadType
== 12)
1257 sub_seq_characteristics( payloadSize
) 5
1258 else if (payloadType
== 13)
1259 full_frame_freeze( payloadSize
) 5
1260 else if (payloadType
== 14)
1261 full_frame_freeze_release( payloadSize
) 5
1262 else if (payloadType
== 15)
1263 full_frame_snapshot( payloadSize
) 5
1264 else if (payloadType
== 16)
1265 progressive_refinement_segment_start( payloadSize
) 5
1266 else if (payloadType
== 17)
1267 progressive_refinement_segment_end( payloadSize
) 5
1268 else if (payloadType
== 18)
1269 motion_constrained_slice_group_set( payloadSize
) 5
1270 else if (payloadType
== 19)
1271 film_grain_characteristics( payloadSize
) 5
1272 else if (payloadType
== 20)
1273 deblocking_filter_display_preference( payloadSize
) 5
1274 else if (payloadType
== 21)
1275 stereo_video_info( payloadSize
) 5
1277 reserved_sei_message( payloadSize
) 5
1280 if (!h264_byte_aligned(bit_offset
)) {
1281 /* bit_equal_to_one / * equal to 1 * / 5 f(1) */
1282 /* TODO:Display the filler and, error if not 1 ?? */
1284 while (!h264_byte_aligned(bit_offset
)) {
1285 /* bit_equal_to_zero / * equal to 0 * / 5 f(1) */
1286 /* TODO:Display the filler and, error if not 0 ?? */
1294 * 7.3.2.3.1 Supplemental enhancement information message syntax
1297 dissect_h264_sei_message(proto_tree
*tree
, tvbuff_t
*tvb
, packet_info
*pinfo
, gint bit_offset
)
1299 /* sei_message( ) { C Descriptor */
1300 guint32 payloadType
= 0, payloadSize
;
1301 gint start_bit_offset
, length
;
1303 start_bit_offset
= bit_offset
;
1305 /* while (next_bits( 8 ) == 0xFF) { */
1306 while (tvb_get_bits8(tvb
, bit_offset
, 8) == 0xFF) {
1307 /* ff_byte / * equal to 0xFF * / 5 f(8) */
1311 /* last_payload_type_byte 5 u(8) */
1312 payloadType
+= tvb_get_bits8(tvb
, bit_offset
, 8);
1314 length
= (bit_offset
- start_bit_offset
)>>3;
1316 proto_tree_add_uint(tree
, hf_h264_payloadtype
, tvb
, start_bit_offset
>>3, length
, payloadType
);
1319 start_bit_offset
= bit_offset
;
1320 /* while (next_bits( 8 ) == 0xFF) { */
1321 while (tvb_get_bits8(tvb
, bit_offset
, 8) == 0xFF) {
1322 /* ff_byte / * equal to 0xFF * / 5 f(8) */
1326 /* last_payload_size_byte 5 u(8) */
1327 /* payloadSize += last_payload_size_byte */
1328 payloadSize
+= tvb_get_bits8(tvb
, bit_offset
, 8);
1330 length
= (bit_offset
- start_bit_offset
)>>3;
1331 proto_tree_add_uint(tree
, hf_h264_payloadsize
, tvb
, start_bit_offset
>>3, length
, payloadSize
);
1333 /*sei_payload( payloadType, payloadSize ) 5 */
1334 bit_offset
= h264_sei_payload( tree
, tvb
, pinfo
, bit_offset
, payloadType
, payloadSize
);
1339 * 7.3.2.3 Supplemental enhancement information RBSP syntax
1343 dissect_h264_sei_rbsp(proto_tree
*tree
, tvbuff_t
*tvb
, packet_info
*pinfo _U_
, gint offset
)
1347 bit_offset
= offset
<<3;
1349 /* sei_message( ) 5*/
1350 bit_offset
= dissect_h264_sei_message( tree
, tvb
, pinfo
, bit_offset
);
1352 /* while (more_rbsp_data( ))
1353 * If there is more data in an RBSP before rbsp_trailing_bits( ),
1354 * the return value of more_rbsp_data( ) is equal to TRUE.
1356 /* rbsp_trailing_bits( ) 5 */
1357 bit_offset
= dissect_h264_rbsp_trailing_bits(tree
, tvb
, pinfo
, bit_offset
);
1362 /* Ref 7.3.2.1 Sequence parameter set RBSP syntax */
1364 dissect_h264_seq_parameter_set_rbsp(proto_tree
*tree
, tvbuff_t
*tvb
, packet_info
*pinfo
, gint offset
)
1366 proto_item
*level_item
;
1368 guint8 constraint_set3_flag
;
1372 guint8 profile_idc
, chroma_format_idc
, frame_mbs_only_flag
, frame_cropping_flag
;
1373 guint8 pic_order_cnt_type
, vui_parameters_present_flag
, num_ref_frames_in_pic_order_cnt_cycle
;
1374 guint8 seq_scaling_matrix_present_flag
; /* seq_scaling_list_present_flag */
1376 /* profile_idc 0 u(8) */
1377 profile_idc
= tvb_get_guint8(tvb
, offset
);
1378 proto_tree_add_item(tree
, hf_h264_profile_idc
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1381 constraint_set3_flag
= (tvb_get_guint8(tvb
, offset
)&0x10)>>4;
1382 /* constraint_set0_flag 0 u(1) */
1383 proto_tree_add_item(tree
, hf_h264_constraint_set0_flag
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1385 /* constraint_set1_flag 0 u(1) */
1386 proto_tree_add_item(tree
, hf_h264_constraint_set1_flag
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1388 /* constraint_set2_flag 0 u(1) */
1389 proto_tree_add_item(tree
, hf_h264_constraint_set2_flag
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1391 /* constraint_set3_flag 0 u(1) */
1392 proto_tree_add_item(tree
, hf_h264_constraint_set3_flag
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1394 /* reserved_zero_4bits equal to 0 0 u(4)*/
1395 proto_tree_add_item(tree
, hf_h264_reserved_zero_4bits
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1398 /* level_idc 0 u(8) */
1399 level_idc
= tvb_get_guint8(tvb
, offset
);
1400 level_item
= proto_tree_add_item(tree
, hf_h264_level_idc
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1401 if ((level_idc
== 11) && (constraint_set3_flag
== 1)) {
1402 proto_item_append_text(level_item
,"[Level 1b]");
1404 proto_item_append_text(level_item
," [Level %.1f %s]", ((double)level_idc
/10), val_to_str_const(level_idc
, h264_level_bitrate_values
, "Unknown "));
1407 /* seq_parameter_set_id 0 ue(v)
1408 * ue(v): unsigned integer Exp-Golomb-coded syntax element with the left bit first.
1409 * The parsing process for this descriptor is specified in subclause 9.1.
1411 bit_offset
= offset
<<3;
1412 dissect_h264_exp_golomb_code(tree
, hf_h264_seq_parameter_set_id
, tvb
, &bit_offset
, H264_UE_V
);
1415 if ((profile_idc
== 100) || (profile_idc
== 110) ||
1416 (profile_idc
== 122) || (profile_idc
== 144)) {
1418 /* chroma_format_idc 0 ue(v) */
1419 chroma_format_idc
= dissect_h264_exp_golomb_code(tree
, hf_h264_chroma_format_idc
, tvb
, &bit_offset
, H264_UE_V
);
1420 if (chroma_format_idc
== 3) {
1421 /* residual_colour_transform_flag 0 u(1) */
1422 proto_tree_add_bits_item(tree
, hf_h264_residual_colour_transform_flag
, tvb
, bit_offset
, 1, ENC_BIG_ENDIAN
);
1426 /* bit_depth_luma_minus8 0 ue(v) */
1427 dissect_h264_exp_golomb_code(tree
, hf_h264_bit_depth_luma_minus8
, tvb
, &bit_offset
, H264_UE_V
);
1429 /* bit_depth_chroma_minus8 0 ue(v) */
1430 dissect_h264_exp_golomb_code(tree
, hf_h264_bit_depth_chroma_minus8
, tvb
, &bit_offset
, H264_UE_V
);
1432 /* qpprime_y_zero_transform_bypass_flag 0 u(1) */
1433 proto_tree_add_bits_item(tree
, hf_h264_qpprime_y_zero_transform_bypass_flag
, tvb
, bit_offset
, 1, ENC_BIG_ENDIAN
);
1436 /* seq_scaling_matrix_present_flag 0 u(1) */
1437 seq_scaling_matrix_present_flag
= tvb_get_bits8(tvb
, bit_offset
, 1);
1438 proto_tree_add_bits_item(tree
, hf_h264_seq_scaling_matrix_present_flag
, tvb
, bit_offset
, 1, ENC_BIG_ENDIAN
);
1441 if (seq_scaling_matrix_present_flag
) {
1443 for (i = 0; i < 8; i++) {
1444 / seq_scaling_list_present_flag[ i ] 0 u(1) /
1445 seq_scaling_list_present_flag = tvb_get_bits8(tvb, bit_offset, 1);
1447 if (seq_scaling_list_present_flag) {
1449 scaling_list( ScalingList4x4[ i ], 16, UseDefaultScalingMatrix4x4Flag[ i ])0
1450 dissect_h264_scaling_list()
1452 scaling_list( ScalingList8x8[ i - 6 ], 64, UseDefaultScalingMatrix8x8Flag[ i - 6 ] )0
1456 proto_tree_add_expert(tree
, pinfo
, &ei_h264_undecoded
, tvb
, offset
, -1);
1462 /* log2_max_frame_num_minus4 0 ue(v) */
1463 dissect_h264_exp_golomb_code(tree
, hf_h264_log2_max_frame_num_minus4
, tvb
, &bit_offset
, H264_UE_V
);
1465 /* pic_order_cnt_type 0 ue(v) */
1466 pic_order_cnt_type
= dissect_h264_exp_golomb_code(tree
, hf_h264_pic_order_cnt_type
, tvb
, &bit_offset
, H264_UE_V
);
1468 if (pic_order_cnt_type
== 0) {
1469 /* log2_max_pic_order_cnt_lsb_minus4 0 ue(v) */
1470 dissect_h264_exp_golomb_code(tree
, hf_h264_log2_max_pic_order_cnt_lsb_minus4
, tvb
, &bit_offset
, H264_UE_V
);
1471 } else if (pic_order_cnt_type
== 1) {
1472 /* delta_pic_order_always_zero_flag 0 u(1) */
1473 proto_tree_add_bits_item(tree
, hf_h264_delta_pic_order_always_zero_flag
, tvb
, bit_offset
, 1, ENC_BIG_ENDIAN
);
1476 /* offset_for_non_ref_pic 0 se(v) */
1477 dissect_h264_exp_golomb_code(tree
, hf_h264_offset_for_non_ref_pic
, tvb
, &bit_offset
, H264_SE_V
);
1479 /* offset_for_top_to_bottom_field 0 se(v) */
1480 dissect_h264_exp_golomb_code(tree
, hf_h264_offset_for_top_to_bottom_field
, tvb
, &bit_offset
, H264_SE_V
);
1482 /* num_ref_frames_in_pic_order_cnt_cycle 0 ue(v) */
1483 num_ref_frames_in_pic_order_cnt_cycle
= dissect_h264_exp_golomb_code(tree
, hf_h264_num_ref_frames_in_pic_order_cnt_cycle
, tvb
, &bit_offset
, H264_UE_V
);
1484 for (i
= 0; i
< num_ref_frames_in_pic_order_cnt_cycle
; i
++) {
1485 /*offset_for_ref_frame[ i ] 0 se(v)*/
1486 dissect_h264_exp_golomb_code(tree
, hf_h264_offset_for_ref_frame
, tvb
, &bit_offset
, H264_SE_V
);
1489 /* num_ref_frames 0 ue(v) */
1490 dissect_h264_exp_golomb_code(tree
, hf_h264_num_ref_frames
, tvb
, &bit_offset
, H264_UE_V
);
1492 /* gaps_in_frame_num_value_allowed_flag 0 u(1) */
1493 proto_tree_add_bits_item(tree
, hf_h264_gaps_in_frame_num_value_allowed_flag
, tvb
, bit_offset
, 1, ENC_BIG_ENDIAN
);
1496 /* pic_width_in_mbs_minus1 0 ue(v) */
1497 dissect_h264_exp_golomb_code(tree
, hf_h264_pic_width_in_mbs_minus1
, tvb
, &bit_offset
, H264_UE_V
);
1499 /* pic_height_in_map_units_minus1 0 ue(v) */
1500 dissect_h264_exp_golomb_code(tree
, hf_h264_pic_height_in_map_units_minus1
, tvb
, &bit_offset
, H264_UE_V
);
1502 /* frame_mbs_only_flag 0 u(1) */
1503 frame_mbs_only_flag
= tvb_get_bits8(tvb
, bit_offset
, 1);
1504 proto_tree_add_bits_item(tree
, hf_h264_frame_mbs_only_flag
, tvb
, bit_offset
, 1, ENC_BIG_ENDIAN
);
1506 if (!frame_mbs_only_flag
) {
1507 /* mb_adaptive_frame_field_flag 0 u(1) */
1508 proto_tree_add_bits_item(tree
, hf_h264_mb_adaptive_frame_field_flag
, tvb
, bit_offset
, 1, ENC_BIG_ENDIAN
);
1512 /* direct_8x8_inference_flag 0 u(1) */
1513 proto_tree_add_bits_item(tree
, hf_h264_direct_8x8_inference_flag
, tvb
, bit_offset
, 1, ENC_BIG_ENDIAN
);
1516 /* frame_cropping_flag 0 u(1) */
1517 frame_cropping_flag
= tvb_get_bits8(tvb
, bit_offset
, 1);
1518 proto_tree_add_bits_item(tree
, hf_h264_frame_cropping_flag
, tvb
, bit_offset
, 1, ENC_BIG_ENDIAN
);
1521 if (frame_cropping_flag
) {
1522 /* frame_crop_left_offset 0 ue(v) */
1523 dissect_h264_exp_golomb_code(tree
, hf_h264_frame_crop_left_offset
, tvb
, &bit_offset
, H264_UE_V
);
1524 dissect_h264_exp_golomb_code(tree
, hf_h264_frame_crop_right_offset
, tvb
, &bit_offset
, H264_UE_V
);
1525 dissect_h264_exp_golomb_code(tree
, hf_h264_frame_crop_top_offset
, tvb
, &bit_offset
, H264_UE_V
);
1526 dissect_h264_exp_golomb_code(tree
, hf_h264_frame_crop_bottom_offset
, tvb
, &bit_offset
, H264_UE_V
);
1530 /* vui_parameters_present_flag 0 u(1) */
1531 vui_parameters_present_flag
= tvb_get_bits8(tvb
, bit_offset
, 1);
1532 proto_tree_add_bits_item(tree
, hf_h264_vui_parameters_present_flag
, tvb
, bit_offset
, 1, ENC_BIG_ENDIAN
);
1534 if (vui_parameters_present_flag
) {
1535 bit_offset
= dissect_h264_vui_parameters(tree
, tvb
, pinfo
, bit_offset
);
1538 /* rbsp_trailing_bits( ) 0 */
1539 bit_offset
= dissect_h264_rbsp_trailing_bits(tree
, tvb
, pinfo
, bit_offset
);
1541 offset
= bit_offset
>>3;
1546 /* 7.3.2.2 Picture parameter set RBSP syntax */
1549 dissect_h264_pic_parameter_set_rbsp(proto_tree
*tree
, tvbuff_t
*tvb
, packet_info
*pinfo
, gint offset
)
1552 guint32 num_slice_groups_minus1
, pic_scaling_matrix_present_flag
;
1554 bit_offset
= offset
<<3;
1556 /* pic_parameter_set_id 1 ue(v) */
1557 dissect_h264_exp_golomb_code(tree
, hf_h264_pic_parameter_set_id
, tvb
, &bit_offset
, H264_UE_V
);
1559 /* seq_parameter_set_id 1 ue(v) */
1560 dissect_h264_exp_golomb_code(tree
, hf_h264_seq_parameter_set_id
, tvb
, &bit_offset
, H264_UE_V
);
1562 /* entropy_coding_mode_flag 1 u(1) */
1563 proto_tree_add_bits_item(tree
, hf_h264_entropy_coding_mode_flag
, tvb
, bit_offset
, 1, ENC_BIG_ENDIAN
);
1566 /* pic_order_present_flag 1 u(1)*/
1567 proto_tree_add_bits_item(tree
, hf_h264_pic_order_present_flag
, tvb
, bit_offset
, 1, ENC_BIG_ENDIAN
);
1570 /* num_slice_groups_minus1 1 ue(v)*/
1571 num_slice_groups_minus1
= dissect_h264_exp_golomb_code(tree
, hf_h264_num_slice_groups_minus1
, tvb
, &bit_offset
, H264_UE_V
);
1572 if (num_slice_groups_minus1
> 0) {
1573 /* slice_group_map_type 1 ue(v)*/
1574 dissect_h264_exp_golomb_code(tree
, hf_h264_slice_group_map_type
, tvb
, &bit_offset
, H264_UE_V
);
1575 /* slice_group_map_type = dissect_h264_exp_golomb_code(tree, hf_h264_slice_group_map_type, tvb, &bit_offset, H264_UE_V);*/
1576 /* if (slice_group_map_type == 0)*/
1577 /* for (iGroup = 0; iGroup <= num_slice_groups_minus1; iGroup++)*/
1578 /* run_length_minus1[ iGroup ] 1 ue(v)*/
1579 /* else if (slice_group_map_type == 2)*/
1580 /* for (iGroup = 0; iGroup < num_slice_groups_minus1; iGroup++) {*/
1581 /* top_left[ iGroup ] 1 ue(v)*/
1582 /* bottom_right[ iGroup ] 1 ue(v)*/
1584 /* else if (slice_group_map_type == 3 ||*/
1585 /* slice_group_map_type == 4 ||*/
1586 /* slice_group_map_type == 5 ) {*/
1587 /* slice_group_change_direction_flag 1 u(1)*/
1588 /* slice_group_change_rate_minus1 1 ue(v)*/
1589 /* } else if (slice_group_map_type == 6) {*/
1590 /* pic_size_in_map_units_minus1 1 ue(v)*/
1591 /* for (i = 0; i <= pic_size_in_map_units_minus1; i++)*/
1592 /* slice_group_id[ i ] 1 u(v)*/
1595 proto_tree_add_expert(tree
, pinfo
, &ei_h264_undecoded
, tvb
, bit_offset
>>3, -1);
1598 /* num_ref_idx_l0_active_minus1 1 ue(v)*/
1599 dissect_h264_exp_golomb_code(tree
, hf_h264_num_ref_idx_l0_active_minus1
, tvb
, &bit_offset
, H264_UE_V
);
1601 /* num_ref_idx_l1_active_minus1 1 ue(v)*/
1602 dissect_h264_exp_golomb_code(tree
, hf_h264_num_ref_idx_l1_active_minus1
, tvb
, &bit_offset
, H264_UE_V
);
1604 /* weighted_pred_flag 1 u(1)*/
1605 proto_tree_add_bits_item(tree
, hf_h264_weighted_pred_flag
, tvb
, bit_offset
, 1, ENC_BIG_ENDIAN
);
1608 /* weighted_bipred_idc 1 u(2)*/
1609 proto_tree_add_bits_item(tree
, hf_h264_weighted_bipred_idc
, tvb
, bit_offset
, 2, ENC_BIG_ENDIAN
);
1610 bit_offset
= bit_offset
+2;
1612 /* pic_init_qp_minus26 * relative to 26 * 1 se(v)*/
1613 dissect_h264_exp_golomb_code(tree
, hf_h264_pic_init_qp_minus26
, tvb
, &bit_offset
, H264_SE_V
);
1615 /* pic_init_qs_minus26 * relative to 26 * 1 se(v)*/
1616 dissect_h264_exp_golomb_code(tree
, hf_h264_pic_init_qs_minus26
, tvb
, &bit_offset
, H264_SE_V
);
1618 /* chroma_qp_index_offset 1 se(v)*/
1619 dissect_h264_exp_golomb_code(tree
, hf_h264_chroma_qp_index_offset
, tvb
, &bit_offset
, H264_SE_V
);
1621 /* deblocking_filter_control_present_flag 1 u(1)*/
1622 proto_tree_add_bits_item(tree
, hf_h264_deblocking_filter_control_present_flag
, tvb
, bit_offset
, 1, ENC_BIG_ENDIAN
);
1625 /* constrained_intra_pred_flag 1 u(1)*/
1626 proto_tree_add_bits_item(tree
, hf_h264_constrained_intra_pred_flag
, tvb
, bit_offset
, 1, ENC_BIG_ENDIAN
);
1629 /* redundant_pic_cnt_present_flag 1 u(1)*/
1630 proto_tree_add_bits_item(tree
, hf_h264_redundant_pic_cnt_present_flag
, tvb
, bit_offset
, 1, ENC_BIG_ENDIAN
);
1633 if (more_rbsp_data(tree
, tvb
, pinfo
, bit_offset
)) {
1634 /* transform_8x8_mode_flag 1 u(1)*/
1635 proto_tree_add_bits_item(tree
, hf_h264_transform_8x8_mode_flag
, tvb
, bit_offset
, 1, ENC_BIG_ENDIAN
);
1638 /* pic_scaling_matrix_present_flag 1 u(1)*/
1639 pic_scaling_matrix_present_flag
= tvb_get_bits8(tvb
, bit_offset
, 1);
1640 proto_tree_add_bits_item(tree
, hf_h264_pic_scaling_matrix_present_flag
, tvb
, bit_offset
, 1, ENC_BIG_ENDIAN
);
1643 if (pic_scaling_matrix_present_flag
) {
1644 proto_tree_add_expert(tree
, pinfo
, &ei_h264_undecoded
, tvb
, bit_offset
>>3, -1);
1646 /* for (i = 0; i < 6 + 2* transform_8x8_mode_flag; i++) {*/
1647 /* pic_scaling_list_present_flag[ i ] 1 u(1)*/
1648 /* if (pic_scaling_list_present_flag[ i ])*/
1650 /* scaling_list( ScalingList4x4[ i ], 16, UseDefaultScalingMatrix4x4Flag[ i ] )*/
1652 /* scaling_list( ScalingList8x8[ i - 6 ], 64, UseDefaultScalingMatrix8x8Flag[ i - 6 ] )*/
1656 /* second_chroma_qp_index_offset 1 se(v)*/
1657 dissect_h264_exp_golomb_code(tree
, hf_h264_second_chroma_qp_index_offset
, tvb
, &bit_offset
, H264_SE_V
);
1659 bit_offset
= dissect_h264_rbsp_trailing_bits(tree
, tvb
, pinfo
, bit_offset
);
1663 * 7.3.2.4 Access unit delimiter RBSP syntax
1664 * access_unit_delimiter_rbsp( )
1667 dissect_h264_access_unit_delimiter_rbsp(proto_tree
*tree
, tvbuff_t
*tvb
, packet_info
*pinfo _U_
, gint offset
)
1669 /* primary_pic_type 6 u(3) */
1670 /* rbsp_trailing_bits( ) 6 */
1671 proto_tree_add_expert(tree
, pinfo
, &ei_h264_undecoded
, tvb
, offset
, -1);
1675 * 7.3.2.5 End of sequence RBSP syntax
1676 * end_of_seq_rbsp( ) {}
1679 dissect_h264_end_of_seq_rbsp(proto_tree
*tree
, tvbuff_t
*tvb
, packet_info
*pinfo _U_
, gint offset
)
1681 proto_tree_add_expert(tree
, pinfo
, &ei_h264_undecoded
, tvb
, offset
, -1);
1685 * 7.3.2.6 End of stream RBSP syntax
1686 * end_of_stream_rbsp( ) {}
1689 dissect_h264_end_of_stream_rbsp(proto_tree
*tree
, tvbuff_t
*tvb
, packet_info
*pinfo _U_
, gint offset
)
1691 proto_tree_add_expert(tree
, pinfo
, &ei_h264_undecoded
, tvb
, offset
, -1);
1695 * 7.3.2.7 Filler data RBSP syntax
1696 * filler_data_rbsp( )
1699 dissect_h264_filler_data_rbsp(proto_tree
*tree
, tvbuff_t
*tvb
, packet_info
*pinfo _U_
, gint offset
)
1701 /* while (next_bits( 8 ) == 0xFF) */
1702 /* ff_byte * equal to 0xFF * 9 f(8) */
1703 /* rbsp_trailing_bits( ) 9 */
1704 proto_tree_add_expert(tree
, pinfo
, &ei_h264_undecoded
, tvb
, offset
, -1);
1708 * 7.3.2.1.2 Sequence parameter set extension RBSP syntax
1709 * seq_parameter_set_extension_rbsp( )
1712 dissect_h264_seq_parameter_set_extension_rbsp(proto_tree
*tree
, tvbuff_t
*tvb
, packet_info
*pinfo _U_
, gint offset
)
1714 /* seq_parameter_set_id 10 ue(v) */
1715 /* aux_format_idc 10 ue(v) */
1716 /* if (aux_format_idc != 0 ) { */
1717 /* bit_depth_aux_minus8 10 ue(v) */
1718 /* alpha_incr_flag 10 u(1) */
1719 /* alpha_opaque_value 10 u(v) */
1720 /* alpha_transparent_value 10 u(v) */
1722 /* additional_extension_flag 10 u(1) */
1723 /* rbsp_trailing_bits() 10 */
1724 proto_tree_add_expert(tree
, pinfo
, &ei_h264_undecoded
, tvb
, offset
, -1);
1729 * Dissect NAL unit as recived in sprop-parameter-sets of SDP
1730 * or "DecoderConfiguration parameter in H.245
1733 dissect_h264_nal_unit(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
)
1736 proto_tree
*h264_nal_tree
;
1738 guint8 nal_unit_type
;
1741 item
= proto_tree_add_item(tree
, hf_h264_nal_unit
, tvb
, offset
, -1, ENC_NA
);
1742 h264_nal_tree
= proto_item_add_subtree(item
, ett_h264_nal_unit
);
1745 /* In decoder configuration start code may be pressent
1746 * B.1.1 Byte stream NAL unit syntax
1748 dword
= tvb_get_bits32(tvb
, offset
<<3, 32, ENC_BIG_ENDIAN
);
1750 /* zero_byte + start_code_prefix_one_3bytes */
1752 } else if ((dword
>> 8) == 1) {
1753 /* start_code_prefix_one_3bytes */
1756 /* Ref: 7.3.1 NAL unit syntax */
1757 nal_unit_type
= tvb_get_guint8(tvb
, offset
) & 0x1f;
1759 /* forbidden_zero_bit All f(1) */
1760 proto_tree_add_item(h264_nal_tree
, hf_h264_forbidden_zero_bit
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1761 /* nal_ref_idc All u(2) */
1762 proto_tree_add_item(h264_nal_tree
, hf_h264_nal_ref_idc
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1763 /* nal_unit_type All u(5) */
1764 proto_tree_add_item(h264_nal_tree
, hf_h264_nal_unit_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1767 switch (nal_unit_type
) {
1768 case 1: /* Coded slice of a non-IDR picture */
1769 dissect_h264_slice_layer_without_partitioning_rbsp(h264_nal_tree
, tvb
, pinfo
, offset
);
1771 case 2: /* Coded slice data partition A */
1772 dissect_h264_slice_data_partition_a_layer_rbsp(h264_nal_tree
, tvb
, pinfo
, offset
);
1774 case 3: /* Coded slice data partition B */
1775 dissect_h264_slice_data_partition_b_layer_rbsp(h264_nal_tree
, tvb
, pinfo
, offset
);
1777 case 4: /* Coded slice data partition C */
1778 dissect_h264_slice_data_partition_c_layer_rbsp(h264_nal_tree
, tvb
, pinfo
, offset
);
1780 case 5: /* Coded slice of an IDR picture */
1781 dissect_h264_slice_layer_without_partitioning_rbsp(h264_nal_tree
, tvb
, pinfo
, offset
);
1783 case 6: /* Supplemental enhancement information (SEI) */
1784 dissect_h264_sei_rbsp(h264_nal_tree
, tvb
, pinfo
, offset
);
1786 case H264_SEQ_PAR_SET
: /* 7 Sequence parameter set*/
1787 offset
= dissect_h264_seq_parameter_set_rbsp(h264_nal_tree
, tvb
, pinfo
, offset
);
1789 if (tvb_length_remaining(tvb
, offset
) > 0) {
1790 /* In this case length = offset as we start from zero */
1791 proto_item_set_len(item
, offset
/*Length */);
1792 item
= proto_tree_add_item(tree
, hf_h264_nal_unit
, tvb
, offset
, -1, ENC_NA
);
1793 h264_nal_tree
= proto_item_add_subtree(item
, ett_h264_nal_unit
);
1797 case H264_PIC_PAR_SET
: /* 8 Picture parameter set */
1798 dissect_h264_pic_parameter_set_rbsp(h264_nal_tree
, tvb
, pinfo
, offset
);
1800 case 9: /* Access unit delimiter */
1801 dissect_h264_access_unit_delimiter_rbsp(h264_nal_tree
, tvb
, pinfo
, offset
);
1803 case 10: /* End of sequence */
1804 dissect_h264_end_of_seq_rbsp(h264_nal_tree
, tvb
, pinfo
, offset
);
1806 case 11: /* End of stream */
1807 dissect_h264_end_of_stream_rbsp(h264_nal_tree
, tvb
, pinfo
, offset
);
1809 case 12: /* Filler data */
1810 dissect_h264_filler_data_rbsp(h264_nal_tree
, tvb
, pinfo
, offset
);
1812 case 13: /* Sequence parameter set extension */
1813 dissect_h264_seq_parameter_set_extension_rbsp(h264_nal_tree
, tvb
, pinfo
, offset
);
1815 case 14: /* Reserved */
1816 case 15: /* Reserved */
1817 case 16: /* Reserved */
1818 case 17: /* Reserved */
1819 case 18: /* Reserved */
1820 proto_tree_add_text(h264_nal_tree
, tvb
, offset
, -1, "Reserved NAL unit type");
1822 case 19: /* Coded slice of an auxiliary coded picture without partitioning */
1823 dissect_h264_slice_layer_without_partitioning_rbsp(tree
, tvb
, pinfo
, offset
);
1826 dissect_h264_slice_layer_without_partitioning_rbsp(tree
, tvb
, pinfo
, offset
);
1828 case 0: /* Unspecified */
1830 /* 24..31 Unspecified */
1831 proto_tree_add_text(h264_nal_tree
, tvb
, offset
, -1, "Unspecified NAL unit type");
1836 /* Code to actually dissect the packets */
1838 dissect_h264(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
)
1841 proto_item
*item
, *ti
, *stream_item
, *fua_item
;
1842 proto_tree
*h264_tree
, *h264_nal_tree
, *stream_tree
, *fua_tree
;
1847 /* Make entries in Protocol column and Info column on summary display */
1848 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "H264");
1850 type
= tvb_get_guint8(tvb
, offset
)&0x1f;
1852 col_append_fstr(pinfo
->cinfo
, COL_INFO
, " %s",
1853 val_to_str(type
, h264_type_values
, "Unknown Type (%u)"));
1856 item
= proto_tree_add_item(tree
, proto_h264
, tvb
, 0, -1, ENC_NA
);
1857 h264_tree
= proto_item_add_subtree(item
, ett_h264
);
1859 /* if the type is 28, it would be draw another title */
1861 ti
= proto_tree_add_text(h264_tree
, tvb
, offset
, 1, "FU identifier");
1863 ti
= proto_tree_add_text(h264_tree
, tvb
, offset
, 1, "NAL unit header or first byte of the payload");
1864 h264_nal_tree
= proto_item_add_subtree(ti
, ett_h264_nal
);
1866 /* +---------------+
1874 * forbidden_zero_bit. A value of 0 indicates that the NAL unit type
1875 * octet and payload should not contain bit errors or other syntax
1876 * violations. A value of 1 indicates that the NAL unit type octet
1877 * and payload may contain bit errors or other syntax violations.
1879 proto_tree_add_item(h264_nal_tree
, hf_h264_nal_f_bit
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1880 proto_tree_add_item(h264_nal_tree
, hf_h264_nal_nri
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1882 proto_tree_add_item(h264_nal_tree
, hf_h264_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1885 fua_item
= proto_tree_add_text(h264_tree
, tvb
, offset
, 1, "FU Header");
1886 fua_tree
= proto_item_add_subtree(fua_item
, ett_h264_fua
);
1887 proto_tree_add_item(fua_tree
, hf_h264_start_bit
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1888 proto_tree_add_item(fua_tree
, hf_h264_end_bit
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1889 proto_tree_add_item(fua_tree
, hf_h264_forbidden_bit
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1890 proto_tree_add_item(fua_tree
, hf_h264_nal_unit_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1891 if ((tvb_get_guint8(tvb
, offset
)&0x80) == 0x80) {
1892 type
= tvb_get_guint8(tvb
, offset
)&0x1f;
1899 /* Unescape NAL unit */
1900 rbsp_tvb
= dissect_h265_unescap_nal_unit(tvb
, pinfo
, offset
);
1902 stream_item
= proto_tree_add_text(h264_tree
, tvb
, offset
, -1, "H264 bitstream");
1903 stream_tree
= proto_item_add_subtree(stream_item
, ett_h264_stream
);
1905 case 1: /* 1 Coded slice of a non-IDR picture */
1906 dissect_h264_slice_layer_without_partitioning_rbsp(stream_tree
, rbsp_tvb
, pinfo
, 0);
1908 case 3: /* Coded slice data partition B */
1909 dissect_h264_slice_data_partition_b_layer_rbsp(h264_nal_tree
, rbsp_tvb
, pinfo
, 0);
1911 case 4: /* Coded slice data partition C */
1912 dissect_h264_slice_data_partition_c_layer_rbsp(h264_nal_tree
, rbsp_tvb
, pinfo
, 0);
1914 case 5: /* Coded slice of an IDR picture */
1915 dissect_h264_slice_layer_without_partitioning_rbsp(stream_tree
, rbsp_tvb
, pinfo
, 0);
1917 case 6: /* Supplemental enhancement information (SEI) */
1918 dissect_h264_sei_rbsp(stream_tree
, tvb
, pinfo
, offset
);
1920 case H264_SEQ_PAR_SET
: /* 7 Sequence parameter set*/
1921 dissect_h264_seq_parameter_set_rbsp(stream_tree
, rbsp_tvb
, pinfo
, 0);
1923 case H264_PIC_PAR_SET
: /* 8 Picture parameter set */
1924 dissect_h264_pic_parameter_set_rbsp(stream_tree
, rbsp_tvb
, pinfo
, 0);
1926 case 19: /* Coded slice of an auxiliary coded picture without partitioning */
1927 dissect_h264_slice_layer_without_partitioning_rbsp(stream_tree
, rbsp_tvb
, pinfo
, 0);
1938 static const int *profile_fields
[] = {
1939 &hf_h264_par_profile_b
,
1940 &hf_h264_par_profile_m
,
1941 &hf_h264_par_profile_e
,
1942 &hf_h264_par_profile_h
,
1943 &hf_h264_par_profile_h10
,
1944 &hf_h264_par_profile_h4_2_2
,
1945 &hf_h264_par_profile_h4_4_4
,
1950 dissect_h264_par_profile(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, void *data _U_
)
1954 proto_tree_add_bitmask(tree
, tvb
, offset
,
1955 hf_h264_par_profile
, ett_h264_par_profile
,
1956 profile_fields
, ENC_BIG_ENDIAN
);
1961 static const int *AdditionalModesSupported_fields
[] = {
1962 &hf_h264_par_add_mode_sup_rcdo
,
1967 dissect_h264_par_AdditionalModesSupported(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, void *data _U_
)
1971 proto_tree_add_bitmask(tree
, tvb
, offset
,
1972 hf_h264_par_AdditionalModesSupported
, ett_h264_par_AdditionalModesSupported
,
1973 AdditionalModesSupported_fields
, ENC_BIG_ENDIAN
);
1979 static const int *ProfileIOP_fields
[] = {
1980 &hf_h264_par_constraint_set0_flag
,
1981 &hf_h264_par_constraint_set1_flag
,
1982 &hf_h264_par_constraint_set2_flag
,
1988 dissect_h264_ProfileIOP(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, void *data _U_
)
1992 proto_tree_add_bitmask(tree
, tvb
, offset
,
1993 hf_h264_par_ProfileIOP
, ett_h264_par_ProfileIOP
,
1994 ProfileIOP_fields
, ENC_BIG_ENDIAN
);
1999 static const value_string h264_par_level_values
[] = {
2020 dissect_h264_par_level(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree _U_
, void *data _U_
)
2025 asn1_ctx_t
*actx
= get_asn1_ctx(data
);
2027 DISSECTOR_ASSERT(actx
);
2029 lvl
= tvb_get_ntohs(tvb
, offset
);
2030 p
= try_val_to_str(lvl
, VALS(h264_par_level_values
));
2032 proto_item_append_text(actx
->created_item
, " - Level %s", p
);
2039 dissect_h264_par_DecoderConfigurationInformation(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void *data
)
2041 asn1_ctx_t
*actx
= get_asn1_ctx(data
);
2043 DISSECTOR_ASSERT(actx
);
2045 dissect_h264_nal_unit(tvb
, pinfo
, tree
);
2047 return tvb_length(tvb
);
2050 typedef struct _h264_capability_t
{
2053 new_dissector_t content_pdu
;
2054 } h264_capability_t
;
2056 static h264_capability_t h264_capability_tab
[] = {
2057 /* ITU-T H.241 (05/2006), 8.3 H.264 capabilities */
2058 { "GenericCapability/0.0.8.241.0.0.1", "ITU-T Rec. H.241 H.264 Video Capabilities", NULL
},
2059 { "GenericCapability/0.0.8.241.0.0.1/collapsing/41", "Profile", dissect_h264_par_profile
},
2060 { "GenericCapability/0.0.8.241.0.0.1/collapsing/42", "Level", dissect_h264_par_level
},
2061 { "GenericCapability/0.0.8.241.0.0.1/collapsing/3" , "CustomMaxMBPS", NULL
},
2062 { "GenericCapability/0.0.8.241.0.0.1/collapsing/4" , "CustomMaxFS", NULL
},
2063 { "GenericCapability/0.0.8.241.0.0.1/collapsing/5" , "CustomMaxDPB", NULL
},
2064 { "GenericCapability/0.0.8.241.0.0.1/collapsing/6" , "CustomMaxBRandCPB", NULL
},
2065 { "GenericCapability/0.0.8.241.0.0.1/collapsing/7" , "MaxStaticMBPS", NULL
},
2066 { "GenericCapability/0.0.8.241.0.0.1/collapsing/8" , "max-rcmd-nal-unit-size", NULL
},
2067 { "GenericCapability/0.0.8.241.0.0.1/collapsing/9" , "max-nal-unit-size", NULL
},
2068 { "GenericCapability/0.0.8.241.0.0.1/collapsing/10", "SampleAspectRatiosSupported", NULL
},
2069 { "GenericCapability/0.0.8.241.0.0.1/collapsing/11", "AdditionalModesSupported", dissect_h264_par_AdditionalModesSupported
},
2070 { "GenericCapability/0.0.8.241.0.0.1/collapsing/12", "AdditionalDisplayCapabilities", NULL
},
2071 /* TS 26.111 H.264 */
2072 { "GenericCapability/0.0.8.241.0.0.1/nonCollapsing/43" , "DecoderConfigurationInformation", dissect_h264_par_DecoderConfigurationInformation
},
2073 { "GenericCapability/0.0.8.241.0.0.1/collapsing/44" , "AcceptRedundantSlices", NULL
},
2074 { "GenericCapability/0.0.8.241.0.0.1/collapsing/45" , "NalAlignedMode", NULL
},
2075 { "GenericCapability/0.0.8.241.0.0.1/collapsing/46" , "ProfileIOP", dissect_h264_ProfileIOP
},
2076 { NULL
, NULL
, NULL
},
2079 static h264_capability_t
*find_cap(const gchar
*id
) {
2080 h264_capability_t
*ftr
= NULL
;
2081 h264_capability_t
*f
;
2083 for (f
=h264_capability_tab
; f
->id
; f
++) {
2084 if (!strcmp(id
, f
->id
)) { ftr
= f
; break; }
2090 dissect_h264_name(tvbuff_t
*tvb _U_
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
2092 asn1_ctx_t
*actx
= get_asn1_ctx(data
);
2094 DISSECTOR_ASSERT(actx
);
2096 h264_capability_t
*ftr
;
2097 ftr
= find_cap(pinfo
->match_string
);
2099 proto_item_append_text(actx
->created_item
, " - %s", ftr
->name
);
2100 proto_item_append_text(proto_item_get_parent(proto_tree_get_parent(tree
)), ": %s", ftr
->name
);
2102 proto_item_append_text(actx
->created_item
, " - unknown(%s)", pinfo
->match_string
);
2106 return tvb_length(tvb
);
2110 static void range_delete_h264_rtp_pt_callback(guint32 rtp_pt
) {
2111 if (rtp_pt
>= 96 && rtp_pt
<= 127)
2112 dissector_delete_uint("rtp.pt", rtp_pt
, h264_handle
);
2115 static void range_add_h264_rtp_pt_callback(guint32 rtp_pt
) {
2116 if (rtp_pt
>= 96 && rtp_pt
<= 127)
2117 dissector_add_uint("rtp.pt", rtp_pt
, h264_handle
);
2120 void proto_reg_handoff_h264(void);
2123 proto_register_h264(void)
2125 module_t
*h264_module
;
2126 expert_module_t
* expert_h264
;
2128 /* Setup list of header fields See Section 1.6.1 for details*/
2129 static hf_register_info hf
[] = {
2130 { &hf_h264_nal_f_bit
,
2131 { "F bit", "h264.f",
2132 FT_BOOLEAN
, 8, TFS(&h264_f_bit_vals
), 0x80,
2136 { "Nal_ref_idc (NRI)", "h264.nal_nri",
2137 FT_UINT8
, BASE_DEC
, NULL
, 0x60,
2141 { "Type", "h264.nal_unit_hdr",
2142 FT_UINT8
, BASE_DEC
, VALS(h264_type_values
), 0x1f,
2145 { &hf_h264_start_bit
,
2146 { "Start bit", "h264.start.bit",
2147 FT_BOOLEAN
, 8, TFS(&h264_start_bit_vals
), 0x80,
2151 { "End bit", "h264.end.bit",
2152 FT_BOOLEAN
, 8, TFS(&h264_end_bit_vals
), 0x40,
2155 { &hf_h264_forbidden_bit
,
2156 { "Forbidden bit", "h264.forbidden.bit",
2157 FT_UINT8
, BASE_DEC
, NULL
, 0x20,
2161 { "Profile", "h264.profile",
2162 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
2165 { &hf_h264_profile_idc
,
2166 { "Profile_idc", "h264.profile_idc",
2167 FT_UINT8
, BASE_DEC
, VALS(h264_profile_idc_values
), 0xff,
2170 { &hf_h264_rbsp_stop_bit
,
2171 { "rbsp_stop_bit", "h264.rbsp_stop_bit",
2172 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2175 { &hf_h264_rbsp_trailing_bits
,
2176 { "rbsp_trailing_bits", "h264.rbsp_trailing_bits",
2177 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2180 { &hf_h264_constraint_set0_flag
,
2181 { "Constraint_set0_flag", "h264.constraint_set0_flag",
2182 FT_UINT8
, BASE_DEC
, NULL
, 0x80,
2185 { &hf_h264_constraint_set1_flag
,
2186 { "Constraint_set1_flag", "h264.constraint_set1_flag",
2187 FT_UINT8
, BASE_DEC
, NULL
, 0x40,
2190 { &hf_h264_constraint_set2_flag
,
2191 { "Constraint_set2_flag", "h264.constraint_set2_flag",
2192 FT_UINT8
, BASE_DEC
, NULL
, 0x20,
2195 { &hf_h264_constraint_set3_flag
,
2196 { "Constraint_set3_flag", "h264.constraint_set3_flag",
2197 FT_UINT8
, BASE_DEC
, NULL
, 0x10,
2200 { &hf_h264_reserved_zero_4bits
,
2201 { "Reserved_zero_4bits", "h264.reserved_zero_4bits",
2202 FT_UINT8
, BASE_DEC
, NULL
, 0x0f,
2205 { &hf_h264_level_idc
,
2206 { "Level_id", "h264.level_id",
2207 FT_UINT8
, BASE_DEC
, NULL
, 0xff,
2210 { &hf_h264_nal_unit
,
2211 { "NAL unit", "h264.nal_unit",
2212 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
2215 { &hf_h264_forbidden_zero_bit
,
2216 { "Forbidden_zero_bit", "h264.forbidden_zero_bit",
2217 FT_UINT8
, BASE_DEC
, NULL
, 0x80,
2220 { &hf_h264_nal_ref_idc
,
2221 { "Nal_ref_idc", "h264.nal_ref_idc",
2222 FT_UINT8
, BASE_DEC
, NULL
, 0x60,
2225 {&hf_h264_nal_unit_type
,
2226 { "Nal_unit_type", "h264.nal_unit_type",
2227 FT_UINT8
, BASE_DEC
, VALS(h264_nal_unit_type_vals
), 0x1f,
2230 { &hf_h264_seq_parameter_set_id
,
2231 { "seq_parameter_set_id", "h264.seq_parameter_set_id",
2232 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2235 { &hf_h264_chroma_format_idc
,
2236 { "chroma_format_id", "h264.chroma_format_id",
2237 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2240 { &hf_h264_residual_colour_transform_flag
,
2241 { "residual_colour_transform_flag", "h264.residual_colour_transform_flag",
2242 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2245 { &hf_h264_bit_depth_luma_minus8
,
2246 { "bit_depth_luma_minus8", "h264.bit_depth_luma_minus8",
2247 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2250 { &hf_h264_bit_depth_chroma_minus8
,
2251 { "bit_depth_chroma_minus8", "h264.bit_depth_chroma_minus8",
2252 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2255 { &hf_h264_qpprime_y_zero_transform_bypass_flag
,
2256 { "qpprime_y_zero_transform_bypass_flag", "h264.qpprime_y_zero_transform_bypass_flag",
2257 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2260 { &hf_h264_seq_scaling_matrix_present_flag
,
2261 { "seq_scaling_matrix_present_flag", "h264.seq_scaling_matrix_present_flag",
2262 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2265 { &hf_h264_log2_max_frame_num_minus4
,
2266 { "log2_max_frame_num_minus4", "h264.log2_max_frame_num_minus4",
2267 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2270 { &hf_h264_pic_order_cnt_type
,
2271 { "pic_order_cnt_type", "h264.pic_order_cnt_type",
2272 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2275 { &hf_h264_log2_max_pic_order_cnt_lsb_minus4
,
2276 { "log2_max_pic_order_cnt_lsb_minus4", "h264.log2_max_pic_order_cnt_lsb_minus4",
2277 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2280 { &hf_h264_delta_pic_order_always_zero_flag
,
2281 { "delta_pic_order_always_zero_flag", "h264.delta_pic_order_always_zero_flag",
2282 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2285 { &hf_h264_offset_for_non_ref_pic
,
2286 { "offset_for_non_ref_pic", "h264.offset_for_non_ref_pic",
2287 FT_INT32
, BASE_DEC
, NULL
, 0x0,
2290 { &hf_h264_offset_for_top_to_bottom_field
,
2291 { "offset_for_top_to_bottom_field", "h264.offset_for_top_to_bottom_field",
2292 FT_INT32
, BASE_DEC
, NULL
, 0x0,
2295 { &hf_h264_num_ref_frames_in_pic_order_cnt_cycle
,
2296 { "num_ref_frames_in_pic_order_cnt_cycle", "h264.num_ref_frames_in_pic_order_cnt_cycle",
2297 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2300 { &hf_h264_offset_for_ref_frame
,
2301 { "offset_for_ref_frame", "h264.offset_for_ref_frame",
2302 FT_INT32
, BASE_DEC
, NULL
, 0x0,
2305 { &hf_h264_num_ref_frames
,
2306 { "num_ref_frames", "h264.num_ref_frames",
2307 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2310 { &hf_h264_gaps_in_frame_num_value_allowed_flag
,
2311 { "gaps_in_frame_num_value_allowed_flag", "h264.gaps_in_frame_num_value_allowed_flag",
2312 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2315 { &hf_h264_pic_width_in_mbs_minus1
,
2316 { "pic_width_in_mbs_minus1", "h264.pic_width_in_mbs_minus1",
2317 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2320 { &hf_h264_pic_height_in_map_units_minus1
,
2321 { "pic_height_in_map_units_minus1", "h264.pic_height_in_map_units_minus1",
2322 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2325 { &hf_h264_frame_mbs_only_flag
,
2326 { "frame_mbs_only_flag", "h264.frame_mbs_only_flag",
2327 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2330 { &hf_h264_mb_adaptive_frame_field_flag
,
2331 { "mb_adaptive_frame_field_flag", "h264.mb_adaptive_frame_field_flag",
2332 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2335 { &hf_h264_direct_8x8_inference_flag
,
2336 { "direct_8x8_inference_flag", "h264.direct_8x8_inference_flag",
2337 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2340 { &hf_h264_frame_cropping_flag
,
2341 { "frame_cropping_flag", "h264.frame_cropping_flag",
2342 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2345 { &hf_h264_frame_crop_left_offset
,
2346 { "frame_crop_left_offset", "h264.frame_crop_left_offset",
2347 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2350 { &hf_h264_frame_crop_right_offset
,
2351 { "frame_crop_left_offset", "h264.frame_crop_right_offset",
2352 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2355 { &hf_h264_frame_crop_top_offset
,
2356 { "frame_crop_top_offset", "h264.frame_crop_top_offset",
2357 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2360 { &hf_h264_frame_crop_bottom_offset
,
2361 { "frame_crop_bottom_offset", "h264.frame_crop_bottom_offset",
2362 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2365 { &hf_h264_vui_parameters_present_flag
,
2366 { "vui_parameters_present_flag", "h264.vui_parameters_present_flag",
2367 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2370 { &hf_h264_pic_parameter_set_id
,
2371 { "pic_parameter_set_id", "h264.pic_parameter_set_id",
2372 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2375 { &hf_h264_entropy_coding_mode_flag
,
2376 { "entropy_coding_mode_flag", "h264.entropy_coding_mode_flag",
2377 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2380 { &hf_h264_pic_order_present_flag
,
2381 { "pic_order_present_flag", "h264.pic_order_present_flag",
2382 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2385 { &hf_h264_num_slice_groups_minus1
,
2386 { "num_slice_groups_minus1", "h264.num_slice_groups_minus1",
2387 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2390 { &hf_h264_slice_group_map_type
,
2391 { "slice_group_map_type", "h264.slice_group_map_type",
2392 FT_UINT32
, BASE_DEC
, VALS(h264_slice_group_map_type_vals
), 0x0,
2395 { &hf_h264_num_ref_idx_l0_active_minus1
,
2396 { "num_ref_idx_l0_active_minus1", "h264.num_ref_idx_l0_active_minus1",
2397 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2400 { &hf_h264_num_ref_idx_l1_active_minus1
,
2401 { "num_ref_idx_l1_active_minus1", "h264.num_ref_idx_l1_active_minus1",
2402 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2405 { &hf_h264_weighted_pred_flag
,
2406 { "weighted_pred_flag", "h264.weighted_pred_flag",
2407 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2410 { &hf_h264_weighted_bipred_idc
,
2411 { "weighted_bipred_idc", "h264.weighted_bipred_idc",
2412 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2415 { &hf_h264_pic_init_qp_minus26
,
2416 { "pic_init_qp_minus26", "h264.pic_init_qp_minus26",
2417 FT_INT32
, BASE_DEC
, NULL
, 0x0,
2420 { &hf_h264_pic_init_qs_minus26
,
2421 { "pic_init_qs_minus26", "h264.pic_init_qs_minus26",
2422 FT_INT32
, BASE_DEC
, NULL
, 0x0,
2425 { &hf_h264_chroma_qp_index_offset
,
2426 { "chroma_qp_index_offset", "h264.chroma_qp_index_offset",
2427 FT_INT32
, BASE_DEC
, NULL
, 0x0,
2430 { &hf_h264_deblocking_filter_control_present_flag
,
2431 { "deblocking_filter_control_present_flag", "h264.deblocking_filter_control_present_flag",
2432 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2435 { &hf_h264_constrained_intra_pred_flag
,
2436 { "constrained_intra_pred_flag", "h264.constrained_intra_pred_flag",
2437 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2440 { &hf_h264_redundant_pic_cnt_present_flag
,
2441 { "redundant_pic_cnt_present_flag", "h264.redundant_pic_cnt_present_flag",
2442 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2445 { &hf_h264_transform_8x8_mode_flag
,
2446 { "transform_8x8_mode_flag", "h264.transform_8x8_mode_flag",
2447 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2450 { &hf_h264_pic_scaling_matrix_present_flag
,
2451 { "pic_scaling_matrix_present_flag", "h264.pic_scaling_matrix_present_flag",
2452 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2455 { &hf_h264_second_chroma_qp_index_offset
,
2456 { "second_chroma_qp_index_offset", "h264.second_chroma_qp_index_offset",
2457 FT_INT32
, BASE_DEC
, NULL
, 0x0,
2461 { &hf_h264_aspect_ratio_info_present_flag
,
2462 { "aspect_ratio_info_present_flag", "h264.aspect_ratio_info_present_flag",
2463 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2466 { &hf_h264_aspect_ratio_idc
,
2467 { "aspect_ratio_idc", "h264.aspect_ratio_idc",
2468 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2471 { &hf_h264_sar_width
,
2472 { "sar_width", "h264.sar_width",
2473 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
2476 { &hf_h264_sar_height
,
2477 { "sar_height", "h264.sar_height",
2478 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
2481 { &hf_h264_overscan_info_present_flag
,
2482 { "overscan_info_present_flag", "h264.overscan_info_present_flag",
2483 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2486 { &hf_h264_overscan_appropriate_flag
,
2487 { "overscan_appropriate_flag", "h264.overscan_appropriate_flag",
2488 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2491 { &hf_h264_video_signal_type_present_flag
,
2492 { "video_signal_type_present_flag", "h264.video_signal_type_present_flag",
2493 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2496 { &hf_h264_video_format
,
2497 { "video_format", "h264.video_format",
2498 FT_UINT8
, BASE_DEC
, VALS(h264_video_format_vals
), 0x0,
2501 { &hf_h264_video_full_range_flag
,
2502 { "video_full_range_flag", "h264.video_full_range_flag",
2503 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2506 { &hf_h264_colour_description_present_flag
,
2507 { "colour_description_present_flag", "h264.colour_description_present_flag",
2508 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2511 { &hf_h264_colour_primaries
,
2512 { "colour_primaries", "h264.colour_primaries",
2513 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2516 { &hf_h264_transfer_characteristics
,
2517 { "transfer_characteristics", "h264.transfer_characteristics",
2518 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2521 { &hf_h264_matrix_coefficients
,
2522 { "matrix_coefficients", "h264.matrix_coefficients",
2523 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2526 { &hf_h264_chroma_loc_info_present_flag
,
2527 { "chroma_loc_info_present_flag", "h264.chroma_loc_info_present_flag",
2528 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2531 { &hf_h264_chroma_sample_loc_type_top_field
,
2532 { "chroma_sample_loc_type_top_field", "h264.chroma_sample_loc_type_top_field",
2533 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2536 { &hf_h264_chroma_sample_loc_type_bottom_field
,
2537 { "chroma_sample_loc_type_bottom_field", "h264.chroma_sample_loc_type_bottom_field",
2538 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2541 { &hf_h264_timing_info_present_flag
,
2542 { "timing_info_present_flag", "h264.timing_info_present_flag",
2543 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2546 { &hf_h264_num_units_in_tick
,
2547 { "num_units_in_tick", "h264.num_units_in_tick",
2548 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2551 { &hf_h264_time_scale
,
2552 { "time_scale", "h264.time_scale",
2553 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2556 { &hf_h264_fixed_frame_rate_flag
,
2557 { "fixed_frame_rate_flag", "h264.fixed_frame_rate_flag",
2558 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2561 { &hf_h264_nal_hrd_parameters_present_flag
,
2562 { "nal_hrd_parameters_present_flag", "h264.nal_hrd_parameters_present_flag",
2563 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2566 { &hf_h264_vcl_hrd_parameters_present_flag
,
2567 { "vcl_hrd_parameters_present_flag", "h264.vcl_hrd_parameters_present_flag",
2568 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2571 { &hf_h264_low_delay_hrd_flag
,
2572 { "low_delay_hrd_flag", "h264.low_delay_hrd_flag",
2573 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2576 { &hf_h264_pic_struct_present_flag
,
2577 { "pic_struct_present_flag", "h264.pic_struct_present_flag",
2578 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2581 { &hf_h264_bitstream_restriction_flag
,
2582 { "bitstream_restriction_flag", "h264.bitstream_restriction_flag",
2583 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2586 { &hf_h264_motion_vectors_over_pic_boundaries_flag
,
2587 { "motion_vectors_over_pic_boundaries_flag", "h264.motion_vectors_over_pic_boundaries_flag",
2588 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2591 { &hf_h264_max_bytes_per_pic_denom
,
2592 { "max_bytes_per_pic_denom", "h264.max_bytes_per_pic_denom",
2593 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2596 { &hf_h264_max_bits_per_mb_denom
,
2597 { "max_bits_per_mb_denom", "h264.max_bits_per_mb_denom",
2598 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2601 { &hf_h264_log2_max_mv_length_horizontal
,
2602 { "max_mv_length_horizontal", "h264.max_mv_length_horizontal",
2603 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2606 { &hf_h264_log2_max_mv_length_vertical
,
2607 { "log2_max_mv_length_vertical", "h264.log2_max_mv_length_vertical",
2608 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2611 { &hf_h264_num_reorder_frames
,
2612 { "num_reorder_frames", "h264.num_reorder_frames",
2613 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2616 { &hf_h264_max_dec_frame_buffering
,
2617 { "max_dec_frame_buffering", "h264.max_dec_frame_buffering",
2618 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2621 { &hf_h264_cpb_cnt_minus1
,
2622 { "cpb_cnt_minus1", "h264.cpb_cnt_minus1",
2623 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2626 { &hf_h264_bit_rate_scale
,
2627 { "bit_rate_scale", "h264.bit_rate_scale",
2628 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2631 { &hf_h264_cpb_size_scale
,
2632 { "cpb_size_scale", "h264.cpb_size_scale",
2633 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2636 { &hf_h264_bit_rate_value_minus1
,
2637 { "bit_rate_value_minus1", "h264.bit_rate_value_minus1",
2638 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2641 { &hf_h264_cpb_size_value_minus1
,
2642 { "cpb_size_value_minus1", "h264.cpb_size_value_minus1",
2643 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2646 { &hf_h264_cbr_flag
,
2647 { "cbr_flag", "h264.cbr_flag",
2648 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2651 { &hf_h264_initial_cpb_removal_delay_length_minus1
,
2652 { "initial_cpb_removal_delay_length_minus1", "h264.initial_cpb_removal_delay_length_minus1",
2653 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2656 { &hf_h264_cpb_removal_delay_length_minus1
,
2657 { "cpb_removal_delay_length_minus1", "h264.cpb_removal_delay_length_minus1",
2658 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2661 { &hf_h264_dpb_output_delay_length_minus11
,
2662 { "dpb_output_delay_length_minus11", "h264.dpb_output_delay_length_minus11",
2663 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2666 { &hf_h264_time_offset_length
,
2667 { "time_offset_length", "h264.time_offset_length",
2668 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2671 { &hf_h264_first_mb_in_slice
,
2672 { "first_mb_in_slice", "h264.first_mb_in_slice",
2673 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2676 { &hf_h264_slice_type
,
2677 { "slice_type", "h264.slice_type",
2678 FT_UINT32
, BASE_DEC
, VALS(h264_slice_type_vals
), 0x0,
2681 { &hf_h264_slice_id
,
2682 { "slice_id", "h264.slice_id",
2683 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2686 { &hf_h264_payloadsize
,
2687 { "PayloadSize", "h264.payloadsize",
2688 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
2691 { &hf_h264_payloadtype
,
2692 { "payloadType", "h264.payloadtype",
2693 FT_UINT32
, BASE_DEC
, VALS(h264_sei_payload_vals
), 0x0,
2697 { &hf_h264_frame_num
,
2698 { "frame_num", "h264.frame_num",
2699 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
2703 { &hf_h264_par_profile
,
2704 { "Profile", "h264.profile",
2705 FT_UINT8
, BASE_HEX
, NULL
, 0x00,
2707 { &hf_h264_par_profile_b
,
2708 { "Baseline Profile", "h264.profile.base",
2709 FT_BOOLEAN
, 8, NULL
, 0x40,
2711 { &hf_h264_par_profile_m
,
2712 { "Main Profile", "h264.profile.main",
2713 FT_BOOLEAN
, 8, NULL
, 0x20,
2715 { &hf_h264_par_profile_e
,
2716 { "Extended Profile.", "h264.profile.ext",
2717 FT_BOOLEAN
, 8, NULL
, 0x10,
2719 { &hf_h264_par_profile_h
,
2720 { "High Profile", "h264.profile.high",
2721 FT_BOOLEAN
, 8, NULL
, 0x08,
2723 { &hf_h264_par_profile_h10
,
2724 { "High 10 Profile", "h264.profile.high10",
2725 FT_BOOLEAN
, 8, NULL
, 0x04,
2727 { &hf_h264_par_profile_h4_2_2
,
2728 { "High 4:2:2 Profile", "h264.profile.high4_2_2",
2729 FT_BOOLEAN
, 8, NULL
, 0x02,
2731 { &hf_h264_par_profile_h4_4_4
,
2732 { "High 4:4:4 Profile", "h264.profile.high4_4_4",
2733 FT_BOOLEAN
, 8, NULL
, 0x01,
2735 { &hf_h264_par_AdditionalModesSupported
,
2736 { "AdditionalModesSupported", "h264.AdditionalModesSupported",
2737 FT_UINT8
, BASE_HEX
, NULL
, 0x00,
2740 { &hf_h264_par_add_mode_sup
,
2741 { "Additional Modes Supported", "h264.add_mode_sup",
2742 FT_UINT8
, BASE_HEX
, NULL
, 0x00,
2745 { &hf_h264_par_add_mode_sup_rcdo
,
2746 { "Reduced Complexity Decoding Operation (RCDO) support", "h264.add_mode_sup.rcdo",
2747 FT_BOOLEAN
, 8, NULL
, 0x40,
2749 { &hf_h264_par_ProfileIOP
,
2750 { "ProfileIOP", "h264.ProfileIOP",
2751 FT_UINT8
, BASE_HEX
, NULL
, 0x00,
2753 { &hf_h264_par_constraint_set0_flag
,
2754 { "constraint_set0_flag", "h264.par.constraint_set0_flag",
2755 FT_BOOLEAN
, 8, NULL
, 0x80,
2757 { &hf_h264_par_constraint_set1_flag
,
2758 { "constraint_set1_flag", "h264.par.constraint_set1_flag",
2759 FT_BOOLEAN
, 8, NULL
, 0x40,
2761 { &hf_h264_par_constraint_set2_flag
,
2762 { "constraint_set2_flag", "h264.par.constraint_set2_flag",
2763 FT_BOOLEAN
, 8, NULL
, 0x20,
2767 /* Setup protocol subtree array */
2768 static gint
*ett
[] = {
2775 &ett_h264_par_profile
,
2776 &ett_h264_par_AdditionalModesSupported
,
2777 &ett_h264_par_ProfileIOP
,
2780 static ei_register_info ei
[] = {
2781 { &ei_h264_undecoded
, { "h264.undecoded", PI_UNDECODED
, PI_WARN
, "[Not decoded yet]", EXPFILL
}},
2784 /* Register the protocol name and description */
2785 proto_h264
= proto_register_protocol("H.264","H264", "h264");
2787 /* Required function calls to register the header fields and subtrees used */
2788 proto_register_field_array(proto_h264
, hf
, array_length(hf
));
2789 proto_register_subtree_array(ett
, array_length(ett
));
2790 expert_h264
= expert_register_protocol(proto_h264
);
2791 expert_register_field_array(expert_h264
, ei
, array_length(ei
));
2792 /* Register a configuration option for port */
2795 h264_module
= prefs_register_protocol(proto_h264
, proto_reg_handoff_h264
);
2798 prefs_register_range_preference(h264_module
, "dynamic.payload.type",
2799 "H264 dynamic payload types",
2800 "Dynamic payload types which will be interpreted as H264"
2801 "; Values must be in the range 96 - 127",
2802 &temp_dynamic_payload_type_range
, 127);
2804 register_dissector("h264", dissect_h264
, proto_h264
);
2808 /* Register the protocol with Wireshark */
2810 proto_reg_handoff_h264(void)
2812 static range_t
*dynamic_payload_type_range
= NULL
;
2813 static gboolean h264_prefs_initialized
= FALSE
;
2815 if (!h264_prefs_initialized
) {
2816 dissector_handle_t h264_name_handle
;
2817 h264_capability_t
*ftr
;
2819 h264_handle
= find_dissector("h264");
2820 dissector_add_string("rtp_dyn_payload_type","H264", h264_handle
);
2822 h264_name_handle
= new_create_dissector_handle(dissect_h264_name
, proto_h264
);
2823 for (ftr
=h264_capability_tab
; ftr
->id
; ftr
++) {
2825 dissector_add_string("h245.gef.name", ftr
->id
, h264_name_handle
);
2826 if (ftr
->content_pdu
)
2827 dissector_add_string("h245.gef.content", ftr
->id
, new_create_dissector_handle(ftr
->content_pdu
, proto_h264
));
2829 h264_prefs_initialized
= TRUE
;
2831 range_foreach(dynamic_payload_type_range
, range_delete_h264_rtp_pt_callback
);
2832 g_free(dynamic_payload_type_range
);
2835 dynamic_payload_type_range
= range_copy(temp_dynamic_payload_type_range
);
2836 range_foreach(dynamic_payload_type_range
, range_add_h264_rtp_pt_callback
);