Class Vp8Encoder
Encodes pictures as VP8 frames, RFC 6386, in pure C#: keyframes, every macroblock predicted from its edges by DC, and inter frames between them, every macroblock predicted from the previous picture at the same place and skipped when nothing is left to code; one quantizer, the default probabilities and no loop filter.
Inherited Members
Namespace: Uniform.Matrix.Video.Vp8
Assembly: Uniform.Matrix.Video.dll
Syntax
public sealed class Vp8Encoder
Remarks
The encoder predicts and reconstructs as a decoder does, with Vp8Decoder's inverse transforms, so its Reconstruction is the picture every decoder shows and the reference of the next inter frame. A keyframe comes every KeyframeInterval frames, and after RequestKeyframe(), e.g. when the peer lost packets.
Constructors
| Edit this page View SourceVp8Encoder(int)
Create an encoder of quantizer index quantizer, 0 for the finest to 127 for the coarsest.
Declaration
public Vp8Encoder(int quantizer = 40)
Parameters
| Type | Name | Description |
|---|---|---|
| int | quantizer |
Properties
| Edit this page View SourceKeyframeInterval
Frames from one keyframe to the next; 0 makes every frame a keyframe.
Declaration
public int KeyframeInterval { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
MotionSearch
Whether inter frames search for motion: each macroblock may predict from a place moved by an even number of whole pixels, so its chroma moves by whole pixels too. Off predicts every macroblock from the same place.
Declaration
public bool MotionSearch { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Quantizer
The quantizer index of the next frames, 0 to 127: higher makes smaller frames of lower quality.
Declaration
public int Quantizer { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
Reconstruction
The last frame as decoders show it.
Declaration
public VideoFrame Reconstruction { get; }
Property Value
| Type | Description |
|---|---|
| VideoFrame |
Methods
| Edit this page View SourceEncode(VideoFrame)
Encode picture: a keyframe at the start, when asked, after KeyframeInterval frames or a change of size; else an inter frame. Return the frame.
Declaration
public byte[] Encode(VideoFrame picture)
Parameters
| Type | Name | Description |
|---|---|---|
| VideoFrame | picture |
Returns
| Type | Description |
|---|---|
| byte[] |
RequestKeyframe()
Make the next frame a keyframe.
Declaration
public void RequestKeyframe()