<div dir="ltr"><div><div>>>>Fourcc: 3231564E: (NV12 format).<br></div>In va/va.h file 3231564E is NV11 format.<br><br>>>>What is wrong when you try to read the image by using the above example<br>
code?<br></div>Nothing. I can get valid image using pithches and offsets. But I am afraid of wrong data size. Who can <span id="result_box" class="" lang="en"><span class="">guarantee that my code do not crash outside the image.data_size?<br>
</span></span><br>Gwenole, thank you.<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 19 April 2013 20:10, Gwenole Beauchesne <span dir="ltr"><<a href="mailto:gb.devel@gmail.com" target="_blank">gb.devel@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
This is an issue in the EMGD driver that is still present in version 1.16.<br>
<br>
The dimensions are not reported correctly in the resulting VAImage,<br>
though the pitch information is. Please report a bug in Intel Premier.<br>
Another test application is hwdecode-demos with vaapi_h264 invoked<br>
with --getimage for example. The VAImage.{width,height} fields should<br>
match the VA surface dimensions. The VAImage.pitches[] can 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>
<div><div class="h5">> 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>> wrote:<br>
>> On Tue, 2013-04-16 at 12:26 -0600, kwisp wrote:<br>
>> > I use standart libva example<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 after decoding<br>
>> and<br>
>> > recieve stange VAImage.<br>
>> ><br>
>> > image.width = 512 image.height = 32 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 format I<br>
>> see correct<br>
>> > picture.<br>
>> ><br>
>><br>
><br>
> The vaDeriveImage is used to read/write the image content from the<br>
> corresponding decoded buffer. And we don't need to care whether the<br>
> width/height of derived image is different with real image size(The<br>
> width/height of derived image is determined by the video hardware).<br>
> We should follow the corresponding offset/pitches to read the buffer.<br>
><br>
>><br>
>> Will you please describe how you call the 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), bitsPerPixel(32),<br>
>> depth(32), redM(16711680), greenM(65280), alphaM(4278190080)<br>
>> 1 - imageFormat: fourcc(32595559), byteOrger(1), bitsPerPixel(16),<br>
>> depth(0), redM(0), greenM(0), alphaM(0)<br>
>> 2 - imageFormat: fourcc(32315659), byteOrger(1), bitsPerPixel(12),<br>
>> depth(0), redM(0), greenM(0), alphaM(0)<br>
>> imageinfo: w:14, h:0, data_size:3075098360, planes:3073595636,<br>
>> palettes:2195, bytes:-1221371576, comp_order q·, 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, 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 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 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>
</div></div>> _______________________________________________<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>
</blockquote></div><br><br clear="all"><br>-- <br>-----------------------------------------<br>σ υΧΑΦΕΞΙΕΝ, λΜΟήΛΟΧ χ.χ.<br>mailto: <a href="mailto:kwispost@gmail.com" target="_blank">kwispost@gmail.com</a>
</div>