diff options
author | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2016-08-07 19:11:02 +0300 |
---|---|---|
committer | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2016-08-07 19:11:02 +0300 |
commit | 0c88112e10fc978e570abb42732b257907bd332e (patch) | |
tree | 5f95326277182e0c9985658adfb89da80530c572 | |
parent | 2c639686ea72e07866ac85c5d2f845cf1222f1e8 (diff) |
remove loop, still sucks
-rw-r--r-- | celt/vq.c | 20 |
1 files changed, 13 insertions, 7 deletions
@@ -195,19 +195,25 @@ static int compute_search_vec(const float *X, const float *y, int N, float xy, f #endif } { - int i; float tmp[8]; _mm_storeu_ps(&tmp[0], max); _mm_storeu_ps(&tmp[4], pos); maxval = tmp[0]; maxpos = 4*tmp[4]; - for (i=1;i<4;i++) + if (tmp[1] > maxval) { - if (tmp[i] > maxval) - { - maxval = tmp[i]; - maxpos = 4*tmp[i+4] + i; - } + maxval = tmp[1]; + maxpos = 4*tmp[5]+1; + } + if (tmp[2] > maxval) + { + maxval = tmp[2]; + maxpos = 4*tmp[6]+2; + } + if (tmp[3] > maxval) + { + maxval = tmp[3]; + maxpos = 4*tmp[7]+3; } //printf("n = %d\n", N); //for (i=0;i<8;i++) printf("%f ", tmp[i]); |