Residual data writing method, device, computer equipment and storage medium

By optimizing the reading method and buffer configuration of residual data, the writing efficiency of residual data in the video encoder is improved, the problem of long writing time in the prior art is solved, and the coding efficiency is achieved.

CN117135362BActive Publication Date: 2025-02-18GLENFLY TECHNOLOGY (BEIJING) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311146051.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-06
Publication Date
2025-02-18
Estimated Expiration
2043-09-06

AI Technical Summary

Technical Problem

In the prior art, the writing time of residual data is long, resulting in low access efficiency of residual data, affecting the encoding efficiency of video encoder.

Method used

By determining the appropriate residual data reading method, configure the buffer group and buffer, obtain the buffer label and address of the residual data to be written, and write the data into the corresponding buffer. The method includes configuring a residual data reading circuit to simultaneously read residual data of two adjacent motion vectors, and determining the buffer group and the number of buffers according to the reading method.

Benefits of technology

The clock cycle of data writing is significantly reduced, the writing time of residual data is reduced, the access efficiency of residual data is improved, and the encoding efficiency of video encoder is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117135362B_ABST
    Figure CN117135362B_ABST
Patent Text Reader

Abstract

The present application relates to a residual data writing method, device, computer equipment and storage medium. The method includes: determining a residual data reading method; the residual data reading method includes the reading order of each residual data and the number of parameter data read simultaneously each time; determining the number of buffer groups and the number of buffers included in each buffer group according to the residual data reading method; each buffer is provided with a unique buffer label, and each buffer includes multiple buffer addresses; obtaining the buffer label and buffer address corresponding to the residual data to be written; according to the buffer label and the buffer address, writing the residual data to be written into the corresponding buffer. Writing the residual data of different coordinates into the buffer at one time avoids writing only the residual data of one coordinate at a time, significantly reducing the clock cycle of data writing. The use of this method can greatly reduce the writing time of residual data and improve the access efficiency of residual data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of video coding and decoding technology, and in particular to a residual data writing method, device, computer equipment, storage medium and computer program product. Background Art

[0002] With the continuous update of coding technology in video codec standards, the amount of video coding data continues to increase. In order to improve the data compression rate, mainstream video coding standards use inter-frame coding to improve the video compression rate. Inter-frame coding requires the use of the current frame data and the reference frame data to obtain residual data, and use the residual data for motion estimation. With the continuous update of coding technology, the amount of residual data in the motion estimation process is also increasing. The access efficiency of residual data greatly affects the coding efficiency. Therefore, how to improve the access efficiency of residual data is a problem that needs to be solved when designing each encoder.

[0003] In traditional technology, motion estimation is divided into three stages: coarse stage, fine stage, and fraction stage. The residual data is block data. In the coarse stage, there are 16 residual data belonging to 9 motion vectors in every two 128-bit residual data. In the fine and fraction stages, every two 128-bit data contains data of 16 motion vectors. Existing methods use row scanning order to cache the data of motion vectors in sequence. Taking coarse as an example, coarse caches the data of 9 motion vectors in vector order. It is necessary to split and splice the two 128-bit data and store the data in SRAM 9 times. This method requires 9 cycles to store the two 128-bit residual data in SRAM. A 32x32 block requires 512 residual data for each search, and the time required to cache the data is 4608 cycles. The fine and fraction stages take longer to cache data, which leads to the time redundancy of caching residual data, causing the encoder to be idle for a long time, seriously affecting the encoding efficiency of the encoder.

[0004] Currently, the writing time of residual data is long, resulting in low access efficiency of residual data. Summary of the invention

[0005] Based on this, it is necessary to provide a residual data writing method, apparatus, computer equipment, computer-readable storage medium and computer program product that can improve the residual data access efficiency in response to the above technical problems.

[0006] In a first aspect, the present application provides a residual data writing method, comprising:

[0007] Determine a residual data reading method; the residual data reading method includes a reading order of each residual data and the number of parameter data read simultaneously each time;

[0008] Determine the number of buffer groups and the number of buffers included in each buffer group according to the residual data reading method; each buffer is provided with a unique buffer label, and each buffer includes a plurality of buffer addresses;

[0009] Obtaining the buffer number and buffer address corresponding to the residual data to be written;

[0010] The residual data to be written is written into the corresponding buffer according to the buffer label and the buffer address.

[0011] In one embodiment, determining the residual data reading method includes:

[0012] A residual data reading circuit is configured; the residual data reading circuit includes two data interfaces; the two data interfaces are used to simultaneously read the residual data of two adjacent motion vectors during each residual data reading process;

[0013] The residual data is read from the buffer at least once through two data interfaces of the residual data reading circuit.

[0014] In one embodiment, the number of buffer groups and the number of buffers included in each buffer group are determined according to the residual data reading method, including:

[0015] According to the residual data reading method, determining that in each residual data reading process, the residual data of two adjacent motion vectors are read simultaneously to configure two buffer groups;

[0016] In each buffer group, the same number of buffers is configured.

[0017] In one embodiment, obtaining a buffer number and a buffer address corresponding to the residual data to be written includes:

[0018] The initial residual data obtained in the motion estimation target stage is split to obtain 16-bit residual data to be written;

[0019] According to the positional relationship between the residual data to be written and the initial residual data, the vector coordinates corresponding to the residual data to be written are obtained;

[0020] Obtain the search center point corresponding to the initial residual data, and obtain the vector offset coordinates of the residual data to be written according to the offset between the vector coordinates and the search center point;

[0021] According to the vector offset coordinates, the buffer number and buffer address corresponding to the residual data to be written are obtained.

[0022] In one embodiment, obtaining the buffer number corresponding to the residual data to be written according to the vector offset coordinates includes:

[0023] splicing cache lines of the same cache depth of all caches according to the cache label of each cache to obtain a spliced ​​cache line;

[0024] According to the cache line width of each cache, obtaining the splicing width of the spliced ​​cache line;

[0025] Determine a first position mapping relationship between the residual data to be written and the splicing cache line according to the vector offset coordinates and the splicing width;

[0026] According to the first position mapping relationship, a buffer group and a corresponding buffer corresponding to the residual data to be written are determined to determine a buffer label corresponding to the residual data to be written.

[0027] In one of the embodiments, the residual data to be written includes first residual data and second residual data, the first residual data and the second residual data are residual data of two adjacent motion vectors; according to the first position mapping relationship, determining a buffer group and a corresponding buffer corresponding to the residual data to be written to determine a buffer label corresponding to the residual data to be written, including:

