WO2024255720A1 - 帧内预测方法、装置、电子设备及可读存储介质 - Google Patents
帧内预测方法、装置、电子设备及可读存储介质 Download PDFInfo
- Publication number
- WO2024255720A1 WO2024255720A1 PCT/CN2024/098319 CN2024098319W WO2024255720A1 WO 2024255720 A1 WO2024255720 A1 WO 2024255720A1 CN 2024098319 W CN2024098319 W CN 2024098319W WO 2024255720 A1 WO2024255720 A1 WO 2024255720A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- filter
- target
- coding unit
- current coding
- pixel point
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/102—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
- H04N19/103—Selection of coding mode or of prediction mode
- H04N19/11—Selection of coding mode or of prediction mode among a plurality of spatial predictive coding modes
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/102—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
- H04N19/103—Selection of coding mode or of prediction mode
- H04N19/105—Selection of the reference unit for prediction within a chosen coding or prediction mode, e.g. adaptive choice of position and number of pixels used for prediction
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/102—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
- H04N19/117—Filters, e.g. for pre-processing or post-processing
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/102—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
- H04N19/129—Scanning of coding units, e.g. zig-zag scan of transform coefficients or flexible macroblock ordering [FMO]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/134—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
- H04N19/157—Assigned coding mode, i.e. the coding mode being predefined or preselected to be further used for selection of another element or parameter
- H04N19/159—Prediction type, e.g. intra-frame, inter-frame or bidirectional frame prediction
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/169—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
- H04N19/182—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being a pixel
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/50—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
- H04N19/593—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving spatial prediction techniques
Definitions
- 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.
- the video encoder adopts a block-based hybrid coding framework.
- the coding process includes: block partitioning, 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.
- CTU non-overlapping coding tree units
- CU coding units
- 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.
- 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.
- 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.
- an intra-frame prediction method which is performed by a decoding end and includes:
- 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.
- an intra-frame prediction method which is performed by an encoding end and includes:
- the encoding end determines at least one candidate filter, wherein the candidate filter includes a sample pixel point and a target pixel point, and the sample pixel point is a coded or obtained A pixel point of a predicted value, wherein the target pixel point is a pixel point that is not 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.
- an intra-frame prediction device including:
- 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.
- an intra-frame prediction device including:
- 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.
- an electronic device 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.
- a readable storage medium on which a program or instruction is stored.
- 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.
- a chip comprising a processor and a communication interface, the communication interface is coupled to the processor, the processor is used to run a program or instruction to implement the method as described in the first aspect, or to implement the method as described in the first aspect. The method described in the second 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.
- 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.
- 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.
- FIG. 1a is a schematic diagram of three positions of a reconstructed pixel area and a current coding unit in the related art
- FIG1b is a schematic diagram of three filters of different shapes in the related art
- FIG2 is a flow chart of an intra-frame prediction method provided by an embodiment of the present application.
- FIG3 is one of three schematic diagrams of candidate filters of different shapes applicable in an embodiment of the present application.
- FIG4 is a schematic diagram of three positions of a reconstructed pixel template and a current coding unit applicable in an embodiment of the present application;
- FIG5 is a second schematic diagram of three candidate filters of different shapes applicable in an embodiment of the present application.
- FIG6 is a flowchart of another intra-frame prediction method provided by an embodiment of the present application.
- FIG7 is a structural diagram of an intra-frame prediction device provided in an embodiment of the present application.
- FIG8 is a structural diagram of another intra-frame prediction device provided in an embodiment of the present application.
- FIG9 is a structural diagram of an electronic device provided in an embodiment of the present application.
- FIG. 10 is a structural diagram of a terminal provided in an embodiment of the present application.
- first, second, etc. in this 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 the same type, and the number of objects is not limited.
- the first object can be one or more.
- “or” in this application means at least one of the connected objects.
- “A or B” covers three schemes, namely, scheme one: Including A but excluding B; Option 2: Including B but excluding A; Option 3: Including both A and B.
- the character "/" generally indicates that the related objects are in an "or” relationship.
- the encoder adopts the 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 direct current (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.
- DC direct current
- an implementation step of an extrapolation filter-based intra prediction mode is as follows:
- FIG. 1b Obtain a reconstructed pixel area above and/or to the left of the current coding unit (also called prediction unit, PU) as shown in FIG. 1a, and respectively calculate 15-tap filter coefficients of three shapes as shown in FIG. 1b.
- the calculation method may be the same as the method for calculating the filter coefficients in the convolutional cross-component intra prediction model (CCCM) in the enhanced compression model (ECM) in the related art.
- CCCM convolutional cross-component intra prediction model
- ECM enhanced compression model
- 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 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 subjected to LDL (Lower triangular matrix (L), diagonal matrix (D), transposed lower triangular matrix (L)) decomposition and the final filter coefficients are calculated using inverse permutation.
- 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.
- the present application embodiment proposes a new intra-frame prediction method.
- Figure 2 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. As shown in Figure 2, the method includes the following steps:
- Step 201 When the prediction mode of the current coding unit is the target mode, the decoding end determines a target filter.
- 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
- the sample pixel points are located on the right side or above the target pixel points.
- FIG3 shows three candidate filters of different shapes (a), (b), and (c), respectively, wherein each gray box represents a sample pixel, and the white box represents a target pixel, which is also an undecoded pixel in the current coding unit, and the sample pixel is a pixel in the image frame that has been decoded or has obtained a predicted value, and the sample pixel is located on the right side or upper side of the target pixel.
- the sample pixel is located on the right side and upper side of the target pixel, that is, the target pixel is located at the lower left corner of the sample pixel.
- the target filter is one of the candidate filters, that is, the target filter also includes sample pixels and target pixels.
- 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
- 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.
- 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.
- the target pixel point in the target filter is also the second pixel point.
- 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.
- the target mode may be a certain specific intra-frame prediction mode, such as an EIP mode, or other intra-frame prediction modes.
- 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.
- the method may further include:
- 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.
- 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.
- 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.
- 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.
- the decoding end determines the 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.
- 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.
- 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.
- 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.
- Step 202 The decoding end obtains a reconstructed pixel template corresponding to the target filter.
- different candidate filters may correspond to different reconstructed pixel templates.
- the three candidate filters correspond to three different reconstructed pixel templates, respectively, wherein the candidate filter (a) in FIG. 3 corresponds to the reconstructed pixel template shown in FIG. 4 (c), that is, the candidate filter corresponds to the template composed of the decoded reconstructed pixels on the upper and right sides of the current coding unit; the candidate filter (b) in FIG. 3 corresponds to the reconstructed pixel template shown in FIG. 4 (a), that is, the candidate filter corresponds to the template composed of the decoded reconstructed pixels on the upper side of the current coding unit; the candidate filter (c) in FIG. 3 corresponds to the reconstructed pixel template shown in FIG. 4 (b), that is, the candidate filter corresponds to the template composed of the decoded reconstructed pixels on the right side of the current coding unit.
- the decoding end after the decoding end determines the target filter, that is, a candidate filter, it can obtain the reconstructed pixel template corresponding to it.
- the correspondence between the candidate filter and the reconstructed pixel template can be established in advance.
- the forms of the candidate filters and the reconstructed pixel templates and the correspondence between the two shown in Figures 3 and 4 above are only examples and do not constitute a limitation on the embodiments of the present application.
- the forms of the candidate filters and the reconstructed pixel templates in the embodiments of the present application and the correspondence between the two may also be other possible situations.
- Step 203 The decoding end determines the coefficients of the target filter based on the reconstructed pixel template.
- the decoding end 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.
- Step 204 The decoding end calculates a prediction value of the current coding unit based on the coefficients of the target filter.
- the decoding end 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.
- the target filter can obtain the prediction value of one pixel in the current coding unit each time, and the decoding end obtains the prediction value of each pixel in each row of the current coding unit from right to left based on the target filter, wherein the prediction value of each pixel in the first row is obtained first, and then the prediction value of each pixel in the second row is obtained, and the prediction value of each pixel in each row is obtained row by row from top to bottom.
- the target pixel and sample pixel in the target filter also change accordingly.
- the number of coefficients of the target filter is the same as the number of sample pixels in the target filter. For example, taking the target filter as the filter shown in (a) of FIG. 3 as an example, the target filter includes 15 sample pixels, and the decoding end will obtain 15 filter coefficients.
- the decoding end can be to 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, and 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, and the prediction value of the pixel points to be predicted in the current coding unit is determined based on these 15 products. For example, the average value of these 15 products can be used as the prediction value of the pixel points 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.
- 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.
- 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 in the current coding unit based on the coefficient of the target filter.
- the target filter includes sample pixel points and target pixel points, the sample pixel points are decoded pixels or pixels that have obtained predicted values, the target pixel points are undecoded pixels in the current coding unit (that is, pixels to be predicted), and the sample pixel points are located on the right side or upper side of the target pixel points, that is, the undecoded pixels in the current coding unit are located on the decoded sample pixel points (which may be outside the current coding unit).
- the decoded reconstructed pixel may also be the right or upper side of the sample point that has obtained the predicted value in the current coding unit, and the current coding unit is predicted based on these sample pixel points.
- 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 decoding efficiency.
- the number of the target pixel points is at least one.
- the number of target pixel points (i.e., white boxes) included in each candidate filter is one; the number of target pixel points included in the candidate filter shown in FIG5 (a) is 4, the number of target pixel points included in the candidate filter shown in FIG5 (b) is 8, and the number of target pixel points included in the candidate filter shown in FIG5 (c) is 2.
- 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, and the above FIG. 5 does not constitute a limitation on the candidate filter in the embodiment of the present application.
- 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:
- 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.
- the coefficients are filter coefficients.
- the number of target pixels in the target filter may be one or more.
- the decoding end can predict the predicted value of an undecoded pixel (also referred to as a pixel to be predicted) in the current coding unit each time.
- 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 these 15 filter coefficients.
- the undecoded pixel is also the target pixel in the target filter, and the predicted value of each undecoded pixel in the current coding unit is obtained one by one based on this method.
- the specific implementation method of calculating the predicted value of the undecoded pixel based on the filter coefficient can be referenced 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.
- the target filter is the filter shown in FIG5 , that is, the number of target pixels in the target filter is greater than one.
- the target filter is the filter shown in FIG5 (a)
- the decoder can predict each time when Prediction values of 4 undecoded pixels in the previous coding unit.
- the decoding end 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, and the decoding end calculates the prediction values of 4 undecoded pixels in the current coding unit based on these 4 coefficient groups and 12 filter coefficients in each group, that is, the decoding end can obtain the prediction values of 4 undecoded pixels at the same time, which can effectively improve the decoding efficiency of the decoding end.
- 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.
- the M coefficients in a coefficient group are used to calculate the predicted value of an undecoded pixel
- 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.
- 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.
- the determining the prediction value of the current coding unit includes any one of the following:
- 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;
- 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.
- 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 ⁇ columns of pixels.
- the decoding end can calculate the prediction value of each undecoded pixel in the current coding unit in sequence from right to left and from top to bottom, that is, first calculate the prediction value of each undecoded pixel in the first row one by one from right to left, then calculate the prediction value of each undecoded pixel in the second row one by one from right to left, and then calculate the prediction value of each undecoded pixel in the third row one by one 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.
- the decoding end can simultaneously obtain the predicted values of N undecoded pixels in the current coding unit each time, and the decoding end can calculate the predicted values of each undecoded pixel row by row in a right-to-left or left-to-right order for each row.
- the predicted values of the N undecoded pixels in the first row are calculated each time in a right-to-left order
- the predicted values of the N undecoded pixels in the second row are calculated each time in a right-to-left order
- the predicted values of the N undecoded pixels in the third row are calculated each time in a right-to-left order.
- the predicted values of each undecoded pixel in each row are calculated row by row in a right-to-left order, thereby completing the prediction of the current coding unit.
- 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.
- 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.
- Step S11 The decoding end determines that the prediction mode of the current coding unit to be decoded is the EIP mode
- 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) according to the filter index information;
- the candidate filters in this embodiment include three types as shown in FIG. 3 , but are not limited thereto, and the candidate filters may also have other shapes; it should be noted that the pixel to be predicted (the white box in FIG. 3 ) is located at the lower left corner of the filter;
- 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, in combination with Figures 3 and 4:
- 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.
- Step S21 The decoding end determines that the prediction mode of the current coding unit to be decoded is the EIP mode
- 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 include three types as shown in FIG5 , but are not limited thereto, and may also have other shapes; it should be noted that the pixel to be predicted is located in the bottom row of the filter (the white box in FIG5 );
- 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 from the relevant technology and embodiment 1 is that embodiment 1 and the relevant technology obtain a set of coefficients for each filter, and only obtain the predicted value of one pixel point each time; this embodiment obtains N sets of coefficients for each filter, N is equal to the width of the filter (such as the number of white boxes in Figure 5), and uses the gray sample points (gray boxes) in each filter in Figure 5 to calculate and obtain the bottom row
- the prediction value of each pixel point the advantage of this embodiment is that it can reduce the dependence of the current pixel point to be decoded on the sample point on the left in the same row, and the prediction values of the pixel points at N positions can be obtained at one time, which effectively improves the decoding efficiency;
- 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.
- 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. As shown in Figure 6, the method includes the following steps:
- Step 601 When the prediction mode of the current coding unit is the target mode, the encoding end determines at least one candidate filter.
- 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.
- 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.
- the shape of the candidate filter may be predetermined by the encoding end and the decoding end, for example, the candidate filter may be in the shape shown in Figures 3 and 5.
- the candidate filter may be in the shape shown in Figures 3 and 5.
- Step 602 The encoding end obtains a reconstructed pixel template corresponding to each of the at least one candidate filters
- Step 603 The encoding end determines coefficients corresponding to each of the at least one candidate filter based on the reconstructed pixel template
- 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.
- 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.
- 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.
- the encoding end calculates a predicted 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, and 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, which is different from the related art in which the distance to the current coding unit is forcibly used.
- 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.
- 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.
- 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.
- 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.
- 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.
- each candidate filter may include a corresponding identifier, which may be known to both the encoding end and the decoding end.
- 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.
- 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.
- 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.
- 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 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.
- the calculating the prediction value of the current coding unit includes any one of the following:
- 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;
- 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.
- the specific implementation method of the encoding end 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 may be the same as that of the decoding end.
- the intra-frame prediction method provided in the embodiment of the present application can be performed by an intra-frame prediction device.
- 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.
- FIG. 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.
- the intra-frame prediction device 700 includes:
- 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;
- a first acquisition module 702 used to acquire a reconstructed pixel template corresponding to the target filter
- a second determination module 703, configured to determine coefficients of the target filter based on the reconstructed pixel template
- 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.
- the first determining module 701 is further configured to:
- a filter corresponding to the filter index information among the at least one candidate filter is determined as a target filter.
- the number of the target pixel points is at least one.
- the second determining module 703 is further used to:
- 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 first calculation module 704 is further used for:
- the first calculation module 704 is further configured to perform any one of the following:
- 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.
- the first determining module 701 is further configured to:
- 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.
- 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 it can be other devices other than a terminal.
- the terminal can include but is not limited to the types of terminals listed above, and other devices can be servers, network attached storage (NAS), etc., which are not specifically limited in the embodiment of the present application.
- the intra-frame prediction device provided in the embodiment of the present application can implement each process implemented in the method embodiment of Figure 2 and achieve the same technical effect. To avoid repetition, it will not be repeated here.
- FIG8 is a structural diagram of another intra-frame prediction device provided in an embodiment of the present application, and the device is applied to an encoding end.
- the intra-frame prediction device 800 includes:
- 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;
- a second acquisition module 802 is used to acquire a reconstructed pixel template corresponding to each of the at least one candidate filters
- 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
- 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.
- the second calculation module 804 is further configured to:
- the candidate filter with the smallest rate-distortion cost is determined as the target filter.
- the device further comprises:
- 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.
- the device further comprises:
- 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.
- the fourth determination module 803 is further used to:
- 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 second calculation module 804 is further used for:
- the second calculation module 804 is further configured to perform any one of the following:
- 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.
- 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.
- the intra-frame prediction device provided in the embodiment of the present application can implement each process implemented in the method embodiment of Figure 6 and achieve the same technical effect. To avoid repetition, it will not be repeated here.
- 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.
- the program or instruction is executed by the processor 901 to implement the various steps of the embodiment of the intra-frame prediction method described in FIG2 above, and can achieve the same technical effect.
- the program or instruction is executed by the processor 901 to implement the various steps of the embodiment of the intra-frame prediction method described in FIG6 above, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
- FIG. 10 is a schematic diagram of the hardware structure of a terminal that implements the embodiment of the present application.
- 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.
- the terminal 1000 may also include a power source (such as a battery) for supplying power to each component, and the power source may be logically connected to the processor 1010 through a power management system, so as to implement functions such as managing charging, discharging, and power consumption management through the power management system.
- a power source such as a battery
- the terminal structure shown in FIG10 does not constitute a limitation on the terminal, and the terminal may include more or fewer components than shown in the figure, or combine certain components, or arrange components differently, which will not be described in detail here.
- 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 a volume control key, a switch key, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.
- 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.
- 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.
- 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.
- the memory 1009 may include a volatile memory or a non-volatile memory.
- 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).
- RAM random access memory
- SRAM static random access memory
- DRAM dynamic random access memory
- SDRAM synchronous dynamic random access memory
- DDRSDRAM double data rate synchronous dynamic random access memory
- ESDRAM enhanced synchronous dynamic random access memory
- SLDRAM synchronous link dynamic random access memory
- DRRAM direct memory bus random access memory
- 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, etc.
- 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.
- the processor 1010 is configured to:
- 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;
- a prediction value of the current coding unit is calculated based on coefficients of the target filter.
- the processor 1010 is configured to:
- 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 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.
- 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.
- An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored.
- a program or instruction is stored.
- 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.
- 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.
- the readable storage medium may be a non-transient readable storage medium.
- 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.
- 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.
- the present application embodiment further provides a computer program/program product, wherein the computer program/program product is stored In the 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.
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Compression Or Coding Systems Of Tv Signals (AREA)
Abstract
本申请公开了一种帧内预测方法、装置、电子设备及可读存储介质,属于视频编解码技术领域,本申请实施例的帧内预测方法包括:在当前编码单元的预测模式为目标模式的情况下,解码端确定目标滤波器,其中,所述目标滤波器为至少一个候选滤波器中的其中一个,所述候选滤波器包括样本像素点和目标像素点,所述样本像素点为已解码或者已获得预测值的像素点,所述目标像素点为所述当前编码单元中未解码的像素点,所述样本像素点位于所述目标像素点的右侧或上侧;所述解码端获取与所述目标滤波器对应的重建像素模板;所述解码端基于所述重建像素模板确定所述目标滤波器的系数;所述解码端基于所述目标滤波器的系数计算所述当前编码单元的预测值。
Description
相关申请的交叉引用
本申请主张在2023年06月16日提交的中国专利申请No.202310719342.8的优先权,其全部内容通过引用包含于此。
本申请属于视频编解码技术领域,具体涉及一种帧内预测方法、装置、电子设备及可读存储介质。
视频编码器采用基于块的混合编码框架,编码流程包括:块划分、帧内预测、帧间预测、变换、量化、环路滤波和熵编码。编码器首先将图像划分为不重叠的编码树单元(Coding Tree Unit,CTU),按照四叉树划分成不同编码单元(Coding Unit,CU),编码器按照从上到下、从左到右的顺序编码各编码单元,解码端也按照相同的顺序解码当前帧各编码单元。而图像纹理分布存在多样性,当上方和左方的纹理分布不同或者不均匀时,相关技术中强制使用与当前编码单元距离相同的上边参考行和左边参考列获得的预测值也就不准确。
发明内容
本申请实施例提供一种帧内预测方法、装置、电子设备及可读存储介质,能够解决相关技术中强制使用与当前编码单元距离相同的上边参考行和左边参考列获得的预测值不准确的问题。
第一方面,提供了一种帧内预测方法,由解码端执行,包括:
在当前编码单元的预测模式为目标模式的情况下,解码端确定目标滤波器,其中,所述目标滤波器为至少一个候选滤波器中的其中一个,所述候选滤波器包括样本像素点和目标像素点,所述样本像素点为已解码或者已获得预测值的像素点,所述目标像素点为所述当前编码单元中未解码的像素点,所述样本像素点位于所述目标像素点的右侧或上侧;
所述解码端获取与所述目标滤波器对应的重建像素模板;
所述解码端基于所述重建像素模板确定所述目标滤波器的系数;
所述解码端基于所述目标滤波器的系数计算所述当前编码单元的预测值。
第二方面,提供了一种帧内预测方法,由编码端执行,包括:
在当前编码单元的预测模式为目标模式的情况下,编码端确定至少一个候选滤波器,其中,所述候选滤波器包括样本像素点和目标像素点,所述样本像素点为已编码或者已获
得预测值的像素点,所述目标像素点为所述当前编码单元中未编码的像素点,所述样本像素点位于所述目标像素点的右侧或上侧;
所述编码端获取所述至少一个候选滤波器各自对应的重建像素模板;
所述编码端基于所述重建像素模板确定所述至少一个候选滤波器各自对应的系数;
所述编码端根据每一个所述候选滤波器对应的系数分别计算所述当前编码单元的预测值,并根据所述预测值确定目标滤波器,所述目标滤波器为所述至少一个候选滤波器中的其中一个。
第三方面,提供了一种帧内预测装置,包括:
第一确定模块,用于在当前编码单元的预测模式为目标模式的情况下,确定目标滤波器,其中,所述目标滤波器为至少一个候选滤波器中的其中一个,所述候选滤波器包括样本像素点和目标像素点,所述样本像素点为已解码或者已获得预测值的像素点,所述目标像素点为所述当前编码单元中未解码的像素点,所述样本像素点位于所述目标像素点的右侧或上侧;
第一获取模块,用于获取与所述目标滤波器对应的重建像素模板;
第二确定模块,用于基于所述重建像素模板确定所述目标滤波器的系数;
第一计算模块,用于基于所述目标滤波器的系数计算所述当前编码单元的预测值。
第四方面,提供了一种帧内预测装置,包括:
第三确定模块,用于在当前编码单元的预测模式为目标模式的情况下,确定至少一个候选滤波器,其中,所述候选滤波器包括样本像素点和目标像素点,所述样本像素点为已编码或者已获得预测值的像素点,所述目标像素点为所述当前编码单元中未编码的像素点,所述样本像素点位于所述目标像素点的右侧或上侧;
第二获取模块,用于获取所述至少一个候选滤波器各自对应的重建像素模板;
第四确定模块,用于基于所述重建像素模板确定所述至少一个候选滤波器各自对应的系数;
第二计算模块,用于根据每一个所述候选滤波器对应的系数分别计算所述当前编码单元的预测值,并根据所述预测值确定目标滤波器,所述目标滤波器为所述至少一个候选滤波器中的其中一个。
第五方面,提供了一种电子设备,包括处理器和存储器,所述存储器存储可在所述处理器上运行的程序或指令,所述程序或指令被所述处理器执行时实现如第一方面或第二方面所述的帧内预测方法的步骤。
第六方面,提供了一种可读存储介质,所述可读存储介质上存储程序或指令,所述程序或指令被处理器执行时实现如第一方面所述的方法的步骤,或者实现如第二方面所述的方法的步骤。
第七方面,提供了一种芯片,所述芯片包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行程序或指令,实现如第一方面所述的方法,或者实现如
第二方面所述的方法。
第八方面,提供了一种计算机程序/程序产品,所述计算机程序/程序产品被存储在存储介质中,所述程序/程序产品被至少一个处理器执行以实现如第一方面所述的方法的步骤,或者实现如第二方面所述的方法的步骤。
在本申请实施例中,目标滤波器包括样本像素点和目标像素点,所述样本像素点为已解码的像素点,所述目标像素点为所述当前编码单元中未解码的像素点,所述样本像素点位于所述目标像素点的右侧或上侧,也即当前编码单元中未解码像素点位于已解码的样本像素点的右侧或上侧,基于这些样本像素点来对当前编码单元进行预测,与相关技术中强制使用与当前编码单元距离相同的上边参考行和左边参考列获得的预测值的方法不同,本申请实施例中并不限定样本像素点与当前编码单元中待预测像素点之间的距离,也就考虑了视频图像中纹理分布不对称、不均匀的情况,有效提升帧内预测准确度。
图1a是相关技术中重建像素区域与当前编码单元的三种位置示意图;
图1b是相关技术中三种不同形状滤波器的示意图;
图2是本申请实施例提供的一种帧内预测方法的流程图;
图3是本申请实施例中可应用的三种不同形状候选滤波器的示意图之一;
图4是本申请实施例中可应用的重建像素模板与当前编码单元的三种位置示意图;
图5是本申请实施例中可应用的三种不同形状候选滤波器的示意图之二;
图6是本申请实施例提供的另一种帧内预测方法的流程图;
图7是本申请实施例提供的一种帧内预测装置的结构图;
图8是本申请实施例提供的另一种帧内预测装置的结构图;
图9是本申请实施例提供的一种电子设备的结构图;
图10是本申请实施例提供的一种终端的结构图。
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员所获得的所有其他实施例,都属于本申请保护的范围。
本申请的术语“第一”、“第二”等是用于区别类似的对象,而不用于描述特定的顺序或先后次序。应该理解这样使用的术语在适当情况下可以互换,以便本申请的实施例能够以除了在这里图示或描述的那些以外的顺序实施,且“第一”、“第二”所区别的对象通常为一类,并不限定对象的个数,例如第一对象可以是一个,也可以是多个。此外,本申请中的“或”表示所连接对象的至少其中之一。例如“A或B”涵盖三种方案,即,方案一:
包括A且不包括B;方案二:包括B且不包括A;方案三:既包括A又包括B。字符“/”一般表示前后关联对象是一种“或”的关系。
为更好地理解,以下对本申请实施例中可能涉及的相关概念进行解释说明。
目前,编码器采用基于图像纹理相关性的帧内预测技术,以当前编码单元相邻的上边一行和左边一列重建样本作为参考,通过遍历直流(Direct Current,DC)模式、平面(Planar)模式和角度预测模式,利用率失真代价选择最优帧内预测模式来去除块的空间冗余。
相关技术中,在编码端,一种基于外插滤波器的帧内预测模式(Extrapolation filter-based intra prediction mode,EIP)的实现步骤如下:
1.获取如图1a所示的当前编码单元(也称预测单元Prediction Unit,PU)上方和/或左方的重建像素区域(reconstructed area),分别计算如图1b所示的三种形状的15抽头滤波器系数,计算方法可以是按照相关技术中增强的压缩模型(Enhanced Compression Model,ECM)中卷积跨分量帧内预测模型(Convolutional Cross-Component intra Model,CCCM)中计算滤波器系数相同的方法,以图1b为例,具体地:
滤波器系数通过最小化重建像素区域中的白色样本和灰色样本之间的均方误差(mean-square error,MSE)来计算的。MSE最小化是通过计算以15个灰色样本点的重建值作为输入的自相关矩阵,以及15个灰色输入样本点和1个白色输出样本点之间的互相关向量来执行的。对自相关矩阵进行LDL(下三角矩阵(Lower triangular matrix,L)、对角矩阵(Diagonal matrix,D)、转置下三角矩阵(transposed Lower triangular matrix,L))分解,并使用反置换计算最终滤波器系数。
2.分别使用图1b所示的三种形状的外插滤波器,按照从当前编码单元左上角第一个样本点开始,从左到右、从上到下的顺序计算获得每个样本点的预测值;图1b中,灰色样本点的值为EIP模式的输入(input),右下角白色样本点为EIP模式的输出(output),也即需要获取的预测值;
3.分别计算EIP模式下使用三种形状外插滤波器获得的当前编码单元的预测值,进而计算率失真代价,与其他预测模式的率失真代价进行比较。如果EIP模式的率失真代价最小,则将EIP模式标识信息设置为1,连同所选择的滤波器(也即1b所示的三种滤波器中的一种)索引信息,一起写入码流。
解码端在获得当前待解码的编码单元为EIP模式之后,解析所选择的滤波器的索引值。按照与编码端相同的方式利用当前待解码的编码单元上方和/或左方的已解码重建像素值获得所述滤波器系数,进而按照从上到下、从左到右的顺序计算获得当前编码单元中各样本点的预测值,与从码流中获得当前编码单元的残差信息计算得到的残差值相加获得重建值。
而图像纹理分布存在多样性,当上方和左方的纹理分布不同或者不均匀时,相关技术中强制使用与当前编码单元距离相同的上边参考行和左边参考列获得的预测值也就不准确。本申请实施例提出了一种新的帧内预测方法。
下面结合附图,通过一些实施例及其应用场景对本申请实施例提供的帧内预测方法、装置及相关设备进行详细地说明。
请参照图2,图2是本申请实施例提供的一种帧内预测方法的流程图,所述方法应用于解码端。如图2所示,所述方法包括以下步骤:
步骤201、在当前编码单元的预测模式为目标模式的情况下,解码端确定目标滤波器。
其中,所述目标滤波器为至少一个候选滤波器中的其中一个,所述候选滤波器包括样本像素点和目标像素点,所述样本像素点为已解码或者已获得预测值的像素点,所述目标像素点为所述当前编码单元中未解码的像素点,所述样本像素点位于所述目标像素点的右侧或上侧。
示例性地,如图3所示,图3中分别示出了(a)、(b)、(c)三种不同形状的候选滤波器,其中每一个灰色框代表一个样本像素点,白色框代表目标像素点,该目标像素点也即当前编码单元中未解码的像素点,样本像素点为图像帧中已解码或者已获得预测值的像素点,且样本像素点位于目标像素点的右侧或上侧,图3中示出的三种候选滤波器中,样本像素点位于目标像素点的右侧和上侧,也即目标像素点位于样本像素点的左下角。需要说明的是,以上仅是本申请实施例中可能的三种候选滤波器形式,但并不限于此,本申请实施例所提供的候选滤波器还可以是其他的可能形式。
本申请实施例中,目标滤波器为候选滤波器中的一个,也即目标滤波器同样包括样本像素点和目标像素点。
其中,目标像素点为当前编码单元中未解码的像素点,样本像素点为已解码的或者已获得预测值的像素点,也即样本像素点是位于当前编码单元中待预测样本点上侧或右侧的像素点,目标滤波器可以是以目标像素点的数量为步长进行移动。例如,若目标像素点的数量为一个,则解码端每次解码当前编码单元中的一个像素点,依次对当前编码单元的像素点逐个进行解码预测,示例性地,可以是先解码当前编码单元最上边一行右边的第一个像素点,则目标滤波器中的目标像素点也即该第一个像素点,当解码完该第一个像素点,则对当前编码单元最上边一行的右边第二个像素点进行解码,此时目标滤波器中的目标像素点也即该第二个像素点,则此时目标滤波器整体向右移动了一个像素点的步长,则样本像素点也同样发生了改变。这样,解码端能够基于这样的方式获取当前编码单元中各像素点就的预测值。
本申请实施例中,所述目标模式可以是某种特定的帧内预测模式,例如可以是EIP模式,或者其他帧内预测模式。示例性地,所述目标模式可以是解码端和编码端已经约定的帧内预测模式,或者也可以是解码端通过码流中的信息来确定的帧内预测模式。
可选地,所述步骤201之前,所述方法还可以包括:
所述解码端从码流中获取所述当前编码单元的帧内预测模式索引信息;
所述解码端基于所述帧内预测模式索引信息确定所述当前编码单元的预测模式是否为所述目标模式。
需要说明地,编码端发送给解码端的码流中包括帧内预测模式索引信息,用于表征编码端所使用的帧内预测模式,进而解码端基于所述帧内预测模式索引信息也就能够确定编码端所使用的帧内预测模式是哪种,也就能够确定所使用的帧内预测模式是否为目标模式,从而使得解码端能够使用与编码端相同的帧内预测模式来进行当前编码单元的解码,以确保解码端能够获得与编码端一致的预测值。
示例性地,以所述目标模式为EIP模式为例,若编码端使用的帧内预测模式为EIP模式,则将所述帧内预测模式索引信息标识为1,若编码端使用的不是EIP模式,则可以是将所述帧内预测模式索引信息标识为0,或是其他帧内预测模式对应的标识;编码端将该帧内预测模式索引信息写入码流,并发送给解码端,进而解码端就能够通过识别所述帧内预测模式索引信息标识是否为1,来确定对当前编码单元的预测模式是否为EIP模式。
本申请实施例中,目标滤波器为候选滤波器中的一个,解码端从候选滤波器中随机选择一个作为目标滤波器,或者也可以是基于从码流中获取的信息来确定目标滤波器。
可选地,所述解码端确定目标滤波器,包括:
所述解码端从码流中获取所述当前编码单元的滤波器索引信息;
所述解码端将所述至少一个候选滤波器中与所述滤波器索引信息对应的滤波器确定为目标滤波器。
本申请实施例中,候选滤波器可能为多个,编码端可以是从中选择一个作为目标滤波器,基于目标滤波器来对当前编码单元进行编码。编码端可以是在发送给解码端的码流中写入滤波器索引信息,所述滤波器索引信息用于表征编码端所使用的目标滤波器,进而解码端也就能够基于码流中的滤波器索引信息来确定编码端所使用的目标滤波器是哪一个,从而使用与编码端相同的目标滤波器来对当前编码单元进行解码,以确保解码端能够获得与编码端一致的预测值。
需要说明地,编码端与解码端可以是预先约定不同候选滤波器各自对应的滤波器索引信息,例如候选滤波器1对应的滤波器索引信息标识为1,候选滤波器2对应的滤波器索引信息标识为2,等等。进而,解码端基于所述滤波器索引信息的标识,也就能够确定对应的候选滤波器,并将该候选滤波器作为目标滤波器,使用该候选滤波器对当前编码单元进行解码。
步骤202、所述解码端获取与所述目标滤波器对应的重建像素模板。
可选地,不同的候选滤波器可以是对应不同的重建像素模板。示例性地,以图3中所示的三种候选滤波器为例,这三种候选滤波器分别对应三种不同的重建像素模板,其中图3中候选滤波器(a)对应图4中(c)所示的重建像素模板,也即该候选滤波器对应当前编码单元上侧和右侧的已解码的重建像素构成的模板;图3中候选滤波器(b)对应图4中(a)所示的重建像素模板,也即该候选滤波器对应当前编码单元上侧的已解码的重建像素构成的模板;图3中候选滤波器(c)对应图4中(b)所示的重建像素模板,也即该候选滤波器对应当前编码单元右侧的已解码的重建像素构成的模板。
本申请实施例中,解码端在确定目标滤波器,也即某一个候选滤波器后,也就能够获取与其对应的重建像素模板。需要说明的是,所述候选滤波器与重建像素模板之间的对应关系可以是预先建立。上述图3和图4中所示出的候选滤波器以及重建像素模板的形式以及二者之间的对应关系仅是举例说明,并不构成对本申请实施例的限定,本申请实施例中的候选滤波器以及重建像素模板的形式以及二者之间的对应关系还可以是其他的可能情况。
步骤203、所述解码端基于所述重建像素模板确定所述目标滤波器的系数。
需要说明地,解码端在确定目标滤波器对应的重建像素模板后,则能够基于所述重建像素模板计算所述目标滤波器的系数。其中,其计算方法可以是参照相关技术,例如按照ECM中的CCCM中计算滤波器系数的方法进行计算,本申请实施例不做具体赘述。
步骤204、所述解码端基于所述目标滤波器的系数计算所述当前编码单元的预测值。
解码端在获得目标滤波器的系数后,则基于所述目标滤波器的系数计算当前编码单元各像素点的预测值。
例如,假设目标滤波器为图3中(a)所示的滤波器,也即其中的目标像素点为一个,则目标滤波器每次能够获取当前编码单元中一个像素点的预测值,解码端基于该目标滤波器,对当前编码单元中每行按照从右到左的顺序逐个获取每个像素点的预测值,其中先获取第一行中每个像素点的预测值,再获取第二行每个像素点的预测值,依此从上到下逐行获取每行中每个像素点的预测值。可以理解地,解码端在获取当前编码单元中各像素点的预测值的过程中,目标滤波器中目标像素点及样本像素点也相应发生变化。
需要说明地,目标滤波器的系数的数量与所述目标滤波器中样本像素点的数量相同。例如,以目标滤波器为图3中(a)所示的滤波器为例,该目标滤波器包括15个样本像素点,则解码端会获得15个滤波器系数。解码端可以是分别计算这15个滤波器系数与各自对应的样本像素点的重建值或者预测值(样本像素点为当前编码单元周围已解码的重建像素点,则其重建值是已知的,样本像素点也可能为当前编码单元内部已通过本方法获得预测值的像素点)的乘积,也即会得到15个乘积,基于这15个乘积来确定当前编码单元中待预测像素点的预测值,例如可以是将这15个乘积的平均值作为待预测像素点的预测值。基于这样的方式,也就能够逐个获得当前编码单元中各像素点的预测值。
进一步地,解码端基于从码流中获得的当前编码单元各像素点的残差信息计算得到各像素点的残差值,将各像素点的残差值与对应的预测值相加得到各像素点的重建值。
本申请实施例中,解码端基于目标滤波器来获取对应的重建像素模板,基于所述重建像素模板确定所述目标滤波器的系数,进一步基于所述目标滤波器的系数计算得到当前编码单元中各像素点的预测值。其中,目标滤波器包括样本像素点和目标像素点,所述样本像素点为已解码的或者已获得预测值的像素点,所述目标像素点为所述当前编码单元中未解码的像素点(也即待预测像素点),所述样本像素点位于所述目标像素点的右侧或上侧,也即当前编码单元中未解码像素点位于已解码的样本像素点(可能是当前编码单元外部的
已解码重建像素,也可能是当前编码单元内部已获预测值的样本点)的右侧或上侧,基于这些样本像素点来对当前编码单元进行预测,与相关技术中强制使用与当前编码单元距离相同的上边参考行和左边参考列获得的预测值的方法不同,本申请实施例中并不限定样本像素点与当前编码单元中待预测像素点之间的距离,也就考虑了视频图像中纹理分布不对称、不均匀的情况,有效提升帧内预测准确度,也有助于提升解码效率。
可选地,所述目标像素点的数量为至少一个。例如图3中所示的三个候选滤波器,每个候选滤波器包括的目标像素点(也即白色方框)的数量都是一个;如图5中(a)所示的候选滤波器包括的目标像素点的数量为4个,如图5中(b)所示的候选滤波器包括的目标像素点的数量为8个,如图5中(c)所示的候选滤波器包括的目标像素点的数量为2个。
需要说明地,在目标像素点的数量大于一个的情况下,目标像素点的数量及候选滤波器的形状还可以是其他的可能形式,上述图5并不构成对本申请实施例中候选滤波器的限定。
可选地,所述目标滤波器中目标像素点的数量为N个,N大于或等于1,所述解码端基于所述重建像素模板确定所述目标滤波器的系数,包括:
所述解码端基于所述重建像素模板确定所述目标滤波器的N个系数组,其中每个系数组中包括M个系数,M的数值与所述目标滤波器中样本像素点的数量相同,M为正整数;
所述解码端基于所述目标滤波器的系数确定所述当前编码单元的预测值,包括:
所述解码端基于所述目标滤波器的N个系数组确定所述当前编码单元中N个未解码像素点的预测值。
其中,所述系数是指滤波器系数。
本申请实施例中,目标滤波器中目标像素点的数量可以为一个或一个以上。例如,假设目标滤波器为如图3中所示的滤波器,也即目标滤波器中目标像素点的数量为一个,样本像素点的数量为15个,也即N=1,M=15,解码端每次能够预测当前编码单元中一个未解码像素点(也可称待预测像素点)的预测值。具体地,解码端基于与目标滤波器对应的重建像素模板确定所述目标滤波器的1个系数组,该系数组中包括15个滤波器系数,解码端基于这15个滤波器系数来获取当前编码单元中一个未解码像素点的预测值,该未解码像素点也即目标滤波器中的目标像素点,基于这样的方式逐个获得当前编码单元中每个未解码像素点的预测值。其中,基于滤波器系数计算未解码像素点的预测值的具体实现方式可以是参照相关技术,例如可以是计算15个滤波器系数与各自对应的样本像素点的重建值或者预测值的乘积,将这些乘积的平均值作为待预测像素点的预测值。
或者,目标滤波器为如图5中所示的滤波器,也即目标滤波器中目标像素点的数量大于一个,假设目标滤波器为图5中(a)所示的滤波器,也即目标滤波器中目标像素点的数量为4个,样本像素点的数量为12个,也即N=4,M=12,那么解码端每次能够预测当
前编码单元中4个未解码像素点的预测值。具体地,解码端基于与该目标滤波器对应的重建像素模板确定所述目标滤波器的4个系数组,每个系数组中包括12个滤波器系数,解码端基于这4个系数组、每组中的12个滤波器系数来计算获得当前编码单元中4个未解码像素点的预测值,也即解码端能够一次性同时获得4个未解码像素点的预测值,这样也就能够有效提升解码端的解码效率。
需要说明地,在N大于1的情况下,解码端能够基于目标滤波器的N个系数组、每个系数组中的M个系数同时确定当前编码单元中N个未解码像素点的预测值,具体可以是一个系数组中的M个系数用于计算获得一个未解码像素点的预测值,N个系数组也即对应获得N个未解码像素点的预测值。其中,基于M个系数计算获得一个未解码像素点的预测值的具体实现方式可以参照前面的描述,此处不再赘述。
本申请实施例中,解码端能够根据目标滤波器中的N个目标像素点确定N个系数组,从而基于这N个系数组、每个系数组中的M个系数来分别计算获得当前编码单元中N个未解码像素点的预测值,从而能够有效提升解码端的解码效率。
可选地,所述确定所述当前编码单元的预测值,包括如下任意一项:
在所述目标滤波器中目标像素点的数量为一个的情况下,所述解码端对所述当前编码单元每行中未解码的像素点按照从右到左的顺序逐行计算各未解码的像素点的预测值;
在所述目标滤波器中目标像素点的数量大于一个的情况下,所述解码端对所述当前编码单元每行中未解码的像素点按照从右到左或从左到右的顺序逐行计算各未解码的像素点的预测值。
例如,若目标滤波器中目标像素点的数量为一个,如图3中所示的滤波器,这种情况下,解码端一次只能获得当前编码单元中一个未解码像素点的预测值,而当前编码单元通常包括多行×多列的像素点,则解码端可以是按照从右到左、从上到下的顺序依次计算当前编码单元中各未解码像素点的预测值,也即先对第一行按照从右到左的顺序逐个计算该行中各未解码像素点的预测值,然后对第二行按照从右到左的顺序逐个计算该行中各未解码像素点的预测值,然后对第三行按照从右到左的顺序逐个计算该行中各未解码像素点的预测值……按照这样的方式对每行中未解码的像素点按照从右到左的顺序逐行计算各未解码的像素点的预测值,从而完成对当前编码单元的预测。
或者,若目标滤波器中目标像素点的数量为N个,N大于1,如图5中所示的滤波器,这种情况下,解码端每次能够同时获得当前编码单元中N个未解码像素点的预测值,则解码端可以是每行按照从右到左或从左到右的顺序逐行计算各未解码的像素点的预测值。例如,先对第一行按照从右到左的顺序每次计算获得该行中N个未解码像素点的预测值,在完成对第一行的预测后,对第二行按照从右到左的顺序每次计算获得该行中N个未解码像素点的预测值,在完成对第二行的预测后,对第三行按照从右到左的顺序每次计算获得该行中N个未解码像素点的预测值……按照这样的方式对每行中未解码的像素点按照从右到左的顺序逐行计算各未解码的像素点的预测值,从而完成对当前编码单元的预测。
本申请实施例中,解码端能够对当前编码单元中未解码像素点按照从右上到左下的顺序来计算获得各未解码像素点的预测值,从而完成对当前编码单元的预测,这样也就不再限制于解码端只能按照从左上到右下的顺序进行像素点预测,有效提升了解码的灵活性,也能够降低当前编码单元中未解码像素点对于左侧相邻样本点的依赖性,也有助于提升帧内预测准确度。
需要说明地,解码端在获得各像素点的预测值后,基于从码流中获得的当前编码单元各像素点的残差信息计算得到各像素点的残差值,将各像素点的残差值与对应的预测值相加得到各像素点的重建值。
为更好地理解,以下通过两个具体的实施例对本申请提供的技术方案进行说明。
实施例一
步骤S11.解码端确定当前待解码的编码单元的预测模式为EIP模式;
步骤S12.解码端从码流中获得当前编码单元的滤波器索引信息,根据滤波器索引信息确定所选择的滤波器(也即目标滤波器);本实施例中的候选滤波器有如图3所示的3种,但不限于此,候选滤波器还可以有其他形状;需要注意的是,待预测像素点(图3中白色方框)位于滤波器左下角;
步骤S13.解码端根据当前待解码的编码单元所选的滤波器获得由已解码的重建像素构成的模板,进而计算所选滤波器的系数,计算方法可以参照相关技术;具体地,结合图3和图4:
如果所选择的滤波器为图3(a),则使用如图4中(c)所示模板;
如果所选择的滤波器为图3(b),则使用如图4中(a)所示模板;
如果所选择的滤波器为图3(c),则使用如图4中(b)所示模板;
步骤S14.解码端根据获得的滤波器系数按照从右到左、从上到下的顺序逐个计算获得当前待解码的编码单元中各像素点的预测值,与从码流中获得的残差值相加获得当前编码单元的重建值。
实施例二
步骤S21.解码端确定当前待解码的编码单元的预测模式为EIP模式;
步骤S22.解码端从码流中获得当前编码单元的滤波器索引信息,根据滤波器索引信息确定所选择的滤波器;本实施例中的候选滤波器有如图5中所示的3种,但不限于此,还可以有其他形状;需要注意的是,待预测像素点位于滤波器最下边一行(图5中的白色方框);
步骤S23.解码端根据当前待解码的编码单元所选的滤波器获得由已解码的重建像素构成的模板,进而计算所选滤波器的系数,计算方法可以参考相关技术;与相关技术和实施例一的区别在于,实施例一和相关技术针对每种滤波器获得一组系数,每次仅获得一个像素点的预测值;本实施例对每种滤波器获得N组系数,N等于滤波器的宽度(如图5中白色方框的个数),使用图5中各滤波器中灰色样本点(灰色方框)计算获得最下方一行
各像素点的预测值;本实施例的好处是可以降低当前待解码像素点对于左边位于相同行样本点的依赖性,可以一次性获得N个位置像素点的预测值,有效提升解码效率;
步骤S24.解码端根据获得滤波器系数按照从右到左(或者从左向右)、从上到下的顺序逐个计算获得当前待解码的编码单元中各像素点的预测值,与获得残差值相加获得当前编码单元的重建值。
请参照图6,图6是本申请实施例提供的另一种帧内预测方法的流程图,所述方法应用于编码端。如图6所示,所述方法包括以下步骤:
步骤601、在当前编码单元的预测模式为目标模式的情况下,编码端确定至少一个候选滤波器。
其中,所述候选滤波器包括样本像素点和目标像素点,所述样本像素点为已编码或者已获得预测值的像素点,所述目标像素点为所述当前编码单元中未编码的像素点,所述样本像素点位于所述目标像素点的右侧或上侧。
需要说明地,所述目标模式可以是某种特定的帧内预测模式,例如可以是EIP模式,或者其他帧内预测模式。编码端可以是自行确定帧内预测模式,例如确定为EIP模式。
可选地,所述候选滤波器的形状可以是编码端和解码端预先确定的,例如候选滤波器可以是如图3和图5中所示的形状。关于候选滤波器可以具体参照上述解码端实施例中的描述,此处不再赘述。
步骤602、所述编码端获取所述至少一个候选滤波器各自对应的重建像素模板;
步骤603、所述编码端基于所述重建像素模板确定所述至少一个候选滤波器各自对应的系数;
步骤604、所述编码端根据每一个所述候选滤波器对应的系数分别计算所述当前编码单元的预测值,并根据所述预测值确定目标滤波器,所述目标滤波器为所述至少一个候选滤波器中的其中一个。
示例性地,假设候选滤波器的数量为L个,则编码端获取L个候选滤波器各自对应的重建像素模板,基于每个候选滤波器各自对应的重建像素模板确定该候选滤波器的系数,也即会得到L个候选滤波器各自对应的系数;然后针对每一个候选滤波器,基于该候选滤波器的系数计算当前编码单元的预测值,进而当前编码单元也就会对应得到L个预测值,基于这些预测值确定目标滤波器。例如可以是计算L个预测值的平均值,将其中与该平均值最接近的预测值对应的候选滤波器作为目标滤波器,将该目标滤波器对应的预测值作为当前编码单元的预测值,以实现对当前编码单元的编码。
本申请实施例中,编码端基于候选滤波器来计算当前编码单元的预测值,其中所述候选滤波器包括样本像素点和目标像素点,所述样本像素点为已编码的像素点,所述目标像素点为所述当前编码单元中未编码的像素点,所述样本像素点位于所述目标像素点的右侧或上侧,也即当前编码单元中未编码像素点位于已编码的样本像素点的右侧或上侧,基于这些样本像素点来对当前编码单元进行预测,与相关技术中强制使用与当前编码单元距离
相同的上边参考行和左边参考列获得的预测值的方法不同,本申请实施例中并不限定样本像素点与当前编码单元中待预测像素点之间的距离,也就考虑了视频图像中纹理分布不对称、不均匀的情况,有效提升帧内预测准确度,也有助于提升编码效率。
可选地,所述编码端根据每一个所述候选滤波器对应的系数分别计算所述当前编码单元的预测值,并根据所述预测值确定目标滤波器,包括:
所述编码端根据每一个所述候选滤波器对应的系数分别计算所述当前编码单元的预测值;
所述编码端根据所述预测值确定每一个所述候选滤波器对应的率失真代价;
所述编码端将所述率失真代价最小的所述候选滤波器确定为目标滤波器。
示例性地,假设候选滤波器的数量为L个,针对每一个候选滤波器,基于该候选滤波器的系数计算当前编码单元的预测值,进而当前编码单元也就会对应得到L个预测值,计算这个L个预测值各自对应的率失真代价,将其中率失真代价最小的一个预测值对应的候选滤波器确定为目标滤波器。这样,编码端也就能够基于目标滤波器来实现对当前编码单元的编码,而目标滤波器的率失真代价最小,也就能够有效确保编码的准确性。
可选地,所述方法还包括:
所述编码端向解码端发送码流,所述码流中携带滤波器索引信息,所述滤波器索引信息用于指示目标滤波器。
本申请实施例中,每一个候选滤波器可以是包括对应的标识,该标识可以是编码端和解码端都已知的。在确定目标滤波器后,编码端可以是将所述目标滤波器对应的标识作为滤波器索引信息写入码流中,进而解码端也就能够基于所述滤波器索引信息来确定编码端所使用的目标滤波器,从而解码端选择相同的目标滤波器来进行帧内预测,从而有效确保编码端和解码端能够获得一致的预测值。
可选地,所述方法还包括:
所述编码端向解码端发送码流,所述码流中携带帧内预测模式索引信息,所述帧内预测模式索引信息用于指示所述编码端使用的帧内预测模式为所述目标模式。
需要说明地,编码端发送给解码端的码流中包括帧内预测模式索引信息,用于表征编码端所使用的帧内预测模式为目标模式,进而解码端能够使用与编码端相同的帧内预测模式来进行当前编码单元的解码,以确保解码端能够获得与编码端一致的预测值。
可选地,在所述候选滤波器中目标像素点的数量为N个,N大于或等于1的情况下,所述编码端基于所述重建像素模板确定所述至少一个候选滤波器各自对应的系数,包括:
所述编码端基于所述重建像素模板确定第一候选滤波器对应的N个系数组,其中每个系数组中包括M个系数,M的数值与所述第一候选滤波器中样本像素点的数量相同,M为正整数,所述第一候选滤波器为所述至少一个候选滤波器中的其中一个;
所述编码端根据每一个所述候选滤波器对应的系数分别计算所述当前编码单元的预测值,包括:
所述编码端基于所述第一候选滤波器的N个系数组确定所述当前编码单元中N个未解码像素点的预测值。
可选地,所述计算所述当前编码单元的预测值,包括如下任意一项:
在所述候选滤波器中目标像素点的数量为一个的情况下,所述编码端对所述当前编码单元每行中未编码的像素点按照从右到左的顺序逐行计算各未编码的像素点的预测值;
在所述候选滤波器中目标像素点的数量大于一个的情况下,所述编码端对所述当前编码单元每行中未编码的像素点按照从右到左或从左到右的顺序逐行计算各未编码的像素点的预测值。
本申请实施例中,编码端确定候选滤波器的系数、基于候选滤波器系数确定当前编码单元预测值以及计算当前编码单元预测值的具体实现方式,可以是与解码端相同,具体可参照上述图2方法实施例中的描述,为避免重复,此处不再赘述。
本申请实施例提供的帧内预测方法,执行主体可以为帧内预测装置。本申请实施例中以帧内预测装置执行帧内预测为例,说明本申请实施例提供的帧内预测装置。
请参照图7,图7是本申请实施例提供的一种帧内预测装置的结构图,所述装置应用于解码端。如图7所示,帧内预测装置700包括:
第一确定模块701,用于在当前编码单元的预测模式为目标模式的情况下,确定目标滤波器,其中,所述目标滤波器为至少一个候选滤波器中的其中一个,所述候选滤波器包括样本像素点和目标像素点,所述样本像素点为已解码或者已获得预测值的像素点,所述目标像素点为所述当前编码单元中未解码的像素点,所述样本像素点位于所述目标像素点的右侧或上侧;
第一获取模块702,用于获取与所述目标滤波器对应的重建像素模板;
第二确定模块703,用于基于所述重建像素模板确定所述目标滤波器的系数;
第一计算模块704,用于基于所述目标滤波器的系数计算所述当前编码单元的预测值。
可选地,所述第一确定模块701还用于:
从码流中获取所述当前编码单元的滤波器索引信息;
将所述至少一个候选滤波器中与所述滤波器索引信息对应的滤波器确定为目标滤波器。
可选地,所述目标像素点的数量为至少一个。
可选地,在所述目标滤波器中目标像素点的数量为N个,N大于或等于1的情况下,所述第二确定模块703还用于:
基于所述重建像素模板确定所述目标滤波器的N个系数组,其中每个系数组中包括M个系数,M的数值与所述目标滤波器中样本像素点的数量相同,M为正整数;
所述第一计算模块704还用于:
基于所述目标滤波器的N个系数组确定所述当前编码单元中N个未解码像素点的预测值。
可选地,所述第一计算模块704还用于执行如下任意一项:
在所述目标滤波器中目标像素点的数量为一个的情况下,对所述当前编码单元每行中未解码的像素点按照从右到左的顺序逐行计算各未解码的像素点的预测值;
在所述目标滤波器中目标像素点的数量大于一个的情况下,对所述当前编码单元每行中未解码的像素点按照从右到左或从左到右的顺序逐行计算各未解码的像素点的预测值。
可选地,所述第一确定模块701还用于:
从码流中获取所述当前编码单元的帧内预测模式索引信息;
基于所述帧内预测模式索引信息确定所述当前编码单元的预测模式是否为所述目标模式。
本申请实施例提供的方案,与相关技术中强制使用与当前编码单元距离相同的上边参考行和左边参考列获得的预测值的方法不同,本申请实施例中并不限定样本像素点与当前编码单元中待预测像素点之间的距离,也就考虑了视频图像中纹理分布不对称、不均匀的情况,有效提升帧内预测准确度。
本申请实施例中的帧内预测装置可以是电子设备,例如具有操作系统的电子设备,也可以是电子设备中的部件,例如集成电路或芯片。该电子设备可以是终端,也可以为除终端之外的其他设备。示例性的,终端可以包括但不限于上述所列举的终端的类型,其他设备可以为服务器、网络附属存储器(Network Attached Storage,NAS)等,本申请实施例不作具体限定。
本申请实施例提供的帧内预测装置能够实现图2方法实施例实现的各个过程,并达到相同的技术效果,为避免重复,这里不再赘述。
请参照图8,图8是本申请实施例提供的另一种帧内预测装置的结构图,所述装置应用于编码端。如图8所示,帧内预测装置800包括:
第三确定模块801,用于在当前编码单元的预测模式为目标模式的情况下,确定至少一个候选滤波器,其中,所述候选滤波器包括样本像素点和目标像素点,所述样本像素点为已编码或者已获得预测值的像素点,所述目标像素点为所述当前编码单元中未编码的像素点,所述样本像素点位于所述目标像素点的右侧或上侧;
第二获取模块802,用于获取所述至少一个候选滤波器各自对应的重建像素模板;
第四确定模块803,用于基于所述重建像素模板确定所述至少一个候选滤波器各自对应的系数;
第二计算模块804,用于根据每一个所述候选滤波器对应的系数分别计算所述当前编码单元的预测值,并根据所述预测值确定目标滤波器,所述目标滤波器为所述至少一个候选滤波器中的其中一个。
可选地,所述第二计算模块804还用于:
根据每一个所述候选滤波器对应的系数分别计算所述当前编码单元的预测值;
根据所述预测值确定每一个所述候选滤波器对应的率失真代价;
将所述率失真代价最小的所述候选滤波器确定为目标滤波器。
可选地,所述装置还包括:
第一发送模块,用于向解码端发送码流,所述码流中携带滤波器索引信息,所述滤波器索引信息用于指示目标滤波器。
可选地,所述装置还包括:
第二发送模块,用于向解码端发送码流,所述码流中携带帧内预测模式索引信息,所述帧内预测模式索引信息用于指示所述编码端使用的帧内预测模式为所述目标模式。
可选地,在所述候选滤波器中目标像素点的数量为N个,N大于或等于1的情况下,所述第四确定模块803还用于:
基于所述重建像素模板确定第一候选滤波器对应的N个系数组,其中每个系数组中包括M个系数,M的数值与所述第一候选滤波器中样本像素点的数量相同,M为正整数,所述第一候选滤波器为所述至少一个候选滤波器中的其中一个;
所述第二计算模块804还用于:
基于所述第一候选滤波器的N个系数组确定所述当前编码单元中N个未解码像素点的预测值。
可选地,所述第二计算模块804还用于执行如下任意一项:
在所述候选滤波器中目标像素点的数量为一个的情况下,对所述当前编码单元每行中未编码的像素点按照从右到左的顺序逐行计算各未编码的像素点的预测值;
在所述候选滤波器中目标像素点的数量大于一个的情况下,对所述当前编码单元每行中未编码的像素点按照从右到左或从左到右的顺序逐行计算各未编码的像素点的预测值。
本申请实施例提供的方案,与相关技术中强制使用与当前编码单元距离相同的上边参考行和左边参考列获得的预测值的方法不同,本申请实施例中并不限定样本像素点与当前编码单元中待预测像素点之间的距离,也就考虑了视频图像中纹理分布不对称、不均匀的情况,有效提升帧内预测准确度。
本申请实施例提供的帧内预测装置能够实现图6方法实施例实现的各个过程,并达到相同的技术效果,为避免重复,这里不再赘述。
如图9所示,本申请实施例还提供一种电子设备900,包括处理器901和存储器902,存储器902上存储有可在所述处理器901上运行的程序或指令,例如,该电子设备900为解码端时,该程序或指令被处理器901执行时实现上述图2所述帧内预测方法实施例的各个步骤,且能达到相同的技术效果。该电子设备900为编码端时,该程序或指令被处理器901执行时实现上述图6所述帧内预测方法实施例的各个步骤,且能达到相同的技术效果,为避免重复,这里不再赘述。
本申请实施例还提供一种终端,能够实现上述方法实施例中的步骤。上述方法实施例的各个实施过程和实现方式均可适用于该终端实施例中,且能达到相同的技术效果。具体地,图10为实现本申请实施例的一种终端的硬件结构示意图。
该终端1000包括但不限于:射频单元1001、网络模块1002、音频输出单元1003、输入单元1004、传感器1005、显示单元1006、用户输入单元1007、接口单元1008、存储器1009以及处理器1010等中的至少部分部件。
本领域技术人员可以理解,终端1000还可以包括给各个部件供电的电源(比如电池),电源可以通过电源管理系统与处理器1010逻辑相连,从而通过电源管理系统实现管理充电、放电以及功耗管理等功能。图10中示出的终端结构并不构成对终端的限定,终端可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置,在此不再赘述。
应理解的是,本申请实施例中,输入单元1004可以包括图形处理器(Graphics Processing Unit,GPU)10041和麦克风10042,图形处理器10041对在视频捕获模式或图像捕获模式中由图像捕获装置(如摄像头)获得的静态图片或视频的图像数据进行处理。显示单元1006可包括显示面板10061,可以采用液晶显示器、有机发光二极管等形式来配置显示面板10061。用户输入单元1007包括触控面板10071以及其他输入设备10072中的至少一种。触控面板10071,也称为触摸屏。触控面板10071可包括触摸检测装置和触摸控制器两个部分。其他输入设备10072可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆,在此不再赘述。
本申请实施例中,射频单元1001接收来自网络侧设备的下行数据后,可以传输给处理器1010进行处理;另外,射频单元1001可以向网络侧设备发送上行数据。通常,射频单元1001包括但不限于天线、放大器、收发信机、耦合器、低噪声放大器、双工器等。
存储器1009可用于存储软件程序或指令以及各种数据。存储器1009可主要包括存储程序或指令的第一存储区和存储数据的第二存储区,其中,第一存储区可存储操作系统、至少一个功能所需的应用程序或指令(比如声音播放功能、图像播放功能等)等。此外,存储器1009可以包括易失性存储器或非易失性存储器。其中,非易失性存储器可以是只读存储器(Read-Only Memory,ROM)、可编程只读存储器(Programmable ROM,PROM)、可擦除可编程只读存储器(Erasable PROM,EPROM)、电可擦除可编程只读存储器(Electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(Random Access Memory,RAM),静态随机存取存储器(Static RAM,SRAM)、动态随机存取存储器(Dynamic RAM,DRAM)、同步动态随机存取存储器(Synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(Double Data Rate SDRAM,DDRSDRAM)、增强型同步动态随机存取存储器(Enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(Synch link DRAM,SLDRAM)和直接内存总线随机存取存储器(Direct Rambus RAM,DRRAM)。本申请实施例中的存储器1009包括但不限于这些和任意其它适合类型的存储器。
处理器1010可包括一个或多个处理单元;可选的,处理器1010集成应用处理器和调制解调处理器,其中,应用处理器主要处理涉及操作系统、用户界面和应用程序等的操作,
调制解调处理器主要处理无线通信信号,如基带处理器。可以理解的是,上述调制解调处理器也可以不集成到处理器1010中。
其中,在所述终端1000为解码端的情况下,处理器1010,用于:
在当前编码单元的预测模式为目标模式的情况下,确定目标滤波器,其中,所述目标滤波器为至少一个候选滤波器中的其中一个,所述候选滤波器包括样本像素点和目标像素点,所述样本像素点为已解码或者已获得预测值的像素点,所述目标像素点为所述当前编码单元中未解码的像素点,所述样本像素点位于所述目标像素点的右侧或上侧;
获取与所述目标滤波器对应的重建像素模板;
基于所述重建像素模板确定所述目标滤波器的系数;
基于所述目标滤波器的系数计算所述当前编码单元的预测值。
在所述终端1000为编码端的情况下,处理器1010,用于:
在当前编码单元的预测模式为目标模式的情况下,确定至少一个候选滤波器,其中,所述候选滤波器包括样本像素点和目标像素点,所述样本像素点为已编码或者已获得预测值的像素点,所述目标像素点为所述当前编码单元中未编码的像素点,所述样本像素点位于所述目标像素点的右侧或上侧;
获取所述至少一个候选滤波器各自对应的重建像素模板;
基于所述重建像素模板确定所述至少一个候选滤波器各自对应的系数;
根据每一个所述候选滤波器对应的系数分别计算所述当前编码单元的预测值,并根据所述预测值确定目标滤波器,所述目标滤波器为所述至少一个候选滤波器中的其中一个。
本申请实施例中并不限定样本像素点与当前编码单元中待预测像素点之间的距离,也就考虑了视频图像中纹理分布不对称、不均匀的情况,有效提升帧内预测准确度。
可以理解,本实施例中提及的各实现方式的实现过程可以参照上述图2或图6方法实施例中的相关描述,并达到相同或相应的技术效果,为避免重复,在此不再赘述。
本申请实施例还提供一种可读存储介质,所述可读存储介质上存储有程序或指令,该程序或指令被处理器执行时实现上述帧内预测方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。
其中,所述处理器为上述实施例中所述的终端中的处理器。所述可读存储介质,包括计算机可读存储介质,如计算机只读存储器ROM、随机存取存储器RAM、磁碟或者光盘等。在一些示例中,可读存储介质可以是非瞬态的可读存储介质。
本申请实施例另提供了一种芯片,所述芯片包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行程序或指令,实现上述帧内预测方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。
应理解,本申请实施例提到的芯片还可以称为系统级芯片,系统芯片,芯片系统或片上系统芯片等。
本申请实施例另提供了一种计算机程序/程序产品,所述计算机程序/程序产品被存储
在存储介质中,所述计算机程序/程序产品被至少一个处理器执行以实现上述帧内预测方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。此外,需要指出的是,本申请实施方式中的方法和装置的范围不限按示出或讨论的顺序来执行功能,还可包括根据所涉及的功能按基本同时的方式或按相反的顺序来执行功能,例如,可以按不同于所描述的次序来执行所描述的方法,并且还可以添加、省去或组合各种步骤。另外,参照某些示例所描述的特征可在其他示例中被组合。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助计算机软件产品加必需的通用硬件平台的方式来实现,当然也可以通过硬件。该计算机软件产品存储在存储介质(如ROM、RAM、磁碟、光盘等)中,包括若干指令,用以使得终端或者网络侧设备执行本申请各个实施例所述的方法。
上面结合附图对本申请的实施例进行了描述,但是本申请并不局限于上述的具体实施方式,上述的具体实施方式仅仅是示意性的,而不是限制性的,本领域的普通技术人员在本申请的启示下,在不脱离本申请宗旨和权利要求所保护的范围情况下,还可做出很多形式的实施方式,这些实施方式均属于本申请的保护之内。
Claims (17)
- 一种帧内预测方法,包括:在当前编码单元的预测模式为目标模式的情况下,解码端确定目标滤波器,其中,所述目标滤波器为至少一个候选滤波器中的其中一个,所述候选滤波器包括样本像素点和目标像素点,所述样本像素点为已解码或者已获得预测值的像素点,所述目标像素点为所述当前编码单元中未解码的像素点,所述样本像素点位于所述目标像素点的右侧或上侧;所述解码端获取与所述目标滤波器对应的重建像素模板;所述解码端基于所述重建像素模板确定所述目标滤波器的系数;所述解码端基于所述目标滤波器的系数计算所述当前编码单元的预测值。
- 根据权利要求1所述的方法,其中,所述解码端确定目标滤波器,包括:所述解码端从码流中获取所述当前编码单元的滤波器索引信息;所述解码端将所述至少一个候选滤波器中与所述滤波器索引信息对应的滤波器确定为目标滤波器。
- 根据权利要求1或2所述的方法,其中,在所述目标滤波器中目标像素点的数量为N个,N大于或等于1的情况下,所述解码端基于所述重建像素模板确定所述目标滤波器的系数,包括:所述解码端基于所述重建像素模板确定所述目标滤波器的N个系数组,其中每个系数组中包括M个系数,M的数值与所述目标滤波器中样本像素点的数量相同,M为正整数;所述解码端基于所述目标滤波器的系数确定所述当前编码单元的预测值,包括:所述解码端基于所述目标滤波器的N个系数组确定所述当前编码单元中N个未解码像素点的预测值。
- 根据权利要求1或2所述的方法,其中,所述计算所述当前编码单元的预测值,包括如下任意一项:在所述目标滤波器中目标像素点的数量为一个的情况下,所述解码端对所述当前编码单元每行中未解码的像素点按照从右到左的顺序逐行计算各未解码的像素点的预测值;在所述目标滤波器中目标像素点的数量大于一个的情况下,所述解码端对所述当前编码单元每行中未解码的像素点按照从右到左或从左到右的顺序逐行计算各未解码的像素点的预测值。
- 根据权利要求1-4中任一项所述的方法,所述方法还包括:所述解码端从码流中获取所述当前编码单元的帧内预测模式索引信息;所述解码端基于所述帧内预测模式索引信息确定所述当前编码单元的预测模式是否为所述目标模式。
- 一种帧内预测方法,包括:在当前编码单元的预测模式为目标模式的情况下,编码端确定至少一个候选滤波器,其中,所述候选滤波器包括样本像素点和目标像素点,所述样本像素点为已编码或者已获得预测值的像素点,所述目标像素点为所述当前编码单元中未编码的像素点,所述样本像素点位于所述目标像素点的右侧或上侧;所述编码端获取所述至少一个候选滤波器各自对应的重建像素模板;所述编码端基于所述重建像素模板确定所述至少一个候选滤波器各自对应的系数;所述编码端根据每一个所述候选滤波器对应的系数分别计算所述当前编码单元的预测值,并根据所述预测值确定目标滤波器,所述目标滤波器为所述至少一个候选滤波器中的其中一个。
- 根据权利要求6所述的方法,其中,所述编码端根据每一个所述候选滤波器对应的系数分别计算所述当前编码单元的预测值,并根据所述预测值确定目标滤波器,包括:所述编码端根据每一个所述候选滤波器对应的系数分别计算所述当前编码单元的预测值;所述编码端根据所述预测值确定每一个所述候选滤波器对应的率失真代价;所述编码端将所述率失真代价最小的所述候选滤波器确定为目标滤波器。
- 根据权利要求6所述的方法,所述方法还包括:所述编码端向解码端发送码流,所述码流中携带滤波器索引信息,所述滤波器索引信息用于指示目标滤波器。
- 根据权利要求6所述的方法,所述方法还包括:所述编码端向解码端发送码流,所述码流中携带帧内预测模式索引信息,所述帧内预测模式索引信息用于指示所述编码端使用的帧内预测模式为所述目标模式。
- 根据权利要求6-9中任一项所述的方法,其中,在所述候选滤波器中目标像素点的数量为N个,N大于或等于1的情况下,所述编码端基于所述重建像素模板确定所述至少一个候选滤波器各自对应的系数,包括:所述编码端基于所述重建像素模板确定第一候选滤波器对应的N个系数组,其中每个系数组中包括M个系数,M的数值与所述第一候选滤波器中样本像素点的数量相同,M为正整数,所述第一候选滤波器为所述至少一个候选滤波器中的其中一个;所述编码端根据每一个所述候选滤波器对应的系数分别计算所述当前编码单元的预测值,包括:所述编码端基于所述第一候选滤波器的N个系数组确定所述当前编码单元中N个未解码像素点的预测值。
- 根据权利要求6-9中任一项所述的方法,其中,所述计算所述当前编码单元的预测值,包括如下任意一项:在所述候选滤波器中目标像素点的数量为一个的情况下,所述编码端对所述当前编码单元每行中未编码的像素点按照从右到左的顺序逐行计算各未编码的像素点的预测值;在所述候选滤波器中目标像素点的数量大于一个的情况下,所述编码端对所述当前编码单元每行中未编码的像素点按照从右到左或从左到右的顺序逐行计算各未编码的像素点的预测值。
- 一种帧内预测装置,包括:第一确定模块,用于在当前编码单元的预测模式为目标模式的情况下,确定目标滤波器,其中,所述目标滤波器为至少一个候选滤波器中的其中一个,所述候选滤波器包括样本像素点和目标像素点,所述样本像素点为已解码或者已获得预测值的像素点,所述目标像素点为所述当前编码单元中未解码的像素点,所述样本像素点位于所述目标像素点的右侧或上侧;第一获取模块,用于获取与所述目标滤波器对应的重建像素模板;第二确定模块,用于基于所述重建像素模板确定所述目标滤波器的系数;第一计算模块,用于基于所述目标滤波器的系数计算所述当前编码单元的预测值。
- 一种帧内预测装置,包括:第三确定模块,用于在当前编码单元的预测模式为目标模式的情况下,确定至少一个候选滤波器,其中,所述候选滤波器包括样本像素点和目标像素点,所述样本像素点为已编码或者已获得预测值的像素点,所述目标像素点为所述当前编码单元中未编码的像素点,所述样本像素点位于所述目标像素点的右侧或上侧;第二获取模块,用于获取所述至少一个候选滤波器各自对应的重建像素模板;第四确定模块,用于基于所述重建像素模板确定所述至少一个候选滤波器各自对应的系数;第二计算模块,用于根据每一个所述候选滤波器对应的系数分别计算所述当前编码单元的预测值,并根据所述预测值确定目标滤波器,所述目标滤波器为所述至少一个候选滤波器中的其中一个。
- 一种电子设备,包括处理器和存储器,所述存储器存储可在所述处理器上运行的程序或指令,所述程序或指令被所述处理器执行时实现如权利要求1-11中任一项所述的帧内预测方法的步骤。
- 一种可读存储介质,所述可读存储介质上存储程序或指令,所述程序或指令被处理器执行时实现如权利要求1-11中任一项所述的帧内预测方法的步骤。
- 一种芯片,所述芯片包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行程序或指令以实现如权利要求1-11中任一项所述的帧内预测方法。
- 一种计算机程序/程序产品,所述计算机程序/程序产品被存储在存储介质中,所述程序/程序产品被至少一个处理器执行以实现如权利要求1-11中任一项所述的帧内预测方法。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202310719342.8 | 2023-06-16 | ||
| CN202310719342.8A CN119155444A (zh) | 2023-06-16 | 2023-06-16 | 帧内预测方法、装置、电子设备及可读存储介质 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2024255720A1 true WO2024255720A1 (zh) | 2024-12-19 |
Family
ID=93814480
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2024/098319 Ceased WO2024255720A1 (zh) | 2023-06-16 | 2024-06-11 | 帧内预测方法、装置、电子设备及可读存储介质 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN119155444A (zh) |
| WO (1) | WO2024255720A1 (zh) |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106254866A (zh) * | 2016-10-17 | 2016-12-21 | 中国科学技术大学 | 基于层次化灵活块顺序的视频帧内编码方法 |
| CN111050176A (zh) * | 2018-10-15 | 2020-04-21 | 腾讯科技(深圳)有限公司 | 视频编码、视频解码方法、装置、计算机设备和存储介质 |
| CN115086679A (zh) * | 2022-06-08 | 2022-09-20 | 北京达佳互联信息技术有限公司 | 帧内预测方法、装置、电子设备及存储介质 |
| CN116071440A (zh) * | 2022-07-26 | 2023-05-05 | 杭州海康威视数字技术股份有限公司 | 一种图像解码方法、编码方法及装置 |
Family Cites Families (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| KR102232246B1 (ko) * | 2019-06-21 | 2021-03-25 | 삼성전자주식회사 | 영상 부호화 방법 및 장치, 영상 복호화 방법 및 장치 |
| CN112437298B (zh) * | 2019-08-26 | 2026-01-09 | 北京三星通信技术研究有限公司 | 编解码方法及装置 |
| CN110881125B (zh) * | 2019-12-10 | 2021-10-29 | 中国科学院深圳先进技术研究院 | 帧内预测方法、视频编码、解码方法及相关设备 |
-
2023
- 2023-06-16 CN CN202310719342.8A patent/CN119155444A/zh active Pending
-
2024
- 2024-06-11 WO PCT/CN2024/098319 patent/WO2024255720A1/zh not_active Ceased
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106254866A (zh) * | 2016-10-17 | 2016-12-21 | 中国科学技术大学 | 基于层次化灵活块顺序的视频帧内编码方法 |
| CN111050176A (zh) * | 2018-10-15 | 2020-04-21 | 腾讯科技(深圳)有限公司 | 视频编码、视频解码方法、装置、计算机设备和存储介质 |
| CN115086679A (zh) * | 2022-06-08 | 2022-09-20 | 北京达佳互联信息技术有限公司 | 帧内预测方法、装置、电子设备及存储介质 |
| CN116071440A (zh) * | 2022-07-26 | 2023-05-05 | 杭州海康威视数字技术股份有限公司 | 一种图像解码方法、编码方法及装置 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN119155444A (zh) | 2024-12-17 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US11750809B2 (en) | Encoding and decoding methods and apparatuses with multiple image block division manners | |
| US8483496B2 (en) | Image encoding/decoding system | |
| TWI656786B (zh) | 取樣自適應偏移裝置 | |
| JP2021513755A (ja) | 変換スキップフラグを利用した映像コーディング方法及び装置 | |
| US20160373767A1 (en) | Encoding and Decoding Methods and Apparatuses | |
| KR20220129091A (ko) | 비디오 코딩 및 디코딩의 크로마 인트라 예측 | |
| US20240236378A1 (en) | Encoding method, decoding method, and decoder | |
| JP7448558B2 (ja) | 画像エンコーディングおよびデコーディングのための方法およびデバイス | |
| CN111654696B (zh) | 一种帧内的多参考行预测方法、装置、存储介质及终端 | |
| US20250220219A1 (en) | Method for inter prediction method, video picture encoder and decoder | |
| JP2022524916A (ja) | 適応的な数の領域を伴う幾何学的分割のための形状適応離散コサイン変換 | |
| CN115866263A (zh) | 视频解码方法、视频编码方法及相关设备 | |
| WO2024255720A1 (zh) | 帧内预测方法、装置、电子设备及可读存储介质 | |
| KR20220079996A (ko) | 비디오 인코딩 및 비디오 디코딩 | |
| US11706410B2 (en) | Methods and systems for combined lossless and lossy coding | |
| CN116193140A (zh) | 基于lcevc的编码方法、解码方法及译码设备 | |
| CN119316610B (zh) | 帧内预测方法、参考对象确定方法、装置及电子设备 | |
| US20250097426A1 (en) | Encoding and decoding method, encoder, decoder and storage medium | |
| WO2024240057A1 (zh) | 多参考行帧内预测方法、装置、电子设备及可读存储介质 | |
| RU2809558C2 (ru) | Способ и устройство для кодирования и декодирования изображения | |
| HK40113961B (zh) | 图像解码和编码方法、装置、设备及存储介质 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 24822670 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |