1 / 17

AMR (Adaptive Multi-Rate]

AMR (Adaptive Multi-Rate]. 작성자 : 박 민 호. What is AMR?. Adaptive Multi-Rate (AMR) is a Audio data compression scheme optimized for speech coding. It has eight bit rates, 12.2, 10.2, 7.95, 7.40, 6.70, 5.90, 5.15 and 4.75 kbit/s.

gyala
Download Presentation

AMR (Adaptive Multi-Rate]

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. AMR(Adaptive Multi-Rate] 작성자 : 박 민 호

  2. What is AMR? • Adaptive Multi-Rate (AMR) is a Audio data compression scheme optimized for speech coding. • It has eight bit rates, 12.2, 10.2, 7.95, 7.40, 6.70, 5.90, 5.15 and 4.75 kbit/s. • The bitstream is based on frames which contain 160 sample and are 20 milliseconds long.

  3. HEADER FRAME 1 FRAME 2 FRAME N Storage format Header contain only a magic number that must consist of ASCII character string: “#!AMR\n” (or 0x2321414d520a)

  4. PCM sample of 20ms (8,000Hz, 16bit, Mono) MR122 : 32byte MR102 : 27byte MR795 : 21byte MR740 : 20byte MR670 : 18byte MR590 : 16byte MR515 : 14byte MR475 : 13byte Encoding Transformation

  5. Rate Information (1byte) Data (Total size of each rate – 1byte) Transformation 20ms Sample ▶160 Sample Data ▶160 * 2byte(16bit) = 320byte Encoding

  6. init_amr function • void init_amr(HANDLE* handle, int dtx) • Retrieve a handle for encode function and decode function. • handle parameter is the pointer to the memory that needed for encoding and decoding process. • dtx parameter is the flag that determine dtx mode. • value 0 : disable dtx mode • value 1 : enable dtx mode • Exampleinit_amr(&h, dtx);

  7. encoder function • int encoder(HANDLE handle, short* inbuf, int inbufSize, unsigned char outbuf, int outbufSize, int mode) • Encode the input data that passed through the inbuf parameter and store the result data into buffer that pointed by outbuf parameter.

  8. encoder function - Parameter • encoder function Parameter • HANDLE handle : Pointer to the memory that allocated for encoding process • short* inbuf : Input data • int inbufSize : Size of input data • unsinged char* outbuf : Pointer to the buffer that will be stored encoded data • int outbufSize : Size of outbuf • int mode : Can choose the rate mode. • MR475 – 0, MR515 – 1, MR590 – 2, MR670 – 3, MR740 – 4, MR795 – 5, MR102 – 6, MR122 - 7

  9. encoder function - Return • Return • Type of result (encoded data) is unsigned char. • Return value • return size of frame that varies as the rate. (refer to slide number 3) • return 0 when initialization of function is succeeded. (refer to next slide) • return -1 when initialization of function is failed on account of that the buffer size of input and output is smaller than requested size. (refer to next slide) • return -2 when input data is processed.

  10. encode function - Remarks • Remarks • Will not be encoded when number of sample is smaller than 160. • The least size of input buffer is 160. • The least size of output buffer is 38. • encoder function need to initialize and return result data from second call that process in blocks of 160 sample.

  11. encoder function - Example • Example Initialization Return result from second call

  12. decoder function • int decoder(HANDLE handle, unsigned char* inbuf, int inbufSize, short* outbuf, int outbufSize) • Decode the input data that passed through the inbuf parameter and store the result data into buffer that pointed by outbuf parameter.

  13. decoder function - Parameter • decoder function Parameter • HANDLE handle : Pointer to the memory that allocated for encoding process • unsigned char* inbuf : Input data • int inbufSize : Size of input data • short* outbuf: Pointer to the buffer that will be stored decoded data • int outbufSize : Size of outbuf

  14. decoder function - Return • Return • Type of result (decoded data) is short. • Return value • return 160 that is size of pcm sample of 20ms long • return 0 when initialization of function is succeeded. (refer to next slide) • return -1 when initialization of function is failed on account of that the buffer size of input and output is smaller than requested size. (refer to next slide) • return -2 when input data is processed.

  15. decoder function - Remarks • Remarks • Will not be decoded when size of frame is smaller than 38. • The least size of input buffer is 38. • The least size of output buffer is 160. • decoder function need to initialize and return result data from second call that process in blocks of frame.

  16. decoder function - Example • Example Initialization Return result from second call

  17. end_amr function • void end_amr(HANDLE handle) • Free memory that allocated by init_amr function.

More Related