summaryrefslogtreecommitdiff
path: root/src/i965_decoder_utils.c
diff options
context:
space:
mode:
authorPeng Chen <peng.c.chen@intel.com>2015-06-15 22:28:22 +0800
committerXiang, Haihao <haihao.xiang@intel.com>2015-12-07 12:29:56 +0800
commit5ec92f48aeff12c7db0a96b65aca44feb4965d92 (patch)
tree07cffd63b2a3347a5b9c90a618e706b8d3cc17e8 /src/i965_decoder_utils.c
parent70fe9ba8cf83e27c48f80767565149c7d40ea665 (diff)
downloadlibva-intel-driver-5ec92f48aeff12c7db0a96b65aca44feb4965d92.tar.gz
support HEVC 10bits decoding
v2: code cleanup v3: store shift in an int to make it more readable (Emil) Signed-off-by: Peng Chen <peng.c.chen@intel.com> Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com> Reviewed-by: Zhao Yakui <yakui.zhao@intel.com> Cc: Emil Velikov <emil.l.velikov@gmail.com>
Diffstat (limited to 'src/i965_decoder_utils.c')
-rw-r--r--src/i965_decoder_utils.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/i965_decoder_utils.c b/src/i965_decoder_utils.c
index 3085a56c..53a5aa18 100644
--- a/src/i965_decoder_utils.c
+++ b/src/i965_decoder_utils.c
@@ -1121,9 +1121,26 @@ hevc_ensure_surface_bo(
)
{
VAStatus va_status = VA_STATUS_SUCCESS;
+ int update = 0;
+ unsigned int fourcc = VA_FOURCC_NV12;
+
+ if((pic_param->bit_depth_luma_minus8 > 0)
+ || (pic_param->bit_depth_chroma_minus8 > 0))
+ {
+ if(obj_surface->fourcc != VA_FOURCC_P010)
+ {
+ update = 1;
+ fourcc = VA_FOURCC_P010;
+ }
+ }
+ else if(obj_surface->fourcc != VA_FOURCC_NV12)
+ {
+ update = 1;
+ fourcc = VA_FOURCC_NV12;
+ }
/* (Re-)allocate the underlying surface buffer store, if necessary */
- if (!obj_surface->bo || obj_surface->fourcc != VA_FOURCC_NV12) {
+ if (!obj_surface->bo || update) {
struct i965_driver_data * const i965 = i965_driver_data(ctx);
i965_destroy_surface_storage(obj_surface);
@@ -1131,7 +1148,7 @@ hevc_ensure_surface_bo(
va_status = i965_check_alloc_surface_bo(ctx,
obj_surface,
i965->codec_info->has_tiled_surface,
- VA_FOURCC_NV12,
+ fourcc,
SUBSAMPLE_YUV420);
}