143{
146
148
150
152 uint32_t rgba[2] = {0, 0};
153 uint32_t uyvy = 0;
154 memcpy(&rgba[0], s->
color, 4);
155 memcpy(&rgba[1], s->
color, 4);
158
159 for (
unsigned int i = 0; i < s->
height; ++i) {
160 char *line1 = out->
tiles[0].
data + i * req_pitch;
162 for (
unsigned int x = 0; x < out->
tiles[0].
width; x += 2) {
163 memcpy(line1 + x * 2, &uyvy, 4);
164 memcpy(line2 + x * 2, &uyvy, 4);
165 }
166 }
167
168 for (
unsigned int i = 0; i < s->
width; ++i) {
169 if (i % 2 == 0) {
170 for (
unsigned int y = 0; y < out->
tiles[0].
height; y += 1) {
171 char *line = out->
tiles[0].
data + y * req_pitch;
172 char *line_end = out->
tiles[0].
data + y * req_pitch +
174 memcpy(line + i / 2 * 4, &uyvy, 4);
175 memcpy(line_end - i / 2 * 4, &uyvy, 4);
176 }
177 }
178 }
181 for (
unsigned int i = 0; i < s->
height; ++i) {
182 char *line1 = out->
tiles[0].
data + i * req_pitch;
184 for (
unsigned int x = 0; x < out->
tiles[0].
width; x += 1) {
185 memcpy(line1 + x * bpp, s->
color, bpp);
186 memcpy(line2 + x * bpp, s->
color, bpp);
187 }
188 }
189
190
191 for (
unsigned int i = 0; i < s->
width; ++i) {
192 for (
unsigned int y = 0; y < out->
tiles[0].
height; y += 1) {
193 char *line = out->
tiles[0].
data + y * req_pitch;
194 char *line_end = out->
tiles[0].
data + y * req_pitch +
196 memcpy(line + i * bpp, s->
color, bpp);
197 memcpy(line_end - i * bpp, s->
color, bpp);
198 }
199 }
200 } else {
202 return false;
203 }
204
205 return true;
206}
int vc_get_linesize(unsigned int width, codec_t codec)
#define LOG_LEVEL_WARNING
less severe errors
static void vc_copylineRGBAtoUYVY(unsigned char *__restrict dst, const unsigned char *__restrict src, int dst_len, int rshift, int gshift, int bshift)
Converts RGBA to UYVY.
decoder_t get_decoder_from_to(codec_t in, codec_t out)
decoder_func_t * decoder_t
char * data
Raw tile data. Pointer must be at least 4B aligned.
unsigned int data_len
length of the data
struct tile tiles[FLEXIBLE_ARRAY_MEMBER]
@ RGB
RGB 8-bit (packed into 24-bit word)
@ UYVY
YCbCr 422 8-bit - Cb Y0 Cr Y1.
@ RGBA
RGBA 8-bit, big-endian.
double get_bpp(codec_t codec)