projects
/
ffmpeg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
60f10e0
)
mpeg12enc: use sign_extend() function
author
Mans Rullgard
<mans@mansr.com>
Sat, 8 Oct 2011 11:56:54 +0000
(12:56 +0100)
committer
Mans Rullgard
<mans@mansr.com>
Sun, 9 Oct 2011 12:58:17 +0000
(13:58 +0100)
Signed-off-by: Mans Rullgard <mans@mansr.com>
libavcodec/mpeg12enc.c
patch
|
blob
|
history
diff --git
a/libavcodec/mpeg12enc.c
b/libavcodec/mpeg12enc.c
index
79c46be
..
f4455be
100644
(file)
--- a/
libavcodec/mpeg12enc.c
+++ b/
libavcodec/mpeg12enc.c
@@
-27,6
+27,7
@@
#include "avcodec.h"
#include "dsputil.h"
+#include "mathops.h"
#include "mpegvideo.h"
#include "mpeg12.h"
@@
-690,8
+691,7
@@
static void mpeg1_encode_motion(MpegEncContext *s, int val, int f_or_b_code)
int bit_size = f_or_b_code - 1;
int range = 1 << bit_size;
/* modulo encoding */
- int l= INT_BIT - 5 - bit_size;
- val= (val<<l)>>l;
+ val = sign_extend(val, 5 + bit_size);
if (val >= 0) {
val--;