Intra prediction method and device, electronic equipment and readable storage medium
Patent Information
- Application Number
- CN202310719342.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-16
- Publication Date
- 2026-09-25
- Estimated Expiration
- 2043-06-16
AI Technical Summary
[0003]本申请实施例提供一种帧内预测方法、装置、电子设备及可读存储介质,能够解决相关技术中强制使用与当前编码单元距离相同的上边参考行和左边参考列获得的预测值不准确的问题
[0028]在本申请实施例中,目标滤波器包括样本像素点和目标像素点,所述样本像素点为已解码的像素点,所述目标像素点为所述当前编码单元中未解码的像素点,所述样本像素点位于所述目标像素点的右侧或上侧,也即当前编码单元中未解码像素点位于已解码的样本像素点的右侧或上侧,基于这些样本像素点来对当前编码单元进行预测,与相关技术中强制使用与当前编码单元距离相同的上边参考行和左边参考列获得的预测值的方法不同,本申请实施例中并不限定样本像素点与当前编码单元中待预测像素点之间的距离,也就考虑了视频图像中纹理分布不对称、不均匀的情况,有效提升帧内预测准确度。
Smart Images

Figure CN119155444B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of video encoding and decoding technology, specifically relating to an intra-frame prediction method, apparatus, electronic device, and readable storage medium. Background Technology
[0002] The video encoder employs a block-based hybrid coding framework. The coding process includes: block partitioning, intra-frame prediction, inter-frame prediction, transform, quantization, loop filtering, and entropy coding. The encoder first divides the image into non-overlapping Coding Tree Units (CTUs), which are then further divided into different Coding Units (CUs) according to a quadtree. The encoder encodes each CU in a top-to-bottom, left-to-right order, and the decoder decodes the CUs of the current frame in the same order. However, image texture distribution is diverse. When the texture distribution at the top and left is different or uneven, the prediction values obtained by forcibly using the upper reference row and left reference column, which are equidistant from the current CU, become inaccurate. Summary of the Invention
[0003] This application provides an intra-frame prediction method, apparatus, electronic device, and readable storage medium, which can solve the problem in related technologies where the predicted values obtained by forcibly using the upper reference row and left reference column that are equidistant from the current coding unit are inaccurate.
[0004] Firstly, an intra-frame prediction method is provided, executed by the decoding end, including:
[0005] When the prediction mode of the current coding unit is the target mode, the decoder determines the target filter, wherein the target filter is one of at least one candidate filter, the candidate filter includes sample pixels and target pixels, the sample pixels are pixels that have been decoded or have obtained prediction values, the target pixels are pixels that have not been decoded in the current coding unit, and the sample pixels are located to the right or above the target pixels.
[0006] The decoding end obtains the 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 the predicted value of the current coding unit based on the coefficients of the target filter.
[0009] Secondly, an intra-frame prediction method is provided, executed by the encoder, including:
[0010] When the prediction mode of the current coding unit is the target mode, the encoder determines at least one candidate filter, wherein the candidate filter includes sample pixels and target pixels, the sample pixels are pixels that have been encoded or have obtained a prediction value, the target pixels are pixels that have not been encoded in the current coding unit, and the sample pixels are located to the right or above the target pixels.
[0011] The encoding end obtains the reconstructed pixel template corresponding to each of the at least one candidate filter;
[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 predicted value of the current encoding unit based on the coefficients corresponding to each of the candidate filters, and determines the target filter based on the predicted value. The target filter is one of the at least one candidate filter.
[0014] Thirdly, an intra-frame prediction apparatus is provided, comprising:
[0015] The first determining module is used to determine a target filter when the prediction mode of the current coding unit is the target mode. The target filter is one of at least one candidate filter. The candidate filter includes sample pixels and target pixels. The sample pixels are pixels that have been decoded or have obtained a prediction value. The target pixels are pixels that have not been decoded in the current coding unit. The sample pixels are located to the right or above the target pixels.
[0016] The first acquisition module is used to acquire the reconstructed pixel template corresponding to the target filter;
[0017] The second determining module is used to determine the coefficients of the target filter based on the reconstructed pixel template;
[0018] The first calculation module is used to calculate the predicted value of the current coding unit based on the coefficients of the target filter.
[0019] Fourthly, an intra-frame prediction apparatus is provided, comprising:
[0020] The third determining module is used to determine at least one candidate filter when the prediction mode of the current coding unit is the target mode. The candidate filter includes sample pixels and target pixels. The sample pixels are pixels that have been encoded or have obtained a prediction value. The target pixels are pixels that have not been encoded in the current coding unit. The sample pixels are located to the right or above the target pixels.
[0021] The second acquisition module is used to acquire the reconstructed pixel templates corresponding to each of the at least one candidate filter;
[0022] The fourth determining module is used to determine the 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 predicted value of the current coding unit according to the coefficients corresponding to each of the candidate filters, and to determine the target filter according to the predicted value, wherein the target filter is one of the at least one candidate filter.
[0024] Fifthly, an electronic device is provided, including a processor and a memory, the memory storing a program or instructions executable on the processor, the program or instructions, when executed by the processor, implementing the steps of the intra-frame prediction method as described in the first or second aspect.
[0025] In a sixth aspect, a readable storage medium is provided, on which a program or instructions are stored, which, when executed by a processor, implement the steps of the method described in the first aspect, or implement the steps of the method described in the second aspect.
[0026] In a seventh aspect, a chip is provided, the chip including a processor and a communication interface, the communication interface being coupled to the processor, the processor being configured to run programs or instructions to implement the method as described in the first aspect, or to implement the method as described in the second aspect.
[0027] Eighthly, a computer program / program product is provided, the computer program / program product being stored in a storage medium, the program / program product being executed by at least one processor to implement the steps of the method as described in the first aspect, or to implement the steps of the method as described in the second aspect.
[0028] In this embodiment, the target filter includes sample pixels and target pixels. The sample pixels are decoded pixels, and the target pixels are undecoded pixels in the current coding unit. The sample pixels are located to the right or above the target pixels, meaning that the undecoded pixels in the current coding unit are located to the right or above the decoded sample pixels. Based on these sample pixels, the current coding unit is predicted. Unlike the method in related technologies that forcibly uses the upper reference row and left reference column that are equidistant from the current coding unit to obtain the prediction value, this embodiment does not limit the distance between the sample pixels and the pixels to be predicted in the current coding unit. This takes into account the situation of asymmetrical and uneven texture distribution in the video image, effectively improving the accuracy of intra-frame prediction. Attached Figure Description
[0029] Figure 1a These are schematic diagrams illustrating three possible positions of the reconstructed pixel region and the current coding unit in related technologies;
[0030] Figure 1b These are schematic diagrams of three different filter shapes in related technologies;
[0031] Figure 2 This is a flowchart of an intra-frame prediction method provided in an embodiment of this application;
[0032] Figure 3 This is a schematic diagram of one of three different shaped candidate filters applicable in the embodiments of this application;
[0033] Figure 4 This is a schematic diagram of three possible positions of the reconstructed pixel template and the current coding unit in the embodiments of this application;
[0034] Figure 5 This is a schematic diagram of three different shaped candidate filters applicable in the embodiments of this application;
[0035] Figure 6 This is a flowchart of another intra-frame prediction method provided in the embodiments of this application;
[0036] Figure 7 This is a structural diagram of an intra-frame prediction device provided in an embodiment of this application;
[0037] Figure 8 This is a structural diagram of another intra-frame prediction device provided in the embodiments of this application;
[0038] Figure 9 This is a structural diagram of an electronic device provided in an embodiment of this application;
[0039] Figure 10 This is a structural diagram of a terminal provided in an embodiment of this application. Detailed Implementation
[0040] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.
[0041] The terms "first," "second," etc., used in this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such terms can be used interchangeably where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first" and "second" are generally of the same class, without limiting the number of objects; for example, the first object can be one or more. Furthermore, "or" in this application indicates at least one of the connected objects. For example, "A or B" covers three scenarios: Scenario 1: including A but not B; Scenario 2: including B but not A; Scenario 3: including both A and B. The character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0042] To better understand, the relevant concepts that may be involved in the embodiments of this application are explained below.
[0043] Currently, the encoder employs an intra-frame prediction technique based on image texture correlation. It uses the reconstructed samples of the row above and column to the left adjacent to the current coding unit as a reference. By traversing DC mode, Planar mode, and angle prediction mode, it selects the optimal intra-frame prediction mode using rate-distortion cost to remove spatial redundancy of the block.
[0044] In related technologies, at the encoding end, the implementation steps of an extrapolation filter-based intra prediction mode (EIP) are as follows:
[0045] 1. Obtain such as Figure 1a The reconstructed pixel area above and / or to the left of the current coding unit (also called the prediction unit, PU) shown is calculated as follows: Figure 1b The 15-tap filter coefficients for the three shapes shown can be calculated using the same method as in the Convolutional Cross-Component Intra-Model (CCCM) of 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 region. MSE minimization is performed by calculating the autocorrelation matrix with the reconstructed values of 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 then decomposed using LDL, and the final filter coefficients are calculated using inverse permutations.
[0047] 2. Use them separately Figure 1b The three types of extrapolation filters shown calculate the predicted value of each sample point in the order 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 diagram, the gray sample points represent the input of the EIP mode, while the white sample points in the lower right corner represent the output of the EIP mode, which is the predicted value that needs to be obtained.
[0048] 3. Calculate the prediction value of the current coding unit obtained using the three shapes of extrapolation filters in EIP mode, and then calculate the rate-distortion cost, comparing it with the rate-distortion cost of other prediction modes. If the rate-distortion cost of EIP mode is the lowest, set the EIP mode identifier information to 1, and write it into the bitstream along with the index information of the selected filter (i.e., one of the three filters shown in 1b).
[0049] After the decoder obtains that the current coding unit to be decoded is in EIP mode, it parses the index value of the selected filter. Following the same method as the encoder, it obtains the filter coefficients using the decoded and / or reconstructed pixel values above and / or to the left of the current coding unit. Then, it calculates the predicted value of each sample point in the current coding unit in a top-to-bottom, left-to-right order. This predicted value is then added to the residual value calculated from the residual information of the current coding unit obtained from the bitstream to obtain the reconstructed value.
[0050] However, image texture distribution is diverse. When the texture distribution at the top and left is different or uneven, the prediction values obtained by forcibly using the upper reference row and left reference column that are equidistant from the current coding unit in related technologies will be inaccurate. This application proposes a new intra-frame prediction method.
[0051] The intra-frame prediction method, apparatus, and related devices provided in this application will be described in detail below with reference to the accompanying drawings and through some embodiments and application scenarios.
[0052] Please refer to Figure 2 , Figure 2 This is a flowchart of an intra-frame prediction method provided in an embodiment of this application, which is applied at the decoding end. Figure 2As shown, the method includes the following steps:
[0053] Step 201: When the prediction mode of the current coding unit is the target mode, the decoding end determines the target filter.
[0054] The target filter is one of at least one candidate filter. The candidate filter includes sample pixels and target pixels. The sample pixels are pixels that have been decoded or have obtained a predicted value. The target pixels are pixels that have not been decoded in the current coding unit. The sample pixels are located to the right or above the target pixels.
[0055] For example, such as Figure 3 As shown, Figure 3 The image shows three candidate filters with different shapes: (a), (b), and (c). Each gray box represents a sample pixel, and the white box represents a target pixel, which is the pixel that has not yet been decoded in the current coding unit. Sample pixels are pixels in the image frame that have been decoded or whose predicted values have been obtained, and the sample pixels are located to the right or above the target pixels. Figure 3 In the three candidate filters shown, the sample pixels are located to the right and above the target pixels, that is, the target pixels are located at the lower left corner of the sample pixels. It should be noted that the above are only three possible forms of candidate filters in the embodiments of this application, but are not limited to these. The candidate filters provided in the embodiments of this application can also be other possible forms.
[0056] In this embodiment of the application, the target filter is one of the candidate filters, that is, the target filter also includes sample pixels and target pixels.
[0057] In this context, the target pixel is the undecoded pixel in the current coding unit, and the sample pixel is the decoded pixel or the pixel whose predicted value has been obtained. That is, the sample pixel is the pixel located above or to the right of the sample pixel to be predicted in the current coding unit. The target filter can move in steps based on the number of target pixels. For example, if there is only one target pixel, the decoder decodes one pixel in the current coding unit at a time, sequentially decoding and predicting each pixel in the current coding unit. For instance, it can first decode the first pixel on the right of the top row of the current coding unit; this first pixel becomes the target pixel in the target filter. After decoding the first pixel, it decodes the second pixel on the right of the top row of the current coding unit; this second pixel becomes the target pixel in the target filter. The target filter then moves to the right by one pixel, and the sample pixel also changes accordingly. In this way, the decoder can obtain the predicted value of each pixel in the current coding unit.
[0058] In this embodiment, the target mode can be a specific intra-prediction mode, such as EIP mode or other intra-prediction modes. For example, the target mode can be an intra-prediction mode agreed upon by the decoder and encoder, or it can be an intra-prediction mode determined by the decoder based on information in the bitstream.
[0059] Optionally, prior to 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 bitstream;
[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 bitstream sent from the encoder to the decoder includes intra-prediction mode index information, which is used to characterize the intra-prediction mode used by the encoder. Based on the intra-prediction mode index information, the decoder can determine which intra-prediction mode is used by the encoder and whether the intra-prediction mode used is the target mode. This allows the decoder to use the same intra-prediction mode as the encoder to decode the current coding unit, ensuring that the decoder can obtain the same prediction value as the encoder.
[0063] For example, taking the target mode as EIP mode, if the intra-prediction mode used by the encoder is EIP mode, the intra-prediction mode index information is marked as 1. If the encoder does not use EIP mode, the intra-prediction mode index information can be marked as 0, or other intra-prediction mode corresponding to the index information. The encoder writes the intra-prediction mode index information into the bitstream and sends it to the decoder. The decoder can then determine whether the prediction mode for the current coding unit is EIP mode by identifying whether the intra-prediction mode index information is marked as 1.
[0064] In this embodiment, the target filter is one of the candidate filters. The decoding end randomly selects one of the candidate filters as the target filter, or it can determine the target filter based on the 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 encoding unit from the bit stream;
[0067] The decoding end determines the filter corresponding to the filter index information among the at least one candidate filter as the target filter.
[0068] In this embodiment, there may be multiple candidate filters. The encoder may select one as the target filter and encode the current coding unit based on the target filter. The encoder may write filter index information into the bitstream sent to the decoder. The filter index information is used to characterize the target filter used by the encoder. Thus, the decoder can determine which target filter is used by the encoder based on the filter index information in the bitstream, and use the same target filter as the encoder to decode the current coding unit, ensuring that the decoder can obtain the same prediction value as the encoder.
[0069] It should be noted that the encoder and decoder can pre-agree on the filter index information corresponding to different candidate filters. For example, the filter index information identifier for candidate filter 1 is 1, the filter index information identifier for candidate filter 2 is 2, and so on. Furthermore, based on the identifier of the filter index information, the decoder can determine the corresponding candidate filter and use it as the target filter to decode the current encoding unit.
[0070] Step 202: The decoding end obtains the reconstructed pixel template corresponding to the target filter.
[0071] Optionally, different candidate filters can correspond to different reconstructed pixel templates. For example, using... Figure 3 Taking the three candidate filters shown as examples, these three candidate filters correspond to three different reconstructed pixel templates, among which... Figure 3 The candidate filter (a) corresponds to Figure 4 The reconstructed pixel template shown in (c) is the template formed by the decoded reconstructed pixels above and to the right 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 the template formed by the decoded reconstructed pixels above 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 the template formed by the decoded reconstructed pixels to the right of the current coding unit corresponding to the candidate filter.
[0072] In this embodiment, after determining the target filter, i.e., a candidate filter, the decoding end can obtain the corresponding reconstructed pixel template. It should be noted that the correspondence between the candidate filter and the reconstructed pixel template can be pre-established. Figure 3 and Figure 4 The candidate filters and reconstructed pixel templates shown in the examples and their corresponding relationships are merely illustrative and do not constitute a limitation on the embodiments of this application. The candidate filters and reconstructed pixel templates and their corresponding relationships in the embodiments of this application may also be other possible cases.
[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 determining the reconstructed pixel template corresponding to the target filter, the decoding end can calculate the coefficients of the target filter based on the reconstructed pixel template. The calculation method can refer to relevant technologies, such as the method for calculating filter coefficients in CCCM within ECM, which will not be specifically described in this embodiment.
[0075] Step 204: The decoding end calculates the predicted 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 in 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) has only one target pixel. The target filter can acquire the predicted value of one pixel in the current coding unit at a time. Based on this target filter, the decoder acquires the predicted value of each pixel in each row of the current coding unit from right to left. First, it acquires the predicted value of each pixel in the first row, then the second row, and so on, row by row from top to bottom. Understandably, as the decoder acquires the predicted values of each pixel in the current coding unit, the target pixel and sample pixel in the target filter also change accordingly.
[0078] It should be noted that the number of coefficients in the target filter is the same as the number of sample pixels in the target filter. For example, taking the target filter as... Figure 3Taking the filter shown in (a) as an example, the target filter includes 15 sample pixels, so the decoder will obtain 15 filter coefficients. The decoder can calculate the product of these 15 filter coefficients with the reconstructed value or predicted value of their respective sample pixels (the sample pixels are the reconstructed pixels around the current coding unit that have already been decoded, so their reconstructed values are known; the sample pixels may also be pixels within the current coding unit whose predicted values have been obtained using this method), resulting in 15 products. Based on these 15 products, the predicted value of the pixel to be predicted in the current coding unit is determined. For example, the average of these 15 products can be used as the predicted value of the pixel to be predicted. In this way, the predicted value of each pixel 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 this embodiment, the decoding end obtains the corresponding reconstructed pixel template based on the target filter, determines the coefficients of the target filter based on the reconstructed pixel template, and further calculates the predicted value of each pixel in the current coding unit based on the coefficients of the target filter. The target filter includes sample pixels and target pixels. The sample pixels are decoded pixels or pixels with predicted values. The target pixels are undecoded pixels (i.e., pixels to be predicted) in the current coding unit. The sample pixels are located to the right or above the target pixels. In other words, the undecoded pixels in the current coding unit are located to the right or above the decoded sample pixels (which may be decoded and reconstructed pixels outside the current coding unit or sample pixels with predicted values inside the current coding unit). The current coding unit is predicted based on these sample pixels. Unlike the method in related technologies that forcibly uses the upper reference row and left reference column that are equidistant from the current coding unit to obtain the predicted values, this embodiment does not limit the distance between the sample pixels and the pixels to be predicted in the current coding unit. This takes into account the situation of asymmetrical and uneven texture distribution in the video image, effectively improving the accuracy of intra-frame prediction and also helping to improve decoding efficiency.
[0081] Optionally, the number of target pixels is at least one. For example... Figure 3 The three candidate filters shown each include one target pixel (i.e., the white box); as shown Figure 5 The candidate filter shown in (a) includes four target pixels, such as... Figure 5 The candidate filter shown in (b) includes 8 target pixels, such as Figure 5 The candidate filter shown in (c) includes two 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 can also take other possible forms, as described above. Figure 5 This does not constitute a limitation on the candidate filters in the embodiments of this application.
[0083] Optionally, the number of target pixels in the target filter is N, where N is greater than or equal to 1. The decoding end determines the coefficients 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 pixels in the target filter, and M is a positive integer;
[0085] The decoding end determines the predicted value of the current coding unit based on the coefficients of the target filter, including:
[0086] The decoding end determines the predicted values of the N undecoded pixels in the current coding unit based on the N coefficient sets of the target filter.
[0087] The coefficients referred to here are filter coefficients.
[0088] In this embodiment, the number of target pixels in the target filter can be one or more. For example, suppose the target filter is as follows: Figure 3 The filter shown, i.e., the target filter, has one target pixel and 15 sample pixels, i.e., N=1, M=15. The decoder can predict the value of one undecoded pixel (also called the pixel to be predicted) in the current coding unit each time. Specifically, the decoder determines a coefficient set of the target filter based on the reconstructed pixel template corresponding to the target filter. This coefficient set includes 15 filter coefficients. The decoder uses these 15 filter coefficients to obtain the predicted value of one undecoded pixel in the current coding unit, which is also the target pixel in the target filter. The predicted value of each undecoded pixel in the current coding unit is obtained in this way. The specific implementation of calculating the predicted value of the undecoded pixel based on the filter coefficients can refer to relevant technologies. For example, it can calculate the product of the 15 filter coefficients and the reconstructed or predicted values of their respective sample pixels, and use the average of these products as the predicted value of the pixel to be predicted.
[0089] Alternatively, the target filter is as follows: Figure 5The filter shown, i.e., the target filter, has more than one target pixel. Let's assume the target filter is... Figure 5 The filter shown in (a) has 4 target pixels and 12 sample pixels, i.e., N=4 and M=12. Therefore, the decoder can predict the values of the 4 undecoded pixels in the current coding unit at a time. Specifically, the decoder determines 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. The decoder calculates the predicted values of the 4 undecoded pixels in the current coding unit based on these 4 coefficient groups and the 12 filter coefficients in each group. This means the decoder can obtain the predicted values of 4 undecoded pixels simultaneously, thus effectively improving the decoding efficiency.
[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 one coefficient group can be used to calculate the predicted value of one undecoded pixel, and the N coefficient groups correspond to the predicted values of N undecoded pixels. The specific implementation of calculating the predicted value of one undecoded pixel based on the M coefficients can be referred to the previous description, and will not be repeated here.
[0091] In this embodiment, the decoding end can determine N coefficient groups based on N target pixels in the target filter, and then calculate the predicted values of N undecoded pixels in the current coding unit based on these N coefficient groups and M coefficients in each coefficient group, thereby effectively improving the decoding efficiency of the decoding end.
[0092] Optionally, determining the predicted value of the current coding unit includes any one of the following:
[0093] When the number of target pixels in the target filter is one, the decoding end calculates the predicted value of each undecoded pixel in each row of the current encoding unit in order from right to left.
[0094] When the number of target pixels in the target filter is greater than one, the decoding end calculates the predicted value of each undecoded pixel in each row of the current encoding unit in order from right to left or from left to right.
[0095] For example, if the number of target pixels in the target filter is one, such as Figure 3In the filter shown, in this case, the decoder can only obtain the prediction value of one undecoded pixel in the current coding unit at a time. The current coding unit usually includes multiple rows and columns of pixels. The decoder can calculate the prediction value of each undecoded pixel in the current coding unit in a right-to-left and top-to-bottom order. That is, first calculate the prediction value of each undecoded pixel in the first row in a right-to-left order, then calculate the prediction value of each undecoded pixel in the second row in a right-to-left order, then calculate the prediction value of each undecoded pixel in the third row in a right-to-left order, and so on. The prediction value of each undecoded pixel in each row is calculated row by row in a right-to-left order in this way, thereby completing the prediction of the current coding unit.
[0096] Alternatively, if the number of target pixels in the target filter is N, where N is greater than 1, such as... Figure 5 In the filter shown, if the decoding end can simultaneously obtain the predicted values of N undecoded pixels in the current coding unit, then the decoding end can calculate the predicted value of each undecoded pixel row by row, either from right to left or from left to right. For example, first, the predicted values of the N undecoded pixels in the first row are calculated in order from right to left. After completing the prediction of the first row, the predicted values of the N undecoded pixels in the second row are calculated in order from right to left. After completing the prediction of the second row, the predicted values of the N undecoded pixels in the third row are calculated in order from right to left, and so on. The predicted values of each undecoded pixel in each row are calculated in order from right to left in this way, thereby completing the prediction of the current coding unit.
[0097] In this embodiment, 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 eliminates the limitation that the decoding end can only predict pixels in the order from the upper left to the lower right, effectively improving the flexibility of decoding, reducing the dependence of undecoded pixels in the current coding unit on the left adjacent sample points, and also helping 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 of 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] To better understand, the technical solutions provided in this application will be described below through two specific embodiments.
[0100] Example 1
[0101] Step S11. The decoding end determines that the prediction mode of the current coding unit to be decoded is 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 (i.e., the target filter) based on the filter index information; in this embodiment, the candidate filters are as follows: Figure 3 The three types shown are not limited to these; candidate filters can also have other shapes. It should be noted that the pixel to be predicted ( Figure 3 The white box in the middle is located at the bottom left corner of the filter;
[0103] Step S13. The decoding end obtains a template composed of decoded reconstructed pixels based on 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 relevant technologies; specifically, combined with Figure 3 and Figure 4 :
[0104] If the selected filter is Figure 3 (a) then use as follows Figure 4 Template shown in (c);
[0105] If the selected filter is Figure 3 (b) then use as follows Figure 4 Template shown in (a);
[0106] If the selected filter is Figure 3 (c) then use as follows Figure 4 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 in 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] Example 2
[0109] Step S21. The decoding end determines that the prediction mode of the current coding unit to be decoded is 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 based on the filter index information; in this embodiment, the candidate filters are as follows: Figure 5 The three shapes shown 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 (The white square in the middle);
[0111] Step S23. The decoding end obtains a template composed of decoded reconstructed pixels based on 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 related technologies. The difference between this and related technologies and Embodiment 1 is that Embodiment 1 and related technologies obtain a set of coefficients for each filter, and only obtain the predicted value of one pixel at a time; this embodiment obtains N sets of coefficients for each filter, where N is equal to the width of the filter (e.g., ...). Figure 5 (Number of white squares in the middle), using Figure 5 The gray sample points (gray boxes) in each filter are used to calculate the predicted value of each pixel in the bottom row. The advantage of this embodiment is that it can reduce the dependence of the current pixel to be decoded on the sample points in the same row to the left, and can obtain the predicted values of N pixels at one time, which can effectively improve the decoding efficiency.
[0112] Step S24. The decoding end calculates the predicted value of each pixel in the current coding unit to be decoded in order from right to left (or from left to right) and from top to bottom according to the obtained filter coefficients, and adds it to the obtained residual value to obtain the reconstructed value of the current coding unit.
[0113] Please refer to Figure 6 , Figure 6 This is a flowchart of another intra-frame prediction method provided in an embodiment of this application, which is applied at the encoding end. Figure 6 As shown, the method includes the following steps:
[0114] Step 601: When the prediction mode of the current coding unit is the target mode, the coding 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. The sample pixels are located to the right or above the target pixels.
[0116] It should be noted that the target mode can be a specific intra-prediction mode, such as EIP mode or other intra-prediction modes. The encoding end can determine the intra-prediction mode itself, for example, by determining it to be EIP mode.
[0117] Optionally, the shape of the candidate filter can be predetermined by the encoding and decoding ends; for example, the candidate filter can be as follows: Figure 3 and Figure 5 The shape shown is described above. For details regarding the candidate filters, please refer to the description in the decoding end embodiment above; further details will not be repeated here.
[0118] Step 602: The encoding end obtains the reconstructed pixel template corresponding to each of the at least one candidate filter;
[0119] Step 603: The encoding end determines the 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 predicted value of the current encoding unit according to the coefficients corresponding to each candidate filter, and determines the target filter according to the predicted value. The target filter is one of the at least one candidate filter.
[0121] For example, assuming there are L candidate filters, the encoder obtains the reconstructed pixel templates corresponding to each of the L candidate filters. Based on the reconstructed pixel templates of each candidate filter, the coefficients of that candidate filter are determined, resulting in L coefficients for each candidate filter. Then, for each candidate filter, the predicted value of the current coding unit is calculated based on its coefficients, thus the current coding unit will have L predicted values. The target filter is then determined based on these predicted values. For example, the average of the L predicted values can be calculated, and the candidate filter corresponding to the predicted value closest to the average value can be used as the target filter. The predicted value corresponding to the target filter can then be used as the predicted value for the current coding unit, thereby encoding the current coding unit.
[0122] In this embodiment, the encoder calculates the predicted value of the current coding unit based on a candidate filter. The candidate filter includes sample pixels and target pixels. The sample pixels are encoded pixels, and the target pixels are uncoded pixels in the current coding unit. The sample pixels are located to the right or above the target pixels, meaning that the uncoded pixels in the current coding unit are located to the right or above the encoded sample pixels. The current coding unit is predicted based on these sample pixels. Unlike the method in related technologies that forcibly uses the upper reference row and left reference column that are equidistant from the current coding unit to obtain the predicted value, this embodiment does not limit the distance between the sample pixels and the pixels to be predicted in the current coding unit. This takes into account the asymmetrical and uneven texture distribution in the video image, effectively improving the accuracy of intra-frame prediction and also helping to improve coding efficiency.
[0123] Optionally, the encoding end calculates the predicted value of the current encoding unit based on the coefficients corresponding to each candidate filter, and determines the target filter based on the predicted value, including:
[0124] The encoding end calculates the predicted value of the current encoding unit based on the coefficients corresponding to each candidate filter;
[0125] The encoding end determines the rate-distortion cost corresponding to each candidate filter based on the predicted value.
[0126] The encoding end determines the candidate filter with the lowest rate-distortion cost as the target filter.
[0127] For example, assuming there are L candidate filters, for each candidate filter, the predicted value of the current coding unit is calculated based on the coefficients of that candidate filter. Thus, the current coding unit will have L predicted values. The rate-distortion cost corresponding to each of these L predicted values is calculated, and the candidate filter corresponding to the predicted value with the lowest rate-distortion cost is determined as the target filter. In this way, the encoder can encode the current coding unit based on the target filter, and since the target filter has the lowest rate-distortion cost, the accuracy of the encoding can be effectively ensured.
[0128] Optionally, the method further includes:
[0129] The encoding end sends a bitstream to the decoding end, and the bitstream carries filter index information, which is used to indicate the target filter.
[0130] In this embodiment, each candidate filter may include a corresponding identifier, which may be known to both the encoder and decoder. After determining the target filter, the encoder may write the identifier corresponding to the target filter as filter index information into the bitstream. The decoder can then determine the target filter used by the encoder based on the filter index information, thus allowing the decoder to select the same target filter for intra-frame prediction, effectively ensuring that the encoder and decoder obtain consistent prediction values.
[0131] Optionally, the method further includes:
[0132] The encoding end sends a bitstream to the decoding end. The bitstream carries intra-frame prediction mode index information, which 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 bitstream sent from the encoder to the decoder includes intra-prediction mode index information, which is used to indicate that the intra-prediction mode used by the encoder is the target mode. Thus, the decoder can use the same intra-prediction mode as the encoder to decode the current coding unit, so as to ensure that the decoder can obtain the same prediction value as the encoder.
[0134] Optionally, when the number of target pixels in the candidate filters 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 the 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 predicted value of the current encoding unit based on the coefficients corresponding to each candidate filter, including:
[0137] The encoding end determines the predicted values of N undecoded pixels in the current encoding unit based on the N coefficient groups of the first candidate filter.
[0138] Optionally, calculating the predicted 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 predicted value of each unencoded pixel in each row of the current encoding unit in order from right to left.
[0140] When the number of target pixels in the candidate filter is greater than one, the encoding end calculates the predicted value of each unencoded pixel in each row of the current encoding unit in order from right to left or from left to right.
[0141] In this embodiment, the specific implementation methods for determining the coefficients of the candidate filter at the encoding end, determining the predicted value of the current coding unit based on the candidate filter coefficients, and calculating the predicted value of the current coding unit can be the same as those at the decoding end, and can be referred to the above for details. Figure 2 To avoid repetition, the descriptions in the method embodiments will not be repeated here.
[0142] The intra-prediction method provided in this application can be executed by an intra-prediction device. This application uses an intra-prediction device performing intra-prediction as an example to illustrate the intra-prediction device provided in this application.
[0143] Please refer to Figure 7 , Figure 7 This is a structural diagram of an intra-frame prediction device provided in an embodiment of this application, which is applied at the decoding end. Figure 7 As shown, the intra-frame prediction device 700 includes:
[0144] The first determining module 701 is used to determine a target filter when the prediction mode of the current coding unit is the target mode. The target filter is one of at least one candidate filter. The candidate filter includes sample pixels and target pixels. The sample pixels are pixels that have been decoded or have obtained a prediction value. The target pixels are pixels that have not been decoded in the current coding unit. The sample pixels are located to the right or above the target pixels.
[0145] The first acquisition module 702 is used to acquire the reconstructed pixel template corresponding to the target filter;
[0146] The second determining module 703 is used to determine the coefficients of the target filter based on the reconstructed pixel template;
[0147] The first calculation module 704 is used to calculate the predicted value of the current coding unit based on the coefficients of the target filter.
[0148] Optionally, the first determining module 701 is further configured to:
[0149] Obtain the filter index information of the current coding unit from the bitstream;
[0150] The filter corresponding to the filter index information among the at least one candidate filter is determined as the target filter.
[0151] Optionally, the number of target pixels 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 configured to:
[0153] Based on the reconstructed pixel template, N coefficient groups of the target filter are determined, 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 also used for:
[0155] The predicted values of the N undecoded pixels in the current coding unit are determined based on the N coefficient sets of the target filter.
[0156] Optionally, the first calculation module 704 is further configured to perform any one of the following:
[0157] When there is only one target pixel in the target filter, the predicted value of each undecoded pixel in each row of the current coding unit is calculated row by row from right to left.
[0158] If the number of target pixels in the target filter is greater than one, the predicted value of each undecoded pixel in each row of the current encoding unit is calculated row by row in order from right to left or from left to right.
[0159] Optionally, the first determining module 701 is further configured to:
[0160] Obtain the intra-frame prediction mode index information of the current coding unit from the bitstream;
[0161] Based on the intra-frame prediction mode index information, it is determined whether the prediction mode of the current coding unit is the target mode.
[0162] The solution provided in this application differs from the method in related technologies that forces the use of the upper reference row and left reference column that are equidistant from the current coding unit to obtain the predicted value. In this 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 situation of asymmetrical and uneven texture distribution in the video image, and effectively improves the accuracy of intra-frame prediction.
[0163] The intra-frame prediction device in this application embodiment 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 other devices besides a terminal. For example, the terminal can include, but is not limited to, the types of terminals listed above; other devices can be servers, network attached storage (NAS), etc., and this application embodiment does not specifically limit the scope of the device.
[0164] The intra-frame prediction device provided in this application embodiment 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 This is a structural diagram of another intra-frame prediction device provided in an embodiment of this application, which is applied at the encoding end. Figure 8 As shown, the intra-frame prediction device 800 includes:
[0166] The third determining module 801 is used to determine at least one candidate filter when the prediction mode of the current coding unit is the target mode. The candidate filter includes sample pixels and target pixels. The sample pixels are pixels that have been encoded or have obtained a prediction value. The target pixels are pixels that have not been encoded in the current coding unit. The sample pixels are located to the right or above the target pixels.
[0167] The second acquisition module 802 is used to acquire the reconstructed pixel templates corresponding to each of the at least one candidate filter;
[0168] The fourth determining module 803 is used to determine the 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 predicted value of the current coding unit according to the coefficients corresponding to each of the candidate filters, and to determine the target filter according to the predicted value, wherein the target filter is one of the at least one candidate filter.
[0170] Optionally, the second calculation module 804 is further configured to:
[0171] The predicted value of the current coding unit is calculated based on the coefficients corresponding to each of the candidate filters;
[0172] The rate-distortion cost corresponding to each candidate filter is determined based on the predicted value;
[0173] The candidate filter with the lowest rate-distortion cost is determined as the target filter.
[0174] Optionally, the device further includes:
[0175] The first sending module is used to send a bit stream to the decoding end. The bit stream carries filter index information, which is used to indicate the target filter.
[0176] Optionally, the device further includes:
[0177] The second sending module is used to send a bitstream to the decoding end. The bitstream carries intra-frame prediction mode index information, which 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 determining module 803 is further configured to:
[0179] Based on the reconstructed pixel template, N coefficient groups corresponding to the first candidate filter are determined, 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 also used for:
[0181] The predicted values of the N undecoded pixels in the current coding unit are determined based on the N coefficient sets of the first candidate filter.
[0182] Optionally, the second calculation module 804 is further configured to perform any of the following:
[0183] When there is only one target pixel in the candidate filter, the predicted value of each uncoded pixel in each row of the current coding unit is calculated row by row from right to left.
[0184] If the number of target pixels in the candidate filter is greater than one, the predicted value of each uncoded pixel in each row of the current coding unit is calculated row by row in order from right to left or from left to right.
[0185] The solution provided in this application differs from the method in related technologies that forces the use of the upper reference row and left reference column that are equidistant from the current coding unit to obtain the predicted value. In this 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 situation of asymmetrical 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 this application embodiment 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 Figure 9 As shown, this application embodiment also provides an electronic device 900, including a processor 901 and a memory 902. The memory 902 stores a program or instructions that can run on the processor 901. For example, when the electronic device 900 is a decoding end, the program or instructions executed by the processor 901 implement the above-mentioned... Figure 2 Each step of the intra-frame prediction method embodiment can achieve the same technical effect. When the electronic device 900 is an encoding end, the program or instruction executed by the processor 901 implements the above. Figure 6 The steps of the intra-frame prediction method embodiment described herein are all the same and can achieve the same technical effect. To avoid repetition, they will not be repeated here.
[0188] This application also provides a terminal capable of implementing the steps in the above method embodiments. All implementation processes and methods of the above method embodiments are applicable to this terminal embodiment and can achieve the same technical effect. Specifically, Figure 10 A schematic diagram of the hardware structure of a terminal to implement an embodiment of this application.
[0189] The terminal 1000 includes, but is not limited to, at least some of the following components: radio frequency unit 1001, network module 1002, audio output unit 1003, input unit 1004, sensor 1005, display unit 1006, user input unit 1007, interface unit 1008, memory 1009, and processor 1010.
[0190] Those skilled in the art will understand that the terminal 1000 may also include a power supply (such as a battery) for supplying power to various components. The power supply may be logically connected to the processor 1010 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system. Figure 10 The terminal structure shown does not constitute a limitation on the terminal. The terminal may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be elaborated here.
[0191] It should be understood that, in this embodiment, the input unit 1004 may include a graphics processing unit (GPU) 10041 and a microphone 10042. The GPU 10041 processes image data of still images or videos obtained by an image capture device (such as a camera) in video capture mode or image capture mode. The display unit 1006 may include a display panel 10061, which 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 a touch detection device and a touch controller. Other input devices 10072 may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, power buttons, etc.), trackballs, mice, joysticks, etc., which will not be described in detail here.
[0192] In this embodiment, after receiving downlink data from the network-side device, the radio frequency unit 1001 can transmit it to the processor 1010 for processing; in addition, the radio frequency unit 1001 can send uplink data to the network-side device. Typically, the radio frequency unit 1001 includes, but is not limited to, antennas, amplifiers, transceivers, couplers, low-noise amplifiers, duplexers, etc.
[0193] The memory 1009 can be used to store software programs or instructions, as well as various data. The memory 1009 may primarily include a first storage area for storing programs or instructions and a second storage area for storing data. The first storage area may store the operating system, application programs or instructions required for at least one function (such as sound playback, image playback, etc.). Furthermore, the memory 1009 may include volatile memory or non-volatile memory. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus RAM (DRRAM). The memory 1009 in this embodiment 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 handles operations involving the operating system, user interface, and applications, and the modem processor mainly handles wireless communication signals, such as a baseband processor. It is understood that the aforementioned modem processor may also not be integrated into the processor 1010.
[0195] Where the terminal 1000 is a decoding terminal, the processor 1010 is configured to:
[0196] When the prediction mode of the current coding unit is the target mode, a target filter is determined, wherein the target filter is one of at least one candidate filter, the candidate filter includes sample pixels and target pixels, the sample pixels are pixels that have been decoded or have obtained a prediction value, the target pixels are pixels that have not been decoded in the current coding unit, and the sample pixels are located to the right or above the target pixels.
[0197] Obtain the reconstructed pixel template corresponding to the target filter;
[0198] The coefficients of the target filter are determined based on the reconstructed pixel template;
[0199] The predicted value of the current coding unit is calculated based on the coefficients of the target filter.
[0200] When the terminal 1000 is an encoding terminal, 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 sample pixels and target pixels, the sample pixels are pixels that have been encoded or have obtained a prediction value, the target pixels are pixels that have not been encoded in the current coding unit, and the sample pixels are located to the right or above the target pixels.
[0202] Obtain the reconstructed pixel template corresponding to each of the at least one candidate filter;
[0203] The coefficients corresponding to each of the at least one candidate filter are determined based on the reconstructed pixel template;
[0204] The predicted value of the current coding unit is calculated based on the coefficients corresponding to each of the candidate filters, and the target filter is determined based on the predicted value. The target filter is one of the at least one candidate filter.
[0205] In this embodiment, 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 situation of asymmetrical and uneven texture distribution in the video image, effectively improving the accuracy of intra-frame prediction.
[0206] It is 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, which achieve the same or corresponding technical effects, will not be repeated here to avoid duplication.
[0207] This application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above-described intra-frame prediction method embodiments and achieve the same technical effect. To avoid repetition, they will not be described again here.
[0208] The processor mentioned above is the processor in the terminal described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk. In some examples, the readable storage medium may be a non-transient readable storage medium.
[0209] This application embodiment also provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the various processes of the above-described intra-frame prediction method embodiments and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0210] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.
[0211] This application also provides a computer program / program product, which is stored in a storage medium and executed by at least one processor to implement the various processes of the above-described intra-frame prediction method embodiments, and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0212] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
[0213] From the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of computer software products plus necessary general-purpose hardware platforms, and of course, they can also be implemented by hardware. The computer software product is stored in a storage medium (such as ROM, RAM, magnetic disk, optical disk, etc.) and includes several instructions to cause the terminal or network-side device to execute the methods described in the various embodiments of this application.
[0214] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other implementations under the guidance of this application without departing from the spirit and scope of the claims. All of these implementations are within the protection scope of this application.
Claims
1. An intra-frame prediction method, characterized in that, include: When the prediction mode of the current coding unit is the target mode, the decoder determines the target filter, wherein the target filter is one of at least one candidate filter, the candidate filter includes sample pixels and target pixels, the sample pixels are pixels that have been decoded or have obtained a prediction value, the target pixels are pixels that have not been decoded in the current coding unit, and the sample pixels are located to the right and above the target pixels, or the sample pixels are located to the right of the target pixels; The decoding end obtains the 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 the predicted value of the current coding unit based on the coefficients of the target filter.
2. The method according to claim 1, characterized in that, The decoding end determines the target filter, including: The decoding end obtains the filter index information of the current encoding unit from the bit stream; The decoding end determines the filter corresponding to the filter index information among the at least one candidate filter as the target filter.
3. The method according to claim 1 or 2, characterized in that, When the number of target pixels in the target filter is N, and N is greater than or equal to 1, the decoding end determines the coefficients 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 pixels in the target filter, and M is a positive integer; The decoding end determines the predicted value of the current coding unit based on the coefficients of the target filter, including: The decoding end determines the predicted values of the N undecoded pixels in the current coding unit based on the N coefficient sets of the target filter.
4. The method according to claim 1 or 2, characterized in that, The calculation of the prediction value of the current coding unit includes any one of the following: When the number of target pixels in the target filter is one, the decoding end calculates the predicted value of each undecoded pixel in each row of the current encoding unit in order from right to left. When the number of target pixels in the target filter is greater than one, the decoding end calculates the predicted value of each undecoded pixel in each row of the current encoding unit in order from right to left or from left to right.
5. The method according to any one of claims 1-4, characterized in that, The method further includes: The decoding end obtains the intra-frame prediction mode index information of the current coding unit from the bitstream; 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, characterized in that, include: When the prediction mode of the current coding unit is the target mode, the encoder determines at least one candidate filter, wherein the candidate filter includes sample pixels and target pixels, the sample pixels are pixels that have been encoded or have obtained a prediction value, the target pixels are pixels that have not been encoded in the current coding unit, and the sample pixels are located to the right and above the target pixels, or the sample pixels are located to the right of the target pixels. The encoding end obtains the reconstructed pixel template corresponding to each of the at least one candidate filter; 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 predicted value of the current encoding unit based on the coefficients corresponding to each of the candidate filters, and determines the target filter based on the predicted value. The target filter is one of the at least one candidate filter.
7. The method according to claim 6, characterized in that, The encoding end calculates the predicted value of the current encoding unit based on the coefficients corresponding to each candidate filter, and determines the target filter based on the predicted value, including: The encoding end calculates the predicted value of the current encoding unit based on the coefficients corresponding to each candidate filter; The encoding end determines the rate-distortion cost corresponding to each candidate filter based on the predicted value. The encoding end determines the candidate filter with the lowest rate-distortion cost as the target filter.
8. The method according to claim 6, characterized in that, The method further includes: The encoding end sends a bitstream to the decoding end, and the bitstream carries filter index information, which is used to indicate the target filter.
9. The method according to claim 6, characterized in that, The method further includes: The encoding end sends a bitstream to the decoding end. The bitstream carries intra-frame prediction mode index information, which 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-9, characterized in that, When the number of target pixels in the candidate filters 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: The encoding end determines N coefficient groups corresponding to the 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 predicted value of the current encoding unit based on the coefficients corresponding to each candidate filter, including: The encoding end determines the predicted values of N uncoded pixels in the current encoding unit based on the N coefficient sets of the first candidate filter.
11. The method according to any one of claims 6-9, characterized in that, The calculation of 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 predicted value of each unencoded pixel in each row of the current encoding unit in order from right to left. When the number of target pixels in the candidate filter is greater than one, the encoding end calculates the predicted value of each unencoded pixel in each row of the current encoding unit in order from right to left or from left to right.
12. An intra-frame prediction device, characterized in that, include: The first determining module is configured 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 sample pixels and target pixels, the sample pixels are pixels that have been decoded or have obtained a prediction value, the target pixels are pixels that have not been decoded in the current coding unit, and the sample pixels are located to the right and above the target pixels, or the sample pixels are located to the right of the target pixels; The first acquisition module is used to acquire the reconstructed pixel template corresponding to the target filter; The second determining module is used to determine the coefficients of the target filter based on the reconstructed pixel template; The first calculation module is used to calculate the predicted value of the current coding unit based on the coefficients of the target filter.
13. An intra-frame prediction device, characterized in that, include: The third determining module is used to determine at least one candidate filter when the prediction mode of the current coding unit is the target mode. The candidate filter includes sample pixels and target pixels. The sample pixels are pixels that have been encoded or have obtained a prediction value. The target pixels are pixels that have not been encoded in the current coding unit. The sample pixels are located to the right and above the target pixels, or the sample pixels are located to the right of the target pixels. The second acquisition module is used to acquire the reconstructed pixel templates corresponding to each of the at least one candidate filter; The fourth determining module is used to determine the 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 predicted value of the current coding unit according to the coefficients corresponding to each of the candidate filters, and to determine the target filter according to the predicted value, wherein the target filter is one of the at least one candidate filter.
14. An electronic device, characterized in that, It includes a processor and a memory, the memory storing a program or instructions that can run on the processor, the program or instructions being executed by the processor to implement the steps of the intra-frame prediction method as described in any one of claims 1-11.
15. A readable storage medium, characterized in that, The readable storage medium stores a program or instructions that, when executed by a processor, implement the steps of the intra-frame prediction method as described in any one of claims 1-11.
16. A chip, characterized in that, The chip includes a processor and a communication interface, the communication interface being coupled to the processor, the processor being used to run programs or instructions to implement the intra-frame prediction method as described in any one of claims 1-11.
Citation Information
Patent Citations
Video intra-frame coding method based on hierarchical flexible block sequence
CN106254866A