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
80747088
Commit
80747088
authored
Oct 10, 2015
by
Pavel Rojtberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avoid needless copies during mjpeg decoding
parent
56dd7eda
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
10 deletions
+6
-10
cap_v4l.cpp
modules/videoio/src/cap_v4l.cpp
+6
-10
No files found.
modules/videoio/src/cap_v4l.cpp
View file @
80747088
...
...
@@ -1612,15 +1612,11 @@ uyvy_to_rgb24 (int width, int height, unsigned char *src, unsigned char *dst)
/* convert from mjpeg to rgb24 */
static
bool
mjpeg_to_rgb24
(
int
width
,
int
height
,
unsigned
char
*
src
,
int
length
,
unsigned
char
*
dst
)
{
cv
::
Mat
temp
=
cv
::
imdecode
(
cv
::
Mat
(
std
::
vector
<
uchar
>
(
src
,
src
+
length
)),
1
);
if
(
!
temp
.
data
||
temp
.
cols
!=
width
||
temp
.
rows
!=
height
)
return
false
;
memcpy
(
dst
,
temp
.
data
,
width
*
height
*
3
);
return
true
;
mjpeg_to_rgb24
(
int
width
,
int
height
,
unsigned
char
*
src
,
int
length
,
IplImage
*
dst
)
{
using
namespace
cv
;
Mat
temp
=
cvarrToMat
(
dst
);
imdecode
(
Mat
(
1
,
length
,
CV_8U
,
src
),
IMREAD_COLOR
,
&
temp
);
return
temp
.
data
&&
temp
.
cols
==
width
&&
temp
.
rows
==
height
;
}
#endif
...
...
@@ -2068,7 +2064,7 @@ static IplImage* icvRetrieveFrameCAM_V4L( CvCaptureCAM_V4L* capture, int) {
(
unsigned
char
*
)(
capture
->
buffers
[
capture
->
bufferIndex
]
.
start
),
capture
->
buffers
[
capture
->
bufferIndex
].
length
,
(
unsigned
char
*
)
capture
->
frame
.
imageData
))
&
capture
->
frame
))
return
0
;
break
;
#endif
...
...
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