Video image coding method, system, device and medium

文档序号:142569 发布日期:2021-10-22 浏览:27次 中文

阅读说明:本技术 一种视频图像编码方法、系统、设备以及介质 (Video image coding method, system, device and medium ) 是由 张永兴 李幸远 秦臻 陈静静 于 2021-09-17 设计创作,主要内容包括:本发明公开了一种视频图像编码方法,包括以下步骤:将待编码图像帧划分成多个子块,并为每一个子块分配坐标;根据第i个子块的内容计算对应的哈希值;利用第i个子块对应的哈希值在第一哈希表中进行搜索,以得到与第i个子块对应的哈希值相同的第一参考块对应的坐标;根据第i个子块的坐标判断第一参考块的坐标是否有效;响应于第一参考块的坐标有效,根据第一参考块的坐标获取第一参考块的内容,并与第i个子块的内容进行对比;响应于第一参考块的内容与第i个子块的内容一致,对第i个子块进行帧内复制块编码。本发明还公开了一种系统、计算机设备以及可读存储介质。本发明提出的技术方案能够快速的判断待编码块能否可用于IBC模式编码。(The invention discloses a video image coding method, which comprises the following steps: dividing an image frame to be encoded into a plurality of sub-blocks, and distributing coordinates for each sub-block; calculating a corresponding hash value according to the content of the ith sub-block; searching in a first hash table by using the hash value corresponding to the ith sub-block to obtain a coordinate corresponding to a first reference block with the same hash value corresponding to the ith sub-block; judging whether the coordinate of the first reference block is valid or not according to the coordinate of the ith sub-block; responding to the fact that the coordinate of the first reference block is valid, obtaining the content of the first reference block according to the coordinate of the first reference block, and comparing the content with the content of the ith sub-block; and in response to the content of the first reference block being consistent with the content of the ith sub-block, performing intra-copy block encoding on the ith sub-block. The invention also discloses a system, a computer device and a readable storage medium. The technical scheme provided by the invention can quickly judge whether the to-be-coded block can be used for IBC mode coding.)

1. A video image encoding method, comprising the steps of:

dividing an image frame to be encoded into a plurality of sub-blocks, and distributing coordinates for each sub-block;

calculating a corresponding hash value according to the content of the ith sub-block;

searching in a first hash table by using the hash value corresponding to the ith sub-block to obtain a coordinate corresponding to a first reference block with the same hash value corresponding to the ith sub-block;

judging whether the coordinate of the first reference block is valid or not according to the coordinate of the ith sub-block;

responding to the fact that the coordinate of the first reference block is valid, obtaining the content of the first reference block according to the coordinate of the first reference block, and comparing the content of the first reference block with the content of the ith sub-block;

in response to the content of the first reference block coinciding with the content of the ith sub-block, intra-copy block encoding the ith sub-block.

2. The method of claim 1, wherein a first hash table is searched by using the hash value corresponding to the ith sub-block to obtain coordinates corresponding to a first reference block having a same hash value corresponding to the ith sub-block, further comprising:

in response to that the first hash table does not have the coordinate of the first reference block which is the same as the hash value corresponding to the ith sub-block, updating the hash value corresponding to the ith sub-block and the corresponding coordinate into the first hash table;

and encoding the ith sub-block by using a preset encoding method.

3. The method of claim 1, further comprising:

and in response to the invalidity of the coordinates of the first reference block, encoding the ith sub-block by using a preset encoding method.

4. The method of claim 1, further comprising:

in response to the fact that the content of the first reference block is inconsistent with the content of the ith sub-block, searching a second hash table according to the coordinates of the first reference block to obtain a difference value between the coordinates of the second reference block and the coordinates of the first reference block, wherein the coordinates of the second reference block are the same as the hash value corresponding to the first reference block;

determining the coordinates of the second reference block according to the difference between the coordinates of the second reference block and the coordinates of the first reference block;

acquiring the content of the second reference block according to the coordinates of the second reference block, and comparing the content of the second reference block with the content of the ith sub-block;

in response to the content of the second reference block coinciding with the content of the ith sub-block, intra-copy block encoding the ith sub-block.

5. The method of claim 1, further comprising:

and replacing the coordinates corresponding to the first reference block in the first hash table by using the coordinates corresponding to the ith sub-block.

6. The method of claim 5, further comprising:

calculating a coordinate difference value between the coordinate of the first reference block and the coordinate corresponding to the ith sub-block;

and updating the coordinate corresponding to the ith sub-block and the coordinate difference value into a second hash table.

7. The method of claim 1, further comprising:

and updating the coordinates and the hash value of the ith sub-block into a third hash table.

8. A video image encoding system, comprising:

the dividing module is configured to divide an image frame to be encoded into a plurality of sub-blocks and allocate coordinates to each sub-block;

the calculating module is configured to calculate a corresponding hash value according to the content of the ith sub-block;

the searching module is configured to search in a first hash table by using the hash value corresponding to the ith sub-block to obtain a coordinate corresponding to a first reference block which is the same as the hash value corresponding to the ith sub-block;

the judging module is configured to judge whether the coordinate of the first reference block is valid according to the coordinate of the ith sub-block;

the comparison module is configured to respond that the coordinates of the first reference block are valid, acquire the content of the first reference block according to the coordinates of the first reference block, and compare the content with the content of the ith sub-block;

an encoding module configured to perform intra-copy block encoding on the ith sub-block in response to the content of the first reference block being consistent with the content of the ith sub-block.

9. A computer device, comprising:

at least one processor; and

memory storing a computer program operable on the processor, wherein the processor executes the program to perform the steps of the method according to any of claims 1-7.

10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, is adapted to carry out the steps of the method according to any one of claims 1 to 7.

Technical Field

The present invention relates to the field of image coding, and in particular, to a video image coding method, system, device, and storage medium.

Background

Two predictive coding schemes are used in conventional video coding and decoding standards: intra prediction (intra prediction), inter prediction (inter prediction). Intra-frame prediction can reduce single-frame image spatial redundancy information, and inter-frame prediction can reduce temporal information redundancy from frame to frame.

And Intra Copy Block (IBC), a new Intra prediction technique, is commonly used for Intra-frame coding of data blocks of the same content.

The latest video codec protocols such as AV1, H266 and the like support IBC encoding, and for encoders, IBC algorithms focus on the search for repeated blocks of content. The video codec protocol has no algorithm nor does it necessarily specify IBC lookup. Most of the current mainstream IBC search algorithms are similar to the interframe block search method, for example, based on the block matching search algorithm.

The basic idea of the block matching algorithm is to divide the video image into non-overlapping sub-blocks, each of which is independent of the other, and assume that all the pixel displacements are the same within the sub-blocks. I.e. we can consider each sub-block as a moving object, in the sequence of video image posts, time t corresponds to the k-th frame image and time t-x corresponds to the k-1 image of the previous frame. For any sub-block in k frames, the sub-block with the highest similarity to the sub-block in k frames is found in k-1 detection, i.e. the process is called block matching.

The criterion for evaluating similarity of two sub-blocks is called matching criterion. The following two matching criteria are commonly used:

(1) mean Square Error (MSE) minimum criterion:

(2) mean absolute error (MAD) minimum criterion:

from the above formula content, whether the minimum MSE criterion or the minimum MAD criterion, similarity is evaluated by comparing the difference between the contents of two blocks. I.e., the purpose of the conventional block matching search algorithm is to find a reference block that is most similar to the current block. In a naturally collected video sequence, due to the influence of factors such as illumination, noise, cameras and the like, the pixel values of the same object in two images cannot be completely the same. In this case, the minimum MSE or the minimum MAD may search for blocks of the conventional natural video series that are similar to the higher ones.

However, the characteristics of the screen content video and the naturally collected video sequence are different: the screen content is generated entirely by the algorithm, so the video (image) pixel values are not affected by illumination, noise, camera, etc. For two identical blocks of content, their pixels are also identical and identical. So that the IBC search algorithm should search for the same block. But the block matching search algorithm is essentially searching for similar blocks, so the block matching search algorithm is not an ideal IBC search algorithm.

Disclosure of Invention

In view of the above, in order to overcome at least one aspect of the above problems, the present invention provides a video image encoding method, including the steps of:

dividing an image frame to be encoded into a plurality of sub-blocks, and distributing coordinates for each sub-block;

