Table of Contents

Class Vp8EncodedFrame

Namespace
Egami.Formats.Webp
Assembly
Egami.dll

One frame Encode(YuvRaster<byte>, Vp8FramePlan) wrote, and what it cost.

public sealed class Vp8EncodedFrame
Inheritance
Vp8EncodedFrame
Inherited Members

Examples

// 4:2:0 pictures of one size, here decoded from a clip; Egami.Video writes WebM and IVF and plans the frames for you.
using Vp8StreamEncoder encoder = new(pictures[0].Width, pictures[0].Height);
for (int i = 0; i < pictures.Count; i++)
{
    Vp8FramePlan plan = new()
    {
        KeyFrame = i % 30 == 0,     // a key frame a second at 30 frames a second
        RefreshGolden = i % 10 == 0, // and a golden frame to fall back on every tenth
        Quality = 70,
    };
    Vp8EncodedFrame frame = encoder.Encode(pictures[i], plan);
    packets.Add(frame.Data.ToArray()); // a WebM block or an IVF frame; frame.LumaPsnr says how close it came
}

Properties

Bits

Gets the frame's size in bits.

public long Bits { get; }

Property Value

long

ChromaSquaredError

Gets the sum of squared differences between the source's chroma (both planes) and the decoded frame's.

public long ChromaSquaredError { get; }

Property Value

long

Data

Gets the frame's data, as a WebM block or an IVF frame holds it.

public ReadOnlyMemory<byte> Data { get; }

Property Value

ReadOnlyMemory<byte>

FilterLevel

Gets the frame's loop filter level, 0 to 63.

public int FilterLevel { get; }

Property Value

int

IntraMacroblocks

Gets the macroblocks coded with intra prediction: all of a key frame's.

public int IntraMacroblocks { get; }

Property Value

int

IsKeyFrame

Gets whether the frame is a key frame.

public bool IsKeyFrame { get; }

Property Value

bool

IsShown

Gets whether the frame is shown.

public bool IsShown { get; }

Property Value

bool

LumaPsnr

Gets the luma PSNR of the decoded frame against the source, in dB; infinity when they are the same.

public double LumaPsnr { get; }

Property Value

double

LumaSquaredError

Gets the sum of squared differences between the source's luma and the decoded frame's.

public long LumaSquaredError { get; }

Property Value

long

Macroblocks

Gets the frame's macroblocks.

public int Macroblocks { get; }

Property Value

int

Quantizer

Gets the frame's base quantizer index, 0 to 127.

public int Quantizer { get; }

Property Value

int

SkippedMacroblocks

Gets the macroblocks with no coefficients.

public int SkippedMacroblocks { get; }

Property Value

int