CN109547791B - Image intra-frame prediction method and device thereof - Google Patents

Image intra-frame prediction method and device thereof Download PDF

Info

Publication number
CN109547791B
CN109547791B CN201811260515.XA CN201811260515A CN109547791B CN 109547791 B CN109547791 B CN 109547791B CN 201811260515 A CN201811260515 A CN 201811260515A CN 109547791 B CN109547791 B CN 109547791B
Authority
CN
China
Prior art keywords
image
macro block
prediction
pixels
group
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
Application number
CN201811260515.XA
Other languages
Chinese (zh)
Other versions
CN109547791A (en
Inventor
李雯
田林海
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xian Cresun Innovation Technology Co Ltd
Original Assignee
Xian Cresun Innovation Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Xian Cresun Innovation Technology Co Ltd filed Critical Xian Cresun Innovation Technology Co Ltd
Priority to CN201811260515.XA priority Critical patent/CN109547791B/en
Publication of CN109547791A publication Critical patent/CN109547791A/en
Application granted granted Critical
Publication of CN109547791B publication Critical patent/CN109547791B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods 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/17Methods 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/176Methods 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/132Sampling, masking or truncation of coding units, e.g. adaptive resampling, frame skipping, frame interpolation or high-frequency transform coefficient masking
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods 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/146Data rate or code amount at the encoder output
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/593Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving spatial prediction techniques

Abstract

The invention relates to a method and device for predicting an image frame, which comprises the steps of dividing a current image frame into a plurality of image macro blocks; sampling pixels in each image macro block to obtain sampling pixels; for each image macro block, determining a first predicted value of each pixel in each image macro block through a first intra-frame prediction mode based on the sampling pixel in each image macro block; dividing each image macro block into a plurality of image sub macro blocks; for each image macro block, determining a second predicted value of each pixel in each image macro block through a second intra-frame prediction mode based on the division mode of the plurality of image sub-macro blocks; and determining the final intra-frame prediction mode of each image macro block according to the first prediction value and the second prediction value. Compared with the existing method, two intra-frame prediction modes are selected for predicting the image frame, the encoding compression rate of the image frame can be improved for image macro blocks of different scenes, and the theoretical limit entropy of compression is further reduced.

Description

Image intra-frame prediction method and device thereof
Technical Field
The present invention relates to the field of compression technologies, and in particular, to a method and an apparatus for intra prediction of an image.
Background
The natural form of a digital video signal of an image is a sequence of images. A frame of image is usually a rectangular area composed of several pixels, and a digital video signal is a video image sequence composed of tens of frames to thousands of frames of images, sometimes also referred to simply as a video sequence or sequence. Encoding a digital video signal is to encode one frame by one frame of image.
In the latest international Video compression standard hevc (high Efficiency Video coding), when a frame of image is encoded, the frame of image is divided into a plurality of macroblocks (Macro blocks, abbreviated as MBs) of M × N pixels, and the MB is used as a basic encoding unit to encode one Block of image. Thus, encoding a sequence of video pictures is the sequential encoding of each MB. Similarly, during decoding, each MB is sequentially decoded, and finally the entire video image sequence is reconstructed. In the currently used image compression technology, the encoding process mainly includes the steps of predictive encoding, matching encoding, transform encoding, quantization encoding, post-processing for removing negative effects (such as block effect and ripple effect) of encoding, and the like. In the currently used image compression technology, the decoding process of the current coding unit is to read out the selected coding mode and parameter set, given quantization parameters and residual data from the video compressed code stream through entropy decoding, calculate partial restored images (also weighing the picture composition images) of different degrees according to the information, then perform post-processing to remove coding negative effects (such as blocking effect and ripple effect), and finally obtain a complete restored image.
In the current predictive coding method, a single predictive coding method is adopted for each MB, and the single predictive coding method cannot be applied to different scenes of a macroblock.
Disclosure of Invention
Therefore, to solve the technical defects and shortcomings of the prior art, the present invention provides a video encoding method and apparatus.
Specifically, an embodiment of the present invention provides an image intra prediction method, including:
dividing a current image frame into a plurality of image macro blocks;
sampling pixels in each image macro block to obtain sampling pixels;
for each image macro block, determining a first predicted value of each pixel in each image macro block through a first intra-frame prediction mode based on the sampling pixel in each image macro block;
dividing each image macro block into a plurality of image sub macro blocks;
for each image macro block, determining a second predicted value of each pixel in each image macro block through a second intra-frame prediction mode based on the division mode of the plurality of image sub-macro blocks;
and determining the final intra-frame prediction mode of each image macro block according to the first prediction value and the second prediction value.
In one embodiment of the present invention, sampling pixels in each image macroblock to obtain sampled pixels comprises:
and carrying out multiple groups of non-equidistant sampling on the pixels in each image macro block to obtain corresponding multiple groups of sampling pixels.
In an embodiment of the present invention, determining a first predicted value of each pixel in each image macroblock by a first intra prediction mode includes:
performing preset angle prediction on the multiple groups of sampling pixels in each image macro block to respectively obtain multiple groups of first prediction residuals corresponding to the multiple groups of sampling pixels in each image macro block;
predicting a plurality of groups of non-sampling pixels corresponding to the plurality of groups of sampling pixels in each image macro block by using a preset formula to respectively obtain a plurality of groups of second prediction residuals of the plurality of groups of non-sampling pixels corresponding to the plurality of groups of sampling pixels in each image macro block;
respectively carrying out absolute value sum operation on each group of first prediction residual errors and each group of corresponding second prediction residual errors to obtain a plurality of groups of absolute value sums corresponding to each pixel in each image macro block;
and selecting a group of first prediction residuals and second prediction residuals corresponding to a group of absolute values and minimum values as first prediction residuals of all pixels in each image macro block.
In one embodiment of the present invention, dividing each of the image macroblocks into a plurality of image sub-macroblocks comprises:
dividing each image macro block into a plurality of image sub macro blocks by utilizing a plurality of dividing modes; the multiple segmentation modes comprise a horizontal segmentation mode, a vertical segmentation mode and a non-segmentation mode.
In an embodiment of the present invention, determining the second predicted value of each pixel in each image macroblock by the second intra prediction mode includes:
respectively calculating each group of third prediction residual errors and the number of bits corresponding to each image macro block under each segmentation mode;
selecting a final segmentation mode of each image macro block according to each group of third prediction residuals and the bit number;
and taking a group of third prediction residuals corresponding to the final segmentation mode as second prediction values of all pixels in each image macro block.
Another embodiment of the present invention provides an image intra prediction apparatus, including:
the dividing module is used for dividing the current image frame into a plurality of image macro blocks;
the sampling module is connected with the dividing module and used for sampling the pixels in each image macro block to obtain sampling pixels;
the first intra-frame prediction module is connected with the sampling module and used for determining a first predicted value of each pixel in each image macro block through a first intra-frame prediction mode according to the sampling pixel in each image macro block;
the dividing module is connected with the dividing module and used for dividing each image macro block into a plurality of image sub macro blocks;
a second intra-frame prediction module, connected to the partitioning module, configured to determine, for each image macroblock, a second predicted value of each pixel in each image macroblock in a second intra-frame prediction manner based on a partitioning manner of the plurality of image sub-macroblocks;
and the determining module is connected with the first intra-frame prediction module and the second intra-frame prediction module and is used for determining the final intra-frame prediction mode of each image macro block according to the first predicted value and the second predicted value.
In an embodiment of the present invention, the sampling module is specifically configured to perform multiple sets of non-equidistant sampling on the pixels in each image macroblock to obtain corresponding multiple sets of sampled pixels.
In an embodiment of the present invention, the first intra prediction module is specifically configured to:
performing preset angle prediction on the multiple groups of sampling pixels in each image macro block to respectively obtain multiple groups of first prediction residuals corresponding to the multiple groups of sampling pixels in each image macro block;
predicting a plurality of groups of non-sampling pixels corresponding to the plurality of groups of sampling pixels in each image macro block by using a preset formula to respectively obtain a plurality of groups of second prediction residuals of the plurality of groups of non-sampling pixels corresponding to the plurality of groups of sampling pixels in each image macro block;
respectively carrying out absolute value sum operation on each group of first prediction residual errors and each group of corresponding second prediction residual errors to obtain a plurality of groups of absolute value sums corresponding to each pixel in each image macro block;
selecting a group of first prediction residual errors and second prediction residual errors corresponding to a group of absolute values and minimum values
As the first prediction residual for each pixel in said each image macroblock.
In an embodiment of the present invention, the dividing module is specifically configured to divide each image macroblock into a plurality of image sub-macroblocks by using a plurality of dividing manners; the multiple segmentation modes comprise a horizontal segmentation mode, a vertical segmentation mode and a non-segmentation mode.
In an embodiment of the invention, the second intra prediction module is specifically configured to:
respectively calculating each group of third prediction residual errors and the number of bits corresponding to each image macro block under each segmentation mode;
selecting a final segmentation mode of each image macro block according to each group of third prediction residuals and the bit number;
and taking a group of third prediction residuals corresponding to the final segmentation mode as second prediction values of all pixels in each image macro block.
Based on this, the invention has the following advantages:
the invention respectively predicts the current image frame by two image intra-frame prediction methods, selects the optimal intra-frame prediction method according to different prediction results, can improve the encoding compression rate of the image frame for image macro blocks of different scenes and further reduces the theoretical limit entropy of compression.
Other aspects and features of the present invention will become apparent from the following detailed description, which proceeds with reference to the accompanying drawings. It is to be understood, however, that the drawings are designed solely for purposes of illustration and not as a definition of the limits of the invention, for which reference should be made to the appended claims. It should be further understood that the drawings are not necessarily drawn to scale and that, unless otherwise indicated, they are merely intended to conceptually illustrate the structures and procedures described herein.
Drawings
The following detailed description of embodiments of the invention will be made with reference to the accompanying drawings.
FIG. 1 is a flowchart illustrating a method for intra prediction according to an embodiment of the present invention;
FIG. 2 is a schematic diagram illustrating a sampling method of a first intra prediction method according to an embodiment of the present invention;
fig. 3 is a schematic diagram of a method for predicting a preset angle in a first intra-frame prediction mode according to an embodiment of the present invention;
FIGS. 4a to 4c are schematic diagrams illustrating different partition modes of a second intra prediction mode according to an embodiment of the present invention;
fig. 5 is a schematic diagram of an image intra prediction apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in detail below.
Example one
Referring to fig. 1, fig. 1 is a schematic flow chart illustrating an image intra prediction method according to an embodiment of the present invention; this embodiment describes an image intra prediction method provided by the present invention in detail, and the method includes the following steps:
step 1, dividing a current image frame into a plurality of image macro blocks;
the current image frame may be divided into image macroblocks of a fixed size or image macroblocks of different sizes, each image macroblock includes a plurality of pixels, and the size of the image macroblock is m × n, that is, the image macroblock includes m × n pixels.
Step 2, sampling pixels in each image macro block to obtain sampling pixels;
the method for obtaining the image macroblock comprises the following steps of carrying out multi-group non-equidistant sampling on pixels in each image macroblock to obtain corresponding multi-group sampling pixels, and specifically comprises the following steps:
according to the texture correlation existing in the image macro block, the closer the pixel distance in the image macro block is, the higher the consistency probability of the texture gradual change of the image macro block is, and on the contrary, the farther the pixel distance in the image macro block is, the lower the consistency probability of the texture gradual change of the image macro block is, so that the pixels in the image macro block are subjected to non-equidistant sampling, and a plurality of groups of non-equidistant sampling modes can be selected.
Preferably, as shown in fig. 2, fig. 2 is a schematic diagram of a sampling manner of a first intra prediction manner according to an embodiment of the present invention; in the step, assuming that 16 × 1 pixels exist in an image macro block, the image macro blocks with other sizes are the same, non-equidistant sampling is performed on the image macro block, which is exemplified by three non-equidistant sampling modes of sampling 1, sampling 2 and sampling 3, and the other non-equidistant sampling modes are the same, wherein sampling 1 is performed on 3 pixels with sequence numbers of 0, 4 and 15 corresponding to the positions in the image macro block; sampling 2 is to sample 4 pixels with corresponding positions of 0, 5, 10 and 15 in the image macro block; sampling 3 is to sample 3 pixels with corresponding positions of 0, 11 and 15 in the image macro block; three sets of sampled pixels are obtained by sample1, sample 2, and sample 3.
Step 3, for each image macro block, determining a first predicted value of each pixel in each image macro block in a first intra-frame prediction mode based on the sampling pixel in each image macro block;
specifically, performing preset angle prediction on the multiple groups of sampling pixels in each image macro block to respectively obtain multiple groups of first prediction residuals corresponding to the multiple groups of sampling pixels in each image macro block; further, the process of processing a group of sampling pixels in a group of non-equidistant sampling modes is taken as an example in this step for explanation, and includes:
as shown in fig. 3, fig. 3 is a schematic diagram of a method for predicting a preset angle in a first intra-frame prediction mode according to an embodiment of the present invention; for sampling 1, predicting 45-degree pixel points, 90-degree pixel points and 135-degree pixel points of sampling pixels in an adjacent image macro block right above a current image macro block respectively, namely predicting preset angles of 135 degrees, 45 degrees and 90 degrees, and respectively solving prediction residuals of all sampling pixels under prediction of the three preset angles. The prediction residual error of all sampling pixels under the prediction of the preset angle can be solved by subtracting the pixel points of the preset angle from the sampling pixels. And respectively calculating the sum of absolute values of prediction residuals of all sampling pixels under each type of preset angle prediction, selecting one type of preset angle prediction corresponding to the absolute value and the minimum value of the prediction residuals as a final preset angle prediction of a group of sampling pixels of the current image macro block, and using the prediction residuals corresponding to the final preset angle prediction as a group of first prediction residuals corresponding to the group of sampling pixels.
Multiple sets of first prediction residuals corresponding to multiple sets of sampling pixels in each image macroblock can be obtained in the above manner.
Preferably, the prediction mode can be any combination of 135-degree prediction, 45-degree prediction and 90-degree prediction.
Predicting a plurality of groups of non-sampling pixels corresponding to the plurality of groups of sampling pixels in each image macro block by using a preset formula to respectively obtain a plurality of groups of second prediction residuals of the plurality of groups of non-sampling pixels corresponding to the plurality of groups of sampling pixels in each image macro block;
specifically, a group of non-sampled pixels in each image macroblock uses a preset formula to solve the prediction residual of the non-sampled pixels, where the preset formula is as follows:
Resi=(sample1-sample0)*(i+1)/(num+1)
sample0 and sample1 are pixel component reconstruction values of consecutive sampled pixels in a current image macroblock, i is an index of a non-sampled pixel in the current image macroblock, and num is the number of the non-sampled pixels.
According to the preset formula, a plurality of groups of second prediction residuals of a plurality of groups of non-sampled pixels in each image macro block can be solved.
Respectively carrying out absolute value sum operation on each group of first prediction residual errors and each group of corresponding second prediction residual errors to obtain a plurality of groups of absolute value sums corresponding to each pixel in each image macro block; carrying out absolute value sum operation on a group of first prediction residual errors under a group of sampling pixels in each image macro block and a group of second prediction residual errors under a corresponding group of non-sampling pixels to obtain a group of absolute value sums corresponding to each pixel in each image macro block; further, multiple sets of absolute value sums corresponding to each pixel in each image macroblock may be sequentially obtained.
And selecting a group of first prediction residuals and second prediction residuals corresponding to a group of absolute values and minimum values as first prediction values of all pixels in each image macro block.
In the step, a sampling mode of the image macro block and a reference mode of pixel angle prediction are defined, and the sum of the prediction residual error and the absolute value of the residual error of the current image macro block is calculated. Compared with the prior art, when the texture of the image to be compressed is complex, the prediction residual error is obtained by the texture characteristics of the current macro block according to the gradual change principle of the texture for the macro block at the texture boundary of the current image without depending on the peripheral macro blocks of the current macro block, so that the precision of solving the prediction residual error value for the complex texture area can be improved, the theoretical limit entropy is further reduced, and the bandwidth compression ratio is increased.
Step 4, dividing each image macro block into a plurality of image sub macro blocks;
as shown in fig. 4a to 4c, fig. 4a to 4c are schematic diagrams illustrating different partition modes of a second intra prediction mode according to an embodiment of the present invention; dividing an image macro block according to different dividing modes, specifically, dividing the image macro block according to a horizontal dividing mode, and dividing the image macro block into an upper image sub macro block and a lower image sub macro block; dividing an image macro block into a left image sub macro block and a right image sub macro block according to a vertical division mode; and partitioning the image macro block in a non-partitioning mode.
Step 5, for each image macro block, determining a second predicted value of each pixel in each image macro block through a second intra-frame prediction mode based on the division mode of the plurality of image sub macro blocks; the method specifically comprises the following steps:
for the horizontal segmentation mode, subtracting the minimum value of the pixels of the upper image sub-macro block from all the pixels in the upper image sub-macro block to obtain the prediction residual errors of all the pixels of the upper image sub-macro block; the lower image sub-macro block is calculated in the same way, the minimum value of the pixels of the lower image sub-macro block is subtracted from all the pixels of the lower image sub-macro block to obtain the prediction residual errors of all the pixels of the lower image sub-macro block, and finally a group of third prediction residual errors of all the pixels of the image macro block in a horizontal segmentation mode are obtained; for the vertical segmentation mode, subtracting the minimum value of the pixels of the left image sub-macro block from all the pixels in the left image sub-macro block to obtain the prediction residual errors of all the pixels of the left image sub-macro block; the right image sub-macro block is calculated in the same way, the minimum value of the pixels of the right image sub-macro block is subtracted from all the pixels in the right image sub-macro block to obtain the prediction residual errors of all the pixels of the right image sub-macro block, and finally a group of third prediction residual errors of all the pixels of the image macro block in a vertical partition mode are obtained; and for the non-segmentation mode, subtracting the minimum value of the pixels in the image macro block from the pixels in the image macro block to finally obtain a group of third prediction residuals of all the pixels of the image macro block in the non-segmentation mode.
For a horizontal segmentation mode, calculating a first difference value between a maximum value of pixels in the upper image sub-macroblock and a minimum value of pixels in the upper image sub-macroblock to obtain a first minimum bit number representing the first difference value, calculating a second difference value between a maximum value of pixels in the lower image sub-macroblock and a minimum value of pixels in the lower image sub-macroblock to obtain a second minimum bit number representing the second difference value, and obtaining the first bit number according to the first minimum bit number, the second minimum bit number and a bit depth of original data of the image macroblock, wherein the first bit number satisfies the following formula:
MBIT1=N1*BIT_MIN1+N2*BIT_MIN2+2*BITDEPTH
where MBIT1 is the first number of BITs, BIT _ MIN1 is the first minimum number of BITs, N × BIT _ MIN2 is the second minimum number of BITs, bittemp is the original data BIT depth of the image macroblock, N1 is the number of pixels in the upper image sub-macroblock, and N2 is the number of pixels in the lower image sub-macroblock.
For a vertical partition mode, calculating a third difference value between a maximum value of a pixel in the left image sub-macroblock and a minimum value of a pixel in the left image sub-macroblock to obtain a third minimum bit number representing the third difference value, calculating a fourth difference value between a maximum value of a pixel in the right image sub-macroblock and a minimum value of a pixel in the right image sub-macroblock to obtain a fourth minimum bit number representing the fourth difference value, and obtaining the second bit number according to the third minimum bit number, the fourth minimum bit number and a bit depth of original data of the image macroblock, wherein the second bit number satisfies:
MBIT2=N3*BIT_MIN3+N4*BIT_MIN4+2*BITDETH
wherein, MBIT2 is the second BIT number, BIT _ MIN3 is the third minimum BIT number, BIT _ MIN4 is the fourth minimum BIT number, BITDEPTH is the original data BIT depth of the image macroblock, N3 is the number of pixels in the left image sub-macroblock, and N4 is the number of pixels in the right image sub-macroblock.
For the non-segmentation mode, calculating a fifth difference value between the maximum value of the pixels in the image macro block and the minimum value of the pixels in the image macro block to obtain a fifth minimum bit number representing the fifth difference value, and obtaining a third bit number according to the fifth minimum bit number and the bit depth of the original data of the image macro block, where the third bit number satisfies:
MBIT3=M*BIT_MIN5+2*BITDETH
where MBIT3 is the third BIT number, BIT _ MIN5 is the fifth minimum BIT number, BITDEPTH is the original data BIT depth of the image macroblock, and M is the number of pixels in the image macroblock.
Selecting a segmentation mode according to the different prediction residuals and the different bit numbers, specifically, for a horizontal segmentation mode, obtaining a group of first reconstruction values of an image macro block according to a group of third prediction residuals of all pixels of the image macro block in the horizontal segmentation mode, obtaining a first reconstruction difference value by summing absolute values of differences between the group of first reconstruction values and original pixel values in the image macro block, and weighting the first reconstruction difference value and a first bit number to obtain a first weighting value of the image macro block in the horizontal segmentation mode, wherein the first weighting value satisfies the following formula:
RDO1=b1*MBIT1+b2*RES1
the RDO1 is the first weighted value, the MBIT1 is the first bit number, RES1 is the first reconstruction difference value, and b1 and b2 are weighting coefficients. The values of a and b may be preset fixed values, further, a + b is 1, preferably, a may be selected to be 0.5, b may be selected to be 0.5, and a and b may also be flexibly adjusted in size.
Further, a reconstructed value can be obtained according to the prediction residual, that is, a reconstructed value can be obtained by adding the reference value (the minimum value of each image macro block pixel) to the prediction residual.
For a vertical segmentation mode, obtaining a group of second reconstruction values of an image macro block according to a group of third prediction residuals of all pixels of the image macro block in the vertical segmentation mode, obtaining a second reconstruction difference value by summing absolute values of differences between the group of second reconstruction values and original pixel values in the image macro block, and weighting the second reconstruction difference value and the second bit number to obtain a second weighted value of the image macro block in the vertical segmentation mode, wherein the second weighted value satisfies the following formula:
RDO2=b3*MBIT2+b4*RES2
and the RDO2 is the second weighted value, the MBIT2 is the second bit number, the RES2 is the second reconstruction difference value, and b3 and b4 are weighting coefficients. The values of a and b may be preset fixed values, further, a + b is 1, preferably, a may be selected to be 0.5, b may be selected to be 0.5, and a and b may also be flexibly adjusted in size.
For the non-division mode, obtaining a group of third reconstruction values of the image macro block according to a group of third prediction residuals of all pixels of the image macro block in the non-division mode, obtaining a third reconstruction difference value by summing absolute values of differences between the group of third reconstruction values and original pixel values in the image macro block, and weighting the third reconstruction difference value and the third bit number to obtain a third weighted value of the image macro block in the non-division mode, wherein the third weighted value satisfies the following formula;
RDO3=b5*MBIT3+b6*RES3
and the RDO3 is the third weighted value, the MBIT3 is the third bit number, the RES3 is the third reconstruction difference value, and b5 and b6 are weighting coefficients. The values of a and b may be preset fixed values, further, a + b is 1, preferably, a may be selected to be 0.5, b may be selected to be 0.5, and a and b may also be flexibly adjusted in size.
And selecting the segmentation mode corresponding to the minimum value of the first weighted value, the second weighted value and the third weighted value as a final segmentation mode.
And taking a group of third prediction residuals corresponding to the final segmentation mode as second prediction values of all pixels in each image macro block.
The algorithm of the step is utilized to predict through the correlation among the pixel values of the current region, the compressed data amount of three conditions of horizontal segmentation, vertical segmentation and non-segmentation is compared, and the corresponding optimal segmentation mode is selected to perform residual prediction, so that the difference between the initial image macro block and the predicted image macro block is minimized, the compression efficiency is improved, the subjective picture quality is improved, and when complex texture images are processed, the prediction effect is good, the processing efficiency is high, and the theoretical limit entropy can be reduced.
Step 6, determining a final intra prediction mode of each image macro block according to the first prediction value and the second prediction value, specifically comprising:
the Sum of Absolute Differences (SAD) and Sum of Differences (SD) for each intra prediction mode are calculated as shown in the following formula:
Figure BDA0001843786490000131
Figure BDA0001843786490000132
res is the predicted value of each pixel in the current image macro block, ABS is the absolute value, and m x n is the number of pixels in the current image macro block.
Finally, according to the SAD and SD situations, weight coefficients a1 and a2 are configured according to different image scenes, and a residual difference (SUBD) is calculated as shown in the following formula:
SUBD=a1×SAD+a2×SD
and calculating the residual subjective sum under the first intra-frame prediction mode and the second intra-frame prediction mode by using the formula according to the first prediction value and the second prediction value.
If the scene is continuous multiframe and has conduction effect, such as H246 reference value compression, a2 is larger, and a1 is smaller; conversely, a1 is larger and a2 is smaller; further, a1+ a2 may be set to 1.
And selecting a prediction mode corresponding to the minimum value of the residual subjective sum as a final intra-frame prediction mode of the current image macro block, and calculating by adopting the mode to obtain a prediction residual as a final prediction residual.
Wherein, after step 6, the method may further include transmitting an additional flag bit of a final prediction mode of the current image macroblock and a final prediction residual in the code stream
Example two
In this embodiment, a detailed description is given to an image intra prediction apparatus proposed by the present invention on the basis of the above-mentioned embodiment, as shown in fig. 5, fig. 5 is a schematic diagram of an image intra prediction apparatus provided by an embodiment of the present invention, and the apparatus includes:
a dividing module 11, configured to divide a current image frame into a plurality of image macroblocks;
the sampling module 12 is connected to the dividing module 11 and configured to sample pixels in each image macroblock to obtain sampled pixels;
a first intra-frame prediction module 13, connected to the sampling module 12, configured to determine, for each image macroblock, a first predicted value of each pixel in each image macroblock by a first intra-frame prediction manner based on the sampled pixel in each image macroblock;
a dividing module 14, connected to the dividing module 11, for dividing each image macro block into a plurality of image sub macro blocks;
a second intra-frame prediction module 15, connected to the segmentation module 14, configured to determine, for each image macroblock, a second predicted value of each pixel in each image macroblock according to a second intra-frame prediction manner based on the segmentation manner of the plurality of image sub-macroblocks;
a determining module 16, connected to the first intra prediction module 13 and the second intra prediction module 15, configured to determine a final intra prediction mode of each image macroblock according to the first predicted value and the second predicted value.
The sampling module is specifically configured to perform multiple sets of non-equidistant sampling on pixels in each image macroblock to obtain corresponding multiple sets of sampled pixels.
Wherein the first intra prediction module is specifically configured to:
performing preset angle prediction on the multiple groups of sampling pixels in each image macro block to respectively obtain multiple groups of first prediction residuals corresponding to the multiple groups of sampling pixels in each image macro block;
predicting a plurality of groups of non-sampling pixels corresponding to the plurality of groups of sampling pixels in each image macro block by using a preset formula to respectively obtain a plurality of groups of second prediction residuals of the plurality of groups of non-sampling pixels corresponding to the plurality of groups of sampling pixels in each image macro block;
respectively carrying out absolute value sum operation on each group of first prediction residual errors and each group of corresponding second prediction residual errors to obtain a plurality of groups of absolute value sums corresponding to each pixel in each image macro block;
selecting a group of first prediction residual errors and second prediction residual errors corresponding to a group of absolute values and minimum values
As the first prediction residual for each pixel in said each image macroblock.
The dividing module is specifically configured to divide each image macroblock into a plurality of image sub-macroblocks by using a plurality of dividing manners; the multiple segmentation modes comprise a horizontal segmentation mode, a vertical segmentation mode and a non-segmentation mode.
Wherein the second intra prediction module is specifically configured to:
respectively calculating each group of third prediction residual errors and the number of bits corresponding to each image macro block under each segmentation mode;
selecting a final segmentation mode of each image macro block according to each group of third prediction residuals and the bit number;
and taking a group of third prediction residuals corresponding to the final segmentation mode as second prediction values of all pixels in each image macro block.
In summary, the present invention has been explained by using specific examples, and the above description of the embodiments is only used to help understanding the method and the core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention, and the scope of the present invention should be subject to the appended claims.

Claims (6)

1. An image intra prediction method, comprising:
dividing a current image frame into a plurality of image macro blocks;
carrying out multiple groups of non-equidistant sampling on pixels in each image macro block to obtain corresponding multiple groups of sampling pixels; for each image macro block, determining a first predicted value of each pixel in each image macro block through a first intra prediction mode based on the sampling pixel in each image macro block, including: performing preset angle prediction on the multiple groups of sampling pixels in each image macro block to respectively obtain multiple groups of first prediction residuals corresponding to the multiple groups of sampling pixels in each image macro block; predicting a plurality of groups of non-sampling pixels corresponding to the plurality of groups of sampling pixels in each image macro block by using a preset formula to respectively obtain a plurality of groups of second prediction residuals of the plurality of groups of non-sampling pixels corresponding to the plurality of groups of sampling pixels in each image macro block;and solving the prediction residual error of the non-sampled pixels by using the preset formula, wherein the preset formula is as follows: resi(sample1-sample0) × (i +1)/(num + 1); sample0 and sample1 are pixel component reconstruction values of consecutive sampled pixels in the current image macroblock, i is an index of non-sampled pixels in the current image macroblock, and num is the number of non-sampled pixels; carrying out absolute value sum operation on a group of first prediction residual errors under a group of sampling pixels in each image macro block and a group of second prediction residual errors under a corresponding group of non-sampling pixels to obtain a group of absolute value sums corresponding to each pixel in each image macro block, and sequentially obtaining a plurality of groups of absolute value sums corresponding to each pixel in each image macro block; selecting a group of first prediction residuals and second prediction residuals corresponding to a group of absolute values and minimum values as first prediction residuals of each pixel in each image macro block;
dividing each image macro block into a plurality of image sub macro blocks;
for each image macro block, determining a second predicted value of each pixel in each image macro block through a second intra-frame prediction mode based on the division mode of the plurality of image sub-macro blocks;
and determining the final intra-frame prediction mode of each image macro block according to the first prediction value and the second prediction value.
2. The method of claim 1, wherein partitioning each image macroblock into a plurality of image sub-macroblocks comprises:
dividing each image macro block into a plurality of image sub macro blocks by utilizing a plurality of dividing modes; the multiple segmentation modes comprise a horizontal segmentation mode, a vertical segmentation mode and a non-segmentation mode.
3. The method according to claim 2, wherein determining the second predicted value of each pixel in each image macroblock by a second intra prediction mode comprises:
respectively calculating each group of third prediction residual errors and the number of bits corresponding to each image macro block under each segmentation mode;
selecting a final segmentation mode of each image macro block according to each group of third prediction residuals and the bit number;
and taking a group of third prediction residuals corresponding to the final segmentation mode as second prediction values of all pixels in each image macro block.
4. An image intra prediction apparatus, comprising:
the dividing module is used for dividing the current image frame into a plurality of image macro blocks;
the sampling module is connected with the dividing module and is used for carrying out multi-group non-equidistant sampling on the pixels in each image macro block to obtain a plurality of groups of corresponding sampling pixels;
a first intra-prediction module, connected to the sampling module, configured to determine, for each image macroblock, a first predicted value of each pixel in each image macroblock through a first intra-prediction manner based on the sampled pixel in each image macroblock, where the first intra-prediction module includes: performing preset angle prediction on the multiple groups of sampling pixels in each image macro block to respectively obtain multiple groups of first prediction residuals corresponding to the multiple groups of sampling pixels in each image macro block;
predicting a plurality of groups of non-sampling pixels corresponding to the plurality of groups of sampling pixels in each image macro block by using a preset formula to respectively obtain a plurality of groups of second prediction residuals of the plurality of groups of non-sampling pixels corresponding to the plurality of groups of sampling pixels in each image macro block; and solving the prediction residual error of the non-sampled pixels by using the preset formula, wherein the preset formula is as follows: resi(sample1-sample0) × (i +1)/(num + 1); sample0 and sample1 are pixel component reconstruction values of consecutive sampled pixels in the current image macroblock, i is an index of non-sampled pixels in the current image macroblock, and num is the number of non-sampled pixels; performing absolute prediction on a group of first prediction residuals under a group of sampling pixels and a group of second prediction residuals under a corresponding group of non-sampling pixels in each image macro blockThe value sum operation obtains a group of absolute value sums corresponding to each pixel in each image macro block, and sequentially obtains a plurality of groups of absolute value sums corresponding to each pixel in each image macro block; selecting a group of first prediction residuals and second prediction residuals corresponding to a group of absolute values and minimum values as first prediction residuals of each pixel in each image macro block;
the dividing module is connected with the dividing module and used for dividing each image macro block into a plurality of image sub macro blocks;
a second intra-frame prediction module, connected to the partitioning module, configured to determine, for each image macroblock, a second predicted value of each pixel in each image macroblock in a second intra-frame prediction manner based on a partitioning manner of the plurality of image sub-macroblocks;
and the determining module is connected with the first intra-frame prediction module and the second intra-frame prediction module and is used for determining the final intra-frame prediction mode of each image macro block according to the first predicted value and the second predicted value.
5. The apparatus according to claim 4, wherein the partitioning module is specifically configured to partition each of the image macroblocks into a plurality of image sub-macroblocks by a plurality of partitioning manners; the multiple segmentation modes comprise a horizontal segmentation mode, a vertical segmentation mode and a non-segmentation mode.
6. The apparatus of claim 5, wherein the second intra-prediction module is specifically configured to:
respectively calculating each group of third prediction residual errors and the number of bits corresponding to each image macro block under each segmentation mode;
selecting a final segmentation mode of each image macro block according to each group of third prediction residuals and the bit number;
and taking a group of third prediction residuals corresponding to the final segmentation mode as second prediction values of all pixels in each image macro block.
CN201811260515.XA 2018-10-26 2018-10-26 Image intra-frame prediction method and device thereof Active CN109547791B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811260515.XA CN109547791B (en) 2018-10-26 2018-10-26 Image intra-frame prediction method and device thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811260515.XA CN109547791B (en) 2018-10-26 2018-10-26 Image intra-frame prediction method and device thereof

Publications (2)

Publication Number Publication Date
CN109547791A CN109547791A (en) 2019-03-29
CN109547791B true CN109547791B (en) 2020-12-22

Family

ID=65845735

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811260515.XA Active CN109547791B (en) 2018-10-26 2018-10-26 Image intra-frame prediction method and device thereof

Country Status (1)

Country Link
CN (1) CN109547791B (en)

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090268810A1 (en) * 2006-09-29 2009-10-29 Congxia Dai Geometric intra prediction
US20110310966A1 (en) * 2010-06-18 2011-12-22 Texas Instruments Incorporated Syntax element decoding
CN107071428B (en) * 2011-06-23 2019-12-27 Jvc 建伍株式会社 Image encoding device and image encoding method
US20150043638A1 (en) * 2012-05-15 2015-02-12 Sony Corporation Image processing apparatus and image processing method
US20150103909A1 (en) * 2013-10-14 2015-04-16 Qualcomm Incorporated Multi-threaded video encoder
CN103618898B (en) * 2013-12-09 2017-01-25 中国计量学院 Complexity image lossless compression method supporting random access
CN108184117B (en) * 2018-01-10 2021-11-26 北京工业大学 Content-based bit stream layer video quality evaluation model

Also Published As

Publication number Publication date
CN109547791A (en) 2019-03-29

Similar Documents

Publication Publication Date Title
US9729881B2 (en) Video encoding/decoding apparatus and method
US8681873B2 (en) Data compression for video
KR100324610B1 (en) Image predictive decoding apparatus and method thereof
WO2018199459A1 (en) Image restoration machine learning algorithm using compression parameter, and image restoration method using same
US20110206118A1 (en) Data Compression for Video
JP2023519022A (en) Video decoding method and its video encoding method, apparatus, computer device and computer program
CN110944185B (en) Video decoding method and device, computer equipment and storage medium
EP2775718B1 (en) Method, device, and program for coding and decoding of images
KR20070005848A (en) Method and apparatus for intra prediction mode decision
CN112738511B (en) Fast mode decision method and device combined with video analysis
CN113994701A (en) Method and apparatus for motion field storage in video coding
CN115118976A (en) Image coding method, readable medium and electronic device thereof
CN109547788B (en) Image compression method, equipment and image transmission system
KR101911587B1 (en) Apparatus and method for video coding/decoding using adaptive intra prediction
CN109547791B (en) Image intra-frame prediction method and device thereof
CN109547780B (en) Image coding method and device
CN109302605B (en) Image coding method and device based on multi-core processor
US10764577B2 (en) Non-MPM mode coding for intra prediction in video coding
KR101247024B1 (en) Method of motion estimation and compensation using in-loop preprocessing filtering
KR20170122351A (en) Video coding method and apparatus using adaptive coding order according to direction of intra prediction
KR102020953B1 (en) Image Reencoding Method based on Decoding Data of Image of Camera and System thereof
CN111107353A (en) Video compression method and video compressor
CN109361924B (en) Image coding method and device
US20130170565A1 (en) Motion Estimation Complexity Reduction
CN109510985B (en) Video coding method and device thereof

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