| Electronic Components Datasheet Search |
|
UM0851 Datasheet(PDF) 157 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
UM0851 Datasheet(HTML) 157 Page - STMicroelectronics |
|
157 / 245 page ![]() UM0851 Accelerator engine device drivers Doc ID 16604 Rev 2 157/245 u32 hdc;/ * hdc bit selects the Huffman table for the encoding of the DC * coefficient in the data units belonging to the color component */ u32 hac; /* hac bit selects the Huffman table for the encoding of the AC * coefficients in the data units belonging to the color component */ u32 qt; /* QT indicates the quantization table to be used for the color component */ u32 nblock; /* nblock value is the number of data units (8 x 8 blocks of data) of * the color component contained in the MCU */ u32 h; /* Horizontal Sampling factor for component */ u32 v; /* Vertical Sampling factor for component */ }; Use the following system call to set JPEG info for DWOH: ioctl(wfd, JPEGIOC_SET_DEC_INFO, &dec_info); wfd: file descriptor of jpeg write node. JPEGIOC_SET_DEC_INFO: ioctl command for setting JPEG decoding information. dec_info: structure containing jpeg decoding information. Description of dec_info structure: struct jpeg_dec_info { struct jpeg_hdr hdr; /* jpeg image header */ int hdr_enable; /* header processing enable/disable */ 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 */ }; On success, zero is returned, otherwise on error, -1 is returned and errno is set appropriately. If this ioctl is not called before writing/reading data to/from JPEG, then DWH (decoding with header processing) is performed by default. Mapping memory for read and write The JPEG driver needs to allocate buffers for storing the input and output data. To speed up the encoding/decoding process, the driver uses the mmap() Linux system call. This system call allocates physically contiguous memory for JPEG driver and returns the virtual address of this memory to the user application. Now, user can then read and write to these virtual addresses and the same data is reflected in the driver buffers. This saves unnecessary data copy time between kernel and user level. In order to further increase the performance of the encoding/decoding process, two buffers are used both for read and write operations. By having two buffers for read and write, we are actually parallelizing JPEG processing. By the time JPEG hardware reads/writes data from/to read/write buffer software has written/read data to/from other buffer. Use the following system call to map physical memory in virtual space: void * mmap(void *start, size_t length, int prot , int flags, int fd, off_t offset); fd: file descriptor of jpeg read/jpeg write node. length: is total size of buffers (write or read) to allocate. Size should be multiple of page size, i.e. 4096 bytes. Maximum size that can be allocated or mapped at once is 4 MB, this makes size of each buffer (write or read) 2 MB. Single call to mmap for jpegread/jpegwrite node will allocate "length" amount of memory and will return its base address. Now user application should use this memory as two buffers of same size. |
|
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 |