dimanche 29 mars 2015

libVPX convert VPX_IMG_FMT_I420 -> RGB

How I can convert VPX_IMG_FMT_I420 vpx_image_t to RGB?


Example code:



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;
};

Aucun commentaire:

Enregistrer un commentaire