| 전자부품 데이터시트 검색엔진 |
|
UM0851 데이터시트(PDF) 160 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
UM0851 데이터시트(HTML) 160 Page - STMicroelectronics |
|
160 / 245 page ![]() Accelerator engine device drivers UM0851 160/245 Doc ID 16604 Rev 2 munmap(adrs, size); adrs: is address of mapped memory size: is size of mapped memory On success zero is returned otherwise, -1 is returned on error and errno is set appropriately. Close After unmapping memory, you must close JPEG nodes. Use the following system call to do this: close(fd); Close returns zero on success, or -1 if error occurred, errno is set appropriately. This function must be called both for read and write nodes. JPEG codec usage JPEG read and write are not synchronized enough, for example, one chunk of input data may produce output data varying in size. Due to this, you need to write and read simultaneously to JPEG driver, otherwise JPEG codec may be wasting time sitting idle. It is recommended to use two processes or threads to read and write data simultaneously from the JPEG driver. This will increase speed of JPEG processing. The following example is for encoding/decoding a JPEG image. Here input data is read by application from a file and is passed to JPEG driver. After that, it is processed by JPEG codec based no processing type (encoding/decoding), and output data is read by application again. #include <sys/mman.h> #include "include/linux/spr_jpeg_syn_usr.h" struct jpeg_info jpeg_info; volatile unsigned char *wbuf[2] = {NULL, NULL}, *rbuf[2] = {NULL, NULL}; unsigned int wsize = 4*4096, rsize = 4*4096; unsigned int ssize = XXX;/* set size of input data here */ int rfd, wfd, cur_rbuf = 1, cur_wbuf = 1; pid_t pid; void jpegread() { int size = 0, status; /* while encoding/decoding is not over */ do { shuffle_buf(cur_rbuf); if((status = ioctl(rfd, JPEGIOC_GET_OUT_DATA_SIZE, &size)) != 0) return -1; /* Add code here for manipulating decoded data present in rbuf[cur_rbuf] */ }while(size == rsize); /* get jpeg info after encoding/decoding is over */ ioctl(rfd, JPEGIOC_GET_INFO, &jpeg_info); /* unmap buf */ munmap((char *)rbuf[0], 2*rsize); close(rfd); } void jpegwrite() |
|
링크 URL |
| ALLDATASHEET 가 귀하에 도움이 되셨나요? [ DONATE ] |
Alldatasheet는? | 광고문의 | 운영자에게 연락하기 | 개인정보취급방침 | 링크 투 데이터시트 | 링크교환 | 제조사별 검색 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 |