The characteristics of H.264 compression techniques are introduced to study the design of H.264 encoder hardware and optimize image compression algorithm. Studies have shown that the compression ratio has a large increase, basically 10 times or so, the PSNR variation is not large, and the compression ratio is 100 times. This shows that the compression effect of the image after optimization is better, and the quality of the image before and after optimization is not significantly reduced.
As my country's comprehensive scientific and technological strength is constantly rising, drone technology is a rapid development of rapid development in recent years, and drone technology is widely used in industries such as electricity, movies, military, etc., high temperature, alpine, dangerous and other environments. Under the use of drone technology, it can help people work. Most of the many applications of drones, most of the camera auxiliary work is required, so data transmission is very important in the UAV system. With the continuous application of drones in the military field, the data transmission distance becomes longer, and higher requirements are proposed for compression technology of video data [1-5].
2 H.264 Research on Compression Technology
2.1 Basic Concept
(1) Video frame structure. The H.264 algorithm uses I or P frame as a forward predictive frame, divides the image of each frame into a plurality of macroblocks, each macroblock consisting of sampling points, and each macroblock can be further divided into a plurality of sub-blocks.
(2) H.264 grade level. The grade is the implementation of the encoder and algorithm to implement the function and scope of the encoder. Basic grade is mainly suitable for video communication fields, which can achieve a variety of fast coding, and can meet the sequence of sequence of cascades. The main gear is mainly used in the fields of digital TV, broadcasting. In addition to the three types of functional characteristics of i, p, b, in addition to the functional characteristics of I, p, and b, and two functional features of CAVLC and CABAC. The expansion grade is mainly used for network transmission, which has strong anti-interference capabilities, including all functions of basic grades, and weighted predictions.
2.2 Code Key Technology
(1) intra prediction coding. For brightness macroblocks, this coding method uses pixels and pixel patterns. The current macroblock is predicted by the current macroblock and the encoded macroblock, better compression performance can be achieved.
(2) Interface prediction coding. The correlation of the video image sequence adjacent frame image time, which results in high redundancy when the image is stored, mainly including the time and space two dimensions. This predicted encoding technology is to remove the test piece redundancy by similarity, and perform video compression. The H.264 technology introduces variable block and motion estimation technique relative to the previous coding criteria. Variable block size technology, dividing each macroblock into seven ways. The macroblock size has a greater impact on the compression performance of the video image, and the large macroblock can be applied to a small number of exercise information, and the small macroblock can be applied to a large portion of the amount of exercise.
3 H.264 encoder hardware design
3.1 Overall hardware design
(1) Hardware design goals. The image detection capabilities of drones are one of the main functions of drones. The key content of the overall hardware design of drones is the design of the digital image transmission system. In many cases, the transmission of drone image motion system must be real-time, so huge amount of data must take up huge bandwidth, so large data leads to a certain difficulty of transmission and anti-interference ability, so for the current drone The need requires high efficiency compression, real-time wireless transmission systems.
(2) Hardware design. According to the requirements of the drone design objectives, the drone video compression design method should have the following features: First, high compression ratio, using digital image compression algorithm, implement high efficiency compression of digital images; second, real-time, via video compression Save broadband, real-time transmission; finally, anti-interference performance is strong, lightweight.
(3) System overall structure. Design needs to complete the application requirements while completing the design goals. The overall structure of the system is divided into two parts: first is the wireless transmit portion on the drone, transmitted back to the ground by image compression; in real time; in addition, the ground receiving portion, the hardware platform uses the dual-core video processing module of Texas Instruments.
3.2 Integrated development environment
The CCS software integrates the development environment, using the CCS function library, the Windows operating system operating system, integrated multiple debugging methods, and completes the simulation and intuitive data results of TMS320 series instructions. The CCS software integrates the development environment with strong scalability.
The CCS software integration environment mainly includes program planning and design, code writing generation, code debugging tracking, and analysis. The CCS software development platform integrates the builder, assembler, and linker and other tools implement the generation of DSP source code.
(1) C ++ / C ++ compiler. The main function is to implement the compilation and conversion of the C / C ++ source program to the assembly language. This compiler consists of three parts, the shell, optimization procedures, and internal tools. The shell program mainly completes the language of the language compilation, and the optimizer compiles the shell program. The language is optimized, increasing the execution speed and execution efficiency of the code. The internal tool implements C / C ++ code to convert to DSP assembly code.
(2) Assembler. The main role of the assembler is to convert assembly languages into machine target files. The main contents are pseudo-instructions, directive, etc., mainly used to control assembly language content, data format, etc.
(3) Link. The main content of the linker is to generate the COFF format file to the process of executable code, and enter the target file and target library that can be relocated.
(4) Software flow. Software technology through the assembler can run the loop instructions well, optimize the loop instruction parallel operation, improve the speed of the software, and use software water technology to optimize cyclic code. When the user gives information on the compiler, it is necessary to clarify the number of cycles of the compiler, reduce the efficiency of software flow, and improve the running speed of the code.
4 encoder transplantation and optimization
4.1 Optimization of motion estimation calculation
(1) Match guidelines. Motion estimation search algorithm Adopt rate distortion optimization criteria, optimization, and SAD formula as shown in equation (1).
(2) Search algorithm. The currently common search algorithm is a diamond search algorithm, a hexagon search algorithm. 1 Diamond search algorithm searches in a small rhombus having a radius 1, by calculating the matching error, resulting in the MBD point. After the comparison, if the MBD point is within another area, the search MBD point is the best point. If not, you will search the center as a center as a center. 2 The hexagon search algorithm is divided into three parts. First, search the search start point as a hexagon template, compared to the matching error of the center point and the surrounding point, then compare the matching error of Dolby MBD and the central point; the second step is the previous MBD point, Search according to the hexagonal template, calculate the matching error of the MBD point. If the MBD point is calculated next to the central point without error, the second step is not repeated; finally, the small square template is used to search, the MBD point is the best point.
(3) Search algorithm optimization. The above search algorithm will repeat the search point during the search process, resulting in a decrease in efficiency. With no duplicate search algorithms, you can resolve the problem of repeated search. With SAD code, add judgment modules to the program, if the termination condition is satisfied.
4.2 Results analysis
(1) Further optimization. On the basis of search algorithm optimization, perform inline function optimization and cyclic optimization processing, using inline functions_MEM4 (), _Subabs (), etc., greatly improves the calculation efficiency; uses pseudo-instructions #pragma must_iterate (min, Max, multiple can be more clearly calculated for minimum cycles.
(2) Result analysis. Analysis of the data before and after optimization, it can be seen that the frame rate has increased significantly after optimization, basically 10 times or so, the PSNR variation is not large, the compression ratio is 100 times, and the compression effect of the image after optimization Ok, the image quality gap before and after optimization is not large.
5 Conclusion
This paper introduces the characteristics of H.264 compression technology, and research on the design of H.264 encoder hardware and optimizes the image compression algorithm. Adopt SAD code, add IF (ISUM ≥ bcost) judgment module in the program; on the basis of search algorithm optimization, perform intramid function optimization and loop optimization processing; after optimization, the frame rate has a large increase, basically in 10 Row, the PSNR variation is not large, the compression ratio is 100 times, whereby the compression effect of the image after the words is better, and the quality of the image before and after optimization is not significantly decreased. , Read full article, original title: Research on drone video compression based on compression algorithm
Article Source: [Micro Signal: Appic-CN, WeChat Public Number: Integrated Circuit App Magazine Electronic Technology Magazine] Welcome to add attention! Please indicate the source of the article.
Our other product: