hevc: simplify rounding
authorChristophe Gisquet <christophe.gisquet@gmail.com>
Thu, 10 Jul 2014 06:47:55 +0000 (06:47 +0000)
committerAnton Khirnov <anton@khirnov.net>
Tue, 12 Aug 2014 09:57:25 +0000 (09:57 +0000)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
libavcodec/hevc_mvs.c

index 2fe4dbbed601ad1c3af5148c2f5062f4dff02479..7fa418b15bda5207b9ba798b3f5c3828045c83b6 100644 (file)
@@ -271,8 +271,8 @@ static int temporal_luma_motion_vector(HEVCContext *s, int x0, int y0,
         (y0 >> s->sps->log2_ctb_size) == (y >> s->sps->log2_ctb_size) &&
         y < s->sps->height &&
         x < s->sps->width) {
-        x                  = ((x >> 4) << 4);
-        y                  = ((y >> 4) << 4);
+        x                 &= ~15;
+        y                 &= ~15;
         x_pu               = x >> s->sps->log2_min_pu_size;
         y_pu               = y >> s->sps->log2_min_pu_size;
         temp_col           = TAB_MVF(x_pu, y_pu);
@@ -283,8 +283,8 @@ static int temporal_luma_motion_vector(HEVCContext *s, int x0, int y0,
     if (tab_mvf && !availableFlagLXCol) {
         x                  = x0 + (nPbW >> 1);
         y                  = y0 + (nPbH >> 1);
-        x                  = ((x >> 4) << 4);
-        y                  = ((y >> 4) << 4);
+        x                 &= ~15;
+        y                 &= ~15;
         x_pu               = x >> s->sps->log2_min_pu_size;
         y_pu               = y >> s->sps->log2_min_pu_size;
         temp_col           = TAB_MVF(x_pu, y_pu);