hardware/intel/intel-driver
Revision | d9572c8d11198f0624ac1aed44c41c0e5930098e (tree) |
---|---|
Zeit | 2015-12-07 14:31:29 |
Autor | Pengfei Qu <Pengfei.Qu@inte...> |
Commiter | Xiang, Haihao |
VP9 HWDec:add vp9 surface structure and related parameter
Signed-off-by: Pengfei Qu <Pengfei.Qu@intel.com>
Signed-off-by: Sirisha Muppavarapu <sirisha.muppavarapu@intel.com>
Signed-off-by: peng.chen <peng.c.chen@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
(cherry picked from commit f36ab3413f814c80f4df4f4570f4ef9a1168b624)
@@ -437,6 +437,9 @@ | ||
437 | 437 | #define HCP_PAK_OBJECT HCP(0x21) |
438 | 438 | #define HCP_INSERT_PAK_OBJECT HCP(0x22) |
439 | 439 | |
440 | +#define HCP_VP9_SEGMENT_STATE HCP(0x32) | |
441 | +#define HCP_VP9_PIC_STATE HCP(0x30) | |
442 | + | |
440 | 443 | #define I965_DEPTHFORMAT_D32_FLOAT 1 |
441 | 444 | |
442 | 445 | #define BASE_ADDRESS_MODIFY (1 << 0) |
@@ -906,6 +909,12 @@ | ||
906 | 909 | |
907 | 910 | #define HCP_CODEC_HEVC 0 |
908 | 911 | |
912 | +#define HCP_CODEC_VP9 1 | |
913 | +#define HCP_VP9_KEY_FRAME 0 | |
914 | +#define HCP_VP9_INTER_FRAME 1 | |
915 | +#define HCP_VP9_PROFILE0 0 /* 8 bit 420 only */ | |
916 | +#define HCP_VP9_PROFILE2 2 /* 10 bits 420 only */ | |
917 | + | |
909 | 918 | #define HCP_CODEC_SELECT_DECODE 0 |
910 | 919 | #define HCP_CODEC_SELECT_ENCODE 1 |
911 | 920 |
@@ -59,6 +59,17 @@ struct gen_hevc_surface | ||
59 | 59 | dri_bo *motion_vector_temporal_bo; |
60 | 60 | }; |
61 | 61 | |
62 | +typedef struct gen_vp9_surface GenVP9Surface; | |
63 | +struct gen_vp9_surface | |
64 | +{ | |
65 | + GenCodecSurface base; | |
66 | + uint16_t frame_width; | |
67 | + uint16_t frame_height; | |
68 | + dri_bo *motion_vector_temporal_bo; | |
69 | +}; | |
70 | + | |
62 | 71 | extern void gen_free_hevc_surface(void **data); |
63 | 72 | |
73 | +extern void gen_free_vp9_surface(void **data); | |
74 | + | |
64 | 75 | #endif /* INTEL_MEDIA_H */ |
@@ -107,3 +107,27 @@ gen_free_hevc_surface(void **data) | ||
107 | 107 | |
108 | 108 | pthread_mutex_unlock(&free_hevc_surface_lock); |
109 | 109 | } |
110 | + | |
111 | +static pthread_mutex_t free_vp9_surface_lock = PTHREAD_MUTEX_INITIALIZER; | |
112 | + | |
113 | +void gen_free_vp9_surface(void **data) | |
114 | +{ | |
115 | + GenVP9Surface *vp9_surface; | |
116 | + | |
117 | + pthread_mutex_lock(&free_vp9_surface_lock); | |
118 | + | |
119 | + vp9_surface = *data; | |
120 | + | |
121 | + if (!vp9_surface) { | |
122 | + pthread_mutex_unlock(&free_vp9_surface_lock); | |
123 | + return; | |
124 | + } | |
125 | + | |
126 | + dri_bo_unreference(vp9_surface->motion_vector_temporal_bo); | |
127 | + vp9_surface->motion_vector_temporal_bo = NULL; | |
128 | + | |
129 | + free(vp9_surface); | |
130 | + *data = NULL; | |
131 | + | |
132 | + pthread_mutex_unlock(&free_vp9_surface_lock); | |
133 | +} |