summaryrefslogtreecommitdiffstats
path: root/media/ffvpx/libavcodec/vp9.c
diff options
context:
space:
mode:
authorMoonchild <mcwerewolf@gmail.com>2018-10-01 14:34:26 +0200
committerGitHub <noreply@github.com>2018-10-01 14:34:26 +0200
commit79b00fc33b5cb6d56d29b50efac6d62ce3a89018 (patch)
tree77d8179bb3d9d76d9ec4fcfe396a35afcc8f73cd /media/ffvpx/libavcodec/vp9.c
parentab881a3bf513e591b6cc2966560cdab2b63a0f2a (diff)
parent7d1ee0e5e4958175ccde5d153b025f97a17caeb2 (diff)
downloadUXP-79b00fc33b5cb6d56d29b50efac6d62ce3a89018.tar
UXP-79b00fc33b5cb6d56d29b50efac6d62ce3a89018.tar.gz
UXP-79b00fc33b5cb6d56d29b50efac6d62ce3a89018.tar.lz
UXP-79b00fc33b5cb6d56d29b50efac6d62ce3a89018.tar.xz
UXP-79b00fc33b5cb6d56d29b50efac6d62ce3a89018.zip
Merge pull request #801 from trav90/update-from-upstream
Update ffvpx code to 4.0.2
Diffstat (limited to 'media/ffvpx/libavcodec/vp9.c')
-rw-r--r--media/ffvpx/libavcodec/vp9.c33
1 files changed, 31 insertions, 2 deletions
diff --git a/media/ffvpx/libavcodec/vp9.c b/media/ffvpx/libavcodec/vp9.c
index f2cf19424..b1178c9c0 100644
--- a/media/ffvpx/libavcodec/vp9.c
+++ b/media/ffvpx/libavcodec/vp9.c
@@ -23,6 +23,7 @@
#include "avcodec.h"
#include "get_bits.h"
+#include "hwaccel.h"
#include "internal.h"
#include "profiles.h"
#include "thread.h"
@@ -169,7 +170,10 @@ fail:
static int update_size(AVCodecContext *avctx, int w, int h)
{
-#define HWACCEL_MAX (CONFIG_VP9_DXVA2_HWACCEL + CONFIG_VP9_D3D11VA_HWACCEL * 2 + CONFIG_VP9_VAAPI_HWACCEL)
+#define HWACCEL_MAX (CONFIG_VP9_DXVA2_HWACCEL + \
+ CONFIG_VP9_D3D11VA_HWACCEL * 2 + \
+ CONFIG_VP9_NVDEC_HWACCEL + \
+ CONFIG_VP9_VAAPI_HWACCEL)
enum AVPixelFormat pix_fmts[HWACCEL_MAX + 2], *fmtp = pix_fmts;
VP9Context *s = avctx->priv_data;
uint8_t *p;
@@ -184,6 +188,7 @@ static int update_size(AVCodecContext *avctx, int w, int h)
switch (s->pix_fmt) {
case AV_PIX_FMT_YUV420P:
+ case AV_PIX_FMT_YUV420P10:
#if CONFIG_VP9_DXVA2_HWACCEL
*fmtp++ = AV_PIX_FMT_DXVA2_VLD;
#endif
@@ -191,12 +196,17 @@ static int update_size(AVCodecContext *avctx, int w, int h)
*fmtp++ = AV_PIX_FMT_D3D11VA_VLD;
*fmtp++ = AV_PIX_FMT_D3D11;
#endif
+#if CONFIG_VP9_NVDEC_HWACCEL
+ *fmtp++ = AV_PIX_FMT_CUDA;
+#endif
#if CONFIG_VP9_VAAPI_HWACCEL
*fmtp++ = AV_PIX_FMT_VAAPI;
#endif
break;
- case AV_PIX_FMT_YUV420P10:
case AV_PIX_FMT_YUV420P12:
+#if CONFIG_VP9_NVDEC_HWACCEL
+ *fmtp++ = AV_PIX_FMT_CUDA;
+#endif
#if CONFIG_VP9_VAAPI_HWACCEL
*fmtp++ = AV_PIX_FMT_VAAPI;
#endif
@@ -1787,4 +1797,23 @@ AVCodec ff_vp9_decoder = {
.init_thread_copy = ONLY_IF_THREADS_ENABLED(vp9_decode_init_thread_copy),
.update_thread_context = ONLY_IF_THREADS_ENABLED(vp9_decode_update_thread_context),
.profiles = NULL_IF_CONFIG_SMALL(ff_vp9_profiles),
+ .bsfs = "vp9_superframe_split",
+ .hw_configs = (const AVCodecHWConfigInternal*[]) {
+#if CONFIG_VP9_DXVA2_HWACCEL
+ HWACCEL_DXVA2(vp9),
+#endif
+#if CONFIG_VP9_D3D11VA_HWACCEL
+ HWACCEL_D3D11VA(vp9),
+#endif
+#if CONFIG_VP9_D3D11VA2_HWACCEL
+ HWACCEL_D3D11VA2(vp9),
+#endif
+#if CONFIG_VP9_NVDEC_HWACCEL
+ HWACCEL_NVDEC(vp9),
+#endif
+#if CONFIG_VP9_VAAPI_HWACCEL
+ HWACCEL_VAAPI(vp9),
+#endif
+ NULL
+ },
};