summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2013-04-15AUTHORS: Mention Frédéric's contributionsHEADmasterMarcel Holtmann1-0/+1
2013-04-15TODO: Add TODO listFrédéric Dalleau1-0/+49
2013-04-15sbc: Update sbcinfo for msbcFrédéric Dalleau1-14/+40
2013-04-15sbc: Update sbcenc for msbcFrédéric Dalleau1-43/+65
2013-04-15sbc: Update sbcdec for msbcFrédéric Dalleau1-5/+17
2013-04-15sbc: Add support for mSBC frame headerFrédéric Dalleau1-90/+138
Traditionnal SBC frame header describe encoding parameters for each frame: nr of blocks, subbands, allocation method, and bitpool. In mSBC, only one combination of parameter is defined. That combination cannot be expressed using a traditionnal SBC header. Because of this, a specific header is defined with 0xAD followed by two reserved zero bytes.
2013-04-15sbc: Declare and implement sbc_init_msbcFrédéric Dalleau3-0/+36
2013-04-15sbc: Add a private boolean flag to enable 15 block encodingFrédéric Dalleau1-8/+29
This patch introduce a new private member which purpose is to encode 15 blocks. It is private to the library and can't be set from standard API. sbc_init_msbc() function will be defined to set this flag.
2013-04-15sbc: Fix input reordering for 15 blocks caseFrédéric Dalleau1-1/+58
SBC analysis handles 8 samples at a time. The optimisation requires 8 samples forming an "odd" block, followed by 8 samples, forming an "even" block. Until now SBC was used for encoding 4, 8, 12, or 16 blocks in a frame. Reordering took a frame and for each 16 samples (ie 2 blocks) it produced one "odd" block and one "even" block. A mSBC frame encodes 15 blocks of 8 samples. 14 blocks are processed as before, two at a time. If 8 samples are remaining, it will form the first half of two blocks (a bit of an "odd" block, and a bit of an "even" block). When processing the next frame, we detect eight samples were missing at previous iteration and the two block can be finished. This reordering is possible because only one sample is moved (x[-7]) AND the first coefficient in the coef table is 0. Thus x[0] doesn't need to be set and 0 can be used in calculation instead. Note that x[-7] is not used in analysis for this block. see: analysis_consts_fixed8_simd_odd. To detect that two blocks are not completed, the number of processed samples can be used. This value is stored in position. position starts at SBC_X_BUFFER_SIZE-72 and is decremented by 16 as long as two blocks can be formed. If only 8 samples are remaining in input, then position is decremented by 8 *arbitrarly*, thus indicating that some samples are pending. During next frame reordering, position will be decremented by 8 again, back to a 16 multiple. This logic works for SBC_X_BUFFER_SIZE-72 multiple of 16 and bigger than 8*2*15+72=312 and less than 8*3*15+72=432. The current value of 328 matches this constraint and X buffer is shifted every two frames (30 blocks) in mSBC. This way, we don't need to care about x[-7] when shifting, we also know that it won't be before X.
2013-04-15sbc: Use plain C primitive if doing msbc on neonFrédéric Dalleau1-0/+8
neon has it's own optimized input reordering. Until this code gets optimized, the neon assembly code will not work with the mSBC input reordering. However, the plain C version of mSBC can be used in this case. This patch makes use of plain C code if the block increment is 1 which is typical for mSBC.
2013-04-15sbc: Add plain C primitive for 1b 8s analysisFrédéric Dalleau1-1/+21
2013-04-15sbc: Add iwmmxt primitive for 1b 8s encodingFrédéric Dalleau1-1/+21
2013-04-15sbc: Add armv6 primitive for 1b 8s analysisFrédéric Dalleau1-1/+21
2013-04-15sbc: Add mmx primitive for 1b 8s analysisFrédéric Dalleau1-1/+25
2013-04-15sbc: Rename sbc_analyze_4b_xx to sbc_analyze_xxFrédéric Dalleau7-14/+14
2013-04-15sbc: Break 4 blocks processing to variable stepsFrédéric Dalleau2-10/+15
Until now SBC processed 4 blocks at a time. If we want to process 15 blocks, then we need to break this processing in one block steps. 4 blocks is still default increment.
2013-04-15sbc: Add encoder_state to analysis functionsFrédéric Dalleau7-22/+26
Until now, SIMD analysis used to process 4 blocks of 8 samples at a time. This was implemented using two constant tables: odd and even. This mean we can only process 4, 8, 12, or 16 blocks par SBC packets. mSBC requires 15 blocks, so to be able to analyse 1 block, it will be necessary to know if we are processing an odd or even block. This will be done with a new member to encoder_state.
2013-03-01build: Do not use deprecated AM_CONFIG_HEADERLucas De Marchi1-1/+1
The long-obsoleted AM_CONFIG_HEADER macro was removed in automake 1.13. Use AC_CONFIG_HEADERS instead.
2012-07-30Release 1.01.0Marcel Holtmann2-1/+3
2012-07-29sbc: Remove unnecessary whitespace from empty lineJohan Hedberg1-1/+1
2012-07-29build: Set initial public library versionMarcel Holtmann1-1/+1
2012-07-29sbc: Set symbols for version 1.0Marcel Holtmann1-1/+1
2012-07-29build: Add symbol table for libraryMarcel Holtmann2-1/+23
2012-07-29sbc: Use SBC_EXPORT instead of LIB_EXPORTMarcel Holtmann2-11/+11
2012-07-29sbc: Fix spelling mistakeMarcel Holtmann1-1/+1
2012-07-29build: Add library version informationMarcel Holtmann1-0/+12
2012-07-29README: Add basic informationMarcel Holtmann1-0/+20
2012-07-29AUTHORS: Add missing original contributorMarcel Holtmann1-0/+1
2012-07-29sbc: Export public functions as APIMarcel Holtmann1-10/+11
2012-07-29build: Add private SBC library headerMarcel Holtmann2-1/+26
2012-07-29build: Switch to -fvisibility=hidden by defaultMarcel Holtmann1-2/+5
2012-07-29build: Add pkg-config informationMarcel Holtmann4-1/+16
2012-07-29build: Private library is not needed when tools are disabledMarcel Holtmann1-1/+1
2012-07-29build: Rename option for SBC testerMarcel Holtmann2-5/+5
2012-07-29build: Add option to disable SBC toolsMarcel Holtmann2-0/+6
2012-07-29build: Install SBC header includesMarcel Holtmann1-3/+7
2012-07-29AUTHORS: Update list of contributorsMarcel Holtmann1-0/+5
2012-07-29build: Add support for building SBC testerMarcel Holtmann3-1/+18
2012-07-29build: Use -Wshadow compiler optionMarcel Holtmann1-1/+1
2012-07-29build: Add support for building SBC toolsMarcel Holtmann2-0/+16
2012-07-29build: Add support for building SBC libraryMarcel Holtmann1-0/+14
2012-07-29src: Move SBC tester utilityMarcel Holtmann1-0/+0
2012-07-29src: Move subband encoder, decoder and info toolsMarcel Holtmann4-2/+2
2012-07-29sbc: Fix spelling errorsRafael Fonseca1-1/+1
Fix spelling errors found using the codespell tool (https://github.com/lucasdemarchi/codespell).
2012-07-29sbc: fix "always_inline function might not be inlinable" warningSiarhei Siamashka1-1/+1
"__attribute__((always_inline))" does not replace "inline" and they still need to be used together. This fixes "always_inline function might not be inlinable [-Wattributes]" warning in gcc 4.7
2012-07-29sbc: Reduce for-loop induced indentation in sbc_unpack_frameJohan Hedberg1-16/+20
2012-07-29sbc: overflow bugfix and audio decoding quality improvementSiarhei Siamashka2-6/+11
The "(((audio_sample << 1) | 1) << frame->scale_factor[ch][sb])" part of expression "frame->sb_sample[blk][ch][sb] = (((audio_sample << 1) | 1) << frame->scale_factor[ch][sb]) / levels[ch][sb] - (1 << frame->scale_factor[ch][sb])" in "sbc_unpack_frame" function can sometimes overflow 32-bit signed int. This problem can be reproduced by first using bitpool 128 and encoding some random noise data, and then feeding it to sbc decoder. The obvious thing to do would be to change "audio_sample" variable type to uint32_t. However the problem is a little bit more complicated. According to the section "12.6.2 Scale Factors" of A2DP spec: scalefactor[ch][sb] = pow(2.0, (scale_factor[ch][sb] + 1)) And according to "12.6.4 Reconstruction of the Subband Samples": sb_sample[blk][ch][sb] = scalefactor[ch][sb] * ((audio_sample[blk][ch][sb]*2.0+1.0) / levels[ch][sb]-1.0); Hence the current code for calculating "sb_sample[blk][ch][sb]" is not quite correct, because it loses one least significant bit of sample data and passes twice smaller sample values to the synthesis filter (the filter also deviates from the spec to compensate this). This all has quite a noticeable impact on audio quality. Moreover, it makes sense to keep a few extra bits of precision here in order to minimize rounding errors. So the proposed patch introduces a new SBCDEC_FIXED_EXTRA_BITS constant and uses uint64_t data type for intermediate calculations in order to safeguard against overflows. This patch intentionally addresses only the quality issue, but performance can be also improved later (like replacing division with multiplication by reciprocal). Test for the difference of sbc encoding/decoding roundtrip vs. the original audio file for joint stereo, bitpool 128, 8 subbands and http://media.xiph.org/sintel/sintel-master-st.flac sample demonstrates some quality improvement: === before === --- comparing original / sbc_encoder.exe + sbcdec --- stddev: 4.64 PSNR: 82.97 bytes:170495708/170496000 === after === --- comparing original / sbc_encoder.exe + sbcdec --- stddev: 1.95 PSNR: 90.50 bytes:170495708/170496000
2012-07-29sbc: Use __asm__ keywordMaarten Bosmans4-25/+25
There are two reasons for this change: First: consistency. __asm__ was already used elsewhere in the files, so using that throughout is cleaner. Second: both asm and __asm__ are GCC-specific extensions, not defined in the C standard. When compiling with --std=gnu99 both are recognized, but when using --std=c99 only __asm__ is recognized to make it perfectly clear that you're not using some standard C99 construct, but a GCC-extension.
2012-07-29sbc: Fix empty parameter list in usage() declarationSzymon Janc1-1/+1
2012-07-29sbc: Remove unused variableJohan Hedberg1-2/+1