Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Monado
Monado
Commits
a0fcaf9b
Commit
a0fcaf9b
authored
Aug 17, 2019
by
Jakob Bornecrantz
Browse files
aux/util: Disable use of conversion table for YUV to RGB for now
parent
042d30c5
Pipeline
#56968
passed with stages
in 1 minute and 36 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/xrt/auxiliary/util/u_sink.c
View file @
a0fcaf9b
...
...
@@ -73,7 +73,9 @@ YUV444_to_RGBX8888(int y, int u, int v)
return
B
<<
16
|
G
<<
8
|
R
;
}
static
uint32_t
lookup_YUV_to_RGBX
[
256
][
256
][
256
]
=
{{
0
}};
#undef USE_TABLE
#ifdef USE_TABLE
static
uint32_t
lookup_YUV_to_RGBX
[
256
][
256
][
256
]
=
{
0
};
static
void
generate_lookup_YUV_to_RGBX
()
...
...
@@ -95,6 +97,7 @@ generate_lookup_YUV_to_RGBX()
}
}
}
#endif
inline
static
void
YUV422_to_R8G8B8X8
(
const
uint8_t
*
input
,
uint32_t
*
rgb1
,
uint32_t
*
rgb2
)
...
...
@@ -104,8 +107,13 @@ YUV422_to_R8G8B8X8(const uint8_t *input, uint32_t *rgb1, uint32_t *rgb2)
uint8_t
y1
=
input
[
2
];
uint8_t
v
=
input
[
3
];
#ifdef USE_TABLE
*
rgb1
=
lookup_YUV_to_RGBX
[
y0
][
u
][
v
];
*
rgb2
=
lookup_YUV_to_RGBX
[
y1
][
u
][
v
];
#else
*
rgb1
=
YUV444_to_RGBX8888
(
y0
,
u
,
v
);
*
rgb2
=
YUV444_to_RGBX8888
(
y1
,
u
,
v
);
#endif
}
inline
static
void
...
...
@@ -116,8 +124,15 @@ YUV422_to_R8G8B8(const uint8_t *input, uint8_t *dst)
uint8_t
y1
=
input
[
2
];
uint8_t
v
=
input
[
3
];
#ifdef USE_TABLE
uint8_t
*
rgb1
=
(
uint8_t
*
)
&
lookup_YUV_to_RGBX
[
y0
][
u
][
v
];
uint8_t
*
rgb2
=
(
uint8_t
*
)
&
lookup_YUV_to_RGBX
[
y1
][
u
][
v
];
#else
uint32_t
rgb1v
=
YUV444_to_RGBX8888
(
y0
,
u
,
v
);
uint32_t
rgb2v
=
YUV444_to_RGBX8888
(
y1
,
u
,
v
);
uint8_t
*
rgb1
=
(
uint8_t
*
)
&
rgb1v
;
uint8_t
*
rgb2
=
(
uint8_t
*
)
&
rgb2v
;
#endif
dst
[
0
]
=
rgb1
[
0
];
dst
[
1
]
=
rgb1
[
1
];
...
...
@@ -269,7 +284,9 @@ u_sink_create_format_converter(enum xrt_format f,
return
;
}
#ifdef USE_TABLE
generate_lookup_YUV_to_RGBX
();
#endif
struct
u_sink_converter
*
s
=
U_TYPED_CALLOC
(
struct
u_sink_converter
);
s
->
base
.
push_frame
=
push_frame
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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