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

gitlab.com/quite/celt.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libcelt/cwrs.c16
-rw-r--r--libcelt/vq.c2
2 files changed, 9 insertions, 9 deletions
diff --git a/libcelt/cwrs.c b/libcelt/cwrs.c
index 5184794..67aa47c 100644
--- a/libcelt/cwrs.c
+++ b/libcelt/cwrs.c
@@ -181,9 +181,9 @@ void cwrsi(int _n,int _m,celt_uint32_t _i,int * restrict _x,int * restrict _s){
_x[k]=j;
if(_s[k])_i-=t;
if (k<_m-2)
- prev_ncwrs32(nc, _n+1, 0);
+ prev_ncwrs32(nc, _n-j+1, 0);
else
- prev_ncwrs32(nc, _n+1, 1);
+ prev_ncwrs32(nc, _n-j+1, 1);
}
RESTORE_STACK;
}
@@ -210,9 +210,9 @@ celt_uint32_t icwrs(int _n,int _m,const int *_x,const int *_s, celt_uint32_t *bo
celt_uint32_t pn;
celt_uint32_t p;
if (k<_m-1)
- prev_ncwrs32(nc, _n+1, 0);
+ prev_ncwrs32(nc, _n-j+1, 0);
else
- prev_ncwrs32(nc, _n+1, 1);
+ prev_ncwrs32(nc, _n-j+1, 1);
/*p=ncwrs(_n-j,_m-k-1);
pn=ncwrs(_n-j-1,_m-k-1);*/
p=nc[_n-j];
@@ -271,9 +271,9 @@ void cwrsi64(int _n,int _m,celt_uint64_t _i,int * restrict _x,int * restrict _s)
_x[k]=j;
if(_s[k])_i-=t;
if (k<_m-2)
- prev_ncwrs64(nc, _n+1, 0);
+ prev_ncwrs64(nc, _n-j+1, 0);
else
- prev_ncwrs64(nc, _n+1, 1);
+ prev_ncwrs64(nc, _n-j+1, 1);
}
RESTORE_STACK;
}
@@ -300,9 +300,9 @@ celt_uint64_t icwrs64(int _n,int _m,const int *_x,const int *_s, celt_uint64_t *
celt_uint64_t pn;
celt_uint64_t p;
if (k<_m-1)
- prev_ncwrs64(nc, _n+1, 0);
+ prev_ncwrs64(nc, _n-j+1, 0);
else
- prev_ncwrs64(nc, _n+1, 1);
+ prev_ncwrs64(nc, _n-j+1, 1);
/*p=ncwrs64(_n-j,_m-k-1);
pn=ncwrs64(_n-j-1,_m-k-1);*/
p=nc[_n-j];
diff --git a/libcelt/vq.c b/libcelt/vq.c
index ddf7fa5..d6aca90 100644
--- a/libcelt/vq.c
+++ b/libcelt/vq.c
@@ -179,7 +179,7 @@ void alg_quant(celt_norm_t *X, celt_mask_t *W, int N, int K, const celt_norm_t *
den = ROUND16(Ryy,14);
/* The idea is to check for num/den >= best_num/best_den, but that way
we can do it without any division */
- if (MULT16_32_Q15(best_den, num) >= MULT16_32_Q15(den, best_num))
+ if (MULT16_32_Q15(best_den, num) > MULT16_32_Q15(den, best_num))
{
best_den = den;
best_num = num;