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数。

  • 相关阅读:
    .net core 基于IIS发布
    所有开源播放器
    JWT的相关讲解
    .NET Core2.0 使用EF做数据操作
    任意的组合,数组或数组,数组或list,list或list不用循环得出匹配的总数和需要的字段列
    linq to sql学习
    winform文本框怎么实现html的placeholder效果
    [数据结构]-单链表实现栈
    [数据结构]-数组实现栈
    [数据结构]-单链表
  • 原文地址:https://www.cnblogs.com/fellow1988/p/8810959.html
Copyright © 2011-2022 走看看