- 1、本文档共7页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 5、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 6、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 7、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 8、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
adpcm压缩解压缩算法(ADPCM compression decompression algorithm)
adpcm压缩解压缩算法(ADPCM compression decompression algorithm)
ADPCM压缩算法
ADPCM(自适应差分脉冲编码调制),是一种针对16bits(或8bits或者更高)声音波形数据的一种有损压缩算法,它将声音流中每次采样的16bit数据以4bit存储,所以压缩比1:4。而且压缩/解压缩算法非常简单,所以是一种低空间消耗,高质量高效率声音获得的好途径。保存声音的数据文件后缀名为。澳元的大多用ADPCM压缩。
ADPCM主要是针对连续的波形数据的,保存的是波形的变化情况,以达到描述整个波形的目的,由于它的编码和解码的过程却很简洁,列在后面,相信大家能够看懂。
8bits采样的声音人耳是可以勉强接受的,而16bit采样的声音可以算是高音质了。ADPCM算法却可以将每次采样得到的16bit数据压缩到4位。需要注意的是,如果要压缩/解压缩得是立体声信号,采样时,声音信号是放在一起的,需要将两个声道分别处理。
ADPCM压缩过程
首先我们认为声音信号都是从零开始的,那么需要初始化两个变量
指数= 0,prev_sample = 0;
下面的循环将依次处理声音数据流,注意其中的getnextsample()应该得到一个16bit的采样数据,而outputdata()可以将计算出来的数据保存起来,程序中用到的step_table [ ],[ ]附在后面index_adjust:
指数= 0,prev_sample:= 0;
而(还有数据要处理)
{
cur_sample = getnextsample();/ /得到当前的采样数据
δ= cur_sample-prev_sample;/ /计算出和上一个的增
如果(Δ<0)三角洲,三角洲,某人= 8;//取绝对
某人= 0;//某人保存的是符号位
代码= 4×δ/ step_table [索引];//根据steptable [ ]得到一个0-7的值
如果(代码 7)代码= 7;//它描述了声音强度的变化量
指数= index_adjust [代码];//根据声音强度调整下次取steptable的序号
如果(指数<0)指数= 0;//便于下次得到更精确的变化量的描述
否则如果(索引 88)索引= 88;
prev_sample = cur_sample;
outputode(代码|某人);/ /加上符号位保存起来
}
For more detailed information about the ADPCM compression process, see the station ADPCM compression process demonstration program
ADPCM decompression process
Compression is actually an inverse process of compression, in which the getnextcode () should be encoded, while outputsample () can preserve the decoded sound signals. This code is also used with the same setp_table[] and index_adjust () attached to the back:
Int, index=0, cur_sample=0;
While (and data to be processed)
{
(code=getnextcode); / / get the next data
If ((code 8) = = 0) sb=1, else, sb=0;
Code=7; / / code from data and symbols
Delta = /4+step_table[index]/8 (step_table[index]*code); / / add a is in order to reduce the error
If (sb==1) delta=-delta;
Cur_sample+=delta; / / the calculated data of the current waveform
If (cur_sample32767) output_sample (32767);
Else if (cur_sample-32768) output_sample (-32768);
Else output_sample (cur_sample);
Index+=index_adjust[code];
If (index0) index=0;
If (index88) in
您可能关注的文档
- 2008葡萄酒市场盘点(2008 Wine Market Review).doc
- 2009年4月自学考试行政管理学试题及答案(Administrative examination questions and answers for self taught Examination in April 2009).doc
- 2009年上虞市高一第一学期历史试卷(2009 Shangyu first semester history papers).doc
- 2009年全国高考全国卷2试题答案(英语)(2009 national college entrance examination national Volume 2 questions answer (English)).doc
- 2009年平原县初中毕业生学业水平考试理化试题(In 2009, the junior middle school graduates' academic proficiency test in the plain county was examined).doc
- 2009年度潮词精选(Choice of tide words in 2009).doc
- 2009年北京高考各重点中学高考成绩(2009 Beijing college entrance examination of key secondary school entrance examination results).doc
- 2009年普通高等学校招生全国统一考试理综综合能力测试( …(In 2009, the unified national college entrance examination (the synthetical ability test...).doc
- 2009年高考物理第二轮复习建议(Second round review of college entrance examination physics in 2009).doc
- 2009高教社杯全国大学生数学建模竞赛a题7_17(2009 High Education Association Cup National Undergraduate Mathematical Modeling contest a title 7_17).doc
- allegro出gerber(快板出Gerber).doc
- all字典(All dictionary).doc
- ami脉冲导融疗法(ami脉冲导融疗法).doc
- amt咨询基于业务流程的企业风险管控(AMT Consulting risk management of enterprise based on business process).doc
- ansys civi1fem(ansys civi1fem).doc
- ansys 工作平面和当前坐标系的区别(The difference between ANSYS and the plane coordinate system).doc
- ansys_常见警告和错误(Ansys_ common errors and warnings).doc
- ansys与其他软件接口资料汇总2(ANSYS and other software interface data summary 2).doc
- ansys中坐标系应用及总结(Coordinate system and summarize the application in ANSYS).doc
- ansys使用技巧(ANSYS tips).doc
最近下载
- 2024年全国现场流行病学调查职业技能竞赛备考试题库800题(含答案).docx VIP
- 商务数据分析课件_ 商务数据分析基本概念.pptx VIP
- 阅读疗法在高校图书馆的应用研究.docx VIP
- 非急救医疗转运管理规范(2019年版).pdf VIP
- 结直肠癌筛查与早诊早治方案 (2024 年版).pptx VIP
- 《商务数据分析》PPT课件(全).pptx VIP
- 2025农村教师选调进城小学语文试题库(含答案).docx
- 灾害应急救援风险管理.docx VIP
- 2025年广东省现场流行病学调查职业技能竞赛理论参考试题库(含答案).docx VIP
- DB15T 2526-2022 湿地监测技术规程.docx
文档评论(0)