




已阅读5页,还剩6页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
VPP Audio Jpeg Decoder Specification(Version 1.1)version author Date Description 1.0 Xu Mingliang10/December/07Preliminary version 1.1 Xu Mingliang25/April/08Update the Code mapping for MP3+MJPEG. Overview3II. VPP Audio Jpeg Decoder API4II.1. API Types4II.2. API Variables6II.3. API Constant tables7II.4. API Functions8III. VPP Audio Jpeg Decoder Assembly Code9III.1. Code Mapping9III.2. Code Main10. OverviewTHE VoC processing package (VPP) is composed of different processing functions written in VoC assembly and running on the VoC module (Coolsands proprietary 16/32 bit data DSP core).This document describes the Audio(AAC MP3 AMR) and Jpeg decoder of VPP.II. VPP Audio Jpeg Decoder APIII.1. API TypesInput Parameterstypedef structINT16 mode; INT16 reset;INT32* inStreamBufAddr; INT32* outStreamBufAddr; INT16 EQ_Type; INT16 zoom_mode; vpp_AudioJpeg_DEC_IN_T;Output Parameterstypedef struct INT16 mode; INT16 nbChannel; INT32 output_len; INT32 SampleRate;INT16 BitRate;INT16 consumedLen; INT16 streamStatus; INT16 ErrorStatus;INT16 ImgWidth; INT16 ImgHeight; vpp_AudioJpeg_DEC_OUT_T;Stream Statustypedef enum / continue normally vpp_AudioJpeg_DEC_STREAM_CONTINUE = 0x0000, / stop decoding normally vpp_AudioJpeg_DEC_STREAM_STOP = 0x0010, / stop decoding and signal an error vpp_AudioJpeg_DEC_STREAM_BREAK = 0x0011, / ignore the current frame vpp_AudioJpeg_DEC_STREAM_IGNORE = 0x0020 vpp_AudioJpeg_DEC_STREAM_STATUS;Driver Error Types(only the errors used in the VoC driver are listed)typedef enumHAL_ERR_NO,HAL_ERR_RESOURCE_RESET,HAL_ERR_RESOURCE_BUSY,HAL_ERR_RESOURCE_TIMEOUT,HAL_ERR_RESOURCE_NOT_ENABLED, HAL_ERR_T;ErrorStatustypedef enum ERR_AAC_NONE = 0,ERR_AAC_INDATA_UNDERFLOW = -1,ERR_AAC_NULL_POINTER = -2,ERR_AAC_INVALID_ADTS_HEADER = -3,ERR_AAC_INVALID_ADIF_HEADER = -4,ERR_AAC_INVALID_FRAME = -5,ERR_AAC_MPEG4_UNSUPPORTE = -6,ERR_AAC_CHANNEL_MAP = -7,ERR_AAC_SYNTAX_ELEMENT = -8,ERR_AAC_DEQUANT = -9,ERR_AAC_STEREO_PROCESS = -10,ERR_AAC_PNS = -11,ERR_AAC_SHORT_BLOCK_DEINT = -12,ERR_AAC_TNS = -13,ERR_AAC_IMDCT = -14,ERR_AAC_NCHANS_TOO_HIGH = -15,ERR_AAC_SBR_INIT = -16,ERR_AAC_SBR_BITSTREAM = -17,ERR_AAC_SBR_DATA = -18,ERR_AAC_SBR_PCM_FORMAT = -19,ERR_AAC_SBR_NCHANS_TOO_HIGH = -20,ERR_AAC_SBR_SINGLERATE_UNSUPPORTED = -21,ERR_AAC_RAWBLOCK_PARAMS = -22,ERR_MODE = -23,ERR_UNKNOWN = -9999VPP_AAC_DEC_ERR_Status;Mode typetypedef enum MP3_ENCODE = 0,MP3_DECODE,AMR_ENCODE,AMR_DECODE,MJPEG_ENCODE,MJPEG_DECODE,WMA_ENCODE,WMA_DECODE, AAC_ENCODE,AAC_DECODECodecmode;II.2. API VariablesThe configuration and data exchange between the Service layer and the VPP Audio Jpeg decoder is done by means of dedicated structures read/written inside a different VPP Audio Jpeg Decoder API function. Type Location IO Meaning Input ParametersmodeVoC RAMinCodec mode.resetVoC RAMinGlobal VPP AAC decoder reset, active 1. It should be automatically cleared by the VPP code.inStreamBufAddrVoC RAMinInput stream buffer address.outStreamBufAddrVoC RAMinOutput stream buffer address.EQ_TypeVoC RAMinEQ controller (used by mp3 only).zoom_modeVoC RAMinZoom controller(used by jpeg only).Output ParametersmodeVoC RAMoutAAC decoder mode.nbChannelVoC RAMoutNumber of channels.output_lenVoC RAMoutSize of the output PCM frame.(bytes).SampleRateVoC RAMoutSampleRate.BitRateVoC RAMoutBitRate.consumedLenVoC RAMoutSize of the consumed data since last frame.streamStatusVoC RAMoutStream Status.ErrorStatusVoC RAMoutError status.ImgWidthVoC RAMoutImage width(used by jpeg decoder only).ImgHeightVoC RAMoutImage height(used by jpeg decoder only).II.3. API Constant tablesThese are the constant tables containing the VoC Assembly code of the VPP Audio and Jpeg decoder and the related Audio and Jpeg decoder constants placed in the data RAMs and DMA data.Index Section pointer Loaded in0G_VppCommonDecCodeRAM_I 1G_VppAacDecCodeRAM_I by DMA in VoC program2G_VppAacDecConstYRAM_Y by DMA in VoC program3G_VppMp3DecCodeRAM_I by DMA in VoC program4G_VppMp3DecConstXRAM_X by DMA in VoC program5G_VppMp3DecConstYRAM_Y by DMA in VoC program6G_VppAmrJpegDecCodeRAM_I by DMA in VoC program7G_VppAmrJpegDecConstXRAM_X by DMA in VoC program8G_VppAmrJpegDecConstYRAM_Y by DMA in VoC program9G_VppAacDecHuffTabSpecRAM_Y by DMA in VoC program10G_VppAacDecCos4sin4tabRAM_Y by DMA in VoC program11G_VppAacDecTwidTabOddRAM_Y by DMA in VoC program12G_VppAacDecSinWindowRAM_Y by DMA in VoC program13G_VppAacDecKbdWindowRAM_Y by DMA in VoC programII.4. API FunctionsHAL_ERR_T vpp_AudioJpegDecOpen(HAL_VOC_IRQ_HANDLER_T vocIrqHandler);Initiate all VPP Audio Jpeg Decoder variables of the AudioJpeg_DEC_IN_T structure. Reset the the VPP Audio and Jpeg Decoder (the flag is automatically cleared by the VPP code). Initiate the external DMA address.void vpp_AudioJpegDecClose(void);Close the VPP Audio Jpeg Decoder.void vpp_AudioJpegDecStatus(vpp_AudioJpeg_DEC_OUT_T * pDecStatus);This function will read the decoder status (valid at interrupt generation) for parameter output.HAL_ERR_T vpp_AudioJpegDecScheduleOneFrame(vpp_AudioJpeg_DEC_IN_T *pVoc_Voc_AudioDecIN);Fill in variables of the AudioJpeg_DEC_IN_T structure. Start the decoding.III. VPP Audio Jpeg Decoder Assembly CodeIII.1. Code MappingThe code is composed of one two sections. Code reload mechanism is necessary.The code is composed of one two sections. Code reload mechanism is necessary.As VoC does not have a cache and as the code is too big to fit in the Instruction RAM of the VoC(RAM_I), the code needs to be split into modes, each mode being composed of several code sections.The sections are split into categories: DECODER COMMON CODE: used by all Audio and JPEG decoder. MP3 DECODER LAYER3: specific to MP3 layer3 decoder mode. LAYER1: specific to MP3 layer1 decoder mode. LAYER2: specific to MP3 layer2 decoder mode. AAC DECODER: specific to MP3 decoder mode. AMR DECODER: specific to AMR decoder modes.JPEG DECODER: specific to JPEG decoder modes.The images of the different sections are compiled in the C code. The code pointers of the function of the VoC binary code images are initialized in the vpp_AudioJpegDecOpen function.DECODER COMMON CODEMP3 DECODERLAYER3AMR ECODERCommon section endAAC or JPEG section startFigure 1. VoC code memory map structure for the VPP AudioJPEG DecoderJPEG DECODERJPEG section endMP3 or AMR section startAAC DECODERLAYER1LAYER2III.2. Code MainThe main entry should consist of an infinite loop with a sleep that wakes on the sof0 event:void Coolsand_AudioDecode_MAIN(void)/ Init : clear all pending statusVoC_cfg_lg(CFG_WAKEUP_ALL,CFG_WAKEUP_STATUS);AudioDecode_MAIN_L0:/ Enable the SOF0 event onlyVoC_cfg_lg(CFG_WAKEUP_SOF0,CFG_WAKEUP_MASK);/ Stall the execution and generate an interruptVoC_cfg(CFG_CTRL_STALL|CFG_CTRL_IRQ_TO_XCPU);/ VoC_directive: PARSER_OFF/ used for simulationVoC_cfg_stop;/ VoC_directive: PARSER_ONVoC_NOP();VoC_NOP();/ Here the execution is woken upVoC_lw16i(SP16,SP_16_ADDR);VoC_lw16i(SP32,SP_32_ADDR);/ Clear all pending statusVoC_cfg_lg(CFG_WAKEUP_ALL,CFG_WAKEUP_STATUS);/ Disable the SOF0 event, enable DMAI event.VoC_cfg_lg(CFG_WAKEUP_DMAI,CFG_WAKEUP_MASK);VoC_lw16_d(REG0,Input_mode_addr);VoC_be16_rd(AudioDecode_MAIN_L2,REG0,Output_mode_addr);VoC_jal(Coolsand_VoC_code_reload);AudioDecode_MAIN_L2:/ jal to the main codeVoC_lw16i_short(REG1,0x10,DEFAULT);/VPP_AAC_DEC_STREAM_STOP;VoC_lw16i_short(REG3,-23,IN_PARALLEL); VoC_lw16_d(REG0,Input_mode_addr);VoC_lw16i_short(REG6,9,DEFAULT);VoC_lw16i_short(REG7,1,IN_PARALLEL);VoC_sw16_d(REG0,Output_mode_addr); VoC_bne16_rr(AudioDecode_MAIN_MP3,REG0
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 快乐成长小班教育的未来展望计划
- 2025年软考更改后的复习要点试题及答案
- 优化招聘流程的策略与实施计划
- 优化资源配置的年度工作计划
- 为法学概论加分的试题及答案
- 2024年黑龙江建华区公益性岗位招聘笔试真题
- 2024年安徽相山水泥公司招聘笔试真题
- 法学概论考试形式与内容的结合研究试题及答案
- 软件设计师常考技能解析与试题及答案
- 河南省新乡市部分重点中学2025届七下数学期末统考模拟试题含解析
- SWOT分析法很全面课件
- 膀胱造瘘的护理课件
- 基坑工程施工验收记录表
- 消防应急疏散演练人员签到表(标准通用版)
- 微生物实验室病原微生物评估报告
- 陕旅版五年级英语上册句型词汇知识点总结
- 汉字构字的基本原理和识字教学模式分析
- RouterOS介绍
- 十字轴锻造成型工艺及模具设计毕业论文
- 主体结构监理实施细则范本
- 控制性详细规划 - 宁波市规划局
评论
0/150
提交评论