亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? pmp2dec.c

?? 瑞星微公司RK27XX系列芯片的SDK開發包
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* Copyright (C) 2007 ROCK-CHIPS FUZHOU . All Rights Reserved. */
/*
File : \Audio\MP2Dec\
Desc : MP2解碼。

Author : FSH , Vincent Hisung
Date : 2007-08-xx
Notes :

$Log :
* FSH               2007/06/01 建立此文件
*
* vincent            2007/08/xx
*
*/
/****************************************************************/

#include "../include/audio_main.h"

#ifdef MP2_INCLUDE
#include "../include/audio_globals.h"
#include "include.h"

#include "MP2DEC_Instance.h"
#include "MP2DEC.h"

#include "../include/file_access.h"
#include "pMP2Dec_lib.h"

extern stID3V2XInfoType ID3V2XInfo;
static long OutLength;

extern unsigned int CheckID3V2Tag(unsigned char *pucBuffer);

F_MP2DEC0 *InitMP2Aud = RKInitMP2Audio;
F_MP2DEC1 *MP2SyncHeader = RKMP2DECSearchForSyncword;
//普通MP2解碼
F_MP2DEC2 *MP2DecData = (F_MP2DEC2 *)RKMP2DecodeData;
//DAB的MP2解碼
//F_MP2DEC2 *MP2DecData = (F_MP2DEC2 *)RKMP2DecodeData_DAB;

