Data processing method and device for image, equipment and storage medium
By finding template image blocks matching the current image block and high filter correlation prediction image blocks in the target reconstruction image area of the image, the problem of insufficient intra-image prediction accuracy is solved and the encoding effect is improved.
Patent Information
- Application Number
- CN202310685682.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-09
- Publication Date
- 2024-12-10
AI Technical Summary
In the process of intra-image prediction in the prior art, the accuracy of the prediction value is insufficient, which affects the encoding effect.
By finding template image blocks matching the current image block in the target reconstruction image area of the image, filtering out a set of predicted image blocks with high correlation with the reference template image blocks, and using the pixel point information of these image blocks to determine the prediction of the current image blocks value.
Improve the accuracy and encoding performance of image intra-frame prediction, reduce encoding distorted data, and improve compression efficiency.
Smart Images

Figure CN119107575A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, device, equipment and storage medium for image data processing. Background Art
[0002] In the relevant scenarios of image transmission, the sender needs to encode the image to obtain the encoding information and transmit the encoding information through the network. After receiving the encoding information, the receiver can decode and reconstruct the image. In the process of encoding or decoding images including video frames in the video, the video frame (image) can be intra-predicted to obtain the predicted value of the pixel point, and then the encoding or decoding can be completed based on the predicted value of the pixel point. The accuracy of the predicted value obtained by intra-prediction of the video frame (image) directly affects the accuracy of the encoding. Based on this, how to improve the accuracy of intra-prediction of the video frame (image) is a current research hotspot. Summary of the invention
[0003] The embodiments of the present application provide a data processing method, apparatus, device and storage medium for an image, which can improve the accuracy of intra-frame prediction of an image.
[0004] On the one hand, an embodiment of the present application provides a data processing method for an image, comprising:
[0005] Determine a template image block of a current image block in an image, and search for a reference template image block matching the template image block from a target reconstructed image region corresponding to the image;
[0006] Determining predicted image blocks corresponding to respective reference template image blocks from the target reconstructed image region; the reference template image blocks correspond to the predicted image blocks one by one;
[0007] A prediction image block set is determined by screening each prediction image block; the correlation between the prediction image blocks in the prediction image block set and the corresponding reference template image blocks is greater than or equal to the correlation between other prediction image blocks outside the prediction image block set and the corresponding reference template image blocks;
[0008] According to the pixel information of the predicted image blocks in the predicted image block set, the predicted value of each pixel in the current image block is determined to encode or decode the current image block.
[0009] On the one hand, an embodiment of the present application provides a data processing device, including:
[0010] A search unit, used to determine a template image block of a current image block in an image, and to search for a reference template image block matching the template image block from a target reconstructed image region corresponding to the image;
[0011] The search unit is further used to determine, from the target reconstructed image area, the prediction image blocks corresponding to the respective reference template image blocks; the reference template image blocks correspond to the prediction image blocks one by one;
[0012] A screening unit is used to screen and determine a set of prediction image blocks according to each prediction image block; the correlation between the prediction image blocks in the set of prediction image blocks and the corresponding reference template image blocks is greater than or equal to the correlation between other prediction image blocks outside the set of prediction image blocks and the corresponding reference template image blocks;
[0013] The prediction unit is used to determine the prediction value of each pixel in the current image block according to the pixel information of the prediction image block in the prediction image block set, so as to encode or decode the current image block.
[0014] On the one hand, before the screening unit screens and determines the prediction image block set according to each prediction image block, it is also used to:
[0015] Searching, from a target prediction image block among the prediction image blocks, a comparison image region whose shape matches that of a target reference template image block corresponding to the target prediction image block; the comparison image region is adjacent to the target reference template image block;
[0016] The correlation between the target prediction image block and the target reference template image block is determined according to the pixel information of the comparison image area and the pixel information of the target reference template image block.
[0017] On the one hand, the pixel point information of the contrast image area includes: the reconstruction value of each pixel point in the contrast image area, and the pixel point information of the target reference template image block includes: the reconstruction value of each pixel point in the target reference template image block;
[0018] When the screening unit determines the correlation between the target prediction image block and the target reference template image block according to the pixel information of the comparison image area and the pixel information of the target reference template image block, it is used to:
[0019] Determine a difference between a reconstruction value of a comparison pixel in the comparison image area and a reconstruction value of an associated pixel in the target reference template image block; the comparison pixel is adjacent to the associated pixel and is in the same row or column in the image, and the comparison pixel is any pixel in the comparison image area;
[0020] The correlation between the target prediction image block and the target reference template image block is determined according to the differences determined by the reconstructed values of the pixels in the comparison image area.
[0021] On the one hand, when the screening unit determines the correlation between the target prediction image block and the target reference template image block according to the respective differences determined by the reconstructed values of the respective pixels in the comparison image area, it is used to:
[0022] Obtaining, according to each difference determined by the reconstruction value of each pixel point in the comparison image area, a first absolute error sum between the target prediction image block and the target reference template image block; the first absolute error sum is used to represent the correlation between the target prediction image block and the target reference template image block, and the correlation between the target prediction image block and the target reference template image block is negatively correlated with the first absolute error sum;
[0023] The predicted image block set is determined by screening according to the size of the first absolute error sum corresponding to each predicted image block.
[0024] On the one hand, the pixel information of the predicted image block includes: the reconstructed value of each pixel in the corresponding predicted image block;
[0025] When the prediction unit determines the prediction value of each pixel in the current image block according to the pixel information of the prediction image block in the prediction image block set, it is used to:
[0026] For a target pixel in the current image block, reconstructed values of matching pixels in each prediction image block in the prediction image block set are averaged; the position of the target pixel in the current image block is the same as the position of the matching pixel in the corresponding prediction image block, and the target pixel is any pixel in the current image block;
[0027] The result of averaging the reconstructed values of the matching pixels is used as the predicted value of the target pixel in the current image block.
[0028] On the one hand, when the searching unit searches for a reference template image block matching the template image block in the target reconstructed image area corresponding to the image, it is used to:
[0029] Searching for a candidate template image block that matches the geometric features of the template image block from the target reconstructed image area;
[0030] Based on the difference between the pixel point information of the template image block and the pixel point information of each candidate template image block, a reference template image block matching the pixel point information of the template image block is determined from the candidate template image blocks.
[0031] On the one hand, when the search unit determines, from each candidate template image block, a reference template image block that matches the pixel point information of the template image block based on the difference between the pixel point information of the template image block and the pixel point information of each candidate template image block, it is used to:
[0032] Obtaining a second absolute error sum between a reconstructed value of each pixel point in the template image block and a reconstructed value of each pixel point in any candidate template image block; the second absolute error sum is used to represent the difference between the pixel point information of the template image block and the pixel point information of any candidate template image block;
[0033] According to the second absolute errors corresponding to the template image blocks and in ascending order, a reference number of second absolute errors and corresponding candidate template image blocks are selected in sequence as reference template image blocks.
[0034] On the one hand, when the search unit determines the prediction image blocks corresponding to the respective reference template image blocks in the target reconstructed image area, it is used to:
[0035] Acquire a geometric feature relationship between the current image block and the template image block;
[0036] Based on the geometric feature relationship, the prediction image blocks corresponding to the respective reference template image blocks are determined from the target reconstructed image region.
[0037] In one aspect, the data processing device further comprises a processing unit, wherein the processing unit is configured to:
[0038] Determining prediction coding distortion data of the current image block based on the prediction value of each pixel in the current image block;
[0039] Acquiring contrast prediction coding distortion data of the current image block when a contrast prediction mode is adopted to determine a prediction value of each pixel in the current image block;
[0040] Selecting a prediction mode for encoding the current image block according to the prediction coding distortion data and the comparison prediction coding distortion data;
[0041] Among them, when the predicted coding distortion data is less than or equal to the comparative prediction coding distortion data under each comparative prediction mode, the target prediction mode when the predicted value of each pixel point in the current image block is determined based on the template image block is used as the prediction mode for encoding the current image block; otherwise, the comparative prediction mode corresponding to the minimum comparative prediction coding distortion data is used as the prediction mode for encoding the current image block.
[0042] On the one hand, when the processing unit determines the prediction coding distortion data of the current image block based on the prediction value of each pixel in the current image block, it is used to:
[0043] Determining a prediction error of each pixel in the current image block based on a prediction value of each pixel in the current image block and a reference value in the image corresponding to each pixel in the current image block;
[0044] The sum of squares of prediction errors of each pixel in the current image block is determined as prediction coding distortion data of the current image block.
[0045] On the one hand, when the target prediction mode is adopted as the prediction mode for encoding the current image block, the encoding information of the current image block carries a corresponding indication mark; and the processing unit is further used for:
[0046] In the process of decoding the encoding information of the current image block, if the indication mark is parsed from the encoding information of the current image block, the decoding of the current image block is completed according to the predicted value of each pixel point in the current image block determined based on the template image block.
[0047] In one aspect, an embodiment of the present application provides a data processing device, the data processing device comprising an input interface and an output interface, and further comprising:
[0048] a processor adapted to implement one or more instructions; and,
[0049] A computer storage medium storing one or more instructions, wherein the one or more instructions are suitable for being loaded by the processor and executing the above-mentioned data processing method for images.
[0050] On the one hand, an embodiment of the present application provides a computer storage medium, in which computer program instructions are stored. When the computer program instructions are executed by a processor, they are used to execute the above-mentioned data processing method for an image.
[0051] On the one hand, an embodiment of the present application provides a computer program product, which includes a computer program stored in a computer storage medium; a processor of a data processing device reads the computer program from the computer storage medium, and the processor executes the computer program, so that the data processing device performs the above-mentioned data processing method for an image.
[0052] In the embodiment of the present application, a reference template image block matching the template image block of the current image block in the image can be searched from the target reconstructed image area corresponding to the image, and the prediction image blocks corresponding to each reference template image block can be determined from the target reconstructed image area; then, prediction image blocks with a large correlation with the corresponding reference template image block can be screened out from each prediction image block to form a prediction image block set, and the prediction value of each pixel in the current image block can be determined based on the pixel information of the prediction image blocks in the prediction image block set to encode or decode the current image block; a new implementation method of intra-frame prediction is proposed, that is, a new implementation method of intra-frame prediction mode is proposed, By searching for a reference template image block that matches the template image block of the current image block in the target reconstructed image area corresponding to the image, and further selecting a prediction image block corresponding to each reference template image block with a larger correlation with the corresponding reference template image block to predict the prediction value of each pixel in the current image block, the pixel information of the selected prediction image block is more similar to the pixel information of the current image block, that is, it is more similar to the distribution of the reference values of each pixel in the current image block, so that the predicted value of each pixel in the current image block is determined to be more accurate, that is, the accuracy of the predicted value obtained by intra-frame prediction of the image can be improved, and the accuracy of intra-frame prediction of the image can also be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be 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.
[0054] Figure 1 is a schematic diagram of a reconstructed image area corresponding to an image provided in an embodiment of the present application;
[0055] Figure 2a is a schematic diagram of a template image block provided in an embodiment of the present application;
[0056] Figure 2b is a schematic diagram of another template image block provided in an embodiment of the present application;
[0057] Figure 2c is a schematic diagram of another template image block provided in an embodiment of the present application;
[0058] Figure 3a is a schematic diagram of a target reconstructed image area provided in an embodiment of the present application;
[0059] Figure 3b is a schematic diagram of another target reconstructed image area provided in an embodiment of the present application;
[0060] Figure 4 It is a structural diagram of a data transmission system provided in an embodiment of the present application;
[0061] Figure 5 It is a flowchart of a data processing method for an image provided by an embodiment of the present application;
[0062] Figure 6 It is a flowchart of another method for processing image data provided by an embodiment of the present application;
[0063] Figure 7 is a schematic diagram of a candidate template image block provided in an embodiment of the present application;
[0064] Figure 8 is a schematic diagram of pixels at the same relative position in a template image block and a reference template image block provided by an embodiment of the present application;
[0065] Fig. 9 is a schematic diagram of the size of a template image block provided in an embodiment of the present application;
[0066] Fig.10 is a schematic diagram of a predicted image block provided in an embodiment of the present application;
[0067] Fig.11 is a schematic diagram of a comparison image area provided in an embodiment of the present application;
[0068] Fig.12 is a schematic diagram of comparing pixels and associated pixels provided in an embodiment of the present application;
[0069] Fig.13 is a schematic diagram of a target pixel point and a matching pixel point provided in an embodiment of the present application;
[0070] Fig.14 is a structural schematic diagram of a data processing device provided in an embodiment of the present application;
[0071] Fig.15 It is a structural diagram of a data processing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0072] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0073] An embodiment of the present application provides a data processing solution for an image, which can search for a reference template image block that matches a template image block of a current image block in an image from a target reconstructed image region corresponding to the image, and determine the prediction image blocks corresponding to each reference template image block from the target reconstructed image region; then, a prediction image block set can be screened and determined based on each prediction image block, and a prediction value of each pixel in the current image block can be determined based on pixel information of the prediction image blocks in the prediction image block set, so as to encode or decode the current image block; wherein, the reference template image block corresponds to the prediction image block one-to-one, and the correlation between the prediction image block in the prediction image block set and the corresponding reference template image block is greater than or equal to the correlation between other prediction image blocks outside the prediction image block set and the corresponding reference template image block. Furthermore, the image mentioned in the above-mentioned data processing scheme for images can be any image with encoding or decoding requirements, for example, it can be a video frame in a video. When the image is a video frame, the above-mentioned data processing scheme for images can be applied to related scenarios of video encoding or video decoding, for example, it can be applied to scenarios such as video transmission, video calls, remote conferencing, online video playback, offline video playback, etc. The embodiments of the present application will be explained later using video frames as an example; the above-mentioned data processing scheme for images belongs to a new implementation method of intra-frame prediction (i.e., a new implementation method of intra-frame prediction mode), which can improve the accuracy of the prediction value obtained by intra-frame prediction of images including video frames.
[0074] In one embodiment, when encoding or decoding a video frame (image), encoding or decoding is performed based on the image blocks obtained by dividing the video frame (image), wherein the current image block refers to the image block currently being processed among the image blocks obtained by dividing the video frame (image), that is, the coding block CU (CU, Coding Unit) currently being processed. The template image block of the current image block is determined from the reconstructed image area corresponding to the image to which the current image block belongs. The reconstructed image area corresponding to the image refers to: an area reconstructed according to the coding information of the image, and specifically refers to: an area reconstructed according to the existing coding information of the image; in other words, in the encoding process of the image, the encoded image block can be decoded and reconstructed based on the coding information obtained by its encoding, then the existing coding information of the image is the coding information of the encoded image block, and the reconstructed image area corresponding to the image refers to: an area reconstructed according to the coding information of the encoded image block in the image; in the decoding process of the image, the image block that receives the coding information can be decoded and reconstructed based on the received coding information, then the existing coding information of the image is the received coding information, and the reconstructed image area corresponding to the image refers to: an area reconstructed according to the received coding information; the value of each pixel point in the image is called a reference value, and the value of each pixel point in the reconstructed image area corresponding to the image is called a reconstructed value, which is reconstructed based on the coding information of the corresponding pixel point; for the convenience of explanation, the embodiments of the present application will be explained later by taking the above-mentioned data processing scheme for an image as an example of applying it to the encoding process of an image. See. Figure 1 , which is a schematic diagram of a reconstructed image area corresponding to an image provided in an embodiment of the present application, wherein the image can be shown as marked 101, the current image block of the image can be shown as marked 102, and the reconstructed image area corresponding to the image can be shown as marked 103.
[0075] Furthermore, the template image block is adjacent to the current image block in the image, that is, the template image block corresponds to an area in the image, and is adjacent to the area in the image corresponding to the current image block; the shape and size of the template image block can be set according to specific needs, and the embodiment of the present application does not limit it; see Figure 2a , is a schematic diagram of a template image block provided in an embodiment of the present application, wherein the current image block in the image may be indicated by a mark 201, the template image block may be indicated by a mark 202, and the area in the image corresponding to the template image block is a rectangular area above the current image block and adjacent to the current image block; see Figure 2b , is a schematic diagram of another template image block provided in an embodiment of the present application, wherein the current image block in the image may be indicated by a mark 211, the template image block may be indicated by a mark 212, and the area in the image corresponding to the template image block is a rectangular area on the left side of the current image block and adjacent to the current image block; see Figure 2c , is a schematic diagram of another template image block provided in an embodiment of the present application, wherein the current image block in the image can be indicated by 221, the template image block can be indicated by 222, and the area in the image corresponding to the template image block is: an "L"-shaped area adjacent to the current image block, which is composed of a partial area above the current image block and a partial area on the left side of the current image block; the embodiment of the present application is subsequently explained by taking the template image block as an "L"-shaped template, that is, the area indicated by the template image block is an "L"-shaped area as an example. For the sake of convenience of explanation, in the "L"-shaped template, the edge indicated by 223 is called the first edge, the edge indicated by 224 is called the second edge, the edge indicated by 225 is called the third edge, the edge indicated by 226 is called the fourth edge, the edge indicated by 227 is called the fifth edge, and the edge indicated by 228 is called the sixth edge, wherein the height of the fourth edge should be the same as the height of the current image block, and the width of the fifth edge should be the same as the width of the current image block; the size of the "L"-shaped template can be set according to specific needs, that is, the lengths of the third edge and the sixth edge can be set according to specific needs, for example, both are set to 1 pixel, 2 pixels, etc., and the embodiments of the present application will be explained later using 2 pixels as an example.
[0076] In one embodiment, the target reconstructed image area is determined from the reconstructed image area corresponding to the image, and the target reconstructed image area is adjacent to the current image block in the image, that is, the target reconstructed image area corresponds to an area in the image, which is adjacent to the area in the image corresponding to the current image block, and the range indicated by the target reconstructed image area is larger than the range indicated by the template image block. Optionally, the target reconstructed image area can be set according to specific needs, and the embodiments of the present application are not limited thereto. For example, all the reconstructed image areas corresponding to the image can be used as the target reconstructed image area; for another example, the area consisting of the partial area above the current image block and the partial area to the left of the current image block in the reconstructed image area corresponding to the image can be used as the target reconstructed image area, see Figure 3a , is a schematic diagram of a target reconstructed image region provided by an embodiment of the present application, wherein the current image block is indicated by a mark 301, the reconstructed image region of the image to which the current image block belongs is indicated by a mark 302, and the target reconstructed image region is indicated by a mark 303; for another example, since the coding block (CU) of the image is obtained by further dividing the coding tree unit CTU (CTU, Coding Tree Units) obtained by dividing the image, based on this, see Figure 3b, which is a schematic diagram of another target reconstructed image area provided in an embodiment of the present application; in the reconstructed image area corresponding to the image, the area corresponding to the coding tree unit to which the current image block (i.e., the current CU) belongs, as indicated by the mark 311, the area corresponding to the coding tree unit above and adjacent to the current image block, as indicated by the mark 312, the area corresponding to the coding tree unit to the upper left of the current image block and adjacent to the current image block, as indicated by the mark 313, and the area corresponding to the coding tree unit to the left of the current image block and adjacent to the current image block, as indicated by the mark 314, can be collectively used as the target reconstructed image area.
[0077] In one embodiment, the above-mentioned data processing scheme for images can be executed by a data processing device, which can be a device with encoding capability, a device with decoding capability, or a device with both encoding capability and decoding capability; the data processing device can be a terminal device or a server; the terminal device here can include but is not limited to: computers, smart phones, tablet computers, laptops, smart home appliances, vehicle terminals, smart wearable devices, etc.; the server here can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and big data and artificial intelligence platforms. Further optionally, the above-mentioned data processing scheme for images can also be executed individually or collaboratively by any electronic device with computing power, and the embodiments of this application are not limited.
[0078] Based on the above data processing scheme for images, the embodiment of the present application provides a data transmission system for implementing the data transmission process based on the above data processing scheme for images; see Figure 4, is a structural diagram of a data transmission system provided in an embodiment of the present application. The data transmission system may include a transmitting end 401 and a receiving end 402, wherein the transmitting end 401 and the receiving end 402 are both data processing devices, and the transmitting end 401 and the receiving end 402 can be directly or indirectly connected to each other through wired or wireless communication, and the present application does not limit this. Taking the streaming media transmission corresponding to the video as an example, the sending end 401 can determine the template image block of the current image block in the image (video frame), and search for the reference template image block matching the template image block from the target reconstructed image area corresponding to the image; determine the prediction image blocks corresponding to each reference template image block from the target reconstructed image area; screen and determine the prediction image block set according to each prediction image block; determine the prediction value of each pixel in the current image block according to the pixel information of the prediction image block in the prediction image block set; encode the current image block based on the prediction value of each pixel in the current image block to obtain the encoding information of the current image block; wherein the reference template image block corresponds to the prediction image block one by one; the correlation between the prediction image block in the prediction image block set and the corresponding reference template image block is greater than or equal to the correlation between other prediction image blocks outside the prediction image block set and the corresponding reference template image block; the target reconstructed image area belongs to the area reconstructed according to the encoding information of the encoded image block in the image. The sending end 401 sends the encoding information of the current image block to the receiving end 402.
[0079] After the receiving end 402 receives the encoding information of the current image block, the receiving end 402 can determine the template image block of the current image block in the image (video frame), and search for a reference template image block that matches the template image block from the target reconstructed image area corresponding to the image; determine the prediction image blocks corresponding to each reference template image block from the target reconstructed image area; screen and determine a prediction image block set based on each prediction image block; determine the prediction value of each pixel in the current image block based on the pixel information of the prediction image block in the prediction image block set; reconstruct based on the prediction value of each pixel in the current image block to obtain a reconstructed area corresponding to the current image block; after obtaining the reconstructed area corresponding to each image block in the image, display based on the reconstructed area corresponding to each image block in the image; wherein, the reference template image block corresponds to the prediction image block one by one; the correlation between the prediction image block in the prediction image block set and the corresponding reference template image block is greater than or equal to the correlation between other prediction image blocks outside the prediction image block set and the corresponding reference template image block; the target reconstructed image area belongs to the area reconstructed according to the received encoding information.
[0080] The collection and processing of relevant data (such as images) in this application should be strictly in accordance with the requirements of relevant laws and regulations when applied in examples, and the informed consent or separate consent of the personal information subject should be obtained. Subsequent data use and processing should be carried out within the scope of authorization of laws and regulations and the personal information subject.
[0081] Based on the above-mentioned data processing scheme for images, the present application embodiment provides a data processing method for images. Figure 5 , which is a flow chart of a data processing method for an image provided in an embodiment of the present application. Figure 5 The data processing method for an image shown can be executed by a data processing device.
[0082] Figure 5 The data processing method for an image may include the following steps:
[0083] S501 , determining a template image block of a current image block in an image, and searching for a reference template image block matching the template image block from a target reconstructed image region corresponding to the image.
[0084] Among them, the image can be any image with encoding or decoding requirements, for example, it can be a video frame in a video; the current image block refers to the image block currently being processed among the image blocks obtained by dividing the video frame (image), that is, the coding block CU (CU, Coding Unit) currently being processed. The template image block is determined from the reconstructed image area corresponding to the image, and the reconstructed image area corresponding to the image refers to: the area reconstructed according to the coding information of the image, and specifically can refer to: the area reconstructed according to the existing coding information of the image; the template image block is adjacent to the current image block in the image, that is, the template image block corresponds to an area in the image, and is adjacent to the area in the image corresponding to the current image block. The shape and size of the template image block can be set according to specific needs, and the embodiments of the present application are not limited. The embodiments of the present application will be described later using the template image block as an "L"-shaped template, that is, the area indicated by the template image block is an "L"-shaped area as an example. The target reconstructed image area is determined from the reconstructed image area corresponding to the image, and the target reconstructed image area is adjacent to the current image block in the image, that is, the target reconstructed image area corresponds to an area in the image, and is adjacent to the area in the image corresponding to the current image block, and the range indicated by the target reconstructed image area is larger than the range indicated by the template image block; the target reconstructed image area can be set according to specific needs, and the embodiments of the present application are not limited. The subsequent embodiments of the present application are described by taking the reconstructed image area corresponding to the image as the target reconstructed image area as an example. The value of each pixel in the image is called a reference value, and the value of each pixel in the reconstructed image area corresponding to the image is called a reconstruction value, which is reconstructed based on the encoding information of the corresponding pixel.
[0085] Furthermore, the data processing device searches for a reference template image block that matches the template image block from the target reconstructed image area corresponding to the image in order to search for an image block that matches the geometric features of the template image block and matches the pixel information of the template image block; wherein, matching the geometric features of the template image block is used to indicate: the same shape and size as the template image block, and matching the pixel information of the template image block is used to indicate: the distribution of reconstructed values of each pixel in the template image block is relatively similar; the data processing device searches for a reference template image block that matches the template image block from the target reconstructed image area corresponding to the image in order to further determine, from the target reconstructed image area, the prediction image blocks corresponding to each reference template image block, and then predict the prediction values of each pixel in the current image block based on the determined prediction image blocks.
[0086] S502: Determine, from the target reconstructed image region, prediction image blocks corresponding to respective reference template image blocks.
[0087] Among them, the reference template image blocks correspond to the predicted image blocks one by one; the predicted image blocks corresponding to each reference template image block determined from the target reconstructed image area should be determined based on the same geometric feature relationship as that between the current image block and the template image block, that is, the shape and size of the predicted image block corresponding to any reference template image block determined from the target reconstructed image area are the same as the shape and size of the current image block, and the positional relationship between the predicted image block corresponding to any reference template image block and the any reference template image block is the same as the positional relationship between the current image block and the template image block.
[0088] S503: Screen and determine a set of predicted image blocks according to the predicted image blocks.
[0089] Among them, the correlation between the predicted image blocks in the predicted image block set and the corresponding reference template image blocks is greater than or equal to the correlation between other predicted image blocks outside the predicted image block set and the corresponding reference template image blocks; that is, the data processing device can filter out the predicted image blocks with a larger correlation with the corresponding reference template image blocks from each predicted image block to form a predicted image block set; the data processing device filters out the predicted image blocks with a larger correlation with the corresponding reference template image block from each predicted image block to form a predicted image block set, in order to filter out predicted image blocks with pixel point information that is more similar to the current image block, that is, to filter out predicted image blocks with a distribution that is more similar to the reference value of each pixel in the current image block, and then determine the predicted value of each pixel in the current image block according to the pixel point information of the predicted image blocks in the predicted image block set, so as to improve the accuracy of the determined predicted value of each pixel in the current image block.
[0090] S504: Determine a prediction value of each pixel in the current image block according to pixel information of the prediction image block in the prediction image block set, so as to encode or decode the current image block.
[0091] In one embodiment, when a data processing device determines the prediction value of each pixel in the current image block based on the pixel information of the predicted image block in the predicted image block set, the determined prediction value of each pixel in the current image block can be fully integrated into the distribution characteristics of the prediction value of each pixel in the predicted image block in the predicted image block set, so that the determined prediction value of each pixel in the current image block is more accurate. That is to say, the data processing device can search for a reference template image block that matches the geometric features of the template image block and the pixel information of the template image block from the target reconstructed image area corresponding to the image based on the template image block of the current image block in the image; and then determine the prediction image blocks corresponding to each reference template image block from the target reconstructed image area, and filter out the prediction image blocks with a large correlation with the corresponding reference template image block from each prediction image block to form a prediction image block set; since the correlation between the prediction image blocks in the prediction image block set and the corresponding reference template image block is large, it can be considered that the prediction image blocks in the prediction image block set are more similar to the pixel information of the current image block than other prediction image blocks outside the prediction image block set, that is, they are more similar to the distribution of reference values of each pixel in the current image block, that is, the filtered prediction image blocks can be considered more accurate, so that the prediction values of each pixel in the current image block determined based on the pixel information of the prediction image blocks in the prediction image block set are more accurate.
[0092] In the embodiment of the present application, a reference template image block matching the template image block of the current image block in the image can be searched from the target reconstructed image area corresponding to the image, and the prediction image blocks corresponding to each reference template image block can be determined from the target reconstructed image area; then, prediction image blocks with a large correlation with the corresponding reference template image block can be screened out from each prediction image block to form a prediction image block set, and the prediction value of each pixel in the current image block can be determined based on the pixel information of the prediction image blocks in the prediction image block set to encode or decode the current image block; a new implementation method of intra-frame prediction is proposed, that is, a new implementation method of intra-frame prediction mode is proposed, By searching for a reference template image block that matches the template image block of the current image block in the target reconstructed image area corresponding to the image, and further selecting a prediction image block corresponding to each reference template image block with a larger correlation with the corresponding reference template image block to predict the prediction value of each pixel in the current image block, the pixel information of the selected prediction image block is more similar to the pixel information of the current image block, that is, it is more similar to the distribution of the reference values of each pixel in the current image block, so that the predicted value of each pixel in the current image block is determined to be more accurate, that is, the accuracy of the predicted value obtained by intra-frame prediction of the image can be improved, and the accuracy of intra-frame prediction of the image can also be improved.
[0093] Based on the above-mentioned related embodiments of the method for processing image data, the present application embodiment provides another method for processing image data. Figure 6 , which is a flow chart of another method for processing image data provided in an embodiment of the present application. Figure 6 The data processing method for an image shown can be executed by a data processing device. Figure 6 The data processing method for an image may include the following steps:
[0094] S601, determining a template image block of a current image block in an image, and searching for a reference template image block matching the template image block from a target reconstructed image region corresponding to the image.
[0095] Among them, the template image block is determined from the reconstructed image area corresponding to the image, and the reconstructed image area corresponding to the image refers to: the area reconstructed according to the encoding information of the image, the template image block is adjacent to the current image block in the image, that is, the template image block corresponds to the area in the image, and is adjacent to the area in the image corresponding to the current image block; the target reconstructed image area is determined from the reconstructed image area corresponding to the image, and the target reconstructed image area is adjacent to the current image block in the image, that is, the target reconstructed image area corresponds to the area in the image, and is adjacent to the area in the image corresponding to the current image block, and the range indicated by the target reconstructed image area is larger than the range indicated by the template image block. The shape and size of the template image block can be set according to specific needs, and the embodiment of the present application is not limited. The embodiment of the present application is described later by taking the template image block as an "L"-shaped template, that is, the area indicated by the template image block is an "L"-shaped area as an example; the target reconstructed image area can be set according to specific needs, and the embodiment of the present application is not limited. In the subsequent embodiments of the present application, the reconstructed image area corresponding to the image is used as the target reconstructed image area as an example. The value of each pixel in the image is called a reference value, and the value of each pixel in the reconstructed image area corresponding to the image is called a reconstructed value, which is reconstructed based on the encoding information of the corresponding pixel.
[0096] Furthermore, the data processing device searches for a reference template image block that matches the template image block from the target reconstructed image area corresponding to the image, in order to search for an image block that matches the geometric features of the template image block and matches the pixel information of the template image block; wherein matching the geometric features of the template image block is used to indicate: the same shape and size as the template image block, and matching the pixel information of the template image block is used to indicate: the distribution of reconstructed values of each pixel in the template image block is relatively similar. In a feasible embodiment, the data processing device searches for a reference template image block that matches the template image block from the target reconstructed image area corresponding to the image, which may include: searching for a candidate template image block that matches the geometric features of the template image block from the target reconstructed image area; and determining a reference template image block that matches the pixel information of the template image block from each candidate template image block based on the difference between the pixel information of the template image block and the pixel information of each candidate template image block. See. Figure 7 , which is a schematic diagram of a candidate template image block provided in an embodiment of the present application, wherein the current image block may be as indicated by mark 701, the template image block may be as indicated by mark 702, the candidate template image block may be as indicated by mark 703, and the candidate template image block as indicated by mark 703 has the same shape and size as the template image block as indicated by mark 702.
[0097] Furthermore, the difference between the pixel information of the template image block and the pixel information of any reference template image block should be less than or equal to the difference between the pixel information of other candidate template image blocks in each candidate template image block except the reference template image block. Specifically, the difference between the pixel information of the template image block and the pixel information of any candidate template image block can be: the distribution difference between the reconstructed value of each pixel in the template image block and the reconstructed value of each pixel in any candidate template image block. In a feasible implementation, the data processing device determines a reference template image block that matches the pixel information of the template image block from each candidate template image block based on the difference between the pixel information of the template image block and the pixel information of each candidate template image block, which may include: obtaining the second absolute error sum between the reconstruction value of each pixel in the template image block and the reconstruction value of each pixel in any candidate template image block; the second absolute error sum is used to represent the difference between the pixel information of the template image block and the pixel information of any candidate template image block; in accordance with the order of the second absolute errors and corresponding to the template image blocks from small to large, the candidate template image blocks corresponding to the reference number of second absolute errors and are selected in sequence as the reference template image blocks. The reference number can be set according to specific needs, for example, it can be set to 10, 8, etc., which is not limited in the embodiment of the present application; taking the reference number of 8 as an example, the reference template image block is the candidate template image block corresponding to the smallest 8 second absolute errors and.
[0098] Since the method for determining the second sum of absolute errors between the reconstructed values of each pixel in the template image block and the reconstructed values of each pixel in the candidate template image block is the same as the method for determining the second sum of absolute errors between the reconstructed values of each pixel in the template image block and the reconstructed values of each pixel in the reference template image block, based on this, the embodiment of the present application takes the second sum of absolute errors between the reconstructed values of each pixel in the template image block and the reconstructed values of each pixel in the reference template image block as an example for explanation; if the number of reference template image blocks is n, and n is a positive integer, then the second sum of absolute errors between the reconstructed values of each pixel in the template image block and the reconstructed values of each pixel in the i-th reference template image block among the n reference template image blocks can be shown by the following formula 1, where i is a positive integer less than or equal to n:
[0099]
[0100] Wherein, loss(i) represents the second absolute error sum between the reconstructed value of each pixel in the template image block and the reconstructed value of each pixel in the i-th reference template image block; k is an independent variable, K represents the number of pixels in the template image block, L0(k) represents the reconstructed value of the k-th pixel in the template image block, and Li (k) represents the reconstructed value of the k-th pixel in the ith reference template image block; wherein the relative position of the k-th pixel in the template image block is the same as the relative position of the k-th pixel in the ith reference template image block in the ith reference template image block, that is, when the template image block and the ith reference template image block are overlapped, the k-th pixel in the template image block should overlap with the k-th pixel in the reference template image block; see Figure 8 , is a schematic diagram of pixel points in the same relative position in a template image block and a reference template image block provided in an embodiment of the present application; wherein, the template image block can be as indicated by mark 801, the i-th reference template image block can be as indicated by mark 802, and the pixel point in the template image block as indicated by mark 803 is in the same relative position as the pixel point in the i-th reference template image block as indicated by mark 804.
[0101] See also Fig. 9 , is a schematic diagram of the size of a template image block provided in an embodiment of the present application, wherein M represents the width of the first side, N represents the height of the second side, and M ′ represents the width of the third side, H represents the height of the fourth side, W represents the width of the fifth side, N ′ represents the height of the sixth edge; if the number of reference template image blocks is n, and n is a positive integer, the second absolute error sum between the reconstructed value of each pixel in the template image block and the reconstructed value of each pixel in the i-th reference template image block among the n reference template image blocks can also be expressed by the following formula 2, where i is a positive integer less than or equal to n:
[0102]
[0103] Among them, x, y are the independent variables of the pixel position coordinates, L0(x, y) represents the reconstructed value of a pixel in the template image block, and L i (x, y) represents the reconstructed value of the pixel at the same relative position in the i-th reference template image block; represents the absolute error and corresponding to the area indicated by the 901 mark, represents the absolute error sum corresponding to the area indicated by the mark 902.
[0104] In another feasible implementation, when selecting a reference template image block from a candidate template image block based on the respective second absolute errors corresponding to the template image block, the candidate template image block whose second absolute error and value are less than the second error threshold value can also be used as a reference template image block, wherein the second error threshold value can be set according to specific needs, and the embodiment of the present application does not limit it. Further optionally, in the above process, the (second) absolute error sum (i.e., SAD, Sum of Absolute Difference) between the reconstruction value of each pixel point in the template image block and the reconstruction value of each pixel point in the candidate template image block is used to represent the difference between the pixel point information of the template image block and the pixel point information of the candidate template image block. Of course, other methods can also be used to represent it, for example, the square sum of the error (SSE, Sum of Squared Error) between the reconstruction value of each pixel point in the template image block and the reconstruction value of each pixel point in the candidate template image block can be used to represent it. The relevant process is similar to the relevant process when the absolute error sum is used, and will not be repeated here.
[0105] S602: Determine, from the target reconstructed image region, prediction image blocks corresponding to respective reference template image blocks.
[0106] Among them, the reference template image block corresponds to the predicted image block one by one; the predicted image block corresponding to each reference template image block determined from the target reconstructed image area should be determined based on the same geometric feature relationship as that between the current image block and the template image block, that is, the shape and size of the predicted image block corresponding to any reference template image block determined from the target reconstructed image area are the same as the shape and size of the current image block, and the positional relationship between the predicted image block corresponding to any reference template image block and the any reference template image block is the same as the positional relationship between the current image block and the template image block. Based on this, the data processing device determines the predicted image block corresponding to each reference template image block from the target reconstructed image area, which may include: obtaining the geometric feature relationship between the current image block and the template image block; and determining the predicted image block corresponding to each reference template image block from the target reconstructed image area based on the geometric feature relationship. See. Fig.10 , is a schematic diagram of a predicted image block provided in an embodiment of the present application, wherein a reference template image block may be shown as marked 1001, and a predicted image block corresponding to the reference template image block may be shown as marked 1002.
[0107] S603 : searching, from a target prediction image block in each prediction image block, a comparison image region whose shape matches that of a target reference template image block corresponding to the target prediction image block.
[0108] Among them, the target prediction image block can be any prediction image block in each prediction image block; the comparison image area is adjacent to the target reference template image block; matching the shape of the target reference template image block is used to indicate: the shape is the same as the target reference template image block, for example, if the shape of the target reference template image block is a rectangle, then the comparison image area is also a rectangle, if the shape of the target reference template image block is "L" type, then the comparison image area is also "L" type, but the size of the target reference template image block and the comparison image area can be different. Furthermore, the area composed of a row or a column of pixels in the target prediction image block that matches the shape of the target reference template image block and is adjacent to the target reference template image block can be used as the comparison image area. See. Fig.11 , is a schematic diagram of a comparison image area provided in an embodiment of the present application, wherein a reference template image block may be as indicated by mark 1101, a predicted image block corresponding to the reference template image block may be as indicated by mark 1102, and a comparison image area may be as indicated by mark 1103.
[0109] S604: Determine the correlation between the target prediction image block and the target reference template image block according to the pixel information of the comparison image area and the pixel information of the target reference template image block.
[0110] In a feasible implementation, the pixel information of the contrast image area includes: the reconstruction value of each pixel in the contrast image area, and the pixel information of the target reference template image block includes: the reconstruction value of each pixel in the target reference template image block; the data processing device determines the correlation between the target prediction image block and the target reference template image block based on the pixel information of the contrast image area and the pixel information of the target reference template image block, which may include: determining the difference between the reconstruction value of the contrast pixel in the contrast image area and the reconstruction value of the associated pixel in the target reference template image block; the contrast pixel is adjacent to the associated pixel and is in the same row or column in the image, and the contrast pixel is any pixel in the contrast image area; the correlation between the target prediction image block and the target reference template image block is determined based on the differences determined by the reconstruction values of each pixel in the contrast image area. See. Fig.12, is a schematic diagram of a comparison pixel and associated pixel points provided in an embodiment of the present application, wherein the comparison image area can be shown as marked by 1201. In this diagram, the pixels identified by the same number are comparison pixels and corresponding associated pixels, for example, a comparison pixel can be shown as marked by 1202, and the associated pixel point corresponding to the comparison pixel point can be shown as marked by 1203. For the comparison pixel point in the area shown by 1204, there are two corresponding associated pixel points, for example, one of the corresponding associated pixel points can be shown as marked by 1205, and the other corresponding associated pixel point can be shown as marked by 1206.
[0111] Furthermore, the data processing device determines the correlation between the target predicted image block and the target reference template image block according to the differences determined by the reconstruction values of each pixel point in the comparison image area, which may include: obtaining the first absolute error sum between the target predicted image block and the target reference template image block according to the differences determined by the reconstruction values of each pixel point in the comparison image area; the first absolute error sum is used to represent the correlation between the target predicted image block and the target reference template image block, and the correlation between the target predicted image block and the target reference template image block is negatively correlated with the first absolute error sum; wherein the prediction image block set is screened and determined according to the size of the first absolute error sum corresponding to each prediction image block.
[0112] If the number of reference template image blocks is n, n is a positive integer, that is, the number of prediction image blocks is n; taking the target prediction image block as the i-th prediction image block among the n prediction image blocks as an example, the target reference template image block is the i-th reference template image block corresponding to the i-th prediction image block among the n reference template image blocks, and the first absolute error sum between the i-th prediction image block and the i-th reference template image block can be expressed by the following formula 3, where i is a positive integer less than or equal to n:
[0113]
[0114] Where H represents the height of the i-th predicted image block, that is, the height of the fourth side of the i-th reference template image block, W represents the width of the i-th predicted image block, that is, the width of the fifth side of the i-th reference template image block, and x and y are the independent variables of the pixel position coordinates. i (x,0) represents the reconstructed value of the pixel points in the area indicated by the top row in the i-th predicted image block, that is, Fig.12 The reconstructed values of the pixels in the area marked by the numbers "4, 5, 6, 7" in the contrast image area shown in FIG. i (x, -1) represents the reconstructed value of the pixel in the area indicated by the first row above the i-th prediction image block in the i-th reference template image block, that is, Fig.12 The reconstructed values of the pixels in the area marked by the numbers “4, 5, 6, 7” in the i-th reference template image block shown in ; P i (0, y) represents the reconstructed value of the pixel in the area indicated by the leftmost column in the i-th predicted image block, that is, Fig.12 The reconstructed values of the pixels in the area marked by the numbers "1, 2, 3, 4" in the contrast image area shown in FIG. i (-1, y) represents the reconstructed value of the pixel in the area indicated by the first row on the left side of the i-th prediction image block in the i-th reference template image block, that is, Fig.12 The reconstructed values of the pixels in the area identified by the numbers “1, 2, 3, 4” in the i-th reference template image block shown in .
[0115] Further optionally, in the above process, the (first) absolute error sum between the target prediction image block and the target reference template image block is used to represent the correlation between the target prediction image block and the target reference template image block. Of course, other methods can also be used to represent it. For example, the square sum of the errors between the target prediction image block and the target reference template image block can be used to represent it. The correlation process is similar to the correlation process when the absolute error sum is used, and will not be repeated here.
[0116] S605: Screen and determine a set of predicted image blocks according to the predicted image blocks.
[0117] Among them, the correlation between the predicted image blocks in the predicted image block set and the corresponding reference template image blocks is greater than or equal to the correlation between other predicted image blocks outside the predicted image block set and the corresponding reference template image blocks. Since the correlation between the predicted image block and the corresponding reference template image block is negatively correlated with the first absolute error sum between the predicted image block and the corresponding reference template image block; based on this, the predicted image block set can be screened and determined according to the size of the first absolute error sum corresponding to each predicted image block, and the first absolute error sum corresponding to the predicted image blocks in the predicted image block set is less than or equal to the first absolute error sum corresponding to other predicted image blocks outside the predicted image block set. In a feasible implementation, the predicted image blocks corresponding to the first absolute error sums of the target number can be selected in order from small to large according to the first absolute error sums corresponding to each predicted image block, wherein the target number can be set according to specific needs, and the embodiment of the present application is not limited, for example, it can be set to 5, 4, etc. In another feasible implementation, the predicted image blocks whose first absolute error sums are less than the first error threshold can also be selected to construct the predicted image block set, wherein the first error threshold can be set according to specific needs, and the embodiment of the present application is not limited. In another optional implementation, the first absolute error between the predicted image block and the corresponding reference template image block can also be mapped through a negative correlation mapping relationship to obtain the correlation between the predicted image block and the corresponding reference template image block. In this way, the predicted image block set can be screened and determined according to the size of the correlation corresponding to each predicted image block. This process is similar to the above-mentioned process of screening and determining the predicted image block set according to the size of the sum of the first absolute errors corresponding to each predicted image block, and will not be elaborated here. The embodiment of the present application does not limit the negative correlation mapping relationship used, as long as the correlation between the predicted image block and the corresponding reference template image block and the sum of the first absolute errors between the predicted image block and the corresponding reference template image block are negatively correlated.
[0118] S606: Determine the prediction value of each pixel in the current image block according to the pixel information of the prediction image block in the prediction image block set, so as to encode or decode the current image block.
[0119] In a feasible implementation, the pixel information of the predicted image block includes: the reconstructed value of each pixel in the corresponding predicted image block; the data processing device determines the predicted value of each pixel in the current image block according to the pixel information of the predicted image block in the predicted image block set, which may include: for the target pixel in the current image block, averaging the reconstructed values of the matching pixels in each predicted image block in the predicted image block set; the position of the target pixel in the current image block is the same as the position of the matching pixel in the corresponding predicted image block, and the target pixel is any pixel in the current image block; the result of averaging the reconstructed values of each matching pixel is used as the predicted value of the target pixel in the current image block. Among them, the position of the target pixel in the current image block is the same as the position of the matching pixel in the corresponding predicted image block, that is, the relative position of the target pixel in the current image block is the same as the relative position of the matching pixel in the corresponding predicted image block, that is, when the current image block and the predicted image block are overlapped, the target pixel in the current image block and the matching pixel in the predicted image block should overlap; see Fig.13 , which is a schematic diagram of a target pixel point and a matching pixel point provided in an embodiment of the present application, wherein a current image block may be indicated by a mark 1301, a predicted image block may be indicated by a mark 1302, a target pixel point in the current image block may be indicated by a mark 1303, and a matching pixel point in the predicted image block corresponding to the target pixel point may be indicated by a mark 1304.
[0120] In a feasible implementation manner, after determining the predicted value of each pixel in the current image block, the data processing device may encode or decode the current image block based on the predicted value of each pixel in the current image block. If the data processing device is a transmitting end, it is necessary to perform an encoding process for the current image block. In this process, the data processing device may determine the residual of each pixel in the current image block based on the reference value and predicted value of each pixel in the current image block, and perform a post-processing process on the residual of each pixel in the current image block to obtain the encoding information of the current image block. The post-processing process may include, for example, quantization, entropy coding and other processes. If the data processing device is a receiving end, it is necessary to perform a decoding process for the current image block. In this process, the data processing device may reconstruct based on the predicted value of each pixel in the current image block to obtain a reconstructed area corresponding to the current image block, that is, the reconstructed value of each pixel in the current image block may be reconstructed based on the predicted value of each pixel in the current image block and the reconstructed value of the residual obtained by parsing the encoding information of the current image block, and the reconstructed value of each pixel in the current image block constitutes the reconstructed area corresponding to the current image block.
[0121] In a feasible implementation manner, after the data processing device determines the predicted value of each pixel in the current image block based on the template image block, it can also: determine the predicted coding distortion data of the current image block based on the predicted value of each pixel in the current image block; obtain the comparative predicted coding distortion data of the current image block when the predicted value of each pixel in the current image block is determined using the comparative predicted mode; select the prediction mode for encoding the current image block according to the predicted coding distortion data and the comparative predicted coding distortion data; wherein, when the predicted coding distortion data is less than or equal to the comparative predicted coding distortion data under each comparative predicted mode, the target prediction mode when the predicted value of each pixel in the current image block is determined based on the template image block is used as the prediction mode for encoding the current image block, otherwise, the comparative prediction mode corresponding to the minimum comparative predicted coding distortion data is used as the prediction mode for encoding the current image block. Among them, the comparative prediction mode can be a prediction mode in which a processing logic for determining the predicted value of each pixel in an image block (CU) is built in a data processing device, and specifically can be an intra-frame prediction mode in which a corresponding intra-frame prediction processing logic is built in a data processing device, for example, it can be: an intra-frame prediction mode based on directional interpolation, etc.; the target prediction mode refers to a prediction mode that uses a template image block to determine the predicted value of each pixel in the current image block, that is, a prediction mode that uses the method indicated by the above steps S501 to S504 or steps S601 to S606 to determine the predicted value of each pixel in the image block (CU). The prediction mode for encoding the current image block is selected according to the predicted coding distortion data and the comparative predicted coding distortion data, in order to select the prediction mode with the smallest predicted coding distortion as the prediction mode for encoding the current image block, so that the current image block can be encoded later based on the predicted value of each pixel in the current image block predicted by the selected prediction mode.
[0122] In a feasible implementation, the data processing device determines the prediction coding distortion data of the current image block based on the prediction value of each pixel in the current image block, which may include: determining the prediction error of each pixel in the current image block based on the prediction value of each pixel in the current image block and the reference value in the image corresponding to each pixel in the current image block; and determining the sum of the squares of the prediction errors of each pixel in the current image block as the prediction coding distortion data of the current image block. Based on this, the prediction coding distortion data of the current image block can be shown by the following formula 4:
[0123]
[0124] Wherein, dist represents the prediction coding distortion data of the current image block, W represents the width of the current image block, H represents the height of the current image block, and x, y are independent variables of the pixel position coordinates; pred(x, y) represents the prediction value of a certain pixel in the current image block, orig(x, y) represents the reference value of the same pixel in the current image block, and |pred(x, y)-orig(x, y)| can represent the prediction error of the same pixel, that is, the prediction error of the pixel in the current image block can be: the absolute value of the difference between the prediction value and the reference value of the corresponding pixel. In the above process, the sum of the squares of the prediction errors of each pixel in the current image block (i.e., the sum of squared errors, SSE) is used as the prediction coding distortion data of the current image block. Of course, other data that can indicate the prediction coding distortion can also be selected as the prediction coding distortion data of the current image block. For example, the sum of the prediction errors of each pixel in the current image block (i.e., the sum of absolute errors, SAD) can be used as the prediction coding distortion data of the current image block.
[0125] Furthermore, when the target prediction mode is adopted as the prediction mode for encoding the current image block, the encoding information of the current image block carries a corresponding indicator mark, so that after the receiving end receives the encoding information of the current image block, it can parse the indicator mark and adopt the target prediction mode to predict the prediction value of each pixel point in the current image block, and then reconstruct the reconstructed area based on the predicted prediction value. When the data processing device is a receiving end, after receiving the encoding information of the current image block, in the process of decoding the encoding information of the current image block, if the indication mark is parsed from the encoding information of the current image block, the decoding of the current image block is completed according to the predicted value of each pixel in the current image block determined based on the template image block, that is, the decoding of the current image block is completed according to the predicted value of each pixel in the current image block determined by adopting the target prediction mode; that is, the data processing device can determine the predicted value of each pixel in the current image block by adopting the target prediction mode, and reconstruct the reconstructed value of each pixel in the current image block based on the predicted value of each pixel in the current image block determined by adopting the target prediction mode and the reconstructed value of the residual obtained by parsing the encoding information of the current image block, and the reconstructed value of each pixel in the current image block constitutes the reconstructed area corresponding to the current image block; wherein, the relevant processing process of the data processing device determining the predicted value of each pixel in the current image block by adopting the target prediction mode in the decoding process is similar to the process shown in the above steps S501 to S504 or steps S601 to S606.
[0126] In a feasible implementation, the embodiment of the present application also provides another prediction mode. When the data processing device adopts the prediction mode to determine the prediction value of each pixel point in the current image block, the template image block of the current image block in the image can be determined, and the reference template image block that best matches the template image block can be found from the target reconstructed image area corresponding to the image; the prediction image block corresponding to the reference template image block is determined from the target reconstructed image area; the prediction value of each pixel point in the prediction image block is used as the prediction value of each pixel point in the current image block to encode or decode the current image block; wherein the reference template image block that best matches the template image block is: the candidate template image block corresponding to the smallest second absolute error among the second absolute errors corresponding to the template image block.
[0127] In an embodiment of the present application, a reference template image block that matches the template image block of the current image block in the image can be searched from the target reconstructed image area corresponding to the image, and the predicted image blocks corresponding to each reference template image block can be determined from the target reconstructed image area; then, predicted image blocks with a large correlation with the corresponding reference template image block can be screened out from each predicted image block to form a predicted image block set, and the predicted value of each pixel in the current image block can be determined based on the pixel information of the predicted image blocks in the predicted image block set to encode or decode the current image block; a new implementation method for intra-frame prediction is proposed, that is, a new implementation method for intra-frame prediction mode is proposed, by searching for a reference template image block that matches the template image block of the current image block in the target reconstructed image area corresponding to the image, and further selecting the corresponding reference template image blocks of each reference template image block. In the predicted image block, the predicted image block with a larger correlation with the corresponding reference template image block is used to predict the predicted value of each pixel in the current image block. The pixel information of the selected predicted image block is more similar to the pixel information of the current image block, that is, it is more similar to the distribution of the reference values of each pixel in the current image block, so that the determined predicted value of each pixel in the current image block is more accurate, that is, the accuracy of the predicted value obtained by intra-frame prediction of the image can be improved, and the accuracy of intra-frame prediction of the image can also be improved. Moreover, since the encoding process of the current image block is realized by entropy encoding of the residual between the reference value and the predicted value of each pixel in the current image block, then, when the predicted value of each pixel in the current image block is more accurate, the performance of compression coding can be improved and bandwidth can be saved; that is, the performance of intra-frame prediction can be improved, and the encoding performance can be further improved.Furthermore, compared to the prediction mode in which the predicted values of each pixel in the predicted image block corresponding to the reference template image block that best matches the template image block are used as the predicted values of each pixel in the current image block, this prediction mode may result in a situation where the determined predicted image block is irrelevant to the reference template image block that best matches. In this case, even the predicted image block determined based on the reference template image block that best matches will have a large difference in pixel information from the current image block, thereby reducing the accuracy of the predicted values of each pixel in the determined current image block. The target prediction mode proposes to select the predicted image block that is related to the current image block. By using a predicted image block having a larger correlation with the corresponding reference template image block among the predicted image blocks corresponding to the matched reference template image blocks to predict the predicted value of each pixel in the current image block, the pixel information of the selected predicted image block can be more similar to the pixel information of the current image block, that is, more similar to the distribution of the reference values of each pixel in the current image block, thereby solving the problem that the pixel information of the determined predicted image block and the current image block is greatly different due to the lack of correlation between the best matching reference template image block and the corresponding predicted image block, which may exist in the prediction mode using the best matching reference template image block.
[0128] Based on the above embodiments related to the data processing method for an image, the present application embodiment provides a data processing device. Fig.14 , is a structural diagram of a data processing device provided in an embodiment of the present application, and the data processing device may include a searching unit 1401, a screening unit 1402 and a predicting unit 1403. Fig.14 The data processing apparatus shown can be used to perform the following operations:
[0129] A searching unit 1401 is used to determine a template image block of a current image block in an image, and to search for a reference template image block matching the template image block from a target reconstructed image region corresponding to the image;
[0130] The search unit 1401 is further configured to determine, from the target reconstructed image region, prediction image blocks corresponding to the reference template image blocks; the reference template image blocks correspond to the prediction image blocks one by one;
[0131] A screening unit 1402 is configured to screen and determine a set of prediction image blocks according to each prediction image block; wherein the correlation between the prediction image blocks in the set of prediction image blocks and the corresponding reference template image blocks is greater than or equal to the correlation between other prediction image blocks outside the set of prediction image blocks and the corresponding reference template image blocks;
[0132] The prediction unit 1403 is used to determine the prediction value of each pixel in the current image block according to the pixel information of the prediction image block in the prediction image block set, so as to encode or decode the current image block.
[0133] In one embodiment, before the screening unit 1402 screens and determines the prediction image block set according to each prediction image block, it is further configured to:
[0134] Searching, from a target prediction image block among the prediction image blocks, a comparison image region whose shape matches that of a target reference template image block corresponding to the target prediction image block; the comparison image region is adjacent to the target reference template image block;
[0135] The correlation between the target prediction image block and the target reference template image block is determined according to the pixel information of the comparison image area and the pixel information of the target reference template image block.
[0136] In one embodiment, the pixel point information of the contrast image area includes: the reconstruction value of each pixel point in the contrast image area, and the pixel point information of the target reference template image block includes: the reconstruction value of each pixel point in the target reference template image block;
[0137] When the screening unit 1402 determines the correlation between the target prediction image block and the target reference template image block according to the pixel information of the comparison image area and the pixel information of the target reference template image block, the screening unit 1402 specifically performs the following operations:
[0138] Determine a difference between a reconstruction value of a comparison pixel in the comparison image area and a reconstruction value of an associated pixel in the target reference template image block; the comparison pixel is adjacent to the associated pixel and is in the same row or column in the image, and the comparison pixel is any pixel in the comparison image area;
[0139] The correlation between the target prediction image block and the target reference template image block is determined according to the differences determined by the reconstructed values of the pixels in the comparison image area.
[0140] In one embodiment, when the screening unit 1402 determines the correlation between the target prediction image block and the target reference template image block according to the differences determined by the reconstructed values of the pixels in the comparison image area, the following operations are specifically performed:
[0141] Obtaining, according to each difference determined by the reconstruction value of each pixel point in the comparison image area, a first absolute error sum between the target prediction image block and the target reference template image block; the first absolute error sum is used to represent the correlation between the target prediction image block and the target reference template image block, and the correlation between the target prediction image block and the target reference template image block is negatively correlated with the first absolute error sum;
[0142] The predicted image block set is determined by screening according to the size of the first absolute error sum corresponding to each predicted image block.
[0143] In one embodiment, the pixel information of the predicted image block includes: a reconstructed value of each pixel in the corresponding predicted image block;
[0144] When the prediction unit 1403 determines the prediction value of each pixel in the current image block according to the pixel information of the prediction image block in the prediction image block set, the following operations are specifically performed:
[0145] For a target pixel in the current image block, reconstructed values of matching pixels in each prediction image block in the prediction image block set are averaged; the position of the target pixel in the current image block is the same as the position of the matching pixel in the corresponding prediction image block, and the target pixel is any pixel in the current image block;
[0146] The result of averaging the reconstructed values of the matching pixels is used as the predicted value of the target pixel in the current image block.
[0147] In one embodiment, when searching for a reference template image block matching the template image block in the target reconstructed image area corresponding to the image, the searching unit 1401 specifically performs the following operations:
[0148] Searching for a candidate template image block that matches the geometric features of the template image block from the target reconstructed image area;
[0149] Based on the difference between the pixel point information of the template image block and the pixel point information of each candidate template image block, a reference template image block matching the pixel point information of the template image block is determined from the candidate template image blocks.
[0150] In one embodiment, the searching unit 1401 specifically performs the following operations when determining a reference template image block that matches the pixel information of the template image block from the candidate template image blocks based on the difference between the pixel information of the template image block and the pixel information of each candidate template image block:
[0151] Obtaining a second absolute error sum between a reconstructed value of each pixel point in the template image block and a reconstructed value of each pixel point in any candidate template image block; the second absolute error sum is used to represent the difference between the pixel point information of the template image block and the pixel point information of any candidate template image block;
[0152] According to the second absolute errors corresponding to the template image blocks and in ascending order, a reference number of second absolute errors and corresponding candidate template image blocks are selected in sequence as reference template image blocks.
[0153] In one embodiment, when the searching unit 1401 determines the prediction image blocks corresponding to the reference template image blocks from the target reconstructed image area, the following operations are specifically performed:
[0154] Acquire a geometric feature relationship between the current image block and the template image block;
[0155] Based on the geometric feature relationship, the prediction image blocks corresponding to the respective reference template image blocks are determined from the target reconstructed image region.
[0156] In one embodiment, the data processing device further includes a processing unit 1404, and the processing unit 1404 is configured to:
[0157] Determining prediction coding distortion data of the current image block based on the prediction value of each pixel in the current image block;
[0158] Acquiring contrast prediction coding distortion data of the current image block when a contrast prediction mode is adopted to determine a prediction value of each pixel in the current image block;
[0159] Selecting a prediction mode for encoding the current image block according to the prediction coding distortion data and the comparison prediction coding distortion data;
[0160] Among them, when the predicted coding distortion data is less than or equal to the comparative prediction coding distortion data under each comparative prediction mode, the target prediction mode when the predicted value of each pixel point in the current image block is determined based on the template image block is used as the prediction mode for encoding the current image block; otherwise, the comparative prediction mode corresponding to the minimum comparative prediction coding distortion data is used as the prediction mode for encoding the current image block.
[0161] In one embodiment, when the processing unit 1404 determines the prediction coding distortion data of the current image block based on the prediction value of each pixel in the current image block, the processing unit 1404 specifically performs the following operations:
[0162] Determining a prediction error of each pixel in the current image block based on a prediction value of each pixel in the current image block and a reference value in the image corresponding to each pixel in the current image block;
[0163] The sum of squares of prediction errors of each pixel in the current image block is determined as prediction coding distortion data of the current image block.
[0164] In one embodiment, when the target prediction mode is adopted as the prediction mode for encoding the current image block, the encoding information of the current image block carries a corresponding indication mark; the processing unit 1404 is further used to:
[0165] In the process of decoding the encoding information of the current image block, if the indication mark is parsed from the encoding information of the current image block, the decoding of the current image block is completed according to the predicted value of each pixel point in the current image block determined based on the template image block.
[0166] According to one embodiment of the present application, Figure 5 as well as Figure 6 The various steps involved in the data processing method for an image shown can be performed by Fig.14 The data processing device shown in FIG. 1 is executed by each unit in the data processing device shown in FIG. Figure 5 Steps S501 to S502 shown in FIG. Fig.14 The search unit 1401 in the data processing device shown is executed. Figure 5 Step S503 shown can be performed by Fig.14 The screening unit 1402 in the data processing device shown in the figure is used to perform, Figure 5 Step S504 shown can be performed by Fig.14 The prediction unit 1403 in the data processing device shown in the figure is used for execution. Figure 6 Steps S601 to S602 shown in FIG. Fig.14 The search unit 1401 in the data processing device shown is executed. Figure 6 Steps S603 to S605 shown in FIG. Fig.14 The screening unit 1402 in the data processing device shown in the figure is used to perform, Figure 6 Step S606 shown can be performed by Fig.14 The prediction unit 1403 in the data processing device shown is used for execution.
[0167] According to another embodiment of the present application, Fig.14The various units in the data processing device shown can be separately or completely combined into one or several other units to constitute, or one (some) of the units can also be split into multiple smaller units in function to constitute, which can achieve the same operation without affecting the realization of the technical effects of the embodiments of the present application. The above-mentioned units are divided based on logical functions. In practical applications, the functions of one unit can also be implemented by multiple units, or the functions of multiple units can be implemented by one unit. For example, the functions implemented by the above-mentioned various units can be implemented by one processing unit. In other embodiments of the present application, the data processing device based on logical function division may also include other units. In practical applications, these functions can also be implemented with the assistance of other units, and can be implemented by the collaboration of multiple units.
[0168] According to another embodiment of the present application, the program can be executed by running on a general computing device such as a computer including a central processing unit (CPU), a random access memory medium (RAM), a read-only memory medium (ROM), and other processing elements and storage elements. Figure 5 as well as Figure 6 A computer program (including program code) for each step involved in the corresponding method shown in FIG. Fig.14 The data processing device shown in the embodiment of the present application is used to implement the data processing method for images. The computer program can be recorded on a computer-readable storage medium, for example, and loaded into the above-mentioned computing device through the computer-readable storage medium and run therein.
[0169] In the embodiment of the present application, a reference template image block matching the template image block of the current image block in the image can be searched from the target reconstructed image area corresponding to the image, and the prediction image blocks corresponding to each reference template image block can be determined from the target reconstructed image area; then, prediction image blocks with a large correlation with the corresponding reference template image block can be screened out from each prediction image block to form a prediction image block set, and the prediction value of each pixel in the current image block can be determined based on the pixel information of the prediction image blocks in the prediction image block set to encode or decode the current image block; a new implementation method of intra-frame prediction is proposed, that is, a new implementation method of intra-frame prediction mode is proposed, By searching for a reference template image block that matches the template image block of the current image block in the target reconstructed image area corresponding to the image, and further selecting a prediction image block corresponding to each reference template image block with a larger correlation with the corresponding reference template image block to predict the prediction value of each pixel in the current image block, the pixel information of the selected prediction image block is more similar to the pixel information of the current image block, that is, it is more similar to the distribution of the reference values of each pixel in the current image block, so that the predicted value of each pixel in the current image block is determined to be more accurate, that is, the accuracy of the predicted value obtained by intra-frame prediction of the image can be improved, and the accuracy of intra-frame prediction of the image can also be improved.
[0170] Based on the above-mentioned related embodiments of the data processing method for an image and the data processing device embodiment, the present application also provides a data processing device. Fig.15 , is a structural diagram of a data processing device provided in an embodiment of the present application. Fig.15 The data processing device shown may include at least a processor 1501, an input interface 1502, an output interface 1503, and a computer storage medium 1504. The processor 1501, the input interface 1502, the output interface 1503, and the computer storage medium 1504 may be connected via a bus or other means.
[0171] The computer storage medium 1504 may be stored in the memory of the data processing device. The computer storage medium 1504 is used to store a computer program. The computer program includes program instructions. The processor 1501 is used to execute the program instructions stored in the computer storage medium 1504. The processor 1501 (or CPU (Central Processing Unit)) is the computing core and control core of the data processing device, which is suitable for implementing one or more instructions, and is specifically suitable for loading and executing one or more instructions to implement the above-mentioned data processing method flow or corresponding functions for the image.
[0172] The embodiment of the present application also provides a computer storage medium (Memory), which is a memory device in a data processing device for storing programs and data. It is understandable that the computer storage medium here can include both the built-in storage medium in the terminal and the extended storage medium supported by the terminal. The computer storage medium provides a storage space, which stores the operating system of the terminal. In addition, one or more instructions suitable for being loaded and executed by the processor 1501 are also stored in the storage space, and these instructions can be one or more computer programs (including program codes). It should be noted that the computer storage medium here can be a high-speed random access memory (RAM) memory, or a non-volatile memory (non-volatile memory), such as at least one disk storage; optionally, it can also be at least one computer storage medium located away from the aforementioned processor.
[0173] In one embodiment, the processor 1501 may load and execute one or more instructions stored in a computer storage medium to implement the above-mentioned Figure 5 as well as Figure 6 In the corresponding steps of the method in the embodiment of the method for processing image data, in a specific implementation, one or more instructions in the computer storage medium are loaded by the processor 1501 and execute the following steps:
[0174] Determine a template image block of a current image block in an image, and search for a reference template image block matching the template image block from a target reconstructed image region corresponding to the image;
[0175] Determining predicted image blocks corresponding to respective reference template image blocks from the target reconstructed image region; the reference template image blocks correspond to the predicted image blocks one by one;
[0176] A prediction image block set is determined by screening each prediction image block; the correlation between the prediction image blocks in the prediction image block set and the corresponding reference template image blocks is greater than or equal to the correlation between other prediction image blocks outside the prediction image block set and the corresponding reference template image blocks;
[0177] According to the pixel information of the predicted image blocks in the predicted image block set, the predicted value of each pixel in the current image block is determined to encode or decode the current image block.
[0178] In one embodiment, before the processor 1501 determines the predicted image block set by screening the predicted image blocks, it is further configured to:
[0179] Searching, from a target prediction image block among the prediction image blocks, a comparison image region whose shape matches that of a target reference template image block corresponding to the target prediction image block; the comparison image region is adjacent to the target reference template image block;
[0180] The correlation between the target prediction image block and the target reference template image block is determined according to the pixel information of the comparison image area and the pixel information of the target reference template image block.
[0181] In one embodiment, the pixel point information of the contrast image area includes: the reconstruction value of each pixel point in the contrast image area, and the pixel point information of the target reference template image block includes: the reconstruction value of each pixel point in the target reference template image block;
[0182] When the processor 1501 determines the correlation between the target prediction image block and the target reference template image block according to the pixel information of the comparison image area and the pixel information of the target reference template image block, the processor 1501 specifically performs the following operations:
[0183] Determine a difference between a reconstruction value of a comparison pixel in the comparison image area and a reconstruction value of an associated pixel in the target reference template image block; the comparison pixel is adjacent to the associated pixel and is in the same row or column in the image, and the comparison pixel is any pixel in the comparison image area;
[0184] The correlation between the target prediction image block and the target reference template image block is determined according to the differences determined by the reconstructed values of the pixels in the comparison image area.
[0185] In one embodiment, when the processor 1501 determines the correlation between the target prediction image block and the target reference template image block according to the differences determined by the reconstructed values of the pixels in the comparison image area, the processor 1501 specifically performs the following operations:
[0186] Obtaining, according to each difference determined by the reconstruction value of each pixel point in the comparison image area, a first absolute error sum between the target prediction image block and the target reference template image block; the first absolute error sum is used to represent the correlation between the target prediction image block and the target reference template image block, and the correlation between the target prediction image block and the target reference template image block is negatively correlated with the first absolute error sum;
[0187] The predicted image block set is determined by screening according to the size of the first absolute error sum corresponding to each predicted image block.
[0188] In one embodiment, the pixel information of the predicted image block includes: a reconstructed value of each pixel in the corresponding predicted image block;
[0189] When the processor 1501 determines the prediction value of each pixel in the current image block according to the pixel information of the prediction image block in the prediction image block set, the processor 1501 specifically performs the following operations:
[0190] For a target pixel in the current image block, reconstructed values of matching pixels in each prediction image block in the prediction image block set are averaged; the position of the target pixel in the current image block is the same as the position of the matching pixel in the corresponding prediction image block, and the target pixel is any pixel in the current image block;
[0191] The result of averaging the reconstructed values of the matching pixels is used as the predicted value of the target pixel in the current image block.
[0192] In one embodiment, when the processor 1501 searches for a reference template image block that matches the template image block in the target reconstructed image area corresponding to the image, the processor 1501 specifically performs the following operations:
[0193] Searching for a candidate template image block that matches the geometric features of the template image block from the target reconstructed image area;
[0194] Based on the difference between the pixel point information of the template image block and the pixel point information of each candidate template image block, a reference template image block matching the pixel point information of the template image block is determined from the candidate template image blocks.
[0195] In one embodiment, the processor 1501 specifically performs the following operations when determining, from among the candidate template image blocks, a reference template image block that matches the pixel information of the template image block based on the difference between the pixel information of the template image block and the pixel information of each candidate template image block:
[0196] Obtaining a second absolute error sum between a reconstructed value of each pixel point in the template image block and a reconstructed value of each pixel point in any candidate template image block; the second absolute error sum is used to represent the difference between the pixel point information of the template image block and the pixel point information of any candidate template image block;
[0197] According to the second absolute errors corresponding to the template image blocks and in ascending order, a reference number of second absolute errors and corresponding candidate template image blocks are selected in sequence as reference template image blocks.
[0198] In one embodiment, when the processor 1501 determines the prediction image blocks corresponding to the reference template image blocks from the target reconstructed image area, the processor 1501 specifically performs the following operations:
[0199] Acquire a geometric feature relationship between the current image block and the template image block;
[0200] Based on the geometric feature relationship, the prediction image blocks corresponding to the respective reference template image blocks are determined from the target reconstructed image region.
[0201] In one embodiment, the processor 1501 is further configured to:
[0202] Determining prediction coding distortion data of the current image block based on the prediction value of each pixel in the current image block;
[0203] Acquiring contrast prediction coding distortion data of the current image block when a contrast prediction mode is adopted to determine a prediction value of each pixel in the current image block;
[0204] Selecting a prediction mode for encoding the current image block according to the prediction coding distortion data and the comparison prediction coding distortion data;
[0205] Among them, when the predicted coding distortion data is less than or equal to the comparative prediction coding distortion data under each comparative prediction mode, the target prediction mode when the predicted value of each pixel point in the current image block is determined based on the template image block is used as the prediction mode for encoding the current image block; otherwise, the comparative prediction mode corresponding to the minimum comparative prediction coding distortion data is used as the prediction mode for encoding the current image block.
[0206] In one embodiment, when the processor 1501 determines the prediction coding distortion data of the current image block based on the prediction value of each pixel in the current image block, the processor 1501 specifically performs the following operations:
[0207] Determining a prediction error of each pixel in the current image block based on a prediction value of each pixel in the current image block and a reference value in the image corresponding to each pixel in the current image block;
[0208] The sum of squares of prediction errors of each pixel in the current image block is determined as prediction coding distortion data of the current image block.
[0209] In one embodiment, when the target prediction mode is adopted as the prediction mode for encoding the current image block, the encoding information of the current image block carries a corresponding indication mark; the processor 1501 is further configured to:
[0210] In the process of decoding the encoding information of the current image block, if the indication mark is parsed from the encoding information of the current image block, the decoding of the current image block is completed according to the predicted value of each pixel point in the current image block determined based on the template image block.
[0211] The present application provides a computer program product, which includes a computer program stored in a computer storage medium; a processor of a data processing device reads the computer program from the computer storage medium, and the processor executes the computer program, so that the data processing device performs the above-mentioned Figure 5 as well as Figure 6 The method embodiment shown in the figure. The computer-readable storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM).
[0212] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A data processing method for an image, characterized in that: include: Determine a template image block of a current image block in an image, and search for a reference template image block matching the template image block from a target reconstructed image region corresponding to the image; Determining predicted image blocks corresponding to respective reference template image blocks from the target reconstructed image region; the reference template image blocks correspond to the predicted image blocks one by one; A prediction image block set is determined by screening each prediction image block; the correlation between the prediction image blocks in the prediction image block set and the corresponding reference template image blocks is greater than or equal to the correlation between other prediction image blocks outside the prediction image block set and the corresponding reference template image blocks; According to the pixel information of the predicted image blocks in the predicted image block set, the predicted value of each pixel in the current image block is determined to encode or decode the current image block.
2. The method according to claim 1, characterized in that Before determining the prediction image block set by screening the prediction image blocks, the method further includes: Searching, from a target prediction image block among the prediction image blocks, a comparison image region whose shape matches that of a target reference template image block corresponding to the target prediction image block; the comparison image region is adjacent to the target reference template image block; The correlation between the target prediction image block and the target reference template image block is determined according to the pixel information of the comparison image area and the pixel information of the target reference template image block.
3. The method according to claim 2, characterized in that The pixel point information of the contrast image area includes: the reconstruction value of each pixel point in the contrast image area, and the pixel point information of the target reference template image block includes: the reconstruction value of each pixel point in the target reference template image block; The determining, according to the pixel information of the comparison image area and the pixel information of the target reference template image block, the correlation between the target prediction image block and the target reference template image block comprises: Determine a difference between a reconstruction value of a comparison pixel in the comparison image area and a reconstruction value of an associated pixel in the target reference template image block; the comparison pixel is adjacent to the associated pixel and is in the same row or column in the image, and the comparison pixel is any pixel in the comparison image area; The correlation between the target prediction image block and the target reference template image block is determined according to the differences determined by the reconstructed values of the pixels in the comparison image area.
4. The method according to claim 3, characterized in that Determining the correlation between the target prediction image block and the target reference template image block according to the differences determined by the reconstructed values of the pixels in the comparison image area includes: Obtaining, according to each difference determined by the reconstruction value of each pixel point in the comparison image area, a first absolute error sum between the target prediction image block and the target reference template image block; the first absolute error sum is used to represent the correlation between the target prediction image block and the target reference template image block, and the correlation between the target prediction image block and the target reference template image block is negatively correlated with the first absolute error sum; The predicted image block set is determined by screening according to the size of the first absolute error sum corresponding to each predicted image block.
5. The method according to claim 1, characterized in that The pixel point information of the predicted image block includes: the reconstruction value of each pixel point in the corresponding predicted image block; The step of determining the predicted value of each pixel in the current image block according to the pixel information of the predicted image blocks in the predicted image block set comprises: For a target pixel in the current image block, reconstructed values of matching pixels in each prediction image block in the prediction image block set are averaged; the position of the target pixel in the current image block is the same as the position of the matching pixel in the corresponding prediction image block, and the target pixel is any pixel in the current image block; The result of averaging the reconstructed values of the matching pixels is used as the predicted value of the target pixel in the current image block.
6. The method according to claim 1, characterized in that The step of searching for a reference template image block matching the template image block in a target reconstructed image region corresponding to the image comprises: Searching for a candidate template image block that matches the geometric features of the template image block from the target reconstructed image area; Based on the difference between the pixel point information of the template image block and the pixel point information of each candidate template image block, a reference template image block matching the pixel point information of the template image block is determined from the candidate template image blocks.
7. The method according to claim 6, characterized in that The step of determining, based on the difference between the pixel information of the template image block and the pixel information of each candidate template image block, a reference template image block that matches the pixel information of the template image block from each candidate template image block comprises: Obtaining a second absolute error sum between a reconstructed value of each pixel point in the template image block and a reconstructed value of each pixel point in any candidate template image block; the second absolute error sum is used to represent the difference between the pixel point information of the template image block and the pixel point information of any candidate template image block; According to the second absolute errors corresponding to the template image blocks and in ascending order, a reference number of second absolute errors and corresponding candidate template image blocks are selected in sequence as reference template image blocks.
8. The method according to claim 1, characterized in that Determining, from the target reconstructed image region, predicted image blocks corresponding to respective reference template image blocks, comprises: Acquire a geometric feature relationship between the current image block and the template image block; Based on the geometric feature relationship, the prediction image blocks corresponding to the respective reference template image blocks are determined from the target reconstructed image region.
9. The method according to claim 1, characterized in that The method further comprises: Determining prediction coding distortion data of the current image block based on the prediction value of each pixel in the current image block; Acquiring contrast prediction coding distortion data of the current image block when a contrast prediction mode is adopted to determine a prediction value of each pixel in the current image block; Selecting a prediction mode for encoding the current image block according to the prediction coding distortion data and the comparison prediction coding distortion data; Among them, when the predicted coding distortion data is less than or equal to the comparative prediction coding distortion data under each comparative prediction mode, the target prediction mode when the predicted value of each pixel point in the current image block is determined based on the template image block is used as the prediction mode for encoding the current image block; otherwise, the comparative prediction mode corresponding to the minimum comparative prediction coding distortion data is used as the prediction mode for encoding the current image block.
10. The method according to claim 9, characterized in that The step of determining the prediction coding distortion data of the current image block based on the prediction value of each pixel in the current image block comprises: Determining a prediction error of each pixel in the current image block based on a prediction value of each pixel in the current image block and a reference value in the image corresponding to each pixel in the current image block; The sum of squares of prediction errors of each pixel in the current image block is determined as prediction coding distortion data of the current image block.
11. The method according to claim 9, characterized in that When the target prediction mode is used as the prediction mode for encoding the current image block, the encoding information of the current image block carries a corresponding indication mark; the method further includes: In the process of decoding the encoding information of the current image block, if the indication mark is parsed from the encoding information of the current image block, the decoding of the current image block is completed according to the predicted value of each pixel point in the current image block determined based on the template image block.
12. A data processing device, characterized in that: include: A search unit, used to determine a template image block of a current image block in an image, and to search for a reference template image block matching the template image block from a target reconstructed image region corresponding to the image; The search unit is further used to determine, from the target reconstructed image area, the prediction image blocks corresponding to the respective reference template image blocks; the reference template image blocks correspond to the prediction image blocks one by one; A screening unit is used to screen and determine a set of prediction image blocks according to each prediction image block; the correlation between the prediction image blocks in the set of prediction image blocks and the corresponding reference template image blocks is greater than or equal to the correlation between other prediction image blocks outside the set of prediction image blocks and the corresponding reference template image blocks; A prediction unit is used to determine the prediction value of each pixel in the current image block according to the pixel information of the prediction image block in the prediction image block set, so as to encode or decode the current image block.
13. A data processing device, characterized in that: The data processing device includes an input interface and an output interface, and further includes: a processor adapted to implement one or more instructions; and, A computer storage medium storing one or more instructions, wherein the one or more instructions are suitable for being loaded by the processor and executing the image data processing method according to any one of claims 1 to 11.
14. A computer storage medium, characterized in that: The computer storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, they are used to execute the data processing method for an image according to any one of claims 1 to 11.
