Improved bitrev with approach suggested by Jens Arnold, gives 0.5%-1% speedup for...
[kugel-rb.git] / apps / codecs / libmusepack / internal.h
blob45f2b41eeaefa93a6a1c55ba6f48b7b73c792c04
1 /*
2 Copyright (c) 2005, The Musepack Development Team
3 All rights reserved.
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions are
7 met:
9 * Redistributions of source code must retain the above copyright
10 notice, this list of conditions and the following disclaimer.
12 * Redistributions in binary form must reproduce the above
13 copyright notice, this list of conditions and the following
14 disclaimer in the documentation and/or other materials provided
15 with the distribution.
17 * Neither the name of the The Musepack Development Team nor the
18 names of its contributors may be used to endorse or promote
19 products derived from this software without specific prior
20 written permission.
22 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 /// \file internal.h
36 /// Definitions and structures used only internally by the libmpcdec.
38 #ifndef _mpcdec_internal_h
39 #define _mpcdec_internal_h
42 enum {
43 MPC_DECODER_SYNTH_DELAY = 481
46 /// Big/little endian 32 bit byte swapping routine.
47 /* Use our Rockbox (maybe) optimised swap routine instead */
48 #define mpc_swap32(x) swap32(x)
49 #if 0
50 static __inline
51 mpc_uint32_t mpc_swap32(mpc_uint32_t val) {
52 return (((val & 0xff000000) >> 24) | ((val & 0x00ff0000) >> 8) |
53 ((val & 0x0000ff00) << 8) | ((val & 0x000000ff) << 24));
55 #endif
57 #ifndef min
58 #define min(a, b) (((a) < (b)) ? (a) : (b))
59 #endif
61 /// Searches for a ID3v2-tag and reads the length (in bytes) of it.
62 /// \param reader supplying raw stream data
63 /// \return size of tag, in bytes
64 /// \return -1 on errors of any kind
65 mpc_int32_t JumpID3v2(mpc_reader* fp);
67 /// helper functions used by multiple files
68 mpc_uint32_t mpc_random_int(mpc_decoder *d); // in synth_filter.c
69 void mpc_decoder_initialisiere_quantisierungstabellen(mpc_decoder *d, double scale_factor);
70 void mpc_decoder_synthese_filter_float(mpc_decoder *d, MPC_SAMPLE_FORMAT* OutData);
72 #endif // _mpcdec_internal_h