diff options
author | Xiang, Haihao <haihao.xiang@intel.com> | 2014-06-19 16:49:54 +0800 |
---|---|---|
committer | Xiang, Haihao <haihao.xiang@intel.com> | 2014-12-14 00:42:17 +0800 |
commit | 89d4bf26ffa8571fdf07cc34d8053cda7fb56ca7 (patch) | |
tree | 98b09e7f02ab48d9cab662a901bc57fd21460244 /src/intel_media_common.c | |
parent | 9b573e880081692c4db15b8f03b49bf5e4ff9021 (diff) |
HEVC: append a motion vector temporal buffer to a VA surface
It is the current motion vector temporal buffer to the decoded
current surface, and the collocated motion verctor temporal buffer
for reference surface
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
(cherry picked from commit 1b1019020ebe3064bd0320bcc1391cc73c9b596c)
Diffstat (limited to 'src/intel_media_common.c')
-rw-r--r-- | src/intel_media_common.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/intel_media_common.c b/src/intel_media_common.c index 504f9d9..f0e1cae 100644 --- a/src/intel_media_common.c +++ b/src/intel_media_common.c @@ -82,3 +82,28 @@ int intel_format_convert(float src, int out_int_bits, int out_frac_bits,int out_ } return output_value; } + +static pthread_mutex_t free_hevc_surface_lock = PTHREAD_MUTEX_INITIALIZER; + +void +gen_free_hevc_surface(void **data) +{ + GenHevcSurface *hevc_surface; + + pthread_mutex_lock(&free_hevc_surface_lock); + + hevc_surface = *data; + + if (!hevc_surface) { + pthread_mutex_unlock(&free_hevc_surface_lock); + return; + } + + dri_bo_unreference(hevc_surface->motion_vector_temporal_bo); + hevc_surface->motion_vector_temporal_bo = NULL; + + free(hevc_surface); + *data = NULL; + + pthread_mutex_unlock(&free_hevc_surface_lock); +} |