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
613a69ab
Commit
613a69ab
authored
May 19, 2011
by
Andrey Kamaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tegra optimization for yuv420i to rgb conversion
parent
2cb08d7f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
0 deletions
+12
-0
cap_android.cpp
modules/highgui/src/cap_android.cpp
+8
-0
precomp.hpp
modules/highgui/src/precomp.hpp
+4
-0
No files found.
modules/highgui/src/cap_android.cpp
View file @
613a69ab
...
...
@@ -48,10 +48,12 @@
#include <android/log.h>
#include "camera_activity.h"
#if !defined(LOGD) && !defined(LOGI) && !defined(LOGE)
#define LOG_TAG "CV_CAP"
#define LOGD(...) ((void)__android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__))
#define LOGI(...) ((void)__android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__))
#define LOGE(...) ((void)__android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__))
#endif
class
HighguiAndroidCameraActivity
;
...
...
@@ -457,6 +459,7 @@ bool CvCapture_Android::convertYUV420i2Grey(int width, int height, const unsigne
return
!
resmat
.
empty
();
}
#ifndef HAVE_TEGRA_OPTIMIZATION
template
<
int
R
>
struct
YUV420i2BGR888Invoker
{
...
...
@@ -513,6 +516,7 @@ struct YUV420i2BGR888Invoker
}
}
};
#endif
bool
CvCapture_Android
::
convertYUV420i2BGR888
(
int
width
,
int
height
,
const
unsigned
char
*
yuv
,
cv
::
Mat
&
resmat
,
bool
inRGBorder
)
{
...
...
@@ -524,10 +528,14 @@ bool CvCapture_Android::convertYUV420i2BGR888(int width, int height, const unsig
unsigned
char
*
y1
=
(
unsigned
char
*
)
yuv
;
unsigned
char
*
uv
=
y1
+
width
*
height
;
#ifdef HAVE_TEGRA_OPTIMIZATION
cv
::
parallel_for
(
cv
::
BlockedRange
(
0
,
height
,
2
),
tegra
::
YUV420i2BGR888Invoker
(
resmat
,
width
,
y1
,
uv
,
inRGBorder
));
#else
if
(
inRGBorder
)
cv
::
parallel_for
(
cv
::
BlockedRange
(
0
,
height
,
2
),
YUV420i2BGR888Invoker
<
2
>
(
resmat
,
width
,
y1
,
uv
));
else
cv
::
parallel_for
(
cv
::
BlockedRange
(
0
,
height
,
2
),
YUV420i2BGR888Invoker
<
0
>
(
resmat
,
width
,
y1
,
uv
));
#endif
return
!
resmat
.
empty
();
}
...
...
modules/highgui/src/precomp.hpp
View file @
613a69ab
...
...
@@ -60,6 +60,10 @@
#include <ctype.h>
#include <assert.h>
#ifdef HAVE_TEGRA_OPTIMIZATION
#include "opencv2/highgui/highgui_tegra.hpp"
#endif
#if defined WIN32 || defined _WIN32
#define WIN32_LEAN_AND_MEAN
...
...
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