summaryrefslogtreecommitdiff
path: root/libavcodec/motion_est_template.c
diff options
context:
space:
mode:
authorGanesh Ajjanagadde <gajjanagadde@gmail.com>2015-09-26 16:24:01 +0200
committerVittorio Giovara <vittorio.giovara@gmail.com>2015-09-29 14:33:00 +0200
commit4885bde3187a2bb0cae85b67796e07db233bf77f (patch)
treec824827d2232685bb53d9dea1bc9ba8d57e4e9b2 /libavcodec/motion_est_template.c
parent977f41e274a66c9d257186ca1df8373a09cc4d40 (diff)
motion_est_template: Fix undefined left shift of negative number
This fixes a -Wshift-negative-value warning reported with clang 3.7+. Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Diffstat (limited to 'libavcodec/motion_est_template.c')
-rw-r--r--libavcodec/motion_est_template.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/motion_est_template.c b/libavcodec/motion_est_template.c
index 01936c6a83..33f3dcb5de 100644
--- a/libavcodec/motion_est_template.c
+++ b/libavcodec/motion_est_template.c
@@ -704,7 +704,8 @@ static int sab_diamond_search(MpegEncContext * s, int *best, int dmin,
key += (1<<(ME_MAP_MV_BITS-1)) + (1<<(2*ME_MAP_MV_BITS-1));
- if((key&((-1)<<(2*ME_MAP_MV_BITS))) != map_generation) continue;
+ if ((key & (-(1 << (2 * ME_MAP_MV_BITS)))) != map_generation)
+ continue;
minima[j].height= score_map[i];
minima[j].x= key & ((1<<ME_MAP_MV_BITS)-1); key>>=ME_MAP_MV_BITS;