search for: flac__bitmath_ilog2_wide

Displaying 9 results from an estimated 9 matches for "flac__bitmath_ilog2_wide".

2013 Sep 04
4
PATCH: bugfixes for bitmath.h
...explanation of this patch. 1. The first parameter of _BitScanReverse() and _BitScanReverse64() is a pointer to unsigned long (4-byte int). However _BitScanReverse64() is called with a pointer to FLAC__uint64 (8-byte int). IMHO it's a bug and this patch changes the type of idx variable inside FLAC__bitmath_ilog2_wide() from FLAC__uint64 to unsigned long. The type of idx variable inside FLAC__bitmath_ilog2() was also changed (from FLAC__uint32 to unsigned long), for symmetry. 2. FLAC__clz_uint32() returns the result of BitScanReverse() XOR 31. FLAC__bitmath_ilog2() returns 31-FLAC__clz_uint32() == 31-(BSR^3...
2013 Sep 06
4
About de Bruijn sequences in bitmath.h
Found this code: ftp://ftp.samba.org/pub/unpacked/ntdb/lib/ccan/ilog/ilog.c Tests show that it's faster to use the following code in FLAC__bitmath_ilog2_wide(): static const unsigned char DEBRUIJN_IDX32[32]={ 0, 1,28, 2,29,14,24, 3,30,22,20,15,25,17, 4, 8, 31,27,13,23,21,19,16, 7,26,12,18, 6,11, 5,10, 9 }; FLAC__uint32 v; int m; m=(_v>0xFFFFFFFFU)<<5; v=(FLAC__uint32)(_v>>m); v|=v&gt...
2012 Mar 29
4
[GIT PULL] Assorted bugfixes and improvements (from openSUSE)
The following changes since commit b78d8e4db10e57b8d82bb82e4e3662d5dedd7255: FLAC__bitmath_ilog2,FLAC__bitmath_ilog2_wide,COUNT_ZERO_MSBS: add gcc specific optimizations (2012-03-28 15:43:48 -0300) are available in the git repository at: git://github.com/crrodriguez/flac.git master for you to fetch changes up to 3a060556772c5d6a6464afddfda7c3ad2f93a306: Remove winamp2 plugin. (2012-03-29 13:51:24 -0300) --...
2013 Sep 08
0
PATCH: bugfixes for bitmath.h
...= BSR. But I don't think that compilers > are so smart that can optimize this expression. So it is better to change > FLAC__bitmath_ilog2() so it simply calls BitScanReverse() when possible. I want to look at this more carefully. Its probably worth writing a unit test for it. > 3. FLAC__bitmath_ilog2_wide() cannot be compiled with MSVC: it has > 'if (v == 0)...' statement followed by a variable (either idx or > DEBRUIJN_IDX64) definition. But all calls of this function have > FLAC__ASSERT statements that ensure that its argument is greater > than 0. So this 'if()' can be...
2012 Mar 30
0
[GIT PULL] Assorted bugfixes and improvements (from openSUSE)
Cristian Rodr?guez wrote: > The following changes since commit b78d8e4db10e57b8d82bb82e4e3662d5dedd7255: > > FLAC__bitmath_ilog2,FLAC__bitmath_ilog2_wide,COUNT_ZERO_MSBS: add gcc > specific optimizations (2012-03-28 15:43:48 -0300) > > are available in the git repository at: > > git://github.com/crrodriguez/flac.git master > > for you to fetch changes up to 3a060556772c5d6a6464afddfda7c3ad2f93a306: Hi Cristian, Thanks f...
2014 Feb 01
1
PATCH for bitmath.h
FLAC__bitmath_ilog2_wide() function is still problematic: 1) it cannot be compiled with MSVS 2) it returns correct results only when compiles with GNUC 3) it mentions LGPL which isn't good for a BSD-licensed library Here's the patch that should fix these issues. (about LGPL -> CC0 change: http://lists.xiph.org...
2012 May 09
1
[PATCH 2/2] bitmath: Finish up optimizations
...) = 4 - * ilog2(17) = 4 - * ilog2(18) = 4 - */ - -#ifndef __GNUC__ - -/* For GNUC, use static inline version in include/private/bitmath.h. */ - -unsigned FLAC__bitmath_ilog2(FLAC__uint32 v) -{ - unsigned l = 0; - if (v == 0) - return 0; - while(v >>= 1) - l++; - return l; -} - -unsigned FLAC__bitmath_ilog2_wide(FLAC__uint64 v) -{ - unsigned l = 0; - if (v == 0) - return 0; - while(v >>= 1) - l++; - return l; -} -#endif - /* An example of what FLAC__bitmath_silog2() computes: * * silog2(-10) = 5 diff --git a/src/libFLAC/bitreader.c b/src/libFLAC/bitreader.c index dcd9e42..9e15db0 100644 ---...
2013 Aug 31
2
New routine: FLAC__lpc_compute_autocorrelation_asm_ia32_sse_lag_16
Erik de Castro Lopo <mle+la at mega-nerd.com> wrote: > Patch applied, tested, commited and pushed. Great. But, what about my other patches? I admit that many of them aren't necessary, but (imho) a couple of them are important. I can explain in detail why I think this.
2013 Sep 01
1
New routine: FLAC__lpc_compute_autocorrelation_asm_ia32_sse_lag_16
...(= unsigned int) but it doesn't really matter since both of them are 4-byte unsigned integers. However, _BitScanReverse64 expects a pointer to a 4-byte uint, but it is called with a pointer to a 8-byte uint. The garbage in the most significant 4 bytes of idx is discarded then and the result of FLAC__bitmath_ilog2_wide() is correct. Still I think it's a bug. Also I noticed that all projects with '_static' suffix produce static library files (*.lib), projects with '_dynamic' suffix produce dynamic library files (*.dll), and projects without suffixes produce executables (*.exe). The only exc...