<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hello all,<div><br></div><div>I am writing code that extracts the luminance component of an input video using my own custom filter in libavfilter - specifically I am extracting it from "PIX_FMT_YUV420P" a video and I am wondering how to go about doing so.  According to the pixfmt.h header: </div><div><blockquote type="cite"><br></blockquote><blockquote type="cite">PIX_FMT_YUV420P,   ///< planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)</blockquote><br></div><div>I am not sure how to interpret that.  Assuming I am doing this in my draw_slice() function. It has the definition of:</div><div></div><blockquote type="cite"><div><br></div><div>static void draw_slice(AVFilterLink *inlink, int y0, int h, int slice_dir)</div></blockquote><div><br></div><div>I know I can get to the input data plane by:</div><div></div><blockquote type="cite"><div><br></div><div>AVFilterBufferRef *cur_pic = link->cur_buf;</div><div>uint8_t *data = cur_pic->data[0];</div></blockquote><br><div>But there are multiple "planes" in the data.  Does data[0], data[1], data[2] correspond to each of the Y, U, V channels?</div><div><br></div><div>Also, once I am able to point my pointer at the correct coordinate, how should I interpret the extracted result (float, int, etc)?</div><div><br></div><div><br></div><div>Thank you in advance.</div></body></html>