Intra-frame prediction method and device, electronic equipment and readable storage medium
By using candidate filters that incorporate decoded and undecoded pixels, the method improves intra-frame prediction accuracy and efficiency by adapting to uneven image textures, overcoming the limitations of fixed reference methods.
Patent Information
- Application Number
- CN202310719342.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-16
- Publication Date
- 2024-12-17
- Estimated Expiration
- 2043-06-16
AI Technical Summary
Existing video coding technologies inaccurately predict pixel values using a fixed reference from the upper and left columns, which fails to account for uneven texture distributions in images, leading to inefficiencies in intra-frame prediction.
The method employs candidate filters that include decoded sample pixels and undecoded target pixels, allowing for flexible prediction based on reconstructed pixel templates to improve accuracy and efficiency by considering asymmetric texture distributions.
This approach enhances the accuracy and efficiency of intra-frame prediction by dynamically adjusting pixel predictions based on reconstructed pixel templates, effectively addressing the limitations of fixed reference methods.
Smart Images

Figure CN119155444A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of video coding and decoding technology, and specifically relates to an intra-frame prediction method, device, electronic device and readable storage medium. Background Art
[0002] The video encoder adopts a block-based hybrid coding framework. The coding process includes: block division, intra-frame prediction, inter-frame prediction, transformation, quantization, loop filtering and entropy coding. The encoder first divides the image into non-overlapping coding tree units (CTU), and then divides them into different coding units (CU) according to the quadtree. The encoder encodes each coding unit from top to bottom and from left to right, and the decoder also decodes each coding unit of the current frame in the same order. However, the image texture distribution is diverse. When the texture distribution above and to the left is different or uneven, the prediction value obtained by forcibly using the upper reference row and left reference column with the same distance from the current coding unit in the related technology is inaccurate. Summary of the invention
[0003] The embodiments of the present application provide an intra-frame prediction method, device, electronic device and readable storage medium, which can solve the problem of inaccurate prediction values obtained by forcibly using an upper reference row and a left reference column with the same distance as a current coding unit in the related art.
[0004] In a first aspect, an intra-frame prediction method is provided, which is performed by a decoding end and includes:
[0005] In a case where the prediction mode of the current coding unit is the target mode, the decoding end determines a target filter, wherein the target filter is one of at least one candidate filter, the candidate filter includes a sample pixel point and a target pixel point, the sample pixel point is a pixel point that has been decoded or has obtained a prediction value, the target pixel point is a pixel point that has not been decoded in the current coding unit, and the sample pixel point is located on the right side or the upper side of the target pixel point;
[0006] The decoding end obtains a reconstructed pixel template corresponding to the target filter;
[0007] The decoding end determines the coefficients of the target filter based on the reconstructed pixel template;
[0008] The decoding end calculates a prediction value of the current coding unit based on coefficients of the target filter.
[0009] In a second aspect, an intra-frame prediction method is provided, which is performed by an encoding end and includes:
[0010] When the prediction mode of the current coding unit is the target mode, the encoding end determines at least one candidate filter, wherein the candidate filter includes a sample pixel point and a target pixel point, the sample pixel point is a pixel point that has been encoded or has obtained a prediction value, the target pixel point is a pixel point that has not been encoded in the current coding unit, and the sample pixel point is located on the right side or the upper side of the target pixel point;
[0011] The encoding end obtains a reconstructed pixel template corresponding to each of the at least one candidate filters;
[0012] The encoding end determines the coefficients corresponding to each of the at least one candidate filter based on the reconstructed pixel template;
[0013] The encoding end calculates the prediction value of the current coding unit according to the coefficients corresponding to each of the candidate filters, and determines a target filter according to the prediction value, where the target filter is one of the at least one candidate filter.
[0014] In a third aspect, an intra-frame prediction device is provided, including:
[0015] A first determination module is used to determine a target filter when the prediction mode of the current coding unit is a target mode, wherein the target filter is one of at least one candidate filter, the candidate filter includes a sample pixel point and a target pixel point, the sample pixel point is a pixel point that has been decoded or has obtained a prediction value, the target pixel point is a pixel point that has not been decoded in the current coding unit, and the sample pixel point is located on the right side or the upper side of the target pixel point;
[0016] A first acquisition module, used to acquire a reconstructed pixel template corresponding to the target filter;
[0017] A second determination module, configured to determine coefficients of the target filter based on the reconstructed pixel template;
[0018] The first calculation module is used to calculate the prediction value of the current coding unit based on the coefficient of the target filter.
[0019] In a fourth aspect, an intra-frame prediction device is provided, including:
[0020] a third determination module, configured to determine at least one candidate filter when the prediction mode of the current coding unit is the target mode, wherein the candidate filter includes a sample pixel point and a target pixel point, the sample pixel point is a pixel point that has been encoded or has obtained a prediction value, the target pixel point is a pixel point that has not been encoded in the current coding unit, and the sample pixel point is located on the right side or the upper side of the target pixel point;
[0021] A second acquisition module, used to acquire a reconstructed pixel template corresponding to each of the at least one candidate filters;
[0022] A fourth determination module, configured to determine coefficients corresponding to each of the at least one candidate filter based on the reconstructed pixel template;
[0023] The second calculation module is used to calculate the prediction value of the current coding unit according to the coefficients corresponding to each of the candidate filters, and determine the target filter according to the prediction value, where the target filter is one of the at least one candidate filter.
[0024] In a fifth aspect, an electronic device is provided, comprising a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the intra-frame prediction method described in the first aspect or the second aspect are implemented.
[0025] In a sixth aspect, a readable storage medium is provided, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented, or the steps of the method described in the second aspect are implemented.
[0026] In the seventh aspect, a chip is provided, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the method described in the first aspect, or to implement the method described in the second aspect.
[0027] In an eighth aspect, a computer program / program product is provided, wherein the computer program / program product is stored in a storage medium, and the program / program product is executed by at least one processor to implement the steps of the method described in the first aspect, or to implement the steps of the method described in the second aspect.
[0028] In an embodiment of the present application, a target filter includes sample pixels and target pixels, the sample pixels are decoded pixels, the target pixels are undecoded pixels in the current coding unit, the sample pixels are located on the right or upper side of the target pixels, that is, the undecoded pixels in the current coding unit are located on the right or upper side of the decoded sample pixels, and the current coding unit is predicted based on these sample pixels. This is different from the method in the related art of forcibly using the predicted values obtained by the upper reference row and the left reference column with the same distance as the current coding unit. In the embodiment of the present application, the distance between the sample pixels and the pixels to be predicted in the current coding unit is not limited, which takes into account the asymmetric and uneven texture distribution in the video image, and effectively improves the accuracy of intra-frame prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1a Schematic diagram of three positions of the reconstructed pixel area and the current coding unit in the related art;
[0030] Figure 1b Schematic diagram of three filters of different shapes in the related art;
[0031] Figure 2 is a flowchart of an intra-frame prediction method provided by an embodiment of the present application;
[0032] Figure 3 is one of the schematic diagrams of three candidate filters of different shapes applicable in the embodiments of the present application;
[0033] Figure 4 Schematic diagrams of three positions of the reconstructed pixel template and the current coding unit applicable in the embodiments of the present application;
[0034] Figure 5 This is the second schematic diagram of three candidate filters of different shapes applicable in the embodiments of the present application;
[0035] Figure 6 is a flowchart of another intra-frame prediction method provided by an embodiment of the present application;
[0036] Figure 7 is a structural diagram of an intra-frame prediction device provided in an embodiment of the present application;
[0037] Figure 8 is a structural diagram of another intra-frame prediction device provided in an embodiment of the present application;
[0038] Fig. 9 is a structural diagram of an electronic device provided in an embodiment of the present application;
[0039] Fig.10 It is a structural diagram of a terminal provided in an embodiment of the present application. DETAILED DESCRIPTION
[0040] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field belong to the scope of protection of this application.
[0041] The terms "first", "second", etc. of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the terms used in this way are interchangeable where appropriate, so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first" and "second" are generally of one type, and the number of objects is not limited, for example, the first object can be one or more. In addition, "or" in the present application represents at least one of the connected objects. For example, "A or B" covers three schemes, namely, Scheme 1: including A but not including B; Scheme 2: including B but not including A; Scheme 3: including both A and B. The character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0042] For better understanding, the related concepts that may be involved in the embodiments of the present application are explained below.
[0043] At present, the encoder adopts intra-frame prediction technology based on image texture correlation, taking the reconstructed samples of the upper row and left column adjacent to the current coding unit as reference, and traversing the DC mode, Planar mode and angular prediction mode, and selecting the optimal intra-frame prediction mode using the rate-distortion cost to remove the spatial redundancy of the block.
[0044] In the related art, at the encoding end, an implementation step of an extrapolation filter-based intra prediction mode (EIP) is as follows:
[0045] 1. Get Figure 1a The reconstructed pixel area above and / or to the left of the current coding unit (also called prediction unit, PU) shown in FIG. Figure 1b The 15-tap filter coefficients of the three shapes shown in the figure can be calculated by the same method as that of calculating the filter coefficients in the convolutional cross-component intra prediction model (CCCM) in the existing enhanced compression model (ECM). Figure 1b For example, specifically:
[0046] The filter coefficients are calculated by minimizing the mean-square error (MSE) between white and gray samples in the reconstructed pixel area. MSE minimization is performed by calculating the autocorrelation matrix with the reconstructed values of the 15 gray sample points as input, and the cross-correlation vector between the 15 gray input sample points and 1 white output sample point. The autocorrelation matrix is LDL-decomposed and the final filter coefficients are calculated using inverse permutation.
[0047] 2. Use separately Figure 1b The three shapes of extrapolation filters shown are used to calculate the prediction value of each sample point from left to right and from top to bottom starting from the first sample point in the upper left corner of the current coding unit; Figure 1b In the figure, the value of the gray sample point is the input of the EIP model, and the white sample point in the lower right corner is the output of the EIP model, that is, the predicted value to be obtained;
[0048] 3. Calculate the prediction value of the current coding unit obtained by using the three shapes of extrapolation filters in the EIP mode, and then calculate the rate-distortion cost, and compare it with the rate-distortion cost of other prediction modes. If the rate-distortion cost of the EIP mode is the smallest, the EIP mode identification information is set to 1, and written into the bitstream together with the selected filter (that is, one of the three filters shown in 1b) index information.
[0049] After obtaining that the current coding unit to be decoded is in EIP mode, the decoder parses the index value of the selected filter. The filter coefficient is obtained by using the decoded reconstructed pixel values above and / or to the left of the current coding unit to be decoded in the same manner as the encoder, and then the prediction value of each sample point in the current coding unit is calculated from top to bottom and from left to right, and the residual value calculated from the residual information of the current coding unit obtained from the bitstream is added to obtain the reconstructed value.
[0050] However, image texture distribution is diverse. When the texture distribution above and to the left is different or uneven, the prediction value obtained by forcibly using the upper reference row and left reference column with the same distance to the current coding unit in the related art is inaccurate. The present application embodiment proposes a new intra-frame prediction method.
[0051] The following is a detailed description of the intra-frame prediction method, apparatus and related equipment provided by the embodiments of the present application through some embodiments and their application scenarios in combination with the accompanying drawings.
[0052] Please refer to Figure 2 , Figure 2 1 is a flowchart of an intra-frame prediction method provided by an embodiment of the present application, and the method is applied to a decoding end. Figure 2As shown, the method comprises the following steps:
[0053] Step 201: When the prediction mode of the current coding unit is the target mode, the decoding end determines a target filter.
[0054] Among them, the target filter is one of at least one candidate filter, the candidate filter includes sample pixel points and target pixel points, the sample pixel points are pixel points that have been decoded or have obtained predicted values, the target pixel points are undecoded pixel points in the current coding unit, and the sample pixel points are located on the right side or above the target pixel points.
[0055] For example, Figure 3 As shown, Figure 3 Figures 1 and 2 show three candidate filters of different shapes (a), (b), and (c), respectively, where each gray box represents a sample pixel, and the white box represents a target pixel. The target pixel is also the undecoded pixel in the current coding unit. The sample pixel is the pixel in the image frame that has been decoded or has obtained a predicted value, and the sample pixel is located on the right or upper side of the target pixel. Figure 3 In the three candidate filters shown in , the sample pixel is located on the right and upper side of the target pixel, that is, the target pixel is located at the lower left corner of the sample pixel. It should be noted that the above are only three possible candidate filter forms in the embodiment of the present application, but are not limited to this. The candidate filters provided in the embodiment of the present application can also be in other possible forms.
[0056] In the embodiment of the present application, the target filter is one of the candidate filters, that is, the target filter also includes sample pixels and target pixels.
[0057] Among them, the target pixel point is the undecoded pixel point in the current coding unit, the sample pixel point is the pixel point that has been decoded or has obtained the predicted value, that is, the sample pixel point is the pixel point located on the upper side or right side of the sample point to be predicted in the current coding unit, and the target filter can be moved with the number of target pixels as the step size. For example, if the number of target pixels is one, the decoding end decodes a pixel point in the current coding unit each time, and decodes and predicts the pixels of the current coding unit one by one in turn. For example, the first pixel point on the right side of the top row of the current coding unit can be decoded first, and the target pixel point in the target filter is also the first pixel point. When the first pixel point is decoded, the second pixel point on the right side of the top row of the current coding unit is decoded. At this time, the target pixel point in the target filter is also the second pixel point. At this time, the target filter is moved to the right as a whole by a step size of one pixel point, and the sample pixel point is also changed. In this way, the decoding end can obtain the predicted value of each pixel point in the current coding unit based on this method.
[0058] In an embodiment of the present application, the target mode may be a certain specific intra-frame prediction mode, such as an EIP mode, or other intra-frame prediction modes. Exemplarily, the target mode may be an intra-frame prediction mode agreed upon by the decoding end and the encoding end, or may be an intra-frame prediction mode determined by the decoding end through information in the bitstream.
[0059] Optionally, before step 201, the method may further include:
[0060] The decoding end obtains the intra-frame prediction mode index information of the current coding unit from the bit stream;
[0061] The decoding end determines whether the prediction mode of the current coding unit is the target mode based on the intra-frame prediction mode index information.
[0062] It should be noted that the code stream sent by the encoder to the decoder includes intra-frame prediction mode index information, which is used to characterize the intra-frame prediction mode used by the encoder. The decoder can determine which intra-frame prediction mode is used by the encoder based on the intra-frame prediction mode index information, and can also determine whether the intra-frame prediction mode used is the target mode, so that the decoder can use the same intra-frame prediction mode as the encoder to decode the current coding unit, so as to ensure that the decoder can obtain a prediction value consistent with the encoder.
[0063] Exemplarily, taking the EIP mode as the target mode, if the intra-frame prediction mode used by the encoding end is the EIP mode, the intra-frame prediction mode index information is identified as 1; if the encoding end does not use the EIP mode, the intra-frame prediction mode index information may be identified as 0, or an identifier corresponding to other intra-frame prediction modes; the encoding end writes the intra-frame prediction mode index information into the bitstream and sends it to the decoding end, and then the decoding end can determine whether the prediction mode for the current coding unit is the EIP mode by identifying whether the intra-frame prediction mode index information is 1.
[0064] In the embodiment of the present application, the target filter is one of the candidate filters, and the decoding end randomly selects one from the candidate filters as the target filter, or the target filter may be determined based on information obtained from the bitstream.
[0065] Optionally, the decoding end determines the target filter, including:
[0066] The decoding end obtains the filter index information of the current coding unit from the bit stream;
[0067] The decoding end determines a filter corresponding to the filter index information among the at least one candidate filter as a target filter.
[0068] In the embodiment of the present application, there may be multiple candidate filters, and the encoder may select one of them as the target filter, and encode the current coding unit based on the target filter. The encoder may write filter index information in the bitstream sent to the decoder, and the filter index information is used to characterize the target filter used by the encoder, and then the decoder can determine which target filter is used by the encoder based on the filter index information in the bitstream, so as to use the same target filter as the encoder to decode the current coding unit, so as to ensure that the decoder can obtain the prediction value consistent with the encoder.
[0069] It should be noted that the encoding end and the decoding end may pre-agreed on the filter index information corresponding to different candidate filters, for example, the filter index information corresponding to candidate filter 1 is identified as 1, the filter index information corresponding to candidate filter 2 is identified as 2, etc. Furthermore, the decoding end can determine the corresponding candidate filter based on the identification of the filter index information, and use the candidate filter as the target filter to decode the current coding unit.
[0070] Step 202: The decoding end obtains a reconstructed pixel template corresponding to the target filter.
[0071] Optionally, different candidate filters may correspond to different reconstructed pixel templates. Figure 3 Take the three candidate filters shown in as examples, these three candidate filters correspond to three different reconstructed pixel templates, where Figure 3 The candidate filter (a) corresponds to Figure 4 The reconstructed pixel template shown in (c) is a template composed of decoded reconstructed pixels on the upper and right sides of the current coding unit corresponding to the candidate filter; Figure 3 The candidate filter (b) corresponds to Figure 4 The reconstructed pixel template shown in (a) is a template composed of the decoded reconstructed pixels on the upper side of the current coding unit corresponding to the candidate filter; Figure 3 The candidate filter (c) corresponds to Figure 4 The reconstructed pixel template shown in (b) is a template composed of the decoded reconstructed pixels on the right side of the current coding unit corresponding to the candidate filter.
[0072] In the embodiment of the present application, after the decoding end determines the target filter, that is, a candidate filter, it can also obtain the corresponding reconstructed pixel template. It should be noted that the corresponding relationship between the candidate filter and the reconstructed pixel template can be established in advance. Figure 3 and Figure 4 The forms of the candidate filters and the reconstructed pixel templates and the correspondence between the two shown in the figure are merely illustrative and do not constitute a limitation on the embodiments of the present application. The forms of the candidate filters and the reconstructed pixel templates and the correspondence between the two in the embodiments of the present application may also be other possible situations.
[0073] Step 203: The decoding end determines the coefficients of the target filter based on the reconstructed pixel template.
[0074] It should be noted that after the decoding end determines the reconstructed pixel template corresponding to the target filter, it can calculate the coefficient of the target filter based on the reconstructed pixel template. The calculation method can refer to the relevant technology, for example, according to the method of calculating the filter coefficient in CCCM in ECM, which is not described in detail in the embodiment of the present application.
[0075] Step 204: The decoding end calculates a prediction value of the current coding unit based on the coefficients of the target filter.
[0076] After obtaining the coefficients of the target filter, the decoding end calculates the predicted value of each pixel point of the current coding unit based on the coefficients of the target filter.
[0077] For example, suppose the target filter is Figure 3 The filter shown in (a) in the figure, that is, the target pixel point therein is one, then the target filter can obtain the prediction value of one pixel point in the current coding unit each time, and the decoding end obtains the prediction value of each pixel point in each row of the current coding unit from right to left based on the target filter, wherein the prediction value of each pixel point in the first row is obtained first, and then the prediction value of each pixel point in the second row is obtained, and the prediction value of each pixel point in each row is obtained row by row from top to bottom. It can be understood that in the process of obtaining the prediction value of each pixel point in the current coding unit, the target pixel point and the sample pixel point in the target filter also change accordingly.
[0078] It should be noted that the number of coefficients of the target filter is the same as the number of sample pixels in the target filter. Figure 3Taking the filter shown in (a) as an example, the target filter includes 15 sample pixels, and the decoding end will obtain 15 filter coefficients. The decoding end can respectively calculate the product of the 15 filter coefficients and the reconstruction value or prediction value of the corresponding sample pixel points (the sample pixel points are the decoded reconstructed pixel points around the current coding unit, and their reconstruction values are known. The sample pixel points may also be the pixel points in the current coding unit that have obtained the prediction value through this method). That is, 15 products will be obtained. Based on these 15 products, the prediction value of the pixel point to be predicted in the current coding unit is determined. For example, the average value of these 15 products can be used as the prediction value of the pixel point to be predicted. Based on this method, the prediction value of each pixel point in the current coding unit can be obtained one by one.
[0079] Furthermore, the decoding end calculates the residual value of each pixel based on the residual information of each pixel of the current coding unit obtained from the bitstream, and adds the residual value of each pixel to the corresponding prediction value to obtain the reconstructed value of each pixel.
[0080] In an embodiment of the present application, the decoding end obtains the corresponding reconstructed pixel template based on the target filter, determines the coefficient of the target filter based on the reconstructed pixel template, and further calculates the predicted value of each pixel point in the current coding unit based on the coefficient of the target filter. Among them, the target filter includes sample pixels and target pixels, the sample pixels are pixels that have been decoded or have obtained predicted values, the target pixels are pixels that have not been decoded in the current coding unit (that is, pixels to be predicted), and the sample pixels are located on the right or upper side of the target pixels, that is, the undecoded pixels in the current coding unit are located on the right or upper side of the decoded sample pixels (which may be decoded reconstructed pixels outside the current coding unit, or sample points that have obtained predicted values inside the current coding unit). The current coding unit is predicted based on these sample pixels, which is different from the method in the related art that forcibly uses the predicted values obtained by the upper reference row and the left reference column with the same distance as the current coding unit. In the embodiment of the present application, the distance between the sample pixels and the pixels to be predicted in the current coding unit is not limited, which takes into account the asymmetric and uneven texture distribution in the video image, effectively improves the accuracy of intra-frame prediction, and also helps to improve decoding efficiency.
[0081] Optionally, the number of the target pixel is at least one. Figure 3 The three candidate filters shown in , each candidate filter includes one target pixel (ie, white box); Figure 5 The number of target pixels included in the candidate filter shown in (a) is 4, as shown in FIG. Figure 5 The number of target pixels included in the candidate filter shown in (b) is 8, as shown in FIG. Figure 5 The candidate filter shown in (c) includes 2 target pixels.
[0082] It should be noted that, when the number of target pixels is greater than one, the number of target pixels and the shape of the candidate filter may also be other possible forms. Figure 5 It does not constitute a limitation on the candidate filters in the embodiments of the present application.
[0083] Optionally, the number of target pixel points in the target filter is N, N is greater than or equal to 1, and the decoding end determines the coefficient of the target filter based on the reconstructed pixel template, including:
[0084] The decoding end determines N coefficient groups of the target filter based on the reconstructed pixel template, wherein each coefficient group includes M coefficients, the value of M is the same as the number of sample pixel points in the target filter, and M is a positive integer;
[0085] The decoding end determines the prediction value of the current coding unit based on the coefficient of the target filter, including:
[0086] The decoding end determines the prediction values of N undecoded pixels in the current coding unit based on the N coefficient groups of the target filter.
[0087] The coefficients are filter coefficients.
[0088] In the embodiment of the present application, the number of target pixels in the target filter may be one or more. For example, assuming that the target filter is Figure 3 The filter shown in , that is, the number of target pixels in the target filter is one, and the number of sample pixels is 15, that is, N=1, M=15, and the decoding end can predict the predicted value of an undecoded pixel (also called a pixel to be predicted) in the current coding unit each time. Specifically, the decoding end determines a coefficient group of the target filter based on the reconstructed pixel template corresponding to the target filter, and the coefficient group includes 15 filter coefficients. The decoding end obtains the predicted value of an undecoded pixel in the current coding unit based on the 15 filter coefficients. The undecoded pixel is also the target pixel in the target filter. Based on this method, the predicted value of each undecoded pixel in the current coding unit is obtained one by one. Among them, the specific implementation method of calculating the predicted value of the undecoded pixel based on the filter coefficient can refer to the relevant technology, for example, it can be to calculate the product of the 15 filter coefficients and the reconstructed value or predicted value of the corresponding sample pixel, and the average value of these products is used as the predicted value of the pixel to be predicted.
[0089] Alternatively, the target filter is Figure 5The filter shown in , that is, the number of target pixels in the target filter is greater than one, assuming that the target filter is Figure 5 The filter shown in (a) in the figure, that is, the number of target pixels in the target filter is 4, and the number of sample pixels is 12, that is, N=4, M=12, then the decoder can predict the predicted values of 4 undecoded pixels in the current coding unit each time. Specifically, the decoder determines the 4 coefficient groups of the target filter based on the reconstructed pixel template corresponding to the target filter, each coefficient group includes 12 filter coefficients, and the decoder calculates the predicted values of the 4 undecoded pixels in the current coding unit based on the 4 coefficient groups and the 12 filter coefficients in each group, that is, the decoder can obtain the predicted values of 4 undecoded pixels at the same time, which can effectively improve the decoding efficiency of the decoder.
[0090] It should be noted that when N is greater than 1, the decoding end can simultaneously determine the predicted values of N undecoded pixels in the current coding unit based on the N coefficient groups of the target filter and the M coefficients in each coefficient group. Specifically, the M coefficients in a coefficient group are used to calculate the predicted value of an undecoded pixel, and the N coefficient groups correspond to the predicted values of N undecoded pixels. The specific implementation method of calculating the predicted value of an undecoded pixel based on the M coefficients can refer to the previous description and will not be repeated here.
[0091] In an embodiment of the present application, the decoding end can determine N coefficient groups according to the N target pixel points in the target filter, and then calculate the predicted values of the N undecoded pixel points in the current coding unit based on these N coefficient groups and the M coefficients in each coefficient group, thereby effectively improving the decoding efficiency of the decoding end.
[0092] Optionally, the determining the prediction value of the current coding unit includes any one of the following:
[0093] When the number of target pixel points in the target filter is one, the decoding end calculates the prediction value of each undecoded pixel point in each row of the current coding unit row by row in a right-to-left order;
[0094] When the number of target pixels in the target filter is greater than one, the decoding end calculates the prediction value of each undecoded pixel in each row of the current coding unit row by row in a right-to-left or left-to-right order.
[0095] For example, if the number of target pixels in the target filter is one, such as Figure 3In this case, the decoding end can only obtain the prediction value of one undecoded pixel in the current coding unit at a time, and the current coding unit usually includes multiple rows × multiple columns of pixels. The decoding end can calculate the prediction value of each undecoded pixel in the current coding unit in order from right to left and from top to bottom, that is, first calculate the prediction value of each undecoded pixel in the first row from right to left, then calculate the prediction value of each undecoded pixel in the second row from right to left, and then calculate the prediction value of each undecoded pixel in the third row from right to left... In this way, the prediction value of each undecoded pixel in each row is calculated row by row from right to left, thereby completing the prediction of the current coding unit.
[0096] Alternatively, if the number of target pixels in the target filter is N, and N is greater than 1, such as Figure 5 The filter shown in , in this case, the decoding end can simultaneously obtain the predicted values of N undecoded pixels in the current coding unit each time, then the decoding end can be each row in the order from right to left or from left to right to calculate the predicted values of each undecoded pixel. For example, the predicted values of N undecoded pixels in the first row are calculated each time from right to left, after the prediction of the first row is completed, the predicted values of N undecoded pixels in the second row are calculated each time from right to left, after the prediction of the second row is completed, the predicted values of N undecoded pixels in the third row are calculated each time from right to left... In this way, the predicted values of each undecoded pixel in each row are calculated row by row from right to left, thereby completing the prediction of the current coding unit.
[0097] In an embodiment of the present application, the decoding end can calculate the predicted value of each undecoded pixel in the current coding unit in the order from the upper right to the lower left, thereby completing the prediction of the current coding unit. This is no longer limited to the decoding end only being able to predict pixels in the order from the upper left to the lower right, which effectively improves the flexibility of decoding, and can also reduce the dependence of the undecoded pixels in the current coding unit on the adjacent sample points on the left, which also helps to improve the accuracy of intra-frame prediction.
[0098] It should be noted that after obtaining the predicted value of each pixel, the decoding end calculates the residual value of each pixel based on the residual information of each pixel in the current coding unit obtained from the bitstream, and adds the residual value of each pixel to the corresponding predicted value to obtain the reconstructed value of each pixel.
[0099] For better understanding, the technical solution provided by this application is described below through two specific embodiments.
[0100] Embodiment 1
[0101] Step S11. The decoding end determines that the prediction mode of the current coding unit to be decoded is the EIP mode;
[0102] Step S12. The decoding end obtains the filter index information of the current coding unit from the bitstream, and determines the selected filter (ie, the target filter) according to the filter index information; the candidate filters in this embodiment are as follows: Figure 3 The three types shown in the figure are not limited to these, and the candidate filters can also have other shapes; it should be noted that the pixel point to be predicted ( Figure 3 The middle white box) is located at the lower left corner of the filter;
[0103] Step S13. The decoding end obtains a template composed of decoded reconstructed pixels according to the filter selected by the current coding unit to be decoded, and then calculates the coefficients of the selected filter. The calculation method can refer to the relevant technology; specifically, combined with Figure 3 and Figure 4 :
[0104] If the selected filter is Figure 3 (a), then use Figure 4 The template shown in (c);
[0105] If the selected filter is Figure 3 (b), then use Figure 4 The template shown in (a);
[0106] If the selected filter is Figure 3 (c), then use Figure 4 The template shown in (b);
[0107] Step S14. The decoding end calculates the predicted value of each pixel in the current coding unit to be decoded one by one in the order from right to left and from top to bottom according to the obtained filter coefficients, and adds it to the residual value obtained from the bit stream to obtain the reconstructed value of the current coding unit.
[0108] Embodiment 2
[0109] Step S21. The decoding end determines that the prediction mode of the current coding unit to be decoded is the EIP mode;
[0110] Step S22. The decoding end obtains the filter index information of the current coding unit from the bitstream, and determines the selected filter according to the filter index information; the candidate filters in this embodiment are as follows: Figure 5 There are three types shown in the figure, but they are not limited to these. Other shapes are also possible. It should be noted that the pixel to be predicted is located in the bottom row of the filter ( Figure 5 )
[0111] Step S23. The decoding end obtains a template composed of decoded reconstructed pixels according to the filter selected by the current coding unit to be decoded, and then calculates the coefficients of the selected filter. The calculation method can refer to the relevant technology; the difference between the relevant technology and the first embodiment is that the first embodiment and the relevant technology obtain a set of coefficients for each filter, and only obtain the predicted value of one pixel point each time; the present embodiment obtains N sets of coefficients for each filter, and N is equal to the width of the filter (such as Figure 5 The number of white boxes in the middle), use Figure 5 The gray sample points (gray boxes) in each filter are used to calculate the predicted values of each pixel in the bottom row; the advantage of this embodiment is that the dependency of the current pixel to be decoded on the sample points on the left in the same row can be reduced, and the predicted values of the pixels in N positions can be obtained at one time, which effectively improves the decoding efficiency;
[0112] Step S24. The decoding end calculates the predicted value of each pixel in the current coding unit to be decoded one by one from right to left (or from left to right) and from top to bottom according to the obtained filter coefficients, and adds the predicted value to the obtained residual value to obtain the reconstructed value of the current coding unit.
[0113] Please refer to Figure 6 , Figure 6 is a flowchart of another intra-frame prediction method provided by an embodiment of the present application, and the method is applied to the encoding end. Figure 6 As shown, the method comprises the following steps:
[0114] Step 601: When the prediction mode of the current coding unit is the target mode, the encoding end determines at least one candidate filter.
[0115] The candidate filter includes sample pixels and target pixels, the sample pixels are pixels that have been encoded or have obtained predicted values, the target pixels are pixels that have not been encoded in the current encoding unit, and the sample pixels are located on the right or upper side of the target pixels.
[0116] It should be noted that the target mode may be a certain intra-frame prediction mode, such as an EIP mode, or other intra-frame prediction modes. The encoding end may determine the intra-frame prediction mode by itself, such as determining it as the EIP mode.
[0117] Optionally, the shape of the candidate filter may be predetermined by the encoding end and the decoding end. For example, the candidate filter may be Figure 3 and Figure 5 The candidate filters may be specifically referred to the description in the above decoding end embodiment, which will not be described in detail here.
[0118] Step 602: The encoding end obtains a reconstructed pixel template corresponding to each of the at least one candidate filters;
[0119] Step 603: The encoding end determines coefficients corresponding to each of the at least one candidate filter based on the reconstructed pixel template;
[0120] Step 604: The encoding end calculates the prediction value of the current coding unit according to the coefficients corresponding to each of the candidate filters, and determines a target filter according to the prediction value, where the target filter is one of the at least one candidate filter.
[0121] Exemplarily, assuming that the number of candidate filters is L, the encoding end obtains the reconstructed pixel templates corresponding to the L candidate filters, and determines the coefficients of the candidate filters based on the reconstructed pixel templates corresponding to each candidate filter, that is, the coefficients corresponding to the L candidate filters are obtained; then, for each candidate filter, the prediction value of the current coding unit is calculated based on the coefficients of the candidate filter, and then the current coding unit will also correspond to L prediction values, and the target filter is determined based on these prediction values. For example, the average value of the L prediction values can be calculated, and the candidate filter corresponding to the prediction value closest to the average value is used as the target filter, and the prediction value corresponding to the target filter is used as the prediction value of the current coding unit to achieve encoding of the current coding unit.
[0122] In an embodiment of the present application, the encoding end calculates a prediction value of the current coding unit based on a candidate filter, wherein the candidate filter includes a sample pixel point and a target pixel point, the sample pixel point is an encoded pixel point, the target pixel point is an unencoded pixel point in the current coding unit, the sample pixel point is located on the right side or upper side of the target pixel point, that is, the unencoded pixel point in the current coding unit is located on the right side or upper side of the encoded sample pixel point, and the current coding unit is predicted based on these sample pixel points. This is different from the method in the related art of forcibly using the prediction value obtained by the upper reference row and the left reference column with the same distance as the current coding unit. In the embodiment of the present application, the distance between the sample pixel point and the pixel point to be predicted in the current coding unit is not limited, which takes into account the asymmetric and uneven texture distribution in the video image, effectively improves the accuracy of intra-frame prediction, and also helps to improve coding efficiency.
[0123] Optionally, the encoding end calculates the prediction value of the current coding unit according to the coefficient corresponding to each of the candidate filters, and determines the target filter according to the prediction value, including:
[0124] The encoding end calculates the prediction value of the current coding unit according to the coefficients corresponding to each of the candidate filters;
[0125] The encoding end determines a rate-distortion cost corresponding to each of the candidate filters according to the prediction value;
[0126] The encoding end determines the candidate filter with the smallest rate-distortion cost as the target filter.
[0127] For example, assuming that the number of candidate filters is L, for each candidate filter, the prediction value of the current coding unit is calculated based on the coefficient of the candidate filter, and then the current coding unit will also correspond to L prediction values, and the rate-distortion cost corresponding to each of the L prediction values is calculated, and the candidate filter corresponding to the prediction value with the smallest rate-distortion cost is determined as the target filter. In this way, the encoding end can implement the encoding of the current coding unit based on the target filter, and the rate-distortion cost of the target filter is the smallest, which can effectively ensure the accuracy of the encoding.
[0128] Optionally, the method further comprises:
[0129] The encoding end sends a code stream to the decoding end, the code stream carries filter index information, and the filter index information is used to indicate a target filter.
[0130] In the embodiment of the present application, each candidate filter may include a corresponding identifier, which may be known to both the encoding end and the decoding end. After determining the target filter, the encoding end may write the identifier corresponding to the target filter into the bitstream as filter index information, and then the decoding end can determine the target filter used by the encoding end based on the filter index information, so that the decoding end selects the same target filter for intra-frame prediction, thereby effectively ensuring that the encoding end and the decoding end can obtain consistent prediction values.
[0131] Optionally, the method further comprises:
[0132] The encoding end sends a code stream to the decoding end, where the code stream carries intra-frame prediction mode index information, and the intra-frame prediction mode index information is used to indicate that the intra-frame prediction mode used by the encoding end is the target mode.
[0133] It should be noted that the code stream sent by the encoder to the decoder includes intra-frame prediction mode index information, which is used to indicate that the intra-frame prediction mode used by the encoder is the target mode, so that the decoder can use the same intra-frame prediction mode as the encoder to decode the current coding unit to ensure that the decoder can obtain a prediction value consistent with the encoder.
[0134] Optionally, when the number of target pixels in the candidate filter is N, and N is greater than or equal to 1, the encoding end determines the coefficients corresponding to each of the at least one candidate filter based on the reconstructed pixel template, including:
[0135] The encoding end determines N coefficient groups corresponding to a first candidate filter based on the reconstructed pixel template, wherein each coefficient group includes M coefficients, the value of M is the same as the number of sample pixels in the first candidate filter, M is a positive integer, and the first candidate filter is one of the at least one candidate filter;
[0136] The encoding end calculates the prediction value of the current coding unit according to the coefficient corresponding to each of the candidate filters, including:
[0137] The encoding end determines the prediction values of N undecoded pixels in the current coding unit based on the N coefficient groups of the first candidate filter.
[0138] Optionally, the calculating the prediction value of the current coding unit includes any one of the following:
[0139] When the number of target pixels in the candidate filter is one, the encoding end calculates the prediction value of each uncoded pixel in each row of the current coding unit row by row in a right-to-left order;
[0140] When the number of target pixels in the candidate filter is greater than one, the encoding end calculates the prediction value of each uncoded pixel in each row of the current coding unit row by row in a right-to-left or left-to-right order.
[0141] In the embodiment of the present application, the specific implementation method of determining the coefficients of the candidate filter, determining the prediction value of the current coding unit based on the candidate filter coefficients, and calculating the prediction value of the current coding unit at the encoding end may be the same as that at the decoding end, and may refer to the above Figure 2 To avoid repetition, the description in the method embodiment will not be repeated here.
[0142] The intra-frame prediction method provided in the embodiment of the present application can be performed by an intra-frame prediction device. In the embodiment of the present application, the intra-frame prediction device performing intra-frame prediction is taken as an example to illustrate the intra-frame prediction device provided in the embodiment of the present application.
[0143] Please refer to Figure 7 , Figure 7 is a structural diagram of an intra-frame prediction device provided in an embodiment of the present application, and the device is applied to a decoding end. Figure 7 As shown, the intra-frame prediction device 700 includes:
[0144] A first determination module 701 is used to determine a target filter when the prediction mode of the current coding unit is the target mode, wherein the target filter is one of at least one candidate filter, the candidate filter includes a sample pixel point and a target pixel point, the sample pixel point is a pixel point that has been decoded or has obtained a prediction value, the target pixel point is a pixel point that has not been decoded in the current coding unit, and the sample pixel point is located on the right side or the upper side of the target pixel point;
[0145] A first acquisition module 702, used to acquire a reconstructed pixel template corresponding to the target filter;
[0146] A second determination module 703, configured to determine coefficients of the target filter based on the reconstructed pixel template;
[0147] The first calculation module 704 is used to calculate the prediction value of the current coding unit based on the coefficient of the target filter.
[0148] Optionally, the first determining module 701 is further configured to:
[0149] Acquire filter index information of the current coding unit from a bitstream;
[0150] A filter corresponding to the filter index information among the at least one candidate filter is determined as a target filter.
[0151] Optionally, the number of the target pixel points is at least one.
[0152] Optionally, when the number of target pixels in the target filter is N, and N is greater than or equal to 1, the second determining module 703 is further used to:
[0153] Determine N coefficient groups of the target filter based on the reconstructed pixel template, wherein each coefficient group includes M coefficients, the value of M is the same as the number of sample pixels in the target filter, and M is a positive integer;
[0154] The first calculation module 704 is further used for:
[0155] Determine predicted values of N undecoded pixels in the current coding unit based on the N coefficient groups of the target filter.
[0156] Optionally, the first calculation module 704 is further configured to perform any one of the following:
[0157] When the number of target pixel points in the target filter is one, calculating the prediction value of each undecoded pixel point in each row of the current coding unit row by row in a right-to-left order;
[0158] When the number of target pixels in the target filter is greater than one, the prediction value of each undecoded pixel in each row of the current coding unit is calculated row by row from right to left or from left to right.
[0159] Optionally, the first determining module 701 is further configured to:
[0160] Acquire the intra-frame prediction mode index information of the current coding unit from the bitstream;
[0161] Determine whether the prediction mode of the current coding unit is the target mode based on the intra prediction mode index information.
[0162] The solution provided in the embodiment of the present application is different from the method in the related art that forcibly uses the prediction value obtained by the upper reference row and the left reference column with the same distance as the current coding unit. The embodiment of the present application does not limit the distance between the sample pixel point and the pixel point to be predicted in the current coding unit, which takes into account the asymmetric and uneven texture distribution in the video image, and effectively improves the accuracy of intra-frame prediction.
[0163] The intra-frame prediction device in the embodiment of the present application can be an electronic device, such as an electronic device with an operating system, or a component in an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or can be other devices other than a terminal. Exemplarily, the terminal can include but is not limited to the types of terminals listed above, and other devices can be servers, network attached storage (Network Attached Storage, NAS), etc., which are not specifically limited in the embodiment of the present application.
[0164] The intra-frame prediction device provided in the embodiment of the present application can achieve Figure 2 The various processes implemented in the method embodiment achieve the same technical effect and will not be described again here to avoid repetition.
[0165] Please refer to Figure 8 , Figure 8 is a structural diagram of another intra-frame prediction device provided in an embodiment of the present application, and the device is applied to the encoding end. Figure 8 As shown, the intra-frame prediction device 800 includes:
[0166] The third determination module 801 is used to determine at least one candidate filter when the prediction mode of the current coding unit is the target mode, wherein the candidate filter includes a sample pixel point and a target pixel point, the sample pixel point is a pixel point that has been encoded or has obtained a prediction value, the target pixel point is a pixel point that has not been encoded in the current coding unit, and the sample pixel point is located on the right side or the upper side of the target pixel point;
[0167] A second acquisition module 802 is used to acquire a reconstructed pixel template corresponding to each of the at least one candidate filters;
[0168] A fourth determination module 803, configured to determine coefficients corresponding to each of the at least one candidate filter based on the reconstructed pixel template;
[0169] The second calculation module 804 is used to calculate the prediction value of the current coding unit according to the coefficients corresponding to each of the candidate filters, and determine the target filter according to the prediction value, where the target filter is one of the at least one candidate filter.
[0170] Optionally, the second calculation module 804 is further configured to:
[0171] Calculate the prediction value of the current coding unit according to the coefficients corresponding to each of the candidate filters;
[0172] Determine a rate-distortion cost corresponding to each of the candidate filters according to the predicted value;
[0173] The candidate filter with the smallest rate-distortion cost is determined as the target filter.
[0174] Optionally, the device further comprises:
[0175] The first sending module is used to send a code stream to a decoding end, where the code stream carries filter index information, and the filter index information is used to indicate a target filter.
[0176] Optionally, the device further comprises:
[0177] The second sending module is used to send a code stream to a decoding end, wherein the code stream carries intra-frame prediction mode index information, and the intra-frame prediction mode index information is used to indicate that the intra-frame prediction mode used by the encoding end is the target mode.
[0178] Optionally, when the number of target pixels in the candidate filter is N, and N is greater than or equal to 1, the fourth determination module 803 is further used to:
[0179] Determine N coefficient groups corresponding to a first candidate filter based on the reconstructed pixel template, wherein each coefficient group includes M coefficients, the value of M is the same as the number of sample pixels in the first candidate filter, M is a positive integer, and the first candidate filter is one of the at least one candidate filter;
[0180] The second calculation module 804 is further used for:
[0181] Determine predicted values of N undecoded pixels in the current coding unit based on the N coefficient groups of the first candidate filter.
[0182] Optionally, the second calculation module 804 is further configured to perform any one of the following:
[0183] When the number of target pixels in the candidate filter is one, calculating the prediction value of each uncoded pixel in each row of the current coding unit row by row in a right-to-left order;
[0184] When the number of target pixels in the candidate filter is greater than one, the prediction value of each uncoded pixel in each row of the current coding unit is calculated row by row from right to left or from left to right.
[0185] The solution provided in the embodiment of the present application is different from the method in the related art that forcibly uses the prediction value obtained by the upper reference row and the left reference column with the same distance as the current coding unit. The embodiment of the present application does not limit the distance between the sample pixel point and the pixel point to be predicted in the current coding unit, which takes into account the asymmetric and uneven texture distribution in the video image, and effectively improves the accuracy of intra-frame prediction.
[0186] The intra-frame prediction device provided in the embodiment of the present application can achieve Figure 6 The various processes implemented in the method embodiment achieve the same technical effect and will not be described again here to avoid repetition.
[0187] like Fig. 9 As shown, the embodiment of the present application further provides an electronic device 900, including a processor 901 and a memory 902, wherein the memory 902 stores a program or instruction that can be run on the processor 901. For example, when the electronic device 900 is a decoding end, the program or instruction is executed by the processor 901 to implement the above Figure 2 When the electronic device 900 is an encoding end, the program or instruction is executed by the processor 901 to implement the above Figure 6 The various steps of the embodiment of the intra-frame prediction method can achieve the same technical effect, and will not be described again here to avoid repetition.
[0188] The present application also provides a terminal that can implement the steps in the above method embodiment. Each implementation process and implementation method of the above method embodiment can be applied to the terminal embodiment and can achieve the same technical effect. Specifically, Fig.10 A schematic diagram of the hardware structure of a terminal for implementing an embodiment of the present application.
[0189] The terminal 1000 includes but is not limited to: a radio frequency unit 1001, a network module 1002, an audio output unit 1003, an input unit 1004, a sensor 1005, a display unit 1006, a user input unit 1007, an interface unit 1008, a memory 1009 and at least some of the components of a processor 1010.
[0190] Those skilled in the art will appreciate that the terminal 1000 may also include a power source (such as a battery) for supplying power to various components, and the power source may be logically connected to the processor 1010 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Fig.10 The terminal structure shown in the figure does not constitute a limitation on the terminal. The terminal may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.
[0191] It should be understood that in the embodiment of the present application, the input unit 1004 may include a graphics processing unit (GPU) 10041 and a microphone 10042, and the graphics processor 10041 processes the image data of the static picture or video obtained by the image capture device (such as a camera) in the video capture mode or the image capture mode. The display unit 1006 may include a display panel 10061, and the display panel 10061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 1007 includes a touch panel 10071 and at least one of other input devices 10072. The touch panel 10071 is also called a touch screen. The touch panel 10071 may include two parts: a touch detection device and a touch controller. Other input devices 10072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.
[0192] In the embodiment of the present application, after receiving downlink data from the network side device, the RF unit 1001 can transmit the data to the processor 1010 for processing; in addition, the RF unit 1001 can send uplink data to the network side device. Generally, the RF unit 1001 includes but is not limited to an antenna, an amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, etc.
[0193] The memory 1009 can be used to store software programs or instructions and various data. The memory 1009 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instruction required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory 1009 may include a volatile memory or a non-volatile memory. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM) and a direct memory bus random access memory (DRRAM). The memory 1009 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.
[0194] The processor 1010 may include one or more processing units; optionally, the processor 1010 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor 1010.
[0195] Wherein, when the terminal 1000 is a decoding end, the processor 1010 is configured to:
[0196] In a case where the prediction mode of the current coding unit is the target mode, determining a target filter, wherein the target filter is one of at least one candidate filter, the candidate filter includes a sample pixel point and a target pixel point, the sample pixel point is a pixel point that has been decoded or has obtained a prediction value, the target pixel point is a pixel point that has not been decoded in the current coding unit, and the sample pixel point is located on the right side or the upper side of the target pixel point;
[0197] Obtaining a reconstructed pixel template corresponding to the target filter;
[0198] Determining coefficients of the target filter based on the reconstructed pixel template;
[0199] A prediction value of the current coding unit is calculated based on coefficients of the target filter.
[0200] When the terminal 1000 is a coding end, the processor 1010 is configured to:
[0201] When the prediction mode of the current coding unit is the target mode, at least one candidate filter is determined, wherein the candidate filter includes a sample pixel point and a target pixel point, the sample pixel point is a pixel point that has been encoded or has obtained a prediction value, the target pixel point is a pixel point that has not been encoded in the current coding unit, and the sample pixel point is located on the right side or the upper side of the target pixel point;
[0202] Obtaining a reconstructed pixel template corresponding to each of the at least one candidate filters;
[0203] Determine the coefficients corresponding to the at least one candidate filter based on the reconstructed pixel template;
[0204] A prediction value of the current coding unit is calculated according to coefficients corresponding to each of the candidate filters, and a target filter is determined according to the prediction value, where the target filter is one of the at least one candidate filter.
[0205] In the embodiment of the present application, the distance between the sample pixel and the pixel to be predicted in the current coding unit is not limited, which takes into account the asymmetric and uneven texture distribution in the video image, effectively improving the accuracy of intra-frame prediction.
[0206] It can be understood that the implementation process of each implementation method mentioned in this embodiment can refer to the above Figure 2 or Figure 6 The relevant descriptions in the method embodiments achieve the same or corresponding technical effects and will not be repeated here to avoid repetition.
[0207] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned intra-frame prediction method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0208] The processor is the processor in the terminal described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk. In some examples, the readable storage medium may be a non-transient readable storage medium.
[0209] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned intra-frame prediction method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0210] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0211] The embodiment of the present application further provides a computer program / program product, which is stored in a storage medium. The computer program / program product is executed by at least one processor to implement the various processes of the above-mentioned intra-frame prediction method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0212] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises one..." does not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the method and device in the embodiment of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0213] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of a computer software product plus a necessary general hardware platform, and of course, can also be implemented by hardware. The computer software product is stored in a storage medium (such as ROM, RAM, disk, CD, etc.), including several instructions to enable a terminal or a network-side device to execute the methods described in each embodiment of the present application.
[0214] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms of implementation methods without departing from the purpose of the present application and the scope of protection of the claims, and these implementation methods are all within the protection of the present application.
Claims
1. An intra-frame prediction method, It is characterized in that include: In a case where the prediction mode of the current coding unit is the target mode, the decoding end determines a target filter, wherein the target filter is one of at least one candidate filter, the candidate filter includes a sample pixel point and a target pixel point, the sample pixel point is a pixel point that has been decoded or has obtained a prediction value, the target pixel point is a pixel point that has not been decoded in the current coding unit, and the sample pixel point is located on the right side or the upper side of the target pixel point; The decoding end obtains a reconstructed pixel template corresponding to the target filter; The decoding end determines the coefficients of the target filter based on the reconstructed pixel template; The decoding end calculates a prediction value of the current coding unit based on coefficients of the target filter.
2. The method according to claim 1, It is characterized in that The decoding end determines a target filter, including: The decoding end obtains the filter index information of the current coding unit from the bit stream; The decoding end determines a filter corresponding to the filter index information among the at least one candidate filter as a target filter.
3. The method according to claim 1 or 2, It is characterized in that When the number of target pixel points in the target filter is N and N is greater than or equal to 1, the decoding end determines the coefficient of the target filter based on the reconstructed pixel template, including: The decoding end determines N coefficient groups of the target filter based on the reconstructed pixel template, wherein each coefficient group includes M coefficients, the value of M is the same as the number of sample pixel points in the target filter, and M is a positive integer; The decoding end determines the prediction value of the current coding unit based on the coefficient of the target filter, including: The decoding end determines the prediction values of N undecoded pixels in the current coding unit based on the N coefficient groups of the target filter.
4. The method according to claim 1 or 2, It is characterized in that The calculating the prediction value of the current coding unit includes any one of the following: When the number of target pixel points in the target filter is one, the decoding end calculates the prediction value of each undecoded pixel point in each row of the current coding unit row by row in a right-to-left order; When the number of target pixels in the target filter is greater than one, the decoding end calculates the prediction value of each undecoded pixel in each row of the current coding unit row by row in a right-to-left or left-to-right order.
5. The method according to any one of claims 1 to 4, It is characterized in that The method further comprises: The decoding end obtains the intra-frame prediction mode index information of the current coding unit from the bit stream; The decoding end determines whether the prediction mode of the current coding unit is the target mode based on the intra-frame prediction mode index information.
6. An intra-frame prediction method, It is characterized in that include: When the prediction mode of the current coding unit is the target mode, the encoding end determines at least one candidate filter, wherein the candidate filter includes a sample pixel point and a target pixel point, the sample pixel point is a pixel point that has been encoded or has obtained a prediction value, the target pixel point is a pixel point that has not been encoded in the current coding unit, and the sample pixel point is located on the right side or the upper side of the target pixel point; The encoding end obtains a reconstructed pixel template corresponding to each of the at least one candidate filters; The encoding end determines the coefficients corresponding to each of the at least one candidate filter based on the reconstructed pixel template; The encoding end calculates the prediction value of the current coding unit according to the coefficients corresponding to each of the candidate filters, and determines a target filter according to the prediction value, where the target filter is one of the at least one candidate filter.
7. The method according to claim 6, It is characterized in that The encoding end calculates the prediction value of the current coding unit according to the coefficient corresponding to each of the candidate filters, and determines the target filter according to the prediction value, including: The encoding end calculates the prediction value of the current coding unit according to the coefficients corresponding to each of the candidate filters; The encoding end determines a rate-distortion cost corresponding to each of the candidate filters according to the prediction value; The encoding end determines the candidate filter with the smallest rate-distortion cost as the target filter.
8. The method according to claim 6, It is characterized in that The method further comprises: The encoding end sends a code stream to the decoding end, the code stream carries filter index information, and the filter index information is used to indicate a target filter.
9. The method according to claim 6, It is characterized in that The method further comprises: The encoding end sends a code stream to the decoding end, where the code stream carries intra-frame prediction mode index information, and the intra-frame prediction mode index information is used to indicate that the intra-frame prediction mode used by the encoding end is the target mode.
10. The method according to any one of claims 6 to 9, It is characterized in that When the number of target pixels in the candidate filter is N and N is greater than or equal to 1, the encoder determines the coefficients corresponding to the at least one candidate filter based on the reconstructed pixel template, including: The encoding end determines N coefficient groups corresponding to a first candidate filter based on the reconstructed pixel template, wherein each coefficient group includes M coefficients, the value of M is the same as the number of sample pixels in the first candidate filter, M is a positive integer, and the first candidate filter is one of the at least one candidate filter; The encoding end calculates the prediction value of the current coding unit according to the coefficient corresponding to each of the candidate filters, including: The encoding end determines the prediction values of N undecoded pixels in the current coding unit based on the N coefficient groups of the first candidate filter.
11. The method according to any one of claims 6 to 9, It is characterized in that The calculating the prediction value of the current coding unit includes any one of the following: When the number of target pixels in the candidate filter is one, the encoding end calculates the prediction value of each uncoded pixel in each row of the current coding unit row by row in a right-to-left order; When the number of target pixels in the candidate filter is greater than one, the encoding end calculates the prediction value of each uncoded pixel in each row of the current coding unit row by row in a right-to-left or left-to-right order.
12. An intra-frame prediction device, It is characterized in that include: A first determination module is used to determine a target filter when the prediction mode of the current coding unit is a target mode, wherein the target filter is one of at least one candidate filter, the candidate filter includes a sample pixel point and a target pixel point, the sample pixel point is a pixel point that has been decoded or has obtained a prediction value, the target pixel point is a pixel point that has not been decoded in the current coding unit, and the sample pixel point is located on the right side or the upper side of the target pixel point; A first acquisition module, used to acquire a reconstructed pixel template corresponding to the target filter; A second determination module, configured to determine coefficients of the target filter based on the reconstructed pixel template; The first calculation module is used to calculate the prediction value of the current coding unit based on the coefficient of the target filter.
13. An intra-frame prediction device, It is characterized in that include: a third determination module, configured to determine at least one candidate filter when the prediction mode of the current coding unit is the target mode, wherein the candidate filter includes a sample pixel point and a target pixel point, the sample pixel point is a pixel point that has been encoded or has obtained a prediction value, the target pixel point is a pixel point that has not been encoded in the current coding unit, and the sample pixel point is located on the right side or the upper side of the target pixel point; A second acquisition module, used to acquire a reconstructed pixel template corresponding to each of the at least one candidate filters; A fourth determination module, configured to determine coefficients corresponding to each of the at least one candidate filter based on the reconstructed pixel template; The second calculation module is used to calculate the prediction value of the current coding unit according to the coefficients corresponding to each of the candidate filters, and determine the target filter according to the prediction value, where the target filter is one of the at least one candidate filter.
14. An electronic device, It is characterized in that The method comprises a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the intra-frame prediction method according to any one of claims 1 to 11 are implemented.
15. A readable storage medium, It is characterized in that The readable storage medium stores a program or an instruction, and when the program or the instruction is executed by a processor, the steps of the intra-frame prediction method according to any one of claims 1 to 11 are implemented.
16. A chip, It is characterized in that The chip includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or an instruction to implement the intra-frame prediction method according to any one of claims 1 to 11.
Citation Information
Patent Citations
Video intra-frame coding method based on hierarchical flexible block sequence
CN106254866A
Intra-frame prediction method, video encoding method, video decoding method and related equipment
CN110881125A
Coding and decoding method and device
CN112437298A
Video encoding method and device, and video decoding method and device
CN114073091A
Cited By
Prediction method and apparatus, and device
WO2026184540A1
Image processing method, image processing device, and medium and program product
WO2026189053A1
