( bitstream: Bitstream, maxNumSubLayersMinus1: number, )
| 597 | }; |
| 598 | |
| 599 | const parseProfileTierLevel = ( |
| 600 | bitstream: Bitstream, |
| 601 | maxNumSubLayersMinus1: number, |
| 602 | ) => { |
| 603 | const general_profile_space = bitstream.readBits(2); |
| 604 | const general_tier_flag = bitstream.readBits(1); |
| 605 | const general_profile_idc = bitstream.readBits(5); |
| 606 | |
| 607 | let general_profile_compatibility_flags = 0; |
| 608 | for (let i = 0; i < 32; i++) { |
| 609 | general_profile_compatibility_flags = (general_profile_compatibility_flags << 1) | bitstream.readBits(1); |
| 610 | } |
| 611 | |
| 612 | const general_constraint_indicator_flags = new Uint8Array(6); |
| 613 | for (let i = 0; i < 6; i++) { |
| 614 | general_constraint_indicator_flags[i] = bitstream.readBits(8); |
| 615 | } |
| 616 | |
| 617 | const general_level_idc = bitstream.readBits(8); |
| 618 | |
| 619 | const sub_layer_profile_present_flag: number[] = []; |
| 620 | const sub_layer_level_present_flag: number[] = []; |
| 621 | for (let i = 0; i < maxNumSubLayersMinus1; i++) { |
| 622 | sub_layer_profile_present_flag.push(bitstream.readBits(1)); |
| 623 | sub_layer_level_present_flag.push(bitstream.readBits(1)); |
| 624 | } |
| 625 | if (maxNumSubLayersMinus1 > 0) { |
| 626 | for (let i = maxNumSubLayersMinus1; i < 8; i++) { |
| 627 | bitstream.skipBits(2); // reserved_zero_2bits |
| 628 | } |
| 629 | } |
| 630 | for (let i = 0; i < maxNumSubLayersMinus1; i++) { |
| 631 | if (sub_layer_profile_present_flag[i]) bitstream.skipBits(88); |
| 632 | if (sub_layer_level_present_flag[i]) bitstream.skipBits(8); |
| 633 | } |
| 634 | |
| 635 | return { |
| 636 | general_profile_space, |
| 637 | general_tier_flag, |
| 638 | general_profile_idc, |
| 639 | general_profile_compatibility_flags, |
| 640 | general_constraint_indicator_flags, |
| 641 | general_level_idc, |
| 642 | }; |
| 643 | }; |
| 644 | |
| 645 | const skipScalingListData = (bitstream: Bitstream) => { |
| 646 | for (let sizeId = 0; sizeId < 4; sizeId++) { |
no test coverage detected