Code Monkey home page Code Monkey logo

yuvutils-rs's Introduction

Rust utilities for YUV format handling and conversion.

Fast and simple YUV approximation conversion in pure Rust. At most the same as libyuv does. Performance will be equal to libyuv or slightly higher on platforms where SIMD is implemented. Otherwise equal or slower.

Mostly implemented AVX-512, AVX2, SSE, NEON

X86 targets with SSE and AVX uses runtime dispatch to detect available cpu features.

Supports:

  • YCbCr ( aka YUV )
  • YCgCo
  • YCgCo-R
  • YUY2

SIMD

rustc avx2, avx512f, avx512bw, neon, sse4.1 features should be set when you expect than code will run on supported device.

For AVX-512 target feature avx512bw is required along with feature nightly_avx512 and nightly rust channel compiler.

Adding to project

cargo add yuvutils-rs

RGB to YCbCr

rgb_to_yuv422(&mut y_plane, y_stride,
              &mut u_plane, u_width,
              &mut v_plane, v_width,
              &rgb, rgb_stride,
              width, height, 
              YuvRange::Full, YuvStandardMatrix::Bt709);

YCbCr to RGB

yuv422_to_rgb(&y_plane, y_stride, 
              &u_plane, u_stride,
              &v_plane, v_stride,
              &mut rgb, rgb_stride,
              width, height, 
              YuvRange::Full, YuvStandardMatrix::Bt709);

RGB To YCgCo

rgb_to_ycgco420(&mut y_plane, y_stride,
              &mut cg_plane, cg_width,
              &mut cg_plane, cg_width,
              &rgb, rgb_stride,
              width, height, 
              YuvRange::TV);

YCgCo to RGB

ycgco420_to_rgb(&y_plane, y_stride, 
                &cg_plane, cg_stride,
                &co_plane, co_stride,
                &mut rgb, rgb_stride,
                width, height, 
                YuvRange::TV);

yuvutils-rs's People

Contributors

awxkee avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

xlievo

yuvutils-rs's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.