diff options
author | dcommander <dcommander@632fc199-4ca6-4c93-a231-07263d6284db> | 2015-01-14 08:31:54 +0000 |
---|---|---|
committer | dcommander <dcommander@632fc199-4ca6-4c93-a231-07263d6284db> | 2015-01-14 08:31:54 +0000 |
commit | febb1d628414fa712851fb63ea22ddcc7948b1d7 (patch) | |
tree | 7511248b0cf5db038d418f538c792501c30ef52d | |
parent | 4d033869d986a738b64bdeb0da69d4355042c1a8 (diff) |
Fix a bug in the AltiVec downsampling routines uncovered during additional testing with small image sizes. Since the output width is half the input width, the downsampler should only read a second 16-byte chunk if there are more than 8 output columns left.
git-svn-id: svn://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1499 632fc199-4ca6-4c93-a231-07263d6284db
-rw-r--r-- | simd/jcsample-altivec.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/simd/jcsample-altivec.c b/simd/jcsample-altivec.c index 58ae449..517e2be 100644 --- a/simd/jcsample-altivec.c +++ b/simd/jcsample-altivec.c @@ -64,7 +64,7 @@ jsimd_h2v1_downsample_altivec (JDIMENSION image_width, int max_v_samp_factor, outl = vec_add(outl, pw_bias); outl = vec_sr(outl, pw_one); - if (outcol > 16) { + if (outcol > 8) { next0 = vec_ld(16, inptr); next0 = vec_perm(next0, next0, even_odd_index); next0e = (__vector unsigned short)vec_mergeh(pb_zero, next0); @@ -132,7 +132,7 @@ jsimd_h2v2_downsample_altivec (JDIMENSION image_width, int max_v_samp_factor, outl = vec_add(outl, pw_bias); outl = vec_sr(outl, pw_two); - if (outcol > 16) { + if (outcol > 8) { next0 = vec_ld(16, inptr0); next0 = vec_perm(next0, next0, even_odd_index); next0e = (__vector unsigned short)vec_mergeh(pb_zero, next0); |