Showing the changes to libavcodec (4 of 4 files). Show all
Unified · Split
| @@ -1059,6 +1059,14 @@ static int cbs_h266_read_nal_unit(CodedBitstreamContext *ctx, · 1058 unmodified lines | ||
| 1059 | 1059 | return err; |
| 1060 | 1060 | |
| 1061 | 1061 | switch (unit->type) { |
| 1062 | + case VVC_DCI_NUT: | |
| 1063 | + { | |
| 1064 | + err = cbs_h266_read_dci(ctx, &gbc, unit->content); | |
| 1065 | + | |
| 1066 | + if (err < 0) | |
| 1067 | + return err; | |
| 1068 | + } | |
| 1069 | + break; | |
| 1062 | 1070 | case VVC_OPI_NUT: |
| 1063 | 1071 | { |
| 1064 | 1072 | err = cbs_h266_read_opi(ctx, &gbc, unit->content); |
| @@ -1601,6 +1609,15 @@ static int cbs_h266_write_nal_unit(CodedBitstreamContext *ctx, · 536 unmodified lines | ||
| 1601 | 1609 | int err; |
| 1602 | 1610 | |
| 1603 | 1611 | switch (unit->type) { |
| 1612 | + case VVC_DCI_NUT: | |
| 1613 | + { | |
| 1614 | + H266RawDCI *dci = unit->content; | |
| 1615 | + | |
| 1616 | + err = cbs_h266_write_dci(ctx, pbc, dci); | |
| 1617 | + if (err < 0) | |
| 1618 | + return err; | |
| 1619 | + } | |
| 1620 | + break; | |
| 1604 | 1621 | case VVC_OPI_NUT: |
| 1605 | 1622 | { |
| 1606 | 1623 | H266RawOPI *opi = unit->content; |
| @@ -1982,6 +1999,7 @@ static void cbs_h266_free_sei(void *opaque, uint8_t *content) · 375 unmodified lines | ||
| 1982 | 1999 | } |
| 1983 | 2000 | |
| 1984 | 2001 | static const CodedBitstreamUnitTypeDescriptor cbs_h266_unit_types[] = { |
| 2002 | + CBS_UNIT_TYPE_INTERNAL_REF(VVC_DCI_NUT, H266RawDCI, extension_data.data), | |
| 1985 | 2003 | CBS_UNIT_TYPE_INTERNAL_REF(VVC_OPI_NUT, H266RawOPI, extension_data.data), |
| 1986 | 2004 | CBS_UNIT_TYPE_INTERNAL_REF(VVC_VPS_NUT, H266RawVPS, extension_data.data), |
| 1987 | 2005 | CBS_UNIT_TYPE_INTERNAL_REF(VVC_SPS_NUT, H266RawSPS, extension_data.data), |
| @@ -241,6 +241,16 @@ typedef struct H266RawOPI { · 240 unmodified lines | ||
| 241 | 241 | H266RawExtensionData extension_data; |
| 242 | 242 | } H266RawOPI; |
| 243 | 243 | |
| 244 | +typedef struct H266RawDCI { | |
| 245 | + H266RawNALUnitHeader nal_unit_header; | |
| 246 | + | |
| 247 | + uint8_t dci_reserved_zero_4bits; | |
| 248 | + uint8_t dci_num_ptls_minus1; | |
| 249 | + H266RawProfileTierLevel dci_profile_tier_level[VVC_MAX_DCI_PTLS]; | |
| 250 | + uint8_t dci_extension_flag; | |
| 251 | + H266RawExtensionData extension_data; | |
| 252 | +} H266RawDCI; | |
| 253 | + | |
| 244 | 254 | typedef struct H266RawVPS { |
| 245 | 255 | H266RawNALUnitHeader nal_unit_header; |
| 246 | 256 | |
| @@ -650,6 +650,30 @@ static int FUNC(opi)(CodedBitstreamContext *ctx, RWContext *rw, · 649 unmodified lines | ||
| 650 | 650 | return 0; |
| 651 | 651 | } |
| 652 | 652 | |
| 653 | +static int FUNC(dci)(CodedBitstreamContext *ctx, RWContext *rw, | |
| 654 | + H266RawDCI *current) | |
| 655 | +{ | |
| 656 | + int err, i; | |
| 657 | + | |
| 658 | + HEADER("Decoding capability information"); | |
| 659 | + | |
| 660 | + CHECK(FUNC(nal_unit_header)(ctx, rw, | |
| 661 | + ¤t->nal_unit_header, VVC_DCI_NUT)); | |
| 662 | + | |
| 663 | + ub(4, dci_reserved_zero_4bits); | |
| 664 | + ub(4, dci_num_ptls_minus1); | |
| 665 | + for (i = 0; i <= current->dci_num_ptls_minus1; i++) | |
| 666 | + CHECK(FUNC(profile_tier_level)(ctx, rw, | |
| 667 | + current->dci_profile_tier_level + i, 1, 0)); | |
| 668 | + | |
| 669 | + flag(dci_extension_flag); | |
| 670 | + if (current->dci_extension_flag) | |
| 671 | + CHECK(FUNC(extension_data)(ctx, rw, ¤t->extension_data)); | |
| 672 | + CHECK(FUNC(rbsp_trailing_bits)(ctx, rw)); | |
| 673 | + | |
| 674 | + return 0; | |
| 675 | +} | |
| 676 | + | |
| 653 | 677 | static int FUNC(vps) (CodedBitstreamContext *ctx, RWContext *rw, |
| 654 | 678 | H266RawVPS *current) |
| 655 | 679 | { |
| @@ -76,6 +76,9 @@ enum { · 75 unmodified lines | ||
| 76 | 76 | //7.4.3.3 The value of vps_max_sublayers_minus1 shall be in the range of 0 to 6, inclusive |
| 77 | 77 | VVC_MAX_SUBLAYERS = 7, |
| 78 | 78 | |
| 79 | + //7.3.2.1 dci_num_ptls_minus1 is u(4) | |
| 80 | + VVC_MAX_DCI_PTLS = 16, | |
| 81 | + | |
| 79 | 82 | //7.4.3.3 vps_num_ptls_minus1 is u(8) |
| 80 | 83 | VVC_MAX_PTLS = 256, |
| 81 | 84 | |