Bug 91624 - [SKL] hwaccel putimage doesn't check format
Summary: [SKL] hwaccel putimage doesn't check format
Status: ASSIGNED
Alias: None
Product: libva
Classification: Unclassified
Component: intel (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: PengChen
QA Contact: Sean V Kelley
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-13 14:58 UTC by Víctor Jáquez
Modified: 2016-12-14 01:00 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
test case (260.93 KB, application/x-compressed-tar)
2015-08-13 14:58 UTC, Víctor Jáquez
Details

Description Víctor Jáquez 2015-08-13 14:58:41 UTC
Created attachment 117666 [details]
test case

Right now gstreamer-vaapi uses vaPutImage for encoding (jpeg encoding in this particular case).

When adding support for other input video formats[1], I just found that the i965_hw_putimage() doesn't handle the case when the surface and the image have different color format.

Looking at i965_sw_putimage(), it does (triggers an error).

In the case of i965_hw_putimage(), as far as I understand, the postprocessor is used for the color conversion, nonetheless the generated jpeg image is corrupted.

I attach a minimal case-test:

$ make run
$ display tulips_uyvy.jpg

You can "fix" the output changing the define SAMEFORMAT to 1

1. https://bugzilla.gnome.org/show_bug.cgi?id=744042
Comment 1 Víctor Jáquez 2016-04-21 09:29:06 UTC
Comment on attachment 117666 [details]
test case

fix mime type
Comment 2 Víctor Jáquez 2016-04-21 09:30:13 UTC
$ wget https://bugs.freedesktop.org/attachment.cgi?id=117666 -O test.tgz

$ tar tf test.tgz 
jpeg-enc-test/
jpeg-enc-test/Makefile
jpeg-enc-test/bug.c
jpeg-enc-test/huff.h
jpeg-enc-test/tulips_uyvy422_prog_packed_qcif.yuv
Comment 3 PengChen 2016-12-14 01:00:27 UTC
    if (HAS_ACCELERATED_GETIMAGE(i965))
        va_status = i965_hw_getimage(ctx, obj_surface, obj_image, &rect);
    else
        va_status = i965_sw_getimage(ctx, obj_surface, obj_image, &rect);

above is the latest implementation, if the hardware has VPP, it only select i965_hw_getimage() no mater what the color format it is. and i965_hw_getimage() do support some color formats conversion. if the comment has some mistake or misunderstanding, just feel free to let me know.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.