va

package
v0.3.18 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: MIT Imports: 11 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

Overview

Package va drives VA-API's encoders without cgo: it loads libva and libva-drm at run time through purego, opens a display on a DRM render node, and wraps the calls H.264 and H.265 encoding makes. It is the gpu encoder's second backend, for GPUs whose Vulkan driver encodes no video (Intel Xe2 on Mesa 26).

Index

Constants

View Source
const (
	ProfileH264ConstrainedBaseline        int32  = 13
	ProfileH264Main                       int32  = 6
	ProfileH264High                       int32  = 7
	ProfileHEVCMain                       int32  = 17
	EntrypointEncSlice                    int32  = 6
	EntrypointEncSliceLP                  int32  = 8
	ConfigAttribRTFormat                  int32  = 0
	ConfigAttribRateControl               int32  = 5
	ConfigAttribEncPackedHeaders          int32  = 10
	ConfigAttribEncMaxRefFrames           int32  = 13
	ConfigAttribPredictionDirection       int32  = 39
	ConfigAttribEncHEVCFeatures           int32  = 50
	ConfigAttribEncHEVCBlockSizes         int32  = 51
	PredictionDirectionBiNotEmpty         uint32 = 4
	FeatureNotSupported                   uint32 = 0
	FeatureRequired                       uint32 = 2
	AttribNotSupported                    uint32 = 2147483648
	RTFormatYUV420                        uint32 = 1
	RCCBR                                 uint32 = 2
	RCVBR                                 uint32 = 4
	RCCQP                                 uint32 = 16
	EncPackedHeaderSequence               uint32 = 1
	EncPackedHeaderSlice                  uint32 = 4
	PackedHeaderSequence                  uint32 = 1
	PackedHeaderSlice                     uint32 = 3
	EncCodedBufferType                    int32  = 21
	EncSequenceParameterBufferType        int32  = 22
	EncPictureParameterBufferType         int32  = 23
	EncSliceParameterBufferType           int32  = 24
	EncPackedHeaderParameterBufferType    int32  = 25
	EncPackedHeaderDataBufferType         int32  = 26
	EncMiscParameterBufferType            int32  = 27
	EncMiscParameterTypeFrameRate         int32  = 0
	EncMiscParameterTypeRateControl       int32  = 1
	EncMiscParameterTypeHRD               int32  = 5
	SurfaceAttribMinWidth                 int32  = 2
	SurfaceAttribMaxWidth                 int32  = 3
	SurfaceAttribMinHeight                int32  = 4
	SurfaceAttribMaxHeight                int32  = 5
	SurfaceAttribMemoryType               int32  = 6
	SurfaceAttribExternalBufferDescriptor int32  = 7
	SurfaceAttribMemTypeDRMPrime2         uint32 = 1073741824
	SurfaceAttribSettable                 uint32 = 2
	ExportSurfaceReadOnly                 uint32 = 1
	ExportSurfaceComposedLayers           uint32 = 8
	GenericValueTypeInteger               int32  = 1
	GenericValueTypePointer               int32  = 3
	FourccNV12                            uint32 = 842094158
	InvalidID                             uint32 = 4294967295
	PictureH264Invalid                    uint32 = 1
	PictureH264ShortTermReference         uint32 = 8
	PictureHEVCInvalid                    uint32 = 1
	PictureHEVCRPSStCurrBefore            uint32 = 16
	CodedBufStatusSliceOverflowMask       uint32 = 512
	StatusSuccess                         int32  = 0
	StatusErrorTimedOut                   int32  = 38
)

The values of libva's enumerants and flags encoding names, as libva 2.24's headers define them.

Variables

