[x264-devel] Codec usage with image sequence

Stephan Menzel stephan.menzel at gmx.eu
Wed Feb 18 18:02:29 CET 2009


> > As far as I understand, this format is only used in video stream
> contexts, such as y4m.
> 
> JPEG is YV12 as well, as are generally JPEG-2000 and most other lossy
> image formats.

Ah, OK.
So if I got the image sequence in JPEG, I can open an image, seek for the SOS ( 'FF DA' ) and just take everything until the final 'FF D9'. Then I could copy that into x264_picture_t->img->plane and put it into the encoder? Would that suffice?
I'd think that'd be a little too easy, for there's more to fill in that struct. And pane[] has at least 3 ptrs, right?

I had a look at the way yuv files are read in x264. There is a part where a large chunk of data is read from the file and filled into that struct roughly like this (pseudocode):

 read(fd, x264_picture_t->img->plane[0], width * height );
 read(fd, x264_picture_t->img->plane[1], width * height / 4);
 read(fd, x264_picture_t->img->plane[2], width * height / 4);

Am I right in assuming that chunk consists of 3 panes directly following each other and the size tells me how large they are? And that chunk would be identical to the one in the JPEG file? Please excuse, I'm a newbie in that sector and have to learn about all this.

Thanks and greetings...

Stephan


More information about the x264-devel mailing list