diff options
author | Gwenole Beauchesne <gwenole.beauchesne@intel.com> | 2014-06-05 21:36:33 +0200 |
---|---|---|
committer | Xiang, Haihao <haihao.xiang@intel.com> | 2014-06-16 11:53:35 +0800 |
commit | 143c53900943c660390122f7fa4a1c5705798fdd (patch) | |
tree | b6af55d593976e900b46d57c7bdeaaed2fa143bc /src/gen75_mfd.c | |
parent | d2262e37a4737d0d03004c0b34165180ddb1d956 (diff) | |
download | libva-intel-driver-143c53900943c660390122f7fa4a1c5705798fdd.tar.gz libva-intel-driver-143c53900943c660390122f7fa4a1c5705798fdd.tar.bz2 libva-intel-driver-143c53900943c660390122f7fa4a1c5705798fdd.zip |
decoder: h264: fix frame store logic for MVC.
In strict MVC decoding mode, when only the necessary set of inter-view
reference pictures are passed to the ReferenceFrames array for decoding
the current picture, we should not re-use a frame store id that might
be needed for decoding another view component in the same access unit.
One way to solve this problem is to track when the VA surface in a
specified frame store id was last referenced. So, a "ref_age" field
is introduced to the GenFrameStore struct and is updated whenever
the surface is being referenced.
Additionally, the list of retired refs candidates (free_refs) is kept
ordered by increasing ref_age. That way, we can immediately know what
is the oldest frame store id to recycle.
Let deltaAge = CurrAge - RefAge:
If deltaAge > 1, we know for sure that the VA surface is gone ;
If deltaAge = 1, the surface could be re-used for inter prediction ;
If deltaAge = 0, the surface could be re-used for inter-view prediction.
The ref_age in each Frame Store entry is always current, i.e. it is
the same for all reference frames that intervened in the decoding
process of all inter view components of the previous access unit. The
age tracks access units.
v2: used a more correct representation of age, instead of POC [Yakui]
v3: minor optimization for detecting changes of access unit [Haihao]
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
(cherry picked from commit 3b5eb0522fbfe1220dcd0c0bb093a93cfc25e22c)
Diffstat (limited to 'src/gen75_mfd.c')
-rw-r--r-- | src/gen75_mfd.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/gen75_mfd.c b/src/gen75_mfd.c index a1d004b..a89640d 100644 --- a/src/gen75_mfd.c +++ b/src/gen75_mfd.c @@ -67,6 +67,7 @@ gen75_mfd_init_avc_surface(VADriverContextP ctx, if (!gen7_avc_surface) { gen7_avc_surface = calloc(sizeof(GenAvcSurface), 1); + gen7_avc_surface->frame_store_id = -1; assert((obj_surface->size & 0x3f) == 0); obj_surface->private_data = gen7_avc_surface; } |