libmix: increase DPB_SIZE to handle H264 stream with 16 reference frames.
BZ: 10408
Current DPB_SIZE for H264 is set to 16, if reference frame number reaches maximum 16
and the frame to be decoded is a referencs as well, no left buffer node for current frame
and one reference frame will be replaced, which leads to decoding error due to missing reference.
Change-Id: If88bb5cc17384f1c5dcec21fdf5b517625b48c17
Reviewed-on: http://android.intel.com:8080/19993
Reviewed-by: Tang, Guifang <guifang.tang@intel.com>
Reviewed-by: Qiu, Junhai <junhai.qiu@intel.com>
Reviewed-by: Chen, Weian <weian.chen@intel.com>
Tested-by: Ding, Haitao <haitao.ding@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
diff --git a/videodecoder/VideoDecoderAVC.cpp b/videodecoder/VideoDecoderAVC.cpp
index a415a20..27c1e1d 100644
--- a/videodecoder/VideoDecoderAVC.cpp
+++ b/videodecoder/VideoDecoderAVC.cpp
@@ -388,7 +388,7 @@
picParam->CurrPic.picture_id = mAcquiredBuffer->renderBuffer.surface;
// build new DPB
- for (int32_t i = 0; i < DPB_SIZE; i++, ref++) {
+ for (int32_t i = 0; i < MAX_REF_NUMBER; i++, ref++) {
if (ref->flags & VA_PICTURE_H264_INVALID) {
continue;
}
diff --git a/videodecoder/VideoDecoderAVC.h b/videodecoder/VideoDecoderAVC.h
index 2d8d1b6..c3a1fe5 100644
--- a/videodecoder/VideoDecoderAVC.h
+++ b/videodecoder/VideoDecoderAVC.h
@@ -67,7 +67,8 @@
enum {
AVC_EXTRA_SURFACE_NUMBER = 6,
// maximum DPB (Decoded Picture Buffer) size
- DPB_SIZE = 16,
+ MAX_REF_NUMBER = 16,
+ DPB_SIZE = 17, // DPB_SIZE = MAX_REF_NUMBER + 1,
REF_LIST_SIZE = 32,
};