vaapi

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2026 License: BSD-2-Clause Imports: 20 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	RCNone           uint32 = 0x00000001
	RCCBR            uint32 = 0x00000002
	RCVBR            uint32 = 0x00000004
	RCCQP            uint32 = 0x00000010
	RCVBRConstrained uint32 = 0x00000020
)
View Source
const (
	PictureH264Invalid            uint32 = 0x00000001
	PictureH264ShortTermReference uint32 = 0x00000008
)
View Source
const FourCCNV12 uint32 = 0x3231564e
View Source
const InvalidID uint32 = 0xffffffff
View Source
const Progressive int32 = 0x1
View Source
const RTFormatYUV420 uint32 = 0x00000001
View Source
const SurfaceAttribSettable uint32 = 0x00000002

Variables

This section is empty.

Functions

func Available

func Available() bool

func Backend

func Backend() hwaccel.Backend

func I420Size

func I420Size(w, h int) int

func I420ToNV12

func I420ToNV12(dstY []byte, dstStrideY int, dstUV []byte, dstStrideUV int, src []byte, w, h int)

func NV12PlaneSize

func NV12PlaneSize(strideY, strideC, h int) int

Types

type BufferType

type BufferType int32
const (
	BufferTypeEncCoded             BufferType = 21
	BufferTypeEncSequenceParameter BufferType = 22
	BufferTypeEncPictureParameter  BufferType = 23
	BufferTypeEncSliceParameter    BufferType = 24
)

type CodedBufferSegment

type CodedBufferSegment struct {
	Size      uint32
	BitOffset uint32
	Status    uint32
	Reserved  uint32
	Buf       unsafe.Pointer
	Next      unsafe.Pointer
	// contains filtered or unexported fields
}

type Config

type Config struct {
	Width     int
	Height    int
	FPSNum    int
	FPSDen    int
	GOPLength int
	QP        int
}

type ConfigAttrib

type ConfigAttrib struct {
	Type  ConfigAttribType
	Value uint32
}

type ConfigAttribType

type ConfigAttribType int32
const (
	ConfigAttribRTFormat    ConfigAttribType = 0
	ConfigAttribRateControl ConfigAttribType = 5
)

type EncPictureParameterBufferH264

type EncPictureParameterBufferH264 struct {
	CurrPic                   PictureH264
	ReferenceFrames           [16]PictureH264
	CodedBuf                  uint32
	PicParameterSetID         uint8
	SeqParameterSetID         uint8
	LastPicture               uint8
	FrameNum                  uint16
	PicInitQP                 uint8
	NumRefIdxL0ActiveMinus1   uint8
	NumRefIdxL1ActiveMinus1   uint8
	ChromaQPIndexOffset       int8
	SecondChromaQPIndexOffset int8
	// contains filtered or unexported fields
}

func (*EncPictureParameterBufferH264) RawPicFields

func (p *EncPictureParameterBufferH264) RawPicFields() uint32

func (*EncPictureParameterBufferH264) SetConstrainedIntraPredFlag

func (p *EncPictureParameterBufferH264) SetConstrainedIntraPredFlag(v bool)

func (*EncPictureParameterBufferH264) SetDeblockingFilterControlPresentFlag

func (p *EncPictureParameterBufferH264) SetDeblockingFilterControlPresentFlag(v bool)

func (*EncPictureParameterBufferH264) SetEntropyCodingModeFlag

func (p *EncPictureParameterBufferH264) SetEntropyCodingModeFlag(v bool)

func (*EncPictureParameterBufferH264) SetIdrPicFlag

func (p *EncPictureParameterBufferH264) SetIdrPicFlag(v bool)

func (*EncPictureParameterBufferH264) SetPicOrderPresentFlag

func (p *EncPictureParameterBufferH264) SetPicOrderPresentFlag(v bool)

func (*EncPictureParameterBufferH264) SetPicScalingMatrixPresentFlag

func (p *EncPictureParameterBufferH264) SetPicScalingMatrixPresentFlag(v bool)

func (*EncPictureParameterBufferH264) SetRedundantPicCntPresentFlag

func (p *EncPictureParameterBufferH264) SetRedundantPicCntPresentFlag(v bool)

func (*EncPictureParameterBufferH264) SetReferencePicFlag

func (p *EncPictureParameterBufferH264) SetReferencePicFlag(v uint32)

func (*EncPictureParameterBufferH264) SetTransform8x8ModeFlag

func (p *EncPictureParameterBufferH264) SetTransform8x8ModeFlag(v bool)

func (*EncPictureParameterBufferH264) SetWeightedBipredIDC

func (p *EncPictureParameterBufferH264) SetWeightedBipredIDC(v uint32)

func (*EncPictureParameterBufferH264) SetWeightedPredFlag

