You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
avcodec/cbs_h266: add support for Decoding capability information NALU type
Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
@@ -1059,6 +1059,14 @@ static int cbs_h266_read_nal_unit(CodedBitstreamContext *ctx,
|
|||||||
return err;
|
return err;
|
||||||
|
|
||||||
switch (unit->type) {
|
switch (unit->type) {
|
||||||
|
case VVC_DCI_NUT:
|
||||||
|
{
|
||||||
|
err = cbs_h266_read_dci(ctx, &gbc, unit->content);
|
||||||
|
|
||||||
|
if (err < 0)
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
break;
|
||||||
case VVC_OPI_NUT:
|
case VVC_OPI_NUT:
|
||||||
{
|
{
|
||||||
err = cbs_h266_read_opi(ctx, &gbc, unit->content);
|
err = cbs_h266_read_opi(ctx, &gbc, unit->content);
|
||||||
@@ -1601,6 +1609,15 @@ static int cbs_h266_write_nal_unit(CodedBitstreamContext *ctx,
|
|||||||
int err;
|
int err;
|
||||||
|
|
||||||
switch (unit->type) {
|
switch (unit->type) {
|
||||||
|
case VVC_DCI_NUT:
|
||||||
|
{
|
||||||
|
H266RawDCI *dci = unit->content;
|
||||||
|
|
||||||
|
err = cbs_h266_write_dci(ctx, pbc, dci);
|
||||||
|
if (err < 0)
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
break;
|
||||||
case VVC_OPI_NUT:
|
case VVC_OPI_NUT:
|
||||||
{
|
{
|
||||||
H266RawOPI *opi = unit->content;
|
H266RawOPI *opi = unit->content;
|
||||||
@@ -1982,6 +1999,7 @@ static void cbs_h266_free_sei(void *opaque, uint8_t *content)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static const CodedBitstreamUnitTypeDescriptor cbs_h266_unit_types[] = {
|
static const CodedBitstreamUnitTypeDescriptor cbs_h266_unit_types[] = {
|
||||||
|
CBS_UNIT_TYPE_INTERNAL_REF(VVC_DCI_NUT, H266RawDCI, extension_data.data),
|
||||||
CBS_UNIT_TYPE_INTERNAL_REF(VVC_OPI_NUT, H266RawOPI, extension_data.data),
|
CBS_UNIT_TYPE_INTERNAL_REF(VVC_OPI_NUT, H266RawOPI, extension_data.data),
|
||||||
CBS_UNIT_TYPE_INTERNAL_REF(VVC_VPS_NUT, H266RawVPS, extension_data.data),
|
CBS_UNIT_TYPE_INTERNAL_REF(VVC_VPS_NUT, H266RawVPS, extension_data.data),
|
||||||
CBS_UNIT_TYPE_INTERNAL_REF(VVC_SPS_NUT, H266RawSPS, extension_data.data),
|
CBS_UNIT_TYPE_INTERNAL_REF(VVC_SPS_NUT, H266RawSPS, extension_data.data),
|
||||||
|
@@ -241,6 +241,16 @@ typedef struct H266RawOPI {
|
|||||||
H266RawExtensionData extension_data;
|
H266RawExtensionData extension_data;
|
||||||
} H266RawOPI;
|
} H266RawOPI;
|
||||||
|
|
||||||
|
typedef struct H266RawDCI {
|
||||||
|
H266RawNALUnitHeader nal_unit_header;
|
||||||
|
|
||||||
|
uint8_t dci_reserved_zero_4bits;
|
||||||
|
uint8_t dci_num_ptls_minus1;
|
||||||
|
H266RawProfileTierLevel dci_profile_tier_level[VVC_MAX_DCI_PTLS];
|
||||||
|
uint8_t dci_extension_flag;
|
||||||
|
H266RawExtensionData extension_data;
|
||||||
|
} H266RawDCI;
|
||||||
|
|
||||||
typedef struct H266RawVPS {
|
typedef struct H266RawVPS {
|
||||||
H266RawNALUnitHeader nal_unit_header;
|
H266RawNALUnitHeader nal_unit_header;
|
||||||
|
|
||||||
|
@@ -650,6 +650,30 @@ static int FUNC(opi)(CodedBitstreamContext *ctx, RWContext *rw,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int FUNC(dci)(CodedBitstreamContext *ctx, RWContext *rw,
|
||||||
|
H266RawDCI *current)
|
||||||
|
{
|
||||||
|
int err, i;
|
||||||
|
|
||||||
|
HEADER("Decoding capability information");
|
||||||
|
|
||||||
|
CHECK(FUNC(nal_unit_header)(ctx, rw,
|
||||||
|
¤t->nal_unit_header, VVC_DCI_NUT));
|
||||||
|
|
||||||
|
ub(4, dci_reserved_zero_4bits);
|
||||||
|
ub(4, dci_num_ptls_minus1);
|
||||||
|
for (i = 0; i <= current->dci_num_ptls_minus1; i++)
|
||||||
|
CHECK(FUNC(profile_tier_level)(ctx, rw,
|
||||||
|
current->dci_profile_tier_level + i, 1, 0));
|
||||||
|
|
||||||
|
flag(dci_extension_flag);
|
||||||
|
if (current->dci_extension_flag)
|
||||||
|
CHECK(FUNC(extension_data)(ctx, rw, ¤t->extension_data));
|
||||||
|
CHECK(FUNC(rbsp_trailing_bits)(ctx, rw));
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int FUNC(vps) (CodedBitstreamContext *ctx, RWContext *rw,
|
static int FUNC(vps) (CodedBitstreamContext *ctx, RWContext *rw,
|
||||||
H266RawVPS *current)
|
H266RawVPS *current)
|
||||||
{
|
{
|
||||||
|
@@ -76,6 +76,9 @@ enum {
|
|||||||
//7.4.3.3 The value of vps_max_sublayers_minus1 shall be in the range of 0 to 6, inclusive
|
//7.4.3.3 The value of vps_max_sublayers_minus1 shall be in the range of 0 to 6, inclusive
|
||||||
VVC_MAX_SUBLAYERS = 7,
|
VVC_MAX_SUBLAYERS = 7,
|
||||||
|
|
||||||
|
//7.3.2.1 dci_num_ptls_minus1 is u(4)
|
||||||
|
VVC_MAX_DCI_PTLS = 16,
|
||||||
|
|
||||||
//7.4.3.3 vps_num_ptls_minus1 is u(8)
|
//7.4.3.3 vps_num_ptls_minus1 is u(8)
|
||||||
VVC_MAX_PTLS = 256,
|
VVC_MAX_PTLS = 256,
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user