diff options
author | Alex VillacĂs Lasso <a_villacis@palosanto.com> | 2008-01-30 21:45:19 -0500 |
---|---|---|
committer | Alex Deucher <alex@botch2.(none)> | 2008-01-30 21:45:19 -0500 |
commit | ee5b54a66495e51fb2a27b4ecb5875dae776b3c9 (patch) | |
tree | fa8e3c2654a5840208e8ac3f5b1394a9ccaa12f7 /src/savage_video.c | |
parent | 1169cb5bd96f7a4ac0deea6d085133d446ec0d6a (diff) |
[PATCH] BCI can only handle widths that are multiple of 16, so only use BCI for these (for now).
Small optimizations (use memcpy instead of copy loop).
Diffstat (limited to 'src/savage_video.c')
-rw-r--r-- | src/savage_video.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/savage_video.c b/src/savage_video.c index 45b082b..cb944a4 100644 --- a/src/savage_video.c +++ b/src/savage_video.c @@ -1189,21 +1189,15 @@ SavageCopyPlanarDataBCI( BCI_GET_PTR; /* copy Y planar */ - for (i=0;i<srcPitch * h;i++) { - dstCopy[i] = srcY[i]; - } + memcpy(dstCopy, srcY, srcPitch * h); /* copy V planar */ dstCopy = dstCopy + srcPitch * h; - for (i=0;i<srcPitch2 * (h>>1);i++) { - dstCopy[i] = srcV[i]; - } + memcpy(dstCopy, srcV, srcPitch2 * (h>>1)); /* copy U planar */ dstCopy = dstCopy + srcPitch2 * (h>>1); - for (i=0;i<srcPitch2 * (h>>1);i++) { - dstCopy[i] = srcU[i]; - } + memcpy(dstCopy, srcU, srcPitch2 * (h>>1)); /* * Transfer pixel data from one memory location to another location @@ -1253,6 +1247,9 @@ SavageCopyData( int w ){ w <<= 1; + if (w == srcPitch && w == dstPitch) { + memcpy(dst, src, w * h); + } else while(h--) { memcpy(dst, src, w); src += srcPitch; @@ -1937,7 +1934,7 @@ SavagePutImage( offsetU += tmp; offsetV += tmp; nlines = ((((y2 + 0xffff) >> 16) + 1) & ~1) - top; - if (S3_SAVAGE4_SERIES(psav->Chipset) && psav->BCIforXv) { + if (S3_SAVAGE4_SERIES(psav->Chipset) && psav->BCIforXv && (npixels & 0xF) == 0) { SavageCopyPlanarDataBCI( pScrn, buf + (top * srcPitch) + (left >> 1), |