diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-08-16 14:01:09 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-08-16 14:01:09 +0400 |
commit | a8353530be6c2e61243110fcf469f7b70834bdd9 (patch) | |
tree | a6ed401b2a71fd5399f2c6db2df738cfcad79ca7 /source/blender/compositor/operations/COM_MultilayerImageOperation.cpp | |
parent | 970c80e473fd390dff329acb7f3a08fc2edfd26d (diff) |
Make byte-float conversion threaded in compositor
In fact, there's no need to get float buffer at all,
conversion could be done in pixel processor level
after interpolation.
It might give slightly worse interpolation results
(which i'm not sure would be visible by eye) but
it gives more than 2x speedup on my laptop on node
setups used for warping image.
--
svn merge -r58988:58989 ^/branches/soc-2011-tomato
Diffstat (limited to 'source/blender/compositor/operations/COM_MultilayerImageOperation.cpp')
-rw-r--r-- | source/blender/compositor/operations/COM_MultilayerImageOperation.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/compositor/operations/COM_MultilayerImageOperation.cpp b/source/blender/compositor/operations/COM_MultilayerImageOperation.cpp index 1c9dd0f170e..1a2a1e77833 100644 --- a/source/blender/compositor/operations/COM_MultilayerImageOperation.cpp +++ b/source/blender/compositor/operations/COM_MultilayerImageOperation.cpp @@ -47,7 +47,7 @@ void MultilayerColorOperation::executePixel(float output[4], float x, float y, P { int yi = y; int xi = x; - if (this->m_imageBuffer == NULL || xi < 0 || yi < 0 || (unsigned int)xi >= this->getWidth() || (unsigned int)yi >= this->getHeight() ) { + if (this->m_imageFloatBuffer == NULL || xi < 0 || yi < 0 || (unsigned int)xi >= this->getWidth() || (unsigned int)yi >= this->getHeight() ) { zero_v4(output); } else { @@ -66,7 +66,7 @@ void MultilayerColorOperation::executePixel(float output[4], float x, float y, P } else { int offset = (yi * this->getWidth() + xi) * 3; - copy_v3_v3(output, &this->m_imageBuffer[offset]); + copy_v3_v3(output, &this->m_imageFloatBuffer[offset]); } } } @@ -75,11 +75,11 @@ void MultilayerValueOperation::executePixel(float output[4], float x, float y, P { int yi = y; int xi = x; - if (this->m_imageBuffer == NULL || xi < 0 || yi < 0 || (unsigned int)xi >= this->getWidth() || (unsigned int)yi >= this->getHeight() ) { + if (this->m_imageFloatBuffer == NULL || xi < 0 || yi < 0 || (unsigned int)xi >= this->getWidth() || (unsigned int)yi >= this->getHeight() ) { output[0] = 0.0f; } else { - float result = this->m_imageBuffer[yi * this->getWidth() + xi]; + float result = this->m_imageFloatBuffer[yi * this->getWidth() + xi]; output[0] = result; } } @@ -88,11 +88,11 @@ void MultilayerVectorOperation::executePixel(float output[4], float x, float y, { int yi = y; int xi = x; - if (this->m_imageBuffer == NULL || xi < 0 || yi < 0 || (unsigned int)xi >= this->getWidth() || (unsigned int)yi >= this->getHeight() ) { + if (this->m_imageFloatBuffer == NULL || xi < 0 || yi < 0 || (unsigned int)xi >= this->getWidth() || (unsigned int)yi >= this->getHeight() ) { output[0] = 0.0f; } else { int offset = (yi * this->getWidth() + xi) * 3; - copy_v3_v3(output, &this->m_imageBuffer[offset]); + copy_v3_v3(output, &this->m_imageFloatBuffer[offset]); } } |