Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
34790165
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,发现更多精彩内容 >>
提交
34790165
编写于
10月 12, 2003
作者:
M
Michael Niedermayer
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
intra dc treshold != 0 decoding fixed
Originally committed as revision 2363 to
svn://svn.ffmpeg.org/ffmpeg/trunk
上级
5e83dec4
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
25 addition
and
6 deletion
+25
-6
libavcodec/h263.c
libavcodec/h263.c
+20
-6
libavcodec/mpeg4data.h
libavcodec/mpeg4data.h
+4
-0
libavcodec/mpegvideo.h
libavcodec/mpegvideo.h
+1
-0
未找到文件。
libavcodec/h263.c
浏览文件 @
34790165
...
...
@@ -3942,6 +3942,7 @@ static inline int mpeg4_decode_block(MpegEncContext * s, DCTELEM * block,
//Note intra & rvlc should be optimized away if this is inlined
if
(
intra
)
{
if
(
s
->
qscale
<
s
->
intra_dc_threshold
){
/* DC coef */
if
(
s
->
partitioned_frame
){
level
=
s
->
dc_val
[
0
][
s
->
block_index
[
n
]
];
...
...
@@ -3955,6 +3956,9 @@ static inline int mpeg4_decode_block(MpegEncContext * s, DCTELEM * block,
}
block
[
0
]
=
level
;
i
=
0
;
}
else
{
i
=
-
1
;
}
if
(
!
coded
)
goto
not_coded
;
...
...
@@ -4154,7 +4158,19 @@ static inline int mpeg4_decode_block(MpegEncContext * s, DCTELEM * block,
CLOSE_READER
(
re
,
&
s
->
gb
);
}
not_coded:
if
(
s
->
mb_intra
)
{
if
(
intra
)
{
if
(
s
->
qscale
>=
s
->
intra_dc_threshold
){
uint16_t
*
dc_val
;
block
[
0
]
+=
ff_mpeg4_pred_dc
(
s
,
n
,
&
dc_val
,
&
dc_pred_dir
);
if
(
n
<
4
)
{
*
dc_val
=
block
[
0
]
*
s
->
y_dc_scale
;
}
else
{
*
dc_val
=
block
[
0
]
*
s
->
c_dc_scale
;
}
if
(
i
==
-
1
)
i
=
0
;
}
mpeg4_pred_ac
(
s
,
block
,
n
,
dc_pred_dir
);
if
(
s
->
ac_pred
)
{
i
=
63
;
/* XXX: not optimal */
...
...
@@ -5013,9 +5029,7 @@ static int decode_vop_header(MpegEncContext *s, GetBitContext *gb){
//FIXME complexity estimation stuff
if
(
s
->
shape
!=
BIN_ONLY_SHAPE
)
{
int
t
;
t
=
get_bits
(
gb
,
3
);
/* intra dc VLC threshold */
//printf("threshold %d\n", t);
s
->
intra_dc_threshold
=
mpeg4_dc_threshold
[
get_bits
(
gb
,
3
)
];
if
(
!
s
->
progressive_sequence
){
s
->
top_field_first
=
get_bits1
(
gb
);
s
->
alternate_scan
=
get_bits1
(
gb
);
...
...
@@ -5063,12 +5077,12 @@ static int decode_vop_header(MpegEncContext *s, GetBitContext *gb){
s
->
b_code
=
1
;
if
(
s
->
avctx
->
debug
&
FF_DEBUG_PICT_INFO
){
printf
(
"qp:%d fc:%d,%d %s size:%d pro:%d alt:%d top:%d %spel part:%d resync:%d w:%d a:%d rnd:%d vot:%d%s
\n
"
,
printf
(
"qp:%d fc:%d,%d %s size:%d pro:%d alt:%d top:%d %spel part:%d resync:%d w:%d a:%d rnd:%d vot:%d%s
dc:%d
\n
"
,
s
->
qscale
,
s
->
f_code
,
s
->
b_code
,
s
->
pict_type
==
I_TYPE
?
"I"
:
(
s
->
pict_type
==
P_TYPE
?
"P"
:
(
s
->
pict_type
==
B_TYPE
?
"B"
:
"S"
)),
gb
->
size_in_bits
,
s
->
progressive_sequence
,
s
->
alternate_scan
,
s
->
top_field_first
,
s
->
quarter_sample
?
"q"
:
"h"
,
s
->
data_partitioning
,
s
->
resync_marker
,
s
->
num_sprite_warping_points
,
s
->
sprite_warping_accuracy
,
1
-
s
->
no_rounding
,
s
->
vo_type
,
s
->
vol_control_parameters
?
" VOLC"
:
" "
);
s
->
sprite_warping_accuracy
,
1
-
s
->
no_rounding
,
s
->
vo_type
,
s
->
vol_control_parameters
?
" VOLC"
:
" "
,
s
->
intra_dc_threshold
);
}
if
(
!
s
->
scalability
){
...
...
libavcodec/mpeg4data.h
浏览文件 @
34790165
...
...
@@ -395,3 +395,7 @@ uint8_t ff_mpeg4_c_dc_scale_table[32]={
const
uint16_t
ff_mpeg4_resync_prefix
[
8
]
=
{
0x7F00
,
0x7E00
,
0x7C00
,
0x7800
,
0x7000
,
0x6000
,
0x4000
,
0x0000
};
static
const
uint8_t
mpeg4_dc_threshold
[
8
]
=
{
99
,
13
,
15
,
17
,
19
,
21
,
23
,
0
};
libavcodec/mpegvideo.h
浏览文件 @
34790165
...
...
@@ -566,6 +566,7 @@ typedef struct MpegEncContext {
int
low_delay
;
///< no reordering needed / has no b-frames
int
vo_type
;
int
vol_control_parameters
;
///< does the stream contain the low_delay flag, used to workaround buggy encoders
int
intra_dc_threshold
;
///< QP above whch the ac VLC should be used for intra dc
PutBitContext
tex_pb
;
///< used for data partitioned VOPs
PutBitContext
pb2
;
///< used for data partitioned VOPs
#define PB_BUFFER_SIZE 1024*256
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录