summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorM Joonas Pihlaja <jpihlaja@cc.helsinki.fi>2009-01-13 11:31:21 +0200
committerM Joonas Pihlaja <jpihlaja@cc.helsinki.fi>2009-01-13 11:31:21 +0200
commit32ca093f19006b9beb0259237a1a4e1869f15807 (patch)
tree56cec3bf8c1f08a9718eb0b05db8404e6f0a1d17
parentbca43fc5c350dece7cac8a12a237e5bf37a666ed (diff)
[sse2-test] Identify runs of zero in the input in the single pixel cases.
-rw-r--r--unpremultiply-sse2-test.S9
1 files changed, 6 insertions, 3 deletions
diff --git a/unpremultiply-sse2-test.S b/unpremultiply-sse2-test.S
index 4d45f7a..1fce594 100644
--- a/unpremultiply-sse2-test.S
+++ b/unpremultiply-sse2-test.S
@@ -75,9 +75,10 @@ unpremultiply_single_pixels:
; Extract alpha and look up the reciprocal.
mov ebx, eax
mov ebp, eax ; Initialise result pixel register.
+ and ebp, 0xFF000000 ; Mask off non-alpha from result pix.
+ jz .prolog
shr ebx, 24 ; Load alpha.
mov ebx, DWORD [reciprocal_table_D + 4*ebx] ; Load reciprocal.
- and ebp, 0xFF000000 ; Mask off non-alpha from result pix.
; Do the component from bits 0..7.
mov edx, eax
@@ -106,8 +107,9 @@ unpremultiply_single_pixels:
; Extract alpha and loop up the reciprocal.
mov ebx, eax
shr eax, 8 ; Shift out alpha.
- and ebx, 255 ; Mask off non-alpha.
- mov ebp, ebx ; Initialise result pixel.
+ and ebp, 255 ; Mask off non-alpha.
+ mov ebx, ebp ; Initialise result pixel.
+ jz .prolog
mov ebx, DWORD [reciprocal_table_D + 4*ebx] ; Load reciprocal.
; Do the component from bits 8..15.
@@ -133,6 +135,7 @@ unpremultiply_single_pixels:
shl eax, 8
or ebp, eax
%endif
+.prolog:
; Write the result pixel.
mov [rdi + rcx*4], ebp