Hi All,
I am in a way to write one Video Filter, where I need to get a Y, U & V data into separate memory pointers. How can I get the Lum, Cb & Cr from the picture_t structure? I tried many ways couldn’t find one, pls help.
Thx
Natz
Yea, I looking for this alone. But I have some questions on this.Did you even peek at other filters or outputs?
I guess you are looking for picture_t.plane[{Y,U,V}_PLANE].p_pixels
If possible, provide some sample codeEither your code is wrong, or the chroma is not I420, or you are not using the correct pixel line pitch.
Code: Select all
// Copy Input Video into YUV buffer
for( i_line = p_pic->p[Y_PLANE].i_visible_lines; i_line--; )
{
memcpy(((*p_buf_Img->imgY_orig)+i_sOff), (p_pic->p[Y_PLANE].p_pixels + i_offset), p_pic->p[Y_PLANE].i_visible_pitch);
i_offset += p_pic->p[Y_PLANE].i_pitch;
i_sOff += p_pic->p[Y_PLANE].i_visible_pitch;
}
i_offset = 0;
i_sOff = 0;
for( i_line = p_pic->p[U_PLANE].i_visible_lines; i_line--; )
{
memcpy(((**p_buf_Img->imgUV_orig)+i_sOff), (p_pic->p[U_PLANE].p_pixels + i_offset), p_pic->p[U_PLANE].i_visible_pitch);
i_offset += p_pic->p[U_PLANE].i_pitch;
i_sOff += p_pic->p[U_PLANE].i_visible_pitch;
}
i_offset = 0;
for( i_line = p_pic->p[V_PLANE].i_visible_lines; i_line--; )
{
memcpy(((**p_buf_Img->imgUV_orig)+i_sOff), (p_pic->p[V_PLANE].p_pixels + i_offset), p_pic->p[V_PLANE].i_visible_pitch);
i_offset += p_pic->p[V_PLANE].i_pitch;
i_sOff += p_pic->p[V_PLANE].i_visible_pitch;
}
Return to “Development around libVLC”
Users browsing this forum: No registered users and 13 guests