Part Number Hot Search : 
HFMD1485 X9511WP IRG4BC RN4910 AK452 223J1000 TC211706 150150
Product Description
Full Text Search
 

To Download USAB17AP77016-XXX-B17 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  sap77016-b17 aac audio encoder middleware document no. u16314ej1v0um00 (1st edition) date published january 2003 ns cp(n) printed in japan 2003 user?s manual target device pd77110 pd77113a pd77114 pd77115 pd77210 pd77213
user?s manual u16314ej1v0um 2 [memo]
user?s manual u16314ej1v0um 3 windows is either a registered trademark or a trademark of microsoft corporation in the united states and/or other countries. the information in this document is current as of january, 2003. the information is subject to change without notice. for actual design-in, refer to the latest publications of nec electronics data sheets or data books, etc., for the most up-to-date specifications of nec electronics products. not all products and/or types are available in every country. please check with an nec electronics sales representative for availability and additional information. no part of this document may be copied or reproduced in any form or by any means without the prior written consent of nec electronics. nec electronics assumes no responsibility for any errors that may appear in this document. nec electronics does not assume any liability for infringement of patents, copyrights or other intellectual property rights of third parties by or arising from the use of nec electronics products listed in this document or any other liability arising from the use of such products. no license, express, implied or otherwise, is granted under any patents, copyrights or other intellectual pr operty rights of nec electronics or others. descriptions of circuits, software and other related information in this document are provided for illustrative purposes in semiconductor product operation and application examples. the incorporation of these circuits, software and information in the design of a customer's equipment shall be done under the full responsibility of the customer. nec electronics assumes no responsibility for any losses incurred by customers or third pa rties arising from the use of these circuits, software and information. while nec electronics endeavors to enhance the quality, reliability and safety of nec ele ctronics products, customers agree and acknowledge that the possibility of defects thereof cannot be eliminated entirely. to minimize risks of damage to property or injury (including death) to persons arising from defects in nec electronics products, customers must incorporate sufficient safety measures in their design, such as redundancy, fire-containment and anti-failure features. nec electronics products are classified into the following three quality grades: "standard", "special" and "specific". the "specific" quality grade applies only to nec electronics products developed based on a customer- designated "quality assurance program" for a specific application. the recommended applications of an nec electronics product depend on its quality grade, as indicated below. customers must check the quality grade of each nec electronics product before using it in a pa rticular application. the quality grade of nec electronics products is "standard" unless otherwise expressly specified in nec electronics data sheets or data books, etc. if cust omers wish to use nec electronics products in applications not intended by nec electronics, they must contact an nec electronics sales representative in advance to determine nec electronics' willingness to support a given application. (note) ? ? ? ? ? ? m8e 02. 11-1 (1) (2) "nec electronics" as used in this statement means nec electronics corporation and also includes its majority-owned subsidiaries. "nec electronics products" means any product developed or manufactured by or for nec electronics (as defined above). computers, office equipment, communications equipment, test and measurement equipment, audio and visual equipment, home electronic appliances, machine tools, personal electronic equipment and industrial robots. transportation equipment (automobiles, trains, ships, etc.), traffic control systems, anti-disaster systems, anti-crime systems, safety equipment and medical equipment (not specifically designed for life support). aircraft, aerospace equipment, submersible repeaters, nuclear reactor control systems, life support systems and medical equipment for life support, etc. "standard": "special": "specific":
user ? s manual u16314ej1v0um 4 regional information ? device availability ? ordering information ? product release schedule ? availability of related technical literature ? development environment specifications (for example, specifications for third-party tools and components, host computers, power plugs, ac supply voltages, and so forth) ? network requirements in addition, trademarks, registered trademarks, export restrictions, and other legal issues may also vary from country to country. nec electronics america, inc. (u.s.) santa clara, california tel: 408-588-6000 800-366-9782 fax: 408-588-6130 800-729-9288 nec electronics hong kong ltd. hong kong tel: 2886-9318 fax: 2886-9022/9044 nec electronics hong kong ltd. seoul branch seoul, korea tel: 02-528-0303 fax: 02-528-4411 nec electronics shanghai, ltd. shanghai, p.r. china tel: 021-6841-1138 fax: 021-6841-1137 nec electronics taiwan ltd. taipei, taiwan tel: 02-2719-2377 fax: 02-2719-5951 nec electronics singapore pte. ltd. novena square, singapore tel: 6253-8311 fax: 6250-3583 j02.11 nec electronics (europe) gmbh duesseldorf, germany tel: 0211-65 03 01 fax: 0211-65 03 327  sucursal en espa ? a madrid, spain tel: 091-504 27 87 fax: 091-504 28 60 v lizy-villacoublay, france tel: 01-30-67 58 00 fax: 01-30-67 58 99  succursale fran ? aise  filiale italiana milano, italy tel: 02-66 75 41 fax: 02-66 75 42 99  branch the netherlands eindhoven, the netherlands tel: 040-244 58 45 fax: 040-244 45 80  tyskland filial taeby, sweden tel: 08-63 80 820 fax: 08-63 80 388  united kingdom branch milton keynes, uk tel: 01908-691-133 fax: 01908-670-290 some information contained in this document may vary from country to country. before using any nec electronics product in your application, piease contact the nec electronics office in your country to obtain a list of authorized representatives and distributors. they will verify:
user ? s manual u16314ej1v0um 5 preface target readers this manual is for users who design and develop pd77016 family application systems. pd77016 family is the generic name for the pd7701x family ( pd77015, 77016, 77017, 77018, 77018a, 77019), the pd77111 family ( pd77110, 77111, 77112, 77113a, 77114, 77115) and the pd77210 family ( pd77210, 77213). however, this manual is for pd77110, 77113a, 77114, 77115, 77210, and 77213 devices. purpose the purpose of this manual is to help users understand the supporting middleware when designing and developing pd77016 family application systems. organization this manual consists of the following contents. ? overview ? library specifications ? installation ? system examples ? sample program source how to read this manual it is assumed that the reader of this manual has general knowledge in the fields of electrical engineering, logic circuits, microcontrollers, and the c language. to learn about pd77111 family hardware functions refer to pd77111 family user ? s manual architecture. to learn about pd77210 family hardware functions refer to pd77210 family user ? s manual architecture. to learn about pd77016 family hardware functions refer to pd77016 family user ? s manual instruction. conventions data significance: higher digits on the left and lower digits on the right active low representation: xxx (overscore over pin or signal name) note: footnote for item marked with note in the text caution: information requiring particular attention remark: supplementary information numerical representation: binary ... xxxx or 0bxxxx decimal ... xxxx hexadecimal ... 0xxxxx
user ? s manual u16314ej1v0um 6 related documents the related documents listed below may include preliminary versions. however, preliminary versions are not marked as such. documents related to devices part number pamphlet data sheet user ? s manual application note architecture instructions basic software pd77110 u12395e u12801e u14623e u13116e u11958e pd77111 pd77112 pd77113a u14373e pd77114 pd77115 u14867e pd77210 u15203e u15807e pd77213 documents related to development tools document name document no. rx77016 user ? s manual function u14397e configuration tool u14404e rx77016 application note host api u14371e documents related to middleware document name document no. sap77106-b08 user's manual (aac decoder) u15152e sap77106-b17 user's manual (aac encoder) this manual documents related to standard document name date published iso/iec 13818-7 mpeg-2 advanced audio coding, aac april, 1997 caution the related documents listed above are subject to change without notice. be sure to use the latest version of each document for designing.
user ? s manual u16314ej1v0um 7 contents chapter 1 overview .......................................................................................................... .................9 1.1 middleware................................................................................................................ ......................................9 1.2 aac audio encoder ......................................................................................................... ..............................9 1.2.1 encoder outline ......................................................................................................... ........................10 1.3 compressed data format .................................................................................................... .......................12 1.3.1 adif format outline ..................................................................................................... ......................12 1.3.2 adts format outline..................................................................................................... .....................12 1.4 product overview.......................................................................................................... ...............................13 1.4.1 features ................................................................................................................ ............................13 1.4.2 function ................................................................................................................ ............................13 1.4.3 operating environment................................................................................................... ...................13 1.4.4 performance............................................................................................................. .........................15 1.4.5 directory configuration ................................................................................................. .....................16 chapter 2 library specifications ........................................................................................... .17 2.1 library overview.......................................................................................................... ................................17 2.2 application processing flow ............................................................................................... .......................18 2.3 function specifications ................................................................................................... ...........................19 2.3.1 aacenc_start function ................................................................................................... .................19 2.3.2 aacenc_encode function.................................................................................................. ..............20 2.3.3 aacenc_getversion function .............................................................................................. ............21 2.4 parameters necessary for compression ...................................................................................... .............22 2.5 memory structure .......................................................................................................... ..............................24 2.5.1 scratch area............................................................................................................ ..........................24 2.5.2 static area ............................................................................................................. ............................24 2.5.3 i/o buffers ............................................................................................................. ............................25 chapter 3 installation ...................................................................................................... ............26 3.1 installation procedure .................................................................................................... .............................26 3.2 sample program creation procedure ......................................................................................... ...............27 3.3 symbol naming conventions ................................................................................................. ....................28 chapter 4 system example ................................................................................................... .......29 4.1 simulation environment using timing file .................................................................................. .............29 4.2 operation ................................................................................................................. .....................................29 appendix sample program source ..........................................................................................30 a.1 header file (aacenc.h) .................................................................................................... ............................30 a.2 include file for sample program (sample.inc) .............................................................................. ...........31 a.3 sample source file (sample.asm) ........................................................................................... ..................33 a.4 timing file for parameter information (value.tmg) ......................................................................... .........38 a.5 timing file for data input (pcm_in.tmg)................................................................................... .................39 a.6 timing file for data output (stream_out.tmg) .............................................................................. ............41
user ? s manual u16314ej1v0um 8 list of figures figure no. title page 1-1. encoder configuration example ............................................................................................ .............................. 10 1-2. system configuration example............................................................................................. ............................... 10 1-3. timing diagram........................................................................................................... ......................................... 11 1-4. adif format ............................................................................................................. .......................................... 12 1-5. adts format ............................................................................................................. ......................................... 12 2-1. application processing flow............................................................................................. .................................. 18 2-2. structure consisting of parameters necessary for compression............................................................. ........... 22 2-3. user-defined input buffer (pcm buffer) ................................................................................... ........................... 25 2-4. user-defined output buffer (bit stream buffer)........................................................................... ........................ 25 list of tables table no. title page 1-1. sampling frequencies ..................................................................................................... ...................................... 9 1-2. maximum bit rates........................................................................................................ ...................................... 11 1-3. required memory sizes .................................................................................................... .................................. 13 1-4. software tools ........................................................................................................... .......................................... 14 1-5. mips values of 1-frame compression processing (measured values) .......................................................... .... 15 2-1. list of library functions ................................................................................................ ...................................... 17 2-2. sampling frequencies ..................................................................................................... .................................... 23 2-3. symbol name/memory sizes................................................................................................. .............................. 24 3-1. symbol naming conventions................................................................................................ ............................... 28
user ? s manual u16314ej1v0um 9 chapter 1 overview 1.1 middleware middleware is the name given to a group of software that has been tuned so that it draws out the maximum performance of the processor and enables processing that is conventionally performed by hardware to be performed by software. the concept of middleware was introduced with the development of a new high-speed processor, the dsp, in order to facilitate operation of the environments integrated in the system. by providing appropriate speech codec and image data compression/decompression-type middleware, nec electronics is offering users the kind of technology essential in the realization of a multimedia system for the pd77016 family, and is continuing its promotion of system development. sap77016-b17 is middleware that provides aac-technology encoding functions. 1.2 aac audio encoder aac stands for advanced audio coding. mpeg-2 aac is an audio coding method that achieves a high quality and a high compression rate by removing compatibility with mpeg-1 audio. the sap77016-b17 conforms to this coding method. the compressed data format conforms to ? iso/iec 13818-7 mpeg-2 advanced audio coding, aac ? . the audio data that is handled is 16-bit linear pcm data sampled at a frequency of 8 khz to 96 khz (refer to table 1-1). table 1-1. sampling frequencies frequency [hz] 8000 11025 12000 16000 22050 24000 32000 44100 48000 64000 88200 96000
chapter 1 overview user ? s manual u16314ej1v0um 10 1.2.1 encoder outline figure 1-1 shows an example of the configuration of an encoder using the sap77016-b17. figure 1-2 shows an example of the configuration of a system that includes an encoder using the sap77016-b17. figure 1-1. encoder configuration example in out sampling frequency 8 khz to 96 khz (analog audio data) (16-bit linear pcm data) variable bit rate (compression data) encoder (aac) 16-bit adc figure 1-2. system configuration example cd player pc dsp audio serial interface line in parallel port evaluation board (1) input data the input data is 16-bit linear pcm data sampled at 8 khz to 96 khz (refer to table 1-1). (2) aac audio encoder the aac audio encoder reads 16-bit linear pcm data and outputs data while controlling the code quantity at a set bit rate. the bit rate per frame is variable. the maximum value of the bit rate that can be set differs depending on the sampling frequency. the bit rate takes any value up to the maximum value. table 1-2 shows the maximum value of the bit rate at a given sampling frequency.
chapter 1 overview user ? s manual u16314ej1v0um 11 table 1-2. maximum bit rates sampling frequency [hz] maximum bit rate [bps/ch] 8000 48000 11025 66150 12000 72000 16000 96000 22050 132300 24000 144000 32000 192000 44100 264600 48000 288000 64000 384000 88200 529200 96000 576000 (3) timing diagram figure 1-3 shows the timing diagram of the aac audio encoder. figure 1-3. timing diagram bit stream output aac compression processing audio input data length of 1 frame 0 16-bit linear pcm data of 1 frame time compressed data of 1 frame <1> <2> <3> <4> user application audio serial input interrupt handler <1> 16-bit linear pcm data of one frame is input. <2> the 16-bit linear pcm data of one frame is buffered and compressed. <3> the compressed data is buffered and output. <4> the user performs appropriate processing.
chapter 1 overview user ? s manual u16314ej1v0um 12 1.3 compressed data format for details of the compressed data format, refer to standards ( iso/iec 13818-7 mpeg-2 advanced audio coding, aac ). the sap77016-b17 specifications conform to standards. 1.3.1 adif format outline figure 1-4 shows the structure of adif format. figure 1-4. adif format raw data n ? 1 raw data x raw data 2 raw data n *1 header raw data 1 1 file audio data remark header: contains information for synchronizing, such as sampling frequency, bit rate, and mode. audio data: this is information related to the audio sample. it consists of multiple raw data bit streams. raw data: this is a bit stream of the smallest unit that is decoded. *1: bit alignment 1.3.2 adts format outline figure 1-5 shows the structure of adts format. figure 1-5. adts format frame frame header variable header frame frame frame frame 1 file *1 raw data 1 raw data 2 raw data 3 raw data 4 *2 1 frame audio data remark frame header: contains information for synchronizing, such as sampling frequency, bit rate, and mode. variable header: this is information needed in decoding, such as the number of raw data bit streams included in the audio data. audio data: this is information related to the audio sample. it consists of multiple raw data bit streams. raw data: this is a bit stream of the smallest unit that is decoded. there are up to four in one frame. *1: error check *2: bit alignment
chapter 1 overview user ? s manual u16314ej1v0um 13 1.4 product overview 1.4.1 features ? supports mpeg-2 aac (advanced audio coding) lc (low complexity) profile. ? supports only two front channels (mono/stereo). ? 16-bit linear pcm data input. ? code quantity control at set bit rate (refer to table 1-2 maximum bit rates ) (bit rate per frame variable). ? sampling frequency: 8 khz to 96 khz (refer to table 1-1 sampling frequencies ). ? codes 1024 samples/frame in mono mode (1 channel). ? codes 2048 samples/frame in stereo mode (2 channels). ? adts, adif, and raw formats used as compressed data formats. ? short block processing, tns processing, and intensity stereo processing not supported. 1.4.2 function the sap77016-b17 converts 16-bit linear pcm data of one frame into compressed data. 1.4.3 operating environment (1) operable dsps: pd77110, 77113a, 77114, 77115, 77210, 77213 (2) required memory size: sap77016-b17 requires memory sizes shown in the following table. table 1-3. required memory sizes memory type size [kwords] instruction memory ? 4.8 x memory ram scratch area 4.7 static area 2.0 rom 3.4 y memory ram scratch area 4.0 static area 0.1 library area 0.1 rom 2.8 caution place the x memory and y memory areas used for the library in the internal rom/ram space. the required memory size shown above does not include the audio data and bit stream data buffers. refer to 2.5.3 i/o buffers. remark one word of instruction memory is 32 bits. one word of x memory or y memory is 16 bits.
chapter 1 overview user ? s manual u16314ej1v0um 14 (3) required a/d converter specifications 2 channels, 16-bit resolution, sampling frequency shown in table 1-1 (4) software tools (windows ? version) table 1-4. software tools relevant dsp software tools pd77110 family wb77016 (workbench (assembler/linker)) hsm77016 (high-speed simulator) id77016 (debugger) pd77210 family atair developer studio (workbench (assembler/linker)) pd7721x high-speed simulator pd7721x debugger remark these dsp software tools are produced by atair software gmbh.
chapter 1 overview user ? s manual u16314ej1v0um 15 1.4.4 performance table 1-5 shows the mips values (measured values) necessary for real-time execution of processing of one frame. ? measurement conditions simulator: hsm77016 ( pd77016 high-speed simulator) sampling frequency: 32 khz, 44.1 khz, 48 khz evaluation result: the processing speed is measured when a stereo/mono audio file is compressed, and the average value and maximum value are calculated. the processing speed of only the aacenc_encode function is included in compression. the processing speed of the other functions and interrupt handlers is not included. table 1-5. mips values of 1-frame compression processing (measured values) sampling frequency [khz] 32 44.1 48 setting bit rate [kbps] 64 96 128 64 96 128 64 96 128 average value stereo 24.9 27.9 28.4 30.7 33.5 37.5 33.5 36.7 41.2 [mips] mono 13.4 13.7 14.8 17.9 18.2 18.8 19.1 19.7 20.7 maximum value stereo 42.2 49.8 51.2 50.3 58.5 67.7 54.6 63.8 73.8 [mips] mono 24.9 26.9 28.5 33.1 34.6 36.4 35.3 36.5 39.5 remark these mips values were measured when evaluation was made by nec electronics. the maximum values do not guarantee the worst values.
chapter 1 overview user ? s manual u16314ej1v0um 16 1.4.5 directory configuration the directory configuration of the psap77016-b17 is shown below. library library for pd77113a, 77114, 77213 aacenc.h: timing file for parameter information sample source file project file header file a2eram.lib: library for pd77110, 77115, 77210 smp aacenc a2erom.lib: sample.prj: sample.asm: include file for sample program sample.inc: value.tmg: timing file for data input pcm_in.tmg: timing file for data output stream_out.tmg: a summary of each directory is shown below. ? library this directory contains library files. ? smp/aacenc this directory contains sample program source files, header files and timing files.
user ? s manual u16314ej1v0um 17 chapter 2 library specifications 2.1 library overview sap77016-b17 provides the following three functions. table 2-1. list of library functions function name function aacenc_start initialization aacenc_encode compression process aacenc_getversion obtain version information
chapter 2 library specifications user ? s manual u16314ej1v0um 18 2.2 application processing flow figure 2-1 shows an example of the processing of an application that uses sap77016-b17. figure 2-1. application processing flow encode processing call aacenc_encode start encoder initialization call aacenc_start audio serial input interrupt handler 1 fram of sampling count? processing to input data to pcm buffer no yes processing <1> <2> repeated three times processing to output compressed data of bit stream buffer from host i/f muted data input to pcm buffer encode processing call aacenc_encode processing to output compressed data of bit stream buffer from host i/f data i/o initialization processing ad initial setup interrupt enable, etc. 16-bit liner pcm data input end of encoder? yes no <1> <2> remark the 16-bit linear pcm data input processing of the interrupt handler is dependent upon the hardware of the target system. therefore, the user should design the input processing in accordance with their target system.
chapter 2 library specifications user ? s manual u16314ej1v0um 19 2.3 function specifications 2.3.1 aacenc_start function the aacenc_start function initializes each parameter used by the encoder. it outputs the first header in the adif format to the bit stream buffer only in the adif format. call this function only once before using the aacenc_encode function. [classification] aac encoder initialization processing [function name] aacenc_start [summary of function] initializes the parameters used by the sap77016-b17 (bit rate, number of audio channels, sampling frequency, compression format, compression method, and buffer pointer used by sap77016-b17). if the compression format is adif only, this function outputs the first header in the adif format to the bit stream buffer. [format] call aacenc_start [arguments] r0l first address of structure consisting of parameters necessary for compressing in x memory note 1 r1l first address of output buffer (bit stream buffer) for encoder in x memory note 2 . the adif header is output to this bit stream buffer only when encoding is performed in the adif format. r2l first address of static area in x memory note 2 r3l first address of scratch area in x memory note 2 r4l first address of static area in y memory note 2 r5l first address of scratch area in y memory note 2 [return value] r0l when 0 or greater: size of compressed bit stream (number of bytes) when negative: error an error is returned if any of the following conditions is satisfied. ? if a value other than 0 or 1 is set to the speaker_config member of the structure consisting of the parameters necessary for compression note 1 . ? if a sampling frequency other than those supported by the sap77016-b17 is set to the higher word and lower word of the sampling_freq member of the structure consisting of the parameters necessary for compression note 1 . [registers used] r0, r1, r2, r3, r5, dp0, dp4 [hardware resources] maximum stack level 2 maximum loop stack level 1 maximum number of repeats 7 maximum number of cycles 13937 notes 1. for the parameters necessary for compression, refer to 2.4 parameters necessary for compression . 2. for the memory area and i/o buffer, refer to 2.5 memory structure . caution secure a memory area before calling this function.
chapter 2 library specifications user ? s manual u16314ej1v0um 20 2.3.2 aacenc_encode function the aacenc_encode function compresses audio data of 16 bits 2048 samples (stereo) or 16 bits 1024 samples (mono) at a specified bit rate. [classification] aac encode processing [function name] aacenc_encode [summary of function] compresses the 16-bit linear pcm data in the pcm buffer and then outputs the compressed data to the bit stream buffer. [format] call aacenc_encode [arguments] r0l first address of structure consisting of parameters necessary for compressing in x memory note 1 r1l first address of input buffer (pcm buffer) for data input for encoder in x memory note 2 r2l first address of output buffer (bit stream buffer) for data output from encoder in x memory note 2 r3l first address of static area in x memory note 2 r4l first address of static area in y memory note 2 [return value] r0l when 0 or greater: size of compressed bit stream (number of bytes) when negative: error if the aacenc_encode function is called after the aacenc_start function has returned an error, the aacenc_encode function also returns an error. [registers used] r0, r1, r2, r3, r4, r5, dp0, dp1, dp2, dp3, dp4, dp5, dp6, dp7, dn0, dn1, dn2, dn3, dn4, dn5, dn6, dn7, dmx, dmy [hardware resources] maximum stack level 6 maximum loop stack level 3 maximum number of repeats 51 maximum mips value 73.8 mips (48 khz sampling, 128 kbps, stereo) notes 1. for the parameters necessary for compression, refer to 2.4 parameters necessary for compression . 2. for the memory area and i/o buffer, refer to 2.5 memory structure . caution on completion of encoding, the user should input muted data of 1 frame (2048 words (stereo)/1024 words (mono)) to the pcm buffer and call the aacenc_encode function three times. this can prevent information of the previous audio data from affecting compression of the next audio data.
chapter 2 library specifications user ? s manual u16314ej1v0um 21 2.3.3 aacenc_getversion function the aacenc_getversion function returns the version number of the sap77016-b17. [classification] version information acquisition [function name] aacenc_getversion [function] returns the version number of the sap77016-b17 library in a 32-bit value. version when r0 = 0x00 ? 0x0001 ? 0x0100: v1.01 [format] aacenc_getversion [arguments] none [return value] r0h major version number r0l minor version number [registers used] r0 [hardware resources] maximum stack level 0 maximum loop stack level 0 maximum number of repeats 0 maximum number of cycles 6
chapter 2 library specifications user ? s manual u16314ej1v0um 22 2.4 parameters necessary for compression secure a structure (refer to figure 2-2) consisting of the parameters necessary for compression on x memory. set the information on each parameter to this structure before calling the aacenc_start and aacenc_encoder functions. figure 2-2. structure consisting of parameters necessary for compression <1> bitrate: total 2 words first address of structure: r0l 7 words <3> sampling_freq: total 2 words <2> speaker_config: 1 word <4> header_type: 1 word <5> mpeg_id: 1 word higher word lower word higher word lower word <1> bitrate (2 words): this parameter sets the bit rate (bps). example: to set the bit rate to 264600 bps (0t264600 = 0x40998), set the higher word to 0x0004 and the lower word to 0x0998. <2> speaker_config (1 word): this parameter sets the number of audio channels. if a value other than 0 or 1 is set to this parameter, the aacenc_start function returns an error. 0: mono (1 ch) 1: stereo (2 chs) example to select stereo (2 chs), set speaker_config to 0x0001.
chapter 2 library specifications user ? s manual u16314ej1v0um 23 <3> sampling_freq (2 words): this parameter specifies the sampling frequency (hz). the frequencies that can be specified are listed in table 2-2 below. if a frequency not listed in this table is specified, the aacenc_start function returns an error. table 2-2. sampling frequencies frequency [hz] 8000 11025 12000 16000 22050 24000 32000 44100 48000 64000 88200 96000 example to set the bit rate to 96000 hz (0t96000 = 0x17700), set the higher word of sampling_freq to 0x0001, and the lower word to 0x7700. <4> header_type (1 word): this parameter specifies the header type. the following header types can be specified. 0: raw format (without header) 1: adif format 2: adts format example to select the adts format, set header_type to 0x0002. <5> mpeg_id (1 word): this parameter specifies the compression method. the sap77016-b17 does not support mpeg-4/aac. therefore, be sure to set mpeg_id to 0x0001 . 0: setting prohibited (mpeg-4/aac) 1: mpeg-2/aac
chapter 2 library specifications user ? s manual u16314ej1v0um 24 2.5 memory structure with the sap77016-b17, the user must define the memory area and i/o buffer area necessary for processing. the scratch memory area and static memory area must be separately defined. for the size of each memory area, refer to table 2-3. table 2-3. symbol name/memory sizes symbol name size [words] x/y plane description scratch_x_area 4756 x scratch area scratch_y_area 4096 y scratch area static_x_area 2048 x static area static_y_area 5 y static area caution place the x memory and y memory areas used for the library in the internal rom/ram space. the size of the scratch memory area and static memory area shown above does not include the audio data and bit stream data buffers. refer to 2.5.3 i/o buffers. 2.5.1 scratch area the scratch area is a memory area that can be discarded when it is not used by the sap77016-b17. the user can use the scratch area freely after encoding processing of one frame. when the sap77016-b17 uses this area again, however, the information set by the user to this area is not guaranteed. example lib_scratch_x xramseg scratch_x_area: ds 4756 lib_scratch_y yramseg scratch_y_area: ds 4096 2.5.2 static area the static area is a memory area that cannot be discarded even when the sap77016-b17 does not operate. the user must not use the static area. if the user manipulates this area after initialization, the correct operation of the sap77016-b17 cannot be guaranteed. example lib_static_x xramseg static_x_area: ds 2048 lib_static_y yramseg static_y_area: ds 5
chapter 2 library specifications user ? s manual u16314ej1v0um 25 2.5.3 i/o buffers the i/o buffer is an area to which audio data (16-bit linear pcm data) is input and from which bit stream data is output. the user must secure an area for the i/o buffers in x memory. the user can freely use the i/o buffer area after encoding processing of one frame. if the audio data or bit stream data area is manipulated during encoding processing, the correct operation is not guaranteed. example necessary i/o buffers main_x_work xramseg spcm: ds 2048 _ _ bitstreambuffer: ds 768 figure 2-3. user-defined input buffer (pcm buffer) first address of input buffer: r1l size of input buffer mono (1 channel): 1024 words or more stereo (2 channels): 2048 words or more l r figure 2-4. user-defined output buffer (bit stream buffer) first address of output buffer: r2l size of output buffer mono (1 channel): 384 words or more stereo (2 channels): 768 words or more caution for mono (when the number of channels is 1), set the size of the pcm buffer to 1024 words or more. also secure 384 words or more for the bit stream buffer. for stereo (when the number of channels is 2), set the size of the pcm buffer to 2048 words or more. also secure 768 words or more for the bit stream buffer. if a buffer of the necessary size is not secured, the output result cannot be guaranteed.
user ? s manual u16314ej1v0um 26 chapter 3 installation 3.1 installation procedure the sap77016-b17 (aac encoder middleware) is supplied on a cd-rom. the procedure for installing the sap77016-b17 in the host machine is outlined below. (1) set the floppy disk in the floppy disk drive and copy the files to the directory where wb77016 and hsm77016 (dsp tools) are used (e.g. c:\dsptools). the following is an example of when files are copied from the q drive to the c drive. q:\>xcopy /s *.* c:\dsptools (2) confirm that the files have been copied. refer to 1.4.5 directory configuration for details on the directories. c:\>dir c:\dsptools
chapter 3 installation user ? s manual u16314ej1v0um 27 3.2 sample program creation procedure a sample program is stored in the smp directory. the sample program operates on hsm77016 (high-speed simulator) ver. 2.32 or later. using the timing files described later makes it possible to simulate data i/o. refer to appendix sample program source regarding timing files. the following is an explanation of how to build the aac decoder middleware sample program. (1) start up the wb77016 (workbench) ver.2.4 or later. (2) open the sample.prj project file. example specify sample.prj with the open project command on the project menu. (3) execute build and confirm that sample.lnk has been created. example the sample.lnk file can be created by selecting the build all command from the make menu. (4) start up the hsm77016 (high-speed simulator) ver.2.32 or later. (5) open the sample.lnk file. example specify sample.lnk with the open command on the file menu. (6) open timing files (value.tmg, pcmin.tmg, streamout.tmg). example specify value.tmg with the open command on the file menu.
chapter 3 installation user ? s manual u16314ej1v0um 28 3.3 symbol naming conventions table 3-1 shows the naming conventions of the symbols used for the sap77016-b17. do not use symbol names in duplicate when other applications are used in combination. table 3-1. symbol naming conventions classification convention function name, code segment name (imseg), constant segment name (romseg/ramseg), constant name, variable area name aacenc_xxxx remark xxxx is an alphanumeric character string.
user ? s manual u16314ej1v0um 29 chapter 4 system example 4.1 simulation environment using timing file the simulation environment of the compression processing of the sap77016-b17 is shown below. audio data (16-bit linear pcm data) is input and compressed in 1-frame units, and the compressed data is output. [software environment] ? high-speed simulator: hsm77016 ver.2.32 or later ? sample program: sample.lnk (created in 3.2 sample program creation procedure) ? timing file: value.tmg, pcm_in.tmg, stream_out.tmg 4.2 operation <1> start up the high-speed simulator. <2> open sample.lnk created in 3.2 sample program creation procedure . example specify sample.lnk by clicking ? file open ? . <3> open the timing files (value.tmg, pcm_in.tmg, stream_out.tmg). example specify value.tmg by clicking ? file open ? . <4> execute using run.
user ? s manual u16314ej1v0um 30 appendix sample program source a.1 header file (aacenc.h) #ifndef __aacenc_h #define __aacenc_h #define aacenc_static_area_x_size 2048 #define aacenc_static_area_y_size 5 #define aacenc_scratch_area_x_size 4756 #define aacenc_scratch_area_y_size 4096 #define headersize 7 extrn aacenc_start extrn aacenc_encode extrn aacenc_getversion #endif
appendix sample program source user ? s manual u16314ej1v0um 31 a.2 include file for sample program (sample.inc) (1/2) vector imseg at 0x200 %define (jmpvect(addr)) ( jmp addr ; nop ; nop ; nop ; ) %define (nopvect) ( nop ; reti ; nop ; nop ; ) ivreset: %jmpvect(startup) ; %nopvect ; %nopvect ; %nopvect ; ivint1: %nopvect ; ivint2: %nopvect ; ivint3: %nopvect ; ivint4: %nopvect ; ivint5: %nopvect ; ivint6: %nopvect ; ivint7: %nopvect ; ivint8: %nopvect ; ivint9: %nopvect ; ivint10: %nopvect ; ivint11: %nopvect ; ivint12: %nopvect ;
appendix sample program source user ? s manual u16314ej1v0um 32 (2/2) %define(initialize) ( clr (r0) ; r1 = r0 ; r2 = r0 ; r3 = r0 ; r4 = r0 ; r5 = r0 ; r6 = r0 ; r7 = r0 ; dp0 = r0l ; dp1 = r0l ; dp2 = r0l ; dp3 = r0l ; dp4 = r0l ; dp5 = r0l ; dp6 = r0l ; dp7 = r0l ; dn0 = r0l ; dn1 = r0l ; dn2 = r0l ; dn3 = r0l ; dn4 = r0l ; dn5 = r0l ; dn6 = r0l ; dn7 = r0l ; dmx = r0l ; dmy = r0l ; )
appendix sample program source user ? s manual u16314ej1v0um 33 a.3 sample source file (sample.asm) (1/5) #include "aacenc.h" lib_static_x xramseg static_x_area: ds aacenc_static_area_x_size lib_static_y yramseg static_y_area: ds aacenc_static_area_y_size lib_scratch_x xramseg scratch_x_area: ds aacenc_scratch_area_x_size lib_scratch_y yramseg scratch_y_area: ds aacenc_scratch_area_y_size main_x_work xramseg at 0x6000 spcm: ds 1024*2 __bitstreambuffer: ds 2048/2 header: _header_bitrate_h: ds 1 _header_bitrate_l: ds 1 _header_speaker_config: ds 1 _header_sampling_freq_h: ds 1 _header_sampling_freq_l: ds 1 _header_header_type: ds 1 _header_mpeg_id: ds 1 _outputbufferflag: ds 1 _valued: ds 1 _frame_number: ds 1 main_ctrl_work xramseg at 0x5ffc _s: ds 1 ; reference value of timing files _stream_length: ds 1 ; reference value of timing files _fw_out_flag: ds 1 ; reference value of timing files _fw_run_flag: ds 1 ; reference value of timing files #defineheader_bitrate_h _header_bitrate_h:x #defineheader_bitrate_l _header_bitrate_l:x #defineheader_speaker_config _header_speaker_config:x #defineheader_sampling_freq_h _header_sampling_freq_h:x #defineheader_sampling_freq_l _header_sampling_freq_l:x #defineheader_header_type _header_header_type:x #defineheader_mpeg_id _header_mpeg_id:x #defineoutputbufferflag _outputbufferflag:x #definevalued _valued:x #defineframe_number _frame_number:x #defines _s:x #definestream_length _stream_length:x #definefw_out_flag _fw_out_flag:x #definefw_run_flag _fw_run_flag:x
appendix sample program source user ? s manual u16314ej1v0um 34 (2/5) #include " sample.inc" main imseg at 0x240 startup: %initialize ; clr (r0) ; dp0 = __bitstreambuffer ; rep 2048/2 ; *dp0++ = r0h ; dp0 = spcm ; rep 1024*2 ; *dp0++ = r0h ; dp4 = 0x4000 ; rep 0x2000 ; *dp4++ = r0h ; *outputbufferflag = r0h ; *frame_number = r0h ; *valued = r0h ; *stream_length = r0h ; clr (r0) ;run_flag = 0 *fw_run_flag = r0h ; r0 = *fw_run_flag ;while (run_flag == 0) {} if (r0 == 0) jmp $-1 ; ;; header analysis ;; (msb) ;; 22+2+4+6+2+8 = 44byte -> 22word dp0 = spcm ; rep 22/2 ;fread (header, 1, 22, fi) r0 = *dp0++ ; r0 = *dp0++ ;fread (&s, 1, 2, fi) *s = r0h ; r1 = r0 sra 16 ;header.speaker_config = (s == 1) ? 0 : 1 r1 = r1 - 1 ; clr (r0) ; if (r1 != 0) r0 = r0 + 1 ; *header_speaker_config = r0l ; r0 = *dp0++ ;fread (&i, 1, 4, fi) r0l = *dp0++ ; *header_sampling_freq_h = r0l ;header.sampling_freq = i *header_sampling_freq_l = r0h ; ;fread (tmp, 1, 6+2+8, fi) clr (r0) ; r0l = 64000 ;64kbps
appendix sample program source user ? s manual u16314ej1v0um 35 (3/5) nop; *header_bitrate_h = r0h ; *header_bitrate_l = r0l ; r0l = 1 ;mpeg-2 aac *header_mpeg_id = r0l ; r0l = 2 ;header_type = 2 *header_header_type = r0l ; r0l = header ;ret = aacenc_start (&header, bitstreambuffer) r1l = __bitstreambuffer ; r2l = static_x_area ; r3l = scratch_x_area ; r4l = static_y_area ; r5l = scratch_y_area ; call aacenc_start ; if (r0 < 0) jmp _exit ; call copyoutputbuffer ;copyoutputbuffer (ret, bitstreambuffer) _while1: ;while (1) { clr (r0) ; run_flag = 0 *fw_run_flag = r0h ; r0 = *fw_run_flag ; while (run_flag == 0) {} if (r0 == 0) jmp $-1 ; if (r0 < 0) jmp _break1 ; if (run_flag < 0) break r0l = header ; ret = aacenc_encode (&header, spcm, bitstreambuffer) r1l = spcm ; r2l = __bitstreambuffer ; r3l = static_x_area ; r4l = static_y_area ; call aacenc_encode ; if (r0 < 0) jmp _exit ; if (ret < 0) exit(ret) call copyoutputbuffer ; copyoutputbuffer (ret, bitstreambuffer) r1l = *frame_number ; frame_numfer++ r1 = r1 + 1 ; *frame_number = r1l ; jmp _while1 ;} _break1: dp0 = spcm ;clear (0) spcm area clr (r0) ;for (i = 0; i < 2048; i++) { rep 2048 ; spcm[i] = 0 *dp0++ = r0h ;}
appendix sample program source user ? s manual u16314ej1v0um 36 (4/5) r0l = header ;ret = aacenc_encode (&header, spcm, bitstreambuffer) r1l = spcm ; r2l = __bitstreambuffer ; r3l = static_x_area ; r4l = static_y_area ; call aacenc_encode ; if (r0 < 0) jmp _exit ;if (ret < 0) exit(ret) call copyoutputbuffer ;copyoutputbuffer (ret, bitstreambuffer) r0l = header ;ret = aacenc_encode (&header, spcm, bitstreambuffer) r1l = spcm ; r2l = __bitstreambuffer ; r3l = static_x_area ; r4l = static_y_area ; call aacenc_encode ; if (r0 < 0) jmp _exit ;if (ret < 0) exit(ret) call copyoutputbuffer ;copyoutputbuffer (ret, bitstreambuffer) r0l = header ;ret = aacenc_encode (&header, spcm, bitstreambuffer) r1l = spcm ; r2l = __bitstreambuffer ; r3l = static_x_area ; r4l = static_y_area ; call aacenc_encode ; if (r0 < 0) jmp _exit ;if (ret < 0) exit(ret) call copyoutputbuffer ;copyoutputbuffer (ret, bitstreambuffer) r0 = *outputbufferflag ; if (r0 == 0) jmp _exit ; r0 = *valued ; *0x4000:y = r0h ; r0l = 1 ; *stream_length = r0l ; clr (r1) ; *fw_out_flag = r1h ; r1 = *fw_out_flag ; if (r1 == 0) jmp $-1 ; _exit: clr (r0) ; r0l = 0x2222 ;length = 0x2222 *stream_length = r0l ; *fw_out_flag = r0h ;out_flag = 0 *fw_run_flag = r0h ;run_flag = 0 jmp startup ;
appendix sample program source user ? s manual u16314ej1v0um 37 (5/5) ;; copy from bitstreambuffer to output buffer ;; copyoutputbuffer: if (r0 == 0) ret ; dp4 = 0x4000 ;wpt = 0x4000 dp0 = __bitstreambuffer ;rpt = bitstreambuffer r2 = *outputbufferflag ;if (outputbufferflag == 0) { if (r2 != 0) jmp _l1 ; r1 = r0 sra 1 ; count = len >> 1 *stream_length = r1l ; r2 = r0 & 1 ; loop r1l { ; for ( ; count > 0; count--) { r1 = *dp0++ ; tmp = *rpt++ *dp4++ = r1h ; *wpt++ = tmp };} *outputbufferflag = r2l ; if (r2 == 0) jmp _l2 ; if (len & 1) { r1 = *dp0 ; valued = *rpt *valued = r1h ; } jmp _l2 ;} _l1: ;else { r1 = r0 sra 1 ; count = len >> 1 r2 = r0 & 1 ; if (len & 1) if (r2 != 0) r1 = r1 + 1 ; count++ *stream_length = r1l ; r0 = *valued ; tmp = valued << 8 r0 = r0 sra 8 ; loop r1l { ; for ( ; count > 0; count--) { r0l = *dp0++ ; tmp |= *rpt++ r0 = r0 sll 8 ; tmp <<= 8 *dp4++ = r0h ; *wpt++ = (tmp >> 16) r0 = r0 sll 8 ; tmp <<= 8 };} r0 = r0 sll 8 ; *valued = r0h ; valued = tmp >> 16 clr (r1) ; *wpt = valued if (r2 == 0) r1 = r1 + 1 ; *outputbufferflag = r1l ; _l2: ;} clr (r0) ; *fw_out_flag = r0l ; r0 = *fw_out_flag ; if (r0 == 0) jmp $-1 ; ret ;return end
appendix sample program source user ? s manual u16314ej1v0um 38 a.4 timing file for parameter information (value.tmg) global s, fw_run_flag, fw_out_flag, stream_length, pcm_start, stream_start global out44_128, out44_96, out44_80, out44_64 global out32_96, out32_64, out32_48, out32_40 global flag01, flag02, flag03, flag04, flag05 global flag08, flag09, flag12, flag13, flag19 global flag21 set s = 0x5ffc set stream_length = 0x5ffd set fw_out_flag = 0x5ffe set fw_run_flag = 0x5fff set pcm_start = 0x6000 set stream_start = 0x4000 set out44_128 = 1 << 7 set out44_96 = 1 << 6 set out44_80 = 1 << 5 set out44_64 = 1 << 4 set out32_96 = 1 << 3 set out32_64 = 1 << 2 set out32_48 = 1 << 1 set out32_40 = 1 << 0 set flag01 = 0 set flag02 = 0 set flag03 = 0 set flag04 = 0 set flag05 = 0 set flag08 = 0 set flag09 = 0 set flag12 = 0 set flag13 = 0 set flag19 = 0 set flag21 = 0 set flag01 = out44_128 | out44_96 | out44_80 | out44_64 | out32_96 | out32_64 | out32_48 | out32_40 set flag02 = out44_128 | out44_96 | out44_80 | out44_64 | out32_96 | out32_64 | out32_48 | out32_40 set flag03 = out44_128 | out44_96 | out44_80 | out44_64 | out32_96 | out32_64 | out32_48 | out32_40 set flag04 = out44_128 | out44_96 | out44_80 | out44_64 | out32_96 | out32_64 | out32_48 | out32_40 set flag05 = out44_128 | out44_96 | out44_80 | out44_64 | out32_96 | out32_64 | out32_48 | out32_40 set flag08 = out44_128 | out44_96 | out44_80 | out44_64 | out32_96 | out32_64 | out32_48 | out32_40 set flag09 = out44_128 | out44_96 | out44_80 | out44_64 | out32_96 | out32_64 | out32_48 | out32_40 set flag12 = out44_128 | out44_96 | out44_80 | out44_64 | out32_96 | out32_64 | out32_48 | out32_40 set flag13 = out44_128 | out44_96 | out44_80 | out44_64 | out32_96 | out32_64 | out32_48 | out32_40 set flag19 = out44_128 | out44_96 | out44_80 | out44_64 | out32_96 | out32_64 | out32_48 | out32_40 set flag21 = out44_128 | out44_96 | out44_80 | out44_64 | out32_96 | out32_64 | out32_48 | out32_40 end
appendix sample program source user ? s manual u16314ej1v0um 39 a.5 timing file for data input (pcm_in.tmg) (1/2) global s, fw_run_flag, fw_out_flag, stream_length, pcm_start global out44_128, out44_96, out44_80, out44_64 global out32_96, out32_64, out32_48, out32_40 global flag01, flag02, flag03, flag04, flag05 global flag08, flag09, flag12, flag13, flag19 global flag21 local size, data, pcm local sz local bitrate local addr set addr = 0x27c sub hanten ; (data) set data = ((data >> 8) & 0xff) | ((data & 0xff) << 8) endsub sub writedata hanten set *pcm:x = data set pcm = pcm + 1 endsub sub writting ; (size, sz) local tmp set pcm = pcm_start if (size >= sz) rept sz input data writedata endrept set size = size - sz else set tmp = sz - size rept size input data writedata endrept set data = 0 rept tmp writedata endrept set size = 0 endif endsub
appendix sample program source user ? s manual u16314ej1v0um 40 (2/2) sub wave2stream input format hex input size set *fw_run_flag:x = 1 wait cond (*fw_run_flag:x != 1) set sz = 22 writting if (*s:x == 1) set sz = 1024 else set sz = 2048 endif set *fw_run_flag:x = 1 wait cond ip == addr set r0 = bitrate do set *fw_run_flag:x = 1 wait cond (*fw_run_flag:x != 1) exit (size < sz) writting enddo set *fw_run_flag:x = -1 wait cond (*fw_run_flag:x != -1) endsub ;;; wait for initialize ;;; wait 1 if (flag02) if (flag02 & out32_40) ;;; 02.wav / 32khz / 40kbps ;;; open input "02_32.dat" set bitrate = 40000 wave2stream close input endif endif break end
appendix sample program source user ? s manual u16314ej1v0um 41 a.6 timing file for data output (stream_out.tmg) global fw_out_flag, stream_length, stream_start global out44_128, out44_96, out44_80, out44_64 global out32_96, out32_64, out32_48, out32_40 global flag01, flag02, flag03, flag04, flag05 global flag08, flag09, flag12, flag13, flag19 global flag21 sub wave2stream2 local data, rpt, length output #10 format dec do set *fw_out_flag:x = 1 wait cond *fw_out_flag:x != 1 set length = *stream_length:x exit length >= 0x2000 if (length) set rpt = stream_start rept length set data = *rpt:y output #10 data set rpt = rpt + 1 endrept endif enddo endsub ;;; main ;;; wait 1 if (flag02) ;;; 02.wav ;;; if (flag02 & out32_40) open output #10 "02_32_40.dat" wave2stream2 close output #10 endif endif end
user ? s manual u16314ej1v0um 42 [memo]


▲Up To Search▲   

 
Price & Availability of USAB17AP77016-XXX-B17

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X