| Electronic Components Datasheet Search |
|
UM0851 Datasheet(PDF) 158 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
UM0851 Datasheet(HTML) 158 Page - STMicroelectronics |
|
158 / 245 page ![]() Accelerator engine device drivers UM0851 158/245 Doc ID 16604 Rev 2 On success, mmap returns a pointer to the mapped area. On error, the value MAP_FAILED (that is, (void *) -1) is returned, and errno is set appropriately. The mmap function asks to map length bytes starting at offset "offset" from the file specified by the file descriptor "fd" into memory, preferably at address "start". This "start" address is a hint only, and is usually specified as 0. You can use following parameters to call this function for rfd and wfd. mmap(0, size, PROT_READ | PROT_WRITE, MAP_SHARED, file_desc, 0) After completion of one codec operation (encoding/decoding), if you need to encode/decode again without closing nodes of jpegread/jpegwrite, then user is not required to allocate/map this memory again. Still if user needs to map it again with a different size, then you must first unmap any memory that has been already mapped. Write source JPEG data After mapping memory for the write buffer, you can write input data to write buffers (data length less than equal to size of one write buffer). This can be done by writing or copying data directly to the mapped virtual memory addresses of write buffers. Start encoding or decoding Once input data is written to write buffer, encoding/decoding can be started/resumed. Use the following system call to start and resume JPEG encoding/decoding with new input data: ioctl(wfd, JPEGIOC_START, size); wfd: file descriptor of write node. JPEGIOC_START: command to start/resume jpeg encoding/decoding size: amount of data written on jpeg write node, <= memory mapped for each jpeg write buffer. This is a blocking system call which unblocks or returns only when encoding/decoding with data supplied from current write buffer is started or an error has occurred. On success, zero is returned otherwise, -1 is returned on error and errno is set appropriately. For example: total size of input data is 15 K, size of each write buffer is 4 K, then you need to follow these steps to pass data to JPEG: 1. Set current write buffer to write_buffer0 2. Write 4K data in current write buffer 3. Call JPEGIOC_START ioctl with size equal to 4 K 4. Toggle current write buffer to buffer1 if current buffer is buffer0, else to buffer0 if current buffer is buffer1 5. Follow steps 2, 3, 4 two more times with size 4 K and one time with size 3 K. Get encoded/decoded data Once encoding/decoding is started, then output data must be copied from read buffer. Use the following system call used to get the output data: ioctl(rfd, JPEGIOC_GET_OUT_DATA_SIZE, &size); rfd: read node file descriptor. JPEGIOC_GET_OUT_DATA_SIZE: command to get output data. |
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |