Displaying 20 results from an estimated 95 matches for "ilog2".
Did you mean:
log2
2012 May 09
1
[PATCH 2/2] bitmath: Finish up optimizations
...), 106 deletions(-)
diff --git a/src/libFLAC/bitmath.c b/src/libFLAC/bitmath.c
index 189977c..4fdde4b 100644
--- a/src/libFLAC/bitmath.c
+++ b/src/libFLAC/bitmath.c
@@ -36,54 +36,6 @@
#include "private/bitmath.h"
#include "FLAC/assert.h"
-/* An example of what FLAC__bitmath_ilog2() computes:
- *
- * ilog2( 0) = assertion failure
- * ilog2( 1) = 0
- * ilog2( 2) = 1
- * ilog2( 3) = 1
- * ilog2( 4) = 2
- * ilog2( 5) = 2
- * ilog2( 6) = 2
- * ilog2( 7) = 2
- * ilog2( 8) = 3
- * ilog2( 9) = 3
- * ilog2(10) = 3
- * ilog2(11) = 3
- * ilog2(12) = 3
- * ilog2(13) = 3
- * ilog2(14) =...
2010 Nov 04
4
Fwd: Merging jorbis upstream and the cortado jorbis fork back into one
...rbis-0.0.17/com/jcraft/jorbis/Mapping0.java 2010-11-04 14:14:30.774014847 +0100
@@ -99,8 +99,8 @@ class Mapping0 extends FuncMapping{
opb.write(1, 1);
opb.write(info.coupling_steps-1, 8);
for(int i=0; i<info.coupling_steps; i++){
- opb.write(info.coupling_mag[i], Util.ilog2(vi.channels));
- opb.write(info.coupling_ang[i], Util.ilog2(vi.channels));
+ opb.write(info.coupling_mag[i], Util.ilog2roundup(vi.channels));
+ opb.write(info.coupling_ang[i], Util.ilog2roundup(vi.channels));
}
}
else{
@@ -136,8 +136,8 @@ class Mapping0 extends...
2017 Feb 15
1
[PATCH] average: change to declare precision, not factor
...long \
ewma_##name##_read(struct ewma_##name *e) \
{ \
- BUILD_BUG_ON(!__builtin_constant_p(_factor)); \
- BUILD_BUG_ON(!__builtin_constant_p(_weight)); \
- BUILD_BUG_ON_NOT_POWER_OF_2(_factor); \
- BUILD_BUG_ON_NOT_POWER_OF_2(_weight); \
- return e->internal >> ilog2(_factor); \
+ BUILD_BUG_ON(!__builtin_constant_p(_precision)); \
+ BUILD_BUG_ON(!__builtin_constant_p(_weight_rcp)); \
+ BUILD_BUG_ON((_precision) > 30); \
+ BUILD_BUG_ON_NOT_POWER_OF_2(_weight_rcp); \
+ return e->internal >> (_precision); \
} \
static inline void...
2017 Feb 15
1
[PATCH] average: change to declare precision, not factor
...long \
ewma_##name##_read(struct ewma_##name *e) \
{ \
- BUILD_BUG_ON(!__builtin_constant_p(_factor)); \
- BUILD_BUG_ON(!__builtin_constant_p(_weight)); \
- BUILD_BUG_ON_NOT_POWER_OF_2(_factor); \
- BUILD_BUG_ON_NOT_POWER_OF_2(_weight); \
- return e->internal >> ilog2(_factor); \
+ BUILD_BUG_ON(!__builtin_constant_p(_precision)); \
+ BUILD_BUG_ON(!__builtin_constant_p(_weight_rcp)); \
+ BUILD_BUG_ON((_precision) > 30); \
+ BUILD_BUG_ON_NOT_POWER_OF_2(_weight_rcp); \
+ return e->internal >> (_precision); \
} \
static inline void...
2017 Sep 11
1
[PATCH v15 1/5] lib/xbitmap: Introduce xbitmap
...ation supports up to ULONG_MAX bits, and it is
> + * implemented based on ida bitmaps. So, given an unsigned long index,
> + * the high order XB_INDEX_BITS bits of the index is used to find the
> + * corresponding item (i.e. ida bitmap) from the radix tree, and the low
> + * order (i.e. ilog2(IDA_BITMAP_BITS)) bits of the index are indexed into
> + * the ida bitmap to find the bit.
> + */
> +#define XB_INDEX_BITS (BITS_PER_LONG - ilog2(IDA_BITMAP_BITS))
> +#define XB_MAX_PATH (DIV_ROUND_UP(XB_INDEX_BITS, \
> + RADIX_TREE_MAP_SHIFT))
> +#define XB_PRELOAD_SI...
2017 Sep 11
1
[PATCH v15 1/5] lib/xbitmap: Introduce xbitmap
...ation supports up to ULONG_MAX bits, and it is
> + * implemented based on ida bitmaps. So, given an unsigned long index,
> + * the high order XB_INDEX_BITS bits of the index is used to find the
> + * corresponding item (i.e. ida bitmap) from the radix tree, and the low
> + * order (i.e. ilog2(IDA_BITMAP_BITS)) bits of the index are indexed into
> + * the ida bitmap to find the bit.
> + */
> +#define XB_INDEX_BITS (BITS_PER_LONG - ilog2(IDA_BITMAP_BITS))
> +#define XB_MAX_PATH (DIV_ROUND_UP(XB_INDEX_BITS, \
> + RADIX_TREE_MAP_SHIFT))
> +#define XB_PRELOAD_SI...
2013 Dec 10
2
[RFC][PATCH 3/3] timekeeping: Fix potential lost pv notification of time change
...struct timekeeper *tk = &shadow_timekeeper;
cycle_t offset;
int shift = 0, maxshift;
- unsigned int action;
+ unsigned int action = 0;
unsigned long flags;
raw_spin_lock_irqsave(&timekeeper_lock, flags);
@@ -1404,7 +1404,7 @@ static void update_wall_time(void)
maxshift = (64 - (ilog2(ntp_tick_length())+1)) - 1;
shift = min(shift, maxshift);
while (offset >= tk->cycle_interval) {
- offset = logarithmic_accumulation(tk, offset, shift);
+ offset = logarithmic_accumulation(tk, offset, shift, &action);
if (offset < tk->cycle_interval<<shift)
shift-...
2007 Sep 28
3
[LLVMdev] Crash on accessing deleted MBBs (new backend)
...little m68k backend things have been going
smoothly. I've been working with the x86 backend as a template, fixing
things as I go.
Now I've run into branches and I have a crash I don't really
understand. Here's the sample IR I'm running llc on to generate
assembly:
define i32 @ilog2(i32 %x) {
entry:
%tmp718 = icmp eq i32 %x, 0 ; <i1> [#uses=1]
br i1 %tmp718, label %bb9, label %bb5
bb5: ; preds = %bb5, %entry
%indvar = phi i32 [ 0, %entry ], [ %indvar.next, %bb5 ]
; <i32> [#uses=2]
%x_addr.015.0 = phi i32 [ %x...
2001 Sep 12
6
Yet another backtrace
...tle: We The People
Artist: DJ Lithium Presents
Bitstream is 2 channel, 44100Hz
Time: 58:29.07, Bitrate: 100.1
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1024 (LWP 27207)]
_vds_shared_init (v=0xbffff73c, vi=0x4024efe0, encp=0) at block.c:176
176 b->modebits=ilog2(ci->modes);
(gdb) bt
#0 _vds_shared_init (v=0xbffff73c, vi=0x4024efe0, encp=0) at block.c:176
#1 0x40040eb6 in vorbis_synthesis_init (v=0xbffff73c, vi=0x4024efe0) at
block.c:621
#2 0x40033fa3 in _make_decode_ready (vf=0xbffff560) at vorbisfile.c:343
#3 0x4003441c in _process_packet (vf=0xbff...
2008 Sep 12
4
[Patch] New function of libvorbis
...3 05:20:28 2008
***************
*** 31,36 ****
--- 31,39 ----
#include "misc.h"
#include "os.h"
+ #define GENERAL_VENDOR_STRING "Xiph.Org libVorbis 1.2.1RC2"
+ #define ENCODE_VENDOR_STRING "Xiph.Org libVorbis I 20080501"
+
/* helpers */
static int ilog2(unsigned int v){
int ret=0;
***************
*** 457,464 ****
}
static int _vorbis_pack_comment(oggpack_buffer *opb,vorbis_comment *vc){
! char temp[]="Xiph.Org libVorbis I 20080501";
! int bytes = strlen(temp);
/* preamble */
oggpack_write(opb,0x03,8);
--- 460,...
2017 Aug 09
1
[PATCH v13 1/5] Introduce xbitmap
...@ -78,6 +79,14 @@ static struct kmem_cache *radix_tree_node_cachep;
> #define IDA_PRELOAD_SIZE (IDA_MAX_PATH * 2 - 1)
>
> /*
> + * The XB can go up to unsigned long, but also uses a bitmap.
This comment is hard to understand.
> + */
> +#define XB_INDEX_BITS (BITS_PER_LONG - ilog2(IDA_BITMAP_BITS))
> +#define XB_MAX_PATH (DIV_ROUND_UP(XB_INDEX_BITS, \
> + RADIX_TREE_MAP_SHIFT))
> +#define XB_PRELOAD_SIZE (XB_MAX_PATH * 2 - 1)
> +
>
> ...
>
> +void xb_preload(gfp_t gfp)
> +{
> + __radix_tree_preload(gfp, XB_PRELOAD_SIZE);
> + if...
2017 Aug 09
1
[PATCH v13 1/5] Introduce xbitmap
...@ -78,6 +79,14 @@ static struct kmem_cache *radix_tree_node_cachep;
> #define IDA_PRELOAD_SIZE (IDA_MAX_PATH * 2 - 1)
>
> /*
> + * The XB can go up to unsigned long, but also uses a bitmap.
This comment is hard to understand.
> + */
> +#define XB_INDEX_BITS (BITS_PER_LONG - ilog2(IDA_BITMAP_BITS))
> +#define XB_MAX_PATH (DIV_ROUND_UP(XB_INDEX_BITS, \
> + RADIX_TREE_MAP_SHIFT))
> +#define XB_PRELOAD_SIZE (XB_MAX_PATH * 2 - 1)
> +
>
> ...
>
> +void xb_preload(gfp_t gfp)
> +{
> + __radix_tree_preload(gfp, XB_PRELOAD_SIZE);
> + if...
2014 Feb 20
2
[PATCH] NTFS: fragmented $MFT file was not handled
...const uint64_t mft_record_size = NTFS_SB(fs)->mft_record_size;
- uint8_t *buf;
- const block_t mft_blk = NTFS_SB(fs)->mft_blk;
- block_t cur_blk;
- block_t right_blk;
- uint64_t offset;
- uint64_t next_offset;
+ uint8_t *buf = NULL;
const uint32_t mft_record_shift = ilog2(mft_record_size);
const uint32_t clust_byte_shift = NTFS_SB(fs)->clust_byte_shift;
- uint64_t lcn;
- int err;
- struct ntfs_mft_record *mrec;
+ uint64_t next_offset = 0;
+ uint64_t lcn = 0;
+ block_t blk = 0;
+ uint64_t offset = 0;
- dprintf("in %s()\n",...
2014 Jul 28
1
Duplicate QLP coefficient restricting code
...t only 32-bit math
> is required for decode of <=16bps streams */
> if(subframe_bps <= 16) {
> FLAC__ASSERT(order > 0);
> FLAC__ASSERT(order <= FLAC__MAX_LPC_ORDER);
> qlp_coeff_precision = flac_min(qlp_coeff_precision, 32 -
> subframe_bps - FLAC__bitmath_ilog2(order));
> }
The difference here is the ilog2 function. I presume this is a
mistake, because subtracting the order (32 - 17 - 8) leaves few
possible precision steps to try. Because the first 'quote' of
the code is always followed by the second, I attach a patch that
makes the first...
2004 Dec 19
1
Crash when reading OGG/Vorbis file
I'm seeing a crash when reading an OGG/Vorbis file. I'm using OGG 1.0
/ Vorbis 1.0.
The crash occurs in _vds_shared_init because the passed in vorbis_info
*vi points to a structure containing all 0s (and thus crashes on the
line
b->modebits = ilog2(ci->modes);
as ci is NULL.
Following the stack, I see that _vds_shared_init is called by
vorbis_synthesis_init which is called by _make_decode_ready by the line
vorbis_syntesis_init(&vf->vd, vf->vi + vf->current_link);
At this point in the vf structure, links = 7. Looking at t...
2013 Dec 11
0
[RFC][PATCH 2/5] timekeeping: Fix potential lost pv notification of time change
...struct timekeeper *tk = &shadow_timekeeper;
cycle_t offset;
int shift = 0, maxshift;
- unsigned int action;
+ unsigned int action = 0;
unsigned long flags;
raw_spin_lock_irqsave(&timekeeper_lock, flags);
@@ -1402,7 +1402,7 @@ static void update_wall_time(void)
maxshift = (64 - (ilog2(ntp_tick_length())+1)) - 1;
shift = min(shift, maxshift);
while (offset >= tk->cycle_interval) {
- offset = logarithmic_accumulation(tk, offset, shift);
+ offset = logarithmic_accumulation(tk, offset, shift, &action);
if (offset < tk->cycle_interval<<shift)
shift-...
2013 Oct 18
1
[RFC/PATCH 2/3] core: MultiFS infrastructure added.
...1;
- disk.s = oreg.ecx.b[0] & 63;
+ disk->h = oreg.edx.b[1] + 1;
+ disk->s = oreg.ecx.b[0] & 63;
}
}
@@ -370,24 +374,24 @@ struct disk *bios_disk_init(void *private)
}
- disk.disk_number = devno;
- disk.sector_size = sector_size;
- disk.sector_shift = ilog2(sector_size);
- disk.part_start = part_start;
- disk.secpercyl = disk.h * disk.s;
- disk.rdwr_sectors = ebios ? edd_rdwr_sectors : chs_rdwr_sectors;
+ disk->disk_number = devno;
+ disk->sector_size = sector_size;
+ disk->sector_shift = ilog2(sector_size);
+...
2017 Nov 03
0
[PATCH v17 1/6] lib/xbitmap: Introduce xbitmap
...he xbitmap implementation supports up to ULONG_MAX bits, and it is
+ * implemented based on ida bitmaps. So, given an unsigned long index,
+ * the high order XB_INDEX_BITS bits of the index is used to find the
+ * corresponding item (i.e. ida bitmap) from the radix tree, and the low
+ * order (i.e. ilog2(IDA_BITMAP_BITS)) bits of the index are indexed into
+ * the ida bitmap to find the bit.
+ */
+#define XB_INDEX_BITS (BITS_PER_LONG - ilog2(IDA_BITMAP_BITS))
+#define XB_MAX_PATH (DIV_ROUND_UP(XB_INDEX_BITS, \
+ RADIX_TREE_MAP_SHIFT))
+#define XB_PRELOAD_SIZE (XB_MAX_PATH * 2 - 1)
+
+/...
2010 Feb 12
2
Optimisation Help
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi,<br>
<br>
I have been looking into optimising the CELT decoder for speed to make
it acceptable for
2017 Dec 12
0
[PATCH v19 2/7] xbitmap: potential improvement
...b/radix-tree.c
+++ b/lib/radix-tree.c
@@ -77,9 +77,6 @@ static struct kmem_cache *radix_tree_node_cachep;
RADIX_TREE_MAP_SHIFT))
#define IDA_PRELOAD_SIZE (IDA_MAX_PATH * 2 - 1)
-/*
- * The XB can go up to unsigned long, but also uses a bitmap.
- */
#define XB_INDEX_BITS (BITS_PER_LONG - ilog2(IDA_BITMAP_BITS))
#define XB_MAX_PATH (DIV_ROUND_UP(XB_INDEX_BITS, \
RADIX_TREE_MAP_SHIFT))
@@ -2145,17 +2142,35 @@ int ida_pre_get(struct ida *ida, gfp_t gfp)
}
EXPORT_SYMBOL(ida_pre_get);
-void xb_preload(gfp_t gfp)
+/**
+ * xb_preload - preload for xb_set_bit()
+ * @gfp_mask: allo...