Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
f65d841d
Commit
f65d841d
authored
Apr 23, 2012
by
Vladislav Vinogradov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed several warnings (VS2010, Win64)
added getParams method to VideoWriter_GPU
parent
24be840c
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
157 additions
and
37 deletions
+157
-37
opengl_interop.hpp
modules/core/include/opencv2/core/opengl_interop.hpp
+1
-1
matrix_operations.cu
modules/core/src/cuda/matrix_operations.cu
+1
-1
gpumat.cpp
modules/core/src/gpumat.cpp
+3
-2
opengl_interop.cpp
modules/core/src/opengl_interop.cpp
+2
-2
gpu.hpp
modules/gpu/include/opencv2/gpu/gpu.hpp
+5
-3
gftt.cpp
modules/gpu/src/gftt.cpp
+1
-1
imgproc.cpp
modules/gpu/src/imgproc.cpp
+2
-2
NCVBroxOpticalFlow.cu
modules/gpu/src/nvidia/NCVBroxOpticalFlow.cu
+1
-1
NCVHaarObjectDetection.hpp
modules/gpu/src/nvidia/NCVHaarObjectDetection.hpp
+1
-1
NCV.cu
modules/gpu/src/nvidia/core/NCV.cu
+4
-4
NCVPyramid.cu
modules/gpu/src/nvidia/core/NCVPyramid.cu
+4
-3
optical_flow.cpp
modules/gpu/src/optical_flow.cpp
+5
-5
orb.cpp
modules/gpu/src/orb.cpp
+3
-3
stereocsbp.cpp
modules/gpu/src/stereocsbp.cpp
+1
-1
video_parser.cpp
modules/gpu/src/video_parser.cpp
+1
-1
video_writer.cpp
modules/gpu/src/video_writer.cpp
+112
-2
test_features2d.cpp
modules/gpu/test/test_features2d.cpp
+8
-2
opticalflow_nvidia_api.cpp
samples/gpu/opticalflow_nvidia_api.cpp
+2
-2
No files found.
modules/core/include/opencv2/core/opengl_interop.hpp
View file @
f65d841d
...
...
@@ -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
,
in
t
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_
;
}
...
...
modules/core/src/cuda/matrix_operations.cu
View file @
f65d841d
...
...
@@ -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,
in
t 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);
...
...
modules/core/src/gpumat.cpp
View file @
f65d841d
...
...
@@ -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
,
in
t
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
);
...
...
modules/core/src/opengl_interop.cpp
View file @
f65d841d
...
...
@@ -1257,7 +1257,7 @@ cv::GlFont::GlFont(const string& family, int height, Weight weight, Style style)
#endif
}
void
cv
::
GlFont
::
draw
(
const
char
*
str
,
in
t
len
)
const
void
cv
::
GlFont
::
draw
(
const
char
*
str
,
size_
t
len
)
const
{
#ifndef HAVE_OPENGL
(
void
)
str
;
...
...
@@ -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
();
...
...
modules/gpu/include/opencv2/gpu/gpu.hpp
View file @
f65d841d
...
...
@@ -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
)
{}
...
...
modules/gpu/src/gftt.cpp
View file @
f65d841d
...
...
@@ -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
]));
}
}
...
...
modules/gpu/src/imgproc.cpp
View file @
f65d841d
...
...
@@ -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
);
...
...
modules/gpu/src/nvidia/NCVBroxOpticalFlow.cu
View file @
f65d841d
...
...
@@ -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];
...
...
modules/gpu/src/nvidia/NCVHaarObjectDetection.hpp
View file @
f65d841d
...
...
@@ -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
;
}
...
...
modules/gpu/src/nvidia/core/NCV.cu
View file @
f65d841d
...
...
@@ -351,7 +351,7 @@ NCVStatus NCVMemStackAllocator::alloc(NCVMemSegment &seg, size_t size)
seg.clear();
ncvAssertReturn(isInitialized(), NCV_ALLOCATOR_BAD_ALLOC);
size = alignUp(s
ize
, this->_alignment);
size = alignUp(s
tatic_cast<Ncv32u>(size)
, this->_alignment);
this->currentSize += size;
this->_maxSize = std::max(this->_maxSize, this->currentSize);
...
...
@@ -461,7 +461,7 @@ NCVStatus NCVMemNativeAllocator::alloc(NCVMemSegment &seg, size_t size)
default:;
}
this->currentSize += alignUp(s
ize
, this->_alignment);
this->currentSize += alignUp(s
tatic_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(s
eg.size
, this->_alignment), NCV_ALLOCATOR_BAD_DEALLOC);
currentSize -= alignUp(s
eg.size
, this->_alignment);
ncvAssertReturn(currentSize >= alignUp(s
tatic_cast<Ncv32u>(seg.size)
, this->_alignment), NCV_ALLOCATOR_BAD_DEALLOC);
currentSize -= alignUp(s
tatic_cast<Ncv32u>(seg.size)
, this->_alignment);
switch (this->_memType)
{
...
...
modules/gpu/src/nvidia/core/NCVPyramid.cu
View file @
f65d841d
...
...
@@ -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, s
rc.step
, NcvSize32u(src.cols, src.rows),
(T*) dst.data,
dst.step
, NcvSize32u(dst.cols, dst.rows));
kernelInterpolateFrom1<<<gDim, bDim, 0, stream>>>((T*) src.data, s
tatic_cast<Ncv32u>(src.step)
, NcvSize32u(src.cols, src.rows),
(T*) dst.data,
static_cast<Ncv32u>(dst.step)
, NcvSize32u(dst.cols, dst.rows));
cudaSafeCall( cudaGetLastError() );
...
...
modules/gpu/src/optical_flow.cpp
View file @
f65d841d
...
...
@@ -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
());
...
...
modules/gpu/src/orb.cpp
View file @
f65d841d
...
...
@@ -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.0
f
-
factor
)
/
(
1.0
f
-
std
::
pow
(
factor
,
nLevels_
));
n_features_per_level_
.
resize
(
nLevels_
);
in
t
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
)
{
...
...
modules/gpu/src/stereocsbp.cpp
View file @
f65d841d
...
...
@@ -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
);
...
...
modules/gpu/src/video_parser.cpp
View file @
f65d841d
...
...
@@ -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
=
s
ize
;
packet
.
payload_size
=
s
tatic_cast
<
unsigned
long
>
(
size
)
;
packet
.
payload
=
data
;
if
(
cuvidParseVideoData
(
parser_
,
&
packet
)
!=
CUDA_SUCCESS
)
...
...
modules/gpu/src/video_writer.cpp
View file @
f65d841d
...
...
@@ -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
...
...
modules/gpu/test/test_features2d.cpp
View file @
f65d841d
...
...
@@ -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
++
;
}
}
...
...
samples/gpu/opticalflow_nvidia_api.cpp
View file @
f65d841d
...
...
@@ -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
;
...
...
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