History

avcodec/cbs_h266: add support for Decoding capability information NALU type

James Almer committed 3 years ago

Commit 8995e2f1 parent 6cb57bb4 files · +55 −0Browse files

Showing the changes to libavcodec (4 of 4 files). Show all

Unified · Split

4 files
  1. libavcodec/cbs_h2645.c +18 −0
  2. libavcodec/cbs_h266.h +10 −0
  3. libavcodec/cbs_h266_syntax_template.c +24 −0
  4. libavcodec/vvc.h +3 −0
libavcodec/cbs_h2645.c+18−0
@@ -1059,6 +1059,14 @@ static int cbs_h266_read_nal_unit(CodedBitstreamContext *ctx, · 1058 unmodified lines
1059 return err;1059 return err;
1060 1060
1061 switch (unit->type) {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 case VVC_OPI_NUT:1070 case VVC_OPI_NUT:
1063 {1071 {
1064 err = cbs_h266_read_opi(ctx, &gbc, unit->content);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 int err;1609 int err;
1602 1610
1603 switch (unit->type) {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 case VVC_OPI_NUT:1621 case VVC_OPI_NUT:
1605 {1622 {
1606 H266RawOPI *opi = unit->content;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
1984static const CodedBitstreamUnitTypeDescriptor cbs_h266_unit_types[] = {2001static const CodedBitstreamUnitTypeDescriptor cbs_h266_unit_types[] = {
2002 CBS_UNIT_TYPE_INTERNAL_REF(VVC_DCI_NUT, H266RawDCI, extension_data.data),
1985 CBS_UNIT_TYPE_INTERNAL_REF(VVC_OPI_NUT, H266RawOPI, extension_data.data),2003 CBS_UNIT_TYPE_INTERNAL_REF(VVC_OPI_NUT, H266RawOPI, extension_data.data),
1986 CBS_UNIT_TYPE_INTERNAL_REF(VVC_VPS_NUT, H266RawVPS, extension_data.data),2004 CBS_UNIT_TYPE_INTERNAL_REF(VVC_VPS_NUT, H266RawVPS, extension_data.data),
1987 CBS_UNIT_TYPE_INTERNAL_REF(VVC_SPS_NUT, H266RawSPS, extension_data.data),2005 CBS_UNIT_TYPE_INTERNAL_REF(VVC_SPS_NUT, H266RawSPS, extension_data.data),
libavcodec/cbs_h266.h+10−0
@@ -241,6 +241,16 @@ typedef struct H266RawOPI { · 240 unmodified lines
241 H266RawExtensionData extension_data;241 H266RawExtensionData extension_data;
242} H266RawOPI;242} H266RawOPI;
243 243
244typedef 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
244typedef struct H266RawVPS {254typedef struct H266RawVPS {
245 H266RawNALUnitHeader nal_unit_header;255 H266RawNALUnitHeader nal_unit_header;
246 256
libavcodec/cbs_h266_syntax_template.c+24−0
@@ -650,6 +650,30 @@ static int FUNC(opi)(CodedBitstreamContext *ctx, RWContext *rw, · 649 unmodified lines
650 return 0;650 return 0;
651}651}
652 652
653static 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 &current->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, &current->extension_data));
672 CHECK(FUNC(rbsp_trailing_bits)(ctx, rw));
673
674 return 0;
675}
676
653static int FUNC(vps) (CodedBitstreamContext *ctx, RWContext *rw,677static int FUNC(vps) (CodedBitstreamContext *ctx, RWContext *rw,
654 H266RawVPS *current)678 H266RawVPS *current)
655{679{
libavcodec/vvc.h+3−0
@@ -76,6 +76,9 @@ enum { · 75 unmodified lines
76 //7.4.3.3 The value of vps_max_sublayers_minus1 shall be in the range of 0 to 6, inclusive76 //7.4.3.3 The value of vps_max_sublayers_minus1 shall be in the range of 0 to 6, inclusive
77 VVC_MAX_SUBLAYERS = 7,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 //7.4.3.3 vps_num_ptls_minus1 is u(8)82 //7.4.3.3 vps_num_ptls_minus1 is u(8)
80 VVC_MAX_PTLS = 256,83 VVC_MAX_PTLS = 256,
81 84

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t