AC3 encoder flow 如下:

1.input PCM

PCM在进入encoder前会使用high pass filter来移除信号的DC部分来达到更有效的编码。

2.Transient detection

Transient detection用于决定在进行MDCT时是否需要switch到short block来减少pre-echo。

Transient detection 分为以下几个步骤:

1)High pass filter.使用二阶IIR filter (cutoff of 8kHz)。

2)Block Segmentation.

一个audio block(256 sample)通过HP filter后,segmented 到hierarchical tree的不同level上。

level 1为256 sample. level 2为2个长度为128 sample 的segment.level3 为4个长度为64 sample的segment.

3)Peak detection

在hierarchical tree的各个level的各个segment上找到最大PCM的最大幅值。

P[j][k] = max(x(n))

for n = (512 ×(k-1) / 2^j), (512 ×(k-1) / 2^j) + 1, ...(512 ×k / 2^j) - 1
and k = 1, ..., 2^(j-1) ;

其中x(n)为256 sample 的audio block 中第n个sample

j=1,2,3 为hierachical tree的level

k为level j的segment index.

4)Thread Comparison

首先用P[1][1]与“silence threshold”进行比较来check当前audio block中是否存在signifant signal level.

如果P[1][1]小于silence threshold则使用long block. silence threshold为100/32768

接下来,在每个level上比较相邻的segment的Peak.如果相邻的两个segment Peak的比值大于预设的threshold,就设置一个flag来标识当前audio block存在transient.

比较方法如下:

mag(P[j][k]) ×T[j] > mag(P[j][(k-1)])

T[j]是level j预设的threshold.T[1]=0.1,T[2]=0.075,T[3]=0.05.

3.Forward Transform

每个audio block在进行MDCT transform之前,需要乘以window function来减少transform的边界效应。

使用MDCT进行时频变换。

x[n]表示乘以window function之后的时域信号,如果使用long block,N=512.如果使用short block, N=256.

4.Coupling Strategy

1)basis encoder

basic encoder 使用static coupling strategy, couplig parameter 如下:

2)advanced encoder

更多的advanced encoder使用动态变化的coupling parameter. coupling frequecies根据psychoacoustic model 分析bit 的需求量来动态变化。

如果某个channel的信号在时间上变化剧烈,就从coupling中移除。在时间上变化缓慢的channel,其coupling coordinate传送bit少很多。

coupling band structure也会动态变化。

5.Form Coupling Channel

大部分basic encoder将所有individual channel的transform coefficients简单的相加,然后除以8(防止transform coefficients超过1溢出)形成coupling channel。

一些稍微复杂点的encoder在进行相加钱会改变individual channel的符号来避免phase cancellations.

在每个coupling band内,原始channel的能量除以coupling channel中对应coupling band内能量的比值形成coupling coordinates.

6.Rematrixing

Rematrixing只存在于2/0 mode.在每个rematrixing band内,计算L,R,L-R,L+R的能量,如果最大的能量是L or R,那当前band不设置rematrixing flag.如果最大的能量是L+R orL- R,那当前band设置rematrixing flag,并传送L+R,L-R.

7.Extract exponent

将transform coefficient表示成二进制后,leading zero的个数为初始的exponent.

每个transform coefficients计算出一个exponent,可以选择不同的exponent strategy将多个exponent group在一起。

8.Exponent Strategy

如果频谱变化平坦,则使用D25 or D45,如果变化不平坦,这是用频谱分辨率较高的exponent strategy D15 or D25.

如果频谱在一个frame的6个audio block内改变很小,则只在audio block 0传送exponents, block 1~5使用block 0的exponents.

对于basic encoder,check时间上exponents的变化,如果变化超过了一个threshold,那么就传送新的exponent。

9.Dither strategy

当transform coefficient被quantize为0bit时,在decoder端使用dither替代transform coefficients.

10.Encoder Exponents

对于exponent strategy D25,D45,一个exponent对应多个mantissa. exponent采用差分编码。两个相邻的exponent的差值被限定为+/-2内,如果相邻的exponent差值大于2,则减少较大的exponent到+/-2范围内,相应的mantissa经调整后包含leading zero.

11.Normalize mantissa

每个channel的transform coefficients根据exponents左移得到normalized mantissa.

12.Core Bit Allocation

Core bit allocation是通过不断调整corse SNR 和fine SNR offset直到一个frame内的所有可用的bit都分配完。

corse SNR offset调整时每次增加/减少3db,fine SNR offset 调整时每次增加/减少3/16db.

对于所有channel,都是 从一个common bit pool来进行bit allocation。在encoder通过不断的迭代选择最优的csnroffst 和fineoffst,分配不超过frame size的最大bit 数。

对于某一次迭代,如果分配的bit数超过了bit pool,那么减小SNR offset来进行下一次迭代。如果分配的bit数小于bit pool,那么增加SNR offset来进行下一次迭代。当SNR offset已经是满足分配bit数不超过bit pool的最大值时,迭代结束。

bit allocation的最终结果是csnroffst,fineoffst和baps(bit allocation points)

13. Quantize mantissa

每个normallized mantissa使用对应bap的quantizer进行quantize.

14.Pack AC-3 Frame

将上述过程产生的side info,exponents和quantized mantissa pack成AC-3 frame

AC3 encoder flow的更多相关文章

  1. AC3 IMDCT

    AC3 encoder 在进行MDCT时,使用两种长度的block. 512 samples的block用于输入信号频谱是stationary,或者在时间上变化缓慢.在fs 为48k时,使用512 s ...

  2. AC3 Rematrix

    当L R channel highly correlated时,AC3 encoder 使用rematrix技术压缩L/R的和和差. 原始信号为left,right,使用rematrix压缩信号为le ...

  3. AC3 overview

    1.AC3 encode overview AC3 encoder的框图如下: AC3在频域采用粗量化(coarsely quantizing)来获取较高的压缩率. 1).输入PCM 经过MDCT变换 ...

  4. ffmpeg最全的命令参数

    Hyper fast Audio and Video encoderusage: ffmpeg [options] [[infile options] -i infile]... {[outfile ...

  5. Motion control encoder extrapolation

    Flying Saw debug Part1 Encoder extrapolation Machine introduction A tube cutting saw, is working for ...

  6. 光流法(optical flow)

    光流分为稠密光流和稀疏光流 光流(optic flow)是什么呢?名字很专业,感觉很陌生,但本质上,我们是最熟悉不过的了.因为这种视觉现象我们每天都在经历.从本质上说,光流就是你在这个运动着的世界里感 ...

  7. Improved Variational Inference with Inverse Autoregressive Flow

    目录 概 主要内容 代码 Kingma D., Salimans T., Jozefowicz R., Chen X., Sutskever I. and Welling M. Improved Va ...

  8. Improving Variational Auto-Encoders using Householder Flow

    目录 概 主要内容 代码 Tomczak J. and Welling M. Improving Variational Auto-Encoders using Householder Flow. N ...

  9. Git 在团队中的最佳实践--如何正确使用Git Flow

    我们已经从SVN 切换到Git很多年了,现在几乎所有的项目都在使用Github管理, 本篇文章讲一下为什么使用Git, 以及如何在团队中正确使用. Git的优点 Git的优点很多,但是这里只列出我认为 ...

随机推荐

  1. 《操作系统真象还原》BIOS

    以下是读本书第二章的收获. 记得我大学学习操作系统的时候会遇到一些奇奇怪怪的问题,因为觉得问题太奇怪了,所以羞于问老师.诸如ROM到底是个什么东西:如果用内存映射的方式访问外部设备,是不是内存条里专门 ...

  2. arm的字节对齐问题总结(转)

    问题由来:pc的lsb总是0,因为代码至少要字对齐.cm3的指令至少是半字对齐的(16) 一.啥是字对齐?为啥要字对齐? 现代计算机中内存空间都是按照byte划分的,从理论上讲似乎对任何类型的变量的访 ...

  3. unserialize():Error at offset 0 of 96 bytes是什么意思

    数据库有个列是数组序列化后存到数据库的,取出来得反序列化, php想要把数组保存到数据库里,有两种序列化方式,分别是: //php系统序列化 $b = serialize($a);    //序列化数 ...

  4. 0级搭建类013-CentOS 8.x 安装

    CentOS 8 操作系统安装

  5. linux 搭建python虚拟环境

    requirements.txt 包含paramiko,pysfp.setuptools,适用python版本3.6.6+ 前提编译安装python wget wget https://www.pyt ...

  6. Java如何自定义注解

    本文主要是记录所学,以供后续参考.注解是Java 1.5引入的,Java自定义注解是通过运行时靠反射获取注解,注解相当于是一种嵌入在程序中的元数据,可以使用注解解析工具或编译器对其进行解析,也可以指定 ...

  7. Yeoman+Bower+gulp web前端自动化工作流程(初级教程)

    Yeoman包括了三个部分yo(脚手架工具).grunt/gulp(构建工具).bower(包管理器).听说gulp更容易上手,所以我就没用grunt而选的gulp 什么是开发流程? 在我看来一个完整 ...

  8. python实用30个小技巧

    python实用30个小技巧 展开1.原地交换两个数字Python 提供了一个直观的在一行代码中赋值与交换(变量值)的方法,请参见下面的示例: In [1]: x,y = 10 ,20 In [2]: ...

  9. [JSOI2013] 快乐的 JYY - 回文自动机,DFS

    #include <bits/stdc++.h> #define Sigma 30 #define MAXN 500010 #define int long long using name ...

  10. 全排列(dfs-有重复数字)

    给出一个字符串S(可能有重复的字符),按照字典序从小到大,输出S包括的字符组成的所有排列.例如:S = "1312", 输出为:   1123 1132 1213 1231 131 ...