//****************************************************************************
//
// The codec plug-in entry point for the MP2 decoder.
//
//****************************************************************************
//功能實現情況:
//SUBFN_CODEC_GETNAME  :   不支持
//SUBFN_CODEC_GETARTIST:   不支持
//SUBFN_CODEC_GETTITLE :   不支持
//SUBFN_CODEC_GETBITRATE:  得到碼率
//SUBFN_CODEC_GETSAMPLERATE: 得到采樣率
//SUBFN_CODEC_GETCHANNELS: 得到聲道數目
//SUBFN_CODEC_GETLENGTH :  得到時長 [單位:毫秒]
//SUBFN_CODEC_GETTIME  :   得到當前播放時間 [單位:毫秒]
//SUBFN_CODEC_OPEN_DEC :   打開解碼器(初始化)
//SUBFN_CODEC_DECODE   :   解碼
//SUBFN_CODEC_ENCODE   :   不支持
//SUBFN_CODEC_SEEK     :   按時間直接定位 [單位:毫秒]
//SUBFN_CODEC_CLOSE    :   關閉解碼器
/******************************************************
Name:  MP2DecFunction
Desc:  MP2解碼器接口函數
Param: ulIoctl 子功能號
    ulParam1 子功能參數1
    ulParam2 子功能參數2
    ulParam3 子功能參數3
    ulParam4 子功能參數4

Return: 0-失敗 1-成功
Global: 無
Note: 無
Author: FSH
Log:
******************************************************/
unsigned long
MP2Function(unsigned long ulSubFn, unsigned long ulParam1, unsigned long ulParam2,
            unsigned long ulParam3, unsigned long ulParam4)
{
    // Determine what to do based on the specified IOCTL.
    unsigned int WaitCounter;

    switch (ulSubFn)
    {
            // Return the bitrate at which this file is encoded.
        case SUBFN_CODEC_GETBITRATE:
            {
                unsigned long *pulBitRate;
                tMP2 *pMP2;

                // The first parameter is a pointer to the MP2 persistent data.
                pMP2 = (tMP2 *)ulParam1;

                // The second parameter is a pointer for the bitrate.
                pulBitRate = (unsigned long *)ulParam2;

                // Return the average bitrate of the file.
                *pulBitRate = pMP2->ulBitRate;

                // Success.
                return(1);
            }

            // Return the sample rate at which this file is encoded.
        case SUBFN_CODEC_GETSAMPLERATE:
            {
                unsigned long *pulSampleRate;
                tMP2 *pMP2;

                // The first parameter is a pointer to the MP2 persistent data.
                pMP2 = (tMP2 *)ulParam1;

                // The second parameter is a pointer for the sample rate.
                pulSampleRate = (unsigned long *)ulParam2;

                // Return the sample rate of the file.
                *pulSampleRate = pMP2->usSampleRate;

                // Success.
                return(1);
            }

        case SUBFN_CODEC_GETCAPTUREBUFFER:
            {
                tMP2 *pMP2;
                short **ppsBuffer;
                long *plLength;

                pMP2 = (tMP2 *)ulParam1;

                if (pMP2->ucChannels == 2)
                {
                    *(unsigned long *)ulParam2 = (unsigned long)pMP2->psLeft;
                    *(unsigned long *)ulParam3 = (unsigned long)pMP2->psRight;
                }
                else
                {
                    *(unsigned long *)ulParam2 = (unsigned long)pMP2->psLeft;
                    *(unsigned long *)ulParam3 = (unsigned long)pMP2->psLeft;
                }
                *(unsigned long *)ulParam4 = (unsigned long)OutLength;

                //success
                return(1);
            }

            // Return the number of channels in the file.
        case SUBFN_CODEC_GETCHANNELS:
            {
                unsigned long *pulChannels;
                tMP2 *pMP2;

                // The first parameter is a pointer to the MP2 persistent data.
                pMP2 = (tMP2 *)ulParam1;

                // The second parameter is a pointer for the number of channels.
                pulChannels = (unsigned long *)ulParam2;

                // Return the number of channels in the file.
                *pulChannels = pMP2->ucChannels;

                // Success.
                return(1);
            }

            // Return the length (in milliseconds) of the file.
        case SUBFN_CODEC_GETLENGTH:
            {
                unsigned long *pulLength;
                tMP2 *pMP2;

                // The first parameter is a pointer to the MP2 persistent data.
                pMP2 = (tMP2 *)ulParam1;

                pulLength = (unsigned long *)ulParam2;

                // Return the length of the file.
                *pulLength = pMP2->ulTimeLength;

                // Success.
                return(1);
            }

            // Return the current position (in milliseconds) within the file.
        case SUBFN_CODEC_GETTIME:
            {
                unsigned long *pulTime;
                tMP2 *pMP2;

                // The first parameter is a pointer to the MP2 persistent data.
                pMP2 = (tMP2 *)ulParam1;

                // The second parameter is a pointer for the number of seconds.
                pulTime = (unsigned long *)ulParam2;

                if (pMP2->usSampleRate == 0) return(0);

                // Determine the time based on the sample rate.
                *pulTime = ((pMP2->ulTimePos / pMP2->usSampleRate) * 1000) +
                           (((pMP2->ulTimePos % pMP2->usSampleRate) * 1000) /
                            pMP2->usSampleRate);

                // Success.
                return(1);
            }

            // Prepare the codec to encode or decode a file.
        case SUBFN_CODEC_OPEN_DEC:
            {
                tMP2 *pMP2;
                unsigned short count;

                // The first parameter is a pointer to the MP2 persistent state.
                pMP2 = (tMP2 *)ulParam1;

                // Determine the pointer to the MP2 decoder library's persistent
                // state.  This pointer must be aligned on a 2K byte boundary.
                pMP2->pMPEGInstance = (tMP2Instance *)(((unsigned long)pMP2 +
                                                        sizeof(tMP2) + 4) & 0xfffffffc);

                // Initialize the MP2 library.
                InitMP2Aud(pMP2->pMPEGInstance, (unsigned char *)pENCODED_DATA);
                memset(pMP2->psLeft, 0, (MP2_PCM_BUFFER_SIZE)*2);
                memset(pMP2->psRight, 0, (MP2_PCM_BUFFER_SIZE)*2);

                // Save the position of the beginning of the file.
                pMP2->ulFirstFrame = GetFirstFrame_MP2((unsigned char *)pENCODED_DATA);

                // Get the length of the file.
                pMP2->ulLength = (unsigned long)RKFIO_FLength(pRawFileCache) - pMP2->ulFirstFrame;

                // Decode the ID3 tag if it is present.
                //MP2DecodeID3Tag(pMP2);

                // Initialize the bitstream.
                MP2InitBitstream(pMP2, pMP2->ulFirstFrame);

                // Find the first frame of the file.
                count = 0;

                while (MP2FindNextFrame(pMP2) == 0)
                {
                    count += 1;

                    if (count > 1024) return (0);
                }

                // Get the sample rate of the file.
                pMP2->usSampleRate = usSRMap2[pMP2->sHdr.sample_rate];

                // Get the number of channels in the file.
                pMP2->ucChannels = pMP2->sHdr.numchans;

                // Attempt to decode the VBR header.
                if (MP2DecodeVBRHeader(pMP2) == 0)
                {
                    // There is no VBR header on this file, so get the actual
                    // bitrate from the sync header.
                    pMP2->ulBitRate = usBRMap2[((pMP2->sHdr.packed_info & 0x00080000) >> 15) |
                                               ((pMP2->sHdr.packed_info & 0x0000f000) >> 12)] * 1000;
                    // If no bitrate is specified, then return an error.
                    if (pMP2->ulBitRate == 0)
                    {
                        return(0);
                    }

                    // Indicate that this is not a VBR file.
                    pMP2->ucIsVBR = 0;
                }

                if (pMP2->ulBitRate == 0) return(0);


                // Get the length of the file.
                pMP2->ulTimeLength = (((pMP2->ulLength * 8) / pMP2->ulBitRate) * 1000) +
                                     ((((pMP2->ulLength * 8) % pMP2->ulBitRate) * 1000) /
                                      pMP2->ulBitRate);

                // Re-initialize the bitstream pointer structure.
                MP2InitBitstream(pMP2, pMP2->ulFirstFrame);

                // The position is zero.
                pMP2->ulTimePos = 0;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产亚洲欧美日韩日本| a4yy欧美一区二区三区| 一区二区三区在线观看视频| 日本一区二区高清| 欧美国产精品中文字幕| 国产精品无码永久免费888| 欧美激情中文不卡| 亚洲天堂2014| 午夜精品福利一区二区三区蜜桃| 一个色综合网站| 午夜视频在线观看一区二区三区| 视频在线观看91| 国产一区二区福利视频| 大桥未久av一区二区三区中文| 国产精品亚洲人在线观看| 国产成a人亚洲| 欧美午夜在线观看| 精品粉嫩aⅴ一区二区三区四区 | 精品国产伦一区二区三区观看方式 | 欧美成人国产一区二区| 26uuu久久天堂性欧美| 国产精品嫩草久久久久| 亚洲精品国产无天堂网2021| 日韩精品免费专区| 国产美女娇喘av呻吟久久| 91丨九色porny丨蝌蚪| 欧美精品一卡两卡| 欧美激情一区二区三区四区| 一区二区在线观看视频 | 国产成人av一区| 在线一区二区三区做爰视频网站| 91麻豆精品国产91久久久 | 亚洲与欧洲av电影| 狠狠狠色丁香婷婷综合激情 | 日韩主播视频在线| 粉嫩一区二区三区性色av| 欧美日韩成人高清| 1区2区3区欧美| 久久爱另类一区二区小说| 99视频在线精品| 久久伊99综合婷婷久久伊| 一区二区三区视频在线看| 国产一区久久久| 色屁屁一区二区| 国产女人水真多18毛片18精品视频| 一区二区成人在线| 成人精品一区二区三区四区 | 婷婷久久综合九色综合绿巨人| 国产精品一区三区| 欧美一区二区大片| 亚洲综合精品久久| av一区二区不卡| 欧美国产1区2区| 韩国视频一区二区| 日韩视频免费观看高清完整版在线观看 | 国产成人免费9x9x人网站视频| 欧美日韩美少妇| 亚洲香蕉伊在人在线观| 91在线国产福利| 国产欧美精品一区二区色综合朱莉| 裸体健美xxxx欧美裸体表演| 在线欧美小视频| 亚洲丝袜精品丝袜在线| 国产不卡视频一区| 久久久激情视频| 久久精品国产精品亚洲综合| 欧美一区二区三区男人的天堂| 亚洲午夜精品17c| 色偷偷成人一区二区三区91| 国产精品女主播在线观看| 国产乱淫av一区二区三区| 日韩欧美国产小视频| 日韩电影在线观看电影| 777精品伊人久久久久大香线蕉| 中文字幕在线一区| 91亚洲永久精品| 久久久91精品国产一区二区三区| 精品一二三四区| 日韩一区二区在线看| 免费精品视频最新在线| 欧美一区二区精品在线| 蜜桃在线一区二区三区| 亚洲精品一区二区三区精华液| 欧美a级一区二区| 日韩欧美不卡一区| 国产乱人伦精品一区二区在线观看 | 国产乱子轮精品视频| 久久亚洲一区二区三区四区| 激情综合网激情| 国产午夜亚洲精品羞羞网站| 大陆成人av片| 亚洲在线成人精品| 日韩一级视频免费观看在线| 极品少妇xxxx偷拍精品少妇| 国产亚洲欧洲一区高清在线观看| 成人禁用看黄a在线| 亚洲一二三四区不卡| 日韩欧美视频一区| 99麻豆久久久国产精品免费优播| 一区二区三区欧美亚洲| 日韩欧美国产一二三区| 成人av片在线观看| 自拍偷拍国产亚洲| 欧美日韩成人在线| 国产麻豆欧美日韩一区| 一区二区三区自拍| 精品久久五月天| 91免费在线视频观看| 强制捆绑调教一区二区| 中文字幕第一页久久| 欧美三级中文字| 国产一区二区视频在线播放| 亚洲免费伊人电影| 欧美第一区第二区| 欧美少妇xxx| 成人中文字幕合集| 日韩电影在线一区二区三区| 亚洲欧美影音先锋| 精品国产伦一区二区三区免费| 在线国产电影不卡| 国产乱码精品一区二区三区五月婷| 亚洲黄色尤物视频| 国产精品久久影院| 日韩欧美成人激情| 欧美亚洲动漫精品| 成人福利电影精品一区二区在线观看| 亚洲一二三区视频在线观看| 欧美激情一区二区三区四区| 制服丝袜国产精品| 91电影在线观看| www.爱久久.com| 久久国产人妖系列| 亚洲国产日韩精品| 亚洲色图一区二区三区| 久久九九久精品国产免费直播| 欧美日韩精品综合在线| thepron国产精品| 国产一区二区福利视频| 捆绑调教美女网站视频一区| 一区二区高清在线| 亚洲精品v日韩精品| 亚洲蜜臀av乱码久久精品蜜桃| 国产天堂亚洲国产碰碰| 欧美大片国产精品| 日韩欧美国产精品一区| 91精品国产全国免费观看| 91丨porny丨中文| 在线一区二区观看| 在线观看成人小视频| 91在线码无精品| 色激情天天射综合网| 一本大道综合伊人精品热热| 99精品欧美一区二区蜜桃免费| 99热国产精品| 在线精品亚洲一区二区不卡| 色综合久久九月婷婷色综合| 91麻豆国产福利精品| 在线精品视频小说1| 欧美另类久久久品| 精品裸体舞一区二区三区| 久久久www成人免费无遮挡大片| 久久精品一区二区| 国产精品每日更新| 亚洲黄色免费网站| 青青草伊人久久| 激情六月婷婷久久| 成人成人成人在线视频| 色综合中文字幕国产 | 亚洲一区二区三区在线看| 亚洲在线免费播放| 视频精品一区二区| 久久国产精品无码网站| 国产成a人无v码亚洲福利| 91美女片黄在线| 精品视频999| 精品国产乱码91久久久久久网站| 久久久久久久久99精品| 亚洲欧洲日韩综合一区二区| 亚洲一本大道在线| 久久91精品国产91久久小草| 成人黄色大片在线观看| 欧美色欧美亚洲另类二区| 欧美xxxxx裸体时装秀| 中文字幕一区二区三区不卡在线 | 成人午夜av电影| 日本韩国精品在线| 欧美电影免费提供在线观看| 亚洲国产高清在线观看视频| 一区二区三区国产精华| 麻豆精品在线看| 91丨国产丨九色丨pron| 精品久久久久久久久久久院品网| 成人欧美一区二区三区在线播放| 久久精品噜噜噜成人av农村| 盗摄精品av一区二区三区| 91精品国产综合久久久久久久 | 九一久久久久久| 日本道在线观看一区二区| 精品久久久久久最新网址| 亚洲精品v日韩精品|