Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
554daa24
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,发现更多精彩内容 >>
提交
554daa24
编写于
12月 03, 2003
作者:
M
Michael Niedermayer
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
cleanup
Originally committed as revision 2558 to
svn://svn.ffmpeg.org/ffmpeg/trunk
上级
6beeb962
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
25 addition
and
40 deletion
+25
-40
libavcodec/h263.c
libavcodec/h263.c
+18
-25
libavcodec/h263dec.c
libavcodec/h263dec.c
+2
-5
libavcodec/mpegvideo.c
libavcodec/mpegvideo.c
+2
-7
libavcodec/mpegvideo.h
libavcodec/mpegvideo.h
+2
-0
libavcodec/rv10.c
libavcodec/rv10.c
+1
-3
未找到文件。
libavcodec/h263.c
浏览文件 @
554daa24
...
...
@@ -2239,20 +2239,19 @@ void mpeg4_encode_picture_header(MpegEncContext * s, int picture_number)
#endif //CONFIG_ENCODERS
/**
*
change qscale by given dquant
and update qscale dependant variables.
*
set qscale
and update qscale dependant variables.
*/
static
void
change_qscale
(
MpegEncContext
*
s
,
int
dquant
)
void
ff_set_qscale
(
MpegEncContext
*
s
,
int
qscale
)
{
s
->
qscale
+=
dquant
;
if
(
s
->
qscale
<
1
)
s
->
qscale
=
1
;
else
if
(
s
->
qscale
>
31
)
s
->
qscale
=
31
;
if
(
qscale
<
1
)
qscale
=
1
;
else
if
(
qscale
>
31
)
qscale
=
31
;
s
->
chroma_qscale
=
s
->
chroma_qscale_table
[
s
->
qscale
];
s
->
qscale
=
qscale
;
s
->
chroma_qscale
=
s
->
chroma_qscale_table
[
qscale
];
s
->
y_dc_scale
=
s
->
y_dc_scale_table
[
s
->
qscale
];
s
->
y_dc_scale
=
s
->
y_dc_scale_table
[
qscale
];
s
->
c_dc_scale
=
s
->
c_dc_scale_table
[
s
->
chroma_qscale
];
}
...
...
@@ -2746,7 +2745,6 @@ static int h263_decode_gob_header(MpegEncContext *s)
s
->
qscale
=
get_bits
(
&
s
->
gb
,
5
);
/* GQUANT */
if
(
s
->
qscale
==
0
)
return
-
1
;
s
->
chroma_qscale
=
s
->
chroma_qscale_table
[
s
->
qscale
];
s
->
mb_x
=
0
;
s
->
mb_y
=
s
->
gob_index
*
s
->
gob_number
;
...
...
@@ -3123,7 +3121,7 @@ static int mpeg4_decode_partition_a(MpegEncContext *s){
s
->
mb_intra
=
1
;
if
(
cbpc
&
4
)
{
change_qscale
(
s
,
quant_tab
[
get_bits
(
&
s
->
gb
,
2
)]);
ff_set_qscale
(
s
,
s
->
qscale
+
quant_tab
[
get_bits
(
&
s
->
gb
,
2
)]);
}
s
->
current_picture
.
qscale_table
[
xy
]
=
s
->
qscale
;
...
...
@@ -3286,7 +3284,7 @@ static int mpeg4_decode_partition_b(MpegEncContext *s, int mb_count){
}
if
(
s
->
cbp_table
[
xy
]
&
8
)
{
change_qscale
(
s
,
quant_tab
[
get_bits
(
&
s
->
gb
,
2
)]);
ff_set_qscale
(
s
,
s
->
qscale
+
quant_tab
[
get_bits
(
&
s
->
gb
,
2
)]);
}
s
->
current_picture
.
qscale_table
[
xy
]
=
s
->
qscale
;
...
...
@@ -3316,7 +3314,7 @@ static int mpeg4_decode_partition_b(MpegEncContext *s, int mb_count){
}
if
(
s
->
cbp_table
[
xy
]
&
8
)
{
change_qscale
(
s
,
quant_tab
[
get_bits
(
&
s
->
gb
,
2
)]);
ff_set_qscale
(
s
,
s
->
qscale
+
quant_tab
[
get_bits
(
&
s
->
gb
,
2
)]);
}
s
->
current_picture
.
qscale_table
[
xy
]
=
s
->
qscale
;
...
...
@@ -3393,9 +3391,7 @@ static int mpeg4_decode_partitioned_mb(MpegEncContext *s, DCTELEM block[6][64])
cbp
=
s
->
cbp_table
[
xy
];
if
(
s
->
current_picture
.
qscale_table
[
xy
]
!=
s
->
qscale
){
s
->
chroma_qscale
=
s
->
qscale
=
s
->
current_picture
.
qscale_table
[
xy
];
s
->
y_dc_scale
=
s
->
y_dc_scale_table
[
s
->
qscale
];
s
->
c_dc_scale
=
s
->
c_dc_scale_table
[
s
->
chroma_qscale
];
ff_set_qscale
(
s
,
s
->
current_picture
.
qscale_table
[
xy
]
);
}
if
(
s
->
pict_type
==
P_TYPE
||
s
->
pict_type
==
S_TYPE
)
{
...
...
@@ -3608,7 +3604,7 @@ int ff_h263_decode_mb(MpegEncContext *s,
s
->
qscale
=
get_bits
(
&
s
->
gb
,
5
);
}
else
s
->
qscale
+=
quant_tab
[
get_bits
(
&
s
->
gb
,
2
)];
change_qscale
(
s
,
0
);
ff_set_qscale
(
s
,
s
->
qscale
);
}
s
->
mv_dir
=
MV_DIR_FORWARD
;
...
...
@@ -3700,7 +3696,7 @@ intra:
s
->
qscale
=
get_bits
(
&
s
->
gb
,
5
);
}
else
s
->
qscale
+=
quant_tab
[
get_bits
(
&
s
->
gb
,
2
)];
change_qscale
(
s
,
0
);
ff_set_qscale
(
s
,
s
->
qscale
);
}
/* decode each block */
...
...
@@ -3793,8 +3789,7 @@ int ff_mpeg4_decode_mb(MpegEncContext *s,
cbp
=
(
cbpc
&
3
)
|
(
cbpy
<<
2
);
if
(
dquant
)
{
s
->
qscale
+=
quant_tab
[
get_bits
(
&
s
->
gb
,
2
)];
change_qscale
(
s
,
0
);
ff_set_qscale
(
s
,
s
->
qscale
+
quant_tab
[
get_bits
(
&
s
->
gb
,
2
)]);
}
if
((
!
s
->
progressive_sequence
)
&&
(
cbp
||
(
s
->
workaround_bugs
&
FF_BUG_XVID_ILACE
)))
s
->
interlaced_dct
=
get_bits1
(
&
s
->
gb
);
...
...
@@ -3918,7 +3913,7 @@ int ff_mpeg4_decode_mb(MpegEncContext *s,
if
((
!
IS_DIRECT
(
mb_type
))
&&
cbp
)
{
if
(
get_bits1
(
&
s
->
gb
)){
change_qscale
(
s
,
get_bits1
(
&
s
->
gb
)
*
4
-
2
);
ff_set_qscale
(
s
,
s
->
qscale
+
get_bits1
(
&
s
->
gb
)
*
4
-
2
);
}
}
...
...
@@ -4026,8 +4021,7 @@ intra:
}
cbp
=
(
cbpc
&
3
)
|
(
cbpy
<<
2
);
if
(
dquant
)
{
s
->
qscale
+=
quant_tab
[
get_bits
(
&
s
->
gb
,
2
)];
change_qscale
(
s
,
0
);
ff_set_qscale
(
s
,
s
->
qscale
+
quant_tab
[
get_bits
(
&
s
->
gb
,
2
)]);
}
if
(
!
s
->
progressive_sequence
)
...
...
@@ -4749,7 +4743,6 @@ int h263_decode_picture_header(MpegEncContext *s)
}
s
->
qscale
=
get_bits
(
&
s
->
gb
,
5
);
s
->
chroma_qscale
=
s
->
chroma_qscale_table
[
s
->
qscale
];
}
/* PEI */
while
(
get_bits1
(
&
s
->
gb
)
!=
0
)
{
...
...
libavcodec/h263dec.c
浏览文件 @
554daa24
...
...
@@ -146,8 +146,7 @@ static int decode_slice(MpegEncContext *s){
s
->
resync_mb_x
=
s
->
mb_x
;
s
->
resync_mb_y
=
s
->
mb_y
;
s
->
y_dc_scale
=
s
->
y_dc_scale_table
[
s
->
qscale
];
s
->
c_dc_scale
=
s
->
c_dc_scale_table
[
s
->
chroma_qscale
];
ff_set_qscale
(
s
,
s
->
qscale
);
if
(
s
->
partitioned_frame
){
const
int
qscale
=
s
->
qscale
;
...
...
@@ -161,9 +160,7 @@ static int decode_slice(MpegEncContext *s){
s
->
first_slice_line
=
1
;
s
->
mb_x
=
s
->
resync_mb_x
;
s
->
mb_y
=
s
->
resync_mb_y
;
s
->
chroma_qscale
=
s
->
qscale
=
qscale
;
s
->
y_dc_scale
=
s
->
y_dc_scale_table
[
s
->
qscale
];
s
->
c_dc_scale
=
s
->
c_dc_scale_table
[
s
->
qscale
];
ff_set_qscale
(
s
,
qscale
);
}
for
(;
s
->
mb_y
<
s
->
mb_height
;
s
->
mb_y
++
)
{
...
...
libavcodec/mpegvideo.c
浏览文件 @
554daa24
...
...
@@ -3123,10 +3123,7 @@ static void encode_mb(MpegEncContext *s, int motion_x, int motion_y)
}
}
}
s
->
qscale
=
last_qp
+
s
->
dquant
;
s
->
chroma_qscale
=
s
->
chroma_qscale_table
[
s
->
qscale
];
s
->
y_dc_scale
=
s
->
y_dc_scale_table
[
s
->
qscale
];
s
->
c_dc_scale
=
s
->
c_dc_scale_table
[
s
->
chroma_qscale
];
ff_set_qscale
(
s
,
last_qp
+
s
->
dquant
);
}
if
(
s
->
mb_intra
)
{
...
...
@@ -3864,9 +3861,7 @@ static void encode_picture(MpegEncContext *s, int picture_number)
s
->
mb_x
=
0
;
s
->
mb_y
=
mb_y
;
s
->
chroma_qscale
=
s
->
chroma_qscale_table
[
s
->
qscale
];
s
->
y_dc_scale
=
s
->
y_dc_scale_table
[
s
->
qscale
];
s
->
c_dc_scale
=
s
->
c_dc_scale_table
[
s
->
chroma_qscale
];
ff_set_qscale
(
s
,
s
->
qscale
);
ff_init_block_index
(
s
);
for
(
mb_x
=
0
;
mb_x
<
s
->
mb_width
;
mb_x
++
)
{
...
...
libavcodec/mpegvideo.h
浏览文件 @
554daa24
...
...
@@ -825,6 +825,7 @@ extern const uint8_t ff_mba_length[6];
extern
const
uint8_t
ff_h263_chroma_qscale_table
[
32
];
extern
const
uint8_t
ff_h263_loop_filter_strength
[
32
];
int
ff_h263_decode_init
(
AVCodecContext
*
avctx
);
int
ff_h263_decode_frame
(
AVCodecContext
*
avctx
,
void
*
data
,
int
*
data_size
,
...
...
@@ -852,6 +853,7 @@ int ff_h263_decode_gob_header(MpegEncContext *s);
int
ff_mpeg4_decode_picture_header
(
MpegEncContext
*
s
,
GetBitContext
*
gb
);
void
ff_h263_update_motion_val
(
MpegEncContext
*
s
);
int
ff_h263_loop_filter
(
MpegEncContext
*
s
);
void
ff_set_qscale
(
MpegEncContext
*
s
,
int
qscale
);
int
intel_h263_decode_picture_header
(
MpegEncContext
*
s
);
...
...
libavcodec/rv10.c
浏览文件 @
554daa24
...
...
@@ -527,9 +527,7 @@ static int rv10_decode_packet(AVCodecContext *avctx,
if
(
s
->
modified_quant
)
s
->
chroma_qscale_table
=
ff_h263_chroma_qscale_table
;
s
->
chroma_qscale
=
s
->
chroma_qscale_table
[
s
->
qscale
];
s
->
y_dc_scale
=
s
->
y_dc_scale_table
[
s
->
qscale
];
s
->
c_dc_scale
=
s
->
c_dc_scale_table
[
s
->
chroma_qscale
];
ff_set_qscale
(
s
,
s
->
qscale
);
s
->
rv10_first_dc_coded
[
0
]
=
0
;
s
->
rv10_first_dc_coded
[
1
]
=
0
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录