summaryrefslogtreecommitdiffstats
path: root/xorg/server
diff options
context:
space:
mode:
authorJay Sorg <jay.sorg@gmail.com>2014-10-04 17:17:45 -0700
committerJay Sorg <jay.sorg@gmail.com>2014-10-04 17:17:45 -0700
commit62481510f730ce8a66a08a5fba7f402cce8d0a95 (patch)
treef164cc310fc7598de6cd46654b309c554fafbf80 /xorg/server
parent39e51cad8c9d4f4314a7a4d6b618117ad5551492 (diff)
downloadxrdp-proprietary-62481510f730ce8a66a08a5fba7f402cce8d0a95.tar.gz
xrdp-proprietary-62481510f730ce8a66a08a5fba7f402cce8d0a95.zip
Xorg: Xv, minor optimize for strech
Diffstat (limited to 'xorg/server')
-rw-r--r--xorg/server/module/rdpXv.c43
1 files changed, 31 insertions, 12 deletions
diff --git a/xorg/server/module/rdpXv.c b/xorg/server/module/rdpXv.c
index da2b7bb8..0885adae 100644
--- a/xorg/server/module/rdpXv.c
+++ b/xorg/server/module/rdpXv.c
@@ -385,32 +385,51 @@ stretch_RGB32_RGB32(int *src, int src_width, int src_height,
{
int index;
int jndex;
- int kndex;
int lndex;
- int oh = (src_w << 16) / dst_w;
+ int last_lndex;
+ int oh;
int ih;
- int ov = (src_h << 16) / dst_h;
+ int ov;
int iv;
int pix;
+ int *src32;
+ int *dst32;
LLOGLN(10, ("stretch_RGB32_RGB32: oh 0x%8.8x ov 0x%8.8x", oh, ov));
+ oh = (src_w << 16) / dst_w;
+ ov = (src_h << 16) / dst_h;
iv = ov;
lndex = src_y;
+ last_lndex = -1;
for (index = 0; index < dst_h; index++)
{
- ih = oh;
- kndex = src_x;
- for (jndex = 0; jndex < dst_w; jndex++)
+ if (lndex == last_lndex)
{
- pix = src[lndex * src_width + kndex];
- dst[index * dst_w + jndex] = pix;
- while (ih > (1 << 16) - 1)
+ /* repeat line */
+ dst32 = dst + index * dst_w;
+ src32 = dst32 - dst_w;
+ g_memcpy(dst32, src32, dst_w * 4);
+ }
+ else
+ {
+ ih = oh;
+ src32 = src + lndex * src_width + src_x;
+ pix = *src32;
+ dst32 = dst + index * dst_w;
+ for (jndex = 0; jndex < dst_w; jndex++)
{
- ih -= 1 << 16;
- kndex++;
+ *dst32 = pix;
+ while (ih > (1 << 16) - 1)
+ {
+ ih -= 1 << 16;
+ src32++;
+ pix = *src32;
+ }
+ ih += oh;
+ dst32++;
}
- ih += oh;
}
+ last_lndex = lndex;
while (iv > (1 << 16) - 1)
{
iv -= 1 << 16;