Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
bba83349
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,发现更多精彩内容 >>
提交
bba83349
编写于
7月 08, 2004
作者:
M
Michael Niedermayer
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
overread fix
Originally committed as revision 3294 to
svn://svn.ffmpeg.org/ffmpeg/trunk
上级
240ae82c
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
10 addition
and
4 deletion
+10
-4
libavcodec/cabac.c
libavcodec/cabac.c
+1
-0
libavcodec/cabac.h
libavcodec/cabac.h
+7
-2
libavcodec/h264.c
libavcodec/h264.c
+2
-2
未找到文件。
libavcodec/cabac.c
浏览文件 @
bba83349
...
...
@@ -93,6 +93,7 @@ void ff_init_cabac_encoder(CABACContext *c, uint8_t *buf, int buf_size){
void
ff_init_cabac_decoder
(
CABACContext
*
c
,
const
uint8_t
*
buf
,
int
buf_size
){
c
->
bytestream_start
=
c
->
bytestream
=
buf
;
c
->
bytestream_end
=
buf
+
buf_size
;
c
->
low
=
*
c
->
bytestream
++
;
c
->
low
=
(
c
->
low
<<
9
)
+
((
*
c
->
bytestream
++
)
<<
1
);
...
...
libavcodec/cabac.h
浏览文件 @
bba83349
...
...
@@ -39,6 +39,7 @@ typedef struct CABACContext{
uint8_t
mps_state
[
2
*
64
];
///< transIdxMPS
const
uint8_t
*
bytestream_start
;
const
uint8_t
*
bytestream
;
const
uint8_t
*
bytestream_end
;
int
bits_left
;
///<
PutBitContext
pb
;
}
CABACContext
;
...
...
@@ -253,7 +254,9 @@ static inline void renorm_cabac_decoder(CABACContext *c){
c
->
range
+=
c
->
range
;
c
->
low
+=
c
->
low
;
if
(
--
c
->
bits_left
==
0
){
c
->
low
+=
*
c
->
bytestream
++
;
if
(
c
->
bytestream
<
c
->
bytestream_end
)
c
->
low
+=
*
c
->
bytestream
;
c
->
bytestream
++
;
c
->
bits_left
=
8
;
}
}
...
...
@@ -298,7 +301,9 @@ static inline int get_cabac_bypass(CABACContext *c){
c
->
low
+=
c
->
low
;
if
(
--
c
->
bits_left
==
0
){
c
->
low
+=
*
c
->
bytestream
++
;
if
(
c
->
bytestream
<
c
->
bytestream_end
)
c
->
low
+=
*
c
->
bytestream
;
c
->
bytestream
++
;
c
->
bits_left
=
8
;
}
...
...
libavcodec/h264.c
浏览文件 @
bba83349
...
...
@@ -5117,7 +5117,7 @@ static int decode_slice(H264Context *h){
ff_init_cabac_states
(
&
h
->
cabac
,
ff_h264_lps_range
,
ff_h264_mps_state
,
ff_h264_lps_state
,
64
);
ff_init_cabac_decoder
(
&
h
->
cabac
,
s
->
gb
.
buffer
+
get_bits_count
(
&
s
->
gb
)
/
8
,
(
s
->
gb
.
size_in_bits
-
get_bits_count
(
&
s
->
gb
)
)
);
(
s
->
gb
.
size_in_bits
-
get_bits_count
(
&
s
->
gb
)
+
7
)
/
8
);
/* calculate pre-state */
for
(
i
=
0
;
i
<
399
;
i
++
)
{
int
pre
;
...
...
@@ -5149,7 +5149,7 @@ static int decode_slice(H264Context *h){
s
->
mb_y
--
;
}
if
(
ret
<
0
)
{
if
(
ret
<
0
||
h
->
cabac
.
bytestream
>
h
->
cabac
.
bytestream_end
+
1
)
{
av_log
(
h
->
s
.
avctx
,
AV_LOG_ERROR
,
"error while decoding MB %d %d
\n
"
,
s
->
mb_x
,
s
->
mb_y
);
ff_er_add_slice
(
s
,
s
->
resync_mb_x
,
s
->
resync_mb_y
,
s
->
mb_x
,
s
->
mb_y
,
(
AC_ERROR
|
DC_ERROR
|
MV_ERROR
)
&
part_mask
);
return
-
1
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录