hevc_mvs: avoid deriving tmvp in amvp
authorChristophe Gisquet <christophe.gisquet@gmail.com>
Fri, 8 Aug 2014 18:21:04 +0000 (18:21 +0000)
committerAnton Khirnov <anton@khirnov.net>
Tue, 12 Aug 2014 10:13:43 +0000 (10:13 +0000)
Reduces the number of calls to tmvp derivation from 933685 to 586271 on
a sequence.

Reviewed-by: Mickaƫl Raulet <mraulet@insa-rennes.fr>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
libavcodec/hevc_mvs.c

index 4d0f302..cc5a16c 100644 (file)
@@ -828,7 +828,8 @@ void ff_hevc_luma_mv_mvp_mode(HEVCContext *s, int x0, int y0, int nPbW,
         mvpcand_list[numMVPCandLX++] = mxB;
 
     //temporal motion vector prediction candidate
-    if (numMVPCandLX < 2 && s->sh.slice_temporal_mvp_enabled_flag) {
+    if (numMVPCandLX < 2 && s->sh.slice_temporal_mvp_enabled_flag &&
+        mvp_lx_flag == numMVPCandLX) {
         Mv mv_col;
         int available_col = temporal_luma_motion_vector(s, x0, y0, nPbW,
                                                         nPbH, ref_idx,