Commit dc7674b5 authored by Gildas Bazin's avatar Gildas Bazin

* modules/codec/ffmpeg/video_filter.c: added RV32 -> YUVA conversion.

parent ca0f0c57
......@@ -343,6 +343,7 @@ static struct
} chroma_table[] =
{
/* Planar YUV formats */
{ VLC_FOURCC('Y','U','V','A'), PIX_FMT_YUV444P }, /* Hack */
{ VLC_FOURCC('I','4','4','4'), PIX_FMT_YUV444P },
{ VLC_FOURCC('I','4','2','2'), PIX_FMT_YUV422P },
{ VLC_FOURCC('I','4','2','0'), PIX_FMT_YUV420P },
......
......@@ -266,6 +266,28 @@ static picture_t *Process( filter_t *p_filter, picture_t *p_pic )
img_resample( p_sys->p_rsc, &dest_pic, &src_pic );
}
/* Special case for RV32 -> YUVA */
if( !p_sys->b_resize &&
p_filter->fmt_in.video.i_chroma == VLC_FOURCC('R','V','3','2') &&
p_filter->fmt_out.video.i_chroma == VLC_FOURCC('Y','U','V','A') )
{
uint8_t *p_src = p_pic->p[0].p_pixels;
int i_src_pitch = p_pic->p[0].i_pitch;
uint8_t *p_dst = p_pic_dst->p[3].p_pixels;
int i_dst_pitch = p_pic_dst->p[3].i_pitch;
int j;
for( i = 0; i < p_filter->fmt_out.video.i_height; i++ )
{
for( j = 0; j < p_filter->fmt_out.video.i_width; j++ )
{
p_dst[j] = p_src[j*4+3];
}
p_src += i_src_pitch;
p_dst += i_dst_pitch;
}
}
p_pic_dst->date = p_pic->date;
p_pic_dst->b_force = p_pic->b_force;
p_pic_dst->i_nb_fields = p_pic->i_nb_fields;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment