Add VP9 Support

This commit is contained in:
Nicolas Chauvet 2019-08-21 22:24:49 +02:00
parent a0c90bd95a
commit af9c369308
2 changed files with 119 additions and 3 deletions

View File

@ -0,0 +1,112 @@
From 4475d106fdd00d74ac84c78691b13db7bd323a8c Mon Sep 17 00:00:00 2001
From: ManojGuptaBonda <mbonda@nvidia.com>
Date: Wed, 17 Jul 2019 14:57:51 +0530
Subject: [PATCH] Add VP9 decode support in VDPAU API
Added VP9 decoder profiles and level to VDPAU header file.
VP9 specification has 4 profiles and 1 level defined.
A new VdpPictureInfoVP9 structure is defined to pass VP9 specific params
to the driver.
---
include/vdpau/vdpau.h | 71 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 71 insertions(+)
diff --git a/include/vdpau/vdpau.h b/include/vdpau/vdpau.h
index 67aeacf..68a814d 100644
--- a/include/vdpau/vdpau.h
+++ b/include/vdpau/vdpau.h
@@ -2560,6 +2560,14 @@ typedef uint32_t VdpDecoderProfile;
/** \brief Support for 8 bit depth only */
#define VDP_DECODER_PROFILE_H264_HIGH_444_PREDICTIVE ((VdpDecoderProfile)26)
/** \hideinitializer */
+#define VDP_DECODER_PROFILE_VP9_PROFILE_0 ((VdpDecoderProfile)27)
+/** \hideinitializer */
+#define VDP_DECODER_PROFILE_VP9_PROFILE_1 ((VdpDecoderProfile)28)
+/** \hideinitializer */
+#define VDP_DECODER_PROFILE_VP9_PROFILE_2 ((VdpDecoderProfile)29)
+/** \hideinitializer */
+#define VDP_DECODER_PROFILE_VP9_PROFILE_3 ((VdpDecoderProfile)30)
+/** \hideinitializer */
/** \brief MPEG-H Part 2 == H.265 == HEVC */
#define VDP_DECODER_PROFILE_HEVC_MAIN ((VdpDecoderProfile)100)
/** \hideinitializer */
@@ -2664,6 +2672,9 @@ typedef uint32_t VdpDecoderProfile;
/** \hideinitializer */
#define VDP_DECODER_LEVEL_DIVX_NA 0
+/** \hideinitializer */
+#define VDP_DECODER_LEVEL_VP9_L1 1
+
/**
* The VDPAU H.265/HEVC decoder levels correspond to the values of
* general_level_idc as described in the H.265 Specification, Annex A,
@@ -3202,6 +3213,66 @@ typedef VdpPictureInfoMPEG4Part2 VdpPictureInfoDivX4;
*/
typedef VdpPictureInfoMPEG4Part2 VdpPictureInfoDivX5;
+typedef struct
+{
+ unsigned int width;
+ unsigned int height;
+
+ //Frame Indices
+ VdpVideoSurface lastReference;
+ VdpVideoSurface goldenReference;
+ VdpVideoSurface altReference;
+
+ unsigned char colorSpace;
+
+ unsigned short profile;
+ unsigned short frameContextIdx;
+ unsigned short keyFrame;
+ unsigned short showFrame;
+ unsigned short errorResilient;
+ unsigned short frameParallelDecoding;
+ unsigned short subSamplingX;
+ unsigned short subSamplingY;
+ unsigned short intraOnly;
+ unsigned short allowHighPrecisionMv;
+ unsigned short refreshEntropyProbs;
+
+ unsigned char refFrameSignBias[4];
+
+ unsigned char bitDepthMinus8Luma;
+ unsigned char bitDepthMinus8Chroma;
+ unsigned char loopFilterLevel;
+ unsigned char loopFilterSharpness;
+
+ unsigned char modeRefLfEnabled;
+ unsigned char log2TileColumns;
+ unsigned char log2TileRows;
+
+ unsigned char segmentEnabled;
+ unsigned char segmentMapUpdate;
+ unsigned char segmentMapTemporalUpdate;
+ unsigned char segmentFeatureMode;
+
+ unsigned char segmentFeatureEnable[8][4];
+ short segmentFeatureData[8][4];
+ unsigned char mbSegmentTreeProbs[7];
+ unsigned char segmentPredProbs[3];
+ unsigned char reservedSegment16Bits[2];
+
+ int qpYAc;
+ int qpYDc;
+ int qpChDc;
+ int qpChAc;
+
+ unsigned int activeRefIdx[3];
+ unsigned int resetFrameContext;
+ unsigned int mcompFilterType;
+ unsigned int mbRefLfDelta[4];
+ unsigned int mbModeLfDelta[2];
+ unsigned int uncompressedHeaderSize;
+ unsigned int compressedHeaderSize;
+} VdpPictureInfoVP9;
+
/**
* \brief Picture parameter information for an H.265/HEVC picture.
*
--
2.20.1

View File

@ -2,11 +2,12 @@
Name: libvdpau
Version: 1.2
Release: 2%{?dist}
Release: 3%{?dist}
Summary: Wrapper library for the Video Decode and Presentation API
License: MIT
URL: https://freedesktop.org/wiki/Software/VDPAU/
Source0: https://gitlab.freedesktop.org/vdpau/libvdpau/uploads/%{gitlab_hash}/libvdpau-%{version}.tar.bz2
Patch0: Add-VP9-decode-support-in-VDPAU-API.patch
BuildRequires: autoconf
BuildRequires: automake
@ -52,7 +53,7 @@ Summary: Development files for %{name}
Requires: %{name}%{?_isa} = %{version}-%{release}
#Multilibs trace
Requires: %{name}-trace%{?_isa} = %{version}-%{release}
Requires: libX11-devel
Requires: libX11-devel%{?_isa}
Requires: pkgconfig
%description devel
@ -60,7 +61,7 @@ The %{name}-devel package contains libraries and header files for developing
applications that use %{name}.
%prep
%setup -q
%autosetup -p1
%build
@ -100,6 +101,9 @@ mv doc/html-out html
%changelog
* Wed Aug 21 2019 Nicolas Chauvet <kwizart@gmail.com> - 1.2-3
- Fetch VP9 support
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild