Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2013-01-04 21:28:58 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2013-01-04 21:28:58 +0400
commit499088366421d2a240721267f46bf5ca335e1ed4 (patch)
tree2e7cf13ee61578a87c0b23b62de2ac8431839828 /source/blender/blenlib/BLI_math_color.h
parent419016928216707f95fa7b94d233b0bb8707ff3c (diff)
Optimization for speed regression in mipmap generation
Regression was caused by alpha premul cleanup commit and the reason of slowdown was uchar <-> float conversion which is slow. Replaced with uchar <-> int conversion which seeps to be accurate enough and mostly eliminates slowdown. Slowdown was easy to notice when movie clip is used for 3d vierport background and undistortion is enabled. In this case every frame will re-calculate mipmaps. It's still a nit slower than mipmap generation before cleanup commit, but couldn't think about extra boost here atm.
Diffstat (limited to 'source/blender/blenlib/BLI_math_color.h')
-rw-r--r--source/blender/blenlib/BLI_math_color.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_math_color.h b/source/blender/blenlib/BLI_math_color.h
index 3831ec3cbb4..1af6985deaa 100644
--- a/source/blender/blenlib/BLI_math_color.h
+++ b/source/blender/blenlib/BLI_math_color.h
@@ -106,6 +106,8 @@ MINLINE void premul_to_straight_v4(float straight[4], const float premul[4]);
MINLINE void straight_to_premul_v4(float straight[4], const float premul[4]);
MINLINE void straight_uchar_to_premul_float(float result[4], const unsigned char color[4]);
MINLINE void premul_float_to_straight_uchar(unsigned char *result, const float color[4]);
+MINLINE void straight_uchar_to_premul_int(int result[4], const unsigned char color[4]);
+MINLINE void premul_int_to_straight_uchar(unsigned char *result, const int color[4]);
/************************** Other *************************/