Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
030b5a4f
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,发现更多精彩内容 >>
提交
030b5a4f
编写于
8月 16, 2015
作者:
R
Ronald S. Bultje
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
lavc: put remaining bits of vdpau-in-decoder under FF_API_CAP_VDPAU.
上级
7a629186
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
78 addition
and
17 deletion
+78
-17
libavcodec/error_resilience.c
libavcodec/error_resilience.c
+2
-0
libavcodec/h263dec.c
libavcodec/h263dec.c
+2
-0
libavcodec/h264.c
libavcodec/h264.c
+4
-0
libavcodec/h264_picture.c
libavcodec/h264_picture.c
+4
-0
libavcodec/h264_slice.c
libavcodec/h264_slice.c
+12
-4
libavcodec/mpeg12dec.c
libavcodec/mpeg12dec.c
+17
-3
libavcodec/mpegpicture.c
libavcodec/mpegpicture.c
+5
-1
libavcodec/mpegvideo.c
libavcodec/mpegvideo.c
+9
-2
libavcodec/utils.c
libavcodec/utils.c
+2
-0
libavcodec/vc1dec.c
libavcodec/vc1dec.c
+21
-7
未找到文件。
libavcodec/error_resilience.c
浏览文件 @
030b5a4f
...
...
@@ -777,7 +777,9 @@ void ff_er_frame_start(ERContext *s)
static
int
er_supported
(
ERContext
*
s
)
{
if
(
s
->
avctx
->
hwaccel
&&
s
->
avctx
->
hwaccel
->
decode_slice
||
#if FF_API_CAP_VDPAU
s
->
avctx
->
codec
->
capabilities
&
AV_CODEC_CAP_HWACCEL_VDPAU
||
#endif
!
s
->
cur_pic
.
f
||
s
->
cur_pic
.
field_picture
)
...
...
libavcodec/h263dec.c
浏览文件 @
030b5a4f
...
...
@@ -603,10 +603,12 @@ retry:
if
(
!
s
->
divx_packed
&&
!
avctx
->
hwaccel
)
ff_thread_finish_setup
(
avctx
);
#if FF_API_CAP_VDPAU
if
(
CONFIG_MPEG4_VDPAU_DECODER
&&
(
s
->
avctx
->
codec
->
capabilities
&
AV_CODEC_CAP_HWACCEL_VDPAU
))
{
ff_vdpau_mpeg4_decode_picture
(
avctx
->
priv_data
,
s
->
gb
.
buffer
,
s
->
gb
.
buffer_end
-
s
->
gb
.
buffer
);
goto
frame_end
;
}
#endif
if
(
avctx
->
hwaccel
)
{
ret
=
avctx
->
hwaccel
->
start_frame
(
avctx
,
s
->
gb
.
buffer
,
...
...
libavcodec/h264.c
浏览文件 @
030b5a4f
...
...
@@ -1561,9 +1561,11 @@ again:
if
(
h
->
avctx
->
hwaccel
&&
(
ret
=
h
->
avctx
->
hwaccel
->
start_frame
(
h
->
avctx
,
buf
,
buf_size
))
<
0
)
goto
end
;
#if FF_API_CAP_VDPAU
if
(
CONFIG_H264_VDPAU_DECODER
&&
h
->
avctx
->
codec
->
capabilities
&
AV_CODEC_CAP_HWACCEL_VDPAU
)
ff_vdpau_h264_picture_start
(
h
);
#endif
}
if
(
sl
->
redundant_pic_count
==
0
)
{
...
...
@@ -1573,6 +1575,7 @@ again:
consumed
);
if
(
ret
<
0
)
goto
end
;
#if FF_API_CAP_VDPAU
}
else
if
(
CONFIG_H264_VDPAU_DECODER
&&
h
->
avctx
->
codec
->
capabilities
&
AV_CODEC_CAP_HWACCEL_VDPAU
)
{
ff_vdpau_add_data_chunk
(
h
->
cur_pic_ptr
->
f
->
data
[
0
],
...
...
@@ -1581,6 +1584,7 @@ again:
ff_vdpau_add_data_chunk
(
h
->
cur_pic_ptr
->
f
->
data
[
0
],
&
buf
[
buf_index
-
consumed
],
consumed
);
#endif
}
else
context_count
++
;
}
...
...
libavcodec/h264_picture.c
浏览文件 @
030b5a4f
...
...
@@ -157,9 +157,11 @@ int ff_h264_field_end(H264Context *h, H264SliceContext *sl, int in_setup)
int
err
=
0
;
h
->
mb_y
=
0
;
#if FF_API_CAP_VDPAU
if
(
CONFIG_H264_VDPAU_DECODER
&&
h
->
avctx
->
codec
->
capabilities
&
AV_CODEC_CAP_HWACCEL_VDPAU
)
ff_vdpau_h264_set_reference_frames
(
h
);
#endif
if
(
in_setup
||
!
(
avctx
->
active_thread_type
&
FF_THREAD_FRAME
))
{
if
(
!
h
->
droppable
)
{
...
...
@@ -178,9 +180,11 @@ int ff_h264_field_end(H264Context *h, H264SliceContext *sl, int in_setup)
"hardware accelerator failed to decode picture
\n
"
);
}
#if FF_API_CAP_VDPAU
if
(
CONFIG_H264_VDPAU_DECODER
&&
h
->
avctx
->
codec
->
capabilities
&
AV_CODEC_CAP_HWACCEL_VDPAU
)
ff_vdpau_h264_picture_complete
(
h
);
#endif
#if CONFIG_ERROR_RESILIENCE
av_assert0
(
sl
==
h
->
slice_ctx
);
...
...
libavcodec/h264_slice.c
浏览文件 @
030b5a4f
...
...
@@ -612,8 +612,11 @@ static int h264_frame_start(H264Context *h)
if
((
ret
=
alloc_picture
(
h
,
pic
))
<
0
)
return
ret
;
if
(
!
h
->
frame_recovered
&&
!
h
->
avctx
->
hwaccel
&&
!
(
h
->
avctx
->
codec
->
capabilities
&
AV_CODEC_CAP_HWACCEL_VDPAU
))
if
(
!
h
->
frame_recovered
&&
!
h
->
avctx
->
hwaccel
#if FF_API_CAP_VDPAU
&&
!
(
h
->
avctx
->
codec
->
capabilities
&
AV_CODEC_CAP_HWACCEL_VDPAU
)
#endif
)
avpriv_color_frame
(
pic
->
f
,
c
);
h
->
cur_pic_ptr
=
pic
;
...
...
@@ -1048,6 +1051,7 @@ static int h264_slice_header_init(H264Context *h)
goto
fail
;
}
#if FF_API_CAP_VDPAU
if
(
h
->
avctx
->
codec
&&
h
->
avctx
->
codec
->
capabilities
&
AV_CODEC_CAP_HWACCEL_VDPAU
&&
(
h
->
sps
.
bit_depth_luma
!=
8
||
h
->
sps
.
chroma_format_idc
>
1
))
{
...
...
@@ -1056,6 +1060,7 @@ static int h264_slice_header_init(H264Context *h)
ret
=
AVERROR_INVALIDDATA
;
goto
fail
;
}
#endif
if
(
h
->
sps
.
bit_depth_luma
<
8
||
h
->
sps
.
bit_depth_luma
>
14
||
h
->
sps
.
bit_depth_luma
==
11
||
h
->
sps
.
bit_depth_luma
==
13
...
...
@@ -2533,8 +2538,11 @@ int ff_h264_execute_decode_slices(H264Context *h, unsigned context_count)
h
->
slice_ctx
[
0
].
next_slice_idx
=
INT_MAX
;
if
(
h
->
avctx
->
hwaccel
||
h
->
avctx
->
codec
->
capabilities
&
AV_CODEC_CAP_HWACCEL_VDPAU
)
if
(
h
->
avctx
->
hwaccel
#if FF_API_CAP_VDPAU
||
h
->
avctx
->
codec
->
capabilities
&
AV_CODEC_CAP_HWACCEL_VDPAU
#endif
)
return
0
;
if
(
context_count
==
1
)
{
int
ret
;
...
...
libavcodec/mpeg12dec.c
浏览文件 @
030b5a4f
...
...
@@ -1186,8 +1186,10 @@ static const enum AVPixelFormat mpeg1_hwaccel_pixfmt_list_420[] = {
#if CONFIG_MPEG1_XVMC_HWACCEL
AV_PIX_FMT_XVMC
,
#endif
#if CONFIG_MPEG1_VDPAU_
HWACCEL
#if CONFIG_MPEG1_VDPAU_
DECODER
AV_PIX_FMT_VDPAU_MPEG1
,
#endif
#if CONFIG_MPEG1_VDPAU_HWACCEL
AV_PIX_FMT_VDPAU
,
#endif
AV_PIX_FMT_YUV420P
,
...
...
@@ -1198,8 +1200,10 @@ static const enum AVPixelFormat mpeg2_hwaccel_pixfmt_list_420[] = {
#if CONFIG_MPEG2_XVMC_HWACCEL
AV_PIX_FMT_XVMC
,
#endif
#if CONFIG_MPEG
2_VDPAU_HWACCEL
#if CONFIG_MPEG
_VDPAU_DECODER
AV_PIX_FMT_VDPAU_MPEG2
,
#endif
#if CONFIG_MPEG2_VDPAU_HWACCEL
AV_PIX_FMT_VDPAU
,
#endif
#if CONFIG_MPEG2_DXVA2_HWACCEL
...
...
@@ -1228,9 +1232,11 @@ static const enum AVPixelFormat mpeg12_pixfmt_list_444[] = {
AV_PIX_FMT_NONE
};
#if FF_API_VDPAU
static
inline
int
uses_vdpau
(
AVCodecContext
*
avctx
)
{
return
avctx
->
pix_fmt
==
AV_PIX_FMT_VDPAU_MPEG1
||
avctx
->
pix_fmt
==
AV_PIX_FMT_VDPAU_MPEG2
;
}
#endif
static
enum
AVPixelFormat
mpeg_get_pixelformat
(
AVCodecContext
*
avctx
)
{
...
...
@@ -1256,7 +1262,11 @@ static enum AVPixelFormat mpeg_get_pixelformat(AVCodecContext *avctx)
static
void
setup_hwaccel_for_pixfmt
(
AVCodecContext
*
avctx
)
{
// until then pix_fmt may be changed right after codec init
if
(
avctx
->
hwaccel
||
uses_vdpau
(
avctx
))
if
(
avctx
->
hwaccel
#if FF_API_VDPAU
||
uses_vdpau
(
avctx
)
#endif
)
if
(
avctx
->
idct_algo
==
FF_IDCT_AUTO
)
avctx
->
idct_algo
=
FF_IDCT_SIMPLE
;
...
...
@@ -2460,9 +2470,11 @@ static int decode_chunks(AVCodecContext *avctx, AVFrame *picture,
s2
->
er
.
error_count
+=
s2
->
thread_context
[
i
]
->
er
.
error_count
;
}
#if FF_API_VDPAU
if
((
CONFIG_MPEG_VDPAU_DECODER
||
CONFIG_MPEG1_VDPAU_DECODER
)
&&
uses_vdpau
(
avctx
))
ff_vdpau_mpeg_picture_complete
(
s2
,
buf
,
buf_size
,
s
->
slice_count
);
#endif
ret
=
slice_end
(
avctx
,
picture
);
if
(
ret
<
0
)
...
...
@@ -2711,10 +2723,12 @@ static int decode_chunks(AVCodecContext *avctx, AVFrame *picture,
return
AVERROR_INVALIDDATA
;
}
#if FF_API_VDPAU
if
(
uses_vdpau
(
avctx
))
{
s
->
slice_count
++
;
break
;
}
#endif
if
(
HAVE_THREADS
&&
(
avctx
->
active_thread_type
&
FF_THREAD_SLICE
)
&&
...
...
libavcodec/mpegpicture.c
浏览文件 @
030b5a4f
...
...
@@ -58,7 +58,11 @@ int ff_mpeg_framesize_alloc(AVCodecContext *avctx, MotionEstContext *me,
{
int
alloc_size
=
FFALIGN
(
FFABS
(
linesize
)
+
64
,
32
);
if
(
avctx
->
hwaccel
||
avctx
->
codec
->
capabilities
&
AV_CODEC_CAP_HWACCEL_VDPAU
)
if
(
avctx
->
hwaccel
#if FF_API_CAP_VDPAU
||
avctx
->
codec
->
capabilities
&
AV_CODEC_CAP_HWACCEL_VDPAU
#endif
)
return
0
;
if
(
linesize
<
24
)
{
...
...
libavcodec/mpegvideo.c
浏览文件 @
030b5a4f
...
...
@@ -1307,7 +1307,11 @@ int ff_mpv_frame_start(MpegEncContext *s, AVCodecContext *avctx)
return
-
1
;
}
if
(
!
avctx
->
hwaccel
&&
!
(
avctx
->
codec
->
capabilities
&
AV_CODEC_CAP_HWACCEL_VDPAU
))
{
if
(
!
avctx
->
hwaccel
#if FF_API_CAP_VDPAU
&&
!
(
avctx
->
codec
->
capabilities
&
AV_CODEC_CAP_HWACCEL_VDPAU
)
#endif
)
{
for
(
i
=
0
;
i
<
avctx
->
height
;
i
++
)
memset
(
s
->
last_picture_ptr
->
f
->
data
[
0
]
+
s
->
last_picture_ptr
->
f
->
linesize
[
0
]
*
i
,
0x80
,
avctx
->
width
);
...
...
@@ -1652,7 +1656,10 @@ void ff_print_debug_info2(AVCodecContext *avctx, AVFrame *pict, uint8_t *mbskip_
/* TODO: export all the following to make them accessible for users (and filters) */
if
(
avctx
->
hwaccel
||
!
mbtype_table
||
(
avctx
->
codec
->
capabilities
&
AV_CODEC_CAP_HWACCEL_VDPAU
))
#if FF_API_CAP_VDPAU
||
(
avctx
->
codec
->
capabilities
&
AV_CODEC_CAP_HWACCEL_VDPAU
)
#endif
)
return
;
...
...
libavcodec/utils.c
浏览文件 @
030b5a4f
...
...
@@ -1243,8 +1243,10 @@ int ff_get_format(AVCodecContext *avctx, const enum AVPixelFormat *fmt)
if
(
!
(
desc
->
flags
&
AV_PIX_FMT_FLAG_HWACCEL
))
break
;
#if FF_API_CAP_VDPAU
if
(
avctx
->
codec
->
capabilities
&
AV_CODEC_CAP_HWACCEL_VDPAU
)
break
;
#endif
if
(
!
setup_hwaccel
(
avctx
,
ret
,
desc
->
name
))
break
;
...
...
libavcodec/vc1dec.c
浏览文件 @
030b5a4f
...
...
@@ -647,12 +647,14 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
return
buf_size
;
}
#if FF_API_CAP_VDPAU
if
(
s
->
avctx
->
codec
->
capabilities
&
AV_CODEC_CAP_HWACCEL_VDPAU
)
{
if
(
v
->
profile
<
PROFILE_ADVANCED
)
avctx
->
pix_fmt
=
AV_PIX_FMT_VDPAU_WMV3
;
else
avctx
->
pix_fmt
=
AV_PIX_FMT_VDPAU_VC1
;
}
#endif
//for advanced profile we may need to parse and unescape data
if
(
avctx
->
codec_id
==
AV_CODEC_ID_VC1
||
avctx
->
codec_id
==
AV_CODEC_ID_VC1IMAGE
)
{
...
...
@@ -672,15 +674,21 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
if
(
size
<=
0
)
continue
;
switch
(
AV_RB32
(
start
))
{
case
VC1_CODE_FRAME
:
if
(
avctx
->
hwaccel
||
s
->
avctx
->
codec
->
capabilities
&
AV_CODEC_CAP_HWACCEL_VDPAU
)
if
(
avctx
->
hwaccel
#if FF_API_CAP_VDPAU
||
s
->
avctx
->
codec
->
capabilities
&
AV_CODEC_CAP_HWACCEL_VDPAU
#endif
)
buf_start
=
start
;
buf_size2
=
vc1_unescape_buffer
(
start
+
4
,
size
,
buf2
);
break
;
case
VC1_CODE_FIELD
:
{
int
buf_size3
;
if
(
avctx
->
hwaccel
||
s
->
avctx
->
codec
->
capabilities
&
AV_CODEC_CAP_HWACCEL_VDPAU
)
if
(
avctx
->
hwaccel
#if FF_API_CAP_VDPAU
||
s
->
avctx
->
codec
->
capabilities
&
AV_CODEC_CAP_HWACCEL_VDPAU
#endif
)
buf_start_second_field
=
start
;
tmp
=
av_realloc_array
(
slices
,
sizeof
(
*
slices
),
(
n_slices
+
1
));
if
(
!
tmp
)
{
...
...
@@ -742,8 +750,11 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
ret
=
AVERROR_INVALIDDATA
;
goto
err
;
}
else
{
// found field marker, unescape second field
if
(
avctx
->
hwaccel
||
s
->
avctx
->
codec
->
capabilities
&
AV_CODEC_CAP_HWACCEL_VDPAU
)
if
(
avctx
->
hwaccel
#if FF_API_CAP_VDPAU
||
s
->
avctx
->
codec
->
capabilities
&
AV_CODEC_CAP_HWACCEL_VDPAU
#endif
)
buf_start_second_field
=
divider
;
tmp
=
av_realloc_array
(
slices
,
sizeof
(
*
slices
),
(
n_slices
+
1
));
if
(
!
tmp
)
{
...
...
@@ -890,6 +901,7 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
s
->
me
.
qpel_put
=
s
->
qdsp
.
put_qpel_pixels_tab
;
s
->
me
.
qpel_avg
=
s
->
qdsp
.
avg_qpel_pixels_tab
;
#if FF_API_CAP_VDPAU
if
((
CONFIG_VC1_VDPAU_DECODER
)
&&
s
->
avctx
->
codec
->
capabilities
&
AV_CODEC_CAP_HWACCEL_VDPAU
)
{
if
(
v
->
field_mode
&&
buf_start_second_field
)
{
...
...
@@ -898,7 +910,9 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
}
else
{
ff_vdpau_vc1_decode_picture
(
s
,
buf_start
,
(
buf
+
buf_size
)
-
buf_start
);
}
}
else
if
(
avctx
->
hwaccel
)
{
}
else
#endif
if
(
avctx
->
hwaccel
)
{
if
(
v
->
field_mode
&&
buf_start_second_field
)
{
// decode first field
s
->
picture_structure
=
PICT_BOTTOM_FIELD
-
v
->
tff
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录