summaryrefslogtreecommitdiff
path: root/src/i965_decoder_utils.c
diff options
context:
space:
mode:
authorGwenole Beauchesne <gwenole.beauchesne@intel.com>2014-05-16 17:04:55 +0200
committerXiang, Haihao <haihao.xiang@intel.com>2014-06-16 11:53:35 +0800
commitc4344dc2d58eedc2f3c07cb8ac512b3ee2a6477d (patch)
tree0d082481e94d11fccae1e9c9d34991426aa989da /src/i965_decoder_utils.c
parentdcd97d032e4a236954f142d2adeed2f57ac65079 (diff)
downloadlibva-intel-driver-c4344dc2d58eedc2f3c07cb8ac512b3ee2a6477d.tar.gz
libva-intel-driver-c4344dc2d58eedc2f3c07cb8ac512b3ee2a6477d.tar.bz2
libva-intel-driver-c4344dc2d58eedc2f3c07cb8ac512b3ee2a6477d.zip
decoder: h264: factor out look ups for VA/H264 picture info.
Add new avc_find_picture() helper function to search for a VAPictureH264 struct based on the supplied VA surface id. Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com> (cherry picked from commit 3f4f9fc2893af24b7e88f44b6350a5a74d49f0c2)
Diffstat (limited to 'src/i965_decoder_utils.c')
-rw-r--r--src/i965_decoder_utils.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/i965_decoder_utils.c b/src/i965_decoder_utils.c
index ae17bd5..3239212 100644
--- a/src/i965_decoder_utils.c
+++ b/src/i965_decoder_utils.c
@@ -254,6 +254,23 @@ avc_gen_default_iq_matrix(VAIQMatrixBufferH264 *iq_matrix)
memset(&iq_matrix->ScalingList8x8, 16, sizeof(iq_matrix->ScalingList8x8));
}
+/* Finds the VA/H264 picture associated with the specified VA surface id */
+VAPictureH264 *
+avc_find_picture(VASurfaceID id, VAPictureH264 *pic_list, int pic_list_count)
+{
+ int i;
+
+ if (id != VA_INVALID_ID) {
+ for (i = 0; i < pic_list_count; i++) {
+ VAPictureH264 * const va_pic = &pic_list[i];
+ if (va_pic->picture_id == id &&
+ !(va_pic->flags & VA_PICTURE_H264_INVALID))
+ return va_pic;
+ }
+ }
+ return NULL;
+}
+
/* Get first macroblock bit offset for BSD, minus EPB count (AVC) */
/* XXX: slice_data_bit_offset does not account for EPB */
unsigned int