videoscale: Fix black horizontal line in image

This commit is contained in:
David Schleef 2010-06-14 15:19:32 -07:00
parent 4219a5ae5c
commit 7778ed7382

View file

@ -29,6 +29,8 @@
#include "gstvideoscaleorc.h" #include "gstvideoscaleorc.h"
#include <string.h>
/* greyscale, i.e., single componenet */ /* greyscale, i.e., single componenet */
void void
@ -92,8 +94,12 @@ vs_scanline_merge_linear_Y (uint8_t * dest, uint8_t * src1, uint8_t * src2,
{ {
uint32_t value = x >> 8; uint32_t value = x >> 8;
if (value == 0) {
memcpy (dest, src1, n);
} else {
orc_merge_linear_u8 (dest, src1, src2, 256 - value, value, n); orc_merge_linear_u8 (dest, src1, src2, 256 - value, value, n);
} }
}
void void
vs_scanline_downsample_Y16 (uint8_t * dest, uint8_t * src, int n) vs_scanline_downsample_Y16 (uint8_t * dest, uint8_t * src, int n)
@ -160,8 +166,12 @@ vs_scanline_merge_linear_Y16 (uint8_t * dest, uint8_t * src1, uint8_t * src2,
const uint16_t *s1 = (const uint16_t *) src1; const uint16_t *s1 = (const uint16_t *) src1;
const uint16_t *s2 = (const uint16_t *) src2; const uint16_t *s2 = (const uint16_t *) src2;
if (x == 0) {
memcpy (d, s1, n * 2);
} else {
orc_merge_linear_u16 (d, s1, s2, 65536 - x, x, n); orc_merge_linear_u16 (d, s1, s2, 65536 - x, x, n);
} }
}
/* RGBA */ /* RGBA */
@ -277,8 +287,12 @@ vs_scanline_merge_linear_RGBA (uint8_t * dest, uint8_t * src1, uint8_t * src2,
{ {
uint32_t value = x >> 8; uint32_t value = x >> 8;
if (value == 0) {
memcpy (dest, src1, n * 4);
} else {
orc_merge_linear_u8 (dest, src1, src2, 256 - value, value, n * 4); orc_merge_linear_u8 (dest, src1, src2, 256 - value, value, n * 4);
} }
}
/* RGB */ /* RGB */
@ -358,8 +372,12 @@ vs_scanline_merge_linear_RGB (uint8_t * dest, uint8_t * src1, uint8_t * src2,
{ {
uint32_t value = x >> 8; uint32_t value = x >> 8;
if (value == 0) {
memcpy (dest, src1, n * 3);
} else {
orc_merge_linear_u8 (dest, src1, src2, 256 - value, value, n * 3); orc_merge_linear_u8 (dest, src1, src2, 256 - value, value, n * 3);
} }
}
/* YUYV */ /* YUYV */
@ -483,8 +501,12 @@ vs_scanline_merge_linear_YUYV (uint8_t * dest, uint8_t * src1, uint8_t * src2,
int quads = (n + 1) / 2; int quads = (n + 1) / 2;
uint32_t value = x >> 8; uint32_t value = x >> 8;
if (value == 0) {
memcpy (dest, src1, quads * 4);
} else {
orc_merge_linear_u8 (dest, src1, src2, 256 - value, value, quads * 4); orc_merge_linear_u8 (dest, src1, src2, 256 - value, value, quads * 4);
} }
}
/* UYVY */ /* UYVY */
@ -608,8 +630,12 @@ vs_scanline_merge_linear_UYVY (uint8_t * dest, uint8_t * src1,
int quads = (n + 1) / 2; int quads = (n + 1) / 2;
uint32_t value = x >> 8; uint32_t value = x >> 8;
if (value == 4) {
memcpy (dest, src1, quads * 4);
} else {
orc_merge_linear_u8 (dest, src1, src2, 256 - value, value, quads * 4); orc_merge_linear_u8 (dest, src1, src2, 256 - value, value, quads * 4);
} }
}
/* RGB565 */ /* RGB565 */