[0028] According to the arrangement order of the buffers in each buffer group, a plurality of target buffers having a corresponding relationship are determined; each target buffer belongs to a different buffer group and has the same arrangement order in the corresponding buffer group;

[0029] Obtaining a difference parameter according to a buffer label of each target buffer;

[0030] According to the first position mapping relationship, respectively determine the buffer groups and corresponding buffers corresponding to the first residual data and the second residual data, so as to determine the first buffer number corresponding to the first residual data and the second buffer number corresponding to the second residual data;

[0031] When the first buffer label is the same as the second buffer label, the second buffer label is corrected according to the difference parameter to obtain a third buffer label;

[0032] The first buffer number is used as the buffer number corresponding to the first residual data, and the third buffer number is used as the buffer number corresponding to the second residual data.

[0033] In one embodiment, obtaining a buffer address corresponding to the residual data to be written according to the vector offset coordinates includes:

[0034] Determine a second position mapping relationship between the residual data to be written and the cache depth according to the vector offset coordinates and the search center point;

[0035] According to the second position mapping relationship, a cache depth corresponding to the residual data to be written is determined to determine a cache address corresponding to the residual data to be written.

[0036] In one embodiment, writing the residual data to be written into the corresponding buffer according to the buffer label and the buffer address includes:

[0037] Generate a MASK mask corresponding to the buffer label and the buffer address;

[0038] According to the buffer number, buffer address and MASK mask, the residual data to be written is written into the corresponding buffer.

[0039] In a second aspect, the present application further provides a residual data writing device, comprising:

[0040] A determination module is used to determine a residual data reading method; the residual data reading method includes a reading order of each residual data and a quantity of parameter data read simultaneously each time;

[0041] A configuration module, used to determine the number of buffer groups and the number of buffers included in each buffer group according to the residual data reading method; each buffer is provided with a unique buffer label, and each buffer includes a plurality of buffer addresses;

[0042] An acquisition module, used for acquiring a buffer number and a buffer address corresponding to the residual data to be written;

[0043] The writing module is used to write the residual data to be written into the corresponding buffer according to the buffer label and the buffer address.

[0044] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0045] Determine a residual data reading method; the residual data reading method includes a reading order of each residual data and the number of parameter data read simultaneously each time;

[0046] Determine the number of buffer groups and the number of buffers included in each buffer group according to the residual data reading method; each buffer is provided with a unique buffer label, and each buffer includes a plurality of buffer addresses;

[0047] Obtaining the buffer number and buffer address corresponding to the residual data to be written;

[0048] The residual data to be written is written into the corresponding buffer according to the buffer label and the buffer address.

[0049] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:

[0050] Determine a residual data reading method; the residual data reading method includes a reading order of each residual data and the number of parameter data read simultaneously each time;

[0051] Determine the number of buffer groups and the number of buffers included in each buffer group according to the residual data reading method; each buffer is provided with a unique buffer label, and each buffer includes a plurality of buffer addresses;

[0052] Obtaining the buffer number and buffer address corresponding to the residual data to be written;

[0053] The residual data to be written is written into the corresponding buffer according to the buffer label and the buffer address.

[0054] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:

[0055] Determine a residual data reading method; the residual data reading method includes a reading order of each residual data and the number of parameter data read simultaneously each time;

[0056] Determine the number of buffer groups and the number of buffers included in each buffer group according to the residual data reading method; each buffer is provided with a unique buffer label, and each buffer includes a plurality of buffer addresses;

[0057] Obtaining the buffer number and buffer address corresponding to the residual data to be written;

[0058] The residual data to be written is written into the corresponding buffer according to the buffer label and the buffer address.

[0059] The above-mentioned residual data writing method, device, computer equipment, storage medium and computer program product determine the residual data reading method; the residual data reading method includes the reading order of each residual data and the number of parameter data read simultaneously each time; the number of buffer groups and the number of buffers included in each buffer group are determined according to the residual data reading method; each buffer is provided with a unique buffer label, and each buffer includes multiple buffer addresses; the buffer label and buffer address corresponding to the residual data to be written are obtained; according to the buffer label and the buffer address, the residual data to be written is written into the corresponding buffer. The residual data of different coordinates are written into the buffer at one time to avoid writing only the residual data of one coordinate at a time, which significantly reduces the clock cycle of data writing, can greatly reduce the writing time of residual data, and improve the access efficiency of residual data. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0061] Figure 1 is a schematic flow chart of a residual data writing method in one embodiment;

[0062] Figure 2 A schematic diagram of a process of address mapping and data writing in one embodiment;

[0063] Figure 3 A schematic diagram of obtaining residual data in a coarse search phase in one embodiment;

[0064] Figure 4 is a schematic diagram of residual data in a coarse search phase in one embodiment;

[0065] Figure 5 is a schematic diagram of a residual data reading sequence in one embodiment;

[0066] Figure 6 A schematic diagram of a process for obtaining residual data in a finesh search phase in one embodiment;

[0067] Figure 7 A schematic diagram of a storage layout of a finesh search phase in one embodiment;

[0068] Figure 8 A schematic diagram of lateral mapping in a finesh search phase in one embodiment;

[0069] Fig. 9 is a structural block diagram of a residual data writing device in one embodiment;

[0070] Fig.10 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0071] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0072] In one embodiment, Figure 1 As shown, a residual data writing method is provided. This embodiment uses the method applied to a computer device as an example for illustration. It can be understood that the computer device can specifically be a terminal or a server. Among them, the terminal can be but is not limited to various personal computers, laptops, smart phones, tablet computers, Internet of Things devices, portable wearable devices, and the Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart medical devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server can be implemented as an independent server or a server cluster composed of multiple servers. In this embodiment, the method includes the following steps 102 to 108.

[0073] in:

[0074] Step 102, determining a residual data reading method; the residual data reading method includes a reading order of each residual data and the number of parameter data read simultaneously each time.

[0075] Optionally, the residual data reading circuit is configured according to the determined residual data reading method. For example, the residual data reading method adopts a reading method of reading the residual data of two adjacent motion vectors at a time, and the residual data reading circuit can be configured with two data interfaces, each of which is connected to a group of buffers, and in each residual data reading process, the two data interfaces read two residual data from the two groups of buffers at the same time.

[0076] Step 104, determining the number of buffer groups and the number of buffers included in each buffer group according to the residual data reading method; each buffer is provided with a unique buffer label, and each buffer includes a plurality of buffer addresses.

[0077] The buffer group can be represented by Bank, and the buffer can be represented by Sram.

[0078] Optionally, according to the determined residual data reading method, it is determined that in each residual data reading process, the residual data of two adjacent motion vectors need to be read simultaneously, and then two buffer groups are configured, and the same number of buffers are configured in each buffer group. Figure 2 As shown, two buffer groups Bank0 and Bank1 are configured, Bank0 is provided with four buffers Sram0-3, and Bank1 is provided with four buffers Sram4-7, for a total of 8 buffers Sram. In this way, the two data interfaces of the residual data reading circuit can be connected to Bank0 and Bank1 respectively, and each time the data is read, a residual data can be read out from each buffer group respectively.

[0079] Specifically, the residual data in the coarse search phase is the characteristics of the two-dimensional block data, such as Figure 3 As shown in the figure, there are 9 cases where the current block and the reference block overlap. The dark block is the current block and the light block is the reference block. Their sizes are all 16x16, and each block can be divided into 4 8x8 sub-blocks. The residual data is the difference between each 8x8 sub-block of the current block and each 8x8 sub-block of the reference block. Figure 3 The 9 motion vectors correspond to 16 residual data, each with 16 bits, which are combined as follows: Figure 4 The residual data reading order is as follows Figure 5 As shown, the reading circuit has two data interfaces, and the residual data of two adjacent motion vectors are read simultaneously.

[0080] The format of residual data in the Finesh search phase is as follows Figure 6 As shown, the two 128-bit data are the residual data of an 8x8 sub-block of the current block and all 8x8 sub-blocks within the 4x4 range of the reference block. The reading order in the fine search stage is the same as that in the coarse search stage, and each cycle reads the residual data of two adjacent motion vectors.

[0081] Step 106, obtaining the buffer number and buffer address corresponding to the residual data to be written.

[0082] The buffer number can be represented by index, and the buffer address can be represented by Addr.

[0083] Optionally, the initial residual data obtained in the motion estimation target stage is split to obtain 16-bit residual data to be written. According to the positional relationship between the residual data to be written and the initial residual data, the vector coordinates corresponding to the residual data to be written are obtained. The search center point corresponding to the initial residual data is obtained, and the vector offset coordinates of the residual data to be written are obtained according to the offset between the vector coordinates and the search center point. According to the vector offset coordinates, the buffer number and buffer address corresponding to the residual data to be written are obtained.

[0084] Specifically, Figure 2 As shown, firstly, data splitting is performed: split the 256-bit residual data into 16 16-bit data. Then the vector coordinate offset calculation is performed: calculate the offset between the vector coordinates corresponding to the 16 data and the search center point, and determine its vector offset coordinates within the search range. Next, Sram horizontal mapping can be performed: the storage space is 8 Srams, each Sram line is 64 bits long and 72 bits deep. Put 8 Srams together with a width of 512 bits, and map each 16-bit data according to its vector offset coordinates. At the same time, Sram vertical mapping is performed: each Sram is 72, and there are two search centers for each search, which are divided into two parts, 0-35 and 36-72, and the data of the two search centers are mapped respectively.

[0085] Step 108, writing the residual data to be written into the corresponding buffer according to the buffer label and the buffer address.

[0086] Optionally, a MASK mask corresponding to the buffer number and the buffer address is generated; and the residual data to be written is written into the corresponding buffer according to the buffer number, the buffer address and the MASK mask.

[0087] Specifically, Figure 2 As shown, the residual data is stored in the corresponding SRAM according to the horizontally mapped SRAM number, the vertically mapped SRAM address and the corresponding MASK. In this way, the residual data reading method can be adopted to realize the parallel reading of the residual data. The residual data of adjacent motion vectors are stored in the same address in different buffers and can be read at the same time, meeting the requirement of the calculation logic to calculate two motion vectors at the same time.

[0088] In the above residual data writing method, the residual data reading method is determined; the residual data reading method includes the reading order of each residual data and the number of parameter data read simultaneously each time; the number of buffer groups and the number of buffers included in each buffer group are determined according to the residual data reading method; each buffer is provided with a unique buffer label, and each buffer includes multiple buffer addresses; the buffer label and buffer address corresponding to the residual data to be written are obtained; according to the buffer label and the buffer address, the residual data to be written is written into the corresponding buffer. The residual data of different coordinates are written into the buffer at one time to avoid writing only the residual data of one coordinate at a time, which significantly reduces the clock cycle of data writing, can greatly reduce the writing time of residual data, and improve the access efficiency of residual data.

[0089] In one embodiment, obtaining a buffer number and a buffer address corresponding to the residual data to be written, and writing the residual data to be written into the corresponding buffer according to the buffer number and the buffer address, includes:

[0090] First, the initial residual data obtained in the motion estimation target stage is split to obtain 16-bit residual data to be written; according to the positional relationship between the residual data to be written and the initial residual data, the vector coordinates corresponding to the residual data to be written are obtained; the search center point corresponding to the initial residual data is obtained, and the vector offset coordinates of the residual data to be written are obtained according to the offset between the vector coordinates and the search center point.

[0091] Then, according to the cache number of each cache, the cache lines of the same cache depth of all the caches are spliced ​​to obtain a spliced ​​cache line; according to the cache line width of each cache, the splicing width of the spliced ​​cache line is obtained; according to the vector offset coordinates and the splicing width, the first position mapping relationship between the residual data to be written and the spliced ​​cache line is determined; the residual data to be written includes first residual data and second residual data, and the first residual data and the second residual data are residual data of two adjacent motion vectors.

[0092] Furthermore, according to the arrangement order of the buffers in each buffer group, multiple target buffers with corresponding relationships are determined; each target buffer belongs to a different buffer group, and the arrangement order in the corresponding buffer group is the same; according to the buffer label of each target buffer, a difference parameter is obtained; according to the first position mapping relationship, the buffer groups and the corresponding buffers corresponding to the first residual data and the second residual data are respectively determined to determine the first buffer label corresponding to the first residual data, and the second buffer label corresponding to the second residual data; when the first buffer label is the same as the second buffer label, the second buffer label is corrected according to the difference parameter to obtain a third buffer label; the first buffer label is used as the buffer label corresponding to the first residual data, and the third buffer label is used as the buffer label corresponding to the second residual data.

[0093] And, according to the vector offset coordinates and the search center point, determine the second position mapping relationship between the residual data to be written and the cache depth; according to the second position mapping relationship, determine the cache depth corresponding to the residual data to be written to determine the cache address corresponding to the residual data to be written.

[0094] Finally, a MASK mask corresponding to the buffer number and the buffer address is generated; and the residual data to be written is written into the corresponding buffer according to the buffer number, the buffer address and the MASK mask.

[0095] Specifically, on the one hand, taking the address mapping in the coarse search phase as an example, the above specific implementation process includes:

[0096] (1) Vector coordinate offset calculation

[0097] Assume the search center vector coordinates are (scmvy, scmvx), Figure 3 The vector coordinates of the center dark block are (cfmvy, cfmvx), numbered as C (C takes the value of 2'b00-2'b11), R (R takes the value of 2'b00-2'b11), and the vector offset coordinates of each 16 data are shown in Table 1:

[0098] serial number Block Information coordinate 4’b0000 C0R0 (scmvy-cfmvy, scmvx-cfmvx) 4’b0001 C0R1 (scmvy-cfmvy, scmvx–cfmvx-1) 4’b0010 C0R2 (scmvy–cfmvy-1, scmvx-cfmvx) 4’b0011 C0R3 (scmvy–cfmvy-1, scmvx–cfmvx-1) 4’b0100 C0R4 (scmvy-cfmvy, scmvx–cfmvx+1) 4’b0101 C0R5 (scmvy-cfmvy, scmvx-cfmvx) 4’b0110 C0R6 (scmvy–cfmvy-1, scmvx–cfmvx+1) 4’b0111 C0R7 (scmvy–cfmvy-1, scmvx-cfmvx) 4’b1000 C0R8 (scmvy–cfmvy+1,scmvx-cfmvx) 4’b1001 C0R9 (scmvy–cfmvy+1, scmvx–cfmvx-1) 4’b1010 C0R10 (scmvy-cfmvy, scmvx-cfmvx) 4’b1011 C0R11 (scmvy-cfmvy, scmvx–cfmvx-1) 4’b1100 C0R12 (scmvy–cfmvy+1, scmvx–cfmvx+1) 4’b1101 C0R13 (scmvy–cfmvy+1,scmvx-cfmvx) 4’b1110 C0R14 (scmvy-cfmvy, scmvx–cfmvx+1) 4’b1111 C0R15 (scmvy-cfmvy, scmvx-cfmvx)

[0099] Table 1

[0100] (2) Horizontal mapping

[0101] The horizontal mapping index value is 0-31. Since the storage layout is a Z-type layout, the data is encoded using coordinates as follows:

[0102] index=(Y[1],X[1],Y[0],X[0])

[0103] Because adjacent coordinate data will be read out at the same address, adjacent coordinate codes are the same, so the coordinate code is

[0104] index=(Y[1],X[1],Y[0])

[0105] Because one coordinate data consists of four 16-bit data, the reference block number R parameter is used to distinguish them, so the encoding is

[0106] index=(Y[1],X[1],Y[0],R[1],R[0])

[0107] Consider the case where the CU size is 32x32, there are 4 16x16 blocks, and the data with the same coordinates are in the same row. Assume that the 16x16 block number is cu16[1:0], then the encoding is:

[0108] index=((Y[1],X[1],Y[0],R[1],R[0])+(cu16[1:0], 2'b00)).

[0109] In the above formula, the adjacent coordinates have the same index. To ensure that the adjacent coordinates are correctly stored in the corresponding sram, the following operations are performed to ensure that one is stored in sram0-3 and the other is stored in sram4-7.

[0110] If index[4]!=x[0]:index=index-16, where 16 is equivalent to the difference parameter.

[0111] (3) Vertical Mapping

[0112] The vertical mapping addr is set to xoffset, and yoffset.

[0113] Addr = base addr +xoffset[3:1]+yoffset[2:0]×4

[0114] The search range is 8x8, and because the adjacent coordinate addresses are the same, xoffset is [3:1], and the address opening for each row is 4.

[0115] Each 16-bit data corresponds to a 512-bit mask as shown below

[0116] mask=1< <index

[0117] (4) Data writing

[0118] Before writing data, the data needs to be shifted to the corresponding 512-bit position.

[0119] data_sft=data< <index×16

[0120] Combine data and mask:

[0121] Line_mask=mask0|mask1|…|mask15

[0122] Line_data=data_sft0|datasft1|…|datasft15

[0123] Split line_mask and line_data into data corresponding to 0-7sram, and write them into the corresponding sram according to the corresponding addr.

[0124] On the other hand, taking the address mapping in the finesh search phase as an example, the above specific implementation process includes:

[0125] (1) Vector coordinate offset calculation

[0126] Depend on Figure 5 It can be seen that the feature of each 256-bit data in the fine search stage is the residual data of all 8x8 blocks of an 8x8 block of the current block and an mv4x4 area of ​​the reference block. Therefore, according to the position relationship of the reference block, the vector offset coordinates of each 16-bit data can be obtained. Taking the C0 block as an example, its vector offset coordinates are shown in Table 2:

[0127]

[0128]

[0129] Table 2

[0130] (2) Horizontal mapping

[0131] If the Z-type storage layout is used, the index is similar to the coarse one. Figure 7 The data is arranged in the order shown, and each coordinate block contains 4 8x8 blocks of residual data. Figure 8 As shown, because adjacent coordinates need to be read at the same time, they are stored in the same address in 0-3sram and 4-7sram respectively. R15 and R14 are read at the same time, R15 data is stored in SRAM0 line0, and R14 data is stored in SRAM4 line0, so the starting index of the (0, 0) coordinate data is 0, and the starting index of (0, 1) is 16.

[0132] Depend on Figure 8 The lateral mapping index can be deduced as follows:

[0133] index={X[0],X[1],Y[0],2′b00}+C[1:0]

[0134] Where C[1:0] is the number of the current block. When the current block is 32x32, there are 4 16x16 blocks. The coordinates of these four blocks are the same and need to be taken out at the same time. Therefore, these 4 blocks should be in 0-3sram or 4-7sram at the same time. The index is modified as shown in the following formula:

[0135] index={X[0],X[1],Y[0],2′b00}+{cu16[1:0],C[1:0]}

[0136] Finally, to ensure that adjacent coordinate data is correctly stored in 0-3sram and 4-7sram, if (Index[4]!=X[0]), it means that the data that should belong to 0-3sram is stored in 4-7sram when the calculation overflows, then the following operation is performed to ensure that it is correctly stored: index=index-16, where 16 is equivalent to the difference parameter.

[0137] (3) Vertical Mapping

[0138] The vertical mapping is the SRAM address corresponding to each piece of data, and its calculation method is shown in the following formula:

[0139] addr=baseaddr+xoffset[3:1]+Yoffset[2:0]×4

[0140] The xoffset is [3:1] because the adjacent coordinate addresses are the same. When the range is 8x8, the yoffset is ×4 because the adjacent coordinate addresses are the same, so it can be regarded as a width of 4 per row.

[0141] (4) Data writing

[0142] The data writing in the finesh search phase is the same as that in the coarse search phase, and will not be repeated here.

[0143] In this embodiment, in Coarsh, data of 9 different coordinates are written into SRAM at one time, which reduces 7 clock cycles per 256-bit data compared to the traditional approach. In Finesh, data of 16 different coordinates are written into SRAM at one time, which reduces 14 clock cycles per 256-bit data compared to the traditional approach. When reading residual data, it supports reading residual data of two adjacent coordinates at one time, which improves the MEE search efficiency.

[0144] In one embodiment, according to different video encoding and decoding requirements, the number of buffer groups, the number of buffers included in each buffer group, and the relevant parameters of horizontal mapping and vertical mapping can be adjusted. The relevant parameters include but are not limited to the search range, search block, current block, and the size of the residual block.

[0145] Specifically, as video resolution continues to increase, video encoding and decoding standards also evolve, including a larger search range and a larger search block size. The horizontal mapping and vertical mapping parameters can be modified to cope with the impact of the expansion of the search range and the search block.

[0146] When the search range is expanded, the sram depth is expanded accordingly, and addr is parameterized:

[0147] Addr=xoffset[Hbit0:1]+Yoffset[Hbit1:0]×(width / 2)

[0148] Hbit is determined by the search range. If the search range is expanded horizontally, Hbit0 and width are expanded. If the search range is expanded vertically, Hbit1 is expanded.

[0149] When the search block becomes larger, the index is modified, the number of srams is increased accordingly, and addr is parameterized:

[0150] Index=zorder_index*(sram_num / 2)+{cu_idx[Hbit0:0], suboffset[Hbit1:0]}

[0151] Parameter description:

[0152] zorder_index is the Z-type storage order;

[0153] sram_num is the number of srams required;

[0154] cu_idx is the current block number. In HEVC, the current block size is 16x16. There are four search blocks for a 32x32 block.

[0155] suboffset is the number of the 8x8 residual block in cu16.

[0156] The search block is defined as Block, the current block is defined as MB, and the residual block is defined as subMB

[0157] Modify the index:

[0158]

[0159] In this embodiment, if a new encoding standard is used, there is no need to redesign the mapping logic, and only the corresponding buffer specifications and mapping parameters need to be adjusted, which has high scalability.

[0160] In one embodiment, a residual data writing method includes:

[0161] A residual data reading circuit is configured; the residual data reading circuit includes two data interfaces; the two data interfaces are used to simultaneously read the residual data of two adjacent motion vectors during each residual data reading process; the residual data is read from the buffer at least once through the two data interfaces of the residual data reading circuit. The residual data reading method includes the reading order of each residual data and the number of parameter data read simultaneously each time.

[0162] According to the residual data reading method, it is determined that in each residual data reading process, the residual data of two adjacent motion vectors are read simultaneously to configure two buffer groups; in each buffer group, the same number of buffers are configured. Each buffer is provided with a unique buffer label, and each buffer includes multiple buffer addresses.

[0163] The initial residual data obtained in the motion estimation target stage is split to obtain 16-bit residual data to be written; according to the positional relationship between the residual data to be written and the initial residual data, the vector coordinates corresponding to the residual data to be written are obtained; the search center point corresponding to the initial residual data is obtained, and the vector offset coordinates of the residual data to be written are obtained according to the offset between the vector coordinates and the search center point.

[0164] According to the cache number of each cache, the cache lines of the same cache depth of all the caches are spliced ​​to obtain a spliced ​​cache line; according to the cache line width of each cache, the splicing width of the spliced ​​cache line is obtained; according to the vector offset coordinates and the splicing width, the first position mapping relationship between the residual data to be written and the spliced ​​cache line is determined; the residual data to be written includes first residual data and second residual data, and the first residual data and the second residual data are residual data of two adjacent motion vectors.

[0165] According to the arrangement order of the buffers in each buffer group, multiple target buffers with corresponding relationships are determined; each target buffer belongs to a different buffer group, and the arrangement order in the corresponding buffer group is the same; according to the buffer label of each target buffer, a difference parameter is obtained; according to the first position mapping relationship, the buffer groups and the corresponding buffers corresponding to the first residual data and the second residual data are determined respectively to determine the first buffer label corresponding to the first residual data and the second buffer label corresponding to the second residual data; when the first buffer label is the same as the second buffer label, the second buffer label is corrected according to the difference parameter to obtain a third buffer label; the first buffer label is used as the buffer label corresponding to the first residual data, and the third buffer label is used as the buffer label corresponding to the second residual data.

[0166] According to the vector offset coordinates and the search center point, a second position mapping relationship between the residual data to be written and the cache depth is determined; according to the second position mapping relationship, the cache depth corresponding to the residual data to be written is determined to determine the cache address corresponding to the residual data to be written.

[0167] Generate a MASK mask corresponding to the buffer number and the buffer address; write the residual data to be written into the corresponding buffer according to the buffer number, the buffer address and the MASK mask.

[0168] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0169] Based on the same inventive concept, the embodiment of the present application also provides a residual data writing device for implementing the residual data writing method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more residual data writing device embodiments provided below can refer to the limitations of the residual data writing method above, and will not be repeated here.

[0170] In an exemplary embodiment, Fig. 9As shown, a residual data writing device 900 is provided, comprising: a determination module 901, a configuration module 902, an acquisition module 903 and a writing module 904, wherein:

[0171] The determination module 901 is used to determine the residual data reading method; the residual data reading method includes the reading order of each residual data and the number of parameter data read simultaneously each time.

[0172] The configuration module 902 is used to determine the number of buffer groups and the number of buffers included in each buffer group according to the residual data reading method; each buffer is provided with a unique buffer label, and each buffer includes a plurality of buffer addresses.

[0173] The acquisition module 903 is used to acquire the buffer number and buffer address corresponding to the residual data to be written.

[0174] The writing module 904 is used to write the residual data to be written into the corresponding buffer according to the buffer label and the buffer address.

[0175] In one embodiment, the determination module 901 is also used to configure a residual data reading circuit; the residual data reading circuit includes two data interfaces; the two data interfaces are used to simultaneously read the residual data of two adjacent motion vectors during each residual data reading process; and the residual data is read from the buffer at least once through the two data interfaces of the residual data reading circuit.

[0176] In one embodiment, the configuration module 902 is further used to determine, according to the residual data reading method, to simultaneously read the residual data of two adjacent motion vectors in each residual data reading process to configure two buffer groups; in each buffer group, the same number of buffers are configured.

[0177] In one embodiment, the acquisition module 903 is also used to split the initial residual data obtained in the motion estimation target stage to obtain 16-bit residual data to be written; according to the positional relationship between the residual data to be written and the initial residual data, the vector coordinates corresponding to the residual data to be written are obtained; the search center point corresponding to the initial residual data is obtained, and according to the offset between the vector coordinates and the search center point, the vector offset coordinates of the residual data to be written are obtained; according to the vector offset coordinates, the buffer label and buffer address corresponding to the residual data to be written are obtained.

[0178] In one embodiment, the acquisition module 903 is also used to splice cache lines of the same cache depth of all caches according to the cache label of each cache to obtain a spliced ​​cache line; obtain the splicing width of the spliced ​​cache line according to the cache line width of each cache; determine the first position mapping relationship between the residual data to be written and the spliced ​​cache line according to the vector offset coordinates and the splicing width; determine the cache group and the corresponding cache corresponding to the residual data to be written according to the first position mapping relationship, so as to determine the cache label corresponding to the residual data to be written.

[0179] In one embodiment, the residual data to be written includes first residual data and second residual data, and the first residual data and the second residual data are residual data of two adjacent motion vectors; the acquisition module 903 is also used to determine a plurality of target buffers having a corresponding relationship according to the arrangement order of the buffers in each buffer group; each target buffer belongs to a different buffer group respectively, and the arrangement order in the corresponding buffer group is the same; according to the buffer label of each target buffer, a difference parameter is obtained; according to the first position mapping relationship, the buffer groups and the corresponding buffers corresponding to the first residual data and the second residual data are respectively determined to determine the first buffer label corresponding to the first residual data, and the second buffer label corresponding to the second residual data; when the first buffer label is the same as the second buffer label, the second buffer label is corrected according to the difference parameter to obtain a third buffer label; the first buffer label is used as the buffer label corresponding to the first residual data, and the third buffer label is used as the buffer label corresponding to the second residual data.

[0180] In one embodiment, the acquisition module 903 is also used to determine a second position mapping relationship between the residual data to be written and the cache depth based on the vector offset coordinates and the search center point; based on the second position mapping relationship, determine the cache depth corresponding to the residual data to be written to determine the cache address corresponding to the residual data to be written.

[0181] In one embodiment, the writing module 904 is further used to generate a MASK mask corresponding to the buffer number and the buffer address; and write the residual data to be written into the corresponding buffer according to the buffer number, the buffer address and the MASK mask.

[0182] Each module in the above residual data writing device can be implemented in whole or in part by software, hardware and a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module above.

[0183] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Fig.10 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store video data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a residual data writing method is implemented.

[0184] Those skilled in the art will understand that Fig.10 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0185] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the following steps when executing the computer program: determining a residual data reading method; the residual data reading method includes a reading order of each residual data and a number of parameter data read simultaneously each time; determining the number of buffer groups and the number of buffers included in each buffer group according to the residual data reading method; each buffer is provided with a unique buffer label, and each buffer includes multiple buffer addresses; obtaining a buffer label and a buffer address corresponding to the residual data to be written; and writing the residual data to be written into the corresponding buffer according to the buffer label and the buffer address.

[0186] In one embodiment, the processor also implements the following steps when executing the computer program: configuring a residual data reading circuit; the residual data reading circuit includes two data interfaces; the two data interfaces are used to simultaneously read the residual data of two adjacent motion vectors during each residual data reading process; and reading the residual data from the buffer at least once through the two data interfaces of the residual data reading circuit.

[0187] In one embodiment, when the processor executes the computer program, the following steps are also implemented: according to the residual data reading method, it is determined that in each residual data reading process, the residual data of two adjacent motion vectors are read simultaneously to configure two buffer groups; in each buffer group, the same number of buffers are configured.

[0188] In one embodiment, when the processor executes the computer program, the following steps are also implemented: the initial residual data obtained in the motion estimation target stage is split to obtain 16-bit residual data to be written; based on the positional relationship between the residual data to be written and the initial residual data, the vector coordinates corresponding to the residual data to be written are obtained; the search center point corresponding to the initial residual data is obtained, and based on the offset between the vector coordinates and the search center point, the vector offset coordinates of the residual data to be written are obtained; based on the vector offset coordinates, the buffer label and buffer address corresponding to the residual data to be written are obtained.

[0189] In one embodiment, when the processor executes the computer program, the following steps are also implemented: according to the cache label of each cache, the cache lines of the same cache depth of all caches are spliced ​​to obtain a spliced ​​cache line; according to the cache line width of each cache, the splicing width of the spliced ​​cache line is obtained; according to the vector offset coordinates and the splicing width, a first position mapping relationship between the residual data to be written and the spliced ​​cache line is determined; according to the first position mapping relationship, a cache group and a corresponding cache corresponding to the residual data to be written are determined to determine the cache label corresponding to the residual data to be written.

[0190] In one embodiment, the residual data to be written includes first residual data and second residual data, and the first residual data and the second residual data are residual data of two adjacent motion vectors; when the processor executes the computer program, the following steps are also implemented: according to the arrangement order of the buffers in each buffer group, a plurality of target buffers with corresponding relationships are determined; each target buffer belongs to a different buffer group, and the arrangement order in the corresponding buffer group is the same; according to the buffer label of each target buffer, a difference parameter is obtained; according to the first position mapping relationship, the buffer groups and the corresponding buffers corresponding to the first residual data and the second residual data are determined respectively, so as to determine the first buffer label corresponding to the first residual data and the second buffer label corresponding to the second residual data; when the first buffer label is the same as the second buffer label, the second buffer label is corrected according to the difference parameter to obtain a third buffer label; the first buffer label is used as the buffer label corresponding to the first residual data, and the third buffer label is used as the buffer label corresponding to the second residual data.

[0191] In one embodiment, when the processor executes the computer program, the following steps are also implemented: determining a second position mapping relationship between the residual data to be written and the cache depth based on the vector offset coordinates and the search center point; determining the cache depth corresponding to the residual data to be written based on the second position mapping relationship to determine the cache address corresponding to the residual data to be written.

[0192] In one embodiment, when the processor executes the computer program, the following steps are also implemented: generating a MASK mask corresponding to the buffer number and the buffer address; and writing the residual data to be written into the corresponding buffer according to the buffer number, the buffer address and the MASK mask.

[0193] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented: determining a residual data reading method; the residual data reading method includes a reading order of each residual data, and the number of parameter data read simultaneously each time; determining the number of buffer groups and the number of buffers included in each buffer group according to the residual data reading method; each buffer is provided with a unique buffer label, and each buffer includes multiple buffer addresses; obtaining a buffer label and a buffer address corresponding to the residual data to be written; and writing the residual data to be written into the corresponding buffer according to the buffer label and the buffer address.

[0194] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: configuring a residual data reading circuit; the residual data reading circuit includes two data interfaces; the two data interfaces are used to simultaneously read the residual data of two adjacent motion vectors during each residual data reading process; and reading the residual data from the buffer at least once through the two data interfaces of the residual data reading circuit.

[0195] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: according to the residual data reading method, it is determined that in each residual data reading process, the residual data of two adjacent motion vectors are read simultaneously to configure two buffer groups; in each buffer group, the same number of buffers are configured.

[0196] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: the initial residual data obtained in the motion estimation target stage is split to obtain 16-bit residual data to be written; based on the positional relationship between the residual data to be written and the initial residual data, the vector coordinates corresponding to the residual data to be written are obtained; the search center point corresponding to the initial residual data is obtained, and based on the offset between the vector coordinates and the search center point, the vector offset coordinates of the residual data to be written are obtained; based on the vector offset coordinates, the buffer label and buffer address corresponding to the residual data to be written are obtained.

[0197] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: according to the cache label of each cache, the cache lines of the same cache depth of all caches are spliced ​​to obtain a spliced ​​cache line; according to the cache line width of each cache, the splicing width of the spliced ​​cache line is obtained; according to the vector offset coordinates and the splicing width, the first position mapping relationship between the residual data to be written and the spliced ​​cache line is determined; according to the first position mapping relationship, the cache group and the corresponding cache corresponding to the residual data to be written are determined to determine the cache label corresponding to the residual data to be written.

[0198] In one embodiment, the residual data to be written includes first residual data and second residual data, and the first residual data and the second residual data are residual data of two adjacent motion vectors; when the computer program is executed by the processor, the following steps are also implemented: according to the arrangement order of the buffers in each buffer group, a plurality of target buffers with corresponding relationships are determined; each target buffer belongs to a different buffer group, and the arrangement order in the corresponding buffer group is the same; according to the buffer label of each target buffer, a difference parameter is obtained; according to the first position mapping relationship, the buffer groups and the corresponding buffers corresponding to the first residual data and the second residual data are determined respectively to determine the first buffer label corresponding to the first residual data and the second buffer label corresponding to the second residual data; when the first buffer label is the same as the second buffer label, the second buffer label is corrected according to the difference parameter to obtain a third buffer label; the first buffer label is used as the buffer label corresponding to the first residual data, and the third buffer label is used as the buffer label corresponding to the second residual data.

[0199] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: determining a second position mapping relationship between the residual data to be written and the cache depth based on the vector offset coordinates and the search center point; determining the cache depth corresponding to the residual data to be written based on the second position mapping relationship to determine the cache address corresponding to the residual data to be written.

[0200] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: generating a MASK mask corresponding to the buffer number and the buffer address; and writing the residual data to be written into the corresponding buffer according to the buffer number, the buffer address and the MASK mask.

[0201] In one embodiment, a computer program product is provided, comprising a computer program, which implements the following steps when executed by a processor: determining a residual data reading method; the residual data reading method includes a reading order of each residual data and the number of parameter data read simultaneously each time; determining the number of buffer groups and the number of buffers included in each buffer group according to the residual data reading method; each buffer is provided with a unique buffer label, and each buffer includes multiple buffer addresses; obtaining a buffer label and a buffer address corresponding to the residual data to be written; and writing the residual data to be written into the corresponding buffer according to the buffer label and the buffer address.

[0202] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: configuring a residual data reading circuit; the residual data reading circuit includes two data interfaces; the two data interfaces are used to simultaneously read the residual data of two adjacent motion vectors during each residual data reading process; and reading the residual data from the buffer at least once through the two data interfaces of the residual data reading circuit.

[0203] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: according to the residual data reading method, it is determined that in each residual data reading process, the residual data of two adjacent motion vectors are read simultaneously to configure two buffer groups; in each buffer group, the same number of buffers are configured.

[0204] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: the initial residual data obtained in the motion estimation target stage is split to obtain 16-bit residual data to be written; based on the positional relationship between the residual data to be written and the initial residual data, the vector coordinates corresponding to the residual data to be written are obtained; the search center point corresponding to the initial residual data is obtained, and based on the offset between the vector coordinates and the search center point, the vector offset coordinates of the residual data to be written are obtained; based on the vector offset coordinates, the buffer label and buffer address corresponding to the residual data to be written are obtained.

[0205] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: according to the cache label of each cache, the cache lines of the same cache depth of all caches are spliced ​​to obtain a spliced ​​cache line; according to the cache line width of each cache, the splicing width of the spliced ​​cache line is obtained; according to the vector offset coordinates and the splicing width, the first position mapping relationship between the residual data to be written and the spliced ​​cache line is determined; according to the first position mapping relationship, the cache group and the corresponding cache corresponding to the residual data to be written are determined to determine the cache label corresponding to the residual data to be written.

[0206] In one embodiment, the residual data to be written includes first residual data and second residual data, and the first residual data and the second residual data are residual data of two adjacent motion vectors; when the computer program is executed by the processor, the following steps are also implemented: according to the arrangement order of the buffers in each buffer group, a plurality of target buffers with corresponding relationships are determined; each target buffer belongs to a different buffer group, and the arrangement order in the corresponding buffer group is the same; according to the buffer label of each target buffer, a difference parameter is obtained; according to the first position mapping relationship, the buffer groups and the corresponding buffers corresponding to the first residual data and the second residual data are determined respectively to determine the first buffer label corresponding to the first residual data and the second buffer label corresponding to the second residual data; when the first buffer label is the same as the second buffer label, the second buffer label is corrected according to the difference parameter to obtain a third buffer label; the first buffer label is used as the buffer label corresponding to the first residual data, and the third buffer label is used as the buffer label corresponding to the second residual data.

[0207] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: determining a second position mapping relationship between the residual data to be written and the cache depth based on the vector offset coordinates and the search center point; determining the cache depth corresponding to the residual data to be written based on the second position mapping relationship to determine the cache address corresponding to the residual data to be written.

[0208] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: generating a MASK mask corresponding to the buffer number and the buffer address; and writing the residual data to be written into the corresponding buffer according to the buffer number, the buffer address and the MASK mask.

[0209] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0210] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0211] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0212] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A residual data writing method, characterized in that: The method comprises: Determine a residual data reading method; the residual data reading method includes a reading order of each residual data and a quantity of parameter data read simultaneously each time; Determine the number of buffer groups and the number of buffers included in each buffer group according to the residual data reading method; each buffer is provided with a unique buffer label, and each buffer includes a plurality of buffer addresses; The initial residual data obtained in the motion estimation target stage is split to obtain 16-bit residual data to be written; According to the positional relationship between the residual data to be written and the initial residual data, obtaining vector coordinates corresponding to the residual data to be written; Acquire a search center point corresponding to the initial residual data, and obtain the vector offset coordinates of the residual data to be written according to the offset between the vector coordinates and the search center point; splicing cache lines of the same cache depth of all caches according to the cache label of each cache to obtain a spliced ​​cache line; According to the cache line width of each cache, obtaining the splicing width of the spliced ​​cache line; Determining a first position mapping relationship between the residual data to be written and the splicing cache line according to the vector offset coordinates and the splicing width; Determine, according to the first position mapping relationship, a buffer group and a corresponding buffer corresponding to the residual data to be written, so as to determine a buffer number corresponding to the residual data to be written; Determining a second position mapping relationship between the residual data to be written and a cache depth according to the vector offset coordinates and the search center point; Determine, according to the second position mapping relationship, a cache depth corresponding to the residual data to be written, so as to determine a cache address corresponding to the residual data to be written; The residual data to be written is written into a corresponding buffer according to the buffer label and the buffer address.

2. The method according to claim 1, characterized in that The determining of the residual data reading method includes: A residual data reading circuit is configured; the residual data reading circuit includes two data interfaces; the two data interfaces are used to simultaneously read the residual data of two adjacent motion vectors during each residual data reading process; Residual data is read from a buffer at least once through the two data interfaces of the residual data reading circuit.

3. The method according to claim 1, characterized in that The determining the number of buffer groups and the number of buffers included in each buffer group according to the residual data reading method includes: According to the residual data reading method, determining that in each residual data reading process, the residual data of two adjacent motion vectors are read simultaneously to configure two buffer groups; In each buffer group, the same number of buffers is configured.

4. The method according to claim 1, characterized in that: The residual data to be written includes first residual data and second residual data, wherein the first residual data and the second residual data are residual data of two adjacent motion vectors; and determining, according to the first position mapping relationship, a buffer group and a corresponding buffer corresponding to the residual data to be written, so as to determine a buffer label corresponding to the residual data to be written, comprises: According to the arrangement order of the buffers in each buffer group, a plurality of target buffers having a corresponding relationship are determined; each target buffer belongs to a different buffer group and has the same arrangement order in the corresponding buffer group; Obtaining a difference parameter according to a buffer label of each target buffer; According to the first position mapping relationship, respectively determine the buffer groups and corresponding buffers corresponding to the first residual data and the second residual data, so as to determine a first buffer number corresponding to the first residual data and a second buffer number corresponding to the second residual data; When the first buffer label is the same as the second buffer label, the second buffer label is modified according to the difference parameter to obtain a third buffer label; The first buffer number is used as the buffer number corresponding to the first residual data, and the third buffer number is used as the buffer number corresponding to the second residual data.

5. The method according to claim 1, characterized in that The step of writing the residual data to be written into a corresponding buffer according to the buffer label and the buffer address includes: Generate a MASK mask corresponding to the buffer number and the buffer address; According to the buffer number, the buffer address and the MASK mask, the residual data to be written is written into the corresponding buffer.

6. A residual data writing device, characterized in that: The device comprises: A determination module, used to determine a residual data reading method; the residual data reading method includes a reading order of each residual data and a quantity of parameter data read simultaneously each time; A configuration module, used to determine the number of buffer groups and the number of buffers included in each buffer group according to the residual data reading method; each buffer is provided with a unique buffer label, and each buffer includes a plurality of buffer addresses; The acquisition module is used to split the initial residual data obtained in the motion estimation target stage to obtain 16-bit residual data to be written; according to the positional relationship between the residual data to be written and the initial residual data, obtain the vector coordinates corresponding to the residual data to be written; obtain the search center point corresponding to the initial residual data, and obtain the vector offset coordinates of the residual data to be written according to the offset between the vector coordinates and the search center point; according to the cache number of each cache, splice the cache lines of the same cache depth of all caches to obtain the spliced ​​cache line; according to the cache line width of each cache, obtain the spliced a cache line splicing width; determining a first position mapping relationship between the residual data to be written and the splicing cache line according to the vector offset coordinates and the splicing width; determining a cache group and a corresponding cache corresponding to the residual data to be written according to the first position mapping relationship, so as to determine a cache label corresponding to the residual data to be written; determining a second position mapping relationship between the residual data to be written and a cache depth according to the vector offset coordinates and the search center point; determining a cache depth corresponding to the residual data to be written according to the second position mapping relationship, so as to determine a cache address corresponding to the residual data to be written; A writing module is used to write the residual data to be written into a corresponding buffer according to the buffer label and the buffer address.

7. The device according to claim 6, characterized in that The determination module is also used to configure a residual data reading circuit; the residual data reading circuit includes two data interfaces; the two data interfaces are used to simultaneously read the residual data of two adjacent motion vectors during each residual data reading process; and the residual data is read from the buffer at least once through the two data interfaces of the residual data reading circuit.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • DCT (Discrete Cosine Transform) method and DCT circuit system

    CN113542770A

  • Data processing method, device and equipment and readable storage medium

    CN116010299A