AnsweredAssumed Answered

iMX6 IPU Color Space Conversion with Alpha

Question asked by Philip Hopkins on Aug 1, 2014
Latest reply on Sep 16, 2014 by Philip Hopkins

I'm having an issue converting color space: NV12 to ABGR(32).  I'm taking an NV12 frame and converting it to ABGR to render into a bitmap for Android.  However, I cannot seem to set the Alpha level for the conversion.  When the ABGR buffer is populated, all the alpha bytes are 0.  I want them to be 0xFF or 255, so I can see my bitmap!  Any idea on how to set the Alpha level when converting from NV12 to ABGR?  If I manually set the alpha, I can see my image, but it's an expensive process that takes too long for motion video and must be done in hardware.

 

here's some code that I'm using to convert( NOTE: these are snippits of working code for reference, not critiquing!):

 

// Input image size and format

task.input.width = width;

task.input.height = height;

task.input.format = IPU_PIX_FMT_NV12;

 

// Output image size and format

task.output.width = width;

task.output.height = height;

task.output.format = IPU_PIX_FMT_ABGR32;

 

// Perform color space conversion

ioctl(fd_ipu, IPU_QUEUE_TASK, &task);

 

// manual alpha set, expensive process!!

int* src = outbuf;

int* dst = out;

int len = osize/4;

while(len--)

{

  *dst++ = *src++ | 0xFF000000;

}

Outcomes