View Source
var (
	H264SeqChromaFormatIdc                          = Bits{0, 2}
	H264SeqFrameMbsOnlyFlag                         = Bits{2, 1}
	H264SeqMbAdaptiveFrameFieldFlag                 = Bits{3, 1}
	H264SeqSeqScalingMatrixPresentFlag              = Bits{4, 1}
	H264SeqDirect8x8InferenceFlag                   = Bits{5, 1}
	H264SeqLog2MaxFrameNumMinus4                    = Bits{6, 4}
	H264SeqPicOrderCntType                          = Bits{10, 2}
	H264SeqLog2MaxPicOrderCntLsbMinus4              = Bits{12, 4}
	H264SeqDeltaPicOrderAlwaysZeroFlag              = Bits{16, 1}
	H264VuiAspectRatioInfoPresentFlag               = Bits{0, 1}
	H264VuiTimingInfoPresentFlag                    = Bits{1, 1}
	H264VuiBitstreamRestrictionFlag                 = Bits{2, 1}
	H264VuiLog2MaxMvLengthHorizontal                = Bits{3, 5}
	H264VuiLog2MaxMvLengthVertical                  = Bits{8, 5}
	H264VuiFixedFrameRateFlag                       = Bits{13, 1}
	H264VuiLowDelayHrdFlag                          = Bits{14, 1}
	H264VuiMotionVectorsOverPicBoundariesFlag       = Bits{15, 1}
	H264PicIdrPicFlag                               = Bits{0, 1}
	H264PicReferencePicFlag                         = Bits{1, 2}
	H264PicEntropyCodingModeFlag                    = Bits{3, 1}
	H264PicWeightedPredFlag                         = Bits{4, 1}
	H264PicWeightedBipredIdc                        = Bits{5, 2}
	H264PicConstrainedIntraPredFlag                 = Bits{7, 1}
	H264PicTransform8x8ModeFlag                     = Bits{8, 1}
	H264PicDeblockingFilterControlPresentFlag       = Bits{9, 1}
	H264PicRedundantPicCntPresentFlag               = Bits{10, 1}
	H264PicPicOrderPresentFlag                      = Bits{11, 1}
	H264PicPicScalingMatrixPresentFlag              = Bits{12, 1}
	HEVCSeqChromaFormatIdc                          = Bits{0, 2}
	HEVCSeqSeparateColourPlaneFlag                  = Bits{2, 1}
	HEVCSeqBitDepthLumaMinus8                       = Bits{3, 3}
	HEVCSeqBitDepthChromaMinus8                     = Bits{6, 3}
	HEVCSeqScalingListEnabledFlag                   = Bits{9, 1}
	HEVCSeqStrongIntraSmoothingEnabledFlag          = Bits{10, 1}
	HEVCSeqAmpEnabledFlag                           = Bits{11, 1}
	HEVCSeqSampleAdaptiveOffsetEnabledFlag          = Bits{12, 1}
	HEVCSeqPcmEnabledFlag                           = Bits{13, 1}
	HEVCSeqPcmLoopFilterDisabledFlag                = Bits{14, 1}
	HEVCSeqSpsTemporalMvpEnabledFlag                = Bits{15, 1}
	HEVCSeqLowDelaySeq                              = Bits{16, 1}
	HEVCSeqHierachicalFlag                          = Bits{17, 1}
	HEVCVuiAspectRatioInfoPresentFlag               = Bits{0, 1}
	HEVCVuiNeutralChromaIndicationFlag              = Bits{1, 1}
	HEVCVuiFieldSeqFlag                             = Bits{2, 1}
	HEVCVuiVuiTimingInfoPresentFlag                 = Bits{3, 1}
	HEVCVuiBitstreamRestrictionFlag                 = Bits{4, 1}
	HEVCVuiTilesFixedStructureFlag                  = Bits{5, 1}
	HEVCVuiMotionVectorsOverPicBoundariesFlag       = Bits{6, 1}
	HEVCVuiRestrictedRefPicListsFlag                = Bits{7, 1}
	HEVCVuiLog2MaxMvLengthHorizontal                = Bits{8, 5}
	HEVCVuiLog2MaxMvLengthVertical                  = Bits{13, 5}
	HEVCSccPaletteModeEnabledFlag                   = Bits{0, 1}
	HEVCPicIdrPicFlag                               = Bits{0, 1}
	HEVCPicCodingType                               = Bits{1, 3}
	HEVCPicReferencePicFlag                         = Bits{4, 1}
	HEVCPicDependentSliceSegmentsEnabledFlag        = Bits{5, 1}
	HEVCPicSignDataHidingEnabledFlag                = Bits{6, 1}
	HEVCPicConstrainedIntraPredFlag                 = Bits{7, 1}
	HEVCPicTransformSkipEnabledFlag                 = Bits{8, 1}
	HEVCPicCuQpDeltaEnabledFlag                     = Bits{9, 1}
	HEVCPicWeightedPredFlag                         = Bits{10, 1}
	HEVCPicWeightedBipredFlag                       = Bits{11, 1}
	HEVCPicTransquantBypassEnabledFlag              = Bits{12, 1}
	HEVCPicTilesEnabledFlag                         = Bits{13, 1}
	HEVCPicEntropyCodingSyncEnabledFlag             = Bits{14, 1}
	HEVCPicLoopFilterAcrossTilesEnabledFlag         = Bits{15, 1}
	HEVCPicPpsLoopFilterAcrossSlicesEnabledFlag     = Bits{16, 1}
	HEVCPicScalingListDataPresentFlag               = Bits{17, 1}
	HEVCPicScreenContentFlag                        = Bits{18, 1}
	HEVCPicEnableGpuWeightedPrediction              = Bits{19, 1}
	HEVCPicNoOutputOfPriorPicsFlag                  = Bits{20, 1}
	HEVCSliceLastSliceOfPicFlag                     = Bits{0, 1}
	HEVCSliceDependentSliceSegmentFlag              = Bits{1, 1}
	HEVCSliceColourPlaneID                          = Bits{2, 2}
	HEVCSliceSliceTemporalMvpEnabledFlag            = Bits{4, 1}
	HEVCSliceSliceSaoLumaFlag                       = Bits{5, 1}
	HEVCSliceSliceSaoChromaFlag                     = Bits{6, 1}
	HEVCSliceNumRefIdxActiveOverrideFlag            = Bits{7, 1}
	HEVCSliceMvdL1ZeroFlag                          = Bits{8, 1}
	HEVCSliceCabacInitFlag                          = Bits{9, 1}
	HEVCSliceSliceDeblockingFilterDisabledFlag      = Bits{10, 2}
	HEVCSliceSliceLoopFilterAcrossSlicesEnabledFlag = Bits{12, 1}
	HEVCSliceCollocatedFromL0Flag                   = Bits{13, 1}
	HEVCFeatureAmp                                  = Bits{4, 2}
	HEVCFeatureSao                                  = Bits{6, 2}
	HEVCFeatureTemporalMvp                          = Bits{10, 2}
	HEVCFeatureCuQpDelta                            = Bits{22, 2}
	HEVCBlockLog2MaxCodingTreeBlockSizeMinus3       = Bits{0, 2}
	HEVCBlockLog2MinLumaCodingBlockSizeMinus3       = Bits{4, 2}
	HEVCBlockLog2MaxLumaTransformBlockSizeMinus2    = Bits{6, 2}
	HEVCBlockLog2MinLumaTransformBlockSizeMinus2    = Bits{8, 2}
	HEVCBlockMaxMaxTransformHierarchyDepthInter     = Bits{10, 2}
	HEVCBlockMaxMaxTransformHierarchyDepthIntra     = Bits{14, 2}
	RCFlagsReset                                    = Bits{0, 1}
	RCFlagsDisableFrameSkip                         = Bits{1, 1}
	RCFlagsDisableBitStuffing                       = Bits{2, 1}
	RCFlagsMbRateControl                            = Bits{3, 4}
	RCFlagsTemporalID                               = Bits{7, 8}
	RCFlagsCfsIFrames                               = Bits{15, 1}
	RCFlagsEnableParallelBrc                        = Bits{16, 1}
	RCFlagsEnableDynamicScaling                     = Bits{17, 1}
	RCFlagsFrameToleranceMode                       = Bits{18, 2}
)

The union bitfields encoding sets, as libva 2.24's headers place them.

View Source
var ErrNoLibrary = errors.New("va: no libva")

ErrNoLibrary reports that libva or libva-drm is not installed.

View Source
var ErrTimeout = errors.New("va: the driver did not finish in time")

ErrTimeout reports work the driver had not finished within the limit a wait gave it.

Functions

This section is empty.

Types

type Bits

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

Bits is a bitfield inside one of libva's unions: its first bit and its width.

func (Bits) Get

func (b Bits) Get(u uint32) uint32

Get is the field's value in the union's value u.

func (Bits) Put

func (b Bits) Put(v uint32) uint32

Put is v in the field, to OR into the union's value.

type CodedBufferSegment

type CodedBufferSegment struct {
	Size       uint32
	BitOffset  uint32
	Status     uint32
	Reserved   uint32
	Buf        unsafe.Pointer
	Next       unsafe.Pointer
	VaReserved [4]uint32
}

CodedBufferSegment is VACodedBufferSegment.

type ConfigAttrib

type ConfigAttrib struct {
	Type  int32
	Value uint32
}

ConfigAttrib is VAConfigAttrib.

type DRMPRIMESurfaceDescriptor

type DRMPRIMESurfaceDescriptor struct {
	Fourcc     uint32
	Width      uint32
	Height     uint32
	NumObjects uint32
	Objects    [4]DRMPRIMESurfaceDescriptorObjects
	NumLayers  uint32
	Layers     [4]DRMPRIMESurfaceDescriptorLayers
}

DRMPRIMESurfaceDescriptor is VADRMPRIMESurfaceDescriptor.

type DRMPRIMESurfaceDescriptorLayers

type DRMPRIMESurfaceDescriptorLayers struct {
	DrmFormat   uint32
	NumPlanes   uint32
	ObjectIndex [4]uint32
	Offset      [4]uint32
	Pitch       [4]uint32
}

DRMPRIMESurfaceDescriptorLayers is an anonymous member of VADRMPRIMESurfaceDescriptorLayers.

type DRMPRIMESurfaceDescriptorObjects

type DRMPRIMESurfaceDescriptorObjects struct {
	Fd                int32
	Size              uint32
	DrmFormatModifier uint64
}

DRMPRIMESurfaceDescriptorObjects is an anonymous member of VADRMPRIMESurfaceDescriptorObjects.

type Display

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

Display is an initialized VA display on a DRM render node. Like the gpu Device it belongs to one goroutine.

func Open

func Open(path string) (*Display, error)

Open opens a VA display on the DRM node at path: ErrNoLibrary without libva, an error naming the node when no VA driver serves it.

func (*Display) Close

func (d *Display) Close()

Close terminates the display and closes its node.

func (*Display) ConfigAttributes

func (d *Display) ConfigAttributes(profile, entrypoint int32, attribs []ConfigAttrib) error

ConfigAttributes reads the driver's value for each of attribs' types, in place: AttribNotSupported where it has none.

func (*Display) CreateBuffer

func (d *Display) CreateBuffer(context uint32, typ int32, size int, data unsafe.Pointer) (uint32, error)

CreateBuffer makes a buffer of typ for context holding size bytes, copied from data unless nil.

func (*Display) CreateConfig

func (d *Display) CreateConfig(profile, entrypoint int32, attribs []ConfigAttrib) (uint32, error)

CreateConfig makes an encode configuration.

func (*Display) CreateContext

func (d *Display) CreateContext(config uint32, width, height int, targets []uint32) (uint32, error)

CreateContext makes an encode context for config over targets.

func (*Display) CreateMiscBuffer

func (d *Display) CreateMiscBuffer(context uint32, typ int32, param unsafe.Pointer, size int) (uint32, error)

CreateMiscBuffer makes a miscellaneous encode parameter buffer for context: typ's header, then the size bytes of param.

func (*Display) CreateSurfaces

func (d *Display) CreateSurfaces(format uint32, width, height, n int) ([]uint32, error)

CreateSurfaces makes n driver-allocated surfaces of format.

func (*Display) DestroyBuffer

func (d *Display) DestroyBuffer(id uint32)

DestroyBuffer releases a buffer.

func (*Display) DestroyConfig

func (d *Display) DestroyConfig(id uint32)

DestroyConfig releases a configuration.

func (*Display) DestroyContext

func (d *Display) DestroyContext(id uint32)

DestroyContext releases a context.

func (*Display) DestroySurfaces

func (d *Display) DestroySurfaces(ids []uint32)

DestroySurfaces releases surfaces, as many a call as vaDestroySurfaces counts.

func (*Display) Encode

func (d *Display) Encode(context, target uint32, bufs []uint32) error

Encode renders bufs into a picture of target in context: the begin, render, end sequence one frame takes.

func (*Display) Entrypoints

func (d *Display) Entrypoints(profile int32) []int32

Entrypoints are the entrypoints the driver offers for profile; an unsupported profile has none.

func (*Display) ExportSurface

func (d *Display) ExportSurface(id uint32) (DRMPRIMESurfaceDescriptor, error)

ExportSurface describes a surface as a PRIME 2 dmabuf, composed in one layer: how the driver lays its own surfaces out. The fds are the caller's to close.

func (*Display) ImportSurface

func (d *Display) ImportSurface(desc *DRMPRIMESurfaceDescriptor) (uint32, error)

ImportSurface wraps a dmabuf desc describes as a surface, with no copy: the PRIME 2 import.

func (*Display) MapBuffer

func (d *Display) MapBuffer(id uint32) (unsafe.Pointer, error)

MapBuffer maps a buffer for the CPU.

func (*Display) ReadCoded

func (d *Display) ReadCoded(dst []byte, id uint32) ([]byte, error)

ReadCoded appends to dst what a coded buffer holds once its picture is done: its segments joined, an error when the picture overflowed it. With room in dst it allocates nothing.

func (*Display) ReadNV12

func (d *Display) ReadNV12(id uint32, width, height int) ([]byte, error)

ReadNV12 copies what an NV12 surface holds: its luma rows, then its interleaved chroma rows, tight.

func (*Display) SurfaceSizes

func (d *Display) SurfaceSizes(config uint32) (minW, minH, maxW, maxH int, err error)

SurfaceSizes are the smallest and largest surfaces config takes, zero where the driver does not say.

func (*Display) SyncSurface

func (d *Display) SyncSurface(id uint32, limit time.Duration) error

SyncSurface waits until the work on surface is done, limit at most: past it the wait is ErrTimeout instead of a frozen caller.

func (*Display) UnmapBuffer

func (d *Display) UnmapBuffer(id uint32) error

UnmapBuffer unmaps a mapped buffer.

func (*Display) Vendor

func (d *Display) Vendor() string

Vendor is the driver's vendor string.

func (*Display) WriteNV12

func (d *Display) WriteNV12(id uint32, width, height int, pix []byte) error

WriteNV12 copies pix (luma rows, then interleaved chroma rows, tight) into an NV12 surface.

type EncMiscParameterBuffer

type EncMiscParameterBuffer struct {
	Type int32
}

EncMiscParameterBuffer is VAEncMiscParameterBuffer's header: its parameter structure follows it in the buffer.

type EncMiscParameterFrameRate

type EncMiscParameterFrameRate struct {
	Framerate      uint32
	FramerateFlags uint32
	VaReserved     [4]uint32
}

EncMiscParameterFrameRate is VAEncMiscParameterFrameRate.

type EncMiscParameterHRD

type EncMiscParameterHRD struct {
	InitialBufferFullness uint32
	BufferSize            uint32
	VaReserved            [4]uint32
}

