[ Date Prev][ Date Next][ Thread Prev][ Thread Next][ Date Index][ Thread Index]
Re: [vsipl++] [patch] Fix for generic pwarp
- To: Jules Bergmann <jules@xxxxxxxxxxxxxxxx>
- Subject: Re: [vsipl++] [patch] Fix for generic pwarp
- From: Stefan Seefeld <stefan@xxxxxxxxxxxxxxxx>
- Date: Thu, 10 Jan 2008 00:50:24 -0500
Stefan Seefeld wrote:
> May
> be someone beats me to it <wink/>.
As usual, just when you hit the <send> button...:
It appears that code interpolates pixels, but the clipping isn't quite
correct. The attached patch fixes that, for the pwarp_gen.hpp as well as
the ref_pwarp.hpp functions. With that patch, the Windows pwarp test, as
well as the Linux one with ElectricFence, pass.
Regards,
Stefan
--
Stefan Seefeld
CodeSourcery
stefan@xxxxxxxxxxxxxxxx
(650) 331-3385 x718
Index: src/vsip_csl/ref_pwarp.hpp
===================================================================
--- src/vsip_csl/ref_pwarp.hpp (revision 191110)
+++ src/vsip_csl/ref_pwarp.hpp (working copy)
@@ -94,7 +94,7 @@
CoeffT u = (u_base + c*u_delta) / w;
CoeffT v = (v_base + c*v_delta) / w;
- if (u >= 0 && u <= u_clip && v >= 0 && v <= v_clip)
+ if (u >= 0 && u < u_clip && v >= 0 && v < v_clip)
{
index_type u0 = static_cast<index_type>(u);
index_type v0 = static_cast<index_type>(v);
Index: src/vsip_csl/img/impl/pwarp_gen.hpp
===================================================================
--- src/vsip_csl/img/impl/pwarp_gen.hpp (revision 191110)
+++ src/vsip_csl/img/impl/pwarp_gen.hpp (working copy)
@@ -221,7 +221,7 @@
CoeffT u = (u_base + c*u_delta) / w;
CoeffT v = (v_base + c*v_delta) / w;
- if (u >= 0 && u <= u_clip && v >= 0 && v <= v_clip)
+ if (u >= 0 && u < u_clip && v >= 0 && v < v_clip)
{
index_type u0 = static_cast<index_type>(u);
index_type v0 = static_cast<index_type>(v);
|