Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
59b571c1
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,发现更多精彩内容 >>
提交
59b571c1
编写于
12月 17, 2002
作者:
M
Michael Niedermayer
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
more debug output
Originally committed as revision 1338 to
svn://svn.ffmpeg.org/ffmpeg/trunk
上级
a8140ad5
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
42 addition
and
13 deletion
+42
-13
ffmpeg.c
ffmpeg.c
+10
-1
libavcodec/h263.c
libavcodec/h263.c
+2
-2
libavcodec/mpeg12.c
libavcodec/mpeg12.c
+10
-0
libavcodec/mpegvideo.c
libavcodec/mpegvideo.c
+9
-1
libavcodec/mpegvideo.h
libavcodec/mpegvideo.h
+2
-0
libavcodec/ratecontrol.c
libavcodec/ratecontrol.c
+9
-9
未找到文件。
ffmpeg.c
浏览文件 @
59b571c1
...
...
@@ -123,6 +123,7 @@ static int dct_algo = 0;
static
int
idct_algo
=
0
;
static
int
use_part
=
0
;
static
int
packet_size
=
0
;
static
int
debug
=
0
;
static
int
gop_size
=
12
;
static
int
intra_only
=
0
;
...
...
@@ -1597,6 +1598,10 @@ void opt_error_concealment(const char *arg)
error_concealment
=
atoi
(
arg
);
}
void
opt_debug
(
const
char
*
arg
)
{
debug
=
atoi
(
arg
);
}
void
opt_frame_rate
(
const
char
*
arg
)
{
...
...
@@ -1987,6 +1992,7 @@ void opt_input_file(const char *filename)
enc
->
error_resilience
=
error_resilience
;
enc
->
error_concealment
=
error_concealment
;
enc
->
idct_algo
=
idct_algo
;
enc
->
debug
=
debug
;
/* if(enc->codec->capabilities & CODEC_CAP_TRUNCATED)
enc->flags|= CODEC_FLAG_TRUNCATED; */
if
(
/*enc->codec_id==CODEC_ID_MPEG4 || */
enc
->
codec_id
==
CODEC_ID_MPEG1VIDEO
)
...
...
@@ -2163,6 +2169,7 @@ void opt_output_file(const char *filename)
video_enc
->
qblur
=
video_qblur
;
video_enc
->
qcompress
=
video_qcomp
;
video_enc
->
rc_eq
=
video_rc_eq
;
video_enc
->
debug
=
debug
;
p
=
video_rc_override_string
;
for
(
i
=
0
;
p
;
i
++
){
...
...
@@ -2581,6 +2588,7 @@ const OptionDef options[] = {
{
"i_qfactor"
,
HAS_ARG
|
OPT_EXPERT
,
{(
void
*
)
opt_i_qfactor
},
"qp factor between p and i frames"
,
"factor"
},
{
"b_qoffset"
,
HAS_ARG
|
OPT_EXPERT
,
{(
void
*
)
opt_b_qoffset
},
"qp offset between p and b frames"
,
"offset"
},
{
"i_qoffset"
,
HAS_ARG
|
OPT_EXPERT
,
{(
void
*
)
opt_i_qoffset
},
"qp offset between p and i frames"
,
"offset"
},
// { "b_strategy", HAS_ARG | OPT_EXPERT, {(void*)opt_b_strategy}, "dynamic b frame selection strategy", "strategy" },
{
"rc_eq"
,
HAS_ARG
|
OPT_EXPERT
,
{(
void
*
)
opt_video_rc_eq
},
""
,
"equation"
},
{
"rc_override"
,
HAS_ARG
|
OPT_EXPERT
,
{(
void
*
)
opt_video_rc_override_string
},
"Rate control override"
,
"qualities for specific intervals"
},
{
"bt"
,
HAS_ARG
,
{(
void
*
)
opt_video_bitrate_tolerance
},
"set video bitrate tolerance (in kbit/s)"
,
"tolerance"
},
...
...
@@ -2594,7 +2602,7 @@ const OptionDef options[] = {
{
"dct_algo"
,
HAS_ARG
|
OPT_EXPERT
,
{(
void
*
)
opt_dct_algo
},
"set dct algo"
,
"algo"
},
{
"idct_algo"
,
HAS_ARG
|
OPT_EXPERT
,
{(
void
*
)
opt_idct_algo
},
"set idct algo"
,
"algo"
},
{
"er"
,
HAS_ARG
|
OPT_EXPERT
,
{(
void
*
)
opt_error_resilience
},
"set error resilience"
,
""
},
{
"ec"
,
HAS_ARG
|
OPT_EXPERT
,
{(
void
*
)
opt_error_
resilience
},
"set error concealment"
,
""
},
{
"ec"
,
HAS_ARG
|
OPT_EXPERT
,
{(
void
*
)
opt_error_
concealment
},
"set error concealment"
,
""
},
{
"bf"
,
HAS_ARG
|
OPT_EXPERT
,
{(
void
*
)
opt_b_frames
},
"use 'frames' B frames (only MPEG-4)"
,
"frames"
},
{
"hq"
,
OPT_BOOL
|
OPT_EXPERT
,
{(
void
*
)
&
use_hq
},
"activate high quality settings"
},
{
"4mv"
,
OPT_BOOL
|
OPT_EXPERT
,
{(
void
*
)
&
use_4mv
},
"use four motion vector by macroblock (only MPEG-4)"
},
...
...
@@ -2603,6 +2611,7 @@ const OptionDef options[] = {
{
"ps"
,
HAS_ARG
|
OPT_EXPERT
,
{(
void
*
)
opt_packet_size
},
"packet size"
,
"size in bits"
},
{
"sameq"
,
OPT_BOOL
,
{(
void
*
)
&
same_quality
},
"use same video quality as source (implies VBR)"
},
{
"debug"
,
HAS_ARG
|
OPT_EXPERT
,
{(
void
*
)
opt_debug
},
"print specific debug info"
},
/* audio options */
{
"ab"
,
HAS_ARG
,
{(
void
*
)
opt_audio_bitrate
},
"set audio bitrate (in kbit/s)"
,
"bitrate"
,
},
{
"ar"
,
HAS_ARG
,
{(
void
*
)
opt_audio_rate
},
"set audio sampling rate (in Hz)"
,
"rate"
},
...
...
libavcodec/h263.c
浏览文件 @
59b571c1
...
...
@@ -4552,11 +4552,11 @@ 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
bc:%d type:%s size:%d pro:%d alt:%d top:%d qpel:%d
part:%d resync:%d w:%d a:%d
\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
\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
,
s
->
progressive_sequence
,
s
->
alternate_scan
,
s
->
top_field_first
,
s
->
quarter_sample
,
s
->
data_partitioning
,
s
->
resync_marker
,
s
->
num_sprite_warping_points
,
s
->
quarter_sample
?
"q"
:
"h"
,
s
->
data_partitioning
,
s
->
resync_marker
,
s
->
num_sprite_warping_points
,
s
->
sprite_warping_accuracy
);
}
...
...
libavcodec/mpeg12.c
浏览文件 @
59b571c1
...
...
@@ -736,6 +736,7 @@ static int mpeg_decode_mb(MpegEncContext *s,
s
->
mv
[
1
][
0
][
0
]
=
s
->
last_mv
[
1
][
0
][
0
];
s
->
mv
[
1
][
0
][
1
]
=
s
->
last_mv
[
1
][
0
][
1
];
}
s
->
mb_skiped
=
1
;
return
0
;
}
...
...
@@ -1617,6 +1618,15 @@ static int mpeg_decode_slice(AVCodecContext *avctx,
s
->
first_slice
=
0
;
if
(
MPV_frame_start
(
s
,
avctx
)
<
0
)
return
DECODE_SLICE_FATAL_ERROR
;
if
(
s
->
avctx
->
debug
&
FF_DEBUG_PICT_INFO
){
printf
(
"qp:%d fc:%d%d%d%d %s %s %s %s dc:%d pstruct:%d fdct:%d cmv:%d qtype:%d ivlc:%d rff:%d %s
\n
"
,
s
->
qscale
,
s
->
mpeg_f_code
[
0
][
0
],
s
->
mpeg_f_code
[
0
][
1
],
s
->
mpeg_f_code
[
1
][
0
],
s
->
mpeg_f_code
[
1
][
1
],
s
->
pict_type
==
I_TYPE
?
"I"
:
(
s
->
pict_type
==
P_TYPE
?
"P"
:
(
s
->
pict_type
==
B_TYPE
?
"B"
:
"S"
)),
s
->
progressive_sequence
?
"pro"
:
""
,
s
->
alternate_scan
?
"alt"
:
""
,
s
->
top_field_first
?
"top"
:
""
,
s
->
intra_dc_precision
,
s
->
picture_structure
,
s
->
frame_pred_frame_dct
,
s
->
concealment_motion_vectors
,
s
->
q_scale_type
,
s
->
intra_vlc_format
,
s
->
repeat_first_field
,
s
->
chroma_420_type
?
"420"
:
""
);
}
}
init_get_bits
(
&
s
->
gb
,
buf
,
buf_size
);
...
...
libavcodec/mpegvideo.c
浏览文件 @
59b571c1
...
...
@@ -914,7 +914,6 @@ alloc:
void
MPV_frame_end
(
MpegEncContext
*
s
)
{
int
i
;
/* draw edge for correct motion prediction if outside */
if
(
s
->
codec_id
!=
CODEC_ID_SVQ1
){
if
(
s
->
pict_type
!=
B_TYPE
&&
!
s
->
intra_only
&&
!
(
s
->
flags
&
CODEC_FLAG_EMU_EDGE
))
{
...
...
@@ -3466,6 +3465,15 @@ static void dct_unquantize_h263_c(MpegEncContext *s,
}
}
char
ff_get_pict_type_char
(
int
pict_type
){
switch
(
pict_type
){
case
I_TYPE
:
return
'I'
;
case
P_TYPE
:
return
'P'
;
case
B_TYPE
:
return
'B'
;
case
S_TYPE
:
return
'S'
;
}
}
AVCodec
mpeg1video_encoder
=
{
"mpeg1video"
,
CODEC_TYPE_VIDEO
,
...
...
libavcodec/mpegvideo.h
浏览文件 @
59b571c1
...
...
@@ -553,6 +553,8 @@ void ff_clean_intra_table_entries(MpegEncContext *s);
void
ff_init_scantable
(
MpegEncContext
*
s
,
ScanTable
*
st
,
const
UINT8
*
src_scantable
);
void
ff_error_resilience
(
MpegEncContext
*
s
);
void
ff_draw_horiz_band
(
MpegEncContext
*
s
);
char
ff_get_pict_type_char
(
int
pict_type
);
extern
int
ff_bit_exact
;
...
...
libavcodec/ratecontrol.c
浏览文件 @
59b571c1
...
...
@@ -330,7 +330,7 @@ static double get_diff_limited_q(MpegEncContext *s, RateControlEntry *rce, doubl
const
int
pict_type
=
rce
->
new_pict_type
;
const
double
last_p_q
=
rcc
->
last_qscale_for
[
P_TYPE
];
const
double
last_non_b_q
=
rcc
->
last_qscale_for
[
rcc
->
last_non_b_pict_type
];
if
(
pict_type
==
I_TYPE
&&
(
a
->
i_quant_factor
>
0
.
0
||
rcc
->
last_non_b_pict_type
==
P_TYPE
))
q
=
last_p_q
*
ABS
(
a
->
i_quant_factor
)
+
a
->
i_quant_offset
;
else
if
(
pict_type
==
B_TYPE
&&
a
->
b_quant_factor
>
0
.
0
)
...
...
@@ -339,6 +339,7 @@ static double get_diff_limited_q(MpegEncContext *s, RateControlEntry *rce, doubl
/* last qscale / qdiff stuff */
if
(
rcc
->
last_non_b_pict_type
==
pict_type
||
pict_type
!=
I_TYPE
){
double
last_q
=
rcc
->
last_qscale_for
[
pict_type
];
if
(
q
>
last_q
+
a
->
max_qdiff
)
q
=
last_q
+
a
->
max_qdiff
;
else
if
(
q
<
last_q
-
a
->
max_qdiff
)
q
=
last_q
-
a
->
max_qdiff
;
}
...
...
@@ -658,17 +659,16 @@ float ff_rate_estimate_qscale(MpegEncContext *s)
assert
(
q
>
0
.
0
);
}
//printf("qmin:%d, qmax:%d, q:%f\n", qmin, qmax, q);
if
(
s
->
avctx
->
debug
&
FF_DEBUG_RC
){
printf
(
"%c qp:%d<%2.1f<%d %d want:%d total:%d comp:%f st_q:%2.2f size:%d var:%d/%d br:%d fps:%d
\n
"
,
ff_get_pict_type_char
(
pict_type
),
qmin
,
q
,
qmax
,
picture_number
,
(
int
)
wanted_bits
/
1000
,
(
int
)
s
->
total_bits
/
1000
,
br_compensation
,
short_term_q
,
s
->
frame_bits
,
pic
->
mb_var_sum
,
pic
->
mc_mb_var_sum
,
s
->
bit_rate
/
1000
,
(
int
)
fps
);
}
if
(
q
<
qmin
)
q
=
qmin
;
else
if
(
q
>
qmax
)
q
=
qmax
;
// printf("%f %d %d %d\n", q, picture_number, (int)wanted_bits, (int)s->total_bits);
//printf("diff:%d comp:%f st_q:%f last_size:%d type:%d\n", (int)diff, br_compensation,
// short_term_q, s->frame_bits, pict_type);
//printf("%d %d\n", s->bit_rate, (int)fps);
if
(
s
->
adaptive_quant
)
adaptive_quantization
(
s
,
q
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录