Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
b90fdb2c
Commit
b90fdb2c
authored
Feb 11, 2017
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hevcdec: add a CUVID hwaccel
parent
770cf1db
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
295 additions
and
2 deletions
+295
-2
Changelog
Changelog
+1
-1
configure
configure
+3
-0
Makefile
libavcodec/Makefile
+1
-0
allcodecs.c
libavcodec/allcodecs.c
+1
-0
cuvid.c
libavcodec/cuvid.c
+1
-0
cuvid_hevc.c
libavcodec/cuvid_hevc.c
+280
-0
hevcdec.c
libavcodec/hevcdec.c
+8
-1
No files found.
Changelog
View file @
b90fdb2c
...
@@ -18,7 +18,7 @@ version <next>:
...
@@ -18,7 +18,7 @@ version <next>:
- support for decoding through D3D11VA in avconv
- support for decoding through D3D11VA in avconv
- Cinepak encoder
- Cinepak encoder
- Intel QSV-accelerated MJPEG encoding
- Intel QSV-accelerated MJPEG encoding
- NVIDIA CUVID-accelerated H.264 decoding
- NVIDIA CUVID-accelerated H.264
and HEVC
decoding
version 12:
version 12:
...
...
configure
View file @
b90fdb2c
...
@@ -2210,6 +2210,8 @@ h264_vda_old_hwaccel_deps="vda"
...
@@ -2210,6 +2210,8 @@ h264_vda_old_hwaccel_deps="vda"
h264_vda_old_hwaccel_select
=
"h264_decoder"
h264_vda_old_hwaccel_select
=
"h264_decoder"
h264_vdpau_hwaccel_deps
=
"vdpau"
h264_vdpau_hwaccel_deps
=
"vdpau"
h264_vdpau_hwaccel_select
=
"h264_decoder"
h264_vdpau_hwaccel_select
=
"h264_decoder"
hevc_cuvid_hwaccel_deps
=
"cuvid CUVIDHEVCPICPARAMS"
hevc_cuvid_hwaccel_select
=
"hevc_decoder"
hevc_d3d11va_hwaccel_deps
=
"d3d11va DXVA_PicParams_HEVC"
hevc_d3d11va_hwaccel_deps
=
"d3d11va DXVA_PicParams_HEVC"
hevc_d3d11va_hwaccel_select
=
"hevc_decoder"
hevc_d3d11va_hwaccel_select
=
"hevc_decoder"
hevc_d3d11va2_hwaccel_deps
=
"d3d11va DXVA_PicParams_HEVC"
hevc_d3d11va2_hwaccel_deps
=
"d3d11va DXVA_PicParams_HEVC"
...
@@ -4700,6 +4702,7 @@ check_lib psapi "windows.h psapi.h" GetProcessMemoryInfo -lpsapi
...
@@ -4700,6 +4702,7 @@ check_lib psapi "windows.h psapi.h" GetProcessMemoryInfo -lpsapi
check_struct
"sys/time.h sys/resource.h"
"struct rusage"
ru_maxrss
check_struct
"sys/time.h sys/resource.h"
"struct rusage"
ru_maxrss
check_type
"cuviddec.h"
"CUVIDH264PICPARAMS"
check_type
"cuviddec.h"
"CUVIDH264PICPARAMS"
check_type
"cuviddec.h"
"CUVIDHEVCPICPARAMS"
check_struct
"cuviddec.h"
"CUVIDDECODECREATEINFO"
bitDepthMinus8
check_struct
"cuviddec.h"
"CUVIDDECODECREATEINFO"
bitDepthMinus8
check_type
"windows.h dxva.h"
"DXVA_PicParams_HEVC"
-DWINAPI_FAMILY
=
WINAPI_FAMILY_DESKTOP_APP
-D_CRT_BUILD_DESKTOP_APP
=
0
check_type
"windows.h dxva.h"
"DXVA_PicParams_HEVC"
-DWINAPI_FAMILY
=
WINAPI_FAMILY_DESKTOP_APP
-D_CRT_BUILD_DESKTOP_APP
=
0
...
...
libavcodec/Makefile
View file @
b90fdb2c
...
@@ -641,6 +641,7 @@ OBJS-$(CONFIG_H264_QSV_HWACCEL) += qsvdec_h2645.o
...
@@ -641,6 +641,7 @@ OBJS-$(CONFIG_H264_QSV_HWACCEL) += qsvdec_h2645.o
OBJS-$(CONFIG_H264_VAAPI_HWACCEL)
+=
vaapi_h264.o
OBJS-$(CONFIG_H264_VAAPI_HWACCEL)
+=
vaapi_h264.o
OBJS-$(CONFIG_H264_VDA_HWACCEL)
+=
vda_h264.o
OBJS-$(CONFIG_H264_VDA_HWACCEL)
+=
vda_h264.o
OBJS-$(CONFIG_H264_VDPAU_HWACCEL)
+=
vdpau_h264.o
OBJS-$(CONFIG_H264_VDPAU_HWACCEL)
+=
vdpau_h264.o
OBJS-$(CONFIG_HEVC_CUVID_HWACCEL)
+=
cuvid_hevc.o
OBJS-$(CONFIG_HEVC_D3D11VA_HWACCEL)
+=
dxva2_hevc.o
OBJS-$(CONFIG_HEVC_D3D11VA_HWACCEL)
+=
dxva2_hevc.o
OBJS-$(CONFIG_HEVC_DXVA2_HWACCEL)
+=
dxva2_hevc.o
OBJS-$(CONFIG_HEVC_DXVA2_HWACCEL)
+=
dxva2_hevc.o
OBJS-$(CONFIG_HEVC_QSV_HWACCEL)
+=
qsvdec_h2645.o
OBJS-$(CONFIG_HEVC_QSV_HWACCEL)
+=
qsvdec_h2645.o
...
...
libavcodec/allcodecs.c
View file @
b90fdb2c
...
@@ -78,6 +78,7 @@ void avcodec_register_all(void)
...
@@ -78,6 +78,7 @@ void avcodec_register_all(void)
REGISTER_HWACCEL
(
H264_VDA
,
h264_vda
);
REGISTER_HWACCEL
(
H264_VDA
,
h264_vda
);
REGISTER_HWACCEL
(
H264_VDA_OLD
,
h264_vda_old
);
REGISTER_HWACCEL
(
H264_VDA_OLD
,
h264_vda_old
);
REGISTER_HWACCEL
(
H264_VDPAU
,
h264_vdpau
);
REGISTER_HWACCEL
(
H264_VDPAU
,
h264_vdpau
);
REGISTER_HWACCEL
(
HEVC_CUVID
,
hevc_cuvid
);
REGISTER_HWACCEL
(
HEVC_D3D11VA
,
hevc_d3d11va
);
REGISTER_HWACCEL
(
HEVC_D3D11VA
,
hevc_d3d11va
);
REGISTER_HWACCEL
(
HEVC_D3D11VA2
,
hevc_d3d11va2
);
REGISTER_HWACCEL
(
HEVC_D3D11VA2
,
hevc_d3d11va2
);
REGISTER_HWACCEL
(
HEVC_DXVA2
,
hevc_dxva2
);
REGISTER_HWACCEL
(
HEVC_DXVA2
,
hevc_dxva2
);
...
...
libavcodec/cuvid.c
View file @
b90fdb2c
...
@@ -53,6 +53,7 @@ static int map_avcodec_id(enum AVCodecID id)
...
@@ -53,6 +53,7 @@ static int map_avcodec_id(enum AVCodecID id)
{
{
switch
(
id
)
{
switch
(
id
)
{
case
AV_CODEC_ID_H264
:
return
cudaVideoCodec_H264
;
case
AV_CODEC_ID_H264
:
return
cudaVideoCodec_H264
;
case
AV_CODEC_ID_HEVC
:
return
cudaVideoCodec_HEVC
;
}
}
return
-
1
;
return
-
1
;
}
}
...
...
libavcodec/cuvid_hevc.c
0 → 100644
View file @
b90fdb2c
This diff is collapsed.
Click to expand it.
libavcodec/hevcdec.c
View file @
b90fdb2c
...
@@ -384,7 +384,8 @@ static void export_stream_params(AVCodecContext *avctx, const HEVCParamSets *ps,
...
@@ -384,7 +384,8 @@ static void export_stream_params(AVCodecContext *avctx, const HEVCParamSets *ps,
static
enum
AVPixelFormat
get_format
(
HEVCContext
*
s
,
const
HEVCSPS
*
sps
)
static
enum
AVPixelFormat
get_format
(
HEVCContext
*
s
,
const
HEVCSPS
*
sps
)
{
{
#define HWACCEL_MAX (CONFIG_HEVC_DXVA2_HWACCEL + CONFIG_HEVC_D3D11VA_HWACCEL * 2 + \
#define HWACCEL_MAX (CONFIG_HEVC_DXVA2_HWACCEL + CONFIG_HEVC_D3D11VA_HWACCEL * 2 + \
CONFIG_HEVC_VAAPI_HWACCEL + CONFIG_HEVC_VDPAU_HWACCEL)
CONFIG_HEVC_VAAPI_HWACCEL + CONFIG_HEVC_VDPAU_HWACCEL + \
CONFIG_HEVC_CUVID_HWACCEL)
enum
AVPixelFormat
pix_fmts
[
HWACCEL_MAX
+
2
],
*
fmt
=
pix_fmts
;
enum
AVPixelFormat
pix_fmts
[
HWACCEL_MAX
+
2
],
*
fmt
=
pix_fmts
;
if
(
sps
->
pix_fmt
==
AV_PIX_FMT_YUV420P
||
sps
->
pix_fmt
==
AV_PIX_FMT_YUVJ420P
||
if
(
sps
->
pix_fmt
==
AV_PIX_FMT_YUV420P
||
sps
->
pix_fmt
==
AV_PIX_FMT_YUVJ420P
||
...
@@ -398,9 +399,15 @@ static enum AVPixelFormat get_format(HEVCContext *s, const HEVCSPS *sps)
...
@@ -398,9 +399,15 @@ static enum AVPixelFormat get_format(HEVCContext *s, const HEVCSPS *sps)
#endif
#endif
#if CONFIG_HEVC_VAAPI_HWACCEL
#if CONFIG_HEVC_VAAPI_HWACCEL
*
fmt
++
=
AV_PIX_FMT_VAAPI
;
*
fmt
++
=
AV_PIX_FMT_VAAPI
;
#endif
#if CONFIG_HEVC_CUVID_HWACCEL && HAVE_CUVIDDECODECREATEINFO_BITDEPTHMINUS8
*
fmt
++
=
AV_PIX_FMT_CUDA
;
#endif
#endif
}
}
if
(
sps
->
pix_fmt
==
AV_PIX_FMT_YUV420P
||
sps
->
pix_fmt
==
AV_PIX_FMT_YUVJ420P
)
{
if
(
sps
->
pix_fmt
==
AV_PIX_FMT_YUV420P
||
sps
->
pix_fmt
==
AV_PIX_FMT_YUVJ420P
)
{
#if CONFIG_HEVC_CUVID_HWACCEL && !HAVE_CUVIDDECODECREATEINFO_BITDEPTHMINUS8
*
fmt
++
=
AV_PIX_FMT_CUDA
;
#endif
#if CONFIG_HEVC_VDPAU_HWACCEL
#if CONFIG_HEVC_VDPAU_HWACCEL
*
fmt
++
=
AV_PIX_FMT_VDPAU
;
*
fmt
++
=
AV_PIX_FMT_VDPAU
;
#endif
#endif
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment