mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
avcodec/cbs_av1: always store temporal_id and spatial_id in CodedBitstreamAV1Context
Also infer them when not coded in the bitstream. Reviewed-by: jkqxz Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
parent
e2589ac650
commit
994d2567f1
@ -920,9 +920,6 @@ static int cbs_av1_read_unit(CodedBitstreamContext *ctx,
|
|||||||
start_pos = get_bits_count(&gbc);
|
start_pos = get_bits_count(&gbc);
|
||||||
|
|
||||||
if (obu->header.obu_extension_flag) {
|
if (obu->header.obu_extension_flag) {
|
||||||
priv->temporal_id = obu->header.temporal_id;
|
|
||||||
priv->spatial_id = obu->header.spatial_id;
|
|
||||||
|
|
||||||
if (obu->header.obu_type != AV1_OBU_SEQUENCE_HEADER &&
|
if (obu->header.obu_type != AV1_OBU_SEQUENCE_HEADER &&
|
||||||
obu->header.obu_type != AV1_OBU_TEMPORAL_DELIMITER &&
|
obu->header.obu_type != AV1_OBU_TEMPORAL_DELIMITER &&
|
||||||
priv->operating_point_idc) {
|
priv->operating_point_idc) {
|
||||||
@ -934,9 +931,6 @@ static int cbs_av1_read_unit(CodedBitstreamContext *ctx,
|
|||||||
// Decoding will drop this OBU at this operating point.
|
// Decoding will drop this OBU at this operating point.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
priv->temporal_id = 0;
|
|
||||||
priv->spatial_id = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (obu->header.obu_type) {
|
switch (obu->header.obu_type) {
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
static int FUNC(obu_header)(CodedBitstreamContext *ctx, RWContext *rw,
|
static int FUNC(obu_header)(CodedBitstreamContext *ctx, RWContext *rw,
|
||||||
AV1RawOBUHeader *current)
|
AV1RawOBUHeader *current)
|
||||||
{
|
{
|
||||||
|
CodedBitstreamAV1Context *priv = ctx->priv_data;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
HEADER("OBU header");
|
HEADER("OBU header");
|
||||||
@ -35,8 +36,14 @@ static int FUNC(obu_header)(CodedBitstreamContext *ctx, RWContext *rw,
|
|||||||
fb(3, temporal_id);
|
fb(3, temporal_id);
|
||||||
fb(2, spatial_id);
|
fb(2, spatial_id);
|
||||||
fc(3, extension_header_reserved_3bits, 0, 0);
|
fc(3, extension_header_reserved_3bits, 0, 0);
|
||||||
|
} else {
|
||||||
|
infer(temporal_id, 0);
|
||||||
|
infer(spatial_id, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
priv->temporal_id = current->temporal_id;
|
||||||
|
priv->spatial_id = current->spatial_id;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user