summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGwenole Beauchesne <gwenole.beauchesne@intel.com>2014-05-09 18:15:23 +0200
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>2014-06-02 19:30:43 +0200
commite29345cbdc26d5e4c6729100344eb8dbf9e35b65 (patch)
treed414f746bc03453d9ffc38ce563010f5428ade63
parent9200fe231e1ffe249e17c8146303eeae6338aa06 (diff)
downloadlibva-intel-driver-e29345cbdc26d5e4c6729100344eb8dbf9e35b65.tar.gz
libva-intel-driver-e29345cbdc26d5e4c6729100344eb8dbf9e35b65.tar.bz2
libva-intel-driver-e29345cbdc26d5e4c6729100344eb8dbf9e35b65.zip
config: fix supported set of chroma formats for JPEG decode.
If the hardware supports JPEG decoding, then we have to expose the right set of chroma formats for the output (decoded) VA surface. In particular, we could support YUV 4:0:0, 4:1:0, 4:2:2 and 4:4:4. v2: export support for YUV 4:0:0 (grayscale) too [Haihao] Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
-rw-r--r--src/i965_device_info.c11
-rwxr-xr-xsrc/i965_drv_video.c5
-rw-r--r--src/i965_drv_video.h2
3 files changed, 18 insertions, 0 deletions
diff --git a/src/i965_device_info.c b/src/i965_device_info.c
index f7ce226..1d5d6aa 100644
--- a/src/i965_device_info.c
+++ b/src/i965_device_info.c
@@ -27,6 +27,11 @@
#include <stdlib.h>
#include "i965_drv_video.h"
+/* Extra set of chroma formats supported for JPEG decoding (beyond YUV 4:2:0) */
+#define EXTRA_JPEG_DEC_CHROMA_FORMATS \
+ (VA_RT_FORMAT_YUV400 | VA_RT_FORMAT_YUV411 | VA_RT_FORMAT_YUV422 | \
+ VA_RT_FORMAT_YUV444)
+
extern struct hw_context *i965_proc_context_init(VADriverContextP, struct object_config *);
extern struct hw_context *g4x_dec_hw_context_init(VADriverContextP, struct object_config *);
extern bool genx_render_init(VADriverContextP);
@@ -115,6 +120,8 @@ static const struct hw_codec_info ivb_hw_codec_info = {
.min_linear_wpitch = 64,
.min_linear_hpitch = 16,
+ .jpeg_dec_chroma_formats = EXTRA_JPEG_DEC_CHROMA_FORMATS,
+
.has_mpeg2_decoding = 1,
.has_mpeg2_encoding = 1,
.has_h264_decoding = 1,
@@ -149,6 +156,8 @@ static const struct hw_codec_info hsw_hw_codec_info = {
.min_linear_wpitch = 64,
.min_linear_hpitch = 16,
+ .jpeg_dec_chroma_formats = EXTRA_JPEG_DEC_CHROMA_FORMATS,
+
.has_mpeg2_decoding = 1,
.has_mpeg2_encoding = 1,
.has_h264_decoding = 1,
@@ -187,6 +196,8 @@ static const struct hw_codec_info bdw_hw_codec_info = {
.min_linear_wpitch = 64,
.min_linear_hpitch = 16,
+ .jpeg_dec_chroma_formats = EXTRA_JPEG_DEC_CHROMA_FORMATS,
+
.has_mpeg2_decoding = 1,
.has_mpeg2_encoding = 1,
.has_h264_decoding = 1,
diff --git a/src/i965_drv_video.c b/src/i965_drv_video.c
index 1d4a65c..4690b62 100755
--- a/src/i965_drv_video.c
+++ b/src/i965_drv_video.c
@@ -446,6 +446,11 @@ i965_get_default_chroma_formats(VADriverContextP ctx, VAProfile profile,
uint32_t chroma_formats = VA_RT_FORMAT_YUV420;
switch (profile) {
+ case VAProfileJPEGBaseline:
+ if (HAS_JPEG_DECODING(i965) && entrypoint == VAEntrypointVLD)
+ chroma_formats |= i965->codec_info->jpeg_dec_chroma_formats;
+ break;
+
default:
break;
}
diff --git a/src/i965_drv_video.h b/src/i965_drv_video.h
index 44f61bf..a09e071 100644
--- a/src/i965_drv_video.h
+++ b/src/i965_drv_video.h
@@ -294,6 +294,8 @@ struct hw_codec_info
int min_linear_wpitch;
int min_linear_hpitch;
+ unsigned int jpeg_dec_chroma_formats;
+
unsigned int has_mpeg2_decoding:1;
unsigned int has_mpeg2_encoding:1;
unsigned int has_h264_decoding:1;