Skip to content

centurysys/hyper_jpeg_nim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hyper_jpeg

Overview

hyper_jpeg is a high-level JPEG encoding library for Nim.

It automatically selects the best backend:

  • V4L2 hardware encoder (if available)
  • TurboJPEG fallback

Users do not need to care about backend differences.

Features

  • Unified API for JPEG encoding
  • Automatic backend selection
  • Zero-copy path for V4L2 (RGBA -> NV12 directly into MMAP buffer)
  • TurboJPEG fallback
  • Result-based error handling (no exceptions)

Performance (example)

Test environment:

  • TI AM67A
  • Cortex-A53 1.4GHz x4
  • CPU-only (no GPU acceleration)

On 1920x1080 RGBA input:

  • Zero-copy path: ~10.8 ms
  • Copy-based path: ~13.9 ms
  • ~22% improvement
  • Byte-identical output

Usage

import hyper_jpeg

let enc = ?JpegEncoder.open(1920, 1080)

let jpeg = ?enc.encodeRgba(
  dataPtr,
  1920,
  1080,
  stride,
  quality = 90
)

?enc.close()

Backends

Backend Description
V4L2 Hardware JPEG encoder
TurboJPEG Software fallback

Dependencies

  • libyuv_nim
  • v4l2_jpeg
  • libturbojpeg_nim
  • results

License

MIT License

About

Unified JPEG encoder for Nim with V4L2 hardware acceleration and TurboJPEG fallback

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages