Method, apparatus, and storage medium for accelerating video encoding motion search
Patent Information
- Application Number
- CN202211442590.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-17
- Publication Date
- 2026-08-21
- Estimated Expiration
- 2042-11-17
AI Technical Summary
[0004]视频编码中运动搜索需要根据搜索形状计算每个位置数据块的SAD或SATD值,数据块本身比搜索形状大,因此会在搜索过程有大量的数据重叠,导致数据访问重复,性能下降
Smart Images

Figure CN115965650B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a motion search method in video coding technology, and more particularly to an acceleration method, acceleration device, computing device, and storage medium for video coding motion search that can improve search speed. Background Technology
[0002] With the development of network technology and mobile communication, video information is being used by users more and more.
[0003] However, video information integrates a large amount of raw data, and directly transmitting video information will consume a lot of network resources. Therefore, video information is generally encoded and compressed to reduce the storage space of video information and improve the transmission efficiency of video information.
[0004] Motion search in video coding requires calculating the SAD or SATD value of each data block based on the search shape. Since the data block itself is larger than the search shape, there is significant data overlap during the search process, leading to repeated data access and performance degradation. Existing video codec technologies often optimize algorithms from existing standards (h.264 / AVC or h.265 / AVC) to improve efficiency. However, these optimizations render existing standards incompatible with video information conforming to those standards.
[0005] Therefore, how to fully utilize the parallel computing power of the processor, without changing the existing video encoding and decoding algorithm standards, to organize continuous rows of data in parallel for vectorized calculations through an index table, thereby improving computational efficiency and encoding and decoding efficiency, is one of the problems that needs to be solved. Summary of the Invention
[0006] Embodiments of the present invention provide a method, device, computing device, and storage medium for accelerating motion search in video encoding. By adding a search cache block, the data used in a single search process is prefetched, and the computation is divided into row vectors for parallel computation, reducing data access and computation, improving computational efficiency, and thus improving encoding and decoding efficiency.
[0007] An embodiment of the present invention provides a method for accelerating video coding motion search, comprising the following steps: obtaining a reference frame Fref and a coding tree block Ci, wherein the coding tree block comprises an M*N pixel matrix, where M is the number of pixels in each row and N is the number of pixels in each column; determining a prefetch point S according to a search algorithm; obtaining a search buffer block P in the reference frame Fref based on the determined prefetch point S; determining an index table T according to the search algorithm; and performing row vector calculations in parallel based on the search buffer block P and the index table T.
[0008] The aforementioned acceleration method, wherein the step of determining the prefetch point S according to the search algorithm further includes:
[0009] The first point of the rectangular area covered by the search algorithm at the start is determined as the pre-fetch point S; wherein
[0010] The search algorithms include diamond search, hexagonal search, asymmetric cross-shaped multi-level hexagonal grid search, or full search.
[0011] The aforementioned acceleration method, wherein the step of obtaining the search cache block P in the reference frame Fref further includes:
[0012] Starting from the prefetch point S, a square search buffer block P is taken from the reference frame Fref. The search buffer block P is used to cache the reference frame data used in one search process. The size of the search buffer block is P≥(M+1)*(N+t), where 1≥w-1, w is the width of the search shape in the search algorithm, and t≥h-1, h is the height of the search shape in the search algorithm.
[0013] The aforementioned acceleration method, wherein the step of determining the index table T further includes:
[0014] According to the search algorithm, the search order of each search point is determined, and the position L(x, y) of each search point in the search cache block P is saved according to the search order. The position L(x, y) in one search process is saved in the index table T.
[0015] The starting position of the coded tree block Ci is obtained directly from the index table T, and the index table T is updated with the position of MVP during each search process before the search ends.
[0016] The aforementioned acceleration method, wherein the step of performing row vector calculations in parallel further includes:
[0017] Starting from the position L(x, y) of a search point sequentially taken from the index table T, one or more rows of data are taken out to calculate the SAD or SATD value with the coding tree block Ci. The vector of the i-th row of data is Vi[L(x, y)]. The SAD or SATD value of the position L(x, y) is then calculated by the following formula:
[0018]
[0019]
[0020] Where Vn(Ci, n) is the nth vector row corresponding to the coding tree block Ci, and i is the number of search points in the search shape;
[0021] Traverse the index table T, and for each position L(x, y), calculate the SAD or SATD value of the corresponding block.
[0022] The above-mentioned acceleration method, wherein the acceleration method further includes:
[0023] Determine whether the SAD or SATD values of all search points are greater than the SAD or SATD value corresponding to the MVP point;
[0024] If so, the search ends;
[0025] If not, update the MVP point to the search point where the minimum value of SAD or SATD is found.
[0026] An acceleration device for video coding motion search according to one embodiment of the present invention includes: a data acquisition unit for acquiring a reference frame Fref and a coding tree block Ci, wherein the coding tree block includes an M*N pixel matrix, where M is the number of pixels in each row and N is the number of pixels in each column; a data processing unit for determining a prefetch point S according to a search algorithm, and acquiring a search buffer block P in the reference frame Fref based on the determined prefetch point S; an index table creation unit for determining an index table T according to the search algorithm; and a parallel computing unit for performing row vector calculations in parallel based on the search buffer block P and the index table T.
[0027] The aforementioned acceleration device, wherein the data processing unit further comprises:
[0028] A prefetch point determination unit is used to determine the prefetch point S; wherein,
[0029] The prefetch point S is determined based on the first point of the rectangular area covered at the start of the search algorithm. The search algorithm includes diamond search, hexagonal search, asymmetric cross-shaped multi-level hexagonal grid search, or full search.
[0030] The aforementioned acceleration device, wherein the data processing unit further comprises:
[0031] A search cache block acquisition unit is used to retrieve a square search cache block P from the reference frame Fref, starting from the prefetch point S. The search cache block P is used to cache the reference frame data used in one search process. The size of the search cache block is P≥(M+1)*(N+t), where 1≥w-1, w is the width of the search shape in the search algorithm, and t≥h-1, h is the height of the search shape in the search algorithm.
[0032] In the aforementioned acceleration device, the index table creation unit is further configured to determine the search order of each search point according to the search algorithm, save the position L(x, y) of each search point in the search cache block P according to the search order, and save the position L(x, y) in the index table T during a search process.
[0033] In the aforementioned acceleration device, the parallel computing unit is further configured to:
[0034] Starting from the position L(x, y) of a search point sequentially taken from the index table T, one or more rows of data are taken out to calculate the SAD or SATD value with the coding tree block Ci. The vector of the i-th row of data is Vi[L(x, y)]. The SAD or SATD value of the position L(x, y) is then calculated by the following formula:
[0035]
[0036]
[0037] Where Vn(Ci, n) is the nth vector row corresponding to the coding tree block Ci, and i is the number of search points in the search shape;
[0038] Traverse the index table T, and for each position L(x, y), calculate the SAD or SATD value of the corresponding block.
[0039] The aforementioned acceleration device, wherein the acceleration device further comprises:
[0040] A judgment unit is used to determine whether the SAD or SATD values of all search points are greater than the SAD or SATD value corresponding to the MVP point;
[0041] An MVP point update unit is used to update the MVP point to the search point with the minimum SAD or SATD value when the SAD or SATD values of all search points are not greater than the SAD or SATD value corresponding to the MVP point.
[0042] A computing device according to one embodiment of the present invention includes at least one acceleration device for any of the video coding motion search methods described above.
[0043] A storage medium according to one embodiment of the present invention is used to store a computer program, wherein the computer program is used to execute any of the video coding motion search acceleration methods described above.
[0044] The present invention will be described in detail below with reference to the accompanying drawings and specific embodiments, but this is not intended to limit the present invention. Attached Figure Description
[0045] Figure 1 This is a flowchart illustrating an embodiment of the video coding motion search acceleration method of the present invention.
[0046] Figure 2 This is a flowchart illustrating step S104 of an embodiment of the present invention.
[0047] Figure 3 This is a flowchart illustrating step S105 of an embodiment of the present invention.
[0048] Figure 4A This is a schematic diagram illustrating the range of the search cache block P in a hexagonal search according to an embodiment of the present invention.
[0049] Figure 4B This is a schematic diagram illustrating the range of the search cache block P in a diamond search according to an embodiment of the present invention.
[0050] Figure 5A This is a schematic diagram of the index table structure in a hexagonal search according to an embodiment of the present invention.
[0051] Figure 5B This is a schematic diagram of the index table structure in a diamond search according to an embodiment of the present invention.
[0052] Figure 6 This is a schematic diagram of the structure of an acceleration device for video coding motion search according to an embodiment of the present invention.
[0053] In the attached figures, the following labels are used:
[0054] 100: Methods to accelerate motion search in video coding
[0055] S101-S105, S1041-S1043, S1051-S1053: Steps
[0056] 200: Accelerator for motion search in video coding
[0057] 201: Data Acquisition Unit
[0058] 202: Data Processing Unit
[0059] 2021: Prefetch Point Determination Unit
[0060] 2022: Search Cache Block Acquisition Unit
[0061] 203: Index Table Creation Unit
[0062] 204: Parallel Computing Unit
[0063] 205: Judgment Unit
[0064] 206: MVP Point Update Unit
[0065] AF: Search point
[0066] MVP: MVP Points
[0067] P: Search cache block
[0068] S: Prefetch point
[0069] Fref: Reference frame Detailed Implementation
[0070] The structural and working principles of the present invention will be described in detail below with reference to the accompanying drawings:
[0071] Figure 1 This is a flowchart illustrating an embodiment of the video coding motion search acceleration method of the present invention; Figure 2 This is a flowchart illustrating step S104 of an embodiment of the present invention; Figure 3 This is a flowchart illustrating step S105 of an embodiment of the present invention; Figure 4A This is a schematic diagram illustrating the range of the search cache block P in a hexagonal search according to an embodiment of the present invention; Figure 4B This is a schematic diagram illustrating the range of search cache block P in a diamond search according to an embodiment of the present invention; Figure 5A This is a schematic diagram of the index table structure in a hexagonal search according to an embodiment of the present invention; Figure 5B This is a schematic diagram of the index table structure in a diamond search according to an embodiment of the present invention.
[0072] like Figure 1 As shown, the video coding motion search acceleration method 100 of the present invention includes the following steps:
[0073] S101, Obtain the reference frame and the coding tree block to be searched. In this invention, each coding tree block Ci to be searched comprises an M*N pixel matrix, where M is the number of pixels in each row and N is the number of pixels in each column. M and N can be the same or different, depending on the encoding standard and the range to be searched. This invention is not limited to this; an 8*8 matrix is used as an example below for specific explanation. The reference frame Fref can be a 16*16 pixel matrix, or a pixel matrix of other sizes such as 16*32, 32*16, or 64*64. This invention is not limited to this.
[0074] S102, Determine the prefetch point S. In existing video coding motion search algorithms, commonly used search algorithms include diamond search, hexagonal search, asymmetric cross-shaped multi-level hexagonal grid search, or full search. Based on the algorithm used, determine the prefetch point S. The prefetch point S is typically selected as the first point of the rectangular area covered at the start of the search algorithm.
[0075] Specifically, such as Figure 4AAs shown, in the hexagonal search algorithm, the search points ABCDEF are typically searched sequentially to form a hexagonal search shape. In the hexagonal search algorithm, the rectangular area covering all search points AF in a single search can also be interpreted as a search shape with a width w of 5 and a height h of 3, where the first point is point S as shown in the figure, which is designated as the pre-fetch point S. Of course, the width and height of the search shape will vary depending on the specific search requirements, and this invention is not limited to this. Figure 4A The medium gray shaded area shows the portion of the data block that overlaps with search point A and search point C.
[0076] For example Figure 4B As shown, in the diamond search algorithm, the search order of search points ABCDEF is also used, searching one by one to form a diamond-shaped search pattern. The rectangular area covering all search points AF in a single search can also be interpreted as a search shape with a width w of 3 and a height h of 3, where the first point is point S as shown in the figure, which is determined as the prefetch point S. Of course, the width and height of the search shape will vary depending on the search requirements, and this invention is not limited to this. This invention only uses the hexagonal search algorithm and the diamond search algorithm as examples for illustration. For other search algorithms, the same method is used to determine the prefetch point S, and will not be elaborated further here.
[0077] S103, Obtain the search cache block. Based on the determined prefetch point S, obtain the search cache block P in the reference frame Fref. The search cache block P is used to cache all reference frame data used in one search process.
[0078] Specifically, such as Figure 4A As shown, in the hexagonal search algorithm, starting from the prefetch point S, a square search buffer block P is taken from the reference frame Fref. To ensure that the search buffer block P can cover all the reference frame data used in one search, the width of the search buffer block P can be set to M+1, and the height to N+t. Here, 1≥w-1, where w is the width of the search shape in the hexagonal search algorithm (e.g., w=5), and t≥h-1, where h is the height of the search shape in the hexagonal search algorithm (e.g., h=3). Therefore, it can be determined that in the hexagonal search algorithm, the data block size contained in the search buffer block P is at least (M+4)*(N+2).
[0079] Again Figure 4BAs shown, in the diamond search algorithm, starting from the prefetch point S, a square search buffer block P is also taken from the reference frame Fref. To ensure that the search buffer block P can cover all the reference frame data used in one search, the width of the search buffer block P can be set to M+1, and the height to N+t. Here, 1≥w-1, where w is the width of the search shape in the diamond search algorithm (e.g., w=3), and t≥h-1, where h is the height of the search shape in the hexagonal search algorithm (e.g., h=3). Therefore, it can be determined that the data block size contained in the search buffer block P in the diamond search algorithm is (M+2)*(N+2).
[0080] S104, determine the index table. For example... Figure 2 As shown, step S104 further includes:
[0081] S1041, Determine the search order. Based on the search algorithm used, determine the search order for each search point. In the hexagonal search algorithm or diamond search algorithm described above, the search order is from search point A to search point F.
[0082] S1042, Save Positions. Save the position L(x, y) of each search point AF in the search cache block P according to the search order, and save the positions L(x, y) corresponding to all search points AF during a single search in the index table T. For example... Figure 4A As shown, the position L(x, y) is determined as follows: starting from the position of the prefetch point S (L(0, 0), the number of pixels extending to the right corresponds to the position y, and the number of pixels extending downwards corresponds to the position x. Taking search point A as an example, if search point A extends one pixel to the right relative to the prefetch point S, then y = 1; if search point A is in the same row as the prefetch point S and does not extend downwards, then x = 0. Similarly, the positions L(x, y) of other search points can be obtained.
[0083] Specifically, Figure 5A This shows the specific structure of the index table for the hexagonal search algorithm. Figure 5B The specific structure of the diamond search algorithm index table is shown. This invention is only used as an example for illustration and is not limited thereto.
[0084] S1043, Obtain Position. During the search, the starting position of the coded tree block Ci is directly obtained from the index table T, and the index table T is updated with the position of MVP during each search process before the search ends.
[0085] S105, Parallel row vector calculation. Based on the search cache block P and index table T, row vector calculations are performed in parallel.
[0086] Specifically, such as Figure 3 As shown, step S105 further includes:
[0087] S1051, Retrieve row data. Starting from the position L(x, y) of a search point in the index table T, retrieve one or more rows of data from the search cache block P.
[0088] S1052, Calculate the SAD or SATD value. Use one or more rows of extracted data to calculate the SAD or SATD value with the coded tree block Ci. Let the vector of the i-th row of extracted data be Vi[L(x, y)]. Then, the SAD or SATD value at position L(x, y) is calculated using the following formula:
[0089]
[0090]
[0091] Where Vn(Ci, n) is the nth vector row corresponding to the encoding tree block Ci, and i is the number of search points in the search shape. For the hexagonal search algorithm, i = 6, and for the diamond search algorithm, i is also equal to 6. However, for the diamond search algorithm, the search point F coincides with the MVP point and can be skipped during the search.
[0092] Traverse the entire index table T, and for each position L(x, y), calculate the SAD or SATD value of the corresponding block.
[0093] S1053, determine whether the SAD or SATD values of all search points are greater than the SAD or SATD value corresponding to the MVP point; if yes, the search process ends. If no, update the MVP point to the search point with the minimum SAD or SATD value, return to S1052, and recalculate the SAD or SATD value.
[0094] In this invention, any computing unit with storage and parallel computing capabilities can be used to achieve the acceleration goal using this solution. Typical computing units include:
[0095] 1: Video codec or dedicated ASIC for video processing. The cache in the video codec or dedicated ASIC for video processing is used to search the storage of cache block P, and parallel operations of row vectors are performed through parallel units.
[0096] 2: Use FPGA as the acceleration unit, utilize the internal RAM or external DRAM of FPGA to store the search cache block P, and implement the parallel operation of index table T and row vector in the logic unit;
[0097] 3: Use the GPU as the acceleration unit, utilize the GPU's internal cache or DRAM to store the search cache block P, and implement parallel operations on the index table and row vectors in the parallel unit;
[0098] 4: Use the CPU's vectorized instructions to store the search cache block P using the CPU's internal cache or DRAM. The CPU's vectorized instructions enable parallel operations on the index table and row vectors.
[0099] Figure 6 This is a schematic diagram of the structure of an acceleration device for video coding motion search according to an embodiment of the present invention. (Combined with...) Figures 4A to 5B ,like Figure 6 As shown, the video coding motion search acceleration device 200 of the present invention includes a data acquisition unit 201, a data processing unit 202, an index table creation unit 203, and a parallel computing unit 204.
[0100] Specifically, the data acquisition unit 201 is used to acquire the reference frame Fref and the coding tree block Ci to be searched. In this invention, each coding tree block Ci to be searched includes an M*N pixel matrix, where M is the number of pixels in each row and N is the number of pixels in each column. M and N can be the same or different, depending on the encoding standard and the range to be searched. This invention is not limited to this; an 8*8 matrix is used as an example below. The reference frame Fref can be a 16*16 pixel matrix, or other sizes such as 16*32, 32*16, or 64*64. This invention is not limited to this; a 16*16 matrix is used as an example below.
[0101] In existing video coding motion search, commonly used search algorithms include diamond search, hexagonal search, asymmetric cross-shaped multi-level hexagonal grid search, or full search. In this embodiment, the data processing unit 202 further includes a prefetch point determination unit 2021 and a search buffer block acquisition unit 2022. According to the algorithm used, the prefetch point determination unit 2021 is used to determine the prefetch point S. The prefetch point S is usually selected as the first point of the rectangular area covered at the beginning of the search algorithm.
[0102] Specifically, such as Figure 4A As shown, in the hexagonal search algorithm, the search points ABCDEF are typically searched sequentially to form a hexagonal search shape. In the hexagonal search algorithm, the rectangular area covering all search points AF in a single search is a 5*3 rectangle, which can also be interpreted as a search shape with a width w of 5 and a height h of 3. The first point is point S as shown in the figure, which is designated as the pre-fetch point S.
[0103] For example Figure 4BAs shown, in the diamond search algorithm, the search order of search points ABCDEF is also used, searching one by one to form a diamond-shaped search pattern. The rectangular area covering all search points AF in one search process is a 3*3 rectangular area, which can also be interpreted as the search shape having a width w of 3 and a height h of 3. The first point is point S as shown in the figure, which is determined as the prefetch point S. This invention only uses the hexagonal search algorithm and the diamond search algorithm as examples for illustration. For other search algorithms, the same method is used to determine the prefetch point S, and will not be elaborated further here.
[0104] The search cache block acquisition unit 2022 is used to acquire the search cache block P. Based on the determined prefetch point S, the search cache block P is acquired from the reference frame Fref. The search cache block P is used to cache all reference frame data used in one search process.
[0105] Specifically, such as Figure 4A As shown, in the hexagonal search algorithm, starting from the prefetch point S, a square search buffer block P is taken from the reference frame Fref. To ensure that the search buffer block P can cover all the reference frame data used in one search, the width of the search buffer block P can be set to M+1, and the height to N+t. Here, 1≥w-1, where w is the width of the search shape in the hexagonal search algorithm (e.g., w=5), and t≥h-1, where h is the height of the search shape in the hexagonal search algorithm (e.g., h=3). Therefore, it can be determined that in the hexagonal search algorithm, the data block size contained in the search buffer block P is at least (M+4)*(N+2).
[0106] Again Figure 4B As shown, in the diamond search algorithm, starting from the prefetch point S, a square search buffer block P is also taken from the reference frame Fref. To ensure that the search buffer block P can cover all the reference frame data used in one search, the width of the search buffer block P can be set to M+1, and the height to N+t. Here, 1≥w-1, where w is the width of the search shape in the diamond search algorithm (e.g., w=3), and t≥h-1, where h is the height of the search shape in the hexagonal search algorithm (e.g., h=3). Therefore, it can be determined that the data block size contained in the search buffer block P in the diamond search algorithm is (M+2)*(N+2).
[0107] The index table creation unit 203 is used to determine the index table. Based on the adopted search algorithm, the search order for each search point is determined. In the hexagonal search algorithm or diamond search algorithm described above, the search order is from search point A to search point F. The position L(x, y) of each search point AF in the search cache block P is saved according to the search order, and the positions L(x, y) corresponding to all search points AF during one search process are saved in the index table T.
[0108] Specifically, Figure 5A This shows the specific structure of the index table for the hexagonal search algorithm. Figure 5B The specific structure of the diamond search algorithm index table is shown. This invention is only used as an example for illustration and is not limited thereto.
[0109] During the search, the starting position of the coded tree block Ci is obtained directly from the index table T, and the index table T is updated with the position of MVP during each search process before the search ends.
[0110] Based on the search cache block P and the index table T, the parallel computing unit 204 performs row vector calculations in parallel. Starting from the position L(x, y) of a search point sequentially retrieved from the index table T, one or more rows of data are retrieved from the search cache block P. The retrieved one or more rows of data are used to calculate the SAD or SATD value with the coding tree block Ci. If the vector of the retrieved i-th row of data is Vi[L(x, y)], then the SAD or SATD value of position L(x, y) is calculated by the following formula:
[0111]
[0112]
[0113] Where Vn(Ci, n) is the nth vector row corresponding to the encoding tree block Ci, and i is the number of search points in the search shape. For the hexagonal search algorithm, i = 6, and for the diamond search algorithm, i is also equal to 6. However, for the diamond search algorithm, the search point F coincides with the MVP point and can be skipped during the search.
[0114] Traverse the entire index table T, and for each position L(x, y), calculate the SAD or SATD value of the corresponding block.
[0115] The acceleration device 200 of the present invention further includes a judgment unit 205 and an MVP point update unit 206. The judgment unit 205 is used to determine whether the SAD or SATD values of all search points are greater than the SAD or SATD value corresponding to the MVP point; if so, one search process ends. If not, the MVP point update unit 206 is used to update the MVP point to the search point with the minimum SAD or SATD value, return to S1052, and recalculate the SAD or SATD value.
[0116] In this invention, the parallel computing unit 204 can be any computing unit with storage and parallel computing capabilities. This solution can be used to achieve the acceleration goal. Typical computing units include:
[0117] 1: Video codec or dedicated ASIC for video processing. The cache in the video codec or dedicated ASIC for video processing is used to search the storage of cache block P, and parallel operations of row vectors are performed through parallel units.
[0118] 2: Use FPGA as the acceleration unit, utilize the internal RAM or external DRAM of FPGA to store the search cache block P, and implement the parallel operation of index table T and row vector in the logic unit;
[0119] 3: Use the GPU as the acceleration unit, utilize the GPU's internal cache or DRAM to store the search cache block P, and implement parallel operations on the index table and row vectors in the parallel unit;
[0120] 4: Use the CPU's vectorized instructions to store the search cache block P using the CPU's internal cache or DRAM. The CPU's vectorized instructions enable parallel operations on the index table and row vectors.
[0121] The present invention also provides a computing device including at least one acceleration device as described above.
[0122] Of course, for computing devices, there are also other registers and functional modules, which will not be described in detail here.
[0123] The present invention also provides a storage medium for storing a computer program for executing any of the video coding motion search acceleration methods described above.
[0124] In summary, this invention improves encoding and decoding efficiency by adding a search cache block to prefetch the data used in a single search process, dividing the computation into row vectors, and parallelizing the computation, thereby reducing data access and computation, and improving operational efficiency.
[0125] Of course, the present invention may have other various embodiments. Without departing from the spirit and essence of the present invention, those skilled in the art can make various corresponding changes and modifications according to the present invention, but these corresponding changes and modifications should all fall within the protection scope of the appended claims.
Claims
1. A method for accelerating motion search in video coding, characterized in that, Includes the following steps: Obtain the reference frame Fref and the coding tree block C i The coded tree block comprises an M*N pixel matrix, where M is the number of pixels in each row and N is the number of pixels in each column; The prefetch point S is determined based on the search algorithm; Based on the determined prefetch point S, the search buffer block P is obtained in the reference frame Fref; Based on the search algorithm, determine the index table T; Based on the search cache block P and the index table T, row vector calculations are performed in parallel. The step of determining the prefetch point S according to the search algorithm further includes: The first point of the rectangular area covered by the search algorithm at the start is determined as the pre-fetch point S; The step of obtaining the search cache block P in the reference frame Fref further includes: Starting from the prefetch point S, a square search buffer block P is taken from the reference frame Fref; The step of determining the index table T further includes: According to the search algorithm, the search order of each search point is determined, and the position L(x, y) of each search point in the search cache block P is saved according to the search order. The position L(x, y) in one search process is also saved in the index table T. The coded tree block C is obtained directly from the index table T. i The starting position of the MVP is determined, and the index table T updates the position of the MVP during each search process before the search ends.
2. The acceleration method as described in claim 1, characterized in that, The search algorithms include diamond search, hexagonal search, asymmetric cross-shaped multi-level hexagonal grid search, or full search.
3. The acceleration method as described in claim 2, characterized in that, The search cache block P is used to cache the reference frame data used in a search process. The size of the search cache block is P≥(M+l)*(N+t), where l≥w–1, w is the width of the search shape in the search algorithm, and t≥h–1, h is the height of the search shape in the search algorithm.
4. The acceleration method as described in claim 1, characterized in that, The parallel execution of row vector calculations further includes: Starting from the position L(x, y) of a search point retrieved sequentially from the index table T, one or more rows of data are retrieved for use with the coding tree block C. i Calculate the SAD or SATD value, and the vector of the i-th row of data is V. i [L(x, y)], then the value of SAD or SATD at the position L(x, y) is calculated by the following formula: ; Among them, V n (C i,n ) is the coding tree block C i The corresponding nth vector row, where i is the number of search points in the search shape; Traverse the index table T, and for each position L(x, y), calculate the SAD or SATD value of the corresponding block.
5. The acceleration method as described in claim 4, characterized in that, The acceleration method further includes: Determine whether the SAD or SATD values of all search points are greater than the SAD or SATD value corresponding to the MVP point; If so, the search ends; If not, update the MVP point to the search point where the minimum value of SAD or SATD is found.
6. An acceleration device for video coding motion search, characterized in that, include: The data acquisition unit is used to acquire the reference frame Fref and the coding tree block C. i The coded tree block comprises an M*N pixel matrix, where M is the number of pixels in each row and N is the number of pixels in each column; The data processing unit is used to determine a prefetch point S according to a search algorithm, and to obtain a search buffer block P in the reference frame Fref based on the determined prefetch point S. The index table creation unit is used to determine the index table T according to the search algorithm; A parallel computing unit is used to perform row vector calculations in parallel based on the search cache block P and the index table T; The data processing unit is also used for: The first point of the rectangular area covered by the search algorithm at the start is determined as the pre-fetch point S; The data processing unit is also used for: Starting from the prefetch point S, a square search buffer block P is taken from the reference frame Fref; The index table creation unit is also used for: According to the search algorithm, the search order of each search point is determined, and the position L(x, y) of each search point in the search cache block P is saved according to the search order. The position L(x, y) in one search process is also saved in the index table T. The coded tree block C is obtained directly from the index table T. i The starting position of the MVP is determined, and the index table T updates the position of the MVP during each search process before the search ends.
7. The acceleration device as described in claim 6, characterized in that, The prefetch point S is determined based on the first point of the rectangular area covered at the start of the search algorithm. The search algorithm includes diamond search, hexagonal search, asymmetric cross-shaped multi-level hexagonal grid search, or full search.
8. The acceleration device as described in claim 7, characterized in that, The search cache block P is used to cache the reference frame data used in a search process. The size of the search cache block is P≥(M+l)*(N+t), where l≥w–1, w is the width of the search shape in the search algorithm, and t≥h–1, h is the height of the search shape in the search algorithm.
9. The acceleration device as described in claim 6, characterized in that, The parallel computing unit is also used for: Starting from the position L(x, y) of a search point retrieved sequentially from the index table T, one or more rows of data are retrieved for use with the coding tree block C. i Calculate the SAD or SATD value, and the vector of the i-th row of data is V. i [L(x, y)], then the value of SAD or SATD at the position L(x, y) is calculated by the following formula: ; Among them, V n (C i,n ) is the coding tree block C i The corresponding nth vector row, where i is the number of search points in the search shape; Traverse the index table T, and for each position L(x, y), calculate the SAD or SATD value of the corresponding block.
10. The acceleration device as claimed in claim 9, characterized in that, The acceleration device further includes: A judgment unit is used to determine whether the SAD or SATD values of all search points are greater than the SAD or SATD value corresponding to the MVP point; An MVP point update unit is used to update the MVP point to the search point with the minimum SAD or SATD value when the SAD or SATD values of all search points are not greater than the SAD or SATD value corresponding to the MVP point.
11. A computing device, characterized in that: The computing device includes an acceleration device for video-encoded motion search as described in any one of claims 6 to 10.
12. A storage medium for storing computer programs, characterized in that: The computer program is used to execute the accelerated method for video-encoded motion search as described in any one of claims 1-5.
Citation Information
Patent Citations
Video decoding data storage method and calculation method of motion vector data
CN104811721A
Motion vector detection apparatus and method for controlling the same
US20180063547A1