Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
85b01098
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,发现更多精彩内容 >>
提交
85b01098
编写于
3月 26, 2011
作者:
P
Philip Langdale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Revert "CrystalHD: Add heuristics to try and distinguish h.264 PAFF variants."
This reverts commit
4ab57cff
.
上级
3188d33a
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
15 addition
and
44 deletion
+15
-44
libavcodec/crystalhd.c
libavcodec/crystalhd.c
+15
-44
未找到文件。
libavcodec/crystalhd.c
浏览文件 @
85b01098
...
...
@@ -506,13 +506,23 @@ static av_cold int init(AVCodecContext *avctx)
}
/*
* The CrystalHD doesn't report interlaced H.264 content in a way that allows
* us to distinguish between specific cases that require different handling.
* So, for now, we have to hard-code the behaviour we want.
*
* Specifically, there are PAFF samples where input is always separate fields
* but the hardware returns separate fields on one occasion and a field-pair
* on another. The code assumes the first case and define
* ASSUME_TWO_INPUTS_ONE_OUTPUT to assume the second case.
*/
#define ASSUME_TWO_INPUTS_ONE_OUTPUT 0
static
inline
CopyRet
copy_frame
(
AVCodecContext
*
avctx
,
BC_DTS_PROC_OUT
*
output
,
void
*
data
,
int
*
data_size
)
{
BC_STATUS
ret
;
BC_DTS_STATUS
decoder_status
;
uint8_t
confirmed_interlaced
;
uint8_t
ignore_interlaced
;
uint8_t
interlaced
;
...
...
@@ -560,33 +570,6 @@ static inline CopyRet copy_frame(AVCodecContext *avctx,
return
RET_ERROR
;
}
/*
* If we're expecting a second field, or we know that the next
* picture has the same number as the current picture, then we're
* definitely interlaced.
*
* Note that this test can return false negatives if the hardware
* hasn't decoded the next picture or if there is a corruption in
* the stream. (In either case a 0 will be returned for the next
* picture number)
*/
confirmed_interlaced
=
((
decoder_status
.
picNumFlags
&
~
0x40000000
)
==
output
->
PicInfo
.
picture_number
)
||
priv
->
need_second_field
;
/*
* If we got a false negative for confirmed_interlaced on the first field,
* we will realise our mistake here when we see that the picture number is that
* of the previous picture. We cannot recover the frame and should discard the
* second field to keep the correct number of output frames.
*/
if
(
output
->
PicInfo
.
picture_number
==
priv
->
last_picture
&&
!
priv
->
need_second_field
)
{
av_log
(
avctx
,
AV_LOG_WARNING
,
"Incorrectly guessed progressie frame. Discarding second field
\n
"
);
/* Returning without providing a picture. */
return
RET_OK
;
}
/*
* Testing has, so far, shown that we can't trust the interlaced flag for
* H.264 content when VDEC_FLAG_UNKNOWN_SRC is set.
...
...
@@ -594,14 +577,9 @@ static inline CopyRet copy_frame(AVCodecContext *avctx,
ignore_interlaced
=
avctx
->
codec
->
id
==
CODEC_ID_H264
&&
(
output
->
PicInfo
.
flags
&
VDEC_FLAG_UNKNOWN_SRC
)
&&
(
pic_type
==
0
||
pic_type
==
PICT_FRAME
||
!
confirmed_interlaced
);
ASSUME_TWO_INPUTS_ONE_OUTPUT
);
interlaced
=
(
output
->
PicInfo
.
flags
&
VDEC_FLAG_INTERLACED_SRC
)
&&
(
!
ignore_interlaced
||
confirmed_interlaced
);
if
(
ignore_interlaced
&&
(
decoder_status
.
picNumFlags
&
~
0x40000000
)
==
0
)
{
av_log
(
avctx
,
AV_LOG_WARNING
,
"Next picture number unknown. Assuming progressive frame.
\n
"
);
}
!
ignore_interlaced
;
av_log
(
avctx
,
AV_LOG_VERBOSE
,
"Interlaced state: %d | ignore_interlaced %d
\n
"
,
interlaced
,
ignore_interlaced
);
...
...
@@ -672,15 +650,8 @@ static inline CopyRet copy_frame(AVCodecContext *avctx,
*
(
AVFrame
*
)
data
=
priv
->
pic
;
}
/*
* Two types of PAFF content have been observed. One form causes the
* hardware to return a field pair and the other individual fields,
* even though the input is always individual fields. We must skip
* copying on the next decode() call to maintain pipeline length in
* the first case.
*/
if
(
!
interlaced
&&
(
output
->
PicInfo
.
flags
&
VDEC_FLAG_UNKNOWN_SRC
)
&&
(
pic_type
==
PICT_TOP_FIELD
||
pic_type
==
PICT_BOTTOM_FIELD
))
{
if
(
ASSUME_TWO_INPUTS_ONE_OUTPUT
&&
output
->
PicInfo
.
flags
&
VDEC_FLAG_UNKNOWN_SRC
)
{
av_log
(
priv
->
avctx
,
AV_LOG_VERBOSE
,
"Fieldpair from two packets.
\n
"
);
return
RET_SKIP_NEXT_COPY
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录