Table of Contents

Struct Vp8FrameInfo

Namespace
Egami.Formats.Webp
Assembly
Egami.dll

What a VP8 frame was, as Decode(ReadOnlySpan<byte>) returns it.

public readonly record struct Vp8FrameInfo : IEquatable<Vp8FrameInfo>
Implements
Inherited Members

Examples

// VP8 frames in stream order, here from an IVF file (Egami.Video reads WebM and IVF for you).
using Vp8StreamDecoder decoder = new() { ConcealErrors = false };
YuvRaster<byte>? picture = null;
foreach (byte[] packet in IvfFrames("clip.ivf"))
{
    Vp8FrameInfo info = decoder.Decode(packet);
    if (!info.IsShown)
    {
        continue; // a hidden frame, typically an alternate reference: it only updates the references
    }

    picture ??= YuvRaster.Create(info.Width, info.Height, ChromaFormat.Yuv420, YuvColor.Bt601Limited);
    decoder.CopyFrameTo(picture); // the picture is the caller's: change it or keep it
    shown++;
}

picture?.Dispose();

Constructors

Vp8FrameInfo(bool, bool, int, int, int, bool)

What a VP8 frame was, as Decode(ReadOnlySpan<byte>) returns it.

public Vp8FrameInfo(bool IsKeyFrame, bool IsShown, int Width, int Height, int Version, bool IsConcealed)

Parameters

IsKeyFrame bool

Whether the frame is a key frame, which decodes on its own and resets the references.

IsShown bool

Whether the frame is shown; a hidden frame (typically an alternate reference) only updates the references.

Width int

The frame width, from the last key frame.

Height int

The frame height, from the last key frame.

Version int

The VP8 version, 0 to 3: 0 uses the six-tap prediction filters and the normal loop filter, 1 to 3 simpler ones.

IsConcealed bool

Whether ConcealErrors concealed broken data in this frame.

Examples

// VP8 frames in stream order, here from an IVF file (Egami.Video reads WebM and IVF for you).
using Vp8StreamDecoder decoder = new() { ConcealErrors = false };
YuvRaster<byte>? picture = null;
foreach (byte[] packet in IvfFrames("clip.ivf"))
{
    Vp8FrameInfo info = decoder.Decode(packet);
    if (!info.IsShown)
    {
        continue; // a hidden frame, typically an alternate reference: it only updates the references
    }

    picture ??= YuvRaster.Create(info.Width, info.Height, ChromaFormat.Yuv420, YuvColor.Bt601Limited);
    decoder.CopyFrameTo(picture); // the picture is the caller's: change it or keep it
    shown++;
}

picture?.Dispose();

Properties

Height

The frame height, from the last key frame.

public int Height { get; init; }

Property Value

int

IsConcealed

Whether ConcealErrors concealed broken data in this frame.

public bool IsConcealed { get; init; }

Property Value

bool

IsKeyFrame

Whether the frame is a key frame, which decodes on its own and resets the references.

public bool IsKeyFrame { get; init; }

Property Value

bool

IsShown

Whether the frame is shown; a hidden frame (typically an alternate reference) only updates the references.

public bool IsShown { get; init; }

Property Value

bool

Version

The VP8 version, 0 to 3: 0 uses the six-tap prediction filters and the normal loop filter, 1 to 3 simpler ones.

public int Version { get; init; }

Property Value

int

Width

The frame width, from the last key frame.

public int Width { get; init; }

Property Value

int