vp8

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 12, 2019 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package vp8 implements a decoder for the VP8 lossy image format.

The VP8 specification is RFC 6386.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Decoder

type Decoder struct {
	// contains filtered or unexported fields
}

Decoder decodes VP8 bitstreams into frames. Decoding one frame consists of calling Init, DecodeFrameHeader and then DecodeFrame in that order. A Decoder can be re-used to decode multiple frames.

func NewDecoder

func NewDecoder() *Decoder

NewDecoder returns a new Decoder.

func (*Decoder) DecodeFrame

func (d *Decoder) DecodeFrame() (*image.YCbCr, error)

DecodeFrame decodes the frame and returns it as an YCbCr image. The image's contents are valid up until the next call to Decoder.Init.

func (*Decoder) DecodeFrameHeader

func (d *Decoder) DecodeFrameHeader() (fh FrameHeader, err error)

DecodeFrameHeader decodes the frame header.

func (*Decoder) Init

func (d *Decoder) Init(r io.Reader, n int)

Init initializes the decoder to read at most n bytes from r.

type FrameHeader

type FrameHeader struct {
	KeyFrame          bool
	VersionNumber     uint8
	ShowFrame         bool
	FirstPartitionLen uint32
	Width             int
	Height            int
	XScale            uint8
	YScale            uint8
}

FrameHeader is a frame header, as specified in section 9.1.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL