Deployment of Mpeg4 Compression

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

DEPLOYMENT OF MPEG4 COMPRESSION

Ganashree T.S1 ,Divya prabha M.D2, Dr. M.Z.Kurian3, Member IEEE Fourth semester M.Tech [Digital Electronics], SSIT, Tumkur, Karnataka 2 Dept of E&C, SSIT, Tumkur, Karnataka 3 Dept of E&C, SSIT, Tumkur, Karnataka Email: [email protected]

AbstractNetwork video Monitoring has been developed in the embedded field, however current video surveillance is too expensive to limit use widely. The project produces new method that arm9 processor is hardware platform and embedded Linux system is a software development, with USB web camera as a video gathering module.The whole system realizes environmental gathering and has high performance and low cost. The video server system is designed centered on IME6410.Based on the platform of embedded processor and Linux, after analyzing the internal relations among Video4Linux(V4L) specification, video driver and kernel of Linux, we propose a common method for driver development accord with V4L Specification Keywords-embedded Linux;Video4Linux;IME6410;SAA7111

interface. In the video server system, The IME6400 controls the SAA7111 indirectly, and the single output data for video encoding is less than 14.745Mbps, so the 16-bit bus ARM9 has a light system load.

CCD Sensor

I.

INTRODUCTION
ARM9 16bit IME6410 MPEG-4 Encoder YUV422 SAA7111 Video decoder

Along with the rapid development of computer technology and network technology, Wired Television Monitoring system has been substituted by computer networking, and it is tending towards embedded video [1]. Currently, MPEG-2 based embedded video monitoring system has been widely used. Because consumption and environment have brought forward high request of the video monitoring system, to find out a better solution for video compress and transmission becomes a new target. So we improve the video monitoring program in view of video compress by using the IME6410, which is an MEPG-4 encoder. In this article, design of video encoding in the embedded Linux driver is emphasized[2][3]. II. PHYSICAL DESIGN OF THE SYSTEM

SDRAM 8MB 32bit

I2S

Audio ADC

Figure1. Physical design of the system

In the design, we use an MPEG-4 encoder IME6410, which is a single chip integrated solution that is intended to encode audio/video. The IME6410 features as multiple Peripheral Interface and controller, such as SDRAM controller, I2C interface, I2S interface. The IME6410 also has its internal RAM, in which firmware is loaded when the chip is running. According to the characters of the IME6410, the physical design is shown as fig1. The IME6400 requires external 32-bit SDRAM for storing video/audio frames during operation. The IME6400 video interface is designed according to CCIR-601 16bit standards, supporting YUV422 externally and sampling by YUV420 internally. In this design, the industry popular video encoders: Philips SAA7111 is used, which supports NTSC/PAL standards and is programmable via its I2C

The data float for the video sampling and encoding is as follows: the analog signal from the capturer is transmitted to the IME6410, and the IME6410 encodes and compresses the video data, and Synthesizes audio code (optional). The encoded data is then transmitted to the internal 1k-bit FIFO. When the FIFO full of half-filled, a external signal nfull is generated. The ARM9 can get state of the FIFO via interruption or polling, and reads data from the FIFO to its internal RAM for following procession when needed. III. THE DEVICE DRIVER DESIGN

The device driver is situated between the operating system and the hardware, closed to the underlying hardware. Under the Linux video capture and compression system, Video4Linux (V4L) device driver specification is generally needed[4], which is the interface between underlying driver modules and application procedures. Provided a set of API and related standards for its Linux video device, to control the read-write the device according to the provisions of the

Deployment of mpeg4 compression standards on arm9

V4L interface access, then complete the acquisition or setting of the video encoding and related parameters. Analysis of V4L standards The template is used to format your paper and style the text. All margins, column widths, line spaces, and text fonts are prescribed; please do not alter them. You may note peculiarities. For example, the head margin in this template measures proportionately more than is customary. This measurement and others are deliberate, using specifications that anticipate your paper as one part of the entire proceedings, and not as an independent document. Please do not revise any of the current designations. V4L divides the video device into four kinds and stipulates the main device number of all video device files is 81, however, regarding the different hardware type, its inferior device number of the special file is different, and each kind of device has a section of independent inferior device number scope. In this way, we can judge the device that belongs to which type by the inferior device number. V4L and the specific device actuation are related through the defined data structure and the related function, which the essential data structure is the video device one, the definition is as following: Struct video_device { Char name[32]; // device name int type; //device type int minor ; //the inferior //device number devfs_ handle_t devfs_handle; // device handle /* The following is the important member indicator, it has the deletion */ int(*open)(struct video_device*int mode); void(*close)(struct video_device *); long(*read)(struct video_device *char *unsigned long,int noblock); long(*write)(struct video_device *,char *unsigned long,int noblock); int(*ioctl)(struct video_device *unsigned intvoid *); int(*mmap)(struct video_device *const char *, unsigned long); int(*initialize)(struct video_device *); }; This structure corresponds to driver control device, where minor represents the inferior device number which the device corresponds to, and other members such as open, close, read, write, ioctl represent the corresponding function pointers. These function pointers are the related operation of the instruction specific devices. V4L registers another device operation structure using the unified connection. The unified actuation connection function of the device operation structure locates in the video_device, which the A.

device file corresponds to, according to the inferior device number of the opened specific installation file. Then it realizes to control the specific devices. In order to realize the localization, static array static struct video_device *video_device [256] is defined, and each specific device occupies an item in the array. When the driver is designed, device registration function video_register_device, which provided by V4L fills the hardware device data structure into the static array, when calling the function, the device should provide specific data structure and the types of device. The function Video_register_device achieves in file videodev.c. In fact, the V4L standards mainly realizes in this file, and it is located under the directory of /driver/media/video/. Videodev.c itself is a device driver module. The menuconfig option is loaded statically when essence is translated. The initialization function module_init() loaded by the module V4L mainly completes the registration of the character device. The process is as follows: Firstly it registers a character device actuation which the main device number is 81 and identifies specific device drivers by the inferior device number. After registering successfully, if there is a proc file system in the / proc file directory, it will create the directory / proc / video / dev /. When the actual device files are registered, it will generate a device file under the directory. For registering an actual device and calling the registration function video_register_device, three parameters are needed. They are the device struct, the device type and the inferior device number respectively. The type decides the start address section of the inferior device number. If the inferior device number is -1, the system automatically assigns the smallest available device number to the device. If the initialize function still exists, it keeps running. Then devfs_register is called, and device file is created automatically under /dev directory. Then the file operation pointer file_operations is hanged. The pointer points to the file pointer when the V4L module is loaded. Finally, the device file under /proc/video/dev/ is created. Therefore, the relationship between V4L and the actuation device registration mainly depends on the devfs_register function. After analyzing the V4L interface specification, according to its syntagma, the most important work is the module initialization. The module_init system call loads the video_IME_init function, completes the hardware initialization and the device structure packing works[5][6][7]. Initialization of IME6410 and SAA7111 Firstly, IME6410 and SAA7111 needed to be initialized respectively. In the hardware design, the I2C interface for SAA7111 registers initialization is on the chip IME6410. So we must initialize the IME6410 at first. Different from general chips, IME6410 needs to download the Firmware procedure for running and, at the same time initializes and configures its internal registers. B.

Deployment of mpeg4 compression standards on arm9

According to hardware design, the ARM processors external bus (EBI) must be configured at first, to satisfy IME6410 various request for the succession, the detention, the level effective and so on. Secondly, initialize IME6410 according to figure 2. The firmware downloading of IME6410 is quite special. After firmware downloading from the selected host, the internal ROM examines the type and width of the external bus and waiting for data transmission from the Host immediately. The way of receiving data is quite similar to the limited condition mechanism for flash writing: firstly, receives the base address and offset for firmware restoring. Secondly, receives a half word of Firmware. Then waits for a transmission order from the host, and starts to save the data to internal RAM actually. The IME6410 can get the transmission state by querying the condition registers, and circulates above process to complete the downloading process. When it finishes downloading, the IME6410 will automatic set the version register and all kind of encoding registers and then inquiry the version register to determined if the firmware downloading is success.

SAA7111 internal registers needed to be initialized, so it can be completed in several operations. C. Realization the video equipment registration and interrupt routine registration

The video device registration function contains the module counter, so it is not needed to call the MACRO MOD_INC_USE_COUNT. The data construction video_device should be fully finished before video frequency registration for quotation, and the file pointer is decided by the callback function. For example: Static struct video_device IME_template { open: video_IME_open, read: video_IME_read, ioctl: video_IME_ioctl,

}; The function of each file operation pointers for callback function can be defined according to actual demands. Here list some function assignment in this system. open: enable the IME6410. Firstly, it inquires the IME6410 condition register, when everything is ready. Then it enables IME6410 to start coding. read: it reads FIFO of IME6410,buffer (512 bytes) is read each time, the first 4 bytes have labeled the package size and type for each data package for the application layer using. write: IME6410 does not need to realize writing data manipulation, thus it has less effect. mmap: Mapping video device buffer to the local memory buffer. ioctl: Different from the common device files, video file operations which conform to V4L gets each kind of parameter even image data by ioctl function setting. All the correlated operations are listed by V4L, but it only realizes part of the practical operations for the video code. Such as Tab.1: many differences exist between video gathering and the code operation, and they need to realize their respective control. Some are visited directly through parameter e set by the ARM.
TABLE I. The control operations of video coding Acquire image parameters,including resolution,frame rate,bit rate control and so on. Set image parameters Acquire local mapping buffer parameters,main including their address and size Acquire image coding and tramsmit itself to mapping buffer zone Acquire the flag of end resolution

VIDIOCGPICT VIDIOCSPICT Figure 2. video frequency peripheral initialization flow chart VIDIOCGMBUF VIDIOCMCAPTURE VIDIOCSYNC

To the ARM controller, Firmware is an external I2C controller which enables the internal I2C module. I2C readwrite operation is abstracted as MACRO in Linux. The IME6410 internal I2C bus only supports most four byte blocks to write. This putts trouble to the operation for the SAA7111 register initialization. But because only a few

The interrupting routine registration uses the request_irq system call, exterior I/O interrupting is used in this procedure, interrupt vector is chosen according to the ARM chip hardware setting.The punctuated handle points at

Deployment of mpeg4 compression standards on arm9

the interrupting program which performs in the core state. When the FIFO of IME6410 is half-full or full,the ARM processors have a break, and Linux kernel responds to interrupt handler, thus enter to interrupting process, a package of data is read by the procedure, the upper application is informed through the mechanism. The compiled driver makes an node file named v4lvideo() in /dev directory. At this point, the whole driver design and the compilation is finished. IV. CONCLUSION

REFERENCES
[1] [2] [3] [4] [5] Xu Li;Kong Yan. Status and Develop Trend of Video Monitor. Information Technology & Informatization, 2005, (4): 60- 62 ALESSANDRO RUBINI.WEIYONGMING. LINUX driver [M]. Beijing: China Electric Power Press, 2002 RUBINI.Linux device driver(the ALESSANDRO edition)[M].Beijing: China Electric Power Press, 2002 Device second

Alan Cox. Video4 Linux Programming[M]. ala @redhat.com. 2000K. Elissa, Title of paper if known, unpublished. Li Genshen Xing Hancheng Technologies of Writing Device Driver for Video Capture Card in Linux System Computer Aided Engineering. BARRY C, LANG M. A survey of multimedia and web development techniques and methodology Usage[J]. Multmedia IEEE, 2001, 8(2): 52-60. LEE D, KIM N, KIM S. The MPEG-4 streaming player using adaptive decoding time stamp synchronization[C]. Proceedings of the Ninth International Conference on Parallel and Distributed Systems, 1521-9097/02, 2002 IEEE: 398 - 403.

The relationships between the V4L standard and video actuation are deeply analyzed in this project. Take the coding chip IME6410as an example, the concrete method of driven development based on the video code module is introduced, the reasonable order of ioctl is chosen in view of the video compression code. The compiled file and the system call follow the standard of V4L, and it has obtained a good performance in the application test. The project applies to all video-driven developments in line with the norms of V4L.

[6]

[7]

Deployment of mpeg4 compression standards on arm9

You might also like