changeset 11897:697ab0e6d756 libavcodec

psdec: Replace a division with a shift.
author alexc
date Sun, 20 Jun 2010 22:03:00 +0000
parents 47b770054db4
children 771f6e96ea43
files ps.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ps.c	Sun Jun 20 21:53:51 2010 +0000
+++ b/ps.c	Sun Jun 20 22:03:00 2010 +0000
@@ -20,6 +20,7 @@
  */
 
 #include <stdint.h>
+#include "libavutil/common.h"
 #include "libavutil/mathematics.h"
 #include "avcodec.h"
 #include "get_bits.h"
@@ -191,7 +192,7 @@
             ps->border_position[e] = get_bits(gb, 5);
     } else
         for (e = 1; e <= ps->num_env; e++)
-            ps->border_position[e] = e * numQMFSlots / ps->num_env - 1;
+            ps->border_position[e] = (e * numQMFSlots >> ff_log2_tab[ps->num_env]) - 1;
 
     if (ps->enable_iid) {
         for (e = 0; e < ps->num_env; e++) {