@scrypted/prebuffer-mixin 0.1.259 → 0.1.262

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,126 +0,0 @@
1
- import { Bitstream } from "./bitstream";
2
-
3
- export type VUIParams = {
4
- aspect_ratio_info_present_flag: 0|1;
5
- aspect_ratio_idc: number;
6
- sar_width: number;
7
- sar_height: number;
8
- overscan_info_present_flag: 0|1;
9
- overscan_appropriate_flag: 0|1;
10
- video_signal_type_present_flag: 0|1;
11
- video_format: number;
12
- video_full_range_flag: 0|1;
13
- colour_description_present_flag: 0|1;
14
- colour_primaries: number;
15
- transfer_characteristics: number;
16
- matrix_coefficients: number;
17
- chroma_loc_info_present_flag: 0|1;
18
- chroma_sample_loc_type_top_field: number;
19
- chroma_sample_loc_type_bottom_field: number;
20
- nal_hrd_parameters_present_flag: 0|1;
21
- vcl_hrd_parameters_present_flag: 0|1;
22
- low_delay_hrd_flag: 0|1;
23
- pic_struct_present_flag: 0|1;
24
- bitstream_restriction_flag: 0|1;
25
- motion_vectors_over_pic_boundaries_flag: number;
26
- max_bytes_per_pic_denom: number;
27
- max_bits_per_mb_denom: number;
28
- log2_max_mv_length_horizontal: number;
29
- log2_max_mv_length_vertical: number;
30
- num_reorder_frames: number;
31
- max_dec_frame_buffering: number;
32
- };
33
-
34
- export function getVUIParams(flag: 0|1, stream: Bitstream): VUIParams {
35
- const vp: VUIParams = {
36
- aspect_ratio_info_present_flag: 0,
37
- aspect_ratio_idc: 0,
38
- sar_width: 0,
39
- sar_height: 0,
40
- overscan_info_present_flag: 0,
41
- overscan_appropriate_flag: 0,
42
- video_signal_type_present_flag: 0,
43
- video_format: 0,
44
- video_full_range_flag: 0,
45
- colour_description_present_flag: 0,
46
- colour_primaries: 0,
47
- transfer_characteristics: 0,
48
- matrix_coefficients: 0,
49
- chroma_loc_info_present_flag: 0,
50
- chroma_sample_loc_type_top_field: 0,
51
- chroma_sample_loc_type_bottom_field: 0,
52
- nal_hrd_parameters_present_flag: 0,
53
- vcl_hrd_parameters_present_flag: 0,
54
- low_delay_hrd_flag: 0,
55
- pic_struct_present_flag: 0,
56
- bitstream_restriction_flag: 0,
57
- motion_vectors_over_pic_boundaries_flag: 0,
58
- max_bytes_per_pic_denom: 0,
59
- max_bits_per_mb_denom: 0,
60
- log2_max_mv_length_horizontal: 0,
61
- log2_max_mv_length_vertical: 0,
62
- num_reorder_frames: 0,
63
- max_dec_frame_buffering: 0,
64
- };
65
-
66
- if (flag) {
67
- vp.aspect_ratio_info_present_flag = stream.readBit();
68
- if (vp.aspect_ratio_info_present_flag) {
69
- vp.aspect_ratio_idc = stream.ExpGolomb();
70
- if (vp.aspect_ratio_idc === 255) { // Extended_SAR
71
- vp.sar_width = stream.readByte();
72
- vp.sar_height = stream.readByte();
73
- }
74
- }
75
-
76
- vp.overscan_info_present_flag = stream.readBit();
77
- if (vp.overscan_info_present_flag) {
78
- vp.overscan_appropriate_flag = stream.readBit();
79
- }
80
-
81
- vp.video_signal_type_present_flag = stream.readBit();
82
-
83
- if (vp.video_signal_type_present_flag) {
84
- vp.video_format = (stream.readBit() << 2) |
85
- (stream.readBit() << 1) |
86
- stream.readBit();
87
- vp.video_full_range_flag = stream.readBit();
88
- vp.colour_description_present_flag = stream.readBit();
89
- if (vp.colour_description_present_flag) {
90
- vp.colour_primaries = stream.readByte();
91
- vp.transfer_characteristics = stream.readByte();
92
- vp.matrix_coefficients = stream.readByte();
93
- }
94
- }
95
-
96
- vp.chroma_loc_info_present_flag = stream.readBit();
97
-
98
- if (vp.chroma_loc_info_present_flag) {
99
- vp.chroma_sample_loc_type_top_field = stream.ExpGolomb();
100
- vp.chroma_sample_loc_type_bottom_field = stream.ExpGolomb();
101
- }
102
-
103
- vp.nal_hrd_parameters_present_flag = stream.readBit();
104
- vp.vcl_hrd_parameters_present_flag = stream.readBit();
105
-
106
- if (vp.nal_hrd_parameters_present_flag || vp.vcl_hrd_parameters_present_flag) {
107
- vp.low_delay_hrd_flag = stream.readBit();
108
- }
109
-
110
- vp.pic_struct_present_flag = stream.readBit();
111
- vp.bitstream_restriction_flag = stream.readBit();
112
-
113
- if (vp.bitstream_restriction_flag) {
114
- vp.bitstream_restriction_flag = stream.readBit();
115
- vp.motion_vectors_over_pic_boundaries_flag = stream.readBit();
116
- vp.max_bytes_per_pic_denom = stream.ExpGolomb();
117
- vp.max_bits_per_mb_denom = stream.ExpGolomb();
118
- vp.log2_max_mv_length_horizontal = stream.ExpGolomb();
119
- vp.log2_max_mv_length_vertical = stream.ExpGolomb();
120
- vp.num_reorder_frames = stream.ExpGolomb();
121
- vp.max_dec_frame_buffering = stream.ExpGolomb();
122
- }
123
- }
124
-
125
- return vp;
126
- }