I’ve been studying the H264_SVC::PayloadDescriptorHandler::Process method and have a question about the intended behavior of the temporal layer upgrade logic. I’ve encountered a scenario that I’d like to understand better.
The code block responsible for upgrading the temporal layer is as follows:
// ...
// Upgrade current temporal layer if needed.
if (context->GetTargetTemporalLayer() > context->GetCurrentTemporalLayer())
{
// clang-format off
if (
packetTemporalLayer >= context->GetCurrentTemporalLayer() + 1 &&
this->payloadDescriptor->s
)
// clang-format on
{
// ...
tmpTemporalLayer = packetTemporalLayer;
}
}
// ...
This logic checks if an upgrade is desired and if the incoming packet is a safe point to perform the switch (start of a frame). However, it does not constrain the upgrade to the targetTemporalLayer.
I would like to understand the original intent behind this design. Is this behavior intentional?
The reason being, if we are inside this block we know that current temporal layer is to be upgraded, so if current packet temporal layer is greater than current and lowest or equal to target let’s increase the temporal layer closer to the target, and repeat with upcoming packets until we reach the target.
Do you recall any reason for the current code otherwise, @ibc?