| Electronic Components Datasheet Search |
|
UM0851 Datasheet(PDF) 159 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
UM0851 Datasheet(HTML) 159 Page - STMicroelectronics |
|
159 / 245 page ![]() UM0851 Accelerator engine device drivers Doc ID 16604 Rev 2 159/245 size: variable which will store size of output data in bytes. This must always be equal to size of individual read buffer. If it is less than size of individual read buffer, end of encoding/decoding is indicated. This is a blocking system call which unblocks or returns only when the output data size less than equal to the size of the individual read buffer is written to current read buffer after encoding/decoding. On success, zero is returned otherwise, -1 is returned on error and errno is set appropriately. For example: total size of output data is 15 K, size of each write buffer is 4 K, then user needs to do following steps to read data from JPEG: 1. Set current read buffer to read_buffer0 2. Call JPEGIOC_GET_OUT_DATA_SIZE ioctl 3. Check value of parameter size, if it is less than 4 K end of encoding/decoding is indicated 4. Read data from current read buffer 5. Toggle current read buffer to buffer1 if current buffer is buffer0, else to buffer0 if current buffer is buffer1 6. Follow steps 2, 3, 4, 5 till the time step 3 doesn't indicate end of encoding/decoding. Writing input data to write buffer and reading output data from read buffer have to be done simultaneously. It is recommended to use different threads/processes for reading and writing. This will speed up encoding/decoding process. Get JPEG information Once encoding/decoding is finished user can read JPEG information (JPEG header information and compression tables). Use the following system call to get JPEG information: ioctl(rfd, JPEGIOC_GET_INFO, &jpeg_info); rfd: read node file descriptor. JPEGIOC_GET_INFO: command to get jpeg information. jepg_info: instance of struct jpeg_info. After successful completion of this system call, it will contain information of JPEG header and compression tables. On success, zero is returned otherwise, -1 is returned on error and errno is set appropriately. struct jpeg_hdr_info is defined below: struct jpeg_info { struct jpeg_hdr hdr;/* jpeg image header */ char qnt_mem[QNT_MEM_SIZE]; /* quantization memory */ char hmin_mem[HMIN_MEM_SIZE]; /* Huff min memory */ char hbase_mem[HBASE_MEM_SIZE]; /* Huff base memory */ char hsymb_mem[HSYMB_MEM_SIZE]; /* Huff symb memory */ char dht_mem[DHT_MEM_SIZE]; /* DHT memory */ char henc_mem[HENC_MEM_SIZE]; /* Huff enc memory */ }; struct jpeg_hdr is already defined earlier in section "Set JPEG Info". This ioctl is mainly useful for DWH (decoding with header processing enabled). Munmap Once the application is finished with JPEG processing, it should unmap the memory that has been mapped for read and write buffers. Use the following system call to unmap memory: |
|
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 |