]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/vp9mvs.c
libxvid: Use proper context in av_log() calls
[ffmpeg] / libavcodec / vp9mvs.c
index a4ce84c5f36fe63d7d0f8508348d7ddf4c9d4856..dde0e84355acf6e9d9977e37a9622795887b26e1 100644 (file)
@@ -64,7 +64,7 @@ static void find_ref_mvs(VP9Context *s,
         [BS_4x4]   = { {  0, -1 }, { -1,  0 }, { -1, -1 }, {  0, -2 },
                        { -2,  0 }, { -1, -2 }, { -2, -1 }, { -2, -2 } },
     };
-    VP9Block *const b = &s->b;
+    VP9Block *b = s->b;
     int row = b->row, col = b->col, row7 = b->row7;
     const int8_t (*p)[2] = mv_ref_blk_off[b->bs];
 #define INVALID_MV 0x80008000U
@@ -164,6 +164,9 @@ static void find_ref_mvs(VP9Context *s,
     if (s->use_last_frame_mvs) {
         VP9MVRefPair *mv = &s->frames[LAST_FRAME].mv[row * s->sb_cols * 8 + col];
 
+        if (!s->last_uses_2pass)
+            ff_thread_await_progress(&s->frames[LAST_FRAME].tf, row >> 3, 0);
+
         if (mv->ref[0] == ref)
             RETURN_MV(mv->mv[0]);
         else if (mv->ref[1] == ref)
@@ -205,6 +208,7 @@ static void find_ref_mvs(VP9Context *s,
     if (s->use_last_frame_mvs) {
         VP9MVRefPair *mv = &s->frames[LAST_FRAME].mv[row * s->sb_cols * 8 + col];
 
+        // no need to await_progress, because we already did that above
         if (mv->ref[0] != ref && mv->ref[0] >= 0)
             RETURN_SCALE_MV(mv->mv[0],
                             s->signbias[mv->ref[0]] != s->signbias[ref]);
@@ -279,7 +283,7 @@ static av_always_inline int read_mv_component(VP9Context *s, int idx, int hp)
 
 void ff_vp9_fill_mv(VP9Context *s, VP56mv *mv, int mode, int sb)
 {
-    VP9Block *const b = &s->b;
+    VP9Block *b = s->b;
 
     if (mode == ZEROMV) {
         memset(mv, 0, sizeof(*mv) * 2);