Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
aa498fef
F
Ffmpeg
项目概览
小白菜888
/
Ffmpeg
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
Ffmpeg
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
aa498fef
编写于
10月 09, 2011
作者:
M
Mans Rullgard
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
mpeg124: use sign_extend() function
Signed-off-by:
N
Mans Rullgard
<
mans@mansr.com
>
上级
633ddb85
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
6 addition
and
10 deletion
+6
-10
libavcodec/ituh263dec.c
libavcodec/ituh263dec.c
+2
-3
libavcodec/ituh263enc.c
libavcodec/ituh263enc.c
+2
-3
libavcodec/mpeg12.c
libavcodec/mpeg12.c
+2
-4
未找到文件。
libavcodec/ituh263dec.c
浏览文件 @
aa498fef
...
@@ -271,7 +271,7 @@ int ff_h263_resync(MpegEncContext *s){
...
@@ -271,7 +271,7 @@ int ff_h263_resync(MpegEncContext *s){
int
h263_decode_motion
(
MpegEncContext
*
s
,
int
pred
,
int
f_code
)
int
h263_decode_motion
(
MpegEncContext
*
s
,
int
pred
,
int
f_code
)
{
{
int
code
,
val
,
sign
,
shift
,
l
;
int
code
,
val
,
sign
,
shift
;
code
=
get_vlc2
(
&
s
->
gb
,
mv_vlc
.
table
,
MV_VLC_BITS
,
2
);
code
=
get_vlc2
(
&
s
->
gb
,
mv_vlc
.
table
,
MV_VLC_BITS
,
2
);
if
(
code
==
0
)
if
(
code
==
0
)
...
@@ -293,8 +293,7 @@ int h263_decode_motion(MpegEncContext * s, int pred, int f_code)
...
@@ -293,8 +293,7 @@ int h263_decode_motion(MpegEncContext * s, int pred, int f_code)
/* modulo decoding */
/* modulo decoding */
if
(
!
s
->
h263_long_vectors
)
{
if
(
!
s
->
h263_long_vectors
)
{
l
=
INT_BIT
-
5
-
f_code
;
val
=
sign_extend
(
val
,
5
+
f_code
);
val
=
(
val
<<
l
)
>>
l
;
}
else
{
}
else
{
/* horrible h263 long vector mode */
/* horrible h263 long vector mode */
if
(
pred
<
-
31
&&
val
<
-
63
)
if
(
pred
<
-
31
&&
val
<
-
63
)
...
...
libavcodec/ituh263enc.c
浏览文件 @
aa498fef
...
@@ -657,7 +657,7 @@ void h263_encode_mb(MpegEncContext * s,
...
@@ -657,7 +657,7 @@ void h263_encode_mb(MpegEncContext * s,
void
ff_h263_encode_motion
(
MpegEncContext
*
s
,
int
val
,
int
f_code
)
void
ff_h263_encode_motion
(
MpegEncContext
*
s
,
int
val
,
int
f_code
)
{
{
int
range
,
l
,
bit_size
,
sign
,
code
,
bits
;
int
range
,
bit_size
,
sign
,
code
,
bits
;
if
(
val
==
0
)
{
if
(
val
==
0
)
{
/* zero vector */
/* zero vector */
...
@@ -667,8 +667,7 @@ void ff_h263_encode_motion(MpegEncContext * s, int val, int f_code)
...
@@ -667,8 +667,7 @@ void ff_h263_encode_motion(MpegEncContext * s, int val, int f_code)
bit_size
=
f_code
-
1
;
bit_size
=
f_code
-
1
;
range
=
1
<<
bit_size
;
range
=
1
<<
bit_size
;
/* modulo encoding */
/* modulo encoding */
l
=
INT_BIT
-
6
-
bit_size
;
val
=
sign_extend
(
val
,
6
+
bit_size
);
val
=
(
val
<<
l
)
>>
l
;
sign
=
val
>>
31
;
sign
=
val
>>
31
;
val
=
(
val
^
sign
)
-
sign
;
val
=
(
val
^
sign
)
-
sign
;
sign
&=
1
;
sign
&=
1
;
...
...
libavcodec/mpeg12.c
浏览文件 @
aa498fef
...
@@ -54,7 +54,7 @@ static VLC mv_vlc;
...
@@ -54,7 +54,7 @@ static VLC mv_vlc;
/* as H.263, but only 17 codes */
/* as H.263, but only 17 codes */
static
int
mpeg_decode_motion
(
MpegEncContext
*
s
,
int
fcode
,
int
pred
)
static
int
mpeg_decode_motion
(
MpegEncContext
*
s
,
int
fcode
,
int
pred
)
{
{
int
code
,
sign
,
val
,
l
,
shift
;
int
code
,
sign
,
val
,
shift
;
code
=
get_vlc2
(
&
s
->
gb
,
mv_vlc
.
table
,
MV_VLC_BITS
,
2
);
code
=
get_vlc2
(
&
s
->
gb
,
mv_vlc
.
table
,
MV_VLC_BITS
,
2
);
if
(
code
==
0
)
{
if
(
code
==
0
)
{
...
@@ -77,9 +77,7 @@ static int mpeg_decode_motion(MpegEncContext *s, int fcode, int pred)
...
@@ -77,9 +77,7 @@ static int mpeg_decode_motion(MpegEncContext *s, int fcode, int pred)
val
+=
pred
;
val
+=
pred
;
/* modulo decoding */
/* modulo decoding */
l
=
INT_BIT
-
5
-
shift
;
return
sign_extend
(
val
,
5
+
shift
);
val
=
(
val
<<
l
)
>>
l
;
return
val
;
}
}
static
inline
int
mpeg1_decode_block_intra
(
MpegEncContext
*
s
,
DCTELEM
*
block
,
int
n
)
static
inline
int
mpeg1_decode_block_intra
(
MpegEncContext
*
s
,
DCTELEM
*
block
,
int
n
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录