Av1SampleDependencyParser


@UnstableApi
public final class Av1SampleDependencyParser


An AV1 bitstream parser that identifies frames that are not depended on.

Summary

Public constructors

Public methods

void

Updates the parser state with the next sample data from a random access temporal unit.

void

Resets the parser state.

int
sampleLimitAfterSkippingNonReferenceFrame(
    ByteBuffer sample,
    boolean skipFrameHeaders
)

Returns the new sample limit after deleting any frames that are not used as reference.

Public constructors

Av1SampleDependencyParser

public Av1SampleDependencyParser()

Public methods

queueInputBuffer

public void queueInputBuffer(ByteBuffer sample)

Updates the parser state with the next sample data from a random access temporal unit.

In order to identify non-reference frames, the parser needs a sequence header. The relevant sequence headers fields cannot change within a coded video sequence. And a new coded video sequence is defined to begin with a temporal unit where:

  • A sequence header OBU appears before the first frame header.
  • The first frame header has frame_type equal to KEY_FRAME.

These requirements are the same as the requirements for random access points. See Ordering of OBUs

reset

public void reset()

Resets the parser state.

sampleLimitAfterSkippingNonReferenceFrame

public int sampleLimitAfterSkippingNonReferenceFrame(
    ByteBuffer sample,
    boolean skipFrameHeaders
)

Returns the new sample limit after deleting any frames that are not used as reference.

Each AV1 temporal unit must have exactly one shown frame. Other frames in the temporal unit that aren't shown are used as reference, but the shown frame may not be used as reference. Frequently, the shown frame is the last frame in the temporal unit.

If the last frame in the temporal unit is a non-reference OBU_FRAME or OBU_FRAME_HEADER, this method returns a new limit value that would leave only the frames used as reference in the input sample.

See Ordering of OBUs.

Parameters
ByteBuffer sample

The sample data for one AV1 temporal unit.

boolean skipFrameHeaders

Whether to skip OBU_FRAME_HEADER.