func (p *EncPictureParameterBufferH264) SetWeightedPredFlag(v bool)

type EncSequenceParameterBufferH264

type EncSequenceParameterBufferH264 struct {
	SeqParameterSetID  uint8
	LevelIDC           uint8
	IntraPeriod        uint32
	IntraIDRPeriod     uint32
	IPPeriod           uint32
	BitsPerSecond      uint32
	MaxNumRefFrames    uint32
	PictureWidthInMbs  uint16
	PictureHeightInMbs uint16

	BitDepthLumaMinus8             uint8
	BitDepthChromaMinus8           uint8
	NumRefFramesInPicOrderCntCycle uint8
	OffsetForNonRefPic             int32
	OffsetForTopToBottomField      int32
	OffsetForRefFrame              [256]int32
	FrameCroppingFlag              uint8
	FrameCropLeftOffset            uint32
	FrameCropRightOffset           uint32
	FrameCropTopOffset             uint32
	FrameCropBottomOffset          uint32
	VUIParametersPresentFlag       uint8

	AspectRatioIDC uint8
	SarWidth       uint32
	SarHeight      uint32
	NumUnitsInTick uint32
	TimeScale      uint32
	// contains filtered or unexported fields
}

func (*EncSequenceParameterBufferH264) RawSeqFields

func (s *EncSequenceParameterBufferH264) RawSeqFields() uint32

func (*EncSequenceParameterBufferH264) SetChromaFormatIDC

func (s *EncSequenceParameterBufferH264) SetChromaFormatIDC(v uint32)

func (*EncSequenceParameterBufferH264) SetDeltaPicOrderAlwaysZeroFlag

func (s *EncSequenceParameterBufferH264) SetDeltaPicOrderAlwaysZeroFlag(v bool)

func (*EncSequenceParameterBufferH264) SetDirect8x8InferenceFlag

func (s *EncSequenceParameterBufferH264) SetDirect8x8InferenceFlag(v bool)

func (*EncSequenceParameterBufferH264) SetFrameMbsOnlyFlag

func (s *EncSequenceParameterBufferH264) SetFrameMbsOnlyFlag(v bool)

func (*EncSequenceParameterBufferH264) SetLog2MaxFrameNumMinus4

func (s *EncSequenceParameterBufferH264) SetLog2MaxFrameNumMinus4(v uint32)

func (*EncSequenceParameterBufferH264) SetLog2MaxPicOrderCntLsbMinus4

func (s *EncSequenceParameterBufferH264) SetLog2MaxPicOrderCntLsbMinus4(v uint32)

func (*EncSequenceParameterBufferH264) SetMbAdaptiveFrameFieldFlag

func (s *EncSequenceParameterBufferH264) SetMbAdaptiveFrameFieldFlag(v bool)

func (*EncSequenceParameterBufferH264) SetPicOrderCntType

func (s *EncSequenceParameterBufferH264) SetPicOrderCntType(v uint32)

func (*EncSequenceParameterBufferH264) SetSeqScalingMatrixPresentFlag

func (s *EncSequenceParameterBufferH264) SetSeqScalingMatrixPresentFlag(v bool)

type EncSliceParameterBufferH264

type EncSliceParameterBufferH264 struct {
	MacroblockAddress           uint32
	NumMacroblocks              uint32
	MacroblockInfo              uint32
	SliceType                   uint8
	PicParameterSetID           uint8
	IdrPicID                    uint16
	PicOrderCntLsb              uint16
	DeltaPicOrderCntBottom      int32
	DeltaPicOrderCnt            [2]int32
	DirectSpatialMvPredFlag     uint8
	NumRefIdxActiveOverrideFlag uint8
	NumRefIdxL0ActiveMinus1     uint8
	NumRefIdxL1ActiveMinus1     uint8
	RefPicList0                 [32]PictureH264
	RefPicList1                 [32]PictureH264
	LumaLog2WeightDenom         uint8
	ChromaLog2WeightDenom       uint8
	LumaWeightL0Flag            uint8
	LumaWeightL0                [32]int16
	LumaOffsetL0                [32]int16
	ChromaWeightL0Flag          uint8
	ChromaWeightL0              [32][2]int16
	ChromaOffsetL0              [32][2]int16
	LumaWeightL1Flag            uint8
	LumaWeightL1                [32]int16
	LumaOffsetL1                [32]int16
	ChromaWeightL1Flag          uint8
	ChromaWeightL1              [32][2]int16
	ChromaOffsetL1              [32][2]int16
	CabacInitIDC                uint8
	SliceQPDelta                int8
	DisableDeblockingFilterIDC  uint8
	SliceAlphaC0OffsetDiv2      int8
	SliceBetaOffsetDiv2         int8
	// contains filtered or unexported fields
}

