accel

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2025 License: MIT Imports: 6 Imported by: 0

README

'accel' is a dumping ground for various functions that I need to speed up by moving them from Go to C/C++

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReduceHalf

func ReduceHalf(width, height, nchannel int, src []byte, srcStride int, dst []byte, dstStride int)

Shrink by 2x. nchannel must be 1,3,4, which correspond to Gray, RGB, RGBA.

func YUV420pToRGB

func YUV420pToRGB(width, height int, y, u, v []byte, strideY, strideU, strideV, strideRGB int, rgb []byte)

void YUV420pToRGB(int width, int height, const uint8_t* y, const uint8_t* u, const uint8_t* v, int strideY, int strideU, int strideV, uint8_t* rgb, int strideRGB) {

Types

type YUVImage

type YUVImage struct {
	Width  int
	Height int
	Y      []byte
	U      []byte
	V      []byte
}

Planar YUV 420 image

func LoadYUVFiles

func LoadYUVFiles(filenameY, filenameU, filenameV string, width, height int) (*YUVImage, error)

Load 3 raw YUV files into a YUVImage

func (*YUVImage) Clone

func (x *YUVImage) Clone() *YUVImage

Clone into a tightly packed YUV420p image

func (*YUVImage) CopyFrom

func (x *YUVImage) CopyFrom(src *YUVImage)

func (*YUVImage) CopyToCImageRGB

func (x *YUVImage) CopyToCImageRGB(dst *cimg.Image)

Transcode from YUV420p to RGB The target image must be the same size as the source, and RGB format

func (*YUVImage) ToCImageRGB

func (x *YUVImage) ToCImageRGB() *cimg.Image

Transcode from YUV420p to RGB

func (*YUVImage) TotalBytes

func (x *YUVImage) TotalBytes() int

func (*YUVImage) UStride

func (x *YUVImage) UStride() int

Infer our stride from the U buffer size

func (*YUVImage) VStride

func (x *YUVImage) VStride() int

Infer our stride from the V buffer size

func (*YUVImage) YStride

func (x *YUVImage) YStride() int

Infer our stride from the Y buffer size

Jump to

Keyboard shortcuts

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