shithub: libvpx

Download patch

ref: 502912de3ab0b9a1b6d66eece92443c146f8177c
parent: 03b2ae16f2bb904ff491bc6ee6e82dc9c414c93d
author: Yaowu Xu <yaowu@google.com>
date: Mon Oct 28 05:02:42 EDT 2013

changed to comply with strict aliasing rule

The clamp operation may not affect the values of the final assigned mv
where compiler may make use of strict aliasing rule to optimize out the
clamp operation. This change made the code segments to better comply
the strict aliasing rule.

Change-Id: I24502ff18bd4f9e62507a879cc8760a91a0fd07e

--- a/vp8/decoder/decodemv.c
+++ b/vp8/decoder/decodemv.c
@@ -512,15 +512,15 @@
                 else
                 {
                     mbmi->mode =  NEARMV;
-                    vp8_clamp_mv2(&near_mvs[CNT_NEAR], &pbi->mb);
                     mbmi->mv.as_int = near_mvs[CNT_NEAR].as_int;
+                    vp8_clamp_mv2(&mbmi->mv, &pbi->mb);
                 }
             }
             else
             {
                 mbmi->mode =  NEARESTMV;
-                vp8_clamp_mv2(&near_mvs[CNT_NEAREST], &pbi->mb);
                 mbmi->mv.as_int = near_mvs[CNT_NEAREST].as_int;
+                vp8_clamp_mv2(&mbmi->mv, &pbi->mb);
             }
         }
         else