diff --git a/libcelt/rate.c b/libcelt/rate.c index 1a90034a..fe0bad43 100644 --- a/libcelt/rate.c +++ b/libcelt/rate.c @@ -1,4 +1,4 @@ -/* (C) 2007 Jean-Marc Valin, CSIRO +/* (C) 2007-2008 Jean-Marc Valin, CSIRO */ /* Redistribution and use in source and binary forms, with or without @@ -165,6 +165,7 @@ static int bits2pulses(const CELTMode *m, int band, int bits) for (i=0;i>1; + /* OPT: Make sure this is implemented with a conditional move */ if (m->bits[band][mid] >= bits) hi = mid; else diff --git a/libcelt/rate.h b/libcelt/rate.h index 968b8fdc..0d693684 100644 --- a/libcelt/rate.h +++ b/libcelt/rate.h @@ -1,4 +1,4 @@ -/* (C) 2007 Jean-Marc Valin, CSIRO +/* (C) 2007-2008 Jean-Marc Valin, CSIRO */ /* Redistribution and use in source and binary forms, with or without diff --git a/libcelt/vq.c b/libcelt/vq.c index cdba91e5..3eb33903 100644 --- a/libcelt/vq.c +++ b/libcelt/vq.c @@ -157,8 +157,9 @@ void alg_quant(celt_norm_t *X, celt_mask_t *W, int N, int K, const celt_norm_t * /* Choose between fast and accurate strategy depending on where we are in the search */ if (pulsesLeft>1) { - for (j=0;j= best_num/best_den, but that way we can do it without any division */ + /* OPT: Make sure to use a conditional move here */ if (MULT16_32_Q15(best_den, num) > MULT16_32_Q15(den, best_num)) { best_den = den; best_num = num; best_id = j; } - } + } while (++j MULT16_32_Q15(den, best_num)) { best_num = num;