EncMiscParameterHRD is VAEncMiscParameterHRD.

type EncMiscParameterRateControl

type EncMiscParameterRateControl struct {
	BitsPerSecond    uint32
	TargetPercentage uint32
	WindowSize       uint32
	InitialQp        uint32
	MinQp            uint32
	BasicUnitSize    uint32
	RcFlags          uint32
	ICQQualityFactor uint32
	MaxQp            uint32
	QualityFactor    uint32
	TargetFrameSize  uint32
	VaReserved       [4]uint32
}

EncMiscParameterRateControl is VAEncMiscParameterRateControl.

type EncPackedHeaderParameterBuffer

type EncPackedHeaderParameterBuffer struct {
	Type              uint32
	BitLength         uint32
	HasEmulationBytes uint8
	VaReserved        [4]uint32
}

EncPackedHeaderParameterBuffer is VAEncPackedHeaderParameterBuffer.

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
	PicFields                 uint32
	VaReserved                [4]uint32
}

EncPictureParameterBufferH264 is VAEncPictureParameterBufferH264.

type EncPictureParameterBufferHEVC

type EncPictureParameterBufferHEVC struct {
	DecodedCurrPic                 PictureHEVC
	ReferenceFrames                [15]PictureHEVC
	CodedBuf                       uint32
	CollocatedRefPicIndex          uint8
	LastPicture                    uint8
	PicInitQp                      uint8
	DiffCuQpDeltaDepth             uint8
	PpsCbQpOffset                  int8
	PpsCrQpOffset                  int8
	NumTileColumnsMinus1           uint8
	NumTileRowsMinus1              uint8
	ColumnWidthMinus1              [19]uint8
	RowHeightMinus1                [21]uint8
	Log2ParallelMergeLevelMinus2   uint8
	CtuMaxBitsizeAllowed           uint8
	NumRefIdxL0DefaultActiveMinus1 uint8
	NumRefIdxL1DefaultActiveMinus1 uint8
	SlicePicParameterSetID         uint8
	NalUnitType                    uint8
	PicFields                      uint32
	HierarchicalLevelPlus1         uint8
	VaByteReserved                 uint8
	SccFields                      uint16
	VaReserved                     [15]uint32
}

EncPictureParameterBufferHEVC is VAEncPictureParameterBufferHEVC.

type EncSequenceParameterBufferH264

type EncSequenceParameterBufferH264 struct {
	SeqParameterSetID              uint8
	LevelIdc                       uint8
	IntraPeriod                    uint32
	IntraIdrPeriod                 uint32
	IpPeriod                       uint32
	BitsPerSecond                  uint32
	MaxNumRefFrames                uint32
	PictureWidthInMbs              uint16
	PictureHeightInMbs             uint16
	SeqFields                      uint32
	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
	VuiFields                      uint32
	AspectRatioIdc                 uint8
	SarWidth                       uint32
	SarHeight                      uint32
	NumUnitsInTick                 uint32
	TimeScale                      uint32
	VaReserved                     [4]uint32
}

EncSequenceParameterBufferH264 is VAEncSequenceParameterBufferH264.

type EncSequenceParameterBufferHEVC

