Ori
Ori

Reputation: 13

How to resize y channel of a yuv image on android

I'm using camera2 api on Android to capture images and need to apply some manipulation on the images such as resize and crop.

My application is very performance sensitive so I want to avoid the conversion to RGB format (Bitmap). Due to memory footprint considerations my intention was to work only on the Y channel of the image.

Can someone suggest an existing implementation for operations on Y channel on Android?

Upvotes: 0

Views: 359

Answers (1)

Eddy Talvala
Eddy Talvala

Reputation: 18097

Take a look at https://chromium.googlesource.com/libyuv/libyuv/:

libyuv is an open source project that includes YUV scaling and conversion functionality.

  • Scale YUV to prepare content for compression, with point, bilinear or box filter.
  • Convert to YUV from webcam formats for compression.
  • Convert to RGB formats for rendering/effects.
  • Rotate by 90/180/270 degrees to adjust for mobile devices in portrait mode.
  • Optimized for SSSE3/AVX2 on x86/x64.
  • Optimized for Neon on Arm.
  • Optimized for MSA on Mips.

It runs on Android as well.

Upvotes: 1

Related Questions