当前位置: 首页>>代码示例>>C#>>正文


C# Header.bitrate_index方法代码示例

本文整理汇总了C#中Header.bitrate_index方法的典型用法代码示例。如果您正苦于以下问题:C# Header.bitrate_index方法的具体用法?C# Header.bitrate_index怎么用?C# Header.bitrate_index使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Header的用法示例。


在下文中一共展示了Header.bitrate_index方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: prepare_sample_reading

        /// <summary>
        ///     *
        /// </summary>
        protected internal virtual void prepare_sample_reading(Header header, int allocation, int channel,
            float[] factor, int[] codelength, float[] c, float[] d)
        {
            int channel_bitrate = header.bitrate_index();
            // calculate bitrate per channel:
            if (header.mode() != Header.SINGLE_CHANNEL)
                if (channel_bitrate == 4)
                    channel_bitrate = 1;
                else
                    channel_bitrate -= 4;

            if (channel_bitrate == 1 || channel_bitrate == 2)
            {
                // table 3-B.2c or 3-B.2d
                groupingtable[channel] = table_cd_groupingtables[allocation];
                factor[0] = table_cd_factor[allocation];
                codelength[0] = table_cd_codelength[allocation];
                c[0] = table_cd_c[allocation];
                d[0] = table_cd_d[allocation];
            }
            else
            {
                // tables 3-B.2a or 3-B.2b
                if (subbandnumber <= 2)
                {
                    groupingtable[channel] = table_ab1_groupingtables[allocation];
                    factor[0] = table_ab1_factor[allocation];
                    codelength[0] = table_ab1_codelength[allocation];
                    c[0] = table_ab1_c[allocation];
                    d[0] = table_ab1_d[allocation];
                }
                else
                {
                    groupingtable[channel] = table_ab234_groupingtables[allocation];
                    if (subbandnumber <= 10)
                    {
                        factor[0] = table_ab2_factor[allocation];
                        codelength[0] = table_ab2_codelength[allocation];
                        c[0] = table_ab2_c[allocation];
                        d[0] = table_ab2_d[allocation];
                    }
                    else if (subbandnumber <= 22)
                    {
                        factor[0] = table_ab3_factor[allocation];
                        codelength[0] = table_ab3_codelength[allocation];
                        c[0] = table_ab3_c[allocation];
                        d[0] = table_ab3_d[allocation];
                    }
                    else
                    {
                        factor[0] = table_ab4_factor[allocation];
                        codelength[0] = table_ab4_codelength[allocation];
                        c[0] = table_ab4_c[allocation];
                        d[0] = table_ab4_d[allocation];
                    }
                }
            }
        }
开发者ID:clashbyte,项目名称:openvice,代码行数:61,代码来源:SubbandLayer2.cs

示例2: get_allocationlength

        /// <summary>
        ///     *
        /// </summary>
        protected internal virtual int get_allocationlength(Header header)
        {
            if (header.version() == Header.MPEG1)
            {
                int channel_bitrate = header.bitrate_index();

                // calculate bitrate per channel:
                if (header.mode() != Header.SINGLE_CHANNEL)
                    if (channel_bitrate == 4)
                        channel_bitrate = 1;
                    else
                        channel_bitrate -= 4;

                if (channel_bitrate == 1 || channel_bitrate == 2)
                    // table 3-B.2c or 3-B.2d
                    if (subbandnumber <= 1)
                        return 4;
                    else
                        return 3;
                // tables 3-B.2a or 3-B.2b
                if (subbandnumber <= 10)
                    return 4;
                if (subbandnumber <= 22)
                    return 3;
                return 2;
            }
            // MPEG-2 LSF -- Jeff

            // table B.1 of ISO/IEC 13818-3
            if (subbandnumber <= 3)
                return 4;
            if (subbandnumber <= 10)
                return 3;
            return 2;
        }
开发者ID:clashbyte,项目名称:openvice,代码行数:38,代码来源:SubbandLayer2.cs


注:本文中的Header.bitrate_index方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。