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
10591059 return err;
10601060
10611061 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;
10621070 case VVC_OPI_NUT:
10631071 {
10641072 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
16011609 int err;
16021610
16031611 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;
16041621 case VVC_OPI_NUT:
16051622 {
16061623 H266RawOPI *opi = unit->content;
@@ -1982,6 +1999,7 @@ static void cbs_h266_free_sei(void *opaque, uint8_t *content) · 375 unmodified lines
19821999 }
19832000
19842001 static const CodedBitstreamUnitTypeDescriptor cbs_h266_unit_types[] = {
2002+ CBS_UNIT_TYPE_INTERNAL_REF(VVC_DCI_NUT, H266RawDCI, extension_data.data),
19852003 CBS_UNIT_TYPE_INTERNAL_REF(VVC_OPI_NUT, H266RawOPI, extension_data.data),
19862004 CBS_UNIT_TYPE_INTERNAL_REF(VVC_VPS_NUT, H266RawVPS, extension_data.data),
19872005 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
241241 H266RawExtensionData extension_data;
242242 } H266RawOPI;
243243
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+
244254 typedef struct H266RawVPS {
245255 H266RawNALUnitHeader nal_unit_header;
246256
libavcodec/cbs_h266_syntax_template.c+24−0
@@ -650,6 +650,30 @@ static int FUNC(opi)(CodedBitstreamContext *ctx, RWContext *rw, · 649 unmodified lines
650650 return 0;
651651 }
652652
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+ &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+
653677 static int FUNC(vps) (CodedBitstreamContext *ctx, RWContext *rw,
654678 H266RawVPS *current)
655679 {
libavcodec/vvc.h+3−0
@@ -76,6 +76,9 @@ enum { · 75 unmodified lines
7676 //7.4.3.3 The value of vps_max_sublayers_minus1 shall be in the range of 0 to 6, inclusive
7777 VVC_MAX_SUBLAYERS = 7,
7878
79+ //7.3.2.1 dci_num_ptls_minus1 is u(4)
80+ VVC_MAX_DCI_PTLS = 16,
81+
7982 //7.4.3.3 vps_num_ptls_minus1 is u(8)
8083 VVC_MAX_PTLS = 256,
8184

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