Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
2f329db9
Commit
2f329db9
authored
Oct 08, 2011
by
Mans Rullgard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mpeg12enc: use sign_extend() function
Signed-off-by:
Mans Rullgard
<
mans@mansr.com
>
parent
60f10e0a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
mpeg12enc.c
libavcodec/mpeg12enc.c
+2
-2
No files found.
libavcodec/mpeg12enc.c
View file @
2f329db9
...
@@ -27,6 +27,7 @@
...
@@ -27,6 +27,7 @@
#include "avcodec.h"
#include "avcodec.h"
#include "dsputil.h"
#include "dsputil.h"
#include "mathops.h"
#include "mpegvideo.h"
#include "mpegvideo.h"
#include "mpeg12.h"
#include "mpeg12.h"
...
@@ -690,8 +691,7 @@ static void mpeg1_encode_motion(MpegEncContext *s, int val, int f_or_b_code)
...
@@ -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
bit_size
=
f_or_b_code
-
1
;
int
range
=
1
<<
bit_size
;
int
range
=
1
<<
bit_size
;
/* modulo encoding */
/* modulo encoding */
int
l
=
INT_BIT
-
5
-
bit_size
;
val
=
sign_extend
(
val
,
5
+
bit_size
);
val
=
(
val
<<
l
)
>>
l
;
if
(
val
>=
0
)
{
if
(
val
>=
0
)
{
val
--
;
val
--
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment