intel / intel-vaapi-driver

VA-API user mode driver for Intel GEN Graphics family
https://01.org/linuxmedia
Other
303 stars 126 forks source link

vaGetImage() doesn't fill the last column and row in chroma plane if the dimension is odd #516

Closed rosetta-jpn closed 4 years ago

rosetta-jpn commented 4 years ago

The title describes the issue. I found this bug when I map an odd dimension frame (e.g. 321x241) with VA Image by vaCreateImage() and vaGetImage(). In this case, chroma plane size is 161x121. vaCreateImage() allocates so, but I suspect vaGetImage() fills up to 160x120. If I change the part of code to vaDeriveImage(), the issue was gone.

sreerenjb commented 4 years ago

Any Sample code to share? Is there a corresponding chromeos bug open somewhere? @xhaihao ping

sreerenjb commented 4 years ago

Reproducible with gst: gst-launch-1.0 -v videotestsrc ! videoscale ! video/x-raw, width=321, height=241 ! vaapipostproc ! xvimagesink

xhaihao commented 4 years ago

@sreerenjb @rosetta-jpn Could you give a try with https://github.com/xhaihao/intel-vaapi-driver/tree/fix-odd-resolution on your side? It works on my SKL.

sreerenjb commented 4 years ago

@xhaihao Yup, it is fixing the GStreamer pipeline for sure. Tested on KBL.

sreerenjb commented 4 years ago

Thank you Haihao

sreerenjb commented 4 years ago

@xhaihao HIro confirmed that it fixed the chrome issue too. Can you please merge the fix?

rosetta-jpn commented 4 years ago

Haihao, gentle ping.

xhaihao commented 4 years ago

@sreerenjb @rosetta-jpn Thanks for testing the patch, I will submit a PR ASAP.