![]() |
|
If you can't view the Datasheet, Please click here to try to view without PDF Reader . |
|
Datasheet File OCR Text: |
user? manual printed in japan document no. u11381ej2v0um00 (2nd edition) date published july 1998 n cp(k) printed in japan target device m sAP703000-B04 : v850 family tm m sap70732-b04 : v810 family tm 1996 m sAP703000-B04, m sap70732-b04 adpcm middleware
2 [memo] 3 v810 family, v850 family, v810, v821, v850/sa1, v852, v853, and v854 are trademarks of nec corp. green hills software is a trademark of green hills software, inc. pc dos is a trademark of ibm corp. windows and ms-dos are either registered trademarks or trademarks of microsoft corporation in the united states and/or other countries. unix is a registered trademark licensed by x/open company limited in the us and other countries. sun4 is a trademark of sun microsystems, inc. the information in this document is subject to change without notice. no part of this document may be copied or reproduced in any form or by any means without the prior written consent of nec corporation. nec corporation assumes no responsibility for any errors which may appear in this document. nec corporation does not assume any liability for infringement of patents, copyrights or other intellectual property rights of third parties by or arising from use of a device described herein or any other liability arising from use of such device. no license, either express, implied or otherwise, is granted under any patents, copyrights or other intellectual property rights of nec corporation or of others. m7a 96.10 4 nec electronics inc. (u.s.) santa clara, california tel: 408-588-6000 800-366-9782 fax: 408-588-6130 800-729-9288 nec electronics (germany) gmbh duesseldorf, germany tel: 0211-65 03 02 fax: 0211-65 03 490 nec electronics (uk) ltd. milton keynes, uk tel: 01908-691-133 fax: 01908-670-290 nec electronics italiana s.r.1. milano, italy tel: 02-66 75 41 fax: 02-66 75 42 99 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 singapore pte. ltd. united square, singapore 1130 tel: 65-253-8311 fax: 65-250-3583 nec electronics taiwan ltd. taipei, taiwan tel: 02-719-2377 fax: 02-719-5951 nec do brasil s.a. cumbica-guarulhos-sp, brasil tel: 011-6465-6810 fax: 011-6465-6829 nec electronics (germany) gmbh benelux office eindhoven, the netherlands tel: 040-2445845 fax: 040-2444580 nec electronics (france) s.a. velizy-villacoublay, france tel: 01-30-67 58 00 fax: 01-30-67 58 99 nec electronics (france) s.a. spain office madrid, spain tel: 01-504-2787 fax: 01-504-2860 nec electronics (germany) gmbh scandinavia office taeby, sweden tel: 08-63 80 820 fax: 08-63 80 388 regional information some information contained in this document may vary from country to country. before using any nec product in your application, please contact the nec office in your country to obtain a list of authorized representatives and distributors. they will verify: ? 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. j98. 2 5 major revisions in this edition page contents p.20 change of 1.3.2 (3) supported tools p.21 change of 1.3.4 directory configuration p.43 change of 3.1.1 v810 family p.43 change of 3.1.2 v850 family p.44 change of 3.1.3 directory and file p.45 change of 3.2.1 unix version p.46 change of 3.2.2 ms-dos/pc dos version p.47 change of 3.3 creating sample program p.49 change of appendix source program of sample.c the mark shows major revised points. 6 [memo] 7 preface readers this manual is intended for user engineers who wish to design and develop application systems using the v810 family/v850 family . purpose the purpose of this manual is to help user engineers understand the middleware that supports the design and development v810 family/v850 family application systems. organization this manual contains the following items: ? general ? library specification ? installation ? appendix how to read this manual it is assumed that the readers of this manual have a general knowledge of electrical engineering, logic circuits, microcomputers, and the c language. to understand the hardware functions of the v810 family/v850 family ? refer to the users manuals (hardware) of each product. to understand the instruction functions of the v810 family/v850 family ? refer to the users manuals (architecture) of each product. legend data significance : most-significant digit on left, least-significant digit on right active low : xxx (bar over pin and signal names) memory map address: top-low, bottom-high note : description of note in the text caution : important information remark : supplement numeric notation : binary ... or b decimal ... hexadecimal ... h or 0 prefix indicating power of 2 (address space, memory capacity) k (kilo) = 2 10 = 1024 m (mega) = 2 20 = 1024 2 g (giga) = 2 30 = 1024 3 8 related documents some of the related documents listed below are preliminary versions but not so specified here. documents related to v810 family product name data sheet users manual nickname device name hardware architecture v810 tm m pd70732 u10691e u10661e u10082e v821 tm m pd70741 u11678e u10077e documents related to v850 family product name data sheet users manual nickname device name hardware architecture v852 tm m pd703002 u11826e u10038e u10243e m pd70p3002 u11827e v853 tm m pd703003, 703003a, 703005a u12261e u10913e m pd70f3003 u12036e m pd70f3003a, 70f3025a u13189e v854 tm m pd703008 planned u11969e m pd703008y planned m pd70f3008 u12756e m pd70f3008y u12755e v850/sa1 tm m pd703015 planned u12768e m pd703015y planned m pd70f3017 planned m pd70f3017y planned 9 document related to v810 family development tools (user?s manual) document name document number ca732 (c compiler) operation (unix tm based) u11013e operation (windows tm based) u11068e assembly language u11016e c language u11010e rx732 (real-time os) fundamental u10346e nucleus installation u10347e technical u10490e documents related to v850 family development tools (users manual) document name document number ie-703002-mc (in-circuit emulator for v851, v852, v853, v854, v850/sa1) u11595e ie-703003-mc-em1 (in-circuit emulator option board for v853) u11596e ie-703008-mc-em1 (in-circuit emulator option board for v854) u12420e ie-703017-mc-em1 (in-circuit emulator option board for v850/sa1) u12898e ca850 (c compiler) operation (unix based) u12839e operation (windows based) u12827e c language u12840e assembly language u10543e project manager (windows based) u11991e id850 (c source debugger) operation (windows based) u11196e installation (unix based) u12210e rx850 (real-time os) fundamental u12861e technical u13002e nucleus installation u11038e installation (unix based) u12863e installation (windows based) u12862e debugger (windows based) u11158e az850 (system performance analyzer) C operation u11181e for inquiries about the tools produced by green hills software tm , inc. (ghs), please contact: green hills software, inc. 510 castillo street, santa barbara, california 93101 tel: 805-965-6044 web site: http://www.ghs.com 10 [memo] 11 contents chapter 1 general ............................................................................................................. ........... 15 1.1 middleware .................................................................................................................. ..... 15 1.2 adpcm ....................................................................................................................... ...... 15 1.2.1 pcm-to-linear conversion block ............................................................................................ 17 1.2.2 adpcm compression block .................................................................................................. 1 7 1.2.3 adpcm expansion block ..................................................................................................... .18 1.2.4 linear-to-pcm conversion block ........................................................................................... 1 8 1.2.5 synchronous coding correction block ................................................................................... 18 1.3 product outline ............................................................................................................. ... 19 1.3.1 features .................................................................................................................. .............. 19 1.3.2 operating environment ..................................................................................................... .... 19 1.3.3 performance ............................................................................................................... ........... 20 1.3.4 directory configuration ................................................................................................... ....... 21 chapter 2 library specifications ........................................................................................... 23 2.1 function .................................................................................................................... ....... 23 2.1.1 compression processing .................................................................................................... .. 23 2.1.2 expansion processing ...................................................................................................... ..... 24 2.2 ram ......................................................................................................................... ......... 25 2.3 data type ................................................................................................................... ...... 25 2.3.1 int pcm_mlaw .............................................................................................................. .......... 25 2.3.2 int pcm_alaw .............................................................................................................. ........... 25 2.3.3 int linear_enc ............................................................................................................ ............. 26 2.3.4 int linear_dec ............................................................................................................ ............. 26 2.3.5 int adpcm_32kbps .......................................................................................................... ....... 26 2.3.6 int adpcm_16kbps .......................................................................................................... ....... 26 2.4 error processing ............................................................................................................ .27 2.5 function specifications .................................................................................................. 27 2.5.1 initialization function ................................................................................................... ........... 27 2.5.2 compression function ...................................................................................................... ..... 28 2.5.3 expansion function ........................................................................................................ ........ 34 chapter 3 installation ........................................................................................................ ....... 43 3.1 supply format ............................................................................................................... .. 43 3.1.1 v810 family ............................................................................................................... ............ 43 3.1.2 v850 family ............................................................................................................... ............ 43 3.1.3 directory and file ........................................................................................................ ........... 44 3.2 file expansion to host machine .................................................................................... 45 3.2.1 unix version .............................................................................................................. ........... 45 3.2.2 ms-dos/pc dos version .................................................................................................... 4 6 3.3 creating sample program .............................................................................................. 47 12 3.4 changing location .......................................................................................................... 4 8 3.5 symbol name convention .............................................................................................. 48 appendix source program of sample.c .................................................................................. 49 13 list of figures figure no. title page 1-1 recommendation g.726 ........................................................................................................ ........... 15 1-2 concept of adpcm ............................................................................................................ ............... 16 1-3 organization of adpcm processing ............................................................................................ ..... 16 1-4 organization of adpcm compression block .................................................................................... 1 7 1-5 organization of adpcm expansion block ....................................................................................... .18 2-1 compression flow ............................................................................................................ ................ 23 2-2 expansion processing flow ................................................................................................... ........... 24 3-1 organization of sample program .............................................................................................. ........ 47 14 list of tables table no. title page 1-1 v810 performance ............................................................................................................ ................ 20 1-2 v853 performance ............................................................................................................ ................ 20 2-1 compression functions ....................................................................................................... ............. 23 2-2 expansion functions ......................................................................................................... ................ 24 15 chapter 1 general this chapter explains the middleware and adpcm decoder. 1.1 middleware middleware is a software group tuned to draw out the full performance of a processor. because many high-performance risc processors are available today, the processing conventionally imple- mented by dedicated hardware can now be realized by a high-performance risc processor and software. the software used for this purpose is called middleware. nec supplies human-machine interface and signal processing technologies in the form of middleware. it provides excellent system solutions to satisfy the various needs of users. this adpcm middleware is a library that compresses and expands speech code (telephone quality). remark risc: reduced instruction set computer 1.2 adpcm the adpcm of this middleware codes speech in the analog telephone band (0.3 to 3.4 khz) stipulated by itu- t recommendation g.726. recommendation g.726 was issued in 1990 by adding 40-kbps adpcm, 24-kbps adpcm, and 16-kbps adpcm to recommendation g.721 (32-kbps adpcm) which was adopted as an international standard of telephone quality coding in 1988. this middleware supports the 32-kbps adpcm and 16-kbps adpcm of recommendation g.726. remark adpcm: adaptive differential pulse code modulation itu-t: international telecommunication union-telecommunication standardization sector figure 1-1. recommendation g.726 recommendation g.726 recommendation g.721 32-kbps adpcm note 24-kbps adpcm 16-kbps adpcm note 40-kbps adpcm note supported by this middleware. 16 chapter 1 general the interface of adpcm is based on the 64-kbps pcm code stipulated by itu-t recommendation g.711. this is because the 64-kbps pcm of recommendation g.721 has been widely used as an international standard telephone quality coding method, and because adpcm was developed as a standard to improve the compression rate. the 64-kbps pcm of itu-t recommendation g.711 limits the bandwidth to 0.3 to 3.4 khz by using a bandpass filter and codes analog speech signals sampled at 8 khz into 8-bit digital signals by means of non-linear quantization. the 64-kbps pcm has two modes: m -law mode (used in japan and north america) and a-law mode (used in europe). adpcm is a standard for further compressing the speech codes compressed by means of 64-kbps pcm. figure 1-2. concept of adpcm pcm code 64 kbps : 8 khz 8 bits compression expansion adpcm code 32 kbps : 8 khz 4 bits 16 kbps : 8 khz 2 bits the compression/expansion processing of adpcm is described next. the compression processing of adpcm is performed by a pcm-to-linear conversion block and an adpcm compression block, as shown in figure 1-3. the expansion processing of adpcm is performed by an adpcm expansion block, linear-to-pcm conversion block, and synchronous coding correction block, as shown in figure 1-3. the expansion processing prevents degradation of the sound quality by repeatedly compressing and expanding speech data, by using the synchronous coding correction block, when incorporated to an existing digital (64-kbps pcm) communication network. figure 1-3. organization of adpcm processing compression processing 14 bits pcm code adpcm code 8 bits pcm-to-linear conversion block adpcm compression block internal variables synchronous coding correction block 8 bits 8 bits 16 bits linear-to-pcm conversion block adpcm expansion block expansion processing 32 kbps : 4 bits 16 kbps : 2 bits 17 chapter 1 general 1.2.1 pcm-to-linear conversion block this block converts a 64-kbps pcm code (8 bits) into a linear code (14 bits: expressed as 2s complement). the pcm code in the m -law mode is converted by a pcm decoder conforming to recommendation g.711. the pcm code in the a-law mode is converted by a pcm decoder conforming to recommendation g.711. the resulting value is doubled and then adjusted to 14 bits. 1.2.2 adpcm compression block this block compresses a linear code (14 bits) to an adpcm code (32 kbps: 4 bits, 16 kbps: 2 bits) in the following procedure (refer to figure 1-4 ): (1) a predicted signal is subtracted from the input signal (linear code) to calculate a differential signal. (2) the differential signal is coded by using an adaptive quantization unit. for 32-kbps adpcm, the differential signal is coded to 4 bits by using a 15 level adaptive quantization unit. for 16-kbps adpcm, the differential signal is coded to 2 bits by using a 4 level adaptive quantization unit. this coded signal is an adpcm code and is the output of the compression processing. (3) an adaptive reverse quantization unit is used to generate a quantized differential signal from the adpcm code. (4) the quantized differential signal is added to the predicted signal to reproduce the input signal. (5) an adaptive prediction unit is used to calculated the predicted value of the next input signal from the reproduced signal and quantized differential signal. figure 1-4. organization of adpcm compression block linear code (14 bits) + + differential signal adaptive quantization unit 32 kbps : 15 levels 16 kbps : 4 levels adpcm code (32 kbps : 4 bits) (16 kbps : 2 bits) adaptive prediction unit reproduced signal + + + quantized differential signal adaptive reverse quantization unit 32 kbps : 15 levels 16 kbps : 4 levels predicted signal 18 chapter 1 general 1.2.3 adpcm expansion block this block expands an adpcm code (32 kbps: 4 bits, 16 kbps: 2 bits) to a reproduced linear code (16 bits) in the following procedure (refer to figure 1-5 ): (1) a quantized differential signal is generated from the adpcm code by using an adaptive reverse quantization unit. (2) the input signal is reproduced by adding the quantized differential signal to a predicted signal. this signal is the output signal of the adpcm expansion processing. (3) an adaptive prediction unit is used to calculate the predicted value of the next input signal from the reproduced signal and quantized differential signal. figure 1-5. organization of adpcm expansion block adpcm code (32 kbps : 4 bits) (16 kbps : 2 bits) adaptive reverse quantization unit 32 kbps : 15 levels 16 kbps : 4 levels quantized differential signal reproduced signal reproduced linear code (16 bits) predicted signal + + + adaptive prediction unit 1.2.4 linear-to-pcm conversion block this block converts a reproduced linear code (16 bits) to a 64-kbps pcm code (8 bits). the pcm code in the m -law mode is converted by a pcm coder conforming to recommendation g.711. the pcm code in the a-law mode is converted by a pcm coder conforming to recommendation g.711 after the reproduced linear code has been adjusted (1/2) 1.2.5 synchronous coding correction block the synchronous coding block corrects for cumulative distortion that may take place when compression from pcm to adpcm and expansion from adpcm to pcm (synchronous tandem coding) are repeatedly performed. the value of the reproduced linear code, which is the input signal, is corrected by simulating the adpcm code to be compressed next by using the pcm-to-linear conversion block described in 1.2.1 and in steps (1) and (2) described in 1.2.2 adpcm compression block, so that the value of the reproduced linear code is the same as that of the current adpcm code. 19 chapter 1 general 1.3 product outline 1.3.1 features conforms to the international adpcm standard (itu-t recommendation g.726). (1) bit rate the following two bit rates are supported: ? 32-kbps adpcm (compresses 1 sampling data to 4 bits) ? 16-kbps adpcm (compresses 1 sampling data to 2 bits) (2) 64 kbps pcm code interface the following two modes conforming to the international 64-kbps pcm standard (itu-t recommendation g.711) are supported: ? m -law mode ? a-law mode if synchronous tandem coding is not performed for expansion, a mode in which the synchronous coding correction function is deleted from the itu-t recommendation g.726, with increased execution speed, is supported. (3) linear code interface a liner code interface that deletes the functions (mutual conversion of 64 kbps pcm code and linear code and synchronous coding correction) that are related to the 64-kbps pcm code interface and that can be deleted from the international standard of adpcm (itu-t recommendation g.726) is supported. remark the linear code interface does not support synchronous tandem coding. 1.3.2 operating environment (1) target cpu ? v810 family ? v850 family (2) necessary memory ? rom: total capacity of 9k bytes or less (the capacity varies depending on the functions to be linked.) ? ram: 80 bytes max. 20 chapter 1 general (3) supported tools (a) v810 family ? nec c compiler package: ca732 (windows 3.1 or above, sun4?) ? ghs c compiler/assembler: c-v810 (windows 3.1 or above, sun4) (b) v850 family ? nec c compiler package: ca850 (windows 3.1 or above, sun4) ? ghs c compiler/assembler: c-v850 (windows 3.1 or above, sun4) 1.3.3 performance the processing time per sampling data is shown below. (1) v810 [condition] 25 mhz, 32-bit bus, cache off, 0 wait rom/ram table 1-1. v810 performance compression/expansion processing time compression linear code interface 62 m s max. pcm code interface 63 m s max. expansion linear code interface (synchronous tandem coding 59 m s max. not supported) pcm code interface (synchronous tandem coding 61 m s max. not supported) pcm code interface 66 m s max. (2) v853 [condition] 33 mhz, internal rom/ram, 0 wait, external ram (speech data) table 1-2. v853 performance compression/expansion processing time compression linear code interface 29 m s max. pcm code interface 30 m s max. expansion linear code interface (synchronous tandem coding 28 m s max. not supported) pcm code interface (synchronous tandem coding 29 m s max. not supported) pcm code interface 31 m s max. 21 chapter 1 general 1.3.4 directory configuration the directory configuration of the middleware library adpcm is as follows: (1) v810 family (software version: ver. 1.00) ./ nectools lib810 libadpcm. a smp810 adpcm sample. c makefile linear o expect_e.o expect_d.o ghstools lib810 libadpcm.a smp810 adpcm sample.c makefile linear.o expect_e.o expect_d.o (2) v850 family (software version: ver. 1.01) ./ nectools lib850 libadpcm. a smp850 adpcm sample. c makefile linear.o expect_e.o expect_d.o startup.s sample.lnk ghstools lib850 libadpcm.a smp850 adpcm sample.c makefile linear.o expect_e.o expect_d.o startup.s dfile 22 [memo] 23 chapter 2 library specifications 2.1 function 2.1.1 compression processing speech data is compressed to adpcm codes of 32 kbps or 16 kbps. the speech data which is input is classified according to functions corresponding to linear codes and 64-kbps pcm codes ( m -law, a-law). table 2-1. compression functions function classification input data type ? compressed data type adpcm_132_enc ( ) linear code ? 32-kbps adpcm adpcm_pm32_enc ( ) 64-kbps pcm code ( m -law) ? 32-kbps adpcm adpcm_pa32_enc ( ) 64-kbps pcm code (a-law) ? 32-kbps adpcm adpcm_i16_enc ( ) linear code ? 16-kbps adpcm adpcm_pm16_enc ( ) 64-kbps pcm code ( m -law) ? 16-kbps adpcm adpcm_pa16_enc ( ) 64-kbps pcm code (a-law) ? 16-kbps adpcm figure 2-1. compression flow start adpcm initialization input of speech data adpcm compression storage of compressed data end ? end yes no library sections 24 chapter 2 library specifications 2.1.2 expansion processing compressed data (adpcm codes of 32 kbps or 16 kbps) is expanded to speech data. the speech data which is output is classified according to functions corresponding to linear codes and 64-kbps pcm codes ( m -law, a-law). table 2-2. expansion functions function classification compressed data type ? output data type adpcm_l32_dec ( ) 32-kbps adpcm ? linear code adpcm_pm32_dec ( ) 32-kbps adpcm ? 64-kbps pcm code ( m -law) adpcm_pa32_dec ( ) 32-kbps adpcm ? 64-kbps pcm code (a-law) adpcm_tpm32_dec ( ) note 32-kbps adpcm ? 64-kbps pcm code ( m -law) adpcm_tpa32_dec ( ) note 32-kbps adpcm ? 64-kbps pcm code (a-law) adpcm_i16_dec ( ) 64-kbps adpcm ? linear code adpcm_pm16_dec ( ) 16-kbps adpcm ? 64-kbps pcm code ( m -law) adpcm_pa16_dec ( ) 16-kbps adpcm ? 64-kbps pcm code (a-law) adpcm_tpm16_dec ( ) note 16-kbps adpcm ? 64-kbps pcm code ( m -law) adpcm_tpa16_dec ( ) note 16-kbps adpcm ? 64-kbps pcm code (a-law) note these functions support tandem synchronous coding. figure 2-2. expansion processing flow start adpcm initialization reads compressed data adpcm expansion outputs expanded data end ? end yes no library sections 25 chapter 2 library specifications 2.2 ram be sure to secure the determined memory capacity (resident area) for each of the compression and expansion processing with this library. to secure the resident area, perform the following in the user application: int work[16] manage the resident area in the user application, and specify a pointer (first address) with the input parameter of the compression/expansion function. do not destroy the contents of the resident area until the compression/ expansion processing sequence is completed. the operation is not guaranteed if the resident area is destroyed. this library also uses the following stack area for the compression/expansion functions: ? v810 family version: 3 words (12 bytes) ? v850 family version: 2 words (8 bytes) 2.3 data type this section describes the data used with this library. each data type is standardized to int width (32 bits) to increase the processing speed. note that the valid range is not checked in each function. 2.3.1 int pcm_mlaw [contents] 64-kbps pcm code ( m -law) [description] 8-bit data (zero-extend up to bit 31.) [valid range] 0 to 255 31 24 23 16 15 8 7 0 zero extension 000000 000 0 0000 0000 0 00000 2.3.2 int pcm_alaw [contents] 64-kbps pcm code (a-law) [description] 8-bit data (zero-extend up to bit 31.) [valid range] 0 to 255 31 24 23 16 15 8 7 0 zero extension 000000 000 0 0000 0000 0 00000 26 chapter 2 library specifications 2.3.3 int linear_enc [contents] linear code (compression processing argument) [description] 14-bit data (expressed as 2s complement. sign-extend up to bit 31.) [valid range] C8192 to 8191 31 24 23 16 15 8 7 0 sign extension ****** *** * **** **** * 2.3.4 int linear_dec [contents] linear code (expansion processing return value) [description] 16-bit data (expressed as 2s complement. sign-extended up to bit 31) [valid range] C32768 to 32767 31 24 23 16 15 8 7 0 sign extension ****** *** * **** ** * 2.3.5 int adpcm_32kbps [contents] 32-kbps adpcm code [description] 4-bit data (zero-extend up to bit 31.) [valid range] 1 to 15 31 24 23 16 15 8 7 0 zero extension 000000 000 0 0000 0000 0 0 00000000 2.3.6 int adpcm_16kbps [contents] 16-kbps adpcm code [description] 2-bit data (zero-extend up to bit 31.) [valid range] 0 to 3 31 24 23 16 15 8 7 0 zero extension 000000 000 0 0000 0000 0 0 0000000000 27 chapter 2 library specifications 2.4 error processing the functions of the adpcm library do not have an error processing functions like outputting an error code as a return value. this is because the value outside the valid range in the middle of calculation is limited (saturated) by the recommendation and therefore, errors do not exist. however, errors, such as nmi, may occur. if these errors occur, deal with them in the user application by managing flags before and after function calls. 2.5 function specifications the adpcm library supplies a total of 17 functions including an initialization function, six compression (encoder) functions, and 10 expansion (decoder) functions. these functions are described next. 2.5.1 initialization function (1) adpcm_init function this function initializes the encoder and decoder. secure a resident area (64 bytes) for the processing of the encoder and decoder in the application program, and use the addresses of that area as arguments. be sure to call the adpcm_init function before performing an encoder/decoder processing sequence. [classification] adpcm initialization (common to encoder and decoder) [function name] adpcm_init [outline] initializes the resident area of the adpcm encoder and decoder. [format] void adpcm_init (init * work ); [argument] type argument description int work [ 16 ] first address of resident area (64 bytes) [return value] none [feature] initializes the resident area for the encode and decode processing. caution after calling the adpcm_init function, do not destroy the resident ram area until the encode and decode processing sequence is completed. if the resident area is destroyed, the operation is not guaranteed. 28 chapter 2 library specifications 2.5.2 compression function (1) adpcm_i32_enc function this function performs 32-kbps adpcm encode processing of the linear code interface. it encodes a linear code given by the input parameter, and returns a 32-kbps adpcm code as a return value. of the parameters to be passed to the adpcm_i32_enc function, specify the same address as that passed to the adpcm_init function as the address of the resident area for encode processing. [classification] 32-kbps adpcm encode processing (linear code interface) [function name] adpcm_i32_enc [outline] encodes a specified linear code to a 32-kbps adpcm code. [format] int adpcm_i32_enc (int linear_enc, int * work ) [argument] type argument description int work [ 16 ] first address of resident area (64 bytes) int linear_enc linear code [return value] type return value description int adpcm_32 32-kbps adpcm code [feature] encodes sampling data given by a linear code to a 32-kbps adpcm code. [remark] the following function is deleted from the 32-kbps adpcm encoder of itu-t recommendation. ? conversion from 64-kbps pcm code to linear code 29 chapter 2 library specifications (2) adpcm_pm32_enc function this function performs 32-kbps adpcm encode processing of the m -law pcm code interface. it encodes a 64-kbps m -law pcm code given by the input parameter, and returns a 32-kbps adpcm code as a return value. of the parameters to be passed to the adpcm_pm32_enc function, specify the same address as that passed to the adpcm_init function as the address of the resident area for encode processing. [classification] 32-kbps adpcm encode processing ( m -law pcm code interface) [function name] adpcm_pm32_enc [outline] encodes a specified 64-kbps m -law pcm code to a 32-kbps adpcm code. [format] int adpcm_pm32_enc (int pcm_mlaw, int * work ) [argument] type argument description int work [ 16 ] first address of resident area (64 bytes) int pcm_mlaw 64-kbps m -law pcm [return value] type return value description int adpcm_32 32-kbps adpcm code [feature] encodes sampling data given by a 64-kbps m -law pcm code to a 32-kbps adpcm code. 30 chapter 2 library specifications (3) adpcm_pa32_enc function this function performs 32-kbps adpcm encode processing of the a-law pcm code interface. it encodes a 64-kbps a-law pcm code given by the input parameter, and returns a 32-kbps adpcm code as a return value. of the parameters to be passed to the adpcm_pa32_enc function, specify the same address as that passed to the adpcm_init function as the address of the resident area for encode processing. [classification] 32-kbps adpcm encode processing (a-law pcm code interface) [function name] adpcm_pa32_enc [outline] encodes a specified a 64-kbps a-law pcm code to a 32-kbps adpcm code. [format] int adpcm_pa32_enc (int pcm_alaw, int * work ) [argument] type argument description int work [ 16 ] first address of resident area (64 bytes) int pcm_alaw 64-kbps a-law pcm code [return value] type return value description int adpcm_32 32-kbps adpcm code [feature] encodes sampling data given by a 64-kbps a-law code to a 32-kbps adpcm code. 31 chapter 2 library specifications (4) adpcm_i16_enc function this function performs 16-kbps adpcm encode processing of the linear code interface. it encodes a linear code given by the input parameter, and returns a 16-kbps adpcm code as a return value. of the parameters to be passed to the adpcm_i16_enc function, specify the same address as that passed to the adpcm_init function as the address of the resident area for encode processing. [classification] 16-kbps adpcm encode processing (a-law pcm code interface) [function name] adpcm_i16_enc [outline] encodes a specified linear code to a 32-kbps adpcm code. [format] int adpcm_i16_enc (int pcm_alaw, int * work ) [argument] type argument description int work [ 16 ] first address of resident area (64 bytes) int linear_enc linear code [return value] type return value description int adpcm_16 16-kbps adpcm code [feature] encodes sampling data given by a linear code to a 16-kbps adpcm code. [remark] the following function is deleted from the 16-kbps adpcm encoder of itu-t recommendation. ? conversion from 64-kbps pcm code to linear code 32 chapter 2 library specifications (5) adpcm_pm16_enc function this function performs 16-kbps adpcm encode processing of the m -law pcm code interface. it encodes a 64-kbps m -law pcm code given by the input parameter, and returns a 16-kbps adpcm code as a return value. of the parameters to be passed to the adpcm_pm16_enc function, specify the same address as that passed to the adpcm_init function as the address of the resident area for encode processing. [classification] 16-kbps adpcm encode processing ( m -law pcm code interface) [function name] adpcm_pm16_enc [outline] encodes a specified a 64-kbps m -law pcm code to a 16-kbps adpcm code. [format] int adpcm_pm16_enc (int pcm_mlaw, int * work ) [argument] type argument description int work [ 16 ] first address of resident area (64 bytes) int pcm_mlaw 64-kbps m -law pcm code [return value] type return value description int adpcm_16 16-kbps adpcm code [feature] encodes sampling data given by a 64-kbps m -law pcm code to a 16-kbps adpcm code. 33 chapter 2 library specifications (6) adpcm_pa16_enc function this function performs 16-kbps adpcm encode processing of the a-law pcm code interface. it encodes a 64-kbps a-law pcm code given by the input parameter, and returns a 16-kbps adpcm code as a return value. of the parameters to be passed to the adpcm_pa16_enc function, specify the same address as that passed to the adpcm_init function as the address of the resident area for encode processing. [classification] 16-kbps adpcm encode processing (a-law pcm code interface) [function name] adpcm_pa16_enc [outline] encodes a specified a 64-kbps a-law pcm code to a 16-kbps adpcm code. [format] int adpcm_pa16_enc (int pcm_alaw, int * work ) [argument] type argument description int work [ 16 ] first address of resident area (64 bytes) int pcm_alaw 64-kbps a-law pcm code [return value] type return value description int adpcm_16 16-kbps adpcm code [feature] encodes sampling data given by a 64-kbps a-law pcm code to a 16-kbps adpcm code. 34 chapter 2 library specifications 2.5.3 expansion function (1) adpcm_i32_dec function this function performs 32-kbps adpcm decode processing of the linear code interface. it decodes a 32-kbps adpcm code given by the input parameter, and returns a linear code as a return value. of the parameters to be passed to the adpcm_i32_dec function, specify the same address as that passed to the adpcm_init function as the address of the resident area for decode processing. [classification] 32-kbps adpcm decode processing (linear code interface) [function name] adpcm_i32_dec [outline] decodes a specified 32-kbps adpcm code to a linear code. [format] int adpcm_i32_dec (int adpcm-32, int * work ) [argument] type argument description int work [ 16 ] first address of resident area (64 bytes) int adpcm-32 32-kbps adpcm code [return value] type return value description int linear_dec linear code [feature] decodes sampling data given by a 32-kbps adpcm code to a linear code. [remark] the following function is deleted from the 32-kbps adpcm decoder of itu-t recommendation. ? conversion from linear code to 64-kbps pcm code ? synchronous coding correction 35 chapter 2 library specifications (2) adpcm_pm32_dec function this function performs 32-kbps adpcm decode processing of the m -law pcm code interface. it decodes a 32-kbps adpcm code given by the input parameter, and returns a 64-kbps m -law pcm code as a return value. of the parameters to be passed to the adpcm_pm32_dec function, specify the same address as that passed to the adpcm_init function as the address of the resident area for decode processing. [classification] 32-kbps adpcm decode processing ( m -law pcm code interface) [function name] adpcm_pm32_dec [outline] decodes a specified a 32-kbps adpcm code to a 64-kbps m -law pcm code. [format] int adpcm_pm32_dec (int adpcm-32, int * work ) [argument] type argument description int work [ 16 ] first address of resident area (64 bytes) int adpcm_32 32-kbps adpcm code [return value] type return value description int pcm_mlaw 64-kbps m -law pcm code [feature] decodes sampling data given by a 32-kbps adpcm code to a 64-kbps m -law pcm code. [remark] the following function is deleted from the 32-kbps adpcm decoder of itu-t recommendation. ? synchronous coding correction. 36 chapter 2 library specifications (3) adpcm_pa32_dec function this function performs 32-kbps adpcm decode processing of the a-law pcm code interface. it decodes a 32-kbps adpcm code given by the input parameter, and returns a 64-kbps a-law pcm code as a return value. of the parameters to be passed to the adpcm_pa32_dec function, specify the same address as that passed to the adpcm_init function as the address of the resident area for decode processing. [classification] 32-kbps adpcm decode processing (a-law pcm code interface) [function name] adpcm_pa32_dec [outline] decodes a specified a 32-kbps adpcm code to a 64-kbps a-law pcm code. [format] int adpcm_pa32_dec (int adpcm-32, int * work ) [argument] type argument description int work [ 16 ] first address of resident area (64 bytes) int adpcm_32 32-kbps adpcm code [return value] type return value description int pcm_alaw 64-kbps a-law pcm code [feature] decodes sampling data given by a 32-kbps adpcm code to a 64-kbps a-law pcm code. [remark] the following function is deleted from the 32-kbps adpcm decoder of itu-t recommendation. ? synchronous coding correction. 37 chapter 2 library specifications (4) adpcm_tpm32_dec function this function performs 32-kbps adpcm decode processing of the m -law pcm code interface. it decodes a 32-kbps adpcm code given by the input parameter, and returns a 64-kbps m -law pcm code as a return value. of the parameters to be passed to the adpcm_tpm32_dec function, specify the same address as that passed to the adpcm_init function as the address of the resident area for decode processing. [classification] 32-kbps adpcm decode processing ( m -law pcm code interface) [function name] adpcm_tpm32_dec [outline] decodes a specified a 32-kbps adpcm code to a 64-kbps m -law pcm code. [format] int adpcm_tpm32_dec (int adpcm-32, int * work ) [argument] type argument description int work [ 16 ] first address of resident area (64 bytes) int adpcm_32 32-kbps adpcm code [return value] type return value description int pcm_mlaw 64-kbps m -law pcm code [feature] decodes sampling data given by a 32-kbps adpcm code to a 64-kbps m -law pcm code. 38 chapter 2 library specifications (5) adpcm_tpa32_dec function this function performs 32-kbps adpcm decode processing of the a-law pcm code interface. it decodes a 32-kbps adpcm code given by the input parameter, and returns a 64-kbps a-law pcm code as a return value. of the parameters to be passed to the adpcm_tpa32_dec function, specify the same address as that passed to the adpcm_init function as the address of the resident area for decode processing. [classification] 32-kbps adpcm decode processing (a-law pcm code interface) [function name] adpcm_tpa32_dec [outline] decodes a specified a 32-kbps adpcm code to a 64-kbps a-law pcm code. [format] int adpcm_tpa32_dec (int adpcm_32, int * work ) [argument] type argument description int work [ 16 ] first address of resident area (64 bytes) int adpcm_32 32-kbps adpcm code [return value] type return value description int pcm_alaw 64-kbps a-law pcm code [feature] decodes sampling data given by a 32-kbps adpcm code to a 64-kbps a-law pcm code. 39 chapter 2 library specifications (6) adpcm_i16_dec function this function performs 16-kbps adpcm decode processing of the linear code interface. it decodes a 16-kbps adpcm code given by the input parameter, and returns a linear code as a return value. of the parameters to be passed to the adpcm_i16_dec function, specify the same address as that passed to the adpcm_init function as the address of the resident area for decode processing. [classification] 16-kbps adpcm decode processing (linear code interface) [function name] adpcm_i16_dec [outline] decodes a specified a 16-kbps adpcm code to a linear code. [format] int adpcm_i16_dec (int adpcm_16, int * work ) [argument] type argument description int work [ 16 ] first address of resident area (64 bytes) int adpcm_16 16-kbps adpcm code [return value] type return value description int linear_dec linear code [feature] decodes sampling data given by a 16-kbps adpcm code to a linear code. [remark] the following function is deleted from the 32-kbps adpcm decoder of itu-t recommendation. ? conversion from linear code to 64-kbps pcm code. ? synchronous coding correction 40 chapter 2 library specifications (7) adpcm_pm16_dec function this function performs 16-kbps adpcm decode processing of the m -law pcm code interface. it decodes a 16-kbps adpcm code given by the input parameter, and returns a 64-kbps m -law pcm code as a return value. of the parameters to be passed to the adpcm_pm16_dec function, specify the same address as that passed to the adpcm_init function as the address of the resident area for decode processing. [classification] 16-kbps adpcm decode processing ( m -law pcm code interface) [function name] adpcm_pm16_dec [outline] decodes a specified 16-kbps adpcm code to a m -law pcm code. [format] int adpcm_pm16_dec (int adpcm_16, int * work ) [argument] type argument description int work [ 16 ] first address of resident area (64 bytes) int adpcm_16 16-kbps adpcm code [return value] type return value description int pcm_mlaw 64-kbps m -law pcm code [feature] decodes sampling data given by a 16-kbps adpcm code to a 64-kbps m -law pcm code. [remark] the following function is deleted from the 16-kbps adpcm decoder of itu-t recommendation. ? synchronous coding correction 41 chapter 2 library specifications (8) adpcm_pa16_dec function this function performs 16-kbps adpcm decode processing of the a-law pcm code interface. it decodes a 16-kbps adpcm code given by the input parameter, and returns a 64-kbps a-law pcm code as a return value. of the parameters to be passed to the adpcm_pa16_dec function, specify the same address as that passed to the adpcm_init function as the address of the resident area for decode processing. [classification] 16-kbps adpcm decode processing (a-law pcm code interface) [function name] adpcm_pa16_dec [outline] decodes a specified 16-kbps adpcm code to a 64-kbps a-law pcm code. [format] int adpcm_pa16_dec (int adpcm_16, int * work ) [argument] type argument description int work [ 16 ] first address of resident area (64 bytes) int adpcm_16 16-kbps adpcm code [return value] type return value description int pcm_alaw 64-kbps a-law pcm code [feature] decodes sampling data given by a 16-kbps adpcm code to a 64-kbps a-law pcm code. [remark] the following function is deleted from the 16-kbps adpcm decoder of itu-t recommendation. ? synchronous coding correction 42 chapter 2 library specifications (9) adpcm_tpm16_dec function this function performs 16-kbps adpcm decode processing of the m -law pcm code interface. it decodes a 16-kbps adpcm code given by the input parameter, and returns a 64-kbps m -law pcm code as a return value. of the parameters to be passed to the adpcm_tpm16_dec function, specify the same address as that passed to the adpcm_init function as the address of the resident area for decode processing. [classification] 16-kbps adpcm decode processing ( m -law pcm code interface) [function name] adpcm_tpm16_dec [outline] decodes a specified 16-kbps adpcm code to a m -law pcm code. [format] int adpcm_tpm16_dec (int adpcm_16, int * work ) [argument] type argument description int work [ 16 ] first address of resident area (64 bytes) int adpcm_16 16-kbps adpcm code [return value] type return value description int pcm_mlaw 64-kbps m -law pcm code [feature] decodes sampling data given by a 16-kbps adpcm code to a 64-kbps m -law pcm code. (10) adpcm_tpa16_dec function this function performs 16-kbps adpcm decode processing of the a-law pcm code interface. it decodes a 16-kbps adpcm code given by the input parameter, and returns a 64-kbps a-law pcm code as a return value. of the parameters to be passed to the adpcm_tpa16_dec function, specify the same address as that passed to the adpcm_init function as the address of the resident area for decode processing. [classification] 16-kbps adpcm decode processing (a-law pcm code interface) [function name] adpcm_tpa16_dec [outline] decodes a specified 16-kbps adpcm code to a 64-kbps a-law pcm code. [format] int adpcm_tpa16_dec (int adpcm_16, int * work ) [argument] type argument description int work [ 16 ] first address of resident area (64 bytes) int adpcm_16 16-kbps adpcm code [return value] type return value description int pcm_alaw 64-kbps a-law pcm code [feature] decodes sampling data given by a 16-kbps adpcm code to a 64-kbps a-law pcm code. 43 chapter 3 installation 3.1 supply format the middleware library adpcm is a library for developing applications using nec or ghs tools. therefore, it is available in two media, one for nec tools and the other for ghs tools. the contents of the supply media are as follows: 3.1.1 v810 family ./ nectools lib810 libadpcm.a smp810 adpcm sample.c makefile linear.o expect_e.o expect_d.o ghstools lib810 libadpcm.a smp810 adpcm sample.c makefile linear.o expect_e.o expect_d.o 3.1.2 v850 family ./ nectools lib850 libadpcm.a smp850 adpcm sample.c makefile linear.o expect_e.o expect_d.o startup.s sample.lnk ghstools lib850 libadpcm.a smp850 adpcm sample.c makefile linear.o expect_e.o expect_d.o startup.s dfile 44 chapter 3 installation 3.1.3 directory and file the functions of each directory and file are as follows: (1) nectools contains the adpcm program used to develop applications using nec tools. (2) ghstools contains the adpcm program used to develop applications using ghs tools. (3) lib850 contains the library of the adpcm. (4) smp810/adpcm, smp850/adpcm contains a sample program using the adpcm and sample speech data. 45 chapter 3 installation 3.2 file expansion to host machine this section describes the procedure, for the unix version (sun4) and ms-dos tm /pc dos tm version, to transfer the files from the supply media to the host machine. 3.2.1 unix version the unix version is available in two media: cgmt and 3.5 fd. the adpcm files are stored in these media in the tar format. the procedure for installing adpcm to the host machine is as follows. <1> create a directory to install the adpcm. in this example, a directory named mw_adpcm is created. % mkdir mw_adpcm 46 chapter 3 installation 3.2.2 ms-dos/pc dos version the ms-dos/pc dos version is supplied on a 3.5 fd. install the adpcm on the host machine in the following procedure: <1> create a directory to which the adpcm is to be installed. in this example, a directory named mw_adpcm is created in drive a. a> md mw_adpcm 47 chapter 3 installation 3.3 creating sample program the directory smp810 (v810 family version) or smp850 (v850 family version) stores a sample program using the compression function and expansion function of 32 kbps adpcm (linear code interface) and speech data (refer to appendix for the source program of sample.c). the sample program compresses a data array called linear_enc stored in the file linear.o, and the result of compression is stored in an array called adpcm_32. next, this compressed data is expanded and the result of decoding (expansion) is stored in an array called linear_dec. figure 3-1. organization of sample program in the example given below, sample program make, nec tools, and unix version are used. <1> move to the directory containing the sample program. % cd mw_adpcm/nectools/smp810/adpcm 48 chapter 3 installation 3.4 changing location the adpcm library is given the following section name. the location can be changed in accordance with the users target. section name type description .ad_text .text text (instruction code) .ad_data .data table data (constant) 3.5 symbol name convention the symbol names used in the adpcm library are in compliance with the following convention. when using the symbol names in combination with other applications, be careful not to duplicate them. classification convention function/symbol adpcm_ is prefixed. 49 appendix source program of sample.c --- sample.c--- extern short linear_enc[0x4000]; unsigned char adpcm_32[0x4000/2]; short linear_dec[0x4000]; int work[16]; void encoder () { unsigned register int cnt; adpcm_init( work ); for( cnt=0; cnt<0x4000; cnt++ ) { if(cnt & 1){ adpcm_32[cnt>>1]|=((unsigned char)adpcm_132_enc((int)linear_enc[cnt], work)) << 4; } else{ adpcm_32[cnt>>1]=(unsigned char)adpcm_132_enc((int)linear_enc[cnt], work); } } } void decoder () { unsigned register int cnt; adpcm_init( work ); for( cnt = 0; cnt<0x4000; cnt++ ){ if(cnt & 1){ linear_dec[cnt] = (short)adpcm_132_dec( ((int)adpcm_32[cnt>>1]) >> 4, work ); } else{ linear_dec[cnt] = (short)adpcm_132_dec( ((int)adpcm_32[cnt>>1]) & 0xf, work ); } } } main () { encoder(); decoder(); } 50 [memo] although nec has taken all possible steps to ensure that the documentation supplied to our customers is complete, bug free and up-to-date, we readily accept that errors may occur. despite all the care and precautions we've taken, you may encounter problems in the documentation. please complete this form whenever you'd like to report errors or suggest improvements to us. hong kong, philippines, oceania nec electronics hong kong ltd. fax: +852-2886-9022/9044 korea nec electronics hong kong ltd. seoul branch fax: 02-528-4411 taiwan nec electronics taiwan ltd. fax: 02-719-5951 address north america nec electronics inc. corporate communications dept. fax: 1-800-729-9288 1-408-588-6130 europe nec electronics (europe) gmbh technical documentation dept. fax: +49-211-6503-274 south america nec do brasil s.a. fax: +55-11-6465-6829 asian nations except philippines nec electronics singapore pte. ltd. fax: +65-250-3583 japan nec semiconductor technical hotline fax: 044-548-7900 i would like to report the following error/make the following suggestion: document title: document number: page number: thank you for your kind support. if possible, please fax the referenced page or drawing. excellent good acceptable poor document rating clarity technical accuracy organization cs 98.2 name company from: tel. fax facsimile message |
Price & Availability of AP703000-B04
![]() |
|
|
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] |