資源簡介
sbc codec子帶壓縮編解碼算法,是藍牙音頻系統里常見的壓縮算法。本算法是國外人寫的比較優良的C語言算法

代碼片段和文件信息
/*
?*
?*??Bluetooth?low-complexity?subband?codec?(SBC)?library
?*
?*??Copyright?(C)?2004-2007??Marcel?Holtmann?
?*??Copyright?(C)?2004-2005??Henryk?Ploetz?
?*??Copyright?(C)?2005-2006??Brad?Midgley?
?*
?*
?*??This?library?is?free?software;?you?can?redistribute?it?and/or
?*??modify?it?under?the?terms?of?the?GNU?Lesser?General?Public
?*??License?as?published?by?the?Free?Software?Foundation;?either
?*??version?2.1?of?the?License?or?(at?your?option)?any?later?version.
?*
?*??This?library?is?distributed?in?the?hope?that?it?will?be?useful
?*??but?WITHOUT?ANY?WARRANTY;?without?even?the?implied?warranty?of
?*??MERCHANTABILITY?or?FITNESS?FOR?A?PARTICULAR?PURPOSE.??See?the?GNU
?*??Lesser?General?Public?License?for?more?details.
?*
?*??You?should?have?received?a?copy?of?the?GNU?Lesser?General?Public
?*??License?along?with?this?library;?if?not?write?to?the?Free?Software
?*??Foundation?Inc.?51?Franklin?St?Fifth?Floor?Boston?MA??02110-1301??USA
?*
?*/
/*?todo?items:
??use?a?log2?table?for?byte?integer?scale?factors?calculation?(sum?log2?results
??for?high?and?low?bytes)?fill?bitpool?by?16?bits?instead?of?one?at?a?time?in
??bits?allocation/bitpool?generation?port?to?the?dsp
*/
#ifdef?HAVE_CONFIG_H
#include?
#endif
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?“sbc_math.h“
#include?“sbc_tables.h“
#include?“sbc.h“
#define?SBC_SYNCWORD 0x9C
/*?sampling?frequency?*/
#define?SBC_FS_16 0x00
#define?SBC_FS_32 0x01
#define?SBC_FS_44 0x02
#define?SBC_FS_48 0x03
/*?nrof_blocks?*/
#define?SBC_NB_4 0x00
#define?SBC_NB_8 0x01
#define?SBC_NB_12 0x02
#define?SBC_NB_16 0x03
/*?channel?mode?*/
#define?SBC_CM_MONO 0x00
#define?SBC_CM_DUAL_CHANNEL 0x01
#define?SBC_CM_STEREO 0x02
#define?SBC_CM_JOINT_STEREO 0x03
/*?allocation?mode?*/
#define?SBC_AM_LOUDNESS 0x00
#define?SBC_AM_SNR 0x01
/*?subbands?*/
#define?SBC_SB_4 0x00
#define?SBC_SB_8 0x01
/*?This?structure?contains?an?unpacked?SBC?frame.
???Yes?there?is?probably?quite?some?unused?space?herein?*/
struct?sbc_frame?{
uint16_t?sampling_frequency; /*?in?kHz?*/
uint8_t?blocks;
enum?{
MONO =?SBC_CM_MONO
DUAL_CHANNEL =?SBC_CM_DUAL_CHANNEL
STEREO =?SBC_CM_STEREO
JOINT_STEREO =?SBC_CM_JOINT_STEREO
}?channel_mode;
uint8_t?channels;
enum?{
LOUDNESS =?SBC_AM_LOUDNESS
SNR =?SBC_AM_SNR
}?allocation_method;
uint8_t?subbands;
uint8_t?bitpool;
uint8_t?codesize;
uint8_t?length;
/*?bit?number?x?set?means?joint?stereo?has?been?used?in?subband?x?*/
uint8_t?join;
/*?only?the?lower?4?bits?of?every?element?are?to?be?used?*/
uint8_t?scale_factor[2][8];
/*?raw?integer?subband?samples?in?the?frame?*/
uint16_t?audio_sample[16][2][8];
int32_t?sb_sample_f[16][2][8];
int32_t?sb_sample[16][2][8]; /*?modified?subband?samples?*/
int16_t?pcm_sample[2][16*8]; /*?original?pcm?audio?samples?*/
};
struct?sbc_decoder_st
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????403??2007-10-26?07:09??sbc_c\Makefile.am
?????文件??????15954??2007-12-26?00:43??sbc_c\Makefile.in
?????文件??????36626??2008-02-14?17:41??sbc_c\sbc.c
?????文件???????1846??2008-02-14?17:06??sbc_c\sbc.h
?????文件??????16384??2008-01-02?12:12??sbc_c\sbccode.IAB
?????文件????????488??2008-01-02?12:12??sbc_c\sbccode.IAD
?????文件???????4096??2008-01-02?12:12??sbc_c\sbccode.IMB
?????文件????????368??2008-01-02?12:12??sbc_c\sbccode.IMD
?????文件?????????32??2008-01-05?11:48??sbc_c\sbccode.PFI
?????文件????????776??2008-01-05?11:48??sbc_c\sbccode.PO
?????文件???????3008??2008-01-02?12:12??sbc_c\sbccode.PR
?????文件??????16704??2008-01-02?12:12??sbc_c\sbccode.PRI
?????文件??????35772??2008-01-05?14:06??sbc_c\sbccode.PS
?????文件???????6422??2008-01-05?14:06??sbc_c\sbccode.WK3
?????文件???????5631??2008-01-05?11:10??sbc_c\sbcdec.c
?????文件???????5555??2007-12-09?03:04??sbc_c\sbcenc.c
?????文件???????6915??2008-01-03?12:07??sbc_c\sbcinfo.c
?????文件???????8717??2007-12-09?03:04??sbc_c\sbctester.c
?????文件???????2808??2008-02-15?10:11??sbc_c\sbc_math.h
?????文件???????8413??2008-02-15?11:06??sbc_c\sbc_tables.h
?????目錄??????????0??2014-03-24?16:26??sbc_c
-----------?---------??----------?-----??----
???????????????176918????????????????????21
- 上一篇:詞法分析器c語言實現
- 下一篇:拼圖游戲大型課程設計C# C++
評論
共有 條評論