calculating a corresponding hash value according to the content of the ith sub-block;

searching in a first hash table by using the hash value corresponding to the ith sub-block to obtain a coordinate corresponding to a first reference block with the same hash value corresponding to the ith sub-block;

judging whether the coordinate of the first reference block is valid or not according to the coordinate of the ith sub-block;

responding to the fact that the coordinate of the first reference block is valid, obtaining the content of the first reference block according to the coordinate of the first reference block, and comparing the content of the first reference block with the content of the ith sub-block;

in response to the content of the first reference block coinciding with the content of the ith sub-block, intra-copy block encoding the ith sub-block.

In some embodiments, searching in a first hash table by using the hash value corresponding to the ith sub-block to obtain the coordinate corresponding to the first reference block having the same hash value corresponding to the ith sub-block, further includes:

in response to that the first hash table does not have the coordinate of the first reference block which is the same as the hash value corresponding to the ith sub-block, updating the hash value corresponding to the ith sub-block and the corresponding coordinate into the first hash table;

and encoding the ith sub-block by using a preset encoding method.

In some embodiments, further comprising:

and in response to the invalidity of the coordinates of the first reference block, encoding the ith sub-block by using a preset encoding method.

In some embodiments, further comprising:

in response to the fact that the content of the first reference block is inconsistent with the content of the ith sub-block, searching a second hash table according to the coordinates of the first reference block to obtain a difference value between the coordinates of the second reference block and the coordinates of the first reference block, wherein the coordinates of the second reference block are the same as the hash value corresponding to the first reference block;

determining the coordinates of the second reference block according to the difference between the coordinates of the second reference block and the coordinates of the first reference block;

acquiring the content of the second reference block according to the coordinates of the second reference block, and comparing the content of the second reference block with the content of the ith sub-block;

in response to the content of the second reference block coinciding with the content of the ith sub-block, intra-copy block encoding the ith sub-block.

In some embodiments, further comprising:

and replacing the coordinates corresponding to the first reference block in the first hash table by using the coordinates corresponding to the ith sub-block.

In some embodiments, further comprising:

calculating a coordinate difference value between the coordinate of the first reference block and the coordinate corresponding to the ith sub-block;

and updating the coordinate corresponding to the ith sub-block and the coordinate difference value into a second hash table.

In some embodiments, further comprising:

and updating the coordinates and the hash value of the ith sub-block into a third hash table.

Based on the same inventive concept, according to another aspect of the present invention, an embodiment of the present invention further provides a video image encoding system, including:

the dividing module is configured to divide an image frame to be encoded into a plurality of sub-blocks and allocate coordinates to each sub-block;

the calculating module is configured to calculate a corresponding hash value according to the content of the ith sub-block;

the searching module is configured to search in a first hash table by using the hash value corresponding to the ith sub-block to obtain a coordinate corresponding to a first reference block which is the same as the hash value corresponding to the ith sub-block;

the judging module is configured to judge whether the coordinate of the first reference block is valid according to the coordinate of the ith sub-block;

the comparison module is configured to respond that the coordinates of the first reference block are valid, acquire the content of the first reference block according to the coordinates of the first reference block, and compare the content with the content of the ith sub-block;

an encoding module configured to perform intra-copy block encoding on the ith sub-block in response to the content of the first reference block being consistent with the content of the ith sub-block.

Based on the same inventive concept, according to another aspect of the present invention, an embodiment of the present invention further provides a computer apparatus, including:

at least one processor; and

a memory storing a computer program operable on the processor, wherein the processor executes the program to perform any of the steps of the video image encoding method as described above.

Based on the same inventive concept, according to another aspect of the present invention, there is also provided a computer-readable storage medium storing a computer program which, when executed by a processor, performs the steps of any one of the video image encoding methods described above.

The invention has the following beneficial technical effects: the technical scheme provided by the invention carries out intra-frame search based on the first hash table, and compared with an inter-frame block matching search method, the method can quickly judge whether the to-be-coded block can be used for IBC mode coding.

Drawings

In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other embodiments can be obtained by using the drawings without creative efforts.

Fig. 1 is a flowchart illustrating a video image encoding method according to an embodiment of the present invention;

FIG. 2 is a schematic diagram of a video image encoding system according to an embodiment of the present invention;

FIG. 3 is a schematic structural diagram of a computer device provided in an embodiment of the present invention;

fig. 4 is a schematic structural diagram of a computer-readable storage medium according to an embodiment of the present invention.

Detailed Description

In order to make the objects, technical solutions and advantages of the present invention more apparent, the following embodiments of the present invention are described in further detail with reference to the accompanying drawings.

It should be noted that all expressions using "first" and "second" in the embodiments of the present invention are used for distinguishing two entities with the same name but different names or different parameters, and it should be noted that "first" and "second" are merely for convenience of description and should not be construed as limitations of the embodiments of the present invention, and they are not described in any more detail in the following embodiments.

In the embodiment of the present invention, ibc (intra block copy) refers to a mode of an intra-frame copy block, video coding and decoding. BV (Block vector) refers to a block vector, describing the positional relationship of IBC with the reference.

According to an aspect of the present invention, an embodiment of the present invention proposes a video image encoding method, as shown in fig. 1, which may include the steps of:

s1, dividing the image frame to be encoded into a plurality of sub-blocks, and distributing coordinates for each sub-block;

s2, calculating the corresponding hash value according to the content of the ith sub-block;

s3, searching in a first hash table by using the hash value corresponding to the ith sub-block to obtain a coordinate corresponding to a first reference block with the same hash value corresponding to the ith sub-block;

s4, judging whether the coordinate of the first reference block is valid according to the coordinate of the ith sub-block;

s5, responding to the validity of the coordinates of the first reference block, acquiring the content of the first reference block according to the coordinates of the first reference block, and comparing the content with the content of the ith sub-block;

s6, in response to the content of the first reference block being consistent with the content of the ith sub-block, performing intra-copy block encoding on the ith sub-block.

The technical scheme provided by the invention carries out intra-frame search based on the first hash table, and compared with an inter-frame block matching search method, the method can quickly judge whether the to-be-coded block can be used for IBC mode coding.

In some embodiments, in step S1, the image frame to be encoded is divided into a plurality of image sub-blocks, and coordinates are allocated to each image sub-block, specifically, the image to be encoded is a video image which can be divided before encodingDividing into M × N non-overlapping sub-blocks, wherein each sub-block corresponds to dataPixel[i:i+8, j:j+8]I.e. each sub-block has a pixel value of 8 x 8. Each sub-block may then be assigned coordinates according to each sub-block position, e.g. the coordinates of the sub-blocks in the first row and the third column may be (1, 3).

In some embodiments, in step S3, the Hash value corresponding to the ith sub-block is used to search in the first Hash table to obtain the coordinate corresponding to the first reference block having the same Hash value as the Hash value corresponding to the ith sub-block, specifically, the first Hash table (Hash _ table) may be a one-dimensional array, the digital coordinate corresponds to the Hash value, and the array element is used to store the coordinate of the image sub-block, that is, the one-dimensional array uses the Hash value as an index and the coordinate of the image sub-block as a value. E.g. Hash _ table [ i ]]Saving the coordinates (x) of a sub-block with hash value equal to i0,y0) I.e. the coordinates (x) of the sub-block can be found in the first hash table by the hash value i0,y0)。

It should be noted that, each time a new image frame to be encoded is encoded, the first hash table needs to be updated to be empty. When the current image frame to be coded is coded, the hash values and the corresponding coordinates of the subblocks divided by the current image frame to be coded are recorded in the first hash table. And one hash value only corresponds to one coordinate, and the coordinate corresponding to the hash value is the coordinate of the latest and latest sub-block, for example, the coordinate with the hash value i in the current first hash table is (x)0,y0) If the hash value of other sub-blocks is also i when other sub-blocks are subsequently encoded, the coordinates (x) of other sub-blocks are used1,y1) Will (x) in the first hash table0,y0) And replaced.

When the hash value corresponding to the ith sub-block is used for searching in the first hash table, and the current first hash table records the coordinate corresponding to the hash value, it is indicated that the hash value of one sub-block is the same as the hash value of the ith sub-block, so that the coordinate corresponding to the first reference block which is the same as the hash value of the ith sub-block can be obtained through the first hash table.

In some embodiments, in step S4, it is determined whether the coordinate of the first reference block is valid according to the coordinate of the ith sub-block, specifically, if the coordinate corresponding to the first reference block is obtained through the first hash table, it may be determined whether the coordinate is valid first, for example, whether a difference between the horizontal and vertical coordinates of the first reference block and the horizontal and vertical coordinates of the ith sub-block is within a preset range, if the difference is within the preset range, the first reference block is valid, and if the difference is not within the preset range, the first reference block is invalid.

In some embodiments, in step S5, in response to that the coordinate of the first reference block is valid, the content of the first reference block is obtained according to the coordinate of the first reference block and compared with the content of the ith sub-block, specifically, when the coordinate of the first reference block is valid, the corresponding content is obtained according to the coordinate of the first reference block and compared with the content of the ith sub-block to determine whether the contents of the two are consistent. In some embodiments, whether the contents of the two blocks are consistent or not is detected, and whether the contents of the two blocks are consistent or not can be judged by detecting whether the residual contents are all 0 or not.

In some embodiments, if all 0S indicate that the content of the ith sub-block is consistent with the content of the first reference block, step S6 is performed to encode the ith sub-block in IBC mode and calculate the corresponding BV.

In some embodiments, the method further comprises:

and in response to the invalidity of the coordinates of the first reference block, encoding the ith sub-block by using a preset encoding method.

Specifically, if the coordinates of the first reference block are invalid, which indicates that the current ith sub-block cannot be encoded in the IBC mode, the i-th sub-block is encoded in another mode.

In some embodiments, the method further comprises:

and replacing the coordinates corresponding to the first reference block in the first hash table by using the coordinates corresponding to the ith sub-block.

Specifically, when the hash value and the content of the ith sub-block are the same as those of the first reference block, the coordinate of the ith sub-block needs to be updated to the coordinate of the first reference block in the first hash table because the latest and latest coordinate is recorded in the first hash table. That is, when searching in the first hash table using the hash value of the ith sub-block or the first reference block thereafter, the coordinates of the ith sub-block are obtained.

In some embodiments, the method further comprises:

calculating a coordinate difference value between the coordinate of the first reference block and the coordinate corresponding to the ith sub-block;

and updating the coordinate corresponding to the ith sub-block and the coordinate difference value into a second hash table.

Specifically, after the coordinates corresponding to the first reference block in the first hash table are replaced with the coordinates corresponding to the ith sub-block, the coordinates of the first reference block may be recorded in the second hash table in a form of a difference.

In some embodiments, the second Hash table (CHT) may be a Chained Hash table, which is a two-dimensional array. The array coordinate is the coordinate of the sub-block image, the array element is the coordinate difference (dx dy). The second Hash table is matched with the first Hash table to construct a chain type Hash table. CHT has the meaning of relating blocks with the same Hash value, i.e.Hash CHT x y[][]==Hash CHT x-dx y-dy[][]. For example, if the hash values of the ith sub-block and the first reference block are the same, the coordinate of the ith sub-block is used as the index of the second hash table, and the difference between the coordinate of the ith sub-block and the coordinate of the first reference block is used as a value, so that the coordinate difference between the ith sub-block and the first reference block can be obtained by using the coordinate of the ith sub-block, and the coordinate of the first reference block can be further obtained.

In some embodiments, further comprising:

in response to the fact that the content of the first reference block is inconsistent with the content of the ith sub-block, searching a second hash table according to the coordinates of the first reference block to obtain a difference value between the coordinates of the second reference block and the coordinates of the first reference block, wherein the coordinates of the second reference block are the same as the hash value corresponding to the first reference block;

determining the coordinates of the second reference block according to the difference between the coordinates of the second reference block and the coordinates of the first reference block;

acquiring the content of the second reference block according to the coordinates of the second reference block, and comparing the content of the second reference block with the content of the ith sub-block;

in response to the content of the second reference block coinciding with the content of the ith sub-block, intra-copy block encoding the ith sub-block.

Specifically, if the content of the ith sub-block is not consistent with the content of the first reference block, which indicates that hash collision occurs (the hash values are the same, but the original contents are different), at this time, a search needs to be performed in the second hash table according to the coordinate of the first reference block to obtain the coordinate of the second reference block, which is the same as the hash value of the first reference block, and since the coordinate difference is recorded in the second hash table, the coordinate difference between the first reference block and the second reference block needs to be obtained according to the coordinate of the first reference block, and then the coordinate of the second reference block is obtained according to the coordinate difference. And then, judging whether the second reference block can be used as the reference of the ith sub-block, similarly judging whether the content of the second reference block is the same as that of the ith sub-block, if so, indicating that the second reference block can be used as the reference of the ith sub-block, encoding the ith sub-block by adopting an IBC mode according to the second reference block, and calculating the corresponding BV. If not, the third reference block is continuously searched in the second hash table according to the coordinates of the second reference block based on the same process, and content judgment is performed. If the coordinates of the reference block with the same content are not found in the second hash table, the ith sub-block is encoded by adopting other modes.

In some embodiments, in step S3, searching in a first hash table by using the hash value corresponding to the ith sub-block to obtain the coordinate corresponding to the first reference block having the same hash value corresponding to the ith sub-block, further includes:

in response to that the first hash table does not have the coordinate of the first reference block which is the same as the hash value corresponding to the ith sub-block, updating the hash value corresponding to the ith sub-block and the corresponding coordinate into the first hash table;

and encoding the ith sub-block by using a preset encoding method.

Specifically, if the first hash table does not have the coordinate of the first reference block which is the same as the hash value corresponding to the ith sub-block, the hash value corresponding to the ith sub-block and the corresponding coordinate are directly updated into the first hash table, so that when the hash values of other sub-blocks are the same as the hash value of the ith sub-block, the coordinate corresponding to the ith sub-block can be searched in the first hash table by using the same hash value. Meanwhile, it is also stated that the current ith sub-block cannot use the IBC mode encoding, and then the ith sub-block is encoded in other modes.

In some embodiments, the method further comprises:

and updating the coordinates and the hash value of the ith sub-block into a third hash table.

Specifically, the third hash table (BHT, Block _ hash _ table) belongs to the Block hash list, which is also a two-dimensional array, but the array coordinates are coordinates of the subblock image, and the array elements are hash values of the subblock image contents corresponding to the coordinates. The hash value corresponding to each coordinate can be recorded through the third hash table.

Based on the same inventive concept, according to another aspect of the present invention, an embodiment of the present invention further provides a video image encoding system 400, as shown in fig. 2, including:

a dividing module 401 configured to divide an image frame to be encoded into a plurality of sub-blocks and allocate coordinates to each sub-block;

a calculating module 402 configured to calculate a corresponding hash value according to the content of the ith sub-block;

a searching module 403, configured to search in a first hash table by using the hash value corresponding to the ith sub-block, so as to obtain a coordinate corresponding to a first reference block having the same hash value corresponding to the ith sub-block;

a judging module 404 configured to judge whether the coordinate of the first reference block is valid according to the coordinate of the ith sub-block;

a comparison module 405 configured to, in response to the coordinates of the first reference block being valid, obtain the content of the first reference block according to the coordinates of the first reference block, and compare the content with the content of the ith sub-block;

an encoding module 406 configured to perform intra-copy block encoding on the ith sub-block in response to the content of the first reference block being consistent with the content of the ith sub-block.

In some embodiments, searching in a first hash table by using the hash value corresponding to the ith sub-block to obtain the coordinate corresponding to the first reference block having the same hash value corresponding to the ith sub-block, further includes:

in response to that the first hash table does not have the coordinate of the first reference block which is the same as the hash value corresponding to the ith sub-block, updating the hash value corresponding to the ith sub-block and the corresponding coordinate into the first hash table;

and encoding the ith sub-block by using a preset encoding method.

In some embodiments, further comprising:

and in response to the invalidity of the coordinates of the first reference block, encoding the ith sub-block by using a preset encoding method.

In some embodiments, further comprising:

in response to the fact that the content of the first reference block is inconsistent with the content of the ith sub-block, searching a second hash table according to the coordinates of the first reference block to obtain a difference value between the coordinates of the second reference block and the coordinates of the first reference block, wherein the coordinates of the second reference block are the same as the hash value corresponding to the first reference block;

determining the coordinates of the second reference block according to the difference between the coordinates of the second reference block and the coordinates of the first reference block;

acquiring the content of the second reference block according to the coordinates of the second reference block, and comparing the content of the second reference block with the content of the ith sub-block;

in response to the content of the second reference block coinciding with the content of the ith sub-block, intra-copy block encoding the ith sub-block.

In some embodiments, further comprising:

and replacing the coordinates corresponding to the first reference block in the first hash table by using the coordinates corresponding to the ith sub-block.

In some embodiments, further comprising:

calculating a coordinate difference value between the coordinate of the first reference block and the coordinate corresponding to the ith sub-block;

and updating the coordinate corresponding to the ith sub-block and the coordinate difference value into a second hash table.

In some embodiments, further comprising:

and updating the coordinates and the hash value of the ith sub-block into a third hash table.

Based on the same inventive concept, according to another aspect of the present invention, as shown in fig. 3, an embodiment of the present invention further provides a computer apparatus 501, comprising:

at least one processor 520; and

a memory 510, the memory 510 storing a computer program 511 executable on the processor, the processor 520 executing the program to perform the following steps:

s1, dividing the image frame to be encoded into a plurality of sub-blocks, and distributing coordinates for each sub-block;

s2, calculating the corresponding hash value according to the content of the ith sub-block;

s3, searching in a first hash table by using the hash value corresponding to the ith sub-block to obtain a coordinate corresponding to a first reference block with the same hash value corresponding to the ith sub-block;

s4, judging whether the coordinate of the first reference block is valid according to the coordinate of the ith sub-block;

s5, responding to the validity of the coordinates of the first reference block, acquiring the content of the first reference block according to the coordinates of the first reference block, and comparing the content with the content of the ith sub-block;

s6, in response to the content of the first reference block being consistent with the content of the ith sub-block, performing intra-copy block encoding on the ith sub-block.

In some embodiments, searching in a first hash table by using the hash value corresponding to the ith sub-block to obtain the coordinate corresponding to the first reference block having the same hash value corresponding to the ith sub-block, further includes:

in response to that the first hash table does not have the coordinate of the first reference block which is the same as the hash value corresponding to the ith sub-block, updating the hash value corresponding to the ith sub-block and the corresponding coordinate into the first hash table;

and encoding the ith sub-block by using a preset encoding method.

In some embodiments, further comprising:

and in response to the invalidity of the coordinates of the first reference block, encoding the ith sub-block by using a preset encoding method.

In some embodiments, further comprising:

in response to the fact that the content of the first reference block is inconsistent with the content of the ith sub-block, searching a second hash table according to the coordinates of the first reference block to obtain a difference value between the coordinates of the second reference block and the coordinates of the first reference block, wherein the coordinates of the second reference block are the same as the hash value corresponding to the first reference block;

determining the coordinates of the second reference block according to the difference between the coordinates of the second reference block and the coordinates of the first reference block;

acquiring the content of the second reference block according to the coordinates of the second reference block, and comparing the content of the second reference block with the content of the ith sub-block;

in response to the content of the second reference block coinciding with the content of the ith sub-block, intra-copy block encoding the ith sub-block.

In some embodiments, further comprising:

and replacing the coordinates corresponding to the first reference block in the first hash table by using the coordinates corresponding to the ith sub-block.

In some embodiments, further comprising:

calculating a coordinate difference value between the coordinate of the first reference block and the coordinate corresponding to the ith sub-block;

and updating the coordinate corresponding to the ith sub-block and the coordinate difference value into a second hash table.

In some embodiments, further comprising:

and updating the coordinates and the hash value of the ith sub-block into a third hash table.

Based on the same inventive concept, according to another aspect of the present invention, as shown in fig. 4, an embodiment of the present invention further provides a computer-readable storage medium 601, where the computer-readable storage medium 601 stores computer program instructions 610, and the computer program instructions 610, when executed by a processor, perform the following steps:

s1, dividing the image frame to be encoded into a plurality of sub-blocks, and distributing coordinates for each sub-block;

s2, calculating the corresponding hash value according to the content of the ith sub-block;

s3, searching in a first hash table by using the hash value corresponding to the ith sub-block to obtain a coordinate corresponding to a first reference block with the same hash value corresponding to the ith sub-block;

s4, judging whether the coordinate of the first reference block is valid according to the coordinate of the ith sub-block;

s5, responding to the validity of the coordinates of the first reference block, acquiring the content of the first reference block according to the coordinates of the first reference block, and comparing the content with the content of the ith sub-block;

s6, in response to the content of the first reference block being consistent with the content of the ith sub-block, performing intra-copy block encoding on the ith sub-block.

In some embodiments, searching in a first hash table by using the hash value corresponding to the ith sub-block to obtain the coordinate corresponding to the first reference block having the same hash value corresponding to the ith sub-block, further includes:

in response to that the first hash table does not have the coordinate of the first reference block which is the same as the hash value corresponding to the ith sub-block, updating the hash value corresponding to the ith sub-block and the corresponding coordinate into the first hash table;

and encoding the ith sub-block by using a preset encoding method.

In some embodiments, further comprising:

and in response to the invalidity of the coordinates of the first reference block, encoding the ith sub-block by using a preset encoding method.

In some embodiments, further comprising:

in response to the fact that the content of the first reference block is inconsistent with the content of the ith sub-block, searching a second hash table according to the coordinates of the first reference block to obtain a difference value between the coordinates of the second reference block and the coordinates of the first reference block, wherein the coordinates of the second reference block are the same as the hash value corresponding to the first reference block;

determining the coordinates of the second reference block according to the difference between the coordinates of the second reference block and the coordinates of the first reference block;

acquiring the content of the second reference block according to the coordinates of the second reference block, and comparing the content of the second reference block with the content of the ith sub-block;

in response to the content of the second reference block coinciding with the content of the ith sub-block, intra-copy block encoding the ith sub-block.

In some embodiments, further comprising:

and replacing the coordinates corresponding to the first reference block in the first hash table by using the coordinates corresponding to the ith sub-block.

In some embodiments, further comprising:

calculating a coordinate difference value between the coordinate of the first reference block and the coordinate corresponding to the ith sub-block;

and updating the coordinate corresponding to the ith sub-block and the coordinate difference value into a second hash table.

In some embodiments, further comprising:

and updating the coordinates and the hash value of the ith sub-block into a third hash table.

Finally, it should be noted that, as will be understood by those skilled in the art, all or part of the processes of the methods of the above embodiments may be implemented by a computer program, which may be stored in a computer-readable storage medium, and when executed, may include the processes of the embodiments of the methods described above.

Further, it should be appreciated that the computer-readable storage media (e.g., memory) herein can be either volatile memory or nonvolatile memory, or can include both volatile and nonvolatile memory.

Those of skill would further appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the disclosure herein may be implemented as electronic hardware, computer software, or combinations of both. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and steps have been described above generally in terms of their functionality. Whether such functionality is implemented as software or hardware depends upon the particular application and design constraints imposed on the overall system. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the disclosed embodiments of the present invention.

The foregoing is an exemplary embodiment of the present disclosure, but it should be noted that various changes and modifications could be made herein without departing from the scope of the present disclosure as defined by the appended claims. The functions, steps and/or actions of the method claims in accordance with the disclosed embodiments described herein need not be performed in any particular order. Furthermore, although elements of the disclosed embodiments of the invention may be described or claimed in the singular, the plural is contemplated unless limitation to the singular is explicitly stated.

It should be understood that, as used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly supports the exception. It should also be understood that "and/or" as used herein is meant to include any and all possible combinations of one or more of the associated listed items.

The numbers of the embodiments disclosed in the embodiments of the present invention are merely for description, and do not represent the merits of the embodiments.

It will be understood by those skilled in the art that all or part of the steps of implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.

Those of ordinary skill in the art will understand that: the discussion of any embodiment above is meant to be exemplary only, and is not intended to intimate that the scope of the disclosure, including the claims, of embodiments of the invention is limited to these examples; within the idea of an embodiment of the invention, also technical features in the above embodiment or in different embodiments may be combined and there are many other variations of the different aspects of the embodiments of the invention as described above, which are not provided in detail for the sake of brevity. Therefore, any omissions, modifications, substitutions, improvements, and the like that may be made without departing from the spirit and principles of the embodiments of the present invention are intended to be included within the scope of the embodiments of the present invention.

16页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种DCT变换方法及DCT变换电路系统

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类