Xorg: align memory in Xv
This commit is contained in:
parent
1956bc88e1
commit
f14caed95b
@ -78,6 +78,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#define RDPMAX(_val1, _val2) ((_val1) < (_val2) ? (_val2) : (_val1))
|
||||
#define RDPCLAMP(_val, _lo, _hi) \
|
||||
(_val) < (_lo) ? (_lo) : (_val) > (_hi) ? (_hi) : (_val)
|
||||
#define RDPALIGN(_val, _al) ((((long)(_val)) + ((_al) - 1)) & ~((_al) - 1))
|
||||
|
||||
#define XRDP_CD_NODRAW 0
|
||||
#define XRDP_CD_NOCLIP 1
|
||||
|
@ -440,6 +440,7 @@ xrdpVidPutImage(ScrnInfoPtr pScrn,
|
||||
int jndex;
|
||||
int num_clips;
|
||||
int error;
|
||||
void *mem;
|
||||
RegionRec dreg;
|
||||
BoxRec box;
|
||||
|
||||
@ -447,15 +448,16 @@ xrdpVidPutImage(ScrnInfoPtr pScrn,
|
||||
LLOGLN(10, ("xrdpVidPutImage: src_x %d srcy_y %d", src_x, src_y));
|
||||
dev = XRDPPTR(pScrn);
|
||||
|
||||
index = width * height * 4 + drw_w * drw_h * 4;
|
||||
rgborg32 = (int *) g_malloc(index, 0);
|
||||
if (rgborg32 == NULL)
|
||||
index = width * height * 4 + drw_w * drw_h * 4 + 64;
|
||||
mem = g_malloc(index, 0);
|
||||
if (mem == NULL)
|
||||
{
|
||||
LLOGLN(0, ("xrdpVidPutImage: memory alloc error"));
|
||||
return Success;
|
||||
}
|
||||
rgborg32 = (int *) RDPALIGN(mem, 16);
|
||||
rgbend32 = rgborg32 + width * height;
|
||||
|
||||
rgbend32 = (int *) RDPALIGN(rgbend32, 16);
|
||||
error = 0;
|
||||
switch (format)
|
||||
{
|
||||
@ -469,20 +471,20 @@ xrdpVidPutImage(ScrnInfoPtr pScrn,
|
||||
break;
|
||||
case FOURCC_YUY2:
|
||||
LLOGLN(10, ("xrdpVidPutImage: FOURCC_YUY2"));
|
||||
error = YUY2_to_RGB32(buf, width, height, rgborg32);
|
||||
error = dev->yuy2_to_rgb32(buf, width, height, rgborg32);
|
||||
break;
|
||||
case FOURCC_UYVY:
|
||||
LLOGLN(10, ("xrdpVidPutImage: FOURCC_UYVY"));
|
||||
error = UYVY_to_RGB32(buf, width, height, rgborg32);
|
||||
error = dev->uyvy_to_rgb32(buf, width, height, rgborg32);
|
||||
break;
|
||||
default:
|
||||
LLOGLN(0, ("xrdpVidPutImage: unknown format 0x%8.8x", format));
|
||||
g_free(rgborg32);
|
||||
g_free(mem);
|
||||
return Success;
|
||||
}
|
||||
if (error != 0)
|
||||
{
|
||||
g_free(rgborg32);
|
||||
g_free(mem);
|
||||
return Success;
|
||||
}
|
||||
error = stretch_RGB32_RGB32(rgborg32, width, height,
|
||||
@ -490,7 +492,7 @@ xrdpVidPutImage(ScrnInfoPtr pScrn,
|
||||
rgbend32, drw_w, drw_h);
|
||||
if (error != 0)
|
||||
{
|
||||
g_free(rgborg32);
|
||||
g_free(mem);
|
||||
return Success;
|
||||
}
|
||||
|
||||
@ -529,7 +531,7 @@ xrdpVidPutImage(ScrnInfoPtr pScrn,
|
||||
rdpClientConAddAllReg(dev, &dreg, dst);
|
||||
rdpRegionUninit(&dreg);
|
||||
|
||||
g_free(rgborg32);
|
||||
g_free(mem);
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
@ -1,4 +1,25 @@
|
||||
|
||||
;
|
||||
;Copyright 2014 Jay Sorg
|
||||
;
|
||||
;Permission to use, copy, modify, distribute, and sell this software and its
|
||||
;documentation for any purpose is hereby granted without fee, provided that
|
||||
;the above copyright notice appear in all copies and that both that
|
||||
;copyright notice and this permission notice appear in supporting
|
||||
;documentation.
|
||||
;
|
||||
;The above copyright notice and this permission notice shall be included in
|
||||
;all copies or substantial portions of the Software.
|
||||
;
|
||||
;THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
;IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
;FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
;OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
;AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
;CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
;
|
||||
;YV12 to RGB32
|
||||
;x86 SSE2 32 bit
|
||||
;
|
||||
; RGB to YUV
|
||||
; 0.299 0.587 0.114
|
||||
; -0.14713 -0.28886 0.436
|
||||
@ -87,10 +108,10 @@ do8:
|
||||
|
||||
movdqa xmm4, xmm3
|
||||
punpcklwd xmm3, xmm5 ; argb
|
||||
movdqu [edi], xmm3
|
||||
movdqa [edi], xmm3
|
||||
add edi, 16
|
||||
punpckhwd xmm4, xmm5 ; argb
|
||||
movdqu [edi], xmm4
|
||||
movdqa [edi], xmm4
|
||||
add edi, 16
|
||||
|
||||
ret;
|
||||
|
Loading…
Reference in New Issue
Block a user