Part Number Hot Search : 
D1040S PCI9050 HLB123SA TM9144 SJ4400 NTE2408 PST8448 LT1465CS
Product Description
Full Text Search
 

To Download AP77016-B04 Datasheet File

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


  Datasheet File OCR Text:
  users manual target devices m m m m pd77018 m m m m pd77018a m m m m pd77019 m m m m pd77110 m m m m pd77111 m m m m pd77112 m m m m pd77113 m m m m pd77114 m m m m pd77116 m m m m sAP77016-B04 g.723.1 speech codec middleware document no. u13955ej2v0umj1 (2nd edition) date published october 2000 n cp (k) printed in japan ? 1999
2 users manual u13955ej2v0um00 [memo]
users manual u13955ej2v0um00 3 windows is either a registered trademark or a trademark of microsoft corporation in the united states and/or other countries. m8e 00. 4 the information in this document is current as of may, 2000. the information is subject to change without notice. for actual design-in, refer to the latest publications of nec's data sheets or data books, etc., for the most up-to-date specifications of nec semiconductor products. not all products and/or types are available in every country. please check with an nec 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 prior written consent of nec. nec assumes no responsibility for any errors that may appear in this document. nec 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 semiconductor 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 property rights of nec 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 customer's equipment shall be done under the full responsibility of customer. nec assumes no responsibility for any losses incurred by customers or third parties arising from the use of these circuits, software and information. while nec endeavours to enhance the quality, reliability and safety of nec semiconductor 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 semiconductor products, customers must incorporate sufficient safety measures in their design, such as redundancy, fire-containment, and anti-failure features. nec semiconductor products are classified into the following three quality grades: "standard", "special" and "specific". the "specific" quality grade applies only to semiconductor products developed based on a customer-designated "quality assurance program" for a specific application. the recommended applications of a semiconductor product depend on its quality grade, as indicated below. customers must check the quality grade of each semiconductor product before using it in a particular application. "standard": computers, office equipment, communications equipment, test and measurement equipment, audio and visual equipment, home electronic appliances, machine tools, personal electronic equipment and industrial robots "special": 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) "specific": aircraft, aerospace equipment, submersible repeaters, nuclear reactor control systems, life support systems and medical equipment for life support, etc. the quality grade of nec semiconductor products is "standard" unless otherwise expressly specified in nec's data sheets or data books, etc. if customers wish to use nec semiconductor products in applications not intended by nec, they must contact an nec sales representative in advance to determine nec's willingness to support a given application. (note) (1) "nec" as used in this statement means nec corporation and also includes its majority-owned subsidiaries. (2) "nec semiconductor products" means any semiconductor product developed or manufactured by or for nec (as defined above).
4 users manual u13955ej2v0um00 regional information some information contained in this document may vary from country to country. before using any nec product in your application, piease 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. 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.l. milano, italy tel: 02-66 75 41 fax: 02-66 75 42 99 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. madrid office madrid, spain tel: 91-504-2787 fax: 91-504-2860 nec electronics (germany) gmbh scandinavia office taeby, sweden tel: 08-63 80 820 fax: 08-63 80 388 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 tel: 65-253-8311 fax: 65-250-3583 nec electronics taiwan ltd. taipei, taiwan tel: 02-2719-2377 fax: 02-2719-5951 nec do brasil s.a. electron devices division guarulhos-sp brasil tel: 55-11-6462-6810 fax: 55-11-6462-6829 j00.7
users manual u13955ej2v0um00 5 major revisions in this edition page description throughout addition of m pd77113 and 77114 to target devices p.27 addition of description to 2.3.1 extraction parameters for g.723.1 annex a functions p.28 addition of description to 2.3.2 extraction parameters for g.723.1 annex c functions p.33 addition of description to 2.4.2 (2) sid frame compression format the mark shows major revised points.
6 users manual u13955ej2v0um00 [memo]
users manual u13955ej2v0um00 7 introduction readers this manual has been prepared for users who design and develop application systems using the m pd77016 family. the m m m m pd77016 family includes the following: m m m m pd77015, 77016, 77017, 77018, 77018a, 77019, 77110, 77111, 77112, 77113, 77114, and 77116 note . the target devices of this manual, however, only include the m m m m pd77018, 77018a, 77019, 77110, 77111, 77112, 77113, 77114, and 77116. note under development purpose the manual is intended to give users an understanding of how to use the middleware that is used for support when designing or developing application systems using the m pd77016 family. organization this manual is broadly divided into the following sections. chapter 1 outline chapter 2 library specifications chapter 3 installation appendix sample program source how to read this manual it is assumed that the readers of this manual have general knowledge of electrical engineering, logic circuits, microcontrollers, and c language. to learn the hardware functions of the m pd7701 family ? refer to the m m m m pd7701 family users manual architecture to learn the hardware functions of the m pd77111 family ? refer to the m m m m pd77111 family users manual architecture to learn the instruction functions of the m pd77016 family ? refer to the m m m m pd77016 family users manual instructions conventions data significance: higher digits on the left and lower digits on the right active low representation: (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 or 0b decimal hexadecimal 0x
8 users manual u13955ej2v0um00 related documents the related documents listed below may include preliminary versions. however, preliminary versions are not marked as such. documents related to devices users manual application note document name part number pamphlet data sheet architecture instructions basic software m pd77016 u10891e m pd77015 m pd77017 m pd77018 u10902e m pd77018a m pd77019 u11849e m pd77019-013 u13053e u10503e m pd77110 m pd77111 m pd77112 u12801e m pd77113 m pd77114 u12395e u14373e under preparation u13116e u11958e m pd77116 ? ? ? ? u14624e ? ? ? ?? ? ? ?? ? ? ? documents related to development tools document name document no. ie-77016-98, ie-77016-pc users manual hardware u13044e ie-77016-cm-lc users manual u14139e function u14397e rx77016 users manual configuration tool u14404e rx77016 application note host api u14371e caution the documents listed above are subject to change without notice. be sure to use the latest documents when designing.
users manual u13955ej2v0um00 9 contents chapter 1 outline.......................................................................................................... ...................11 1.1 middleware .................................................................................................................. .................11 1.2 g.723.1 speech codec ........................................................................................................ ........11 1.3 g.723.1 annex a speech codec...............................................................................................1 2 1.4 g.723.1 annex c speech codec...............................................................................................1 2 1.5 system outline .............................................................................................................. ..............12 1.5.1 features .................................................................................................................. ...................... 12 1.5.2 operating environment ..................................................................................................... ............. 12 1.5.3 performance ............................................................................................................... ................... 13 1.5.4 directory configuration................................................................................................... ................ 14 chapter 2 library specifications .......................................................................................... ..15 2.1 g.723.1 speech codec processing flow ..................................................................................15 2.2 function specifications..................................................................................................... .........17 2.2.1 encoder initialization functions .......................................................................................... ............ 17 2.2.2 decoder initialization functions .......................................................................................... ............ 20 2.2.3 encoder functions......................................................................................................... ................. 22 2.2.4 decoder functions......................................................................................................... ................. 24 2.2.5 version acquisition function.............................................................................................. ............. 26 2.3 description of external interface ........................................................................................... ....27 2.3.1 extraction parameters for g.723.1 annex a functions ................................................................ 27 2.3.2 extraction parameters for g.723.1 annex c functions ................................................................ 28 2.4 i/o data format............................................................................................................. ...............30 2.4.1 encoder input/decoder output data format .................................................................................. .. 30 2.4.2 encoder output/decoder input data format .................................................................................. .. 30 chapter 3 installation ..................................................................................................... .............35 3.1 installation procedure...................................................................................................... ...........35 3.2 sample creation procedure ................................................................................................... ....35 3.3 symbol naming conventions ................................................................................................... .36 appendix sample program source ..........................................................................................37 a.1 for g.723.1 + annex a (samplea.asm) ....................................................................................37 a.2 for g.723.1 + annex a + annex c (sampleac.asm) .............................................................43
10 users manual u13955ej2v0um00 list of figures figure no. title page 2-1 application processing flow (encoder)..................................................................................... ........................... 15 2-2 application processing flow (decoder)..................................................................................... ........................... 16 2-3 compressed data frame format .............................................................................................. ........................... 30 3-1 sample program evaluation system .......................................................................................... .......................... 35 list of tables table no. title page 1-1 required memory capacity .................................................................................................. ................................ 13 2-1 extraction parameters for g.723.1 annex a functions....................................................................... ............... 27 2-2 extraction parameters for g.723.1 annex c functions....................................................................... ............... 28 2-3 bit rate and frame byte number of g.723.1 annex a compressed data ........................................................ 3 0 2-4 bit rate and frame byte number of g.723.1 annex c compressed data ........................................................ 3 0 2-5 6.3 kbps speech compression data format ................................................................................... .................... 31 2-6 5.3 kbps speech compression data format ................................................................................... .................... 32 2-7 bit allocation of sid data ................................................................................................ ..................................... 33 2-8 bit allocation of annex c compression data ................................................................................ ..................... 33 3-1 symbol names .............................................................................................................. ....................................... 36
users manual u13955ej2v0um00 11 chapter 1 outline 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-performance 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 is offering users the kind of technology essential in the realization of a multimedia system for the m pd77016 family, and is continuing promotion of system development. the m sAP77016-B04 is a middleware product that provides itu-t note -recommended g.723.1 speech compression and decompression functions (including the recommended additions annex a and annex c). unless otherwise stated, when describing this middleware, it is assumed the speech codec used is g.723.1. note international telecommunication union-telecommunication standardization sector 1.2 g.723.1 speech codec the g.723.1 speech codec is the 5.3 kbps or 6.3 kbps speech compression/decompression codec recommended by itu-t, and is an algorithm for coding speech data that use acelp and mp-mlq. by means of a telephone band filter (the itu-t recommended g.712), the g.723.1 speech codec samples band- restricted analog input signals at 8 khz. the digital signals that are obtained by converting this sampled data into 16- bit linear pcm data are then designed so that they operate as encoder inputs. similarly, it is necessary to return the signals to analog form to output them from the decoder. signals in other i/o formats, such as the 64 kbps pcm data prescribed by the itu-t-recommended g.711, must be converted into 16-bit linear pcm data before coding, and converted back from 16-bit linear pcm data to a suitable format after decoding. the bit-string that is passed from the encoder to the decoder is defined by the itu-t recommended g.723.1. remark acelp: algebraic code excited linear prediction mp-mlq: multi-pulse maximum likelihood quantization
chapter 1 outline 12 users manual u13955ej2v0um00 1.3 g.723.1 annex a speech codec annex a, which is an additional recommendation to the itu-t recommended g.723.1, is the silence compression function of the g.723.1, and is used in addition to the standard g.723.1 speech codec. speech codecs with an additional silence compression function and those without an additional silence compression function cannot, however, be interconnected. the purpose of the silence compression function is to raise the total compression rate and reduce the bit rate by raising the compression rate in the parts where there is silence. 1.4 g.723.1 annex c speech codec annex c, which is an additional recommendation to the itu-t recommended g.723.1, is the variable bit rate channel codec of the g.723.1 speech codec, and is used in addition to the standard g.723.1 and annex a. the bit rate supported by annex c is 0.7 kbps to 14.3 kbps. annex c is designed as a part of the itu-t h.324 family, which is aimed at multimedia in mobile communications. using this standard, the g.723.1 can be adapted to all wire and wireless transmission systems, although annex c does not define a standard for functions that rely on transmission systems such as interleave or burst formatting systems. 1.5 system outline 1.5.1 features compression coding at 5.3 and 6.3 kbps (variable bit rate for annex c) high bit-rate speech coding codes and decodes 240 samples/frames at an 8 khz sampling frequency all speech i/o data is 16-bit linear data 1.5.2 operating environment (1) target dsps m pd77018 m pd77018a m pd77019 m pd77110 m pd77111 m pd77112 m pd77113 m pd77114 m pd77116 (under development)
chapter 1 outline users manual u13955ej2v0um00 13 (2) required memory table 1-1. required memory capacity memory type annex a [word] annex c [word] instruction memory C 5.6 k 7.9 k ram note 2.1 k 2.2 k x memory rom 3.9 k 5.6 k ram note 2.0 k 2.0 k y memory rom 5.6 k 6.5 k note the scratch area within the ram area is x: 1024 words, y: 1024 words in annex a, and x: 1108 words, y: 284 words in annex c. (3) software tools (windows?) dsp tools: wb77016 (workbench) hsm77016 (high-speed simulator) 1.5.3 performance [conditions] dsp: m pd77016 family (33 mips when operating at 33 mhz) [necessary mips value for execution of a 1-frame process in real-time (30 ms)] (g.723.1 annex a) compression processing: 17.5 mips decompression processing: 1.5 mips (g.723.1 annex c) compression processing: +1 mips decompression processing: +1.5 mips
chapter 1 outline 14 users manual u13955ej2v0um00 1.5.4 directory configuration the directory configuration of this middleware is shown below. library header file for annex a header file for m pd77016 family g723 upd7701x.h: g723_lib.h: smp library samplea.asm: sample source (for annex a) project file (for annex a) samplea.prj: g723_016.lib: library for the m pd77110 and 77116 sampleac.prj: project file (for annex c) sampleac.asm: sample source (for annex c) g723_01x.lib: library for the m pd77018, 77018a, 77019, 77111, 77112, 77113, and 77114 g723 c lib.h: library header file for annex c library files g723_016.lib and g723_01x.lib are included in the following object file. note that g723_016.lib cannot be used for the m pd77016, and g723_01x.lib cannot be used for the m pd77015 and 77017. g723aenc.rel (g.723.1 annex a encoder) g723adec.rel (g.723.1 annex a decoder) g723acom.rel (g.723.1 annex a encoder and decoder shared section) g723cenc.rel (g.723.1 annex c encoder) g723cdec.rel (g.723.1 annex c decoder) g723ccom.rel (g.723.1 annex c encoder and decoder shared section)
users manual u13955ej2v0um00 15 chapter 2 library specifications this chapter describes the function specifications and call conventions of this middleware. 2.1 g.723.1 speech codec processing flow the processing flow of applications that use this middleware is shown in figures 2-1 and 2-2 below. figure 2-1. application processing flow (encoder) voice i/o initialization process ad/da initialization setting interrupt permission library entry specification encode process call g723_encode (call g723_chcod note ) encoder initialization call g723_ini_coder (call g723_ini_chcod note ) start encoder data output process 16 bits 240 samples encoder data input process note g723_ini_chcod and g723_chcod are functions for annex c. be sure to call and use g723_ini_chcod and g723_chcod after g723_ini_coder and g723_encode only when annex c is used.
chapter 2 library specifications 16 users manual u13955ej2v0um00 figure 2-2. application processing flow (decoder) voice i/o initialization process ad/da initialization setting interrupt permission library entry specification decode process (call g723_chdec note ) call g723_decode decoder initialization (call g723_ini_chdec note ) call g723_ini_decod start decoder data input process 16 bits 240 samples decoder data output process note g723_ini_chdec and g723_chdec are functions for annex c. be sure to call and use g723_ini_chdec and g723_chdec before g723_ini_decode and g723_decode only when annex c is used.
chapter 2 library specifications users manual u13955ej2v0um00 17 2.2 function specifications 2.2.1 encoder initialization functions the encoder initialization functions set each encoder constant and initialize the coefficient table and the delay buffer. (1) scratch area initialization function [classification] scratch area initialization process [function name] g723_start_codec [function outline] clears the scratch area used by g.723.1 annex a to 0. [format] call g723_start_codec [argument] none [return value] none [function] clears the scratch area used by g.723.1 annex a to 0. [registers used] r0, dp0, dp4 [hardware resource] maximum stack level: 0 maximum loop stack level: 1 maximum number of repeat: 0 maximum number of cycles: 4000
chapter 2 library specifications 18 users manual u13955ej2v0um00 (2) encoder for g.723.1 annex a initialization function [classification] encoder initialization process [function name] g723_ini_coder [function outline] initializes the ram area and sets the parameters used by g.723.1 annex a encoder. [format] call g723_ini_coder [argument] top address of the x/y static variable area example r0l= staticareax ; *ioarea+g723_static_x_ptr:x = r0l ; r0l= staticareay ; *ioarea+g723_static_y_ptr:x = r0l ; dp0=ioarea ; [return value] none [function] initializes the g.723.1 annex a encoder and sets the parameters. [registers used] r0, r6, r7, dp0, dp4 [hardware resource] maximum stack level: 2 maximum loop stack level: 1 maximum number of repeat: 256 maximum number of cycles: 2000
chapter 2 library specifications users manual u13955ej2v0um00 19 (3) encoder for g.723.1 annex c initialization function [classification] encoder initialization process [function name] g723_ini_chcod [function outline] initializes the ram area and sets the parameters used by g.723.1 annex c encoder. [format] call g723_ini_chcod [argument] top address of the i/o buffer and each set parameter example clr(r0); /*...*/ *enclinebuff+12:x = r0h; /*...*/ *enclinebuff+13:x = r0h; /*---*/ dp0 = libentry; r0l = c_staticareax; /*...*/ *dp0++ = r0l; r0l = c_staticareay; /*...*/ *dp0++ = r0l; r0l = enclinebuff; /*...*/ *dp0++ = r0l; // input buffer r0l = encchanbuff; /*...*/ *dp0++ = r0l; // output buffer r0l = 1; /*...*/ *dp0++ = r0l; // encodesw (0:off 1:on) r0l = 1; /*...*/ *dp0++ = r0l; // high/low select (0:low 1:high) /*---*/ dp4 = bitrateconfig; /* */ *dp0++ = r0h; // number of octets(dummy access) /* */ r0 = *dp4++; rep 6; /* */dp0++ = r0h r0 = *dp4++; /*---*/ dp0 = libentry; [return value] none [function] initializes the g.723.1 annex c encoder and sets the parameters. [registers used] r0, dp0, dp1, dp4 [hardware resource] maximum stack level: 0 maximum loop stack level: 0 maximum number of repeat: 15 maximum number of cycles: 34
chapter 2 library specifications 20 users manual u13955ej2v0um00 2.2.2 decoder initialization functions the decoder initialization functions set each decoder constant and initialize the coefficient table and the delay buffer. (1) decoder for g.723.1 annex a initialization function [classification] decoder initialization process [function name] g723_ini_decod [function outline] initializes the ram area and sets the parameters used by g.723.1 annex a decoder. [format] call g723_ini_decod [argument] top address of the x/y static variable area example r0l= staticareax ; *ioarea+g723_static_x_ptr:x = r0l ; r0l= staticareay ; *ioarea+g723_static_y_ptr:x = r0l ; dp0=ioarea ; [return value] none [function] initializes the g.723.1 annex a decoder and sets the parameters. [registers used] r0, r1, r6, r7, dp0, dp4, dp5 [hardware resource] maximum stack level: 2 maximum loop stack level: 1 maximum number of repeat: 145 maximum number of cycles: 1000
chapter 2 library specifications users manual u13955ej2v0um00 21 (2) decoder for g.723.1 annex c initialization function [classification] decoder initialization process [function name] g723_ini_chdec [function outline] initializes the ram area and sets the parameters used by g.723.1 annex c decoder. [format] call g723_ini_chdec [argument] top address of the i/o buffer and each set parameter example clr(r0); /*---*/ dp0 = libentry + g723c_libentry_decofs; r0l = declinebuff; /*...*/ *dp0++ = r0l; // output buffer r0l = decchanbuff; /*...*/ *dp0++ = r0l; // input buffer /* */ *dp0++ = r0h; // clear error flag /*---*/ dp4 = bitrateconfig; /* */ *dp0++ = r0h; // reserved /* */ r0 = *dp4++; rep 6; /* */ *dp0++ = r0h r0 = *dp4++; /*---*/ dp0 = libentry; [return value] none [function] initializes the g.723.1 annex c decoder and sets the parameters. [registers used] r0, dp0, dp1, dp4 [hardware resource] maximum stack level: 0 maximum loop stack level: 0 maximum number of repeat: 15 maximum number of cycles: 34
chapter 2 library specifications 22 users manual u13955ej2v0um00 2.2.3 encoder functions encoder functions generate the signals that compress the 240 items of sampled speech data that were input into 189, 159, or 32 bits. note that in annex c this is a variable rate. (1) encoder function for g.723.1 annex a [classification] encoder processing section [function name] g723_encode [function outline] compresses the 240 16-bit samples into 189, 159, or 32 bits [format] call g723_encode [argument] top address of the i/o buffer and each set parameter example r0l= encpcmbuff ; set io parameter *ioarea+g723_enc_buff_ptr:x = r0l ; r0l= enclinebuff ; *ioarea+g723_vout_ptr:x= r0l ; *ioarea+g723_use_vad:x= ??? ; 0)vad off, 1)vad on *ioarea+g723_use_hp:x= ??? ; 0)hpf off, 1)hpf on *ioarea+g723_wrk_rate_e:x= ??? ; 0)6.3kbps, 1)5.3kbps dp0=ioarea ; [return value] frame type and number of clipped subframes example ??? = *ioarea+g723_e_frame_type:x ; 0)notx ,1)active ,2)sid ??? = *ioarea+g723_count_clip:x ; clipped sub-frames 0..3 compressed data: output buffers set by arguments [function] compresses the input data from the codec (240 samples 16 bits) into 189, 159, or 32 bits. [registers used] r0, r1, r2, r3, r4, r5, r6, r7, dp0, dp1, dp2, dp3, dp4, dp5, dp6, dp7, dn0, dn1, dn2, dn3, dn4, dn5, dn6, dn7, dmx, dmy [hardware resource] maximum stack level: 7 maximum loop stack level: 4 maximum number of repeat: 256 maximum mips value: 17.5
chapter 2 library specifications users manual u13955ej2v0um00 23 (2) encoder function for g.723.1 annex c [classification] encoder processing section [function name] g723_chcod [function outline] channel codes the data that was compressed by g723_encode [format] call g723_chcod [argument] top address of the i/o buffer and each set parameter example clr(r0); /*...*/ *enclinebuff+12:x = r0h; /*...*/ *enclinebuff+13:x = r0h; /*---*/ dp0 = libentry; r0l = c_staticareax; /*...*/ *dp0++ = r0l; r0l = c_staticareay; /*...*/ *dp0++ = r0l; r0l = enclinebuff; /*...*/ *dp0++ = r0l; // input buffer r0l = encchanbuff; /*...*/ *dp0++ = r0l; // output buffer r0l = 1; /*...*/ *dp0++ = r0l; // encodesw (0:off 1:on) r0l = 1; /*...*/ *dp0++ = r0l; // high/low select (0:low 1:high) /*---*/ dp4 = bitrateconfig; /* */ *dp0++ = r0h; // number of octets(dummy access) /* */ r0 = *dp4++; rep 6; /* */dp0++ = r0h r0 = *dp4++; /*---*/ dp0 = libentry; [return value] number of octets: r2l compressed data: output buffers set by arguments [function] compresses the input data from the codec (240 samples 16 bits) at a variable rate [registers used] r0, r1, r2, r3, r4, r5, r6, r7, dp0, dp1, dp2, dp3, dp4, dp5, dp6, dp7, dn0, dn1, dn2, dn3, dn4, dn5, dn6, dn7, dmx, dmy [hardware resource] maximum stack level: 3 maximum loop stack level: 2 maximum number of repeat: 636 maximum mips value: 1.0
chapter 2 library specifications 24 users manual u13955ej2v0um00 2.2.4 decoder functions decoder functions decompress the signals that were compressed into 189, 159, or 32 bits back into 240 samples 16 bits speech data. (1) decoder function for g.723.1 annex a [classification] decoder processing section [function name] g723_decode [function outline] decompresses the 189, 159, or 32 bits back into 240 16-bit samples [format] call g723_decode [argument] top address of the i/o buffer and each set parameter example r0l= decpcmbuff ; set io parameter *ioarea+g723_dec_buff_ptr:x = r0l ; r0l= declinebuff ; *ioarea+g723_vinp_ptr:x= r0l ; *ioarea+g723_use_pf:x= ??? ; 0)psf off, 1)psf on *ioarea+g723_crc_result:x = ??? ;crc_result,0)normal,else)err dp0=ioarea ; [return value] frame type, work rate, and number of error frames example ???= *ioarea+g723_d_frame_type:x ; 0)notx ,1)active ,2)sid ???= *ioarea+g723_wrk_rate_d:x ; 0)6.3kbps, 1)5.3kbps ???= *ioarea+err_frm_count:x ; num of error frame 0..0x7ff decompressed data: output buffers set by arguments [function] decompresses the data that was compressed into 189, 159, or 32 bits back into speech data (240 samples 16 bits) [registers used] r0, r1, r2, r3, r4, r5, r6, r7, dp0, dp1, dp2, dp3, dp4, dp5, dp6, dp7, dn0, dn1, dn2, dn3, dn4, dn5, dn6, dn7, dmx [hardware resource] maximum stack level: 4 maximum loop stack level: 3 maximum number of repeat: 240 maximum mips value: 1.5
chapter 2 library specifications users manual u13955ej2v0um00 25 (2) decoder function for g.723.1 annex c [classification] decoder process section [function name] g723_chdec [function outline] performs channel decoding, and creates the code that extracts the g723_decode function [format] call g723_chdec [argument] top address of the i/o buffer and each set parameter example clr(r0); /*---*/ dp0 = libentry + g723c_libentry_decofs; r0l = declinebuff; /*...*/ *dp0++ = r0l; // output buffer r0l = decchanbuff; /*...*/ *dp0++ = r0l; // input buffer /* */ *dp0++ = r0h; // clear error flag /*---*/ dp4 = bitrateconfig; /* */ *dp0++ = r0h; // reserved /* */ r0 = *dp4++; rep 6; /* */ *dp0++ = r0h r0 = *dp4++; /*---*/ dp0 = libentry; [return value] mode (0: 6.3 k, 1: 5.3 k, 2: sid): r0l final address of bit stream + 1: r1l decompressed data: output buffers set by arguments [function] decompresses the data that was compressed by a variable rate back into speech data (240 samples 16 bits) [registers used] r0, r1, r2, r3, r4, r5, r6, r7, dp0, dp1, dp2, dp3, dp4, dp5, dp6, dp7, dn0, dn1, dn2, dn3, dn4, dn5, dn6, dn7, dmx [hardware resource] maximum stack level: 4 maximum loop stack level: 3 maximum number of repeat: 15 maximum mips value: 1.5
chapter 2 library specifications 26 users manual u13955ej2v0um00 2.2.5 version acquisition function the version acquisition function returns the version of the library. [classification] version information acquisition [function name] g723_getversion [function outline] restores the version of the library [format] call g723_getversion [argument] none [return value] r0h major version number r0l minor version number [function] returns the version number of this middleware with a 32-bit value. example if r0 = 0x000x00010x0100 then version: v1.01 [registers used] r0
chapter 2 library specifications users manual u13955ej2v0um00 27 2.3 description of external interface the parameters that extract functions g723_encode and g723_decode for g.723.1 annex a, and functions g723_chcod and g723_chdec for g.723.1 annex c at the time that each function is called are described here. 2.3.1 extraction parameters for g.723.1 annex a functions secure scratch areas as follows. scratch areas x and y require "align at 0x20". scratch area x: 1024-word area labeled as "lib_scratch _x" in the x memory scratch area y: 1024-word area labeled as "lib_scratch _y" in the y memory secure static areas as follows. static area x requires "align at 0x20" and static area y requires "align at 0x200". make the address of "lib_scratch _x" the same as that of "lib_scratch _y". table 2-1. extraction parameters for g.723.1 annex a functions function classification symbol note 6 (offset address) setting value encoder/decoder shared parameters static x memory area control input note 1 g723_static_x_ptr x memory addresses static y memory area control input note 1 g723_static_y_ptr y memory addresses encoder parameters encoder input buffer control input g723_enc_buff_ptr x memory addresses encoder output buffer control input g723_vout_ptr x memory addresses coding bit rate control input g723_wrk_rate_e 0: 6.3 kbps, 1: 5.3 kbps vad control control input note 2 g723_use_vad 0: vad off, 1: vad on preprocessing hpf control control input note 2 g723_use_hp 0: hpf off, 1: hpf on encode frame type status output g723_e_frame_type 0: no transfer, 1: active, 2: sid number of clipped frames status output g723_count_clip 0 to 3 decoder parameters decoder output buffer control input g723_dec_buff_ptr x memory addresses decoder input buffer control input g723_vinp_ptr x memory addresses postprocessing filter control control input note 3 g723_use_pf 0: filter off, 1: filter on crc flag control input g723_crc_result 0: normal, else: error decode frame type status output g723_d_frame_type 0: no transfer, 1: active, 2: sid decode bit rate status output note 4 g723_wrk_rate_d 0: 6.3 kbps, 1: 5.3 kbps frame error count status output note 5 g723_err_frm_count 0 to 0x7fff notes 1. cannot be changed following g723_start_codec. 2. cannot be changed during encoding. 3. cannot be changed during decoding. 4. valid only when there are active frames. 5. reset to 0 if normal frame acknowledged. 6. symbols show the value offset from the value of dp0 when each function is called.
chapter 2 library specifications 28 users manual u13955ej2v0um00 2.3.2 extraction parameters for g.723.1 annex c functions secure scratch areas as follows. scratch areas x and y require "align at 0x20". scratch area x: 1108-word area labeled as "lib_scratch _x" in the x memory scratch area y: 1024-word area labeled as "lib_scratch _y" in the y memory secure a scratch area consistent with whichever is larger: annex a or annex c (x indicates annex c and y indicates annex a). table 2-2. extraction parameters for g.723.1 annex c functions (1/2) function classification symbol note 4 (offset address) setting value encoder/decoder shared parameters static x memory area control input note 1 g723c_libstatic_x x memory addresses static y memory area control input note 1 g723c_libstatic_y y memory addresses encoder parameters encoder input buffer control input g723c_libencinbuffer x memory addresses encoder output buffer control input g723c_libencoutbuffer x memory addresses coding drive control control input g723c_libencodersw 0: off, 1: on high-level/low-level switch control input note 2 g723c_libenchighlow 0: low-level, 1: high-level coding result data size control input g723c_libencoutsize number of bits channel upper rate when coding at 6.3 kbps control input note 3 g723c_libenculim63 number of bps channel lower rate when coding at 6.3 kbps control input note 3 g723c_libencllim63 number of bps channel upper rate when coding at 5.3 kbps control input note 3 g723c_libenculim53 number of bps channel lower rate when coding at 5.3 kbps control input note 3 g723c_libencllim53 number of bps channel upper rate when coding at sid control input note 3 g723c_libenculimsid number of bps channel lower rate when coding at sid control input note 3 g723c_libencllimsid number of bps notes 1. cannot be changed following g723_start_codec. 2. the high-level/low-level switch is common to 6.3 kbps, 5.3 kbps, and sid. 3. the values set for the upper and lower channel rate limits must be within the following range when encoding/decoding: for 6.3 kbps: above 7034 and below 20634 for 5.3 kbps: above 6000 and below 17534 for sid: above 1600 and below 4334 4. symbols show the value offset from the value of dp0 when each function is called.
chapter 2 library specifications users manual u13955ej2v0um00 29 table 2-2. extraction parameters for g.723.1 annex c functions (2/2) function classification symbol note 3 (offset address) setting value decoder parameters decoder output buffer control input g723c_libdecoutbuffer x memory addresses decoder input buffer control input g723c_libdecinbuffer x memory addresses decode result error display status output note 1 g723c_libdecerrorinfo bit 2: fii, bit 1: efi, bit 0: bfi reserved C g723c_libdecreserved C channel upper rate when decoding at 6.3 kbps control input note 2 g723c_libdeculim63 number of bps channel lower rate when decoding at 6.3 kbps control input note 2 g723c_libdecllim63 number of bps channel upper rate when decoding at 5.3 kbps control input note 2 g723c_libdeculim53 number of bps channel lower rate when decoding at 5.3 kbps control input note 2 g723c_libdecllim53 number of bps channel upper rate when decoding at sid control input note 2 g723c_libdeculimsid number of bps channel lower rate when decoding at sid control input note 2 g723c_libdecllimsid number of bps notes 1. when decoding, input the value from the decode result error display as the crc value of the code data for decoding. the decoding processing of the frames that correspond to this error display is the frame compensation process. 2. the values set for the upper and lower channel rate limits must be within the following range when encoding/decoding: for 6.3 kbps: above 7034 and below 20634 for 5.3 kbps: above 6000 and below 17534 for sid: above 1600 and below 4334 3. symbols show the value offset from the value of dp0 when each function is called.
chapter 2 library specifications 30 users manual u13955ej2v0um00 2.4 i/o data format the i/o data format of the itu-t-recommended g.723.1 is outlined here. 2.4.1 encoder input/decoder output data format input the encoder-input data, which is pcm data that has been sampled at 8 khz, in a 16-bit 240-sample format. the decoder output data is output in the form of 16-bit 240-sample pcm data that has been sampled at 8 khz. 2.4.2 encoder output/decoder input data format the format of compressed data for encoder output and decoder input is as follows. figure 2-3. compressed data frame format octet#2 octet#1 octet#4 octet#3 octet#2n octet#2nC1 remark 2n: frame byte number. table 2-3. bit rate and frame byte number of g.723.1 annex a compressed data bit rate frame byte number 6.3 kbps 24 5.3 kbps 20 sid 4 table 2-4. bit rate and frame byte number of g.723.1 annex c compressed data bit rate frame byte number 6.3 kbps 27 to 78 5.3 kbps 23 to 66 sid 6 to 17
chapter 2 library specifications users manual u13955ej2v0um00 31 (1) compression format of active frame data the formats of the 6.3 kbps speech compression data (189-bit data) and the 5.3 kbps speech compression data (159-bit data), which are the encoder function output and decoder function input respectively, are shown in tables 2-5 and 2-6 below. refer to itu-t recommendations for compression data details. table 2-5. 6.3 kbps speech compression data format transmitted octets parx_by, , 1 lpc_b5 to lpc_b0, vadflag_b0, rateflag_b0 2 lpc_b13 to lpc_b6 3 lpc_b21 to lpc_b14 4 acl0_b5 to acl0_b0, lpc_b23, lpc_b22 5 acl2_b4 to acl2_b0, acl1_b1, acl1_b0, acl0_b6 6 gain0_b3 to gain0_b0, acl3_b1, acl3_b0, acl2_b6, acl2_b5 7 gain0_b11 to gain0_b4 8 gain1_b7 to gain1_b0 9 gain2_b3 to gain2_b0, gain1_b11 to gain1_b8 10 gain2_b11 to gain2_b4 11 gain3_b7 to gain3_b0 12 grid3_b0, grid2_b0, grid1_b0, grid0_b0, gain3_b11 to gain3_b8 13 msbpos_b6 to msbpos_b0, ub note 14 pos0_b1, pos0_b0, msbpos_b12 to msbpos_b7 15 pos0_b9 to pos0_b2 16 pos1_b2, pos1_b0, pos0_b15 to pos0_b10 17 pos1_b10, pos1_b3 18 pos2_b3 to pos2_b0, pos1_b13 to pos1_b11 19 pos2_b11 to pos2_b4 20 pos3_b3 to pos3_b0, pos2_b15 to pos2_b12 21 pos3_b11 to pos3_b4 22 psig0_b5 to psig0_b0, pos3_b13, pos3_b12 23 psig2_b2 to psig2_b0, psig1_b4 to psig1_b0 24 psig3_b4 to psig3_b0, psig2_b5 to psig2_b3 note ub designates an unused bit (value 0).
chapter 2 library specifications 32 users manual u13955ej2v0um00 table 2-6. 5.3 kbps speech compression data format transmitted octets parx_by, , 1 lpc_b5 to lpc_b0, vadflag_b0, rateflag_b0 2 lpc_b13 to lpc_b6 3 lpc_b21 to lpc_b14 4 acl0_b5 to acl0_b0, lpc_b23, lpc_b22 5 acl2_b4 to acl2_b0, acl1_b1, acl1_b0, acl0_b6 6 gain0_b3 to gain0_b0, acl3_b1, acl3_b0, acl2_b6, acl2_b5 7 gain0_b11 to gain0_b4 8 gain1_b7 to gain1_b0 9 gain2_b3 to gain2_b0, gain1_b11 to gain1_b8 10 gain2_b11 to gain2_b4 11 gain3_b7 to gain3_b0 12 grid3_b0, grid2_b0, grid1_b0, grid0_b0, gain3_b11 to gain3_b8 13 pos0_b7 to pos0_b0 14 pos1_b3 to pos1_b0, pos0_b11 to pos0_b8 15 pos1_b11 to pos1_b4 16 pos2_b7 to pos2_b0 17 pos3_b3 to pos3_b0, pos2_b11 to pos2_b8 18 pos3_b11 to pos3_b4 19 psig1_b3 to psig1_b0, psg0_b3 to psg0_b0 20 psig3_b3 to psig3_b0, psig2_b3 to psig2_b0
chapter 2 library specifications users manual u13955ej2v0um00 33 (2) sid frame compression format the format of the 32-bit inactive frame data, which is the encoder function output and decoder function input, is shown in table 2-7 below. refer to itu-t recommendations for compressed data details. note, however, that "0x3" is returned to "transmitted octets = 1" and "0x0" to "transmitted octets = 2 to 4" when g723_e_frame_type = 0 or g723_d_frame_type = 0. table 2-7. bit allocation of sid data transmitted octets parx_by, 1 lpc_b5 to lpc_b0, vadflag_b0, rateflag_b0 2 lpc_b13 to lpc_b6 3 lpc_b21 to lpc_b14 4 gain_b5 to gain_b0, lpc_b23, lpc_b22 (3) g.723.1 annex c (channel codec) additional compression data format the format of annex c data, which is the encoder function output and decoder function input, is shown in table 2-8 below. refer to itu-t recommendations for compressed data details. table 2-8. bit allocation of annex c compression data transmitted octets channel bit 1 ucb[7], ucb[6], ucb[5], ucb[4] , ucb[3], ucb[2], ucb[1], ucb[0] 2 u[2], u[1], u[0], ucb[12], ucb[11], ucb[10], ucb[9] ,ucb[8] 3 u[10], u[9], u[8], u[7], u[6], u[5], u[4], u[3] mp/8 + 2 , , u[mp], u[mpC1], u[mpC2], , , :: m all /8 + 2 ub, ub ,ub, u[m all C1], u[m all C2], u[m all C3], u[m all C4], u[m all C5] remark ub designates an unused bit (value 0). the bit rate of a protected bit string is (m aii + 13) 1000/30 bps.
34 users manual u13955ej2v0um00 [memo]
users manual u13955ej2v0um00 35 chapter 3 installation 3.1 installation procedure this middleware is only offered in a 3.5-inch (1.44 mb) floppy disk format. the procedure for installing this disk in the host machine is as follows. (1) set this disk in the floppy disk drive. copy the file under a directory that uses software tools (c:\dsptools, for example). an example of when the file was copied from a drive to c drive is shown below. a:\>xcopy /s *.* c:\dsptools (2) check that the file has been copied. refer to 1.5.4 directory configuration for details of each directory. a:\>dir c:\dsptools 3.2 sample creation procedure the sample program is installed in the sample directory (refer to appendix sample program source for details of the samplea.asm and sampleac.asm source programs). the sample program is able to connect speech sources such as cds and dats with speakers, and compress/decompress the speech source in real time. figure 3-1. sample program evaluation system speaker speech source evaluation board line output dsp codec line input
chapter 3 installation 36 users manual u13955ej2v0um00 the following is an example of how to build a sample program for this middleware. (1) activate the wb77016 (workbench). (2) open the samplea.prj (sampleac.prj) project file. example specify samplea.prj (sampleac.prj) with the open project command from the project menu. (3) execute the build function and check that samplea.lnk (sampleac.lnk) has been created. example when the build all command is selected from the make menu, the samplea.lnk (sampleac.lnk) file is created. (4) download the program to the evaluation board. 3.3 symbol naming conventions the symbols, etc., in this library are allocated names in accordance with the conventions outlined below. be careful not to duplicate these names when this middleware is being used in combination with other applications. table 3-1. symbol names convention classification g.723.1 annex a g.723.1 annex c function name g723_ g723_ch macro, constant name g723_ section name _ _ g723_ _ _ g723_c
users manual u13955ej2v0um00 37 appendix sample program source a.1 for g.723.1 + annex a (samplea.asm) /*----------------------------------------------------------------------------- */ /* file information */ /*----------------------------------------------------------------------------- */ /* name : samplea.asm */ /* type : asm programming language source code */ /* version : v1.00 */ /* date : 1998 june 10 */ /* cpu : upd7701x family */ /* assembler : wb77016 ver2.21 */ /* about : nec upd7701x family g723.1 speech codec middle-ware library */ /* sample program [1ch, off-line mode] */ /*----------------------------------------------------------------------------- */ /* copyright (c) nec corporation 1995,1996,1997,1998 */ /* nec confidential and proprietar */ /* all rights reserved by nec coporation */ /* use of copyright notice does not evidence publication */ /*----------------------------------------------------------------------------- */ /*---- include files ----*/ #include "upd77016.h" #include "g723_lib.h" /*---- global variables ----*/ public lib_scratch_x /* scrach area x */ public lib_scratch_y /* scrach area y */ /*---- global functions ----*/ extrn g723_getversion /* get version function */ extrn g723_start_codec /* start g723 functions */ extrn g723_ini_coder /* initialize g723 coder variables */ extrn g723_ini_decod /* initialize g723 decoder variables */ extrn g723_encode /* encode 1 frame */ extrn g723_decode /* decode 1 frame */ $eject /**/ /*****************************************************************************/ /* vector table */ /*****************************************************************************/ vct_ix imseg at 0x0200 call init_proc ; reset jmp g723_proc ; nop ; nop ; reti ; not used nop ; nop ; nop ; reti ; not used nop ;
appendix sample program so urce 38 users manual u13955ej2v0um00 nop ; nop ; reti ; not used nop ; nop ; nop ; reti ; int0 nop ; nop ; nop ; reti ; int1 nop ; nop ; nop ; reti ; int2 nop ; nop ; nop ; reti ; int3 nop ; nop ; nop ; reti ; si#1 nop ; nop ; nop ; reti ; so#1 nop ; nop ; nop ; reti ; si#2 nop ; nop ; nop ; reti ; so#2 nop ; nop ; nop ; reti ; host in nop ; nop ; nop ; reti ; host out nop ; nop ; nop ; reti ; not used nop ; nop ; nop ; reti ; not used nop ; nop ; nop ;
appendix sample program so urce users manual u13955ej2v0um00 39 /*****************************************************************************/ /* g723 off-line process */ /*****************************************************************************/ smp_ix imseg init_proc: clr(r0) ; no wait *dwtr:x = r0l ; *iwtr:x = r0l ; r0l = hst_wait ; wait mode *hst:x = r0l ; ret ; $eject /**/ /*----------------------------------------------------------------------------- */ /* scratch_area / static_area / io_buffer */ /* !!! 'lib_scratch_x' must be equal to 'lib_scratch_y' !!! */ /*----------------------------------------------------------------------------- */ scratch_x xramseg align at 0x020 lib_scratch_x: ds g723_scratch_x_bufsize scratch_y yramseg align at 0x020 lib_scratch_y: ds g723_scratch_y_bufsize static_x xramseg align at 0x020 staticareax: ds g723_static_x_bufsize static_y yramseg align at 0x200 staticareay: ds g723_static_y_bufsize io_area_x xramseg ioarea: ds g723_iotable_size io_buff_x xramseg encpcmbuff: ds g723_frame decpcmbuff: ds g723_frame enclinebuff: ds 24/2 declinebuff: ds 24/2 /*----------------------------------------------------------------------------- */ /* variables */ /*----------------------------------------------------------------------------- */ smp_xe1 xramseg wrkmode: ds 1
appendix sample program so urce 40 users manual u13955ej2v0um00 /*****************************************************************************/ /* g723 off-line process */ /*****************************************************************************/ smp_ix imseg g723_proc: call g723_start_codec ; need only for simulation test r0l = *hdt:x ; wrkmode 1)cod ,2)dec *wrkmode:x = r0l ; ;; call g723_getversion ; library version ;; *hdt:x = r0h ; comment_out for ;; *hdt:x = r0l ; simulator test r0l = staticareax ; *ioarea+g723_static_x_ptr:x = r0l ; static area x r0l = staticareay ; *ioarea+g723_static_y_ptr:x = r0l ; static area y r0l = encpcmbuff ; *ioarea+g723_enc_buff_ptr:x = r0l ; pcm buffer for encode r0l = enclinebuff ; *ioarea+g723_vout_ptr:x= r0l ; code buffer for encode r0l = *hdt:x ; *ioarea+g723_use_hp:x= r0l ; usehp 0)no , 1)usehp r0l = *hdt:x ; *ioarea+g723_use_vad:x= r0l ; usevad 0)no , 1)usehp r0l = decpcmbuff ; *ioarea+g723_dec_buff_ptr:x = r0l ; pcm buffer for decode r0l = declinebuff ; *ioarea+g723_vinp_ptr:x = r0l ; code buffer for decode r0l = *hdt:x ; *ioarea+g723_use_pf:x= r0l ; usepf 0)no , 1)usepf r0l = *wrkmode:x ; r0 = r0 & 0x0001 ; if( r0==0 ) jmp ini_lbc_dec ; /*---*/ dp0 = ioarea ; call g723_ini_coder ; jmp lbc_loop ; ini_lbc_dec: /*---*/ dp0 = ioarea ; call g723_ini_decod ; lbc_loop: r0 = *hdt:x ; control 0)stop, 1)continue if( r0==0 ) jmp lbc_end ; r0l = *wrkmode:x ; r0 = r0 & 0x0001 ; if( r0==0 ) jmp lbc_dec ; call getpcmdata ; r0l = *hdt:x ; *ioarea+g723_wrk_rate_e:x = r0l ; wrkrate 0)6.3, 1)5.3 [kbps]
appendix sample program so urce users manual u13955ej2v0um00 41 /*---*/ dp0 = ioarea ; call g723_encode ; call putlinedata ; ;; r0l = *ioarea+g723_e_frame_type:x ; comment_out for ;; *hdt:x = r0l ; simulator test jmp lbc_next ; lbc_dec: r0l = *wrkmode:x ; r0 = r0 & 0x0002 ; if( r0==0 ) jmp lbc_next ; call getlinedata ; r0l = *hdt:x ; *ioarea+g723_crc_result:x = r0l ; crc_result 0)normal, else)err /*---*/ dp0 = ioarea ; call g723_decode ; call putpcmdata ; ;; r0l = *ioarea+g723_d_frame_type:x ; comment_out for ;; *hdt:x = r0l ; simulator test ;; r0l = *ioarea+g723_wrk_rate_d:x ; ;; *hdt:x = r0l ; ;; r0l = *ioarea+g723_err_frm_count:x ; ;; *hdt:x = r0l ; lbc_next: jmp lbc_loop ; lbc_end: jmp $ ; $eject /**/ /*****************************************************************************/ /* input pcm data for encode process */ /*****************************************************************************/ smp_ix imseg getpcmdata: /*---*/ dp0 = encpcmbuff ; loop g723_frame { ; r0l = *hdt:x ; /* */ *dp0++ = r0l ; } ret ; /*****************************************************************************/ /* output decoded pcm data */ /*****************************************************************************/ smp_ix imseg putpcmdata: /*---*/ dp0 = decpcmbuff ; loop g723_frame { ; /* */ r0l = *dp0++ ;
appendix sample program so urce 42 users manual u13955ej2v0um00 *hdt: = r0l ; } ret ; /*****************************************************************************/ /* input code data for decode process */ /*****************************************************************************/ smp_ix imseg getlinedata: /*---*/ dp0 = declinebuff ; loop 24/2 { ; r0l = *hdt:x ; /* */ *dp0++ = r0l ; } ret ; /*****************************************************************************/ /* output encoded code data */ /*****************************************************************************/ smp_ix imseg putlinedata: /*---*/ dp0 = enclinebuff ; loop 24/2 { ; /* */ r0l = *dp0++ ; *hdt:x = r0l ; } ret ; end
appendix sample program so urce users manual u13955ej2v0um00 43 a.2 for g.723.1 + annex a + annex c (sampleac.asm) /*----------------------------------------------------------------------------- */ /* file information */ /*----------------------------------------------------------------------------- */ /* name : sampleac.asm */ /* type : asm programming language source code */ /* version : v1.00 */ /* date : 1998 oct 10 */ /* cpu : upd7701x family */ /* assembler : wb77016 ver2.21 */ /* about : nec upd7701x family g723.1 speech codec middle-ware library */ /* sample program [1ch, off-line mode] */ /*----------------------------------------------------------------------------- */ /* copyright (c) nec corporation 1995,1996,1997,1998 */ /* nec confidential and proprietary */ /* all rights reserved by nec coporation */ /* use of copyright notice does not evidence publication */ /*----------------------------------------------------------------------------- */ /*---- include files ----*/ #include "upd77016.h" #include "g723_lib.h" #include "g723clib.h" /*---- global variables ----*/ public lib_scratch_x /* scrach area x */ public lib_scratch_y /* scrach area y */ /*---- global functions ----*/ extrn g723_getversion /* get version function */ extrn g723_start_codec /* start g723 functions */ extrn g723_ini_coder /* initialize g723 coder variables*/ extrn g723_ini_decod /* initialize g723 decoder variables */ extrn g723_encode /* encode 1 frame*/ extrn g723_decode /* decode 1 frame*/ $eject /**/ /*****************************************************************************/ /* vector table */ /*****************************************************************************/ vct_ix imseg at 0x0200 call init_proc ; reset jmp g723_proc ; nop ; nop ; reti ; not used nop ; nop ; nop ; reti ; not used nop ; nop ; nop ; reti ; not used
appendix sample program so urce 44 users manual u13955ej2v0um00 nop ; nop ; nop ; reti ; int0 nop ; nop ; nop ; reti ; int1 nop ; nop ; nop ; reti ; int2 nop ; nop ; nop ; reti ; int3 nop ; nop ; nop ; reti ; si#1 nop ; nop ; nop ; reti ; so#1 nop ; nop ; nop ; reti ; si#2 nop ; nop ; nop ; reti ; so#2 nop ; nop ; nop ; reti ; host in nop ; nop ; nop ; reti ; host out nop ; nop ; nop ; reti ; not used nop ; nop ; nop ; reti ; not used nop ; nop ; nop ; /*****************************************************************************/ /* g723 off-line process */ /*****************************************************************************/ smp_ix imseg
appendix sample program so urce users manual u13955ej2v0um00 45 init_proc: clr(r0) ; no wait *dwtr:x = r0l ; *iwtr:x = r0l ; r0l = hst_wait ; wait mode *hst:x = r0l ; ret ; $eject /**/ /*----------------------------------------------------------------------------- */ /* scratch_area / static_area / io_buffer */ /* !!! 'lib_scratch_x' must be equal to 'lib_scratch_y' !!! */ /*----------------------------------------------------------------------------- */ scratch_x xramseg align at 0x020 lib_scratch_x: ;; ds g723_scratch_x_bufsize ds g723c_scratch_x_bufsize ; is bigger than g723_scratch_x_bufsize scratch_y yramseg align at 0x020 lib_scratch_y: ds g723_scratch_y_bufsize static_x xramseg align at 0x020 staticareax: ds g723_static_x_bufsize c_staticareax: ds g723c_static_x_bufsize ; annex c static_y yramseg align at 0x200 staticareay: ds g723_static_y_bufsize c_staticareay: ds g723c_static_y_bufsize ; annex c io_area_x xramseg ioarea: ds g723_iotable_size libentry: ds g723c_libentry_size ; annex c io_buff_x xramseg encpcmbuff: ds g723_frame decpcmbuff: ds g723_frame enclinebuff: ds 24/2 + 2 declinebuff: ds 24/2 + 1 encchanbuff: ds 48 ; annex c decchanbuff: ds 48 ; annex c /*----------------------------------------------------------------------------- */ /* variables */ /*----------------------------------------------------------------------------- */ smp_xe1 xramseg wrkmode:
appendix sample program so urce 46 users manual u13955ej2v0um00 ds 1 /*------------------------------------------------------------*/ /* annex c initialization */ /*------------------------------------------------------------*/ annexc_const yramseg bitrateconfig: dw 77, 27, 65, 23, 16, 6 /* channel rate limits */ initc imseg initannexc: clr(r0); /*...*/ *enclinebuff+12:x = r0h; /*...*/ *enclinebuff+13:x = r0h; /*---*/ dp0 = libentry; r0l = c_staticareax; /*...*/ *dp0++ = r0l; r0l = c_staticareay; /*...*/ *dp0++ = r0l; r0l = enclinebuff; /*...*/ *dp0++ = r0l; // input buffer r0l = encchanbuff; /*...*/ *dp0++ = r0l; // output buffer r0l = 1; /*...*/ *dp0++ = r0l; // encodesw (0:off 1:on) r0l = 1; /*...*/ *dp0++ = r0l; // high/low select (0:low 1:high) /*---*/ dp4 = bitrateconfig; /* */ *dp0++ = r0h; // number of octets(dummy access) /* */ r0 = *dp4++; rep 6; /* */ *dp0++ = r0h r0 = *dp4++; /*---*/ dp0 = libentry; call g723_ini_chcod; clr(r0); /*---*/ dp0 = libentry + g723c_libentry_decofs; r0l = declinebuff; /*...*/ *dp0++ = r0l; // output buffer r0l = decchanbuff; /*...*/ *dp0++ = r0l; // input buffer /* */ *dp0++ = r0h; // clear error flag /*---*/ dp4 = bitrateconfig; /* */ *dp0++ = r0h; // reserved /* */ r0 = *dp4++; rep 6; /* */ *dp0++ = r0h r0 = *dp4++; /*---*/ dp0 = libentry; call g723_ini_chdec; ret;
appendix sample program so urce users manual u13955ej2v0um00 47 /*****************************************************************************/ /* g723 off-line process */ /*****************************************************************************/ smp_ix imseg g723_proc: call g723_start_codec ; need only for simulation test r0l = *hdt:x ; wrkmode 1)cod ,2)dec *wrkmode:x = r0l ; ;; call g723_getversion ; library version ;; *hdt:x = r0h ; comment_out for ;; *hdt:x = r0l ; simulator test r0l = staticareax ; *ioarea+g723_static_x_ptr:x = r0l ; static area x r0l = staticareay ; *ioarea+g723_static_y_ptr:x = r0l ; static area y r0l = encpcmbuff ; *ioarea+g723_enc_buff_ptr:x = r0l ; pcm buffer for encode r0l = enclinebuff ; *ioarea+g723_vout_ptr:x = r0l ; code buffer for encode r0l = *hdt:x ; *ioarea+g723_use_hp:x = r0l ; usehp 0)no , 1)usehp r0l = *hdt:x ; *ioarea+g723_use_vad:x= r0l ; usevad 0)no , 1)usehp r0l = decpcmbuff ; *ioarea+g723_dec_buff_ptr:x = r0l ; pcm buffer for decode r0l = declinebuff ; *ioarea+g723_vinp_ptr:x = r0l ; code buffer for decode r0l = *hdt:x ; *ioarea+g723_use_pf:x = r0l ; usepf 0)no , 1)usepf ;; setup lib-entry for annex c call initannexc; r0l = *wrkmode:x ; r0 = r0 & 0x0001 ; if( r0==0 ) jmp ini_lbc_dec ; /*---*/ dp0 = ioarea ; call g723_ini_coder ; jmp lbc_loop ; ini_lbc_dec: /*---*/ dp0 = ioarea ; call g723_ini_decod ; lbc_loop: r0 = *hdt:x ; control 0)stop, 1)continue if( r0==0 ) jmp lbc_end ; r0l = *wrkmode:x ; r0 = r0 & 0x0001 ; if( r0==0 ) jmp lbc_dec ;
appendix sample program so urce 48 users manual u13955ej2v0um00 call getpcmdata ; r0l = *hdt:x ; *ioarea+g723_wrk_rate_e:x = r0l ; wrkrate 0)6.3, 1)5.3 [kbps] /*---*/ dp0 = ioarea ; call g723_encode ; /*---*/ dp0 = libentry ; annex c call g723_chcod ; ; call putlinedata ; comment for annex c call putchanneldata; ;; r0l = *ioarea+g723_e_frame_type:x ; comment_out for ;; *hdt:x = r0l ; simulator test jmp lbc_next ; lbc_dec: r0l = *wrkmode:x ; r0 = r0 & 0x0002 ; if( r0==0 ) jmp lbc_next ; ; call getlinedata ; call getchanneldata ; /*---*/ dp0 = libentry ; annex c call g723_chdec ; ; r0l = *hdt:x ; r0l = *(libentry + g723c_libentry_errinfo):x; *ioarea+g723_crc_result:x = r0l ; crc_result 0)normal, else)err /*---*/ dp0 = ioarea ; call g723_decode ; call putpcmdata ; ;; r0l = *ioarea+g723_d_frame_type:x ; comment_out for ;; *hdt:x = r0l ; simulator test ;; r0l = *ioarea+g723_wrk_rate_d:x ; ;; *hdt:x = r0l ; ;; r0l = *ioarea+g723_err_frm_count:x ; ;; *hdt:x = r0l ; lbc_next: jmp lbc_loop ; lbc_end: nop ; nop ; nop ; nop ; nop ; nop ; nop ; halt ;
appendix sample program so urce users manual u13955ej2v0um00 49 $eject /**/ /*****************************************************************************/ /* input pcm data for encode process */ /*****************************************************************************/ smp_ix imseg getpcmdata: /*---*/ p0 = encpcmbuff ; loop g723_frame { ; r0l = *hdt:x ; /* */ *dp0++ = r0l ; } ret ; /*****************************************************************************/ /* output decoded pcm data */ /*****************************************************************************/ smp_ix imseg putpcmdata: /*---*/ dp0 = decpcmbuff ; loop g723_frame { ; /* */ r0l = *dp0++ ; *hdt:x = r0l ; } ret ; /*****************************************************************************/ /* input code data for decode process */ /*****************************************************************************/ smp_ix imseg getlinedata: /*---*/ dp0 = declinebuff ; loop 24/2 { ; r0l = *hdt:x ; /* */ *dp0++ = r0l ; } ret ; /*****************************************************************************/ /* output encoded code data */ /*****************************************************************************/ smp_ix imseg putlinedata: /*---*/ dp0 = enclinebuff ; loop 24/2 { ; /* */ r0l = *dp0++ ; *hdt:x = r0l ; } ret ; /*==================================================================** * annex c *===================================================================*/ smp_ix imseg putchanneldata:
appendix sample program so urce 50 users manual u13955ej2v0um00 /*---*/ p0 = encchanbuff; clr(r0); /*...*/ r0l = *(libentry + g723c_libentry_outsize):x; r0 = r0 + 1; r0 = r0 srl 1; loop r0l { /*...*/ r0l = *dp0++; /*...*/ *hdt:x = r0l; } ret; getchanneldata: /*---*/ dp0 = decchanbuff; clr(r0); r0l = *hdt:x; /* r0l = the number of words */ loop r0l { /*...*/ r0l = *hdt:x; /*...*/ *dp0++ = r0l; } ret; end
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-2719-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-6462-6829 asian nations except philippines nec electronics singapore pte. ltd. fax: +65-250-3583 japan nec semiconductor technical hotline fax: 044-435-9608 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 00.6 name company from: tel. fax facsimile message


▲Up To Search▲   

 
Price & Availability of AP77016-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]


 . . . . .
  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