type Encoder

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

func Open

func Open(cfg Config) (*Encoder, error)

func (*Encoder) Close

func (e *Encoder) Close() error

func (*Encoder) Describe

func (e *Encoder) Describe() string

func (*Encoder) Drain

func (e *Encoder) Drain() ([]byte, error)

func (*Encoder) Encode

func (e *Encoder) Encode(i420 []byte) (out []byte, err error)

func (*Encoder) ForceKeyFrame

func (e *Encoder) ForceKeyFrame()

func (*Encoder) Name

func (e *Encoder) Name() string

type Entrypoint

type Entrypoint int32
const (
	EntrypointEncSlice   Entrypoint = 6
	EntrypointEncSliceLP Entrypoint = 8
)

func (Entrypoint) String

func (e Entrypoint) String() string

type GenericValue

type GenericValue struct {
	Type GenericValueType
	// contains filtered or unexported fields
}

func (*GenericValue) SetInt

func (v *GenericValue) SetInt(i int32)

type GenericValueType

type GenericValueType int32
const GenericValueTypeInteger GenericValueType = 1

type Image

type Image struct {
	ImageID           uint32
	Format            ImageFormat
	Buf               uint32
	Width             uint16
	Height            uint16
	DataSize          uint32
	NumPlanes         uint32
	Pitches           [3]uint32
	Offsets           [3]uint32
	NumPaletteEntries int32
	EntryBytes        int32
	ComponentOrder    [4]int8
	// contains filtered or unexported fields
}

type ImageFormat

type ImageFormat struct {
	FourCC       uint32
	ByteOrder    uint32
	BitsPerPixel uint32
	Depth        uint32
	RedMask      uint32
	GreenMask    uint32
	BlueMask     uint32
	AlphaMask    uint32
	// contains filtered or unexported fields
}

type PictureH264

type PictureH264 struct {
	PictureID           uint32
	FrameIdx            uint32
	Flags               uint32
	TopFieldOrderCnt    int32
	BottomFieldOrderCnt int32
	// contains filtered or unexported fields
}

type Profile

type Profile int32
const (
	ProfileH264Main                Profile = 6
	ProfileH264High                Profile = 7
	ProfileH264ConstrainedBaseline Profile = 13
)

type Status

type Status int32
const (
	StatusSuccess                    Status = 0x00000000
	StatusErrorOperationFailed       Status = 0x00000001
	StatusErrorAllocationFailed      Status = 0x00000002
	StatusErrorInvalidDisplay        Status = 0x00000003
	StatusErrorInvalidConfig         Status = 0x00000004
	StatusErrorInvalidContext        Status = 0x00000005
	StatusErrorInvalidSurface        Status = 0x00000006
	StatusErrorInvalidBuffer         Status = 0x00000007
	StatusErrorInvalidImage          Status = 0x00000008
	StatusErrorInvalidSubpicture     Status = 0x00000009
	StatusErrorAttrNotSupported      Status = 0x0000000a
	StatusErrorMaxNumExceeded        Status = 0x0000000b
	StatusErrorUnsupportedProfile    Status = 0x0000000c
	StatusErrorUnsupportedEntrypoint Status = 0x0000000d
	StatusErrorUnsupportedRTFormat   Status = 0x0000000e
	StatusErrorUnsupportedBufferType Status = 0x0000000f
	StatusErrorSurfaceBusy           Status = 0x00000010
	StatusErrorFlagNotSupported      Status = 0x00000011
	StatusErrorInvalidParameter      Status = 0x00000012
	StatusErrorResolutionNotSupp     Status = 0x00000013
	StatusErrorUnimplemented         Status = 0x00000014
	StatusErrorSurfaceInDisplaying   Status = 0x00000015
	StatusErrorInvalidImageFormat    Status = 0x00000016
	StatusErrorDecodingError         Status = 0x00000017
	StatusErrorEncodingError         Status = 0x00000018
	StatusErrorInvalidValue          Status = 0x00000019
	StatusErrorUnsupportedFilter     Status = 0x00000020
	StatusErrorInvalidFilterChain    Status = 0x00000021
	StatusErrorHWBusy                Status = 0x00000022
	StatusErrorUnsupportedMemType    Status = 0x00000024
	StatusErrorNotEnoughBuffer       Status = 0x00000025
	StatusErrorTimedout              Status = 0x00000026
	StatusErrorUnknown               Status = -1
)

func (Status) Error

func (s Status) Error() string

type SurfaceAttrib

type SurfaceAttrib struct {
	Type  SurfaceAttribType
	Flags uint32
	Value GenericValue
}

type SurfaceAttribType

type SurfaceAttribType int32
const SurfaceAttribPixelFormat SurfaceAttribType = 1

Jump to

Keyboard shortcuts

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