#include "gstvideoscaleorc.h"
+#include <string.h>
+
/* greyscale, i.e., single componenet */
void
{
uint32_t value = x >> 8;
- orc_merge_linear_u8 (dest, src1, src2, 256 - value, value, n);
+ if (value == 0) {
+ memcpy (dest, src1, n);
+ } else {
+ orc_merge_linear_u8 (dest, src1, src2, 256 - value, value, n);
+ }
}
void
const uint16_t *s1 = (const uint16_t *) src1;
const uint16_t *s2 = (const uint16_t *) src2;
- orc_merge_linear_u16 (d, s1, s2, 65536 - x, x, n);
+ if (x == 0) {
+ memcpy (d, s1, n * 2);
+ } else {
+ orc_merge_linear_u16 (d, s1, s2, 65536 - x, x, n);
+ }
}
/* RGBA */
{
uint32_t value = x >> 8;
- orc_merge_linear_u8 (dest, src1, src2, 256 - value, value, n * 4);
+ if (value == 0) {
+ memcpy (dest, src1, n * 4);
+ } else {
+ orc_merge_linear_u8 (dest, src1, src2, 256 - value, value, n * 4);
+ }
}
{
uint32_t value = x >> 8;
- orc_merge_linear_u8 (dest, src1, src2, 256 - value, value, n * 3);
+ if (value == 0) {
+ memcpy (dest, src1, n * 3);
+ } else {
+ orc_merge_linear_u8 (dest, src1, src2, 256 - value, value, n * 3);
+ }
}
int quads = (n + 1) / 2;
uint32_t value = x >> 8;
- orc_merge_linear_u8 (dest, src1, src2, 256 - value, value, quads * 4);
+ if (value == 0) {
+ memcpy (dest, src1, quads * 4);
+ } else {
+ orc_merge_linear_u8 (dest, src1, src2, 256 - value, value, quads * 4);
+ }
}
int quads = (n + 1) / 2;
uint32_t value = x >> 8;
- orc_merge_linear_u8 (dest, src1, src2, 256 - value, value, quads * 4);
+ if (value == 4) {
+ memcpy (dest, src1, quads * 4);
+ } else {
+ orc_merge_linear_u8 (dest, src1, src2, 256 - value, value, quads * 4);
+ }
}