0

How to convert argb to nv21 (yuv420sp) in Android ndk?

720 * 1280 ask if I should go to the following parameters api to change the color format of the image size.

argb image data size is 3,686,400. 
(width : 720 
height : 1280 
bitPerPixel : 32 
bytePerPexel: 4) 

Api is down https://code.google.com/p/libyuv/

int ARGBToNV21 (const uint8 * src_argb, int src_stride_argb, 
                uint8 * dst_y, int dst_stride_y, 
                uint8 * dst_vu, int dst_stride_vu, 
                int width, int height); 

What is the meaning of the parameters? int src_stride_argb? int dst_stride_y? int int dst_stride_vu?

Please help with a simple example.

Choco
  • 1,054
  • 1
  • 7
  • 20
aespki
  • 1
  • 3

1 Answers1

1

dst_stride_argb number of bytes in a row of the dst_argb plane.
Normally this would be the same as dst_width, with recommended alignment to 16 bytes for better efficiency.
If rotation of 90 or 270 is used, stride is affected. The caller should allocate the buffer according to rotation.

dst_stride_y number of bytes in a row of the dst_y plane.
If rotation of 90 or 270 is used, stride is affected.

(Taken from convert_argb.h, with some modifications)

Michael
  • 57,169
  • 9
  • 80
  • 125