type EncSequenceParameterBufferHEVC struct {
	GeneralProfileIdc                   uint8
	GeneralLevelIdc                     uint8
	GeneralTierFlag                     uint8
	IntraPeriod                         uint32
	IntraIdrPeriod                      uint32
	IpPeriod                            uint32
	BitsPerSecond                       uint32
	PicWidthInLumaSamples               uint16
	PicHeightInLumaSamples              uint16
	SeqFields                           uint32
	Log2MinLumaCodingBlockSizeMinus3    uint8
	Log2DiffMaxMinLumaCodingBlockSize   uint8
	Log2MinTransformBlockSizeMinus2     uint8
	Log2DiffMaxMinTransformBlockSize    uint8
	MaxTransformHierarchyDepthInter     uint8
	MaxTransformHierarchyDepthIntra     uint8
	PcmSampleBitDepthLumaMinus1         uint32
	PcmSampleBitDepthChromaMinus1       uint32
	Log2MinPcmLumaCodingBlockSizeMinus3 uint32
	Log2MaxPcmLumaCodingBlockSizeMinus3 uint32
	VuiParametersPresentFlag            uint8
	VuiFields                           uint32
	AspectRatioIdc                      uint8
	SarWidth                            uint32
	SarHeight                           uint32
	VuiNumUnitsInTick                   uint32
	VuiTimeScale                        uint32
	MinSpatialSegmentationIdc           uint16
	MaxBytesPerPicDenom                 uint8
	MaxBitsPerMinCuDenom                uint8
	SccFields                           uint16
	VaReserved                          [7]uint32
}

EncSequenceParameterBufferHEVC is VAEncSequenceParameterBufferHEVC.

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
	VaReserved                  [4]uint32
}

EncSliceParameterBufferH264 is VAEncSliceParameterBufferH264.

type EncSliceParameterBufferHEVC

type EncSliceParameterBufferHEVC struct {
	SliceSegmentAddress        uint32
	NumCtuInSlice              uint32
	SliceType                  uint8
	SlicePicParameterSetID     uint8
	NumRefIdxL0ActiveMinus1    uint8
	NumRefIdxL1ActiveMinus1    uint8
	RefPicList0                [15]PictureHEVC
	RefPicList1                [15]PictureHEVC
	LumaLog2WeightDenom        uint8
	DeltaChromaLog2WeightDenom int8
	DeltaLumaWeightL0          [15]int8
	LumaOffsetL0               [15]int8
	DeltaChromaWeightL0        [15][2]int8
	ChromaOffsetL0             [15][2]int8
	DeltaLumaWeightL1          [15]int8
	LumaOffsetL1               [15]int8
	DeltaChromaWeightL1        [15][2]int8
	ChromaOffsetL1             [15][2]int8
	MaxNumMergeCand            uint8
	SliceQpDelta               int8
	SliceCbQpOffset            int8
	SliceCrQpOffset            int8
	SliceBetaOffsetDiv2        int8
	SliceTcOffsetDiv2          int8
	SliceFields                uint32
	PredWeightTableBitOffset   uint32
	PredWeightTableBitLength   uint32
	VaReserved                 [6]uint32
}

EncSliceParameterBufferHEVC is VAEncSliceParameterBufferHEVC.

type Error

type Error struct {
	Op     string
	Status int32
}

Error is a VA call that failed: the call and libva's status.

func (*Error) Error

func (e *Error) Error() string

type GenericValue

type GenericValue struct {
	Type  int32
	Value uint64
}

GenericValue is VAGenericValue.

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
	VaReserved        [4]uint32
}

Image is VAImage.

type ImageFormat

type ImageFormat struct {
	Fourcc       uint32
	ByteOrder    uint32
	BitsPerPixel uint32
	Depth        uint32
	RedMask      uint32
	GreenMask    uint32
	BlueMask     uint32
	AlphaMask    uint32
	VaReserved   [4]uint32
}

ImageFormat is VAImageFormat.

type PictureH264

type PictureH264 struct {
	PictureID           uint32
	FrameIdx            uint32
	Flags               uint32
	TopFieldOrderCnt    int32
	BottomFieldOrderCnt int32
	VaReserved          [4]uint32
}

PictureH264 is VAPictureH264.

type PictureHEVC

type PictureHEVC struct {
	PictureID   uint32
	PicOrderCnt int32
	Flags       uint32
	VaReserved  [4]uint32
}

PictureHEVC is VAPictureHEVC.

type SurfaceAttrib

type SurfaceAttrib struct {
	Type  int32
	Flags uint32
	Value GenericValue
}

SurfaceAttrib is VASurfaceAttrib.

Jump to

Keyboard shortcuts

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