[x264-devel] MBAFF: Clamp MVDs to 66 instead of 33

Simon Horlick git at videolan.org
Thu May 12 08:39:01 CEST 2011


x264 | branch: master | Simon Horlick <simonhorlick at gmail.com> | Tue Mar 29 15:47:04 2011 +0100| [1f07f3253003ec1ff7ce7059eac7f689c3ec6f49] | committer: Jason Garrett-Glaser

MBAFF: Clamp MVDs to 66 instead of 33

> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=1f07f3253003ec1ff7ce7059eac7f689c3ec6f49
---

 encoder/cabac.c |    4 ++--
 encoder/me.c    |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/encoder/cabac.c b/encoder/cabac.c
index e04f14b..22c1ce3 100644
--- a/encoder/cabac.c
+++ b/encoder/cabac.c
@@ -424,9 +424,9 @@ static ALWAYS_INLINE int x264_cabac_mb_mvd_cpn( x264_t *h, x264_cabac_t *cb, int
         x264_cabac_encode_bypass( cb, mvd >> 31 );
     }
 #endif
-    /* Since we don't need to keep track of MVDs larger than 33, just cap the value.
+    /* Since we don't need to keep track of MVDs larger than 66, just cap the value.
      * This lets us store MVDs as 8-bit values instead of 16-bit. */
-    return X264_MIN( i_abs, 33 );
+    return X264_MIN( i_abs, 66 );
 }
 
 static NOINLINE uint16_t x264_cabac_mb_mvd( x264_t *h, x264_cabac_t *cb, int i_list, int idx, int width )
diff --git a/encoder/me.c b/encoder/me.c
index 72e486a..38f27ec 100644
--- a/encoder/me.c
+++ b/encoder/me.c
@@ -1226,7 +1226,7 @@ void x264_me_refine_qpel_rd( x264_t *h, x264_me_t *m, int i_lambda2, int i4, int
     m->mv[0] = bmx;
     m->mv[1] = bmy;
     x264_macroblock_cache_mv ( h, block_idx_x[i4], block_idx_y[i4], bw>>2, bh>>2, i_list, pack16to32_mask(bmx, bmy) );
-    amvd = pack8to16( X264_MIN(abs(bmx - m->mvp[0]),33), X264_MIN(abs(bmy - m->mvp[1]),33) );
+    amvd = pack8to16( X264_MIN(abs(bmx - m->mvp[0]),66), X264_MIN(abs(bmy - m->mvp[1]),66) );
     x264_macroblock_cache_mvd( h, block_idx_x[i4], block_idx_y[i4], bw>>2, bh>>2, i_list, amvd );
     h->mb.b_skip_mc = 0;
 }



More information about the x264-devel mailing list