資源簡介
修改NVIDIA VIDEO CODEC SDK中 NvDecodeD3D9的數據源為FFmpeg,彌補原生SDK不能以流作為數據源的不足
代碼片段和文件信息
/*
?*?Copyright?1993-2014?NVIDIA?Corporation.??All?rights?reserved.
?*
?*?Please?refer?to?the?NVIDIA?end?user?license?agreement?(EULA)?associated
?*?with?this?source?code?for?terms?and?conditions?that?govern?your?use?of
?*?this?software.?Any?use?reproduction?disclosure?or?distribution?of
?*?this?software?and?related?documentation?outside?the?terms?of?the?EULA
?*?is?strictly?prohibited.
?*
?*/
/*?This?example?demonstrates?how?to?use?the?Video?Decode?Library?with?CUDA
?*?bindings?to?interop?between?CUDA?and?DX9?textures?for?the?purpose?of?post
?*?processing?video.
?*/
#include?“cudaProcessframe.h“
#include?
#include?
#include?
#include?
#include?“dynlink_cuda.h“?//?
#include?“dynlink_builtin_types.h“ ??//?
#include?
//?These?store?the?matrix?for?YUV2RGB?transformation
__constant__?float??constHueColorSpaceMat[9];
__constant__?float??constAlpha;
extern?“C“
CUresult??updateConstantMemory_drvapi(CUmodule?module?float?*hueCSC)
{
????CUdeviceptr??d_constHueCSC?d_constAlpha;
????size_t???????d_cscBytes?d_alphaBytes;
????//?First?grab?the?global?device?pointers?from?the?CUBIN
????cuModuleGetGlobal(&d_constHueCSC??&d_cscBytes???module?“constHueColorSpaceMat“);
????cuModuleGetGlobal(&d_constAlpha???&d_alphaBytes?module?“constAlpha“);
????CUresult?error?=?CUDA_SUCCESS;
????//?Copy?the?constants?to?video?memory
????cuMemcpyHtoD(d_constHueCSC
?????????????????reinterpret_cast(hueCSC)
?????????????????d_cscBytes);
????getLastCudaDrvErrorMsg(“cuMemcpyHtoD?(d_constHueCSC)?copy?to?Constant?Memory?failed“);
????uint32?cudaAlpha??????=?((uint32)0xff<24);
????cuMemcpyHtoD(d_constAlpha
?????????????????reinterpret_cast(&cudaAlpha)
?????????????????d_alphaBytes);
????getLastCudaDrvErrorMsg(“cuMemcpyHtoD?(constAlpha)?copy?to?Constant?Memory?failed“);
????return?error;
}
extern?“C“
void?setColorSpaceMatrix(eColorSpace?CSC?float?*hueCSC?float?hue)
{
????float?hueSin?=?sin(hue);
????float?hueCos?=?cos(hue);
????if?(CSC?==?ITU601)
????{
????????//CCIR?601
????????hueCSC[0]?=?1.1644f;
????????hueCSC[1]?=?hueSin?*?1.5960f;
????????hueCSC[2]?=?hueCos?*?1.5960f;
????????hueCSC[3]?=?1.1644f;
????????hueCSC[4]?=?(hueCos?*?-0.3918f)?-?(hueSin?*?0.8130f);
????????hueCSC[5]?=?(hueSin?*??0.3918f)?-?(hueCos?*?0.8130f);
????????hueCSC[6]?=?1.1644f;
????????hueCSC[7]?=?hueCos?*??2.0172f;
????????hueCSC[8]?=?hueSin?*?-2.0172f;
????}
????else?if?(CSC?==?ITU709)
????{
????????//CCIR?709
????????hueCSC[0]?=?1.0f;
????????hueCSC[1]?=?hueSin?*?1.57480f;
????????hueCSC[2]?=?hueCos?*?1.57480f;
????????hueCSC[3]?=?1.0;
????????hueCSC[4]?=?(hueCos?*?-0.18732f)?-?(hueSin?*?0.46812f);
????????hueCSC[5]?=?(hueSin?*??0.18732f)?-?(hueCos?*?0.46812f);
????????hueCSC[6]?=?1.0f;
????????hueCSC[7]?=?hueCos?*??1.85560f;
????????hueCSC[8]?=?hueSin?*?-1.85560f;
????}
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2017-03-24?21:31??ffmpeg??NvDecodeD3D9\
?????目錄???????????0??2017-03-24?21:31??ffmpeg??NvDecodeD3D9\NvDecodeD3D9\
?????文件????????4774??2016-11-23?18:34??ffmpeg??NvDecodeD3D9\NvDecodeD3D9\fr
?????文件????????2828??2016-11-23?18:34??ffmpeg??NvDecodeD3D9\NvDecodeD3D9\fr
?????文件????????6876??2016-11-23?18:34??ffmpeg??NvDecodeD3D9\NvDecodeD3D9\ImageDX.cpp
?????文件????????3647??2016-11-23?18:34??ffmpeg??NvDecodeD3D9\NvDecodeD3D9\ImageDX.h
?????文件???????54770??2017-03-22?19:00??ffmpeg??NvDecodeD3D9\NvDecodeD3D9\NvDecodeD3D9.cpp
?????文件????????1324??2017-03-10?16:11??ffmpeg??NvDecodeD3D9\NvDecodeD3D9\NvDecodeD3D9_2013.sln
?????文件???????12116??2017-03-22?19:00??ffmpeg??NvDecodeD3D9\NvDecodeD3D9\NvDecodeD3D9_2013.vcxproj
?????文件????????7864??2017-03-21?22:10??ffmpeg??NvDecodeD3D9\NvDecodeD3D9\VideoDecoder.cpp
?????文件????????2418??2016-11-23?18:34??ffmpeg??NvDecodeD3D9\NvDecodeD3D9\VideoDecoder.h
?????文件????????4338??2017-03-14?11:08??ffmpeg??NvDecodeD3D9\NvDecodeD3D9\VideoParser.cpp
?????文件????????3647??2016-11-23?18:34??ffmpeg??NvDecodeD3D9\NvDecodeD3D9\VideoParser.h
?????文件????????9857??2017-03-21?22:10??ffmpeg??NvDecodeD3D9\NvDecodeD3D9\VideoSource.cpp
?????文件????????4655??2017-03-20?11:23??ffmpeg??NvDecodeD3D9\NvDecodeD3D9\VideoSource.h
?????文件???????31116??2015-12-10?10:28??ffmpeg??NvDecodeD3D9\NvDecodeD3D9\callback.hpp
?????文件????????5909??2016-11-23?18:34??ffmpeg??NvDecodeD3D9\NvDecodeD3D9\cudaProcessfr
?????文件????????2302??2016-11-23?18:34??ffmpeg??NvDecodeD3D9\NvDecodeD3D9\cudaProcessfr
?????目錄???????????0??2017-03-24?21:31??ffmpeg??NvDecodeD3D9\NvDecodeD3D9\third_party\
?????目錄???????????0??2017-03-24?21:31??ffmpeg??NvDecodeD3D9\NvDecodeD3D9\third_party\cuvid\
?????目錄???????????0??2017-03-24?21:31??ffmpeg??NvDecodeD3D9\NvDecodeD3D9\third_party\cuvid\inc\
?????目錄???????????0??2017-03-24?21:31??ffmpeg??NvDecodeD3D9\NvDecodeD3D9\third_party\cuvid\inc\GL\
?????文件?????????703??2016-11-23?18:34??ffmpeg??NvDecodeD3D9\NvDecodeD3D9\third_party\cuvid\inc\GL\freeglut.h
?????文件???????10682??2016-11-23?18:34??ffmpeg??NvDecodeD3D9\NvDecodeD3D9\third_party\cuvid\inc\GL\freeglut_ext.h
?????文件???????27750??2016-11-23?18:34??ffmpeg??NvDecodeD3D9\NvDecodeD3D9\third_party\cuvid\inc\GL\freeglut_std.h
?????文件???????70198??2016-11-23?18:34??ffmpeg??NvDecodeD3D9\NvDecodeD3D9\third_party\cuvid\inc\GL\gl.h
?????文件??????943450??2016-11-23?18:34??ffmpeg??NvDecodeD3D9\NvDecodeD3D9\third_party\cuvid\inc\GL\glew.h
?????文件??????691298??2016-11-23?18:34??ffmpeg??NvDecodeD3D9\NvDecodeD3D9\third_party\cuvid\inc\GL\glext.h
?????文件???????19252??2016-11-23?18:34??ffmpeg??NvDecodeD3D9\NvDecodeD3D9\third_party\cuvid\inc\GL\glu.h
?????文件?????????660??2016-11-23?18:34??ffmpeg??NvDecodeD3D9\NvDecodeD3D9\third_party\cuvid\inc\GL\glut.h
?????文件???????14378??2016-11-23?18:34??ffmpeg??NvDecodeD3D9\NvDecodeD3D9\third_party\cuvid\inc\GL\glx.h
............此處省略586個文件信息
- 上一篇:inception_v3_features.pkl
- 下一篇:《雷達手冊》中文第三版
評論
共有 條評論