From 7e081bd859a7ca89e702e80a9f8997064d93b196 Mon Sep 17 00:00:00 2001 From: Simon Horlick Date: Tue, 29 Mar 2011 15:47:04 +0100 Subject: [PATCH] MBAFF: Clamp MVDs to 66 instead of 33 --- 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 139a3efd..ab44c172 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 a4de7ddf..d7d4972b 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; } -- 2.40.0