WO2020134969A1 - 一种编解码方法及其设备 - Google Patents
一种编解码方法及其设备 Download PDFInfo
- Publication number
- WO2020134969A1 WO2020134969A1 PCT/CN2019/123632 CN2019123632W WO2020134969A1 WO 2020134969 A1 WO2020134969 A1 WO 2020134969A1 CN 2019123632 W CN2019123632 W CN 2019123632W WO 2020134969 A1 WO2020134969 A1 WO 2020134969A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- mode
- prediction
- prediction mode
- motion information
- current block
- 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
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/169—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
- H04N19/17—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
- H04N19/176—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
-
- 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/107—Selection of coding mode or of prediction mode between spatial and temporal predictive coding, e.g. picture refresh
-
- 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/13—Adaptive entropy coding, e.g. adaptive variable length coding [AVLC] or context adaptive binary arithmetic coding [CABAC]
-
- 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/60—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
- H04N19/61—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding in combination with predictive coding
-
- 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/80—Details of filtering operations specially adapted for video compression, e.g. for pixel interpolation
- H04N19/82—Details of filtering operations specially adapted for video compression, e.g. for pixel interpolation involving filtering within a prediction loop
Definitions
- This application relates to the field of codec, in particular to a codec method and equipment.
- Video encoding may include prediction, transformation, quantization, entropy encoding, filtering and other processes.
- the prediction may include intra prediction and inter prediction.
- inter-frame coding utilizes the correlation in the time domain of the video, and uses pixels adjacent to the encoded image to predict the current pixel, so as to effectively remove the time-domain redundancy of the video.
- intra-coding refers to using the correlation of the video spatial domain to predict the current pixels using the pixels of the encoded block of the current image, so as to achieve the purpose of removing the spatial redundancy of the video.
- inter-frame coding or intra-frame coding can be used to predict the current pixel.
- the prediction accuracy of inter-frame coding and intra-frame coding is not high.
- This application provides a codec method and its equipment to improve prediction accuracy.
- This application provides a codec method, which includes:
- the weighted prediction value of the current block is obtained through the following steps, and the weighted prediction value is used for encoding or decoding of the current block;
- Weighting the intra prediction value and the inter prediction value to obtain the weighted prediction value Weighting the intra prediction value and the inter prediction value to obtain the weighted prediction value.
- This application provides a codec method, which includes:
- the weighted prediction value of the current block is obtained through the following steps, and the weighted prediction value is used for encoding or decoding of the current block:
- Weighting the intra prediction value and the inter prediction value to obtain the weighted prediction value Weighting the intra prediction value and the inter prediction value to obtain the weighted prediction value.
- This application provides a codec method, which includes:
- the weighted prediction value of the current block is obtained through the following steps, and the weighted prediction value is used for encoding or decoding of the current block;
- Weighting the intra prediction value and the inter prediction value to obtain the weighted prediction value Weighting the intra prediction value and the inter prediction value to obtain the weighted prediction value.
- the present application provides a decoding-end device, including: a processor and a machine-readable storage medium, where the machine-readable storage medium stores machine-executable instructions that can be executed by the processor; the processor is used to execute the machine Execute instructions to implement the above method steps.
- the present application provides an encoding-end device, including: a processor and a machine-readable storage medium, where the machine-readable storage medium stores machine-executable instructions that can be executed by the processor; the processor is used to execute the machine Execute instructions to implement the above method steps.
- the current block can be predicted using both the inter-coding technology and the intra-coding technology, that is, the intra-predicted value and the inter-predicted value are weighted, which can improve prediction Accuracy improves prediction performance, which leads to improved coding performance.
- FIG. 1 is a schematic diagram of a video encoding framework in an embodiment of this application
- 4A-4C are schematic diagrams of neighboring blocks and prediction modes in an embodiment of the present application.
- 5A-5C are schematic diagrams of a motion information candidate list in an embodiment of this application.
- 6A-6C are schematic diagrams of weight coefficients in an embodiment of the present application.
- FIG. 9 is a hardware structure diagram of a decoding device in an embodiment of the present application.
- FIG. 10 is a hardware structure diagram of an encoding end device in an embodiment of the present application.
- first, second, third, etc. may be used to describe various information in the embodiments of the present application, the information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other.
- first information may also be referred to as second information, and similarly, the second information may also be referred to as first information.
- word "if” used can be interpreted as "when” or “when” or "in response to a determination”.
- An embodiment of this application proposes a codec method, which may involve the following concepts.
- Intra prediction refers to using the spatial correlation of the video to predict the current pixels using the pixels of the current image coding block, so as to achieve the purpose of removing the spatial redundancy of the video.
- Multiple prediction modes are specified in intra prediction, and each prediction mode corresponds to a texture direction (except for the DC mode).
- the predicted pixel value of the current block is predicted by the pixel value reconstructed by the boundary of the adjacent block. For example, if the texture of the image is arranged horizontally, then selecting the horizontal prediction mode can better predict the image information.
- Inter prediction refers to the use of the correlation in the time domain of the video. Since the video sequence usually has a strong correlation in the time domain, using the pixels of the adjacent encoded image to predict the pixels of the current image can effectively remove the video The purpose of time-domain redundancy.
- the mainstream video coding standards use block-based motion compensation technology for inter prediction. The basic principle is to find the best matching block in the previous encoded image for each pixel block of the current image. This process is called motion Estimate (Motion Estimation, ME).
- Motion Vector In inter-frame coding, the motion vector is used to represent the relative displacement between the current image block of the current frame video image and the reference image block of the reference frame video image. For example, there is a strong temporal correlation between the video image A of the current frame and the video image B of the reference frame.
- motion search can be performed in the video image B. Find the image block B1 (reference image block) that best matches the image block A1, and determine the relative displacement between the image block A1 and the image block B1, which is the motion vector of the image block A1.
- the motion vector of each image block is independently encoded and transmitted, especially in the case where the image is divided into a large number of image blocks of small size, a considerable number of bits are consumed.
- the spatial correlation of adjacent image blocks can be used to predict the motion vector of the current image block to be encoded based on the motion vectors of adjacent encoded image blocks, and then encode the prediction difference , which can effectively reduce the number of bits representing the motion vector.
- the "predicted difference” here refers to the difference between the predicted value of the motion vector and the true estimated value.
- the motion vector of the adjacent encoded image block may be used to predict the motion vector of the current macroblock first, and then the predicted value of the motion vector (MVP, Motion Vector Prediction)
- MVP Motion Vector Prediction
- the difference between the real estimate of the motion vector (MVD, Motion Vector Difference) is encoded to effectively reduce the number of encoded bits of the motion vector.
- Motion information (Motion Information): Since the motion vector indicates the position offset of the current image block and a reference image block, in order to accurately obtain information directed to the image block, in addition to the motion vector, the index information of the reference frame image is also required To indicate which reference frame image to use.
- a reference frame image list can usually be established, and the reference frame index indicates that the current image block adopts the reference frame image in the reference frame image list.
- many coding techniques also support multiple reference frame image lists. Therefore, an index value can also be used to indicate which reference frame image list is used. This index value can be referred to as the reference direction.
- motion-related information such as motion vectors, reference frame indexes, and reference directions can be collectively referred to as motion information.
- Rate-Distortion Optimized There are two major indicators for evaluating coding efficiency: code rate and PSNR (Peak Signal to Noise Ratio). The smaller the bit rate per unit time, the greater the compression rate. The larger the PSNR, the better the quality of the reconstructed image. In the selection of prediction mode, the discriminant formula for comprehensive evaluation of these two indicators can be used.
- Video encoding framework As shown in FIG. 1, the video encoding framework can be used to implement the encoding-end processing flow in this embodiment of the present application.
- the schematic diagram of the video decoding framework is similar to FIG. 1 and will not be repeated here.
- the video decoding framework can be used.
- the decoding end processing flow of the embodiment of the present application is implemented.
- the video encoding framework and the video decoding framework may include an intra prediction unit 101, motion estimation/motion compensation 102, reference image buffer 103, in-loop filtering 104, reconstruction 105, transform 106, quantization 107, inverse transform 108, inverse quantization 109, entropy encoder 110 and other modules.
- the encoding end processing flow can be realized, and at the decoding end, through the cooperation between these modules, the decoding end processing flow can be realized.
- Embodiment 1 As shown in FIG. 2, it is a schematic flowchart of an encoding and decoding method in an embodiment of the present application. The method can be applied to a decoding end to determine the weighting of the current block through the following steps when determining to enable intra-frame weighted prediction Prediction value, the weighted prediction value is used for decoding the current block; the method includes:
- Step 201 The decoding end acquires the first prediction mode of the first neighboring block of the current block and the second prediction mode of the second neighboring block of the current block; determining intra prediction according to the first prediction mode and the second prediction mode Target prediction mode and obtain the intra prediction value of the current block according to the target prediction mode.
- Step 202 The decoding end obtains a motion information candidate list of the current block, where the motion information candidate list includes at least one motion information; determines target motion information for inter prediction according to the motion information candidate list, and obtains the current block's target motion information according to the target motion information Inter prediction value.
- Step 203 The decoding end performs weighting processing on the intra prediction value and the inter prediction value to obtain a weighted prediction value of the current block.
- the decoding end may also decode the coded bitstream according to the weighted prediction value, such as restoring the image of the current block according to the coded bitstream.
- the current block can be predicted using both the inter-coding technology and the intra-coding technology, that is, the intra-predicted value and the inter-predicted value are weighted, which can improve the prediction Accuracy improves prediction performance, which leads to improved coding performance.
- Embodiment 2 As shown in FIG. 3, it is a schematic flowchart of the codec method in the embodiment of the present application. This method can be applied to the encoding side to determine the weighting of the current block through the following steps when determining to enable intra-frame weighted prediction Prediction value, the weighted prediction value is used for encoding the current block; the method includes:
- Step 301 The encoding end acquires the first prediction mode of the first neighboring block of the current block and the second prediction mode of the second neighboring block of the current block; determining intra prediction according to the first prediction mode and the second prediction mode Target prediction mode and obtain the intra prediction value of the current block according to the target prediction mode.
- Step 302 The encoding end obtains a motion information candidate list of the current block, where the motion information candidate list includes at least one motion information; determine target motion information for inter prediction according to the motion information candidate list, and obtain the current block's target motion information according to the target motion information Inter prediction value.
- Step 303 The encoding end performs weighting processing on the intra prediction value and the inter prediction value to obtain a weighted prediction value of the current block.
- the encoding end may also encode the bitstream according to the weighted prediction value to obtain the encoded bitstream, for example, encoding corresponding indication information in the bitstream.
- the current block can be predicted using both the inter-coding technology and the intra-coding technology, that is, the intra-predicted value and the inter-predicted value are weighted, which can improve prediction Accuracy improves prediction performance, which leads to improved coding performance.
- Embodiment 3 In step 201 and step 301, the decoding end/encoding end needs to acquire the first prediction mode of the first adjacent block of the current block and the second prediction mode of the second adjacent block of the current block.
- the first neighboring block and the second neighboring block are shown, block A is the first neighboring block, block B is the second neighboring block, and the prediction mode of the block A is the first prediction mode, The prediction mode of the B block is the second prediction mode.
- the above is only an example, and other blocks may also be used as the first adjacent block or the second adjacent block, which is not limited.
- the aforementioned prediction mode (ie, the first prediction mode or the second prediction mode) may be an intra prediction mode.
- the luminance component supports 5 types of prediction units: 4*4, 8*8, 16*16, 32*32, and 64*64.
- Each size of prediction unit corresponds to 35 prediction modes, including Planar mode.
- DC mode and 33 angle modes See Table 1 for examples of intra prediction modes. Planar mode corresponds to mode 0, DC mode corresponds to mode 1, the remaining 33 angle modes correspond to mode 2 to mode 34, and the prediction directions of 33 angle modes can be seen in FIG. 4B As shown.
- Planar mode is suitable for areas where the pixel value changes slowly. Two linear filters in the horizontal and vertical directions are used, and the average value of the two output values is used as the predicted value of the current block pixel.
- the DC mode is suitable for large-area flat areas, and the average value of surrounding pixels of the current block is used as the predicted pixel value of the current block.
- the angle mode can have 33 angles, mode 26 represents the vertical direction, and mode 10 represents the horizontal direction.
- FIG. 4C which is shown in FIG. 4C
- Embodiment 4 In step 201 and step 301, the decoding end/encoding end needs to determine the target prediction mode of intra prediction according to the first prediction mode and the second prediction mode.
- the The first prediction mode and the second prediction mode create a prediction mode candidate list of the current block, the prediction mode candidate list may include at least one candidate prediction mode; then, one candidate prediction mode may be selected from the prediction mode candidate list as an intra Forecast target prediction mode.
- creating a prediction mode candidate list of the current block according to the first prediction mode and the second prediction mode may include: method one, converting the first prediction mode to the third prediction mode, and converting the second prediction mode to the fourth Prediction mode, and create a prediction mode candidate list according to the third prediction mode and the fourth prediction mode.
- the specific conversion method of the first prediction mode and the second prediction mode will be described below. Manner 2: According to the first prediction mode and the second prediction mode, and the adjacent mode of the first prediction mode and/or the adjacent mode of the second prediction mode, a prediction mode candidate list is created.
- the second prediction mode, and the adjacent mode of the first prediction mode create a prediction mode candidate list; or, according to the first prediction mode, the second prediction mode, and the adjacent mode of the second prediction mode, Create a prediction mode candidate list; or, create a prediction mode candidate list according to the first prediction mode, the second prediction mode, the adjacent mode of the first prediction mode, and the adjacent mode of the second prediction mode.
- the adjacent mode refers to a mode with adjacent mode numbers.
- Mode 5 and Mode 6 are adjacent.
- the modes at the boundary include Mode 2 and Mode 34, and Mode 3 and Mode 33 may be used as the adjacent mode of Mode 2, and Mode 33 and Mode 3 may be used as the adjacent mode of Mode 34.
- Application scenario 1 For mode 1, if the first prediction mode is DC mode or Planar mode, determine that the third prediction mode is the same as the first prediction mode; if the first prediction mode is the angle mode, when the first prediction mode is greater than the diagonal mode When the third prediction mode is determined to be the vertical mode; when the first prediction mode is less than or equal to the diagonal mode, the third prediction mode is determined to be the horizontal mode. If the second prediction mode is the DC mode or the Planar mode, the fourth prediction mode is determined to be the same as the second prediction mode; if the second prediction mode is the angle mode, when the second prediction mode is greater than the diagonal mode, the fourth prediction mode is determined to be Vertical mode; when the second prediction mode is less than or equal to the diagonal mode, it is determined that the fourth prediction mode is the horizontal mode.
- the "diagonal mode” here is a mode in which the predicted direction is the direction of the target line.
- the prediction direction of the mode 34 in FIG. 4c is the angle direction from the lower right to the upper left.
- the comparison of the size relationship between modes may refer to the comparison of mode numbers. For example, if the first prediction mode is mode 38 and the diagonal mode is mode 34, then the first prediction mode is larger than the diagonal mode.
- the third prediction mode is the same as the fourth prediction mode, then: if the third prediction mode is the DC mode or the Planar mode, there are three candidate prediction modes in the prediction mode candidate list, in this order: Planar mode, DC mode And the vertical mode; if the third prediction mode is an angle mode, the candidate prediction modes in the prediction mode candidate list are: the third prediction mode, the Planar mode, and the DC mode.
- the candidate prediction modes in the prediction mode candidate list are: the third prediction mode, the fourth prediction mode, and the specific prediction mode; where, (1) if the third prediction mode and If neither the fourth prediction mode is the Planar mode, the specific prediction mode is the Planar mode; when (1) is not satisfied, (2) if neither the third prediction mode nor the fourth prediction mode is the DC mode, the specific prediction mode is the DC mode; When neither (1) or (2) is satisfied, the specific prediction mode is the vertical mode.
- the first prediction mode is denoted as ModeA
- the second prediction mode is denoted as ModeB
- the three candidate prediction modes included in the prediction mode candidate list are CandModeList[0], CandModeList[1] and CandModeList[2].
- ModeA and ModeB are first initialized to DC mode. If the prediction mode of the first neighboring block is obtained, ModeA is updated using the obtained prediction mode. If the prediction mode of the second neighboring block is obtained, the obtained prediction mode is used. Update ModeB. If it is not obtained, no update is required.
- ModeA is not DC mode or Planar mode, it is determined whether ModeA is greater than diagonal mode, if it is, ModeA is set to vertical mode, if less than or equal to diagonal mode, ModeA is set to horizontal mode. If ModeA is DC mode or Planar mode, it remains unchanged.
- ModeB is not DC mode or Planar mode, it is determined whether ModeB is greater than diagonal mode, if it is, then ModeB is set to vertical mode, if less than or equal to diagonal mode, ModeB is set to horizontal mode. If ModeB is DC mode or Planar mode, it remains unchanged.
- ModeA is equal to ModeB, if ModeA and ModeB are in DC mode or Planar mode, then: CandModeList[0] is Planar mode; CandModeList[1] is DC mode; CandModeList[2] is vertical mode. If Mode and ModeB are both angle modes, CandModeList[0] is ModeA and CandModeList[1] is Planar mode.
- CandModeList[2] is DC mode.
- ModeA is not equal to ModeB
- CandModeList[0] is ModeA mode
- CandModeList[1] is ModeB mode
- CandModeList[2] is judged as follows: (1) If neither ModeA nor ModeB is Planar mode, CandModeList[2] is Planar Mode; When (1) is not satisfied, (2) If ModeA and ModeB are not DC mode, then CandModeList[2] is DC mode, when (1) and (2) are not satisfied, CandModeList[2] is vertical mode.
- Application scenario 2 For mode two, if the first prediction mode is the same as the second prediction mode, then: if the first prediction mode is DC mode or Planar mode, there are three candidate prediction modes in the prediction mode candidate list, which can be in turn : Planar mode, DC mode and vertical mode. If the first prediction mode is the same as the second prediction mode, then: if the first prediction mode is the angle mode, the candidate prediction modes in the prediction mode candidate list may be: the first prediction mode, the first prediction mode O mode.
- the candidate prediction modes in the prediction mode candidate list are: the first prediction mode, the second prediction mode, and the preset prediction mode; where, (1) if the first prediction If neither the mode nor the second prediction mode is Planar mode, the preset prediction mode is Planar mode; when (1) is not satisfied, (2) if neither the first prediction mode nor the second prediction mode is DC mode, the preset prediction mode It is the DC mode; when (1) and (2) are not satisfied, the preset prediction mode is the vertical mode.
- the first prediction mode is denoted as ModeA
- the first prediction mode is denoted as ModeB
- the three candidate prediction modes included in the prediction mode candidate list are CandModeList[0], CandModeList[1] and CandModeList[2].
- ModeA and ModeB are first initialized to DC mode. If the prediction mode of the first neighboring block is obtained, ModeA is updated using the obtained prediction mode. If the prediction mode of the second neighboring block is obtained, the obtained prediction mode is used. Update ModeB. If it is not obtained, no update is required.
- ModeA is equal to ModeB, if ModeA and ModeB are in DC mode or Planar mode, then: CandModeList[0] is Planar mode; CandModeList[1] is DC mode; CandModeList[2] is vertical mode. If Mode and ModeB are both angle modes, CandModeList[0] is ModeA, and CandModeList[1] and CandModeList[2] are two modes adjacent to ModeA. Among them, mode 2 is adjacent to mode 3 and mode 33, and mode 34 is adjacent to mode 33 and mode 3.
- ModeA is not equal to ModeB
- CandModeList[0] is ModeA mode
- CandModeList[1] is ModeB mode
- CandModeList[2] is judged as follows: (1) If neither ModeA nor ModeB is Planar mode, CandModeList[2] is Planar Mode; When (1) is not satisfied, (2) If ModeA and ModeB are not DC mode, then CandModeList[2] is DC mode, when (1) and (2) are not satisfied, CandModeList[2] is vertical mode.
- Application scenario 3 For mode two, if the first prediction mode is the same as the second prediction mode, then: if the first prediction mode is the DC mode or the Planar mode, there are 6 candidate prediction modes in the prediction mode candidate list, in order: : Two adjacent modes of first prediction mode, default prediction mode, vertical mode, horizontal mode and vertical mode; where, if the first prediction mode is DC mode, the default prediction mode is Planar mode, if the first prediction mode is Planar mode, then the default prediction mode is DC mode.
- the candidate prediction modes in the prediction mode candidate list are: first prediction mode, Planar mode, DC mode, first prediction The first adjacent mode of the mode, the second adjacent mode of the first prediction mode, and the third adjacent mode of the first prediction mode; wherein, the first adjacent mode, the second adjacent mode, and the third adjacent mode are all Determined by offset value (such as offset value) and modulus value (such as Mod value).
- offset value such as offset value
- modulus value such as Mod value
- the candidate prediction modes in the prediction mode candidate list are: first prediction mode, second prediction mode , Planar mode, DC mode, the first adjacent mode of the candidate prediction mode and the second adjacent mode of the candidate prediction mode; wherein, the candidate prediction mode is a mode with a larger number in the first prediction mode and the second prediction mode;
- the first adjacent mode and the second adjacent mode are determined by the offset value and the modulus value.
- the candidate prediction modes in the prediction mode candidate list are: the first prediction mode, the second prediction mode, the reference prediction mode, the third adjacent mode of the candidate prediction mode, and the fourth adjacent mode of the candidate prediction mode The fifth neighboring mode of the mode and the candidate prediction mode; where the candidate prediction mode is a mode with a larger number in the first prediction mode and the second prediction mode; if there is no Planar mode in the first prediction mode and the second prediction mode , The reference prediction mode is the Planar mode; if there is no DC mode in the first prediction mode and the second prediction mode, the reference prediction mode is the DC mode; the third adjacent mode, the fourth adjacent mode, and the fifth adjacent mode , Are determined by the offset value and modulus value.
- the first prediction mode may be denoted as ModeA
- the second prediction mode may be denoted as ModeB
- the six candidate prediction modes included in the prediction mode candidate list may be CandModeList[ 0], CandModeList[1], CandModeList[2], CandModeList[3], CandModeList[4] and CandModeList[5].
- CandModeList[1] Planar mode or DC mode, if ModeA is DC mode, then CandModeList[1 ] Is Planar mode, if ModeA is Planar mode, CandModeList[1] is DC mode;
- CandModeList[2] vertical mode;
- CandModeList[3] horizontal mode;
- CandModeList[4] vertical mode-4 (that is, vertical mode For the adjacent mode, as shown in FIG. 4B, the vertical mode is mode 26. Therefore, CandModeList[4] is mode 22);
- CandModeList[5] vertical mode+4 (that is, the adjacent mode of vertical mode, that is, mode 30).
- CandModeList[3], CandModeList[4] and CandModeList[5] are adjacent modes of ModeA
- CandModeList[3], CandModeList[4] and CandModeList[5] are determined by offset and mod, and the initial values of offset and mod The value can be configured based on experience, without limitation.
- ModeA is a known value.
- the value of ModeA is 28, and offset and mod are also known values configured based on experience. Substitute 28, offset, and mod into the above formula to obtain CandModeList[3], CandModeList[4] and CandModeList[5].
- CandModeList[4] ((CandModeList[maxCandModeIdx]+offset)%mod)+2;
- CandModeList[5] ((CandModeList[maxCandModeIdx]- 1)% mod)+2.
- CandModeList[maxCandModeIdx] is the one with the larger mode number in ModeA and ModeB.
- ModeA and ModeB are known values.
- ModeA is Mode 28 and ModeB is Mode 23
- ModeA is greater than ModeB
- CandModeList[maxCandModeIdx] is the value of ModeA, which is 28, and offset and mod are also based on Known values of empirical configuration, can be obtained by substituting 28, offset and mod into the above formula, CandModeList [4] and CandModeList [5].
- CandModeList[4] ((CandModeList[maxCandModeIdx]+offset-1)%mod)+2;
- CandModeList[5] ((CandModeList[maxCandModeIdx] )%Mod)+2.
- CandModeList[maxCandModeIdx] is the one with the larger mode number in ModeA and ModeB.
- ModeA and ModeB are known values.
- ModeA is Mode 28 and ModeB is Mode 23
- ModeA is greater than ModeB
- CandModeList[maxCandModeIdx] is the value of ModeA, which is 28, and offset and mod are also based on Known values of empirical configuration, can be obtained by substituting 28, offset and mod into the above formula, CandModeList [4] and CandModeList [5].
- CandModeList[4] and CandModeList[5] are adjacent modes of the candidate prediction mode, and the candidate prediction mode is the one with the larger mode number in ModeA and ModeB.
- CandModeList[4] and CandModeList[5] are offset Determined with mod, the initial values of offset and mod are configured according to experience.
- CandModeList[1] ModeB;
- CandModeList[2] Planar mode or DC mode, where, if there is DC mode in ModeA and ModeB, CandModeList[2] is Planar mode, if there is Planar mode in ModeA and ModeB, then CandModeList[2] is DC mode;
- CandModeList[3] ((CandModeList[maxCandModeIdx]+offset)%mod)+2;
- CandModeList[4] ((CandModeList[maxCandModeIdx]-1)%mod)+2;
- CandModeList [5] ((CandModeList[maxCandModeIdx
- CandModeList[maxCandModeIdx] is the larger one of ModeA and ModeB.
- CandModeList [3], CandModeList [4], and CandModeList [5] are all adjacent modes of the candidate prediction mode, and the candidate prediction mode is the mode number of ModeA and ModeB that is larger.
- CandModeList[3], CandModeList[4] and CandModeList[5] are determined by offset and mod.
- ModeA and ModeB are known values.
- ModeA is Mode 28 and ModeB is Mode 23
- ModeA is greater than ModeB
- CandModeList[maxCandModeIdx] is the value of ModeA 28
- offset and mod are known configurations based on experience Value, substituting 28, offset and mod into the above formula, you can get CandModeList [3], CandModeList [4] and CandModeList [5].
- selecting one candidate prediction mode from the prediction mode candidate list as the target prediction mode for intra prediction may include: Method 1: For the encoding end, the encoding end may predict based on each candidate in the prediction mode candidate list The rate-distortion cost of the mode selects the candidate prediction mode with the lowest rate-distortion cost as the target prediction mode for intra prediction. Specifically, the encoding end may use the rate-distortion principle to determine the rate-distortion cost of each candidate prediction mode, and there is no restriction on the determination method. Then, the encoding end may use the candidate prediction mode with the lowest rate-distortion cost as the target prediction mode.
- the encoded bit stream carries first indication information, where the first indication information is used to indicate index information of the target prediction mode, and the index information indicates that the target prediction mode is The number of candidate prediction modes in the prediction mode candidate list.
- the decoding end receives an encoded bit stream from the encoding end, where the encoded bit stream carries first indication information, and the first indication information is used to indicate index information of a target prediction mode. Based on the first indication information, the decoding end selects a candidate prediction mode corresponding to the index information from the prediction mode candidate list, and uses the selected candidate prediction mode as the target prediction mode for intra prediction.
- Method 2 The encoding end and the decoding end use the target prediction mode by default through the agreement, so that the encoded bit stream does not need to carry the first indication information, that is, the index value (that is, the index information of the target prediction mode) does not need to be transmitted, so that Save coding overhead for transmitting index values.
- the encoding side and the decoding side fixedly use the DC mode as the target prediction mode for intra prediction.
- both the encoding end and the decoding end configure a first preset strategy, and both the encoding end and the decoding end determine the target prediction mode of intra prediction based on the first preset strategy.
- the encoding end selects one candidate prediction mode from the prediction mode candidate list according to the first preset strategy as the target prediction mode for intra prediction; in addition, the decoding end selects one candidate from the prediction mode candidate list according to the first preset strategy
- the prediction mode serves as the target prediction mode for intra prediction.
- the first preset strategy is used to indicate the target prediction mode in the prediction mode candidate list.
- the first preset strategy is used to stipulate that the first candidate prediction mode in the prediction mode candidate list is the target prediction mode, then the encoding side uses the first candidate prediction mode in the prediction mode candidate list as the target prediction mode, and the decoding side Take the first candidate prediction mode in the prediction mode candidate list as the target prediction mode.
- Embodiment 5 In step 201 and step 301, the decoding end/encoding end needs to determine the target prediction mode of intra prediction according to the first prediction mode and the second prediction mode. In the second possible implementation manner, case 1, If the first prediction mode is the same as the second prediction mode, the first prediction mode is determined as the target prediction mode for intra prediction. Or, case 2.
- the target prediction mode for intra prediction is determined according to the first prediction mode; specifically, in case 2, if the first prediction mode is the DC mode, then Determine the target prediction mode as the DC mode; if the first prediction mode is the Planar mode, determine the target prediction mode as the Planar mode; if the first prediction mode is the angle mode, when the first prediction mode is greater than the diagonal mode, determine the target prediction The mode is the vertical mode; when the first prediction mode is less than or equal to the diagonal mode, it is determined that the target prediction mode is the horizontal mode.
- the intra-frame prediction mode used includes 4 prediction modes, such as DC mode, Planar mode, vertical mode, and horizontal mode.
- the intra prediction mode To simplify, simplify the construction process of the prediction mode candidate list, so that the prediction mode candidate list includes only one candidate prediction mode, and use the candidate prediction mode as the target prediction mode. Or, instead of constructing a prediction mode candidate list, directly select a prediction mode as the target prediction mode.
- ModeA and ModeB are first initialized to DC mode. If the prediction mode of the first neighboring block is obtained, ModeA is updated using the obtained prediction mode. If the prediction mode of the second neighboring block is obtained, the obtained prediction mode is used. Update ModeB. If it is not obtained, no update is required.
- ModeA is equal to ModeB
- the target prediction mode is ModeA. If ModeA is not equal to ModeB, the target prediction mode is determined according to ModeA. For example, if ModeA is DC mode, determine the target prediction mode as DC mode; if ModeA is Planar mode, determine the target prediction mode as Planar mode; if ModeA is an angle mode, when ModeA is greater than diagonal mode, determine the target prediction mode as vertical Mode; when ModeA is less than or equal to the diagonal mode, the target prediction mode is determined to be the horizontal mode.
- Embodiment 6 In step 202 and step 302, the decoding end/encoding end needs to obtain the motion information candidate list of the current block.
- the motion information candidate list includes at least one motion information.
- the merge mode is used to create the motion information candidate list of the current block; or, the AMVP (AdvancedMotionVectorPrediction, advanced motion vector prediction) mode is used to create the motion information candidate list of the current block; or, the affine merge mode is used to create the current The motion information candidate list of the block; or, the affine AMVP mode is used to create the motion information candidate list of the current block; or, the merge mode and the MMVD mode are used to create the motion information candidate list of the current block; or, the AMVP mode and the MMVD mode are used to create the current The motion information candidate list of the block; or, the affine merge mode and the MMVD mode are used to create the motion information candidate list of the current block; or, the affine merge mode and the MMVD mode are used to create the motion information candidate list
- inter prediction may use the merge mode to create a motion information candidate list, and obtain the inter prediction value of the current block based on the motion information candidate list.
- motion information in other modes such as MMVD mode
- MMVD mode may be used to create a motion information candidate list, and the inter prediction value of the current block is obtained based on the motion information candidate list, and then weighted with the intra prediction value to obtain a weighted value.
- inter prediction is performed to obtain the inter prediction value of the affine block, and then intra prediction is performed to obtain the intra prediction value, and then the intra prediction value and the inter frame are obtained.
- the weighting of the predicted values yields a weighted predicted value, which in turn results in a better predicted pixel value.
- the MMVD mode and the merge mode are used to create a motion information candidate list, and the inter prediction value of the current block is obtained based on the motion information candidate list.
- intra prediction is needed to obtain intra prediction values. For example, six candidate prediction modes in the prediction mode candidate list are selected to obtain a target prediction mode, and the intra prediction value is obtained based on the target prediction mode. Then, the intra-frame prediction value and the inter-frame prediction value are weighted to obtain a weighted prediction value, and then a better prediction pixel value is obtained.
- the MMVD mode and the merge mode are used to create a motion information candidate list, and the inter prediction value of the current block is obtained based on the motion information candidate list.
- intra prediction is needed to obtain intra prediction values. For example, three candidate prediction modes in the prediction mode candidate list are selected to obtain a target prediction mode, and the intra prediction value is obtained based on the target prediction mode. Then, the intra-frame prediction value and the inter-frame prediction value are weighted to obtain a weighted prediction value, and then a better prediction pixel value is obtained.
- the Merge mode will create a motion information candidate list for the current block.
- N candidate motion information such as motion vectors and corresponding reference frame information
- the candidate motion information with the lowest rate-distortion cost is finally selected as the best motion information for the Merge mode. If the encoding end and the decoding end construct the motion information candidate list in the same manner, the encoding end only needs to transmit the index of the optimal motion information in the motion information candidate list, which can greatly save the number of encoded bits of the motion information.
- the motion information candidate list established by the Merge mode includes both the space and time domains, and for the B Slice (that is, the two-way inter-frame coding strip), it also contains the combined motion information candidate list.
- A1 represents the lowest candidate block on the left side of the current block
- B1 represents the rightmost candidate block above the current block
- B0 and A0 represent the upper right and lower left of the current block, respectively
- B2 represents the closest candidate block in the upper left corner of the current block.
- the motion information of the 4 candidate blocks of the above 5 candidate blocks is used at most, and is established in the order of A1-B1-B0-A0-(B2), and B2 is a substitute. That is, when one or more of the motion information of A1, B1, B0, and A0 cannot be obtained, the motion information of B2 is required.
- the motion information of the candidate block of the corresponding position of the current block in the adjacent encoded image can be used. Unlike the spatial domain situation, the candidate list of temporal motion information cannot directly use the candidate block For motion information, you need to adjust the scale according to the position relationship between the reference image and the current image. Assuming that only one candidate motion information is provided in the time domain at most, the motion information of the candidate block at the H position in FIG. 5B is obtained by scaling. If the motion information of the candidate block at the H position is not available, the candidate block at the C3 position is substituted.
- the motion information candidate list for the B slice block, because there are two motion information, the motion information candidate list also provides two predicted motion information, such as the first 4 candidate motion information of the candidate motion information.
- the two combinations produce a combined motion information candidate list of B Slice.
- merge technology Merge
- AMVP AMVP technology
- the motion information list is selected by the rate-distortion cost, and an optimal candidate motion information is selected as the predicted motion information of the current block.
- the main difference between the two is reflected in two aspects.
- the motion information of the current block is directly predicted from adjacent blocks in the spatial or temporal domain.
- Motion Vector Difference MVD
- AMVP can Seen as MV prediction technology, the encoder only needs to encode the difference between the actual MV and the predicted MV, so there is MVD.
- the lengths of the motion information candidate lists of the two are different, and the manner of constructing the motion information candidate list is also different. The construction of the motion information candidate list in the AMVP mode will not be described in detail.
- Affine mode is used to create the motion information candidate list of the current block.
- the affine merge mode ie, affine merge
- the affine AMVP mode ie, affine, amvp
- the affine mode is a prediction technology based on sub-blocks. Through the motion information of control points and the motion parameter model, the motion information of each sub-block can be derived. For the four-parameter affine block, the motion information of each sub-block of the current block is obtained from the information of the two control points. For example, referring to FIG. 5C, the motion information of each sub-block can be obtained by the following formula. For affine, it is also divided into affine merge and affine amvp. Affine merge is similar to the merge mode, by using the motion information in the motion information candidate list to obtain the motion information of the current block, and transmitting the index value of the motion information candidate in the coded code stream.
- MVD For affine amvp, there is also MVD, that is to say, the information of each control point is not obtained by prediction, but is obtained by searching. It is necessary to subtract the predicted motion information of the current block from the motion information obtained by the search. The difference in motion information is obtained, and then the difference in motion information is transmitted in the encoded code stream.
- the MMVD technology uses the candidate motion information of the original merge mode to offset the candidate motion information in a direction and angle to obtain new motion information, so as to obtain the purpose of better prediction.
- the motion information can be offset based on the existing candidate motion information, as shown in Table 2.
- the offset amplitude can be seen in Table 3, and the following offset schemes are given. Again, the bias direction is shown in Table 4.
- Embodiment 7 In step 202 and step 302, the decoding end/encoding end needs to determine target motion information for inter prediction according to the motion information candidate list.
- the determination process may include:
- the encoding end may select the motion information with the lowest rate distortion cost as the target motion information for inter prediction based on the rate distortion cost of each motion information in the motion information candidate list. Specifically, the encoding end may use the rate-distortion principle to determine the rate-distortion cost of each motion information, and there is no restriction on this determination method, and then use the motion information with the lowest rate-distortion cost as the target motion information.
- the encoded bit stream carries second indication information, and the second indication information is used to indicate index information of target motion information, where the index information indicates that the target motion information is The motion information in the motion information candidate list.
- the decoding end receives an encoded bit stream from the encoding end, where the encoded bit stream carries second indication information, and the second indication information is used to indicate index information of target motion information. Based on the second indication information, the decoding end selects the motion information corresponding to the index information from the motion information candidate list, and uses the selected motion information as the target motion information for inter prediction.
- Method 2 The encoding end uses the target motion information by default through the agreement, so that the encoded bit stream does not need to carry the second indication information, that is, the index value (that is, the index information of the target motion information) does not need to be transmitted, and the decoding end also passes the protocol By default, the target motion information is used, which can save the coding overhead of transmitting the index value.
- the encoding end and the decoding end use the first motion information in the motion information candidate list as the target motion information for inter prediction.
- both the encoding end and the decoding end configure a second preset strategy, and both the encoding end and the decoding end determine target motion information for inter prediction based on the second preset strategy.
- the encoding end selects one piece of motion information from the motion information candidate list as the target motion information for inter prediction according to the second preset strategy; in addition, the decoding end selects one piece of motion information from the motion information candidate list according to the second preset strategy As the target motion information for inter prediction.
- the second preset strategy is used to indicate target motion information in the motion information candidate list.
- the second preset strategy is used to stipulate that the first motion information in the motion information candidate list is the target motion information, then the encoding side uses the first motion information in the motion information candidate list as the target motion information, and the decoding side uses the motion
- the first motion information in the information candidate list is used as the target motion information.
- both the encoding end and the decoding end configure a first preset strategy and a second preset strategy
- the encoding end and the decoding end both determine the target prediction mode of intra prediction based on the first preset strategy
- the encoding end and the decoding end The target motion information of the inter prediction is determined based on the second preset strategy, so that the index information of the target prediction mode and the index information of the target motion information are not required to be transmitted in the code stream, and the decoder can also determine the target prediction mode And target motion information, thereby saving the coding overhead of the transmission index.
- Embodiment 8 In step 202 and step 302, it can also be implemented in the following manner:
- Method 1 When the MMVD mode is used to create the motion information candidate list of the current block, multiple original motion information is offset, and the offset motion information is added to the motion information candidate list; or, one original motion information is offset Shift, add the shifted motion information to the motion information candidate list.
- original motion information refers to existing candidate motion information.
- the motion information of the MMVD mode and the merge mode at the same time to obtain the inter-frame prediction value it is necessary to pay attention to the source of the prediction value of the MMVD.
- the purpose of the MMVD itself is to obtain better prediction information by offsetting the original motion information in a directional and angular manner. Therefore, it is possible to carry out directional and angular motion information of multiple original merge modes Or, the motion information of the first merge mode can be shifted in a direction and an angle.
- the intra-block copy mode is configured for the current block, it is equivalent to enabling the inter-frame prediction technology of the intra-block, but the reference frame is the current frame, so that it is not necessary to transmit the relevant information of the reference frame index in the code stream. Therefore, a reference block corresponding to the current block may be selected from the current frame, and the inter prediction value of the current block may be determined according to pixel information of the reference block. In addition, intra prediction is needed to obtain intra prediction values. Then, the inter prediction value and the intra prediction value are weighted to obtain a weighted prediction value.
- Method 3 Obtain the inter prediction value of the current block according to the target motion information, including: If the target motion information includes the motion information in the first direction and the motion information in the second direction, the motion information from the first direction and the second direction choose one of the motion information; obtain the inter prediction value of the current block according to the selected motion information, that is, use only one motion information to obtain the inter prediction value.
- the motion information in the merge mode is bidirectional motion information
- this bidirectional prediction only unidirectional prediction information is used to obtain inter prediction information, that is, one motion information is selected from the motion information in two directions
- the inter prediction information is then weighted with the predicted value of intra prediction.
- the construction of the motion information candidate list in the merge mode directly affects the inter prediction value used for intra-frame weighting.
- the following gives a method for constructing the motion information candidate list.
- the motion information candidate list can be constructed by one or more of the following: (1) spatial domain candidates; (2) temporal domain candidates; (3) motion information based on coded blocks; (4) based on the motion information candidate list Some motion information is combined with weighted motion information; (5) The default zero motion information.
- the target motion information can be selected and the inter prediction value can be obtained, which can be weighted with the intra prediction value to obtain better prediction information.
- the construction of the motion information candidate list in the merge mode will affect the inter prediction value used for intra-frame weighting.
- the following gives a method for constructing the motion information candidate list.
- the motion information candidate list can be constructed by one or more of the following: (1) spatial domain candidates; (2) motion information acquired based on an optional temporal domain motion vector prediction mode; (3) temporal domain candidates; (4) Based on the motion information of the coded block; (5) Motion information based on weighted combination of motion information already in the motion information candidate list; (6) Default zero motion information.
- the target motion information can be selected and the inter prediction value can be obtained, which can be weighted with the intra prediction value to obtain better prediction information.
- the optional time-domain motion vector prediction is based on the sub-blocks in the current block, in the corresponding reference frame (adjacent coded frame) to derive the motion information corresponding to the sub-block, using the motion information of the sub-block Predict each sub-block to obtain the prediction value of the current block.
- the size of the sub-block can be N*N, N defaults to 8.
- the optional time-domain motion vector prediction mode can be added to the candidate list as a newly added merge mode candidate.
- Embodiment 9 In step 203 and step 303, the encoder/decoder needs to perform weighting processing on the intra-frame prediction value and the inter-frame prediction value to obtain a weighted prediction value. The following describes this process:
- the encoding end/decoding end may perform weighting processing according to the intra prediction value, the first weight coefficient corresponding to the intra prediction value, the inter prediction value, and the second weight coefficient corresponding to the inter prediction value to obtain a weighted prediction value;
- the first weight coefficient and the second weight coefficient may be different or the same. Further, if the target prediction mode of the current block is the DC mode or the Planar mode, the first weight coefficient is the same as the second weight coefficient. If the target prediction mode of the current block is the horizontal mode, the first weight coefficient of the left sub-block of the current block is greater than the second weight coefficient of the left sub-block, and the first weight coefficient of the right sub-block of the current block is less than or equal to The second weight coefficient of the right sub-block.
- the first weight coefficient of the upper sub-block of the current block is greater than the second weight coefficient of the upper sub-block, and the first weight coefficient of the lower sub-block of the current block is less than or equal to The second weight coefficient of the lower sub-block.
- the first weight coefficient and the second weight coefficient are the same.
- the first weight coefficient and the second weight coefficient are both 0.5.
- the intra prediction value is assumed P1
- the inter prediction value is P2
- the weighted prediction value is P1*0.5+P2*0.5.
- the target prediction mode of the current block is the horizontal mode, as shown in FIG. 6A, block A is the left sub-block of the current block, and block B is the right sub-block of the current block
- the first weight coefficient of block A a11 is greater than the second weight coefficient a12 of the A block.
- a11 is 0.7 and a12 is 0.3.
- the first weight coefficient b11 of the B block is less than or equal to the second weight coefficient b12 of the B block, for example, b11 is 0.3 and b12 is 0.7.
- the intra prediction value of the A block is P11
- the inter prediction value is P12
- the intra prediction value of the B block is P21
- the inter prediction value is P22.
- the weighted prediction value for block A can be P11*a11+P12*a12
- the weighted prediction value for block B can be P21*b11+P22*b22. Then, the weighted prediction value of block A and the weight of block B The prediction values are combined together to obtain the weighted prediction value of the current block, which will not be described in detail.
- the target prediction mode of the current block is the vertical mode, as shown in FIG. 6B
- block A is the upper sub-block of the current block
- block B is the lower sub-block of the current block
- the first weight coefficient of block A a11 is greater than the second weight coefficient a12 of the A block.
- a11 is 0.7 and a12 is 0.3.
- the first weight coefficient b11 of the B block is less than or equal to the second weight coefficient b12 of the B block, for example, b11 is 0.3 and b12 is 0.7.
- the intra prediction value of the A block is P11
- the inter prediction value is P12
- the intra prediction value of the B block is P21
- the inter prediction value is P22.
- the weighted prediction value for block A can be P11*a11+P12*a12
- the weighted prediction value for block B can be P21*b11+P22*b22. Then, the weighted prediction value of block A and the weight of block B The prediction values are combined together to obtain the weighted prediction value of the current block, which will not be described in detail.
- blocks A and B may be the left sub-blocks of the current block
- blocks C and D may be the right sub-blocks of the current block
- the first weight coefficient of block A may also be It is greater than the first weight coefficient of the B block
- the first weight coefficient of the C block may also be greater than the first weight coefficient of the D block.
- the first weight coefficient of block A is 0.9
- the second weight coefficient of block A is 0.1
- the first weight coefficient of block B is 0.7
- the second weight coefficient of block B is 0.3
- the first weight coefficient of block C is 0.5
- the second weight coefficient of the C block is 0.5
- the first weight coefficient of the D block is 0.3
- the second weight coefficient of the D block is 0.7.
- the vertical mode it may be vertical A blocks, B blocks, C blocks, and D blocks, and non-uniform weighted predictions with different weight ratio settings are implemented, which is similar to FIG. 6C and will not be described in detail.
- the encoding end/decoding end may perform weighting processing according to the intra prediction value, the first weight coefficient corresponding to the intra prediction value, the inter prediction value, and the second weight coefficient corresponding to the inter prediction value to obtain a weight Predicted value; where the first weight coefficient and the second weight coefficient can be different.
- the second weight coefficient corresponding to the inter prediction value is greater than the first weight coefficient corresponding to the intra prediction value if the candidate block corresponding to the target motion information is a unidirectional prediction block, and the target motion information is forward motion information. If the candidate block corresponding to the target motion information is a unidirectional prediction block, and the target motion information is backward motion information, the second weight coefficient corresponding to the inter prediction value is smaller than the first weight coefficient corresponding to the intra prediction value. If the candidate block corresponding to the target motion information is a bidirectional prediction block, the second weight coefficient corresponding to the inter prediction value is greater than the first weight coefficient corresponding to the intra prediction value.
- Embodiment 10 The following describes the encoding process at the encoding end and the decoding process at the decoding end.
- the encoding end can determine the rate-distortion cost corresponding to the weighted prediction value, the rate-distortion cost corresponding to the intra-prediction value, and the rate-distortion cost corresponding to the inter-prediction value. If the rate-distortion cost corresponding to the weighted prediction value is the minimum rate-distortion cost, it means that the cost of the weighted prediction value is the smallest. Therefore, the bitstream can be encoded according to the weighted prediction value to obtain an encoded bitstream. For example, corresponding instruction information, such as the above-mentioned first instruction information and second instruction information, is encoded in the bit stream.
- the rate-distortion cost corresponding to the weighted prediction value is not the minimum rate-distortion cost, there is no need to encode the bitstream according to the weighted prediction value to obtain the coded bitstream, and the bitstream can be encoded in a conventional manner, which will not be repeated here.
- the encoded bit stream carries third indication information, and the third indication information is used to indicate The weighted prediction value is used to decode the encoded bit stream.
- the decoding end receives the encoded bit stream from the encoding end, where the encoded bit stream carries third indication information, where the third indication information is used to instruct to decode the encoded bit stream using a weighted prediction value. Based on the third indication information, the decoding end performs weighting processing on the intra prediction value and the inter prediction value to obtain a weighted prediction value.
- Embodiment 11 Refer to FIG. 7, which is a schematic flowchart of a codec method in an embodiment of the present application.
- the method can be applied to a decoding end to determine the weighting of the current block through the following steps when determining to enable intra-frame weighted prediction Prediction value, the weighted prediction value is used for decoding the current block; the method includes the steps of:
- step 701 the decoding end determines the target prediction mode of intra prediction according to the shape of the current block, and obtains the intra prediction value of the current block according to the target prediction mode.
- determining the target prediction mode for intra prediction according to the shape of the current block may include but is not limited to: if the height of the current block is the same as the width of the current block, determine whether the target prediction mode is the DC mode or the Planar mode; if the current block Is greater than the width of the current block, the target prediction mode is determined to be the horizontal mode; if the height of the current block is less than the width of the current block, the target prediction mode is determined to be the vertical mode.
- Step 702 The decoding end obtains a motion information candidate list of the current block, where the motion information candidate list includes at least one motion information; determine target motion information for inter prediction according to the motion information candidate list, and obtain the current block's target motion information according to the target motion information Inter prediction value.
- step 702 For the processing in step 702, reference may be made to the foregoing embodiment 6-8, and details are not described herein again.
- Step 703 The decoding end performs weighting processing on the intra prediction value and the inter prediction value to obtain a weighted prediction value.
- step 703 For the processing in step 703, reference may be made to Embodiment 9 above, and details are not described herein again.
- the current block can be predicted using both the inter-coding technology and the intra-coding technology, that is, the intra-predicted value and the inter-predicted value are weighted, which can improve prediction Accuracy improves prediction performance, which leads to improved coding performance.
- Embodiment 12 As shown in FIG. 8, it is a schematic flowchart of a codec method in an embodiment of the present application.
- the method can be applied to an encoding side to determine the weighting of the current block through the following steps when determining to enable intra-frame weighted prediction Prediction value, the weighted prediction value is used for encoding the current block; the method includes:
- Step 801 The encoding end determines the target prediction mode of intra prediction according to the shape of the current block, and obtains the intra prediction value of the current block according to the target prediction mode.
- determining the target prediction mode for intra prediction according to the shape of the current block may include but is not limited to: if the height of the current block is the same as the width of the current block, determine whether the target prediction mode is the DC mode or the Planar mode; if the current block Is greater than the width of the current block, the target prediction mode is determined to be the horizontal mode; if the height of the current block is less than the width of the current block, the target prediction mode is determined to be the vertical mode.
- Step 802 The encoding end obtains a motion information candidate list of the current block, where the motion information candidate list includes at least one motion information; determine target motion information for inter prediction according to the motion information candidate list, and obtain the current block's target motion information according to the target motion information Inter prediction value.
- step 802 For the processing in step 802, reference may be made to the foregoing embodiment 6-8, and details are not described herein again.
- Step 803 The encoding end performs weighting processing on the intra prediction value and the inter prediction value to obtain a weighted prediction value.
- step 803 For the processing in step 803, reference may be made to Embodiment 9 above, and details are not described herein again.
- the current block can be predicted using both the inter-coding technology and the intra-coding technology, that is, the intra-predicted value and the inter-predicted value are weighted, which can improve prediction Accuracy improves prediction performance, which leads to improved coding performance.
- Embodiment 13 In this embodiment of the present application, another encoding and decoding method is proposed. This method can be applied to the encoding end or the decoding end.
- the weighted prediction value of the current block is obtained through the following steps , The weighted prediction value is used for encoding or decoding the current block; the method includes:
- Step a1 Acquire the intra prediction value of the current block according to the preset prediction mode.
- the encoding end uses the preset prediction mode by default through agreement, that is to say, the preset prediction mode is the target prediction mode in the foregoing embodiment, so that the encoding end can directly use the preset prediction mode to obtain the frame of the current block Intra-predicted value.
- the decoder also uses the preset prediction mode by default through the agreement, so that the decoder can directly use the preset prediction mode to obtain the intra prediction value of the current block.
- the encoding side and the decoding side fixedly use the DC mode as the preset prediction mode.
- the encoding side obtains the intra prediction value of the current block according to the DC mode
- the decoding side also obtains the intra prediction value of the current block according to the DC mode.
- the encoding end and the decoding end fixedly use the Planar mode as the preset prediction mode. In this way, the encoding end obtains the intra prediction value of the current block according to the Planar mode, and the decoding end also obtains the intra prediction value of the current block according to the Planar mode.
- the preset prediction mode may also be a vertical mode, or the preset prediction mode may also be a horizontal mode, which is not limited.
- Step a2 Obtain a motion information candidate list of the current block, where the motion information candidate list includes at least one motion information; determine target motion information for inter prediction according to the motion information candidate list, and obtain inter frames of the current block according to the target motion information Predictive value.
- the processing procedure can be seen in Example 6-8.
- Step a3 Perform weighting processing on the intra prediction value and the inter prediction value to obtain a weighted prediction value.
- For the processing procedure refer to Embodiment 9 above, and details are not described herein again.
- the current block can be predicted using both the inter-coding technology and the intra-coding technology, that is, the intra-predicted value and the inter-predicted value are weighted, which can improve prediction Accuracy improves prediction performance, which leads to improved coding performance.
- the hardware architecture of the decoding end device provided by the embodiment of the present application can be seen in FIG. 9 for a schematic diagram of the hardware architecture. It includes: a processor 91 and a machine-readable storage medium 92, wherein: the machine-readable storage medium 92 stores machine-executable instructions executable by the processor 91; the processor 91 is used to execute the machine-executable Instructions to implement the method disclosed in the above examples of this application.
- FIG. 10 For the encoding end device provided by the embodiment of the present application, from a hardware perspective, for a schematic diagram of the hardware architecture, refer to FIG. 10 for details. It includes: a processor 93 and a machine-readable storage medium 94, wherein: the machine-readable storage medium 94 stores machine-executable instructions that can be executed by the processor 93; the processor 93 is used to execute the machine-executable Instructions to implement the method disclosed in the above examples of this application.
- embodiments of the present application also provide a machine-readable storage medium, and the machine-readable storage medium stores several computer instructions.
- the present invention can be implemented Apply the method disclosed in the above example.
- the above machine-readable storage medium may be any electronic, magnetic, optical or other physical storage device, and may contain or store information, such as executable instructions, data, and so on.
- the machine-readable storage medium may be: RAM (Radom Access Memory), volatile memory, non-volatile memory, flash memory, storage drive (such as a hard disk drive), solid-state drive, any type of storage disk (Such as optical discs, DVDs, etc.), or similar storage media, or a combination thereof.
- the system, device, module or unit explained in the above embodiments may be specifically implemented by a computer chip or entity, or implemented by a product having a certain function.
- a typical implementation device is a computer, and the specific form of the computer may be a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email sending and receiving device, and a game control Desk, tablet computer, wearable device, or any combination of these devices.
- the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present application may take the form of computer program products implemented on one or more computer usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer usable program code.
- computer usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
- these computer program instructions can also be stored in a computer readable memory that can guide a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce a manufactured product including an instruction device,
- the instruction device implements the functions specified in one block or multiple blocks of one flow or multiple blocks in the flowchart and/or block diagram.
- These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operating steps are performed on the computer or other programmable device to produce computer-implemented processing, which is executed on the computer or other programmable device
- the instructions provide steps for implementing the functions specified in one block or multiple blocks of the flowchart one flow or multiple flows and/or block diagrams.
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Compression Or Coding Systems Of Tv Signals (AREA)
Abstract
本申请提供一种编解码方法及其设备,包括:确定启用帧内帧间加权预测时,通过以下步骤获取当前块的加权预测值,所述加权预测值用于所述当前块的编码或解码;获取所述当前块的第一相邻块的第一预测模式、当前块的第二相邻块的第二预测模式;根据第一预测模式和第二预测模式确定用于帧内预测的目标预测模式,根据目标预测模式获取当前块的帧内预测值;获取当前块的运动信息候选列表,运动信息候选列表包括至少一个运动信息;根据运动信息候选列表确定用于帧间预测的目标运动信息,根据目标运动信息获取当前块的帧间预测值;对帧内预测值和帧间预测值进行加权处理,得到所述加权预测值。
Description
本申请涉及编解码领域,尤其是涉及一种编解码方法及其设备。
为了达到节约空间的目的,视频图像都是经过编码后才传输的,视频编码可以包括预测、变换、量化、熵编码、滤波等过程。其中,预测可以包括帧内预测和帧间预测。进一步的,帧间编码是利用视频时域的相关性,使用邻近已编码图像的像素预测当前像素,以达到有效去除视频时域冗余的目的。此外,帧内编码是指利用视频空域的相关性,使用当前图像的已经编码块的像素预测当前像素,以达到去除视频空域冗余的目的。
综上所述,可以采用帧间编码或帧内编码对当前像素进行预测。但是,在某些应用场景下,帧间编码和帧内编码的预测准确性均不高。
发明内容
本申请提供了一种编解码方法及其设备,提高预测准确性。
本申请提供一种编解码方法,所述方法包括:
确定启用帧内帧间加权预测时,通过以下步骤获取当前块的加权预测值,所述加权预测值用于所述当前块的编码或解码;
获取所述当前块的第一相邻块的第一预测模式、当前块的第二相邻块的第二预测模式;根据所述第一预测模式和所述第二预测模式确定帧内预测的目标预测模式,并根据所述目标预测模式获取所述当前块的帧内预测值;
获取所述当前块的运动信息候选列表,所述运动信息候选列表包括至少一个运动信息;根据所述运动信息候选列表确定帧间预测的目标运动信息,并根据所述目标运动信息获取所述当前块的帧间预测值;
对所述帧内预测值和所述帧间预测值进行加权处理,得到所述加权预测值。
本申请提供一种编解码方法,所述方法包括:
确定启用帧内帧间加权预测时,通过以下步骤获取当前块的加权预测值,所述加权预测值用于所述当前块的编码或解码:
根据所述当前块的形状确定帧内预测的目标预测模式,并根据所述目标预测模式获取所述当前块的帧内预测值;
获取所述当前块的运动信息候选列表,所述运动信息候选列表包括至少一个运动信息;根据所述运动信息候选列表确定帧间预测的目标运动信息,并根据所述目标运动信息获取所述当前块的帧间预测值;
对所述帧内预测值和所述帧间预测值进行加权处理,得到所述加权预测值。
本申请提供一种编解码方法,所述方法包括:
确定启用帧内帧间加权预测时,通过以下步骤获取当前块的加权预测值,所述加权预测值用于所述当前块的编码或解码;
根据预设预测模式获取所述当前块的帧内预测值;
获取所述当前块的运动信息候选列表,所述运动信息候选列表包括至少一个运动信息;根据所述运动信息候选列表确定帧间预测的目标运动信息,并根据所述目标运动信息获取所述当前块的帧间预测值;
对所述帧内预测值和所述帧间预测值进行加权处理,得到所述加权预测值。
本申请提供一种解码端设备,包括:处理器和机器可读存储介质,所述机器可读存储介质存储有能够被所述处理器执行的机器可执行指令;所述处理器用于执行机器可执行指令,以实现上述的方法步骤。
本申请提供一种编码端设备,包括:处理器和机器可读存储介质,所述机器可读存储介质存储有能够被所述处理器执行的机器可执行指令;所述处理器用于执行机器可执行指令,以实现上述的方法步骤。
由以上技术方案可见,本申请实施例中,可以同时采用帧间编码技术和帧内编码技术对当前块进行预测,即采用帧内预测值与帧间预测值加权的方式,这样,可以提高预测准确性,提高预测性能,从而带来编码性能的提高。
为了更加清楚地说明本申请实施例或者现有技术中的技术方案,下面将对本申请实施例或者现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请中记载的一些实施例,对于本领域普通技术人员来讲,还可以根据本申请实施例的这些附图获得其他的附图。
图1是本申请一种实施方式中的视频编码框架的示意图;
图2是本申请一种实施方式中的编解码方法的流程图;
图3是本申请一种实施方式中的编解码方法的流程图;
图4A-图4C是本申请一种实施方式中的相邻块和预测模式的示意图;
图5A-图5C是本申请一种实施方式中的运动信息候选列表的示意图;
图6A-图6C是本申请一种实施方式中的权重系数的示意图;
图7是本申请一种实施方式中的编解码方法的流程图;
图8是本申请一种实施方式中的编解码方法的流程图;
图9是本申请一种实施方式中的解码端设备的硬件结构图;
图10是本申请一种实施方式中的编码端设备的硬件结构图。
在本申请实施例使用的术语仅仅是出于描述特定实施例的目的,而非限制本申请。本申请和权利要求书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其它含义。还应当理解,本文中使用的术语“和/或”是指包含一个或多个相关联的列出项目的任何或所有可能组合。
应当理解,尽管在本申请实施例可能采用术语第一、第二、第三等来描述各种信息,但这些信息不应限于这些术语。这些术语仅用来将同一类型的信息彼此区分开。例如,在不脱离本申请范围的情况下,第一信息也可以被称为第二信息,类似地,第二信息也可以被称为第一信息。取决于语境,此外,所使用的词语“如果”可以被解释成为“在……时”或“当……时”或“响应于确定”。
本申请实施例中提出一种编解码方法,可以涉及如下概念。
帧内预测(intra prediction)是指,利用视频空域的相关性,使用当前图像已经编码块的像素预测当前像素,以达到去除视频空域冗余的目的。帧内预测中规定了多种预测模式,每一种预测模式都对应一种纹理方向(DC模式除外),当前块的预测像素值由相邻块的边界重构像素值预测。举例说明,如果图像的纹理是呈现水平状排布的,那么选择水平预测模式可以更好的预测图像信息。
帧间预测(inter prediction)是指,利用视频时域的相关性,由于视频序列通常有较强的时域相关性,使用邻近的已编码图像的像素预测当前图像的像素,可以达到有效去除视频时域冗余的目的。主流的视频编码标准中关于帧间预测都采用了基于块的运动补偿技术,基本原理是为当前图像的每一个像素块在之前的已编码图像中寻找一个最佳匹配块,该过程称为运动估计(Motion Estimation,ME)。
运动矢量(Motion Vector,MV):在帧间编码中,使用运动矢量表示当前帧视频图像的当前图像块与参考帧视频图像的参考图像块之间的相对位移。例如,当前帧的视频图像A与参考帧的视频图像B存在很强的时域相关性,在传输视频图像A的图像块A1(当前图像块)时,可以在视频图像B中进行运动搜索,找到与图像块A1最匹配的图像块B1(参考图像块),并确定图像块A1与图像块B1之间的相对位移,该相对位移也就是图像块A1的运动矢量。如果对每个图像块的运动矢量进行独立编码和传输,特别是在图像被划分成小尺寸的大量图像块的情况下,则消耗相当多的比特。为降低用于编码运动矢量的比特数,可以利用相邻图像块的空间相关性,根据相邻已编码图像块的运动矢量对当前待编码图像块的运动矢量进行预测,然后对预测差进行编码,这样可以有效降低表示运动矢量的比特数。这里的“预测差”指运动矢量的预测值与真正估值的差。
具体地,在对当前图像块的运动矢量编码过程中,可以先使用相邻已编码图像块的运动矢量预测当前宏块的运动矢量,然后对该运动矢量的预测值(MVP,Motion Vector Prediction)与运动矢量的真正估值之间的差值(MVD,MotionVector Difference)进行编码,从而有效降低运动矢量的编码比特数。
运动信息(Motion Information):由于运动矢量表示当前图像块与某个参考图像块 的位置偏移,为了准确获取指向(direct to)图像块的信息,除了运动矢量,还需要参考帧图像的索引信息来表示使用哪个参考帧图像。在视频编码技术中,对于当前帧图像,通常可以建立一个参考帧图像列表,参考帧索引则表示当前图像块采用了参考帧图像列表中的第几个参考帧图像。此外,很多编码技术还支持多个参考帧图像列表,因此,还可以使用一个索引值来表示使用了哪一个参考帧图像列表,这个索引值可以称为参考方向。在视频编码技术中,可以将运动矢量、参考帧索引、参考方向等与运动相关的信息统称为运动信息。
率失真原则(Rate-Distortion Optimized):评价编码效率有两大指标:码率和PSNR(Peak Signal to Noise Ratio,峰值信噪比),单位时间内的比特流量越小,则压缩率越大,PSNR越大,则重建图像质量越好。在预测模式选择时,可以利用对这二者指标综合评价的判别公式。例如,预测模式对应的代价:J(mode)=D+λ*R,其中,D表示Distortion(失真),通常可以使用SSE指标来进行衡量,SSE是指重建图像块与源图像的差值的均方和;λ是拉格朗日乘子,R就是该模式下图像块编码所需的实际比特数,包括编码模式信息、运动信息、残差等所需的比特总和。
视频编码框架:参见图1所示,可以使用视频编码框架实现本申请实施例的编码端处理流程,此外,视频解码框架的示意图与图1类似,在此不再重复赘述,可以使用视频解码框架实现本申请实施例的解码端处理流程。
具体的,在视频编码框架和视频解码框架中,可以包括帧内预测单元101、运动估计/运动补偿102、参考图像缓存器103、环内滤波104、重建105、变换106、量化107、反变换108、反量化109、熵编码器110等模块。在编码端,通过这些模块之间的配合,可以实现编码端处理流程,在解码端,通过这些模块之间的配合,可以实现解码端处理流程。
以下结合几个具体实施例,对编解码方法进行详细说明。
实施例1:参见图2所示,为本申请实施例中的编解码方法的流程示意图,该方法可以应用于解码端,确定启用帧内帧间加权预测时,通过以下步骤获取当前块的加权预测值,所述加权预测值用于所述当前块的解码;该方法包括:
步骤201,解码端获取当前块的第一相邻块的第一预测模式、当前块的第二相邻块的第二预测模式;根据该第一预测模式和该第二预测模式确定帧内预测的目标预测模式,并根据该目标预测模式获取当前块的帧内预测值。
步骤202,解码端获取当前块的运动信息候选列表,该运动信息候选列表包括至少一个运动信息;根据该运动信息候选列表确定帧间预测的目标运动信息,并根据该目标运动信息获取当前块的帧间预测值。
步骤203,解码端对该帧内预测值和该帧间预测值进行加权处理,得到当前块的加权预测值。
在一个例子中,解码端在接收到编码比特流后,还可以根据该加权预测值对该编码比特流进行解码,如根据编码比特流恢复当前块的图像。
由以上技术方案可见,本申请实施例中,可以同时采用帧间编码技术和帧内编码技 术对当前块进行预测,即采用帧内预测值与帧间预测值加权的方式,这样,可以提高预测准确性,提高预测性能,从而带来编码性能的提高。
实施例2:参见图3所示,为本申请实施例中的编解码方法的流程示意图,该方法可以应用于编码端,确定启用帧内帧间加权预测时,通过以下步骤获取当前块的加权预测值,所述加权预测值用于所述当前块的编码;该方法包括:
步骤301,编码端获取当前块的第一相邻块的第一预测模式、当前块的第二相邻块的第二预测模式;根据该第一预测模式和该第二预测模式确定帧内预测的目标预测模式,并根据该目标预测模式获取当前块的帧内预测值。
步骤302,编码端获取当前块的运动信息候选列表,该运动信息候选列表包括至少一个运动信息;根据该运动信息候选列表确定帧间预测的目标运动信息,并根据该目标运动信息获取当前块的帧间预测值。
步骤303,编码端对该帧内预测值和该帧间预测值进行加权处理,得到当前块的加权预测值。
在一个例子中,编码端还可以根据该加权预测值对比特流进行编码,得到编码比特流,例如,在比特流中编码相应的指示信息。
由以上技术方案可见,本申请实施例中,可以同时采用帧间编码技术和帧内编码技术对当前块进行预测,即采用帧内预测值与帧间预测值加权的方式,这样,可以提高预测准确性,提高预测性能,从而带来编码性能的提高。
实施例3:在步骤201和步骤301中,解码端/编码端需要获取当前块的第一相邻块的第一预测模式、当前块的第二相邻块的第二预测模式。参见图4A所示,示出了第一相邻块和第二相邻块,A块为第一相邻块,B块为第二相邻块,A块的预测模式为第一预测模式,B块的预测模式为第二预测模式。当然,上述只是一个示例,还可以将其它块作为第一相邻块或第二相邻块,对此不做限制。
在一个例子中,上述预测模式(即第一预测模式或者第二预测模式)可以是帧内预测模式。通常情况下,亮度分量支持5种预测单元:4*4,8*8,16*16,32*32和64*64,每一种大小的预测单元都对应35种预测模式,包含Planar模式,DC模式以及33种角度模式。参见表1所示,为帧内预测模式的示例,Planar模式对应模式0,DC模式对应模式1,其余的33种角度模式对应模式2至模式34,33种角度模式的预测方向可以参见图4B所示。
表1
| 模式编号 | 帧内预测模式 |
| 0 | Planar模式 |
| 1 | DC模式 |
| 2…34 | angular2…angular34 |
Planar模式适用于像素值缓慢变化的区域,使用水平方向和垂直方向的两个线性滤波器,并将两者输出值的平均值作为当前块像素的预测值。DC模式适用于大面积平坦区域,将当前块的周围像素的平均值作为当前块的预测像素值。角度模式可以有33种角度,模式26表示垂直方向,模式10表示水平方向,在最新制定的新一代编解码标准VVC中,采用了更细分的角度方向,参见图4C所示,在图4C中,共有65种角度模式,如角度模式变为angular2…angular66。
实施例4:在步骤201和步骤301中,解码端/编码端需要根据第一预测模式和第二预测模式确定帧内预测的目标预测模式,在第一种可能的实现方式中,可以根据该第一预测模式和该第二预测模式创建当前块的预测模式候选列表,该预测模式候选列表可以包括至少一个候选预测模式;然后,可以从该预测模式候选列表中选择一个候选预测模式作为帧内预测的目标预测模式。
其中,根据该第一预测模式和该第二预测模式创建当前块的预测模式候选列表,可以包括:方式一、将第一预测模式转换为第三预测模式,将第二预测模式转换为第四预测模式,并根据第三预测模式和第四预测模式创建预测模式候选列表。第一预测模式和第二预测模式的具体转换方法将在下文中进行描述。方式二、根据第一预测模式和第二预测模式,以及,第一预测模式的相邻模式和/或第二预测模式的相邻模式,创建预测模式候选列表。例如,根据第一预测模式、第二预测模式和第一预测模式的相邻模式,创建预测模式候选列表;或者,根据第一预测模式、第二预测模式和第二预测模式的相邻模式,创建预测模式候选列表;或者,根据第一预测模式、第二预测模式、第一预测模式的相邻模式和第二预测模式的相邻模式,创建预测模式候选列表。
其中,相邻模式是指模式号相邻的模式。例如,模式5和模式6相邻。特殊的,参见图4B所示,处于边界的模式包括模式2和模式34,可以将模式3与模式33作为模式2的相邻模式,并将模式33与模式3作为模式34的相邻模式。
应用场景1、针对方式一,若第一预测模式为DC模式或者Planar模式,确定第三预测模式与第一预测模式相同;若第一预测模式为角度模式,当第一预测模式大于对角模式时,确定第三预测模式为垂直模式;当第一预测模式小于或等于对角模式时,确定第三预测模式为水平模式。若第二预测模式为DC模式或者Planar模式,确定第四预测模式与第二预测模式相同;若第二预测模式为角度模式,当第二预测模式大于对角模式时,确定第四预测模式为垂直模式;当第二预测模式小于或者等于对角模式时,确定第四预测模式为水平模式。这里的“对角模式(diagonal mode)”是预测方向为对象线方 向的模式。例如,附图4c中的模式34,其预测方向为从右下指向左上的角度方向。在本文中,关于模式之间大小关系的比较可以指模式编号的比较。例如,第一预测模式为模式38,对角模式为模式34,则第一预测模式大于对角模式。
进一步的,若第三预测模式与第四预测模式相同,则:若第三预测模式为DC模式或者Planar模式,则预测模式候选列表中的候选预测模式有三个,依次为:Planar模式、DC模式和垂直模式;若第三预测模式为角度模式,则预测模式候选列表中的候选预测模式依次为:第三预测模式、Planar模式和DC模式。
若第三预测模式与第四预测模式不同,则预测模式候选列表中的候选预测模式依次为:第三预测模式、第四预测模式和特定预测模式;其中,(1)若第三预测模式和第四预测模式都不是Planar模式,则特定预测模式为Planar模式;在(1)不满足时,(2)若第三预测模式和第四预测模式都不是DC模式,特定预测模式为DC模式;在(1)和(2)均不满足时,特定预测模式为垂直模式。
以下结合具体应用场景,对上述过程进行详细说明,将第一预测模式记为ModeA,将第二预测模式记为ModeB,且预测模式候选列表包括的三个候选预测模式依次为CandModeList[0]、CandModeList[1]和CandModeList[2]。
ModeA和ModeB首先初始化为DC模式,若获取到第一相邻块的预测模式,则使用获取到的预测模式更新ModeA,若获取到第二相邻块的预测模式,则使用获取到的预测模式更新ModeB,若未获取到则不需要更新。
如果ModeA不是DC模式或者Planar模式,则判断ModeA是否大于对角模式,如果是,则将ModeA设为垂直模式,如果小于等于对角模式,则将ModeA设为水平模式。如果ModeA是DC模式或者Planar模式,则保持不变。
如果ModeB不是DC模式或者Planar模式,则判断ModeB是否大于对角模式,如果是,则将ModeB设为垂直模式,如果小于等于对角模式,则将ModeB设为水平模式。如果ModeB是DC模式或者Planar模式,则保持不变。
如果ModeA等于ModeB,若ModeA和ModeB都为DC模式或者Planar模式,则:CandModeList[0]为Planar模式;CandModeList[1]为DC模式;CandModeList[2]为垂直模式。若Mode和ModeB都为角度模式,CandModeList[0]为ModeA,CandModeList[1]为Planar模式。CandModeList[2]为DC模式。
如果ModeA不等于ModeB,CandModeList[0]为ModeA模式;CandModeList[1]为ModeB模式;CandModeList[2]的判断规则如下:(1)如果ModeA和ModeB都不是Planar模式,则CandModeList[2]是Planar模式;在(1)不满足时,(2)如果ModeA和ModeB都不是DC模式,则CandModeList[2]是DC模式,在(1)和(2)均不满足时,CandModeList[2]为垂直模式。
应用场景2、针对方式二,若第一预测模式与第二预测模式相同,则:若第一预测模式为DC模式或者Planar模式,则预测模式候选列表中的候选预测模式有三个,可以依次为:Planar模式、DC模式和垂直模式。若第一预测模式与第二预测模式相同,则:若第一预测模式为角度模式,则预测模式候选列表中的候选预测模式可以依次为:第一 预测模式、第一预测模式的两个相邻模式。
若第一预测模式与第二预测模式不同,则:预测模式候选列表中的候选预测模式依次为:第一预测模式、第二预测模式和预设预测模式;其中,(1)若第一预测模式和第二预测模式都不是Planar模式,则预设预测模式为Planar模式;在(1)不满足时,(2)若第一预测模式和第二预测模式都不是DC模式,预设预测模式为DC模式;在(1)和(2)不满足时,预设预测模式为垂直模式。
以下结合具体应用场景,对上述过程进行详细说明,将第一预测模式记为ModeA,将第一预测模式记为ModeB,且预测模式候选列表包括的三个候选预测模式依次为CandModeList[0]、CandModeList[1]和CandModeList[2]。
ModeA和ModeB首先初始化为DC模式,若获取到第一相邻块的预测模式,则使用获取到的预测模式更新ModeA,若获取到第二相邻块的预测模式,则使用获取到的预测模式更新ModeB,若未获取到则不需要更新。
如果ModeA等于ModeB,若ModeA和ModeB都为DC模式或者Planar模式,则:CandModeList[0]为Planar模式;CandModeList[1]为DC模式;CandModeList[2]为垂直模式。若Mode和ModeB都为角度模式,CandModeList[0]为ModeA,CandModeList[1]和CandModeList[2]为与ModeA相邻的两个模式。其中,模式2与模式3以及模式33相邻,模式34与模式33以及模式3相邻。
如果ModeA不等于ModeB,CandModeList[0]为ModeA模式;CandModeList[1]为ModeB模式;CandModeList[2]的判断规则如下:(1)如果ModeA和ModeB都不是Planar模式,则CandModeList[2]是Planar模式;在(1)不满足时,(2)如果ModeA和ModeB都不是DC模式,则CandModeList[2]是DC模式,在(1)和(2)均不满足时,CandModeList[2]为垂直模式。
应用场景3、针对方式二,若第一预测模式与第二预测模式相同,则:若第一预测模式为DC模式或者Planar模式,则预测模式候选列表中的候选预测模式有6个,依次为:第一预测模式、默认预测模式、垂直模式、水平模式和垂直模式的两个相邻模式;其中,若第一预测模式为DC模式,则默认预测模式为Planar模式,若第一预测模式为Planar模式,则默认预测模式为DC模式。
若第一预测模式与第二预测模式相同,则:若第一预测模式为角度模式,则预测模式候选列表中的候选预测模式依次为:第一预测模式、Planar模式、DC模式、第一预测模式的第一相邻模式、第一预测模式的第二相邻模式和第一预测模式的第三相邻模式;其中,第一相邻模式、第二相邻模式和第三相邻模式均由偏移值(如offset值)和模数值(如Mod值)确定。该偏移值和模数值可以是预先设定的经验值。
若第一预测模式与第二预测模式不同,则:若第一预测模式和第二预测模式均为角度模式,预测模式候选列表中的候选预测模式依次为:第一预测模式、第二预测模式、Planar模式、DC模式、候选预测模式的第一相邻模式和候选预测模式的第二相邻模式;其中,候选预测模式为第一预测模式和第二预测模式中的编号较大的模式;第一相邻模式和第二相邻模式,均由偏移值和模数值确定。
若第一预测模式与第二预测模式不同,则:若第一预测模式为Planar模式或DC模式,第二预测模式为角度模式,或者,第一预测模式为角度模式,第二预测模式为Planar模式或DC模式,则预测模式候选列表中的候选预测模式依次为:第一预测模式、第二预测模式、参考预测模式、候选预测模式的第三相邻模式、候选预测模式的第四相邻模式和候选预测模式的第五相邻模式;其中,候选预测模式为第一预测模式和第二预测模式中的编号较大的模式;若第一预测模式和第二预测模式中不存在Planar模式,则参考预测模式为Planar模式;若第一预测模式和第二预测模式中不存在DC模式,则参考预测模式为DC模式;第三相邻模式、第四相邻模式和第五相邻模式,均由偏移值和模数值确定。
以下结合具体应用场景,对上述过程进行详细说明,可以将第一预测模式记为ModeA,可以将第二预测模式记为ModeB,且预测模式候选列表包括的六个候选预测模式可以依次为CandModeList[0]、CandModeList[1]、CandModeList[2]、CandModeList[3]、CandModeList[4]和CandModeList[5]。
如果ModeA等于ModeB,当ModeA小于等于1,即ModeA是DC模式或Planar模式时,则CandModeList[0]=ModeA;CandModeList[1]=Planar模式或者DC模式,若ModeA为DC模式,则CandModeList[1]为Planar模式,若ModeA为Planar模式,则CandModeList[1]为DC模式;CandModeList[2]=垂直模式;CandModeList[3]=水平模式;CandModeList[4]=垂直模式-4(即垂直模式的相邻模式,参见图4B所示,垂直模式为模式26,因此,CandModeList[4]为模式22);CandModeList[5]=垂直模式+4(即垂直模式的相邻模式,即模式30)。
如果ModeA等于ModeB,当ModeA和ModeB均不是DC模式和Planar模式时,CandModeList[0]=ModeA;CandModeList[1]=Planar模式;CandModeList[2]=DC模式;CandModeList[3]=((ModeA+offset)%mod)+2;CandModeList[4]=((ModeA-1)%mod)+2;CandModeList[5]=((ModeA+offset-1)%mod)+2。
其中,CandModeList[3]、CandModeList[4]和CandModeList[5]均是ModeA的相邻模式,且CandModeList[3]、CandModeList[4]和CandModeList[5]由offset和mod确定,offset和mod的初始值可以根据经验配置,对此不做限制。
例如,ModeA为已知值,如当ModeA为模式28时,则ModeA的值为28,且offset和mod也为根据经验配置的已知值,将28、offset和mod代入上述公式,就可以得到CandModeList[3]、CandModeList[4]和CandModeList[5]。
如果ModeA不等于ModeB,若ModeA和ModeB均不是Planar模式和DC模式,即二者都为角度模式,则CandModeList[0]=ModeA;CandModeList[1]=ModeB;CandModeList[2]=Planar模式,CandModeList[3]=DC模式。
进一步的,若ModeA和ModeB的差值在某一个区间范围内时,CandModeList[4]=((CandModeList[maxCandModeIdx]+offset)%mod)+2;CandModeList[5]=((CandModeList[maxCandModeIdx]-1)%mod)+2。其中,CandModeList[maxCandModeIdx]为ModeA和ModeB中模式号较大的那一个。
例如,ModeA和ModeB均为已知值,如当ModeA为模式28,ModeB为模式23时,由于ModeA大于ModeB,则CandModeList[maxCandModeIdx]为ModeA的值,即为28,且offset和mod也为根据经验配置的已知值,将28、offset和mod代入上述公式,就可以得到CandModeList[4]和CandModeList[5]。
此外,若ModeA和ModeB的差值不在某一个区间范围内时,CandModeList[4]=((CandModeList[maxCandModeIdx]+offset-1)%mod)+2;CandModeList[5]=((CandModeList[maxCandModeIdx])%mod)+2。其中,CandModeList[maxCandModeIdx]为ModeA和ModeB中模式号较大的那一个。
例如,ModeA和ModeB均为已知值,如当ModeA为模式28,ModeB为模式23时,由于ModeA大于ModeB,则CandModeList[maxCandModeIdx]为ModeA的值,即为28,且offset和mod也为根据经验配置的已知值,将28、offset和mod代入上述公式,就可以得到CandModeList[4]和CandModeList[5]。
综上所述,CandModeList[4]和CandModeList[5]均是候选预测模式的相邻模式,且候选预测模式为ModeA和ModeB中模式号较大的,CandModeList[4]和CandModeList[5]由offset和mod确定,offset和mod的初始值根据经验配置。
如果ModeA不等于ModeB,若ModeA+ModeB的模式号总和大于等于2,ModeA和ModeB中有且仅有一个大于等于2,即,ModeA和ModeB中存在DC模式或者Planar模式,则CandModeList[0]=ModeA;CandModeList[1]=ModeB;CandModeList[2]=Planar模式或者DC模式,其中,若ModeA和ModeB中存在DC模式,则CandModeList[2]为Planar模式,若ModeA和ModeB中存在Planar模式,则CandModeList[2]为可以DC模式;CandModeList[3]=((CandModeList[maxCandModeIdx]+offset)%mod)+2;CandModeList[4]=((CandModeList[maxCandModeIdx]-1)%mod)+2;CandModeList[5]=((CandModeList[maxCandModeIdx]+offset-1)%mod)+2。
CandModeList[maxCandModeIdx]为ModeA和ModeB中模式号较大的那一个。此外,CandModeList[3]、CandModeList[4]和CandModeList[5]均是候选预测模式的相邻模式,且候选预测模式为ModeA和ModeB中模式号较大的。CandModeList[3]、CandModeList[4]和CandModeList[5]由offset和mod确定。
例如,ModeA和ModeB均为已知值,当ModeA为模式28,ModeB为模式23时,由于ModeA大于ModeB,则CandModeList[maxCandModeIdx]为ModeA的值28,且offset和mod为根据经验配置的已知值,将28、offset和mod代入上述公式,就可以得到CandModeList[3]、CandModeList[4]和CandModeList[5]。
在上述实施例中,从预测模式候选列表中选择一个候选预测模式作为帧内预测的目标预测模式,可以包括:方式一、针对编码端,编码端可以基于预测模式候选列表中的每个候选预测模式的率失真代价,选择率失真代价最小的候选预测模式,作为帧内预测的目标预测模式。具体的,编码端可以采用率失真原则确定每个候选预测模式的率失真代价,对此确定方式不做限制,然后,编码端可以将率失真代价最小的候选预测模式作为目标预测模式。
进一步的,编码端在向解码端发送编码比特流时,所述编码比特流携带第一指示信息,所述第一指示信息用于指示目标预测模式的索引信息,该索引信息表示目标预测模式是预测模式候选列表中的第几个候选预测模式。
针对解码端,解码端接收来自编码端的编码比特流,所述编码比特流携带第一指示信息,所述第一指示信息用于指示目标预测模式的索引信息。基于所述第一指示信息,解码端从预测模式候选列表中选择与该索引信息对应的候选预测模式,并将选择的候选预测模式作为帧内预测的目标预测模式。
方式二、编码端和解码端通过协议约定默认使用目标预测模式,这样,编码比特流中就不需要携带第一指示信息,即不需要传输索引值(即目标预测模式的索引信息),从而可以节省传输索引值的编码开销。例如,编码端和解码端固定使用DC模式作为帧内预测的目标预测模式。又例如,编码端和解码端均配置第一预设策略,编码端和解码端均基于第一预设策略确定帧内预测的目标预测模式。
具体的,编码端根据第一预设策略从预测模式候选列表中选择一个候选预测模式作为帧内预测的目标预测模式;此外,解码端根据第一预设策略从预测模式候选列表中选择一个候选预测模式作为帧内预测的目标预测模式。
其中,第一预设策略用于指示预测模式候选列表中的目标预测模式。例如,第一预设策略用于约定预测模式候选列表中的第一个候选预测模式为目标预测模式,则编码端将预测模式候选列表中的第一个候选预测模式作为目标预测模式,解码端将预测模式候选列表中的第一个候选预测模式作为目标预测模式。
实施例5:在步骤201和步骤301中,解码端/编码端需要根据第一预测模式和第二预测模式确定帧内预测的目标预测模式,在第二种可能的实现方式中,情况1、若第一预测模式与第二预测模式相同,则将第一预测模式确定为帧内预测的目标预测模式。或者,情况2、若第一预测模式与第二预测模式不同,则根据第一预测模式确定帧内预测的目标预测模式;具体的,在情况2中,若第一预测模式为DC模式,则确定目标预测模式为DC模式;若第一预测模式为Planar模式,则确定目标预测模式为Planar模式;若第一预测模式为角度模式,当第一预测模式大于对角模式时,则确定目标预测模式为垂直模式;当第一预测模式小于或者等于对角模式时,则确定目标预测模式为水平模式。
与上述实施例4不同的是,在第二种可能的实现方式中,不需要创建当前块的预测模式候选列表,可以直接确定帧内预测的目标预测模式。
在一个例子中,针对帧内帧间加权技术,采用的帧内预测模式包含了4种预测模式,如DC模式、Planar模式、垂直模式和水平模式,本实施例中,可以对帧内预测模式进行简化,简化预测模式候选列表的构建过程,使得预测模式候选列表只包括一个候选预测模式,将该候选预测模式作为目标预测模式。或者,不构建预测模式候选列表,直接选择一个预测模式作为目标预测模式。
例如,将第一预测模式记为ModeA,将第二预测模式记为ModeB。ModeA和ModeB首先初始化为DC模式,若获取到第一相邻块的预测模式,则使用获取到的预测模式更新ModeA,若获取到第二相邻块的预测模式,则使用获取到的预测模式更新ModeB, 若未获取到则不需要更新。
若ModeA等于ModeB,目标预测模式为ModeA。若ModeA不等于ModeB,则根据ModeA确定目标预测模式。例如,若ModeA是DC模式,确定目标预测模式为DC模式;若ModeA是Planar模式,确定目标预测模式为Planar模式;若ModeA是角度模式,当ModeA大于对角模式时,确定目标预测模式为垂直模式;当ModeA小于或者等于对角模式时,确定目标预测模式为水平模式。
实施例6:在步骤202和步骤302中,解码端/编码端需要获取当前块的运动信息候选列表,该运动信息候选列表包括至少一个运动信息,为了获取当前块的运动信息候选列表,可以采用如下方式实现:采用合并模式创建当前块的运动信息候选列表;或者,采用AMVP(Advanced Motion Vector Prediction,高级运动矢量预测)模式创建当前块的运动信息候选列表;或者,采用仿射合并模式创建当前块的运动信息候选列表;或者,采用仿射AMVP模式创建当前块的运动信息候选列表;或者,采用合并模式和MMVD模式创建当前块的运动信息候选列表;或者,采用AMVP模式和MMVD模式创建当前块的运动信息候选列表;或,采用仿射合并模式和MMVD模式创建当前块的运动信息候选列表;或者,采用仿射AMVP模式和MMVD模式创建当前块的运动信息候选列表。
例如,帧间预测可以利用合并模式创建运动信息候选列表,并基于运动信息候选列表获取当前块的帧间预测值。或者,可以利用其它模式(如MMVD模式)的运动信息创建运动信息候选列表,并基于运动信息候选列表获取当前块的帧间预测值,然后与帧内预测值进行加权,得到加权值。
又例如,在仿射合并模式(affine合并模式)下,进行帧间预测得到affine块的帧间预测值,再进行帧内预测,得到帧内预测值,然后,进行帧内预测值与帧间预测值的加权,得到加权预测值,继而得到更优的预测像素值。
又例如,同时利用MMVD模式和合并模式创建运动信息候选列表,并基于运动信息候选列表获取当前块的帧间预测值。此外,还需要再进行帧内预测,得到帧内预测值,如对预测模式候选列表中的6个候选预测模式进行选择,得到一个目标预测模式,基于目标预测模式得到帧内预测值。然后,进行帧内预测值与帧间预测值的加权,得到加权预测值,继而得到更优的预测像素值。
又例如,同时利用MMVD模式和合并模式创建运动信息候选列表,并基于运动信息候选列表获取当前块的帧间预测值。此外,还需要再进行帧内预测,得到帧内预测值,如对预测模式候选列表中的3个候选预测模式进行选择,得到一个目标预测模式,基于目标预测模式得到帧内预测值。然后,进行帧内预测值与帧间预测值的加权,得到加权预测值,继而得到更优的预测像素值。
上述只是给出了几个示例,对此不做限制,只要能够构建运动信息候选列表即可,以下对不同模式下构建运动信息候选列表的过程进行说明。
1、采用合并模式(Merge模式)创建当前块的运动信息候选列表。
Merge模式会为当前块建立一个运动信息候选列表,运动信息候选列表中存在N个候选运动信息(如运动矢量及其对应的参考帧信息),通过遍历这N个候选运动信息, 并且进行率失真代价的计算,最终选取率失真代价最小的一个候选运动信息,作为该Merge模式的最佳运动信息。若编码端和解码端依照一样的方式构建运动信息候选列表,则编码端只需要传输最佳运动信息在运动信息候选列表中的索引即可,这样可以大幅度节省了运动信息的编码比特数。
Merge模式建立的运动信息候选列表中包含了空域和时域两种情形,而对于B Slice(即双向帧间编码的条带),还包含组合运动信息候选列表,以下对这几种运动信息候选列表进行说明。
空域运动信息候选列表的建立:参见图5A所示,A1表示当前块左侧最下方的候选块,B1表示当前块上方最右侧的候选块,B0和A0分别表示当前块右上方和左下方距离最近的候选块,B2表示当前块左上角距离最近的候选块。假设空域最多提供4个候选运动信息,则最多使用上述5个候选块中的4个候选块的运动信息,且按照A1-B1-B0-A0-(B2)的顺序建立,B2为替补。也就是说,当A1,B1,B0,A0中的一个或者多个的运动信息无法获得时,则需要B2的运动信息。
时域运动信息候选列表的建立:可以利用当前块在邻近已编码图像(参考图像)中的对应位置的候选块的运动信息,与空域情形不同,时域运动信息候选列表不能直接使用候选块的运动信息,而需要根据参考图像与当前图像的位置关系做相应的比例伸缩调整。假设时域最多只提供一个候选运动信息,则由图5B中H位置的候选块的运动信息经过伸缩得到,如果H位置的候选块的运动信息不可得,则用C3位置的候选块进行替换。
需要注意的是,若运动信息候选列表中的候选运动信息的数量达不到5个,则可以使用(0,0)进行填补,以达到规定的候选运动信息的数目。
组合运动信息候选列表的建立:对于B Slice的块来说,由于存在两个运动信息,因此运动信息候选列表也提供两个预测运动信息,如将候选运动信息的前4个候选运动信息进行两两组合,产生B Slice的组合运动信息候选列表。
2、采用AMVP模式创建当前块的运动信息候选列表。
为了利用相邻块的空域相关性和时域相关性,在运动信息的预测方面提出了合并技术(Merge)和AMVP技术,两者均使用了空域和时域运动信息预测的思想,通过建立候选运动信息列表,通过率失真代价选择,择取最优的一个候选运动信息作为当前块的预测运动信息。二者的主要区别体现在两个方面,Merge模式下,当前块的运动信息直接由空域或者时域上相邻的块预测得到,不存在运动矢量差(Motion Vector Difference,MVD),而AMVP可以看做是MV预测技术,编码端只需要对实际MV和预测MV的差值进行编码,因此是存在MVD的。此外,二者的运动信息候选列表的长度是不同的,构建运动信息候选列表的的方式也有所区别,对于AMVP模式的运动信息候选列表构建不再赘述。
3、采用仿射模式(affine)创建当前块的运动信息候选列表。具体的,采用仿射合并模式(即affine merge)创建当前块的运动信息候选列表,或者,采用仿射AMVP模式(即affine amvp)创建当前块的运动信息候选列表。
仿射模式是基于子块的预测技术,通过控制点的运动信息,通过运动参数模型,可以推导出每一个子块的运动信息。对于四参数的affine块,由两个控制点的信息,得到当前块的每一个子块的运动信息。例如,参见图5C所示,可以通过如下公式得到每一个子块的运动信息。对于affine来说,也分为affine merge和affine amvp。affine merge类似合并模式,通过利用运动信息候选列表中的运动信息得到当前块的运动信息,在编码码流中传输候选运动信息的索引值。对于affine amvp来说,也是存在MVD的,也就是说,每一个控制点的信息,不是预测得到,而是通过搜索得到,需要将当前块的预测运动信息和搜索得到的运动信息进行相减,得到运动信息差,然后在编码码流中传输运动信息差。
4、采用MMVD模式创建当前块的运动信息候选列表。
MMVD技术是利用原有的合并模式的候选运动信息,对候选运动信息进行有方向有角度的偏置,得到新的运动信息,从而得到更好的预测的目的。首先,可以基于已有的候选运动信息进行运动信息的偏置,如表2所示。其次,偏置幅度可以参见表3所示,给出如下偏置方案。再次,偏置方向如表4所示。
表2
表3
表4
| Direction IDX | 00 | 01 | 10 | 11 |
| x-axis | + | – | N/A | N/A |
| y-axis | N/A | N/A | + | – |
实施例7:在步骤202和步骤302中,解码端/编码端需要根据该运动信息候选列表确定帧间预测的目标运动信息,该确定过程可以包括:
方式一、针对编码端,编码端可以基于运动信息候选列表中的每个运动信息的率失真代价,选择率失真代价最小的运动信息,作为帧间预测的目标运动信息。具体的, 编码端可以采用率失真原则确定每个运动信息的率失真代价,对此确定方式不做限制,然后将率失真代价最小的运动信息作为目标运动信息。
进一步的,编码端在向解码端发送编码比特流时,所述编码比特流携带第二指示信息,所述第二指示信息用于指示目标运动信息的索引信息,该索引信息表示目标运动信息是运动信息候选列表中的第几个运动信息。
针对解码端,解码端接收来自编码端的编码比特流,所述编码比特流携带第二指示信息,所述第二指示信息用于指示目标运动信息的索引信息。基于所述第二指示信息,解码端从运动信息候选列表中选择与所述索引信息对应的运动信息,并将选择的运动信息作为帧间预测的目标运动信息。
方式二、编码端通过协议约定默认使用目标运动信息,这样,编码比特流中就不需要携带第二指示信息,即不需要传输索引值(即目标运动信息的索引信息),解码端也通过协议约定默认使用目标运动信息,从而可以节省传输索引值的编码开销。例如,对于合并模式来说,编码端和解码端固定使用运动信息候选列表中的第一个运动信息,作为帧间预测的目标运动信息。又例如,编码端和解码端均配置第二预设策略,编码端和解码端均基于第二预设策略,确定帧间预测的目标运动信息。
具体的,编码端根据第二预设策略从运动信息候选列表中选择一个运动信息作为帧间预测的目标运动信息;此外,解码端根据第二预设策略从运动信息候选列表中选择一个运动信息作为帧间预测的目标运动信息。
其中,第二预设策略用于指示运动信息候选列表中的目标运动信息。例如,第二预设策略用于约定运动信息候选列表中的第一个运动信息为目标运动信息,则编码端将运动信息候选列表中的第一个运动信息作为目标运动信息,解码端将运动信息候选列表中的第一个运动信息作为目标运动信息。
在一个例子中,编码端和解码端均配置第一预设策略和第二预设策略,编码端和解码端均基于第一预设策略确定帧内预测的目标预测模式,编码端和解码端均基于第二预设策略确定帧间预测的目标运动信息,这样,码流中不需要传输目标预测模式的索引信息,也不需要传输目标运动信息的索引信息,解码端也可以确定目标预测模式和目标运动信息,从而节省传输索引的编码开销。
实施例8:在步骤202和步骤302中,还可以采用如下方式实现:
方式一,在采用MMVD模式创建当前块的运动信息候选列表时,对多个原始运动信息进行偏移,将偏移后的运动信息添加到运动信息候选列表;或者,对一个原始运动信息进行偏移,将偏移后的运动信息添加到运动信息候选列表。这里的“原始运动信息”指已有的候选运动信息。
例如,在同时利用MMVD模式和合并模式的运动信息得到帧间预测值的过程中,需要关注的是MMVD的预测值的来源问题。MMVD本身的目的是通过对原有的运动信息进行有方向,有角度的偏移,从而得到更好的预测信息,因此,可以对多个原有的合并模式的运动信息进行有方向,有角度的偏移,或者,也可以对第一个合并模式的运动信息进行有方向,有角度的偏移。
方式二,若针对当前块配置帧内块复制模式,则从当前帧中选择当前块对应的参考块,并根据所述参考块的像素信息确定当前块的帧间预测值。
例如,若针对当前块配置帧内块复制模式,相当于使能了帧内块的帧间预测技术,只是参考帧是当前帧,这样,不需要在码流中传输参考帧索引的相关信息。因此,可以从当前帧中选择当前块对应的参考块,并根据所述参考块的像素信息确定当前块的帧间预测值。此外,还需要再进行帧内预测,得到帧内预测值。然后,对帧间预测值和帧内预测值进行加权得到加权预测值。
方式三,根据目标运动信息获取当前块的帧间预测值,包括:若目标运动信息包括第一方向的运动信息和第二方向的运动信息,则从第一方向的运动信息以及第二方向的运动信息中选择一个运动信息;根据选择的运动信息获取当前块的帧间预测值,也就是说,只利用一个运动信息获取帧间预测值。
例如,当合并模式的运动信息是双向运动信息时,针对这种双向预测来说,仅利用单向的预测信息,得到帧间预测信息,即从两个方向的运动信息中选择一个运动信息得到帧间预测信息,然后与帧内预测的预测值进行加权。
方式四,合并模式的运动信息候选列表的构建会直接影响用于帧内帧间加权的帧间预测值,下面给出一种运动信息候选列表的构建方式。该运动信息候选列表可以通过以下一个或多个构建:(1)空域候选者;(2)时域候选者;(3)基于已编码块的运动信息;(4)基于运动信息候选列表中已有的运动信息进行加权组合的运动信息;(5)缺省的零运动信息。
基于上述构建方式得到的运动信息候选列表,可以选择目标运动信息,并得到帧间预测值,可与帧内预测值进行加权,从而得到更好的预测信息。
方式五,合并模式的运动信息候选列表的构建会影响用于帧内帧间加权的帧间预测值,下面给出一种运动信息候选列表的构建方式。该运动信息候选列表可以通过以下一个或多个构建:(1)空域候选者;(2)基于可选的时域运动矢量预测模式获取的运动信息;(3)时域候选者;(4)基于已编码块的运动信息;(5)基于运动信息候选列表中已有的运动信息进行加权组合的运动信息;(6)缺省的零运动信息。
基于上述构建方式得到的运动信息候选列表,可以选择目标运动信息,并得到帧间预测值,可与帧内预测值进行加权,从而得到更好的预测信息。
其中,可选的时域运动矢量预测,是基于当前块中各子块,在对应的参考帧(相邻的已编码帧)中推导对应于该子块的运动信息,利用子块的运动信息对各子块进行预测,从而得到当前块的预测值。其中,子块的大小可以是N*N的,N缺省为8。可选的时域运动矢量预测模式可以作为新添加的合并模式候选者被加入到候选者列表中。
实施例9:在步骤203和步骤303中,编码端/解码端需要对帧内预测值和帧间预测值进行加权处理,得到加权预测值,以下对此过程进行说明:
编码端/解码端可以根据帧内预测值、帧内预测值对应的第一权重系数、帧间预测值、帧间预测值对应的第二权重系数进行加权处理,得到加权预测值;其中,第一权重系数与第二权重系数,可以不同或者相同。进一步的,若当前块的目标预测模式为 DC模式或Planar模式,则第一权重系数与第二权重系数相同。若当前块的目标预测模式为水平模式,则当前块的左侧子块的第一权重系数大于左侧子块的第二权重系数,当前块的右侧子块的第一权重系数小于或者等于右侧子块的第二权重系数。若当前块的目标预测模式为垂直模式,则当前块的上侧子块的第一权重系数大于上侧子块的第二权重系数,当前块的下侧子块的第一权重系数小于或者等于下侧子块的第二权重系数。
例如,若当前块的目标预测模式为DC模式或者Planar模式,则第一权重系数与第二权重系数相同,如第一权重系数与第二权重系数均为0.5,这样,假设帧内预测值为P1,帧间预测值为P2,则加权预测值为P1*0.5+P2*0.5。
又例如,若当前块的目标预测模式为水平模式,参见图6A所示,A块为当前块的左侧子块,B块为当前块的右侧子块,则A块的第一权重系数a11大于A块的第二权重系数a12,如a11为0.7,a12为0.3。B块的第一权重系数b11小于或者等于B块的第二权重系数b12,如b11为0.3,b12为0.7。假设A块的帧内预测值为P11,帧间预测值为P12,B块的帧内预测值为P21,帧间预测值为P22。针对A块的加权预测值,可以为P11*a11+P12*a12,针对B块的加权预测值,可以为P21*b11+P22*b22,然后,将A块的加权预测值和B块的加权预测值组合在一起,就可以得到当前块的加权预测值,对此不再详加赘述。
又例如,若当前块的目标预测模式为垂直模式,参见图6B所示,A块为当前块的上侧子块,B块为当前块的下侧子块,则A块的第一权重系数a11大于A块的第二权重系数a12,如a11为0.7,a12为0.3。B块的第一权重系数b11小于或者等于B块的第二权重系数b12,如b11为0.3,b12为0.7。假设A块的帧内预测值为P11,帧间预测值为P12,B块的帧内预测值为P21,帧间预测值为P22。针对A块的加权预测值,可以为P11*a11+P12*a12,针对B块的加权预测值,可以为P21*b11+P22*b22,然后,将A块的加权预测值和B块的加权预测值组合在一起,就可以得到当前块的加权预测值,对此不再详加赘述。
在一个例子中,参见图6C所示,A块和B块可以为当前块的左侧子块,C块和D块可以为当前块的右侧子块,A块的第一权重系数还可以大于B块的第一权重系数,C块的第一权重系数还可以大于D块的第一权重系数。例如,A块的第一权重系数为0.9,A块的第二权重系数为0.1,B块的第一权重系数为0.7,B块的第二权重系数为0.3,C块的第一权重系数为0.5,C块的第二权重系数为0.5,D块的第一权重系数为0.3,D块的第二权重系数为0.7。
此外,对于垂直模式来说,可以是纵向的A块、B块、C块和D块,且采用不同权重比例设置的非均匀加权预测,实现与图6C类似,不再赘述。
在另一个例子中,编码端/解码端可以根据帧内预测值、帧内预测值对应的第一权重系数、帧间预测值、帧间预测值对应的第二权重系数进行加权处理,得到加权预测值;其中,第一权重系数与第二权重系数,可以不同。
例如,若目标运动信息对应的候选块为单向预测块,且所述目标运动信息是前向运动信息,则帧间预测值对应的第二权重系数大于帧内预测值对应的第一权重系数。若目标运动信息对应的候选块为单向预测块,且所述目标运动信息是后向运动信息,则 帧间预测值对应的第二权重系数小于帧内预测值对应的第一权重系数。若目标运动信息对应的候选块为双向预测块,则帧间预测值对应的第二权重系数大于帧内预测值对应的第一权重系数。
实施例10:以下对编码端的编码过程、解码端的解码过程进行说明。
针对编码端,编码端可以确定加权预测值对应的率失真代价、帧内预测值对应的率失真代价、帧间预测值对应的率失真代价。若加权预测值对应的率失真代价为最小率失真代价,则说明加权预测值的代价最小,因此,可以根据加权预测值对比特流进行编码,得到编码比特流。例如,在比特流中编码相应的指示信息,如上述第一指示信息和第二指示信息等。若加权预测值对应的率失真代价不为最小率失真代价,则不需要根据加权预测值对比特流进行编码得到编码比特流,可以采用传统方式对比特流进行编码,对此不再赘述。
进一步的,若加权预测值对应的率失真代价为最小率失真代价,编码端在向解码端发送编码比特流时,所述编码比特流携带第三指示信息,所述第三指示信息用于指示采用加权预测值对编码比特流进行解码。针对解码端,解码端接收来自编码端的编码比特流,所述编码比特流携带第三指示信息,所述第三指示信息用于指示采用加权预测值对编码比特流进行解码。基于所述第三指示信息,解码端对帧内预测值和帧间预测值进行加权处理,得到加权预测值。
实施例11:参见图7所示,为本申请实施例中的编解码方法的流程示意图,该方法可以应用于解码端,确定启用帧内帧间加权预测时,通过以下步骤获取当前块的加权预测值,所述加权预测值用于所述当前块的解码;该方法包括步骤:
步骤701,解码端根据当前块的形状确定帧内预测的目标预测模式,并根据目标预测模式获取当前块的帧内预测值。
具体的,根据当前块的形状确定帧内预测的目标预测模式,可以包括但不限于:若当前块的高度与当前块的宽度相同,则确定目标预测模式为DC模式或者Planar模式;若当前块的高度大于当前块的宽度,则确定目标预测模式为水平模式;若当前块的高度小于当前块的宽度,则确定目标预测模式为垂直模式。
步骤702,解码端获取当前块的运动信息候选列表,该运动信息候选列表包括至少一个运动信息;根据该运动信息候选列表确定帧间预测的目标运动信息,并根据该目标运动信息获取当前块的帧间预测值。
其中,步骤702的处理可以参见上述实施例6-8,在此不再赘述。
步骤703,解码端对该帧内预测值和该帧间预测值进行加权处理,得到加权预测值。
其中,步骤703的处理可以参见上述实施例9,在此不再赘述。
由以上技术方案可见,本申请实施例中,可以同时采用帧间编码技术和帧内编码技术对当前块进行预测,即采用帧内预测值与帧间预测值加权的方式,这样,可以提高预测准确性,提高预测性能,从而带来编码性能的提高。
实施例12:参见图8所示,为本申请实施例中的编解码方法的流程示意图,该方法可以应用于编码端,确定启用帧内帧间加权预测时,通过以下步骤获取当前块的加权预测值,所述加权预测值用于所述当前块的编码;该方法包括:
步骤801,编码端根据当前块的形状确定帧内预测的目标预测模式,并根据目标预测模式获取当前块的帧内预测值。
具体的,根据当前块的形状确定帧内预测的目标预测模式,可以包括但不限于:若当前块的高度与当前块的宽度相同,则确定目标预测模式为DC模式或者Planar模式;若当前块的高度大于当前块的宽度,则确定目标预测模式为水平模式;若当前块的高度小于当前块的宽度,则确定目标预测模式为垂直模式。
步骤802,编码端获取当前块的运动信息候选列表,该运动信息候选列表包括至少一个运动信息;根据该运动信息候选列表确定帧间预测的目标运动信息,并根据该目标运动信息获取当前块的帧间预测值。
其中,步骤802的处理可以参见上述实施例6-8,在此不再赘述。
步骤803,编码端对该帧内预测值和该帧间预测值进行加权处理,得到加权预测值。
其中,步骤803的处理可以参见上述实施例9,在此不再赘述。
由以上技术方案可见,本申请实施例中,可以同时采用帧间编码技术和帧内编码技术对当前块进行预测,即采用帧内预测值与帧间预测值加权的方式,这样,可以提高预测准确性,提高预测性能,从而带来编码性能的提高。
实施例13:本申请实施例中还提出另一种编解码方法,该方法可以应用于编码端或者解码端,在确定启用帧内帧间加权预测时,通过以下步骤获取当前块的加权预测值,所述加权预测值用于所述当前块的编码或解码;该方法包括:
步骤a1、根据预设预测模式获取当前块的帧内预测值。
具体的,编码端通过协议约定默认使用预设预测模式,也就是说,这个预设预测模式就是上述实施例中的目标预测模式,这样,编码端可以直接利用预设预测模式获取当前块的帧内预测值。解码端也通过协议约定默认使用预设预测模式,这样,解码端可以直接利用预设预测模式获取当前块的帧内预测值。
例如,编码端和解码端固定使用DC模式作为预设预测模式,这样,编码端根据DC模式获取当前块的帧内预测值,解码端也根据DC模式获取当前块的帧内预测值。又例如,编码端和解码端固定使用Planar模式作为预设预测模式,这样,编码端根据Planar模式获取当前块的帧内预测值,解码端也根据Planar模式获取当前块的帧内预测值。当然,上述只是示例,预设预测模式还可以是垂直模式,或者,预设预测模式还可以是水平模式,对此不做限制。
步骤a2、获取当前块的运动信息候选列表,该运动信息候选列表包括至少一个运动信息;根据该运动信息候选列表确定帧间预测的目标运动信息,并根据该目标运动信息获取当前块的帧间预测值。处理过程可以参见实施例6-8。
步骤a3、对该帧内预测值和该帧间预测值进行加权处理,得到加权预测值。处理过程可以参见上述实施例9,在此不再赘述。
由以上技术方案可见,本申请实施例中,可以同时采用帧间编码技术和帧内编码技术对当前块进行预测,即采用帧内预测值与帧间预测值加权的方式,这样,可以提高预测准确性,提高预测性能,从而带来编码性能的提高。
实施例14:
本申请实施例提供的解码端设备,从硬件层面而言,其硬件架构示意图具体可以参见图9所示。包括:处理器91和机器可读存储介质92,其中:所述机器可读存储介质92存储有能够被所述处理器91执行的机器可执行指令;所述处理器91用于执行机器可执行指令,以实现本申请上述示例公开的方法。
本申请实施例提供的编码端设备,从硬件层面而言,其硬件架构示意图具体可以参见图10所示。包括:处理器93和机器可读存储介质94,其中:所述机器可读存储介质94存储有能够被所述处理器93执行的机器可执行指令;所述处理器93用于执行机器可执行指令,以实现本申请上述示例公开的方法。
基于与上述方法同样的申请构思,本申请实施例还提供一种机器可读存储介质,所述机器可读存储介质上存储有若干计算机指令,所述计算机指令被处理器执行时,能够实现本申请上述示例公开的方法。
其中,上述机器可读存储介质可以是任何电子、磁性、光学或其它物理存储装置,可以包含或存储信息,如可执行指令、数据,等等。例如,机器可读存储介质可以是:RAM(Radom Access Memory,随机存取存储器)、易失存储器、非易失性存储器、闪存、存储驱动器(如硬盘驱动器)、固态硬盘、任何类型的存储盘(如光盘、dvd等),或者类似的存储介质,或者它们的组合。
上述实施例阐明的系统、装置、模块或单元,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。一种典型的实现设备为计算机,计算机的具体形式可以是个人计算机、膝上型计算机、蜂窝电话、相机电话、智能电话、个人数字助理、媒体播放器、导航设备、电子邮件收发设备、游戏控制台、平板计算机、可穿戴设备或者这些设备中的任意几种设备的组合。
为了描述的方便,描述以上装置时以功能分为各种单元分别描述。当然,在实施本申请时可以把各单元的功能在同一个或多个软件和/或硬件中实现。
本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请实施例可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
本申请是参照根据本申请实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可以由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些 计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其它可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其它可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
而且,这些计算机程序指令也可以存储在能引导计算机或其它可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或者多个流程和/或方框图一个方框或者多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其它可编程数据处理设备上,使得在计算机或者其它可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其它可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
以上所述仅为本申请的实施例而已,并不用于限制本申请。对于本领域技术人员来说,本申请可以有各种更改和变化。凡在本申请的精神和原理之内所作的任何修改、等同替换、改进等,均应包含在本申请的权利要求范围之内。
Claims (22)
- 一种编解码方法,其特征在于,所述方法包括:确定启用帧内帧间加权预测时,通过以下步骤获取当前块的加权预测值,所述加权预测值用于所述当前块的编码或解码;获取所述当前块的第一相邻块的第一预测模式、所述当前块的第二相邻块的第二预测模式;根据所述第一预测模式和所述第二预测模式确定用于帧内预测的目标预测模式,并根据所述目标预测模式获取所述当前块的帧内预测值;获取所述当前块的运动信息候选列表,所述运动信息候选列表包括至少一个运动信息;根据所述运动信息候选列表确定用于帧间预测的目标运动信息,并根据所述目标运动信息获取所述当前块的帧间预测值;对所述帧内预测值和所述帧间预测值进行加权处理,得到所述加权预测值。
- 根据权利要求1所述的方法,其特征在于,所述根据所述第一预测模式和所述第二预测模式确定用于帧内预测的目标预测模式,包括:根据所述第一预测模式和所述第二预测模式创建所述当前块的预测模式候选列表,所述预测模式候选列表包括至少一个候选预测模式;从所述预测模式候选列表中选择一个候选预测模式作为用于帧内预测的目标预测模式。
- 根据权利要求2所述的方法,其特征在于,所述根据所述第一预测模式和所述第二预测模式创建所述当前块的预测模式候选列表,包括:将所述第一预测模式转换为第三预测模式,将所述第二预测模式转换为第四预测模式,并根据所述第三预测模式和所述第四预测模式创建预测模式候选列表;或者,根据所述第一预测模式和所述第二预测模式,以及,所述第一预测模式的相邻模式和/或所述第二预测模式的相邻模式,创建预测模式候选列表。
- 根据权利要求3所述的方法,其特征在于,所述将所述第一预测模式转换为第三预测模式,包括:若所述第一预测模式为DC模式或者Planar模式,则确定所述第三预测模式与所述第一预测模式相同;若所述第一预测模式为角度模式,当所述第一预测模式大于对角模式时,则确定所述第三预测模式为垂直模式;当所述第一预测模式小于或等于对角模式时,则确定所述第三预测模式为水平模式;所述将所述第二预测模式转换为第四预测模式,包括:若所述第二预测模式为DC模式或者Planar模式,则确定所述第四预测模式与所述第二预测模式相同;若所述第二预测模式为角度模式,当所述第二预测模式大于对角模式时,则确定所述第四预测模式为垂直模式;当所述第二预测模式小于或者等于对角模式时,则确定所述第四预测模式为水平模式。
- 根据权利要求4所述的方法,其特征在于,根据所述第三预测模式和所述第四预测模式创建预测模式候选列表,包括:若所述第三预测模式与所述第四预测模式相同,则:若所述第三预测模式为DC模式或者Planar模式,则所述预测模式候选列表中的候选预测模式依次为:Planar模式、DC模式和垂直模式;若所述第三预测模式为角度模式,则所述预测模式候选列表中的候选预测模式依次为:所述第三预测模式、Planar模式和DC模式;若所述第三预测模式与所述第四预测模式不同,则:所述预测模式候选列表中的候 选预测模式依次为:所述第三预测模式、所述第四预测模式和特定预测模式;其中,(1)若所述第三预测模式和所述第四预测模式都不是Planar模式,则特定预测模式为Planar模式;在(1)不满足时,(2)若所述第三预测模式和所述第四预测模式都不是DC模式,特定预测模式为DC模式;在(1)和(2)均不满足时,特定预测模式为垂直模式。
- 根据权利要求3所述的方法,其特征在于,所述根据所述第一预测模式和所述第二预测模式,以及,所述第一预测模式的相邻模式和/或所述第二预测模式的相邻模式,创建预测模式候选列表,具体包括:若所述第一预测模式与所述第二预测模式相同,则:若所述第一预测模式为DC模式或者Planar模式,则所述预测模式候选列表中的候选预测模式依次为:Planar模式、DC模式和垂直模式;若所述第一预测模式为角度模式,则所述预测模式候选列表中的候选预测模式依次为:所述第一预测模式、所述第一预测模式的两个相邻模式;若所述第一预测模式与所述第二预测模式不同,则:所述预测模式候选列表中的候选预测模式依次为:所述第一预测模式、所述第二预测模式和预设预测模式;其中,(1)若所述第一预测模式和所述第二预测模式都不是Planar模式,则所述预设预测模式为Planar模式;在(1)不满足时,(2)若所述第一预测模式和所述第二预测模式都不是DC模式,所述预设预测模式为DC模式;在(1)和(2)不满足时,所述预设预测模式为垂直模式。
- 根据权利要求3所述的方法,其特征在于,所述根据所述第一预测模式和所述第二预测模式,以及,所述第一预测模式的相邻模式和/或所述第二预测模式的相邻模式,创建预测模式候选列表,具体包括:若所述第一预测模式与所述第二预测模式相同,则:若所述第一预测模式为DC模式或者Planar模式,则所述预测模式候选列表中的候选预测模式依次为:第一预测模式、默认预测模式、垂直模式、水平模式和垂直模式的两个相邻模式;若第一预测模式为DC模式,则默认预测模式为Planar模式,若第一预测模式为Planar模式,则默认预测模式为DC模式;若所述第一预测模式为角度模式,则所述预测模式候选列表中的候选预测模式依次为:第一预测模式、Planar模式、DC模式、第一预测模式的第一相邻模式、第一预测模式的第二相邻模式和第一预测模式的第三相邻模式;其中,第一相邻模式、第二相邻模式和第三相邻模式均由预设偏移值和预设模数值确定。
- 根据权利要求3所述的方法,其特征在于,所述根据所述第一预测模式和所述第二预测模式,以及,所述第一预测模式的相邻模式和/或所述第二预测模式的相邻模式,创建预测模式候选列表,具体包括:若所述第一预测模式与所述第二预测模式不同,则:若所述第一预测模式和所述第二预测模式均为角度模式,所述预测模式候选列表中的候选预测模式依次为:第一预测模式、第二预测模式、Planar模式、DC模式、候选预测模式的第一相邻模式和候选预测模式的第二相邻模式;其中,所述候选预测模式为第一预测模式和第二预测模式中的较大模式;所述第一相邻模式和所述第二相邻模式,均由预设偏移值和预设模数值确定。
- 根据权利要求3所述的方法,其特征在于,所述根据所述第一预测模式和所述第二预测模式,以及,所述第一预测模式的相邻模式和/或所述第二预测模式的相邻模式, 创建预测模式候选列表,具体包括:若所述第一预测模式与所述第二预测模式不同,则:若所述第一预测模式为Planar模式或DC模式,所述第二预测模式为角度模式,或者,所述第一预测模式为角度模式,所述第二预测模式为Planar模式或DC模式,则所述预测模式候选列表中的候选预测模式依次为:第一预测模式、第二预测模式、参考预测模式、候选预测模式的第三相邻模式、所述候选预测模式的第四相邻模式和所述候选预测模式的第五相邻模式;其中,所述候选预测模式为所述第一预测模式和所述第二预测模式中的较大模式;若所述第一预测模式和所述第二预测模式中不存在Planar模式,则所述参考预测模式为Planar模式;若所述第一预测模式和所述第二预测模式中不存在DC模式,则所述参考预测模式为DC模式;所述第三相邻模式、所述第四相邻模式和所述第五相邻模式,均由预设偏移值和预设模数值确定。
- 根据权利要求1所述的方法,其特征在于,所述根据所述第一预测模式和所述第二预测模式确定帧内预测的目标预测模式,包括:若所述第一预测模式与所述第二预测模式相同,则将所述第一预测模式确定为用于帧内预测的目标预测模式;或者,若所述第一预测模式与所述第二预测模式不同,则根据所述第一预测模式确定用于帧内预测的目标预测模式。
- 根据权利要求10所述的方法,其特征在于,所述根据所述第一预测模式确定用于帧内预测的目标预测模式,包括:若第一预测模式为DC模式,则确定目标预测模式为DC模式;若第一预测模式为Planar模式,则确定目标预测模式为Planar模式;若第一预测模式为角度模式,当所述第一预测模式大于对角模式时,则确定目标预测模式为垂直模式;当所述第一预测模式小于或者等于对角模式时,则确定目标预测模式为水平模式。
- 根据权利要求1所述的方法,其特征在于,所述获取所述当前块的运动信息候选列表,包括:采用合并模式创建当前块的运动信息候选列表;或者,采用AMVP模式创建当前块的运动信息候选列表;或者,采用仿射合并模式创建当前块的运动信息候选列表;或者,采用仿射AMVP模式创建当前块的运动信息候选列表;或者,采用合并模式和MMVD模式创建当前块的运动信息候选列表;或者,采用AMVP模式和MMVD模式创建当前块的运动信息候选列表;或者,采用仿射合并模式和MMVD模式创建当前块的运动信息候选列表;或者,采用仿射AMVP模式和MMVD模式创建当前块的运动信息候选列表。
- 根据权利要求12所述的方法,其特征在于,在采用MMVD模式创建当前块的运动信息候选列表时,对多个原始运动信息进行偏移,将偏移后的运动信息添加到运动信息候选列表;或者,对一个原始运动信息进行偏移,将偏移后的运动信息添加到运动信息候选列表。
- 根据权利要求1所述的方法,其特征在于,所述方法还包括:若针对所述当前块配置帧内块复制模式,则从当前帧中选择所述当前块对应的参考 块,并根据所述参考块的像素信息确定所述当前块的帧间预测值。
- 根据权利要求1所述的方法,其特征在于,所述根据所述目标运动信息获取所述当前块的帧间预测值,包括:若所述目标运动信息包括第一方向的运动信息和第二方向的运动信息,则从第一方向的运动信息以及第二方向的运动信息中选择一个运动信息;根据选择的运动信息获取所述当前块的帧间预测值。
- 根据权利要求1所述的方法,其特征在于,所述对所述帧内预测值和所述帧间预测值进行加权处理,得到所述加权预测值,具体包括:根据所述帧内预测值、所述帧内预测值对应的第一权重系数、所述帧间预测值、所述帧间预测值对应的第二权重系数进行加权处理,得到所述加权预测值;其中,所述第一权重系数与所述第二权重系数不同或者相同。
- 根据权利要求16所述的方法,其特征在于,若所述当前块的目标预测模式为DC模式或Planar模式,则所述第一权重系数与所述第二权重系数相同;若所述当前块的目标预测模式为水平模式,则所述当前块的左侧子块的第一权重系数大于所述左侧子块的第二权重系数,所述当前块的右侧子块的第一权重系数小于或者等于所述右侧子块的第二权重系数;若所述当前块的目标预测模式为垂直模式,则所述当前块的上侧子块的第一权重系数大于所述上侧子块的第二权重系数,所述当前块的下侧子块的第一权重系数小于或者等于所述下侧子块的第二权重系数。
- 一种编解码方法,其特征在于,所述方法包括:确定启用帧内帧间加权预测时,通过以下步骤获取当前块的加权预测值,所述加权预测值用于所述当前块的编码或解码:根据所述当前块的形状确定用于帧内预测的目标预测模式,并根据所述目标预测模式获取所述当前块的帧内预测值;获取所述当前块的运动信息候选列表,所述运动信息候选列表包括至少一个运动信息;根据所述运动信息候选列表确定用于帧间预测的目标运动信息,并根据所述目标运动信息获取所述当前块的帧间预测值;对所述帧内预测值和所述帧间预测值进行加权处理,得到所述加权预测值。
- 根据权利要求18所述的方法,其特征在于,所述根据当前块的形状确定用于帧内预测的目标预测模式,包括:若所述当前块的高度与所述当前块的宽度相同,则确定所述目标预测模式为DC模式或者Planar模式;若所述当前块的高度大于所述当前块的宽度,则确定所述目标预测模式为水平模式;若所述当前块的高度小于所述当前块的宽度,则确定所述目标预测模式为垂直模式。
- 一种编解码方法,其特征在于,所述方法包括:确定启用帧内帧间加权预测时,通过以下步骤获取当前块的加权预测值,所述加权预测值用于所述当前块的编码或解码;根据预设预测模式获取所述当前块的帧内预测值;获取所述当前块的运动信息候选列表,所述运动信息候选列表包括至少一个运动信息;根据所述运动信息候选列表确定用于帧间预测的目标运动信息,并根据所述目标运 动信息获取所述当前块的帧间预测值;对所述帧内预测值和所述帧间预测值进行加权处理,得到所述加权预测值。
- 一种解码端设备,其特征在于,包括:处理器和机器可读存储介质,所述机器可读存储介质存储有能够被所述处理器执行的机器可执行指令;所述处理器用于执行机器可执行指令,以实现权利要求1-17任一所述的方法步骤,或实现权利要求18或19所述的方法步骤,或实现权利要求20所述的方法步骤。
- 一种编码端设备,其特征在于,包括:处理器和机器可读存储介质,所述机器可读存储介质存储有能够被所述处理器执行的机器可执行指令;所述处理器用于执行机器可执行指令,以实现权利要求1-17任一所述的方法步骤,或实现权利要求18或19所述的方法步骤,或实现权利要求20所述的方法步骤。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201811626347.1 | 2018-12-28 | ||
| CN201811626347.1A CN111385569B (zh) | 2018-12-28 | 2018-12-28 | 一种编解码方法及其设备 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2020134969A1 true WO2020134969A1 (zh) | 2020-07-02 |
Family
ID=67813939
Family Applications (2)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2019/123632 Ceased WO2020134969A1 (zh) | 2018-12-28 | 2019-12-06 | 一种编解码方法及其设备 |
| PCT/CN2019/123631 Ceased WO2020134968A1 (zh) | 2018-12-28 | 2019-12-06 | 一种编解码方法及其设备 |
Family Applications After (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2019/123631 Ceased WO2020134968A1 (zh) | 2018-12-28 | 2019-12-06 | 一种编解码方法及其设备 |
Country Status (2)
| Country | Link |
|---|---|
| CN (2) | CN110225346A (zh) |
| WO (2) | WO2020134969A1 (zh) |
Families Citing this family (25)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110636311B (zh) * | 2019-09-18 | 2021-10-15 | 浙江大华技术股份有限公司 | 运动矢量的获取方法及相关预测方法、装置 |
| CN112543322B (zh) * | 2019-09-20 | 2022-04-15 | 杭州海康威视数字技术股份有限公司 | 一种解码、编码方法、装置及其设备 |
| CN113810687B (zh) * | 2019-09-23 | 2022-12-23 | 杭州海康威视数字技术股份有限公司 | 一种编解码方法、装置及其设备 |
| CN112204983A (zh) * | 2019-09-24 | 2021-01-08 | 北京大学 | 一种视频处理方法、设备及存储介质 |
| CN110611813A (zh) * | 2019-10-28 | 2019-12-24 | 北京达佳互联信息技术有限公司 | 视频合并编码场景下的最优候选获取方法及装置 |
| CN112135146B (zh) | 2019-11-14 | 2021-12-24 | 杭州海康威视数字技术股份有限公司 | 一种编解码方法、装置及其设备 |
| CN113099240B (zh) * | 2019-12-23 | 2022-05-31 | 杭州海康威视数字技术股份有限公司 | 一种编解码方法、装置及其设备 |
| CN113329225B (zh) * | 2020-02-28 | 2024-10-15 | 北京三星通信技术研究有限公司 | 视频编解码方法和装置 |
| CN113452997B (zh) * | 2020-03-25 | 2022-07-29 | 杭州海康威视数字技术股份有限公司 | 一种编解码方法、装置及其设备 |
| CN113453005B (zh) * | 2020-03-26 | 2022-11-01 | 杭州海康威视数字技术股份有限公司 | 解码方法、编码方法、装置及设备 |
| CN113766222B (zh) * | 2020-06-01 | 2023-03-24 | 杭州海康威视数字技术股份有限公司 | 一种编解码方法、装置及其设备 |
| CN113766245A (zh) * | 2020-06-05 | 2021-12-07 | Oppo广东移动通信有限公司 | 帧间预测方法、解码器、编码器及计算机存储介质 |
| CN113766234B (zh) * | 2020-06-05 | 2022-12-23 | 杭州海康威视数字技术股份有限公司 | 一种解码、编码方法、装置及其设备 |
| CN113873249B (zh) | 2020-06-30 | 2023-02-28 | 杭州海康威视数字技术股份有限公司 | 一种编解码方法、装置及其设备 |
| CN114007078B (zh) * | 2020-07-03 | 2022-12-23 | 杭州海康威视数字技术股份有限公司 | 一种运动信息候选列表的构建方法、装置及其设备 |
| CN114071159B (zh) * | 2020-07-29 | 2023-06-30 | Oppo广东移动通信有限公司 | 帧间预测方法、编码器、解码器及计算机可读存储介质 |
| CN112055209B (zh) * | 2020-08-06 | 2024-08-02 | 浙江大华技术股份有限公司 | 图像编码方法及图像处理装置、计算机可读存储介质 |
| CN113709499B (zh) * | 2020-08-20 | 2022-12-23 | 杭州海康威视数字技术股份有限公司 | 一种编解码方法、装置及其设备 |
| CN112055203B (zh) * | 2020-08-22 | 2024-04-12 | 浙江大华技术股份有限公司 | 帧间预测方法、视频编码方法及其相关装置 |
| CN112291565B (zh) * | 2020-09-10 | 2021-09-14 | 浙江大华技术股份有限公司 | 视频编码方法及其相关装置 |
| CN114598889B (zh) * | 2020-12-03 | 2023-03-28 | 杭州海康威视数字技术股份有限公司 | 一种编解码方法、装置及其设备 |
| CN113794881B (zh) * | 2021-04-13 | 2023-03-24 | 杭州海康威视数字技术股份有限公司 | 一种编解码方法、装置及其设备 |
| CN118414825A (zh) | 2021-12-31 | 2024-07-30 | Oppo广东移动通信有限公司 | 预测方法、装置、设备、系统、及存储介质 |
| CN120530627A (zh) * | 2023-01-18 | 2025-08-22 | Oppo广东移动通信有限公司 | 视频编解码方法、装置、设备、系统、及存储介质 |
| CN118803234A (zh) * | 2023-04-14 | 2024-10-18 | 维沃移动通信有限公司 | 联合帧间帧内的预测方法、装置、终端及可读存储介质 |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101877785A (zh) * | 2009-04-29 | 2010-11-03 | 祝志怡 | 一种基于混合预测的视频编码方法 |
| CN102238391A (zh) * | 2011-05-25 | 2011-11-09 | 深圳市融创天下科技股份有限公司 | 一种预测编码方法、装置 |
| CN107113425A (zh) * | 2014-11-06 | 2017-08-29 | 三星电子株式会社 | 视频编码方法和设备以及视频解码方法和设备 |
| CN107995489A (zh) * | 2017-12-20 | 2018-05-04 | 北京大学深圳研究生院 | 一种用于p帧或b帧的帧内帧间组合预测方法 |
| WO2018237295A1 (en) * | 2017-06-23 | 2018-12-27 | Qualcomm Incorporated | Combination of inter-prediction and intra-prediction in video coding |
Family Cites Families (8)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN100401789C (zh) * | 2004-06-11 | 2008-07-09 | 上海大学 | H.264/avc帧内预测模式的快速选择方法 |
| CN100413342C (zh) * | 2005-03-09 | 2008-08-20 | 浙江大学 | 用于视频或图像压缩的帧内预测模式编解码的方法和装置 |
| ZA200900032B (en) * | 2006-07-07 | 2010-03-31 | Ericsson Telefon Ab L M | Video data management |
| CN105872551B (zh) * | 2011-01-07 | 2018-09-25 | 寰发股份有限公司 | 编码方法与装置以及解码方法与装置 |
| KR101611409B1 (ko) * | 2011-09-28 | 2016-04-14 | 한국전자통신연구원 | 인트라 예측 모드 부호화/복호화 방법 및 장치 |
| GB2534606A (en) * | 2015-01-29 | 2016-08-03 | Canon Kk | Method and device for encoding or decoding an image comprising encoding of decoding information representing prediction modes |
| CN106991477B (zh) * | 2016-01-20 | 2020-08-14 | 中科寒武纪科技股份有限公司 | 一种人工神经网络压缩编码装置和方法 |
| CN117041547A (zh) * | 2016-04-29 | 2023-11-10 | 世宗大学校产学协力团 | 用于对图像信号进行编码/解码的方法和设备 |
-
2018
- 2018-12-28 CN CN201910572303.3A patent/CN110225346A/zh active Pending
- 2018-12-28 CN CN201811626347.1A patent/CN111385569B/zh active Active
-
2019
- 2019-12-06 WO PCT/CN2019/123632 patent/WO2020134969A1/zh not_active Ceased
- 2019-12-06 WO PCT/CN2019/123631 patent/WO2020134968A1/zh not_active Ceased
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101877785A (zh) * | 2009-04-29 | 2010-11-03 | 祝志怡 | 一种基于混合预测的视频编码方法 |
| CN102238391A (zh) * | 2011-05-25 | 2011-11-09 | 深圳市融创天下科技股份有限公司 | 一种预测编码方法、装置 |
| CN107113425A (zh) * | 2014-11-06 | 2017-08-29 | 三星电子株式会社 | 视频编码方法和设备以及视频解码方法和设备 |
| WO2018237295A1 (en) * | 2017-06-23 | 2018-12-27 | Qualcomm Incorporated | Combination of inter-prediction and intra-prediction in video coding |
| CN107995489A (zh) * | 2017-12-20 | 2018-05-04 | 北京大学深圳研究生院 | 一种用于p帧或b帧的帧内帧间组合预测方法 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN110225346A (zh) | 2019-09-10 |
| WO2020134968A1 (zh) | 2020-07-02 |
| CN111385569B (zh) | 2022-04-26 |
| CN111385569A (zh) | 2020-07-07 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2020134968A1 (zh) | 一种编解码方法及其设备 | |
| CN109862368B (zh) | 一种编解码方法及其设备 | |
| JP5875989B2 (ja) | ビデオ・エンコードおよびデコードのための低複雑性テンプレート照合予測のための方法および装置 | |
| CN113055685B (zh) | 一种编解码方法、装置及其设备 | |
| CN111698500B (zh) | 一种编解码方法、装置及其设备 | |
| WO2020108360A1 (zh) | 视频图像编解码中的运动信息确定 | |
| CN112449181B (zh) | 一种编解码方法、装置及其设备 | |
| CN113099240B (zh) | 一种编解码方法、装置及其设备 | |
| CN111510726B (zh) | 一种编解码方法及其设备 | |
| CN112565747B (zh) | 一种解码、编码方法、装置及其设备 | |
| CN112291558B (zh) | 一种编解码方法、装置及其设备 | |
| CN112543322B (zh) | 一种解码、编码方法、装置及其设备 | |
| CN112449180B (zh) | 一种编解码方法、装置及其设备 | |
| CN112422971B (zh) | 一种编解码方法、装置及其设备 | |
| CN112055220B (zh) | 一种编解码方法、装置及其设备 | |
| CN113709486B (zh) | 一种编解码方法、装置及其设备 | |
| WO2020177747A1 (zh) | 编解码方法与装置、编码端设备和解码端设备 | |
| HK40046512B (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: 19905300 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 19905300 Country of ref document: EP Kind code of ref document: A1 |

