CN110290388B - Intra-frame prediction method, video encoding method, computer device and storage device - Google Patents
Intra-frame prediction method, video encoding method, computer device and storage device Download PDFInfo
- Publication number
- CN110290388B CN110290388B CN201910523773.0A CN201910523773A CN110290388B CN 110290388 B CN110290388 B CN 110290388B CN 201910523773 A CN201910523773 A CN 201910523773A CN 110290388 B CN110290388 B CN 110290388B
- Authority
- CN
- China
- Prior art keywords
- block
- current block
- prediction
- search
- matching
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/134—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
- H04N19/146—Data rate or code amount at the encoder output
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/134—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
- H04N19/157—Assigned coding mode, i.e. the coding mode being predefined or preselected to be further used for selection of another element or parameter
- H04N19/159—Prediction type, e.g. intra-frame, inter-frame or bidirectional frame prediction
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/169—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
- H04N19/17—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
- H04N19/176—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Compression Or Coding Systems Of Tv Signals (AREA)
Abstract
The application discloses an intra prediction method, a video encoding method, a computer device and a storage device. The intra prediction method includes: acquiring a search template of a current block; searching a reference pixel area by adopting a searching template, wherein the reference pixel area is a pixel area which is coded in a current frame; respectively obtaining the matching degree of the search template and the block covered by the search template in the reference pixel area; determining the minimum value in the matching degree to obtain an image block corresponding to the minimum value as the optimal matching block of the current block; and if the rate distortion cost corresponding to the best matching block is minimum, the block matching mode corresponding to the best matching block is the best prediction mode. By searching the reference pixel area by adopting the search template, the intra-frame prediction method provided by the application can be used for obtaining the best matching block by combining the image content, the brightness and the chrominance signal of the current block, so that the bit overhead of subsequent residual coding is low, the compression rate of intra-frame coding is improved, and the spatial redundancy is further removed.
Description
Technical Field
The present application relates to the field of video encoding and decoding technologies, and in particular, to an intra prediction method, a video encoding method, a computer device, and a storage apparatus.
Background
Because the data volume of the video image is large, when the video image interaction is carried out, the video image needs to be coded and decoded, and the video coding mainly has the function of compressing video pixel data (RGB, YUV and the like) into a video code stream, so that the data volume of the video is reduced, and the purposes of reducing the network bandwidth in the transmission process and reducing the storage space are achieved.
The video coding system mainly comprises video acquisition, prediction, transformation quantization and entropy coding, wherein the prediction is divided into an intra-frame prediction part and an inter-frame prediction part, and the intra-frame prediction part and the inter-frame prediction part are respectively used for removing the redundancy of video images in space and time.
In the conventional intra-frame prediction method, when a reference pixel of a current block is obtained, only pixel values adjacent to the upper side and the left side of the current block are selected without considering the content of a video image, and in this case, if the difference between the current block and the reference pixel is large, the generated residual error is also large, so that the bit cost of residual error coding is large, and the compression rate of intra-frame coding is influenced.
Disclosure of Invention
The application mainly provides an intra-frame prediction method, a video coding method, computer equipment and a storage device, which are used for solving the problems that when a reference pixel of a current block is obtained by a traditional intra-frame prediction method, only pixel values on the upper side and the left side of the current block are selected, and the content of a video image is not considered, so that bit cost of residual coding is high and compression rate of intra-frame coding is influenced.
In order to solve the technical problem, the application adopts a technical scheme that: an intra prediction method is provided. The intra prediction method includes: acquiring a search template of a current block, wherein the current block is an image block to be encoded; searching a reference pixel area by adopting a searching template, wherein the reference pixel area is a pixel area which is coded in a current frame; respectively obtaining the matching degree of the search template and the image block covered by the search template in the reference pixel area; determining the minimum value in the matching degree to obtain an image block corresponding to the minimum value as the optimal matching block of the current block; and if the rate distortion cost corresponding to the best matching block is minimum, the block matching mode corresponding to the best matching block is the best prediction mode.
In order to solve the above technical problem, another technical solution adopted by the present application is: a video encoding method is provided. The video encoding method includes: performing intra-frame prediction on the current block to obtain the optimal prediction mode of the current block; encoding the current block based on the optimal prediction mode; the best prediction mode of the current block is obtained by utilizing the intra-frame prediction method.
In order to solve the above technical problem, another technical solution adopted by the present application is: a computer device is provided. The computer device comprises a processor coupled to a memory for storing a program and a memory for executing the program to implement the method as described above.
In order to solve the above technical problem, another technical solution adopted by the present application is: a memory device is provided. The storage device stores a program that, when executed, enables the method described above to be implemented.
The beneficial effect of this application is: in contrast to the prior art, the present application discloses an intra prediction method, a video encoding method, a computer device, and a storage apparatus. By providing an intra-frame prediction mode based on block matching, all the encoded pixel areas in the current frame are used as the reference pixel areas of the current block, namely all the encoded pixels in the current frame are the reference pixels of the current block, the range of the reference pixels is increased, and meanwhile, the best matching block of the current block is determined in the reference pixel areas by adopting a search matching method, so that the best matching block can be obtained by combining the image content, the brightness and the chrominance signals of the current block, the bit cost of subsequent residual coding is smaller, the compression ratio of intra-frame coding is improved, and the spatial redundancy is further removed.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative efforts, wherein:
FIG. 1 is a flowchart illustrating an embodiment of an intra prediction method provided herein;
FIG. 2 is a diagram illustrating a first structure in the current frame of FIG. 1;
FIG. 3 is a second block diagram of the current frame of FIG. 1;
FIG. 4 is a schematic diagram of a third structure in the current frame of FIG. 1;
FIG. 5 is a diagram illustrating conventional intra prediction modes according to an embodiment of the present application;
FIG. 6 is a flow diagram of FIG. 1 after step S14;
fig. 7 is a flowchart illustrating an embodiment of a video encoding method provided in the present application;
FIG. 8 is a schematic block diagram of an embodiment of a computer device provided herein;
fig. 9 is a schematic structural diagram of an embodiment of a memory device provided in the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terms "first", "second" and "third" in the embodiments of the present application are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first," "second," or "third" may explicitly or implicitly include at least one of the feature. In the description of the present application, "plurality" means at least two, e.g., two, three, etc., unless explicitly specifically limited otherwise. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
Referring to fig. 1, fig. 1 is a flowchart illustrating an embodiment of an intra prediction method provided in the present application, in which the intra prediction method includes:
s11, obtaining a search template of the current block, wherein the current block is an image block to be coded.
Referring to fig. 2 to 4, the current frame is sequentially encoded in the form of image blocks according to a certain sequence, and the current block is an image block to be encoded in the current frame at the next moment in the sequence. The current block may have a variety of sizes, such as a size of 4X4, 8X8, or 16X8, among other specifications.
The search templates can be divided into three search templates, and different search templates correspond to different block matching pattern numbers.
First, as shown in fig. 2, the search template is a region of the current block, and the size of the search template is the size of the current block.
For example, the size of the current block is 4X4, the size of the search template is 4X 4. Or, the size of the current block is 16X8, the size of the search template is 16X 8.
In addition, the search template corresponds to a block matching mode number N +1, where N represents the number of types of conventional intra prediction modes, and the number is used to mark the intra prediction mode corresponding to the current block.
The conventional intra prediction modes include a Planar prediction mode, a DC prediction mode, and a multi-angle prediction mode. As shown in fig. 5, fig. 5 is a diagram of conventional intra prediction modes, where an image block corresponds to 67 intra prediction modes, 2-N indicate angle modes, and N is 66 in fig. 5, where 18 indicates horizontal angle mode (H), 50 indicates vertical angle mode (V), 0 indicates Planar prediction mode, and 1 indicates DC prediction mode, so that the corresponding block matching mode number is 68.
Secondly, as shown in fig. 3, the search template is a region formed by the current block and the reference pixels corresponding to the current block, and the size of the search template is the size of the region formed by the current block and the reference pixels corresponding to the current block.
The reference pixel is an encoded pixel point adjacent to the left side and the upper side of the current block in the current frame. The composition area of the reference pixel corresponding to the current block is determined by the number M of the reference lines, M is greater than or equal to 1, correspondingly, the block matching mode number is N + N, N represents the type of the search template, and N is greater than or equal to 1.
For example, the size of the current block is 4X4, and the number M of reference lines is 1, then the reference pixel area corresponding to the current block is the reference pixel point of the left column and the upper row of the current block. If the number M of the reference lines is 2, the reference pixel area corresponding to the current block is the reference pixel points of two columns on the left side and two rows on the upper side of the current block. Thus, the number of different reference lines, M, corresponds to different block matching patterns, and the different block matching pattern numbers are labeled as N +1, N +2 … N + N. Of course, n may be different from M, and each block matching pattern may be numbered differently.
Further, the search template may be a current block and a region composed of some or all of the reference pixels corresponding to the current block. All reference pixels corresponding to the current block are decoding reconstruction pixel points adjacent to the left side and the upper side of the current block, and partial reference pixels corresponding to the current block are decoding reconstruction pixel points adjacent to the left side or the upper side of the current block.
Further, the search template may be a rectangular region or a non-rectangular region. For example, the size of the current block is 4X4, and the number M of the reference lines is 1, then the reference pixels in a row above the current block may be 4 pixels directly above the current block, or 8 pixels directly above and right above the current block, or 9 pixels above left, directly above and right above the current block, that is, the reference pixels in a row above the current block are multiple pixels including the pixels directly above, and the reference pixels in a row at the left side of the current block are multiple pixels including the pixels directly above.
Thirdly, as shown in fig. 4, the size of the search template is the size of the region formed by the reference pixels corresponding to the current block, i.e. the size of the search template is the size of the region formed by the reference pixels corresponding to the current block. Further, the search template may be a region composed of some or all of the reference pixels corresponding to the current block.
The reference pixel area corresponding to the current block is determined by the number M of reference lines, M is greater than or equal to 1, correspondingly, the block matching mode number is N + N, N represents the type of the search template, and N is greater than or equal to 1.
Any template can be used as the search template of the current block, and the multiple search templates can be simultaneously adopted to obtain multiple matching blocks of the multiple search templates corresponding to the current block.
And S12, searching the reference pixel area by using the search template.
The reference pixel area is all the encoded pixel areas in the current frame, namely all the encoded pixels in the current frame are the reference pixels of the current block, the range of the reference pixels is increased, the reference pixel area is different from the reference pixels of the traditional intra-frame prediction mode, the image block covered by the reference pixel area of the search template is used as a prediction block, and then the reference pixel area is searched according to the size of the search template, so that a plurality of prediction blocks can be obtained.
It can be understood that, assuming that an image in the range of the search template is a cup and another identical cup exists in the reference pixel area, the difference between the image block covering the other cup in the reference pixel area and the search template is minimal, but the image block where the other cup exists is not necessarily adjacent to the search template, and therefore the image block needs to be searched in the reference pixel area.
In some embodiments, a fast search strategy is selected to search for the reference pixel region.
For example, the reference pixel region is searched in a sampling manner using a search template. The search starting point of the sampling mode can be selected at will in the reference pixel area, and the sampling mode can comprise a two-dimensional logarithm search method, a three-step search method, a TZsearch search method and a mixed search method, so that the search complexity is reduced, and the search time is shortened.
In this embodiment, a global search strategy is selected to search for the reference pixel region.
I.e. traversing the reference pixel area using the search template. The search starting point can be selected randomly in the reference pixel area, the search step length is at least one pixel point, and then the whole reference pixel area is traversed to obtain a plurality of image blocks. And reasonably setting a search starting point and traversing the reference pixel area, thereby ensuring that the best matching block which has the minimum difference with the image content of the current block and is closest to the brightness and chrominance signals of the corresponding pixel points in the reference pixel area is obtained.
Example 1: as shown in fig. 2, in the block matching mode, the first search template uses the current block as a search template, and adopts a global search strategy, that is, a search is performed from a pixel point at the top left corner of the current frame by using the search template, the search step is a pixel point, and the search direction is from left to right, and then from top to bottom. As shown in fig. 2, the current block has a size of 4x4, the reference pixel areas are encoded pixel areas on the upper side and the left side of the current block, S1 represents a first 4x4 image block to be searched, S2 represents a second 4x4 image block to be searched, and the searching is sequentially performed in the searching area from left to right and then from top to bottom by a step size of one pixel point, so as to obtain a plurality of image blocks having the same size as the searching template.
Example 2: as shown in fig. 3, in the block matching mode, in the second search template, an area formed by the current block and all reference pixels corresponding to the current block is used as the search template, where the number M of reference lines is 2, a global search strategy is adopted, that is, a search is performed from a pixel point at the top left corner of the current frame according to the search template, where the search step is one pixel point, and the search direction is from left to right, and then from top to bottom. As shown in fig. 3, the current block is 4 × 4 in size, the search template is composed of the current block and 16 reference pixels in two columns on the left of the current block and 16 reference pixels in two rows on the top, the reference pixel regions are encoded pixel regions on the upper side and the left side of the current block, S1 represents the first image block to be searched, S2 represents the second image block to be searched, the first image block is searched from left to right in sequence by the step length of one pixel, and then the second image block is searched from top to bottom in the search region, so that a plurality of image blocks with the same size as the search template are obtained.
Example 3: as shown in fig. 4, in the block matching mode, in the third search template, an area formed by all reference pixels corresponding to the current block is used as the search template, where the number M of reference lines is 1, a global search strategy is adopted, that is, a search is performed from a pixel point at the top left corner of the current frame according to the search template, where the search step is one pixel point, and the search direction is from left to right, and then from top to bottom. As shown in fig. 4, the current block is 4x4 in size, the search template is composed of 8 reference pixels in a column on the left of the current block and 8 reference pixels in a row on the top, the reference pixel regions are the encoded pixel regions on the top and left of the current block, S1 represents the first block searched, S2 represents the second block searched, and the searching is performed in the search region sequentially from left to right and then from top to bottom by the step size of one pixel, so as to obtain a plurality of image blocks having the same size as the search template.
And S13, respectively acquiring the matching degrees of the search template and the image block covered by the search template in the reference pixel area.
After the step S12, a plurality of image blocks are obtained, and then the matching degrees of the plurality of image blocks and the search template are respectively obtained, where the matching degree is one of the sum of absolute differences of pixel values, the mean square error value, the mean absolute error value, and the threshold difference count of the corresponding positions on the search template and the image blocks.
In this embodiment, the matching degree is represented by the sum of absolute differences of pixel values of the pixel points on the image block and the search template, which does not involve multiplication and division calculation, thereby facilitating the implementation of hardware.
The sum of absolute differences is calculated as SADk=∑k|s(x1,y1)-c(x2,y2) Where k denotes the k-th image block, s (x), corresponding to the search template1,y1) Representing the coordinate on the image block as (x)1,y1) Pixel value of pixel, c (x)2,y2) Representing the coordinates on the search template as (x)2,y2) The pixel values of the pixels.
In other embodiments, the degree of match may also be a mean squared error value, a mean absolute error value, a threshold difference count, or the like. The mean square error value, the absolute error mean value and the threshold difference count are all common calculation formulas and are not described again.
And S14, determining the minimum value in the matching degree to obtain the image block corresponding to the minimum value as the best matching block of the current block.
The matching degrees of the plurality of image blocks and the search template are respectively obtained, and a minimum value of the plurality of matching degrees, that is, a minimum value of the sums of absolute differences of the plurality of pixel values in this embodiment, is determined to obtain an image block corresponding to the minimum value as a best matching block of the current block, that is, an image block having a smallest difference with the search template is selected as the best matching block, and the best matching block is a prediction block of the current block in the block matching mode.
Further, referring to fig. 6, after S14 is executed, the following steps are also executed.
S141: and performing prediction processing on the current block by adopting a traditional intra-frame prediction mode to obtain a corresponding prediction block.
The conventional intra prediction modes include a Planar prediction mode, a DC prediction mode, and a multi-angle prediction mode.
Referring to fig. 5, fig. 5 is a diagram illustrating intra prediction modes of image blocks in an embodiment of the present application, where a current block corresponds to 67 conventional intra prediction modes, 2-N indicate angular modes, and N is 66 in fig. 3, where 18 indicates a horizontal angular mode (H), 50 indicates a vertical angular mode (V), 0 indicates a Planar prediction mode, and 1 indicates a DC prediction mode. The Planar prediction mode is mainly used for areas with relatively smooth image textures and relatively gradual change processes, and the prediction method comprises the following steps: and using pixel values on adjacent boundaries in 4 directions of up, down, left and right corresponding to the pixel to be predicted of the current block as reference pixel values, and obtaining the prediction block of the current block through averaging calculation. Compared with the Planar prediction mode, the DC prediction mode is mainly used for image flatness, texture smoothness, and not too gradual change area, and its prediction method is: all predicted values in the current block are average values of the left side and the upper side reference pixel values of the current block, and then the predicted block of the current block is obtained. The prediction method of the angle mode comprises the following steps: all predicted values in the current block are reference pixel values in the angle direction, if the reference pixel points to in the angle direction are whole pixels, the pixel values of the whole pixels are used for filling, and otherwise, the pixel values of the whole pixels on the left side and the right side of the reference pixel are used for filling after interpolation. Thus, after the current block is predicted in the conventional intra prediction mode, a plurality of prediction blocks will be obtained.
S142: the rate distortion cost of the best matching block and the prediction block is obtained.
After obtaining the best matching block in the block matching mode and the prediction block in the conventional intra-frame prediction mode, further obtaining rate distortion cost Rdcost of the best matching block and the prediction block, wherein the mathematical relationship of the rate distortion cost Rdcost calculation is as follows: rdcost ═ D + λ × R, where D, R denotes the distortion and the number of bits when different prediction modes are used, λ is the lagrange factor.
And then, determining the best matching block or the prediction block corresponding to the minimum value of the rate distortion cost Rdcost. Namely, the prediction mode with the minimum rate distortion cost Rdcost is found through comparison to be the best prediction mode, and the best matching block or the prediction block corresponding to the best prediction mode is the best prediction block.
Thus, if it is determined that the rate-distortion cost Rdcost of the best matching block is minimum, step S15 is performed, otherwise step S16 is performed.
And S15, if the rate distortion cost corresponding to the best matching block is minimum, the block matching mode corresponding to the best matching block is the best prediction mode.
And if the rate distortion cost corresponding to the best matching block is minimum, determining that the block matching mode corresponding to the best matching block is the best prediction mode, and the best matching block is the best prediction block.
By comparing the rate-distortion cost in the block matching mode with the rate-distortion cost in the traditional intra-frame prediction mode and determining that the block matching mode is the best prediction mode, the method can further improve the compression rate of intra-frame coding and reduce the transmission bandwidth of video data and the storage resource of the video data compared with a method for performing predictive coding only by adopting the traditional intra-frame prediction mode.
And S16, if the rate distortion cost corresponding to the prediction block is the minimum, the traditional intra-frame prediction mode corresponding to the prediction block is the best prediction mode.
And if the rate distortion cost corresponding to the prediction block is minimum, the traditional intra-frame prediction mode corresponding to the prediction block is the optimal prediction mode, the traditional intra-frame prediction mode is one of a Planar prediction mode, a DC prediction mode and a multi-angle prediction mode, and the prediction block is the optimal prediction block.
Referring to fig. 7, fig. 7 is a flowchart illustrating an embodiment of a video encoding method provided in the present application, where the video encoding method includes:
s21: and carrying out intra-frame prediction on the current block to obtain the optimal prediction mode of the current block.
The current block is an image block to be coded, and the best prediction mode of the current block is obtained by adopting the intra-frame prediction method.
S22: the current block is encoded based on the best prediction mode.
If the optimal prediction mode is a block matching mode, for both the first search template and the second search template, the search templates include the current block, and the current block is an image block to be encoded, it is necessary to encode a motion vector from the current block to the optimal matching block in the code stream.
In an embodiment, a motion vector of an image block of which the best prediction mode is a block matching mode may be selected from encoded image blocks adjacent to a current block as a prediction motion vector of the current block, and a decoding end obtains the motion vector of the current block by decoding a motion vector residual in a code stream and combining the prediction motion vector to obtain a prediction block of the current block, so as to decode the current block.
In another embodiment, motion vectors of a plurality of image blocks of which the best prediction mode is the block matching mode may be selected from encoded image blocks adjacent to the current block, an average value of the plurality of motion vectors is obtained as a prediction motion vector of the current block, and the decoding end obtains the motion vector of the current block by decoding a motion vector residual in a code stream and combining the prediction motion vector to obtain a prediction block of the current block, so as to decode the current block.
For the third search template, all the search templates include the reference pixel points.
In one embodiment, it is necessary to encode a motion vector or a motion vector residual from a current block to a best matching block in a code stream, and obtain a prediction block of the current block by decoding the motion vector or the motion vector residual in the code stream at a decoding end.
In another embodiment, the encoding end does not need to encode the motion vector, and the decoding end performs the same block matching mode search as the encoding end to obtain the prediction block of the current block.
Therefore, in the block matching mode, a syntax element may be added to any one of a Picture Parameter Set (PPS), a Sequence Parameter Set (SPS), or Slice header information (Slice header), and the syntax element controls whether a motion vector needs to be transmitted. When the motion vector is transmitted, the decoding end decodes the current block by acquiring the motion vector; and when the motion vector is not transmitted, the decoding end acquires the prediction block by adopting a block matching mode so as to decode the current block.
In contrast to the prior art, the present application discloses an intra prediction method, a video encoding method, a computer device, and a storage apparatus. By providing an intra-frame prediction mode based on block matching, all the encoded pixel areas in the current frame are used as the reference pixel areas of the current block, namely all the encoded pixels in the current frame are the reference pixels of the current block, the range of the reference pixels is increased, and meanwhile, the best matching block of the current block is determined in the reference pixel areas by adopting a search matching method, so that the best matching block can be obtained by combining the image content, the brightness and the chrominance signals of the current block, the bit cost of subsequent residual coding is smaller, the compression ratio of intra-frame coding is improved, and the spatial redundancy is further removed.
Based on this, the present application further provides a computer device 100, please refer to fig. 8, fig. 8 is a schematic structural diagram of a first embodiment of the computer device of the present application, in this embodiment, the computer device 100 includes a processor 110 and a memory 120, the processor 110 is coupled to the memory 120, the memory 120 is used for storing a program, and the processor 110 is used for executing the program to implement the intra prediction method or the video coding method of any of the above embodiments.
The computer device 100 may be a codec. Processor 110 may also be referred to as a CPU (Central Processing Unit). The processor 110 may be an integrated circuit chip having signal processing capabilities. The processor 110 may also be a general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components. The general purpose processor 110 may be a microprocessor or the processor may be any conventional processor or the like.
Based on this, the present application further provides a storage device 200, please refer to fig. 9, fig. 9 is a schematic structural diagram of an embodiment of the storage device provided in the present application, in which the storage device 200 stores a program 210, and when the program 210 is executed, the intra prediction method or the video encoding method according to any of the above embodiments can be implemented.
The program 210 may be stored in the storage device 200 in the form of a software product, and includes several instructions to make a device or a processor execute all or part of the steps of the methods according to the embodiments of the present application.
The storage device 200 is a medium in computer memory for storing some discrete physical quantity. The storage device 200 having a storage function includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and the like, which can store the code of the program 210.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules or units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, a network device, or the like) or a processor (processor) to execute all or part of the steps of the method according to the embodiments of the present application.
The above description is only an example of the present application and is not intended to limit the scope of the present application, and all modifications of equivalent structures and equivalent processes, which are made by the contents of the specification and the drawings, or which are directly or indirectly applied to other related technical fields, are intended to be included within the scope of the present application.
Claims (10)
1. An intra prediction method, comprising:
acquiring a search template of a current block, wherein the current block is an image block to be coded;
searching a reference pixel area by adopting the search template, wherein the reference pixel area is a pixel area which is coded in the current frame;
respectively obtaining the matching degrees of the search template and the image blocks covered by the search template in the reference pixel area;
determining the minimum value in the matching degree to obtain the image block corresponding to the minimum value as the best matching block of the current block;
and if the rate distortion cost corresponding to the best matching block is minimum, the block matching mode corresponding to the best matching block is the best prediction mode.
2. The intra prediction method according to claim 1,
the search template is a region of the current block; or
The search template is an area formed by the current block and the reference pixels corresponding to the current block; or
The search template is an area formed by reference pixels corresponding to the current block;
wherein the reference pixels are encoded pixel points immediately to the left and upper sides of the current block.
3. The method of claim 1, wherein the searching for the reference pixel region using the search template comprises:
traversing the reference pixel region using the search template; or
And searching the reference pixel area by adopting the search template in a sampling mode, wherein the sampling mode comprises a two-dimensional logarithm search method, a three-step search method, a TZsearch search method and a mixed search method.
4. The method of claim 1, wherein the matching degree is one of a sum of absolute differences of pixel values, a mean squared error value, a mean absolute error value, and a threshold difference count of corresponding positions of the search template and the image block.
5. The method of claim 1, wherein after the step of determining the minimum value of the matching degrees to obtain the image block corresponding to the minimum value as the best matching block of the current block, the method further comprises:
performing prediction processing on the current block by adopting a traditional intra-frame prediction mode to obtain a corresponding prediction block;
wherein the conventional intra prediction modes include a Planar prediction mode, a DC prediction mode, and a multi-angle prediction mode.
6. The method of claim 5, wherein after the predicting the current block in the legacy mode to obtain the corresponding prediction block, the method further comprises:
obtaining rate distortion costs of the best matching block and the prediction block;
and determining the best matching block or the prediction block corresponding to the minimum value of the rate-distortion cost.
7. The method of claim 6, wherein after determining the best matching block or the prediction block corresponding to the minimum value of the rate-distortion cost, the method further comprises:
and if the rate distortion cost corresponding to the prediction block is minimum, the traditional intra-frame prediction mode corresponding to the prediction block is the best prediction mode.
8. A method of video encoding, the method comprising:
performing intra-frame prediction on a current block to acquire an optimal prediction mode of the current block;
encoding the current block based on the best prediction mode;
wherein the best prediction mode of the current block is obtained using the intra prediction method according to any one of claims 1 to 7.
9. A computer device, comprising a processor coupled to a memory and the memory for storing a program, and a memory for executing the program to implement the method of any one of claims 1-8.
10. A storage device, characterized in that it stores a program which, when executed, is able to implement the method according to any one of claims 1 to 8.
Priority Applications (4)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910523773.0A CN110290388B (en) | 2019-06-17 | 2019-06-17 | Intra-frame prediction method, video encoding method, computer device and storage device |
EP20826709.6A EP3957075A4 (en) | 2019-06-17 | 2020-06-03 | Systems and methods for predicting a coding block |
PCT/CN2020/094118 WO2020253528A1 (en) | 2019-06-17 | 2020-06-03 | Systems and methods for predicting a coding block |
US17/457,263 US20220094910A1 (en) | 2019-06-17 | 2021-12-02 | Systems and methods for predicting a coding block |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910523773.0A CN110290388B (en) | 2019-06-17 | 2019-06-17 | Intra-frame prediction method, video encoding method, computer device and storage device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110290388A CN110290388A (en) | 2019-09-27 |
CN110290388B true CN110290388B (en) | 2021-07-13 |
Family
ID=68005349
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910523773.0A Active CN110290388B (en) | 2019-06-17 | 2019-06-17 | Intra-frame prediction method, video encoding method, computer device and storage device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110290388B (en) |
Families Citing this family (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2020253528A1 (en) * | 2019-06-17 | 2020-12-24 | Zhejiang Dahua Technology Co., Ltd. | Systems and methods for predicting a coding block |
CN111447454B (en) * | 2020-03-30 | 2022-06-07 | 浙江大华技术股份有限公司 | Coding method and related device |
CN111586415B (en) * | 2020-05-29 | 2022-01-04 | 浙江大华技术股份有限公司 | Video coding method, video coding device, video coder and storage device |
CN111586416B (en) * | 2020-06-02 | 2024-07-12 | 浙江大华技术股份有限公司 | Video coding method, device, coder and storage device |
CN112601094A (en) * | 2021-03-01 | 2021-04-02 | 浙江智慧视频安防创新中心有限公司 | Video coding and decoding method and device |
CN112601092A (en) * | 2021-03-01 | 2021-04-02 | 浙江智慧视频安防创新中心有限公司 | Video coding and decoding method and device |
CN113596475A (en) * | 2021-06-24 | 2021-11-02 | 浙江大华技术股份有限公司 | Image/video encoding method, apparatus, system, and computer-readable storage medium |
CN113489974B (en) * | 2021-07-02 | 2023-05-16 | 浙江大华技术股份有限公司 | Intra-frame prediction method, video/image encoding and decoding method and related devices |
CN115119046B (en) * | 2022-06-02 | 2024-04-16 | 绍兴市北大信息技术科创中心 | Image coding and decoding method, device and system for reference pixel set |
CN114938449B (en) * | 2022-07-20 | 2023-10-27 | 浙江大华技术股份有限公司 | Intra-frame prediction method, image encoding method, image decoding method and device |
WO2024077562A1 (en) * | 2022-10-13 | 2024-04-18 | Oppo广东移动通信有限公司 | Coding method and apparatus, decoding method and apparatus, coder, decoder, code stream, and storage medium |
CN117197507B (en) * | 2023-11-07 | 2024-02-09 | 北京闪马智建科技有限公司 | Image block determining method and device, storage medium and electronic device |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101426140A (en) * | 2008-11-06 | 2009-05-06 | 青岛海信电子产业控股股份有限公司 | AVS fast schema selection method and device |
CN101715135A (en) * | 2009-09-30 | 2010-05-26 | 武汉大学 | Template matching based method for encoding self-adaption intra-frame prediction filtering |
CN104253997A (en) * | 2013-06-26 | 2014-12-31 | 鸿富锦精密工业(深圳)有限公司 | Intra prediction method and system |
JP2015111774A (en) * | 2013-12-06 | 2015-06-18 | 日本電信電話株式会社 | Video coding device and video coding program |
CN105812798A (en) * | 2014-12-31 | 2016-07-27 | 深圳中兴力维技术有限公司 | Image encoding and decoding method and device thereof |
-
2019
- 2019-06-17 CN CN201910523773.0A patent/CN110290388B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101426140A (en) * | 2008-11-06 | 2009-05-06 | 青岛海信电子产业控股股份有限公司 | AVS fast schema selection method and device |
CN101715135A (en) * | 2009-09-30 | 2010-05-26 | 武汉大学 | Template matching based method for encoding self-adaption intra-frame prediction filtering |
CN104253997A (en) * | 2013-06-26 | 2014-12-31 | 鸿富锦精密工业(深圳)有限公司 | Intra prediction method and system |
JP2015111774A (en) * | 2013-12-06 | 2015-06-18 | 日本電信電話株式会社 | Video coding device and video coding program |
CN105812798A (en) * | 2014-12-31 | 2016-07-27 | 深圳中兴力维技术有限公司 | Image encoding and decoding method and device thereof |
Non-Patent Citations (2)
Title |
---|
Intra Prediction Based on Interpolation;Yao Chunlian等;《2011 International Conference on Computer Science and Network Technology》;20111226;全文 * |
适用于4K分辨率视频的HEVC帧内编码快速算法;曾飞洋等;《电脑知识与技术》;20170504;全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN110290388A (en) | 2019-09-27 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110290388B (en) | Intra-frame prediction method, video encoding method, computer device and storage device | |
CN106331703B (en) | Video encoding and decoding method, video encoding and decoding device | |
TWI540885B (en) | Method and apparatus for encoding and decoding image through intra prediction | |
CN104363451B (en) | Image prediction method and relevant apparatus | |
WO2016050051A1 (en) | Image prediction method and relevant device | |
WO2022104498A1 (en) | Intra-frame prediction method, encoder, decoder and computer storage medium | |
US10779000B2 (en) | Motion-compensated prediction method and apparatus | |
KR20180019688A (en) | Picture prediction method and picture prediction apparatus | |
CN113596475A (en) | Image/video encoding method, apparatus, system, and computer-readable storage medium | |
CN101496412A (en) | Mesh-based video compression with domain transformation | |
US20190268608A1 (en) | Motion compensating prediction method and device | |
CN116456101A (en) | Image encoding method, image decoding method and related devices | |
CN110971897B (en) | Method, apparatus and system for encoding and decoding intra prediction mode of chrominance component | |
TWI790662B (en) | Encoding and decoding method, apparatus and device thereof | |
CN111586415B (en) | Video coding method, video coding device, video coder and storage device | |
CN114071161B (en) | Image encoding method, image decoding method and related devices | |
CN108401185B (en) | Reference frame selection method, video transcoding method, electronic device and storage medium | |
CN117897952A (en) | Method and system for performing combined inter and intra prediction | |
CN110719467B (en) | Prediction method of chrominance block, encoder and storage medium | |
CN112887732B (en) | Method and device for inter-frame and intra-frame joint prediction coding and decoding with configurable weight | |
US20240040133A1 (en) | Video coding using multi-model linear model | |
CN116250240A (en) | Image encoding method, image decoding method and related devices | |
CN113365080B (en) | Encoding and decoding method, device and storage medium for string coding technology | |
WO2007063017A1 (en) | Method of predicting motion and texture data | |
CN110166774B (en) | Intra-frame prediction method, video encoding method, video processing apparatus, and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |