Objective
The DS algorithm is one of the most widely used search algorithms in motion search, and some places are translated into Diamond search and diamond search. Whether it's a hardware or software video encoder, you can see its presence. The following article is mainly extracted from the journal, hoping to give some help to the novice video algorithm.
Principle
Generally, motion vectors are always highly concentrated near the center of the search window. This is even more noticeable for the video sequences where objects are moving slowly, because the stationary block and the slow motion block dominate. The center offset characteristic of motion vectors prompts you not to search all the points in the window, but only to search for those points near the center of the window to quickly search for the best match block. As a result, search templates are symmetric at the center of the window, and their shapes and sizes together determine the speed and performance of the search.
Figure 1 (LDSP and SDSP)
The DS algorithm uses two templates, as shown in Chart 1 (LDSP and SDSP). The template shown on the left is called the large Diamond Search template (LDSP), and the template shown on the right is called the Small Diamond Search template (SDSP). In the DS algorithm, the search is repeated using LDSP, until the lowest point of this search error appears in the center of the template, and then with this minimum error point as the center, to SDSP for the new search template for the last round of search, and the last round of the search for the smallest error point as the best match. When using the diamond algorithm, pay attention to the following three points:
All search points must be within the Search window, and the algorithm will not use these points when the points to be searched exceed the bounds of the window.
When searching using the LDSP template continuously, the points to be searched overlap partially. If the minimum error point from the previous LDSP template is located at one of the 4 corners of the LDSP, the next search only needs to be performed at the 5 points remaining in the LDSP, and if the midpoint appears on the LDSP side, only the 3 points remaining in the ldsp are searched. This greatly reduces the number of search points, thus greatly improving the search speed.
The algorithm does not limit the number of times a LDSP search is used, which may increase the number of searches by waiting for the minimum error point to appear in the center of the template. In such cases, you can force the search to end by setting the appropriate search border.
Audio and video codec available:
MPEG4 codec: PC, DM642, Blackfin. 1.8G CPU can realize full real-time codec of 16 channel CIF
H.264 codec: PC below 4 road CIF full time
WMA, WMV9 decoding: PC, DM642, Blackfin
Source-level cooperation. To undertake other audio and video codec development.
qq:763393647
Www.rtcodec.com