[Ffmpeg-devel] Re: YUV420 buffer sizes

Gary Pearman gpearman
Fri Jun 23 12:49:43 CEST 2006


I've added this to the get_buffer code

	printf("s0 = %d, s1 = %d, s2 = %d\n", size[0], size[1], size[2]);

Which gives

	s0 = 184320, s1 = 92160, s2 = 92160

Shouldn't s1 and s2 be _one quarter_ of the size of s0 for YUV420? If
you save the frame out using these sizes it will not display correctly
in VirtualDub for example. However, if you use half s1 and s2, the
frame displays correctly, i.e.

	for(i=0;i<3;i++) {
		size = pic->linesize[i] * (c->height >> (i!=0))
		// ...
	}

Which halfs the size of the data for planes 1 and 2, as they are twice
as large as they should be.

Regards,
Gary.




More information about the ffmpeg-devel mailing list