<div dir="ltr">thank you. <br>I understand how work with vaDeriveImage.<br>:)<br><div class="gmail_extra"><br><br><div class="gmail_quote">On 23 April 2013 06:52, ykzhao <span dir="ltr"><<a href="mailto:yakui.zhao@intel.com" target="_blank">yakui.zhao@intel.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Mon, 2013-04-22 at 11:40 -0600, kwisp wrote:<br>
> >>>Fourcc: 3231564E: (NV12 format).<br>
><br>
> In va/va.h file 3231564E is NV11 format.<br>
<br>
</div>Really? Which branch of libva is you using?<br>
#define VA_FOURCC_NV12 0x3231564E<br>
#define VA_FOURCC_NV11 0x3131564e<br>
<br>
Will you please double check it again?<br>
> >>>What is wrong when you try to read the image by using the above/* a<br>
> few common FourCCs */<br>
<div class="im">> example<br>
> code?<br>
><br>
> Nothing. I can get valid image using pithches and offsets. But I am<br>
> afraid of wrong data size. Who can guarantee that my code do not crash<br>
> outside the image.data_size?<br>
><br>
</div>In theory you can't read/write the image buffer that is beyond<br>
image.data_size. It is developer's responsibility to assure the<br>
reading/writing the correct size. Per my understanding the<br>
image.data_size should be the size of image buffer. If so, the EMGD<br>
driver doesn't return the correct size. The real buffer size should be<br>
1.5 * image.data_size.<br>
<div class="HOEnZb"><div class="h5"><br>
> Gwenole, thank you.<br>
><br>
><br>
><br>
> On 19 April 2013 20:10, Gwenole Beauchesne <<a href="mailto:gb.devel@gmail.com">gb.devel@gmail.com</a>> wrote:<br>
> Hi,<br>
><br>
> This is an issue in the EMGD driver that is still present in<br>
> version 1.16.<br>
><br>
> The dimensions are not reported correctly in the resulting<br>
> VAImage,<br>
> though the pitch information is. Please report a bug in Intel<br>
> Premier.<br>
> Another test application is hwdecode-demos with vaapi_h264<br>
> invoked<br>
> with --getimage for example. The VAImage.{width,height} fields<br>
> should<br>
> match the VA surface dimensions. The VAImage.pitches[] can<br>
> match the<br>
> underlying implementation needs, e.g. next-power-of-two.<br>
><br>
> Thanks,<br>
> Gwenole.<br>
><br>
> 2013/4/19 ykzhao <<a href="mailto:yakui.zhao@intel.com">yakui.zhao@intel.com</a>>:<br>
> > On Wed, 2013-04-17 at 10:40 -0600, kwisp wrote:<br>
> >> On 17 April 2013 08:44, ykzhao <<a href="mailto:yakui.zhao@intel.com">yakui.zhao@intel.com</a>><br>
> wrote:<br>
> >> On Tue, 2013-04-16 at 12:26 -0600, kwisp wrote:<br>
> >> > I use standart libva example<br>
> >> ><br>
> >><br>
> <a href="http://cgit.freedesktop.org/libva/tree/test/decode/mpeg2vldemo.c" target="_blank">http://cgit.freedesktop.org/libva/tree/test/decode/mpeg2vldemo.c</a><br>
> >> ><br>
> >> ><br>
> >> > I try retrive image by calling vaDeriveImage<br>
> after decoding<br>
> >> and<br>
> >> > recieve stange VAImage.<br>
> >> ><br>
> >> > image.width = 512 image.height = 32<br>
> image.data_size=16384<br>
> >> > image.numplanes=2<br>
> >> ><br>
> >> > image.format.fourcc = NV11 image.offsets[0] = 0,<br>
> >> image.offsets[1] =<br>
> >> > 16384, image.pitches[0] = image.pitches[1] = 512.<br>
> >> ><br>
> >> ><br>
> >> > If I convert this VAImage data to normaly FOURCC<br>
> format I<br>
> >> see correct<br>
> >> > picture.<br>
> >> ><br>
> >><br>
> ><br>
> > The vaDeriveImage is used to read/write the image content<br>
> from the<br>
> > corresponding decoded buffer. And we don't need to care<br>
> whether the<br>
> > width/height of derived image is different with real image<br>
> size(The<br>
> > width/height of derived image is determined by the video<br>
> hardware).<br>
> > We should follow the corresponding offset/pitches to read<br>
> the buffer.<br>
> ><br>
> >><br>
> >> Will you please describe how you call the<br>
> vaDeriveImage in<br>
> >> your<br>
> >><br>
> >> libva: libva version 0.32.0<br>
> >> libva: va_getDriverName() returns 0<br>
> >> libva: Trying to open /usr/lib/dri/emgd_drv_video.so<br>
> >> Intel(R) Embedded Media and Graphics Driver 1.10 Build 2209<br>
> >> libva: va_openDriver() returns 0<br>
> >> 3 image formats<br>
> >> 0 - imageFormat: fourcc(41424752), byteOrger(1),<br>
> bitsPerPixel(32),<br>
> >> depth(32), redM(16711680), greenM(65280),<br>
> alphaM(4278190080)<br>
> >> 1 - imageFormat: fourcc(32595559), byteOrger(1),<br>
> bitsPerPixel(16),<br>
> >> depth(0), redM(0), greenM(0), alphaM(0)<br>
> >> 2 - imageFormat: fourcc(32315659), byteOrger(1),<br>
> bitsPerPixel(12),<br>
> >> depth(0), redM(0), greenM(0), alphaM(0)<br>
> >> imageinfo: w:14, h:0, data_size:3075098360,<br>
> planes:3073595636,<br>
> >> palettes:2195, bytes:-1221371576, comp_order q·,<br>
> fourcc:bfa809f0<br>
> >> pitch[0]=4131212846, offset[0]=0<br>
> >> pitch[1]=3075553328, offset[1]=0<br>
> >> pitch[2]=18, offset[2]=1<br>
> >> surface status: 4<br>
> >> vaDeriveImage<br>
> >> imageinfo: w:512, h:32, data_size:16384, planes:2,<br>
> palettes:0,<br>
> >> bytes:0, comp_orderYUV, fourcc:3231564e<br>
> >> pitch[0]=512, offset[0]=0<br>
> >> pitch[1]=512, offset[1]=16384<br>
> >> pitch[2]=0, offset[2]=0<br>
> >> img:0xb6bf9000, size:16384<br>
> >> 24576 bytes written<br>
> >> press any key to exit<br>
> >><br>
> ><br>
> > For the above info about the vaDeriveImage, it seems that<br>
> fourcc,<br>
> > pitches/offset is right.<br>
> > Fourcc: 3231564E: (NV12 format).<br>
> > pitches and offsets are also right.<br>
> ><br>
> > What is wrong when you try to read the image by using the<br>
> above example<br>
> > code?<br>
> ><br>
> >> OS: Linux Debian Squeeze<br>
> >><br>
> >> Driver: EMGD 1.10<br>
> >><br>
> >> Xorg: 1.10<br>
> >><br>
> >> What do you whant to know about platform?<br>
> >><br>
> >><br>
> >> --<br>
> >> -----------------------------------------<br>
> >> σ υΧΑΦΕΞΙΕΝ, λΜΟήΛΟΧ χ.χ.<br>
> >> mailto: <a href="mailto:kwispost@gmail.com">kwispost@gmail.com</a><br>
> ><br>
> ><br>
><br>
> > _______________________________________________<br>
> > Libva mailing list<br>
> > <a href="mailto:Libva@lists.freedesktop.org">Libva@lists.freedesktop.org</a><br>
> > <a href="http://lists.freedesktop.org/mailman/listinfo/libva" target="_blank">http://lists.freedesktop.org/mailman/listinfo/libva</a><br>
><br>
><br>
><br>
> --<br>
> -----------------------------------------<br>
> σ υΧΑΦΕΞΙΕΝ, λΜΟήΛΟΧ χ.χ.<br>
> mailto: <a href="mailto:kwispost@gmail.com">kwispost@gmail.com</a><br>
<br>
<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>-----------------------------------------<br>σ υΧΑΦΕΞΙΕΝ, λΜΟήΛΟΧ χ.χ.<br>mailto: <a href="mailto:kwispost@gmail.com" target="_blank">kwispost@gmail.com</a>
</div></div>