zoukankan      html  css  js  c++  java
  • AC3 bit allocation

    1.bit allocation overview

    bit allocation通过分析audio 信号的频谱envelop,使用masking effect来确定使用多少bit来表示频率系数的mantissa.

    bit allocation包含人耳的parameter model 来预估noise level thresold, 人耳的parameter model将audible和inaudible的频谱部分分开。

    hearing model的parameter在encoder端基于信号的特征进行调整。例如,prototype masking curve可以简单的以两个线段表示,每个线段有自己的斜率和y轴相交的点。encoder从几个合适的线段中不断的迭代选择最佳的线段来表示prototype masking curve,这样的线段可以作为parameter压在bitstream中。

    noise level threshold的预估是基于50个nonuniform bandwidth计算,不同的采样率具有不同的band structure.

    mantissa的bit数是通过计算PSD与预估noise level threshold的差值,进行查表得到。

    2. bit allocation 

    1) initialize.

    计算起始和截止频率。

    通过码流中的parameter,查表确定描述sdecay, fdecay,sgain,dbknee,floor的值,这些值可以描述prototype masking curve的相关信息。masking curve可以简化成两个线段,fast decay和slow decay部分,slow gain表示的是PSD的peak到fast decay相交点的差值。

    fbw channel:

    coupling channel:

    lfe channel:

    2).计算PSD:

    将decode出来的exponent map成13 bit的PSD,每个频率点都计算一个PSD,所以计算出来的PSD是细粒度的.

    exponent的范围为0~24,PSD的范围为0~3272.0表示lowest level signal, 3272表示highest level signal.

     3)PSD integration:

    将256个频率点分为50个band,对每个band内的PSD 进行integration.

    band structure如下,bandtab表示当前band中第一个mantissa(or频率系数)的index,bandsz表示当前band中有多少个mantissa。

    每个mantissa可以map到对应的band中,masktab描述了这种map关系。

    PSD integration采用log-addition的在每个band内进行,log-additon的结果是先计算两个参数的差值,然后用差值查表latab得到:

     4) 计算exciting function

    利用encode选择的prototype masking curve(从bitstream中解码出来)和integrated PSD计算exicting fuction,计算的结果是integrated PSD 减去fgain or sgain.

    计算过程如下:

    其中sdecay表示prototye masking curve的slow decay线段每个band衰减的值,通过bitstream中的信息查表获得.

    当前band的PSD的幅值减去slow decay线段与当前PSD的交点的幅值即为sgain。因此sgain和sdecay就可以描述slow decay线段。

     5)计算masking curve.

    根据exciting function和人耳听觉threshold计算masking (noise level threshold) curve,即取exciting function和人耳听觉threshold的较大值作为noise level threshold.

     6)计算bit allocation

    masking curve首先根据snroffset做调整后,用细粒度的PSD减去masking curver的差值左移5 bit的结果查找baptab得到bap。

    在一个frame内的所有channel的mantissa的bit allocation受限于encoder端,在encoder基于csnroffset,fsnroffset通过不断迭代产生合适的结果以保证在decoder接收到的bit allocation 满足固定的bitrate.

    bap是一个数组,包含一系列4bit的pointer,标识每个mantissa的bit数。

  • 相关阅读:
    struts2标签解释
    通过注册表修改XP默认登陆用户
    6类常见开机故障
    摩尔定律
    小红伞扫描病毒类型
    newInstance()方法和new关键字
    常见恶意软件种类及说明
    jquery1.9 中这些方法已经被删除(live、die、sub........)
    (转)Ubuntu下JDK7安装全过程并调试第一个带包的java程序
    js取消气泡事件、阻止浏览器的默认行为
  • 原文地址:https://www.cnblogs.com/fellow1988/p/8810959.html
Copyright © 2011-2022 走看看