如何将 VPX_IMG_FMT_I420 vpx_image_t 转换为 RGB?
示例代码:
int DecodeFrame()
{
vpx_video_reader_read_frame(reader);
vpx_codec_iter_t iter = NULL;
vpx_image_t *img = NULL;
size_t frame_size = 0;
const unsigned char *frame = vpx_video_reader_get_frame(reader, &frame_size);
if (vpx_codec_decode(&codec, frame, (unsigned int)frame_size, NULL, 0)) return 0;
img = vpx_codec_get_frame(&codec, &iter);
// here I need to convert img to RGB array
return 1;
};