mirror of
https://github.com/opencv/opencv.git
synced 2025-01-18 06:03:15 +08:00
fixed several warnings (VS2010, Win64)
added getParams method to VideoWriter_GPU
This commit is contained in:
parent
24be840c44
commit
f65d841d6f
@ -221,7 +221,7 @@ namespace cv
|
||||
|
||||
static Ptr<GlFont> get(const std::string& family, int height = 12, Weight weight = WEIGHT_NORMAL, Style style = STYLE_NORMAL);
|
||||
|
||||
void draw(const char* str, int len) const;
|
||||
void draw(const char* str, size_t len) const;
|
||||
|
||||
inline const std::string& family() const { return family_; }
|
||||
inline int height() const { return height_; }
|
||||
|
@ -67,7 +67,7 @@ namespace cv { namespace gpu { namespace device
|
||||
cv::gpu::device::transform((DevMem2D_<T>)src, (DevMem2D_<T>)dst, identity<T>(), SingleMaskChannels(mask, cn), stream);
|
||||
}
|
||||
|
||||
void copyToWithMask_gpu(DevMem2Db src, DevMem2Db dst, int elemSize1, int cn, DevMem2Db mask, bool colorMask, cudaStream_t stream)
|
||||
void copyToWithMask_gpu(DevMem2Db src, DevMem2Db dst, size_t elemSize1, int cn, DevMem2Db mask, bool colorMask, cudaStream_t stream)
|
||||
{
|
||||
typedef void (*func_t)(DevMem2Db src, DevMem2Db dst, int cn, DevMem2Db mask, bool colorMask, cudaStream_t stream);
|
||||
|
||||
|
@ -320,7 +320,8 @@ namespace
|
||||
template <class T> void getCudaAttribute(T *attribute, CUdevice_attribute device_attribute, int device)
|
||||
{
|
||||
*attribute = T();
|
||||
CUresult error = CUDA_SUCCESS;// = cuDeviceGetAttribute( attribute, device_attribute, device ); why link erros under ubuntu??
|
||||
//CUresult error = CUDA_SUCCESS;// = cuDeviceGetAttribute( attribute, device_attribute, device ); why link erros under ubuntu??
|
||||
CUresult error = cuDeviceGetAttribute( attribute, device_attribute, device );
|
||||
if( CUDA_SUCCESS == error )
|
||||
return;
|
||||
|
||||
@ -760,7 +761,7 @@ namespace
|
||||
|
||||
namespace cv { namespace gpu { namespace device
|
||||
{
|
||||
void copyToWithMask_gpu(DevMem2Db src, DevMem2Db dst, int elemSize1, int cn, DevMem2Db mask, bool colorMask, cudaStream_t stream);
|
||||
void copyToWithMask_gpu(DevMem2Db src, DevMem2Db dst, size_t elemSize1, int cn, DevMem2Db mask, bool colorMask, cudaStream_t stream);
|
||||
|
||||
template <typename T>
|
||||
void set_to_gpu(DevMem2Db mat, const T* scalar, int channels, cudaStream_t stream);
|
||||
|
@ -1257,11 +1257,11 @@ cv::GlFont::GlFont(const string& family, int height, Weight weight, Style style)
|
||||
#endif
|
||||
}
|
||||
|
||||
void cv::GlFont::draw(const char* str, int len) const
|
||||
void cv::GlFont::draw(const char* str, size_t len) const
|
||||
{
|
||||
#ifndef HAVE_OPENGL
|
||||
(void)str;
|
||||
(void)len;
|
||||
(void)str;
|
||||
(void)len;
|
||||
throw_nogl;
|
||||
#else
|
||||
if (base_ && len > 0)
|
||||
@ -1269,7 +1269,7 @@ void cv::GlFont::draw(const char* str, int len) const
|
||||
glPushAttrib(GL_LIST_BIT);
|
||||
glListBase(base_);
|
||||
|
||||
glCallLists(len, GL_UNSIGNED_BYTE, str);
|
||||
glCallLists(static_cast<GLsizei>(len), GL_UNSIGNED_BYTE, str);
|
||||
|
||||
glPopAttrib();
|
||||
|
||||
|
@ -1928,7 +1928,7 @@ public:
|
||||
|
||||
void write(const cv::gpu::GpuMat& image, bool lastFrame = false);
|
||||
|
||||
struct EncoderParams
|
||||
struct CV_EXPORTS EncoderParams
|
||||
{
|
||||
int P_Interval; // NVVE_P_INTERVAL,
|
||||
int IDR_Period; // NVVE_IDR_PERIOD,
|
||||
@ -1957,7 +1957,9 @@ public:
|
||||
void save(const std::string& configFile) const;
|
||||
};
|
||||
|
||||
class EncoderCallBack
|
||||
EncoderParams getParams() const;
|
||||
|
||||
class CV_EXPORTS EncoderCallBack
|
||||
{
|
||||
public:
|
||||
enum PicType
|
||||
@ -2056,7 +2058,7 @@ public:
|
||||
FormatInfo format() const;
|
||||
void dumpFormat(std::ostream& st);
|
||||
|
||||
class VideoSource
|
||||
class CV_EXPORTS VideoSource
|
||||
{
|
||||
public:
|
||||
VideoSource() : frameQueue_(0), videoParser_(0) {}
|
||||
|
@ -160,7 +160,7 @@ void cv::gpu::GoodFeaturesToTrackDetector_GPU::operator ()(const GpuMat& image,
|
||||
}
|
||||
}
|
||||
|
||||
corners.upload(Mat(1, tmp2.size(), CV_32FC2, &tmp2[0]));
|
||||
corners.upload(Mat(1, static_cast<int>(tmp2.size()), CV_32FC2, &tmp2[0]));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1300,9 +1300,9 @@ void cv::gpu::ConvolveBuf::create(Size image_size, Size templ_size)
|
||||
// CUFFT has hard-coded kernels for power-of-2 sizes (up to 8192),
|
||||
// see CUDA Toolkit 4.1 CUFFT Library Programming Guide
|
||||
if (dft_size.width > 8192)
|
||||
dft_size.width = getOptimalDFTSize(block_size.width + templ_size.width - 1.);
|
||||
dft_size.width = getOptimalDFTSize(block_size.width + templ_size.width - 1);
|
||||
if (dft_size.height > 8192)
|
||||
dft_size.height = getOptimalDFTSize(block_size.height + templ_size.height - 1.);
|
||||
dft_size.height = getOptimalDFTSize(block_size.height + templ_size.height - 1);
|
||||
|
||||
// To avoid wasting time doing small DFTs
|
||||
dft_size.width = std::max(dft_size.width, 512);
|
||||
|
@ -692,7 +692,7 @@ namespace
|
||||
w.clear();
|
||||
h.clear();
|
||||
|
||||
for (int i = img0.size() - 1; i >= 0; --i)
|
||||
for (int i = static_cast<int>(img0.size()) - 1; i >= 0; --i)
|
||||
{
|
||||
delete img1[i];
|
||||
delete img0[i];
|
||||
|
@ -83,7 +83,7 @@ struct HaarFeature64
|
||||
__host__ NCVStatus setRect(Ncv32u rectX, Ncv32u rectY, Ncv32u rectWidth, Ncv32u rectHeight, Ncv32u /*clsWidth*/, Ncv32u /*clsHeight*/)
|
||||
{
|
||||
ncvAssertReturn(rectWidth <= HaarFeature64_CreateCheck_MaxRectField && rectHeight <= HaarFeature64_CreateCheck_MaxRectField, NCV_HAAR_TOO_LARGE_FEATURES);
|
||||
_rect = NcvRect8u(rectX,rectY,rectWidth,rectHeight);
|
||||
_rect = NcvRect8u(static_cast<Ncv8u>(rectX),static_cast<Ncv8u>(rectY),static_cast<Ncv8u>(rectWidth),static_cast<Ncv8u>(rectHeight));
|
||||
|
||||
return NCV_SUCCESS;
|
||||
}
|
||||
|
@ -295,7 +295,7 @@ NCVMemStackAllocator::NCVMemStackAllocator(NCVMemoryType memT, size_t capacity,
|
||||
break;
|
||||
case NCVMemoryTypeHostPageable:
|
||||
allocBegin = (Ncv8u *)malloc(capacity);
|
||||
break;
|
||||
break;
|
||||
default:;
|
||||
}
|
||||
}
|
||||
@ -336,7 +336,7 @@ NCVMemStackAllocator::~NCVMemStackAllocator()
|
||||
break;
|
||||
case NCVMemoryTypeHostPageable:
|
||||
free(allocBegin);
|
||||
break;
|
||||
break;
|
||||
default:;
|
||||
}
|
||||
}
|
||||
@ -351,7 +351,7 @@ NCVStatus NCVMemStackAllocator::alloc(NCVMemSegment &seg, size_t size)
|
||||
seg.clear();
|
||||
ncvAssertReturn(isInitialized(), NCV_ALLOCATOR_BAD_ALLOC);
|
||||
|
||||
size = alignUp(size, this->_alignment);
|
||||
size = alignUp(static_cast<Ncv32u>(size), this->_alignment);
|
||||
this->currentSize += size;
|
||||
this->_maxSize = std::max(this->_maxSize, this->currentSize);
|
||||
|
||||
@ -457,11 +457,11 @@ NCVStatus NCVMemNativeAllocator::alloc(NCVMemSegment &seg, size_t size)
|
||||
break;
|
||||
case NCVMemoryTypeHostPageable:
|
||||
seg.begin.ptr = (Ncv8u *)malloc(size);
|
||||
break;
|
||||
break;
|
||||
default:;
|
||||
}
|
||||
|
||||
this->currentSize += alignUp(size, this->_alignment);
|
||||
this->currentSize += alignUp(static_cast<Ncv32u>(size), this->_alignment);
|
||||
this->_maxSize = std::max(this->_maxSize, this->currentSize);
|
||||
|
||||
seg.begin.memtype = this->_memType;
|
||||
@ -477,8 +477,8 @@ NCVStatus NCVMemNativeAllocator::dealloc(NCVMemSegment &seg)
|
||||
ncvAssertReturn(seg.begin.memtype == this->_memType, NCV_ALLOCATOR_BAD_DEALLOC);
|
||||
ncvAssertReturn(seg.begin.ptr != NULL, NCV_ALLOCATOR_BAD_DEALLOC);
|
||||
|
||||
ncvAssertReturn(currentSize >= alignUp(seg.size, this->_alignment), NCV_ALLOCATOR_BAD_DEALLOC);
|
||||
currentSize -= alignUp(seg.size, this->_alignment);
|
||||
ncvAssertReturn(currentSize >= alignUp(static_cast<Ncv32u>(seg.size), this->_alignment), NCV_ALLOCATOR_BAD_DEALLOC);
|
||||
currentSize -= alignUp(static_cast<Ncv32u>(seg.size), this->_alignment);
|
||||
|
||||
switch (this->_memType)
|
||||
{
|
||||
@ -490,7 +490,7 @@ NCVStatus NCVMemNativeAllocator::dealloc(NCVMemSegment &seg)
|
||||
break;
|
||||
case NCVMemoryTypeHostPageable:
|
||||
free(seg.begin.ptr);
|
||||
break;
|
||||
break;
|
||||
default:;
|
||||
}
|
||||
|
||||
|
@ -211,7 +211,8 @@ namespace cv { namespace gpu { namespace device
|
||||
dim3 bDim(16, 8);
|
||||
dim3 gDim(divUp(src.cols, bDim.x), divUp(src.rows, bDim.y));
|
||||
|
||||
kernelDownsampleX2<<<gDim, bDim, 0, stream>>>((T*)src.data, src.step, (T*)dst.data, dst.step, NcvSize32u(dst.cols, dst.rows));
|
||||
kernelDownsampleX2<<<gDim, bDim, 0, stream>>>((T*)src.data, static_cast<Ncv32u>(src.step),
|
||||
(T*)dst.data, static_cast<Ncv32u>(dst.step), NcvSize32u(dst.cols, dst.rows));
|
||||
|
||||
cudaSafeCall( cudaGetLastError() );
|
||||
|
||||
@ -285,8 +286,8 @@ namespace cv { namespace gpu { namespace device
|
||||
dim3 bDim(16, 8);
|
||||
dim3 gDim(divUp(dst.cols, bDim.x), divUp(dst.rows, bDim.y));
|
||||
|
||||
kernelInterpolateFrom1<<<gDim, bDim, 0, stream>>>((T*) src.data, src.step, NcvSize32u(src.cols, src.rows),
|
||||
(T*) dst.data, dst.step, NcvSize32u(dst.cols, dst.rows));
|
||||
kernelInterpolateFrom1<<<gDim, bDim, 0, stream>>>((T*) src.data, static_cast<Ncv32u>(src.step), NcvSize32u(src.cols, src.rows),
|
||||
(T*) dst.data, static_cast<Ncv32u>(dst.step), NcvSize32u(dst.cols, dst.rows));
|
||||
|
||||
cudaSafeCall( cudaGetLastError() );
|
||||
|
||||
|
@ -114,16 +114,16 @@ void cv::gpu::BroxOpticalFlow::operator ()(const GpuMat& frame0, const GpuMat& f
|
||||
vMemSeg.begin.ptr = v.ptr();
|
||||
vMemSeg.size = v.step * v.rows;
|
||||
|
||||
NCVMatrixReuse<Ncv32f> frame0Mat(frame0MemSeg, devProp.textureAlignment, frame0.cols, frame0.rows, frame0.step);
|
||||
NCVMatrixReuse<Ncv32f> frame1Mat(frame1MemSeg, devProp.textureAlignment, frame1.cols, frame1.rows, frame1.step);
|
||||
NCVMatrixReuse<Ncv32f> uMat(uMemSeg, devProp.textureAlignment, u.cols, u.rows, u.step);
|
||||
NCVMatrixReuse<Ncv32f> vMat(vMemSeg, devProp.textureAlignment, v.cols, v.rows, v.step);
|
||||
NCVMatrixReuse<Ncv32f> frame0Mat(frame0MemSeg, static_cast<Ncv32u>(devProp.textureAlignment), frame0.cols, frame0.rows, static_cast<Ncv32u>(frame0.step));
|
||||
NCVMatrixReuse<Ncv32f> frame1Mat(frame1MemSeg, static_cast<Ncv32u>(devProp.textureAlignment), frame1.cols, frame1.rows, static_cast<Ncv32u>(frame1.step));
|
||||
NCVMatrixReuse<Ncv32f> uMat(uMemSeg, static_cast<Ncv32u>(devProp.textureAlignment), u.cols, u.rows, static_cast<Ncv32u>(u.step));
|
||||
NCVMatrixReuse<Ncv32f> vMat(vMemSeg, static_cast<Ncv32u>(devProp.textureAlignment), v.cols, v.rows, static_cast<Ncv32u>(v.step));
|
||||
|
||||
cudaStream_t stream = StreamAccessor::getStream(s);
|
||||
|
||||
size_t bufSize = getBufSize(desc, frame0Mat, frame1Mat, uMat, vMat, devProp);
|
||||
|
||||
ensureSizeIsEnough(1, bufSize, CV_8UC1, buf);
|
||||
ensureSizeIsEnough(1, static_cast<int>(bufSize), CV_8UC1, buf);
|
||||
|
||||
NCVMemStackAllocator gpuAllocator(NCVMemoryTypeDevice, bufSize, static_cast<Ncv32u>(devProp.textureAlignment), buf.ptr());
|
||||
|
||||
|
@ -406,7 +406,7 @@ cv::gpu::ORB_GPU::ORB_GPU(int nFeatures, float scaleFactor, int nLevels, int edg
|
||||
float n_desired_features_per_scale = nFeatures_ * (1.0f - factor) / (1.0f - std::pow(factor, nLevels_));
|
||||
|
||||
n_features_per_level_.resize(nLevels_);
|
||||
int sum_n_features = 0;
|
||||
size_t sum_n_features = 0;
|
||||
for (int level = 0; level < nLevels_ - 1; ++level)
|
||||
{
|
||||
n_features_per_level_[level] = cvRound(n_desired_features_per_scale);
|
||||
@ -430,7 +430,7 @@ cv::gpu::ORB_GPU::ORB_GPU(int nFeatures, float scaleFactor, int nLevels, int edg
|
||||
++v_0;
|
||||
}
|
||||
CV_Assert(u_max.size() < 32);
|
||||
cv::gpu::device::orb::loadUMax(&u_max[0], u_max.size());
|
||||
cv::gpu::device::orb::loadUMax(&u_max[0], static_cast<int>(u_max.size()));
|
||||
|
||||
// Calc pattern
|
||||
const int npoints = 512;
|
||||
@ -573,7 +573,7 @@ void cv::gpu::ORB_GPU::computeKeyPointsPyramid()
|
||||
GpuMat fastKpRange = keyPointsPyr_[level].rowRange(0, 2);
|
||||
keyPointsCount_[level] = fastDetector_.getKeyPoints(fastKpRange);
|
||||
|
||||
int n_features = n_features_per_level_[level];
|
||||
int n_features = static_cast<int>(n_features_per_level_[level]);
|
||||
|
||||
if (scoreType_ == ORB::HARRIS_SCORE)
|
||||
{
|
||||
|
@ -204,7 +204,7 @@ static void csbp_operator(StereoConstantSpaceBP& rthis, GpuMat& mbuf, GpuMat& te
|
||||
|
||||
Size temp_size = data_cost.size();
|
||||
if ((size_t)temp_size.area() < elem_step * rows_pyr[levels - 1] * rthis.ndisp)
|
||||
temp_size = Size(elem_step, rows_pyr[levels - 1] * rthis.ndisp);
|
||||
temp_size = Size(static_cast<int>(elem_step), rows_pyr[levels - 1] * rthis.ndisp);
|
||||
|
||||
temp.create(temp_size, DataType<T>::type);
|
||||
|
||||
|
@ -70,7 +70,7 @@ bool cv::gpu::detail::VideoParser::parseVideoData(const unsigned char* data, siz
|
||||
if (endOfStream)
|
||||
packet.flags |= CUVID_PKT_ENDOFSTREAM;
|
||||
|
||||
packet.payload_size = size;
|
||||
packet.payload_size = static_cast<unsigned long>(size);
|
||||
packet.payload = data;
|
||||
|
||||
if (cuvidParseVideoData(parser_, &packet) != CUDA_SUCCESS)
|
||||
|
@ -57,6 +57,7 @@ void cv::gpu::VideoWriter_GPU::open(const cv::Ptr<EncoderCallBack>&, cv::Size, d
|
||||
bool cv::gpu::VideoWriter_GPU::isOpened() const { return false; }
|
||||
void cv::gpu::VideoWriter_GPU::close() {}
|
||||
void cv::gpu::VideoWriter_GPU::write(const cv::gpu::GpuMat&, bool) { throw_nogpu(); }
|
||||
cv::gpu::VideoWriter_GPU::EncoderParams cv::gpu::VideoWriter_GPU::getParams() const { EncoderParams params; throw_nogpu(); return params; }
|
||||
|
||||
cv::gpu::VideoWriter_GPU::EncoderParams::EncoderParams() { throw_nogpu(); }
|
||||
cv::gpu::VideoWriter_GPU::EncoderParams::EncoderParams(const std::string&) { throw_nogpu(); }
|
||||
@ -129,6 +130,8 @@ public:
|
||||
|
||||
void write(const cv::gpu::GpuMat& image, bool lastFrame);
|
||||
|
||||
EncoderParams getParams() const;
|
||||
|
||||
private:
|
||||
Impl(const Impl&);
|
||||
Impl& operator=(const Impl&);
|
||||
@ -224,8 +227,7 @@ void cv::gpu::VideoWriter_GPU::Impl::initEncoder(double fps)
|
||||
err = NVSetParamValue(encoder_, NVVE_OUT_SIZE, &inputSize);
|
||||
CV_Assert( err == 0 );
|
||||
|
||||
//int aspectRatio[] = { frameSize_.width, frameSize_.height, ASPECT_RATIO_DAR };
|
||||
int aspectRatio[] = { 16, 9, ASPECT_RATIO_DAR };
|
||||
int aspectRatio[] = { frameSize_.width, frameSize_.height, ASPECT_RATIO_DAR };
|
||||
err = NVSetParamValue(encoder_, NVVE_ASPECT_RATIO, &aspectRatio);
|
||||
CV_Assert( err == 0 );
|
||||
|
||||
@ -333,6 +335,107 @@ void cv::gpu::VideoWriter_GPU::Impl::setEncodeParams(const EncoderParams& params
|
||||
CV_Assert ( err == 0 );
|
||||
}
|
||||
|
||||
cv::gpu::VideoWriter_GPU::EncoderParams cv::gpu::VideoWriter_GPU::Impl::getParams() const
|
||||
{
|
||||
int err;
|
||||
|
||||
EncoderParams params;
|
||||
|
||||
int P_Interval;
|
||||
err = NVGetParamValue(encoder_, NVVE_P_INTERVAL, &P_Interval);
|
||||
CV_Assert( err == 0 );
|
||||
params.P_Interval = P_Interval;
|
||||
|
||||
int IDR_Period;
|
||||
err = NVGetParamValue(encoder_, NVVE_IDR_PERIOD, &IDR_Period);
|
||||
CV_Assert( err == 0 );
|
||||
params.IDR_Period = IDR_Period;
|
||||
|
||||
int DynamicGOP;
|
||||
err = NVGetParamValue(encoder_, NVVE_DYNAMIC_GOP, &DynamicGOP);
|
||||
CV_Assert( err == 0 );
|
||||
params.DynamicGOP = DynamicGOP;
|
||||
|
||||
NVVE_RateCtrlType RCType;
|
||||
err = NVGetParamValue(encoder_, NVVE_RC_TYPE, &RCType);
|
||||
CV_Assert( err == 0 );
|
||||
params.RCType = RCType;
|
||||
|
||||
int AvgBitrate;
|
||||
err = NVGetParamValue(encoder_, NVVE_AVG_BITRATE, &AvgBitrate);
|
||||
CV_Assert( err == 0 );
|
||||
params.AvgBitrate = AvgBitrate;
|
||||
|
||||
int PeakBitrate;
|
||||
err = NVGetParamValue(encoder_, NVVE_PEAK_BITRATE, &PeakBitrate);
|
||||
CV_Assert( err == 0 );
|
||||
params.PeakBitrate = PeakBitrate;
|
||||
|
||||
int QP_Level_Intra;
|
||||
err = NVGetParamValue(encoder_, NVVE_QP_LEVEL_INTRA, &QP_Level_Intra);
|
||||
CV_Assert( err == 0 );
|
||||
params.QP_Level_Intra = QP_Level_Intra;
|
||||
|
||||
int QP_Level_InterP;
|
||||
err = NVGetParamValue(encoder_, NVVE_QP_LEVEL_INTER_P, &QP_Level_InterP);
|
||||
CV_Assert( err == 0 );
|
||||
params.QP_Level_InterP = QP_Level_InterP;
|
||||
|
||||
int QP_Level_InterB;
|
||||
err = NVGetParamValue(encoder_, NVVE_QP_LEVEL_INTER_B, &QP_Level_InterB);
|
||||
CV_Assert( err == 0 );
|
||||
params.QP_Level_InterB = QP_Level_InterB;
|
||||
|
||||
int DeblockMode;
|
||||
err = NVGetParamValue(encoder_, NVVE_DEBLOCK_MODE, &DeblockMode);
|
||||
CV_Assert( err == 0 );
|
||||
params.DeblockMode = DeblockMode;
|
||||
|
||||
int ProfileLevel;
|
||||
err = NVGetParamValue(encoder_, NVVE_PROFILE_LEVEL, &ProfileLevel);
|
||||
CV_Assert( err == 0 );
|
||||
params.ProfileLevel = ProfileLevel;
|
||||
|
||||
int ForceIntra;
|
||||
err = NVGetParamValue(encoder_, NVVE_FORCE_INTRA, &ForceIntra);
|
||||
CV_Assert( err == 0 );
|
||||
params.ForceIntra = ForceIntra;
|
||||
|
||||
int ForceIDR;
|
||||
err = NVGetParamValue(encoder_, NVVE_FORCE_IDR, &ForceIDR);
|
||||
CV_Assert( err == 0 );
|
||||
params.ForceIDR = ForceIDR;
|
||||
|
||||
int ClearStat;
|
||||
err = NVGetParamValue(encoder_, NVVE_CLEAR_STAT, &ClearStat);
|
||||
CV_Assert( err == 0 );
|
||||
params.ClearStat = ClearStat;
|
||||
|
||||
NVVE_DI_MODE DIMode;
|
||||
err = NVGetParamValue(encoder_, NVVE_SET_DEINTERLACE, &DIMode);
|
||||
CV_Assert( err == 0 );
|
||||
params.DIMode = DIMode;
|
||||
|
||||
params.Presets = -1;
|
||||
|
||||
int DisableCabac;
|
||||
err = NVGetParamValue(encoder_, NVVE_DISABLE_CABAC, &DisableCabac);
|
||||
CV_Assert ( err == 0 );
|
||||
params.DisableCabac = DisableCabac;
|
||||
|
||||
int NaluFramingType;
|
||||
err = NVGetParamValue(encoder_, NVVE_CONFIGURE_NALU_FRAMING_TYPE, &NaluFramingType);
|
||||
CV_Assert ( err == 0 );
|
||||
params.NaluFramingType = NaluFramingType;
|
||||
|
||||
int DisableSPSPPS;
|
||||
err = NVGetParamValue(encoder_, NVVE_DISABLE_SPS_PPS, &DisableSPSPPS);
|
||||
CV_Assert ( err == 0 );
|
||||
params.DisableSPSPPS = DisableSPSPPS;
|
||||
|
||||
return params;
|
||||
}
|
||||
|
||||
void cv::gpu::VideoWriter_GPU::Impl::initGpuMemory()
|
||||
{
|
||||
int err;
|
||||
@ -807,6 +910,13 @@ void cv::gpu::VideoWriter_GPU::write(const cv::gpu::GpuMat& image, bool lastFram
|
||||
impl_->write(image, lastFrame);
|
||||
}
|
||||
|
||||
cv::gpu::VideoWriter_GPU::EncoderParams cv::gpu::VideoWriter_GPU::getParams() const
|
||||
{
|
||||
CV_Assert( isOpened() );
|
||||
|
||||
return impl_->getParams();
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// VideoWriter_GPU::EncoderParams
|
||||
|
||||
|
@ -617,12 +617,18 @@ TEST_P(BruteForceMatcher, MatchAdd)
|
||||
|
||||
if ((int)i < queryDescCount / 2)
|
||||
{
|
||||
if ((match.queryIdx != (int)i) || (match.trainIdx != (int)i * countFactor + shift) || (match.imgIdx != 0))
|
||||
bool validQueryIdx = (match.queryIdx == (int)i);
|
||||
bool validTrainIdx = (match.trainIdx == (int)i * countFactor + shift);
|
||||
bool validImgIdx = (match.imgIdx == 0);
|
||||
if (!validQueryIdx || !validTrainIdx || !validImgIdx)
|
||||
badCount++;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((match.queryIdx != (int)i) || (match.trainIdx != ((int)i - queryDescCount / 2) * countFactor + shift) || (match.imgIdx != 1))
|
||||
bool validQueryIdx = (match.queryIdx == (int)i);
|
||||
bool validTrainIdx = (match.trainIdx == ((int)i - queryDescCount / 2) * countFactor + shift);
|
||||
bool validImgIdx = (match.imgIdx == 1);
|
||||
if (!validQueryIdx || !validTrainIdx || !validImgIdx)
|
||||
badCount++;
|
||||
}
|
||||
}
|
||||
|
@ -407,10 +407,10 @@ int main(int argc, char **argv)
|
||||
std::cout << "Using GPU: " << devId << "(" << devProp.name <<
|
||||
"), arch=" << devProp.major << "." << devProp.minor << std::endl;
|
||||
|
||||
g_pGPUMemAllocator = Ptr<INCVMemAllocator> (new NCVMemNativeAllocator (NCVMemoryTypeDevice, devProp.textureAlignment));
|
||||
g_pGPUMemAllocator = Ptr<INCVMemAllocator> (new NCVMemNativeAllocator (NCVMemoryTypeDevice, static_cast<Ncv32u>(devProp.textureAlignment)));
|
||||
ncvAssertPrintReturn (g_pGPUMemAllocator->isInitialized (), "Device memory allocator isn't initialized", -1);
|
||||
|
||||
g_pHostMemAllocator = Ptr<INCVMemAllocator> (new NCVMemNativeAllocator (NCVMemoryTypeHostPageable, devProp.textureAlignment));
|
||||
g_pHostMemAllocator = Ptr<INCVMemAllocator> (new NCVMemNativeAllocator (NCVMemoryTypeHostPageable, static_cast<Ncv32u>(devProp.textureAlignment)));
|
||||
ncvAssertPrintReturn (g_pHostMemAllocator->isInitialized (), "Host memory allocator isn't initialized", -1);
|
||||
|
||||
int width, height;
|
||||
|
Loading…
Reference in New Issue
Block a user