1

I have YUV planar data (420YpCbCr8BiPlanarFullRange) and I would like to convert it to RBGX (RBGA but with 255 in the alpha channel).

void * const luminescencePlaneBytes = ...;
void * const cbChrominancePlaneBytes = ...;
void * const crChrominancePlaneBytes = ...;

// ... Convert YUV planar -> RBGX 32bpp, 8bpc.
void *convertedBytes = ... 

The vImage docs and this answer state this is possible using a Matrix multiplication function:

vImageMatrixMultiply_Planar8

However, I have been unable to find any sample code to that does this.

4

1 回答 1

3

420->RGBA888 涉及一些上采样,这意味着 vImageMatrixMultiply_Planar8 不会单独进行。您需要将色度通道的大小加倍。之后,您应该能够使用适当的矩阵来做到这一点。

如果您有权访问 iOS 8 开发人员种子,那么我建议您查看vImageConvert_420Yp8_CbCr8ToARGB8888

于 2014-06-04T17:41:24.793 回答