videoscale: Implement linear merging of Y16 scanlines with orc

This commit is contained in:
Sebastian Dröge 2010-06-12 12:57:14 +02:00
parent 7ab53a8b0a
commit 944cfa5871
2 changed files with 18 additions and 7 deletions

View file

@ -15,4 +15,18 @@ addw t1, t1, 128
shruw t1, t1, 8
convwb d1, t1
.function orc_merge_linear_u16
.dest 2 d1
.source 2 s1
.source 2 s2
.param 2 p1
.param 2 p2
.temp 4 t1
.temp 4 t2
muluwl t1, s1, p1
muluwl t2, s2, p2
addl t1, t1, t2
shrul t1, t1, 16
convlw d1, t1

View file

@ -127,7 +127,6 @@ vs_scanline_resample_nearest_Y16 (uint8_t * dest, uint8_t * src, int src_width,
*accumulator = acc;
}
#include <glib.h>
void
vs_scanline_resample_linear_Y16 (uint8_t * dest, uint8_t * src, int src_width,
int n, int *accumulator, int increment)
@ -157,13 +156,11 @@ void
vs_scanline_merge_linear_Y16 (uint8_t * dest, uint8_t * src1, uint8_t * src2,
int n, int x)
{
int i;
uint16_t *d = (uint16_t *) dest, *s1 = (uint16_t *) src1, *s2 =
(uint16_t *) src2;
uint16_t *d = (uint16_t *) dest;
const uint16_t *s1 = (const uint16_t *) src1;
const uint16_t *s2 = (const uint16_t *) src2;
for (i = 0; i < n; i++) {
d[i] = (s1[i] * (65536 - x) + s2[i] * x) >> 16;
}
orc_merge_linear_u16 (d, s1, s2, 65536 - x, x, n);
}
/* RGBA */