Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
f977e69d
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,体验更适合开发者的 AI 搜索 >>
提交
f977e69d
编写于
7月 30, 2015
作者:
M
Michael Niedermayer
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
avcodec/mpegvideo_enc: Ignore QMAX if VBV constraints are exceeded
Signed-off-by:
N
Michael Niedermayer
<
michael@niedermayer.cc
>
上级
bf2474c7
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
7 addition
and
2 deletion
+7
-2
libavcodec/mpegvideo.h
libavcodec/mpegvideo.h
+1
-0
libavcodec/mpegvideo_enc.c
libavcodec/mpegvideo_enc.c
+6
-2
未找到文件。
libavcodec/mpegvideo.h
浏览文件 @
f977e69d
...
...
@@ -539,6 +539,7 @@ typedef struct MpegEncContext {
float
rc_buffer_aggressivity
;
float
border_masking
;
int
lmin
,
lmax
;
int
vbv_ignore_qmax
;
char
*
rc_eq
;
...
...
libavcodec/mpegvideo_enc.c
浏览文件 @
f977e69d
...
...
@@ -173,7 +173,8 @@ static inline void update_qscale(MpegEncContext *s)
for
(
i
=
0
;
i
<
FF_ARRAY_ELEMS
(
non_linear_qscale
);
i
++
)
{
int
diff
=
FFABS
((
non_linear_qscale
[
i
]
<<
(
FF_LAMBDA_SHIFT
+
7
))
-
(
int
)
s
->
lambda
*
139
);
if
(
non_linear_qscale
[
i
]
<
s
->
avctx
->
qmin
||
non_linear_qscale
[
i
]
>
s
->
avctx
->
qmax
)
if
(
non_linear_qscale
[
i
]
<
s
->
avctx
->
qmin
||
(
non_linear_qscale
[
i
]
>
s
->
avctx
->
qmax
&&
!
s
->
vbv_ignore_qmax
))
continue
;
if
(
diff
<
bestdiff
)
{
bestdiff
=
diff
;
...
...
@@ -184,7 +185,7 @@ static inline void update_qscale(MpegEncContext *s)
}
else
{
s
->
qscale
=
(
s
->
lambda
*
139
+
FF_LAMBDA_SCALE
*
64
)
>>
(
FF_LAMBDA_SHIFT
+
7
);
s
->
qscale
=
av_clip
(
s
->
qscale
,
s
->
avctx
->
qmin
,
s
->
avctx
->
qmax
);
s
->
qscale
=
av_clip
(
s
->
qscale
,
s
->
avctx
->
qmin
,
s
->
vbv_ignore_qmax
?
31
:
s
->
avctx
->
qmax
);
}
s
->
lambda2
=
(
s
->
lambda
*
s
->
lambda
+
FF_LAMBDA_SCALE
/
2
)
>>
...
...
@@ -1748,6 +1749,8 @@ int ff_mpv_encode_picture(AVCodecContext *avctx, AVPacket *pkt,
int
i
,
stuffing_count
,
ret
;
int
context_count
=
s
->
slice_context_count
;
s
->
vbv_ignore_qmax
=
0
;
s
->
picture_in_gop_number
++
;
if
(
load_input_picture
(
s
,
pic_arg
)
<
0
)
...
...
@@ -1844,6 +1847,7 @@ vbv_retry:
PutBitContext
*
pb
=
&
s
->
thread_context
[
i
]
->
pb
;
init_put_bits
(
pb
,
pb
->
buf
,
pb
->
buf_end
-
pb
->
buf
);
}
s
->
vbv_ignore_qmax
=
1
;
av_log
(
s
->
avctx
,
AV_LOG_VERBOSE
,
"reencoding frame due to VBV
\n
"
);
goto
vbv_retry
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录