WO2021203841A1 - 一种帧间预测方法、编码器、解码器及存储介质 - Google Patents

一种帧间预测方法、编码器、解码器及存储介质 Download PDF

Info

Publication number
WO2021203841A1
WO2021203841A1 PCT/CN2021/076727 CN2021076727W WO2021203841A1 WO 2021203841 A1 WO2021203841 A1 WO 2021203841A1 CN 2021076727 W CN2021076727 W CN 2021076727W WO 2021203841 A1 WO2021203841 A1 WO 2021203841A1
Authority
WO
WIPO (PCT)
Prior art keywords
value
current block
index information
cosine
weight
Prior art date
Application number
PCT/CN2021/076727
Other languages
English (en)
French (fr)
Inventor
马彦卓
霍俊彦
万帅
杨付正
冉启宏
Original Assignee
Oppo广东移动通信有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Priority to CN202180026037.XA priority Critical patent/CN115380532A/zh
Priority to EP21785246.6A priority patent/EP4131954A4/en
Publication of WO2021203841A1 publication Critical patent/WO2021203841A1/zh
Priority to US17/953,250 priority patent/US20230052940A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • H04N19/51Motion estimation or motion compensation
    • H04N19/573Motion compensation with multiple frame prediction using two or more reference frames in a given prediction direction
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/103Selection of coding mode or of prediction mode
    • H04N19/105Selection of the reference unit for prediction within a chosen coding or prediction mode, e.g. adaptive choice of position and number of pixels used for prediction
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/119Adaptive subdivision aspects, e.g. subdivision of a picture into rectangular or non-rectangular coding blocks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/124Quantisation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/146Data rate or code amount at the encoder output
    • H04N19/147Data rate or code amount at the encoder output according to rate distortion criteria
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/182Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being a pixel
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/186Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being a colour or a chrominance component
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/60Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
    • H04N19/61Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding in combination with predictive coding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/70Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by syntax aspects related to video coding, e.g. related to compression standards
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/80Details of filtering operations specially adapted for video compression, e.g. for pixel interpolation
    • H04N19/82Details of filtering operations specially adapted for video compression, e.g. for pixel interpolation involving filtering within a prediction loop
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/85Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using pre-processing or post-processing specially adapted for video compression
    • H04N19/86Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using pre-processing or post-processing specially adapted for video compression involving reduction of coding artifacts, e.g. of blockiness
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • H04N19/51Motion estimation or motion compensation
    • H04N19/513Processing of motion vectors
    • H04N19/517Processing of motion vectors by encoding
    • H04N19/52Processing of motion vectors by encoding by predictive encoding

Definitions

  • the embodiments of the present application relate to video image processing technology, and relate to but not limited to inter-frame prediction methods, encoders, decoders, and storage media.
  • Inter-frame prediction may include motion estimation and motion compensation.
  • VVC Versatile Video Coding
  • TPM Triangular Partition Mode
  • GPM geometric Partition Mode
  • the embodiments of the present application provide an inter-frame prediction method, an encoder, a decoder, and a storage medium, which can improve the expression efficiency of motion information and improve the efficiency of video encoding and decoding.
  • an embodiment of the present application provides an inter-frame prediction method, which is applied to an encoder, and the method includes:
  • the prediction mode parameter indicates that the geometric partition prediction mode GPM is used to determine the inter prediction value of the current block, determine the GPM parameter of the current block;
  • the first predicted value and the first weight value of the pixel in the first partition Based on the first predicted value and the first weight value of the pixel in the first partition, and the second predicted value and the second weight value of the pixel in the second partition, the first predicted value and the The second prediction value is weighted and fused to obtain the inter-frame prediction value of the current block.
  • an embodiment of the present application provides an inter-frame prediction method, which is applied to a decoder, and the method includes:
  • the prediction mode parameter indicates that the geometric partition prediction mode GPM is used to determine the inter prediction value of the current block, determine the GPM parameter of the current block;
  • the first predicted value and the first weight value of the pixel in the first partition Based on the first predicted value and the first weight value of the pixel in the first partition, and the second predicted value and the second weight value of the pixel in the second partition, the first predicted value and the The second prediction value is weighted and fused to obtain the inter-frame prediction value of the current block.
  • an encoder including:
  • the determining unit is configured to determine the prediction mode parameter of the current block
  • the first processing unit is configured to determine the GPM parameter of the current block when the prediction mode parameter indicates that the geometric division prediction mode GPM is used to determine the inter prediction value of the current block; according to the GPM parameter of the current block, Determining the first prediction value of the first partition of the current block and the second prediction value of the second partition of the current block;
  • the first processing unit is further configured to determine the weight index of pixels in the current block according to the GPM parameters of the current block; wherein, the weight indexes of pixels determined according to different GPM parameters are not all even numbers; The weight index of the pixel in the current block, and the first weight value and the second weight value of the pixel in the current block are determined;
  • the first prediction unit is configured to, based on the first prediction value and the first weight value of the pixel in the first partition, and the second prediction value and the second weight value of the pixel in the second partition, perform the The first predicted value and the second predicted value are weighted and merged to obtain the inter-frame predicted value of the current block.
  • an embodiment of the present application provides a decoder, including:
  • the parsing unit is configured to parse the code stream and determine the prediction mode parameters of the current block
  • the second processing unit is configured to determine the GPM parameter of the current block when the prediction mode parameter indicates that the geometric division prediction mode GPM is used to determine the inter prediction value of the current block; according to the GPM parameter of the current block, Determining the first prediction value of the first partition of the current block and the second prediction value of the second partition of the current block;
  • the second processing unit is further configured to determine the weight index of pixels in the current block according to the GPM parameters of the current block; wherein, the weight indexes of the pixels determined according to different GPM parameters are not all even numbers; The weight index of the pixel in the current block, and the first weight value and the second weight value of the pixel in the current block are determined;
  • the second prediction unit is further configured to perform calculations on all pixels based on the first prediction value and the first weight value of the pixel in the first partition, and the second prediction value and the second weight value of the pixel in the second partition.
  • the first predicted value and the second predicted value are weighted and merged to obtain the inter-frame predicted value of the current block.
  • an embodiment of the present application also provides an encoder, including: a first memory and a first processor; the first memory stores a computer program that can run on the first processor, and the first memory The inter-frame prediction method of the encoder is realized when the processor executes the program.
  • an embodiment of the present application also provides a decoder, including: a second memory and a second processor; the second memory stores a computer program that can run on the second processor, and the second memory When the processor executes the program, the inter-frame prediction method of the decoder is implemented.
  • an embodiment of the present application provides a storage medium, including: a computer program is stored thereon, and when the computer program is executed by a first processor, the inter-frame prediction method of the encoder is implemented; or, the computer When the program is executed by the second processor, the inter-frame prediction method of the decoder is implemented.
  • the embodiments of the present application provide an inter-frame prediction method, an encoder, a decoder, and a storage medium, including: determining a prediction mode parameter of a current block; when the prediction mode parameter indicates that the geometric partition prediction mode GPM is used to determine the current block Determining the GPM parameter of the current block; determining the first prediction value of the first partition of the current block and the second partition of the current block according to the GPM parameters of the current block Two prediction values; determine the weight index of the pixel in the current block according to the GPM parameter of the current block; wherein the weight index of the pixel determined according to different GPM parameters is not all even numbers; based on the pixel in the current block To determine the first weight value and the second weight value of the pixel in the current block; based on the first predicted value and the first weight value of the pixel in the first subarea, and the second subarea The second predicted value and the second weight value of the pixel are weighted and merged on the first predicted value and the second predicted value to obtain the inter-frame predicted
  • the preset calculation strategy can be used to reduce the power of the calculation process of the weight index, so that the weight index is not all even numbers, and the codec performance is not changed.
  • the problem that the intermediate index data has redundant bits in the weight calculation process in the original scheme can reduce bit overhead and improve storage efficiency.
  • FIG. 1 is a schematic diagram of a composition block diagram of a video encoding system provided by an embodiment of the application;
  • FIG. 2 is a schematic diagram of the composition of a video decoding system provided by an embodiment of the application.
  • FIG. 3 is a schematic diagram of the first process of an intra prediction method provided by an embodiment of the application.
  • FIGS. 4a-4b are schematic diagrams of two divisions of TPM mode
  • FIGS 5a-5g are schematic diagrams of seven divisions of GPM mode
  • Fig. 6 is a schematic diagram of the angle and step length of an exemplary current block provided by an embodiment of the application.
  • FIG. 7 is a schematic diagram of adjacent block positions of a spatial merge candidate list in an embodiment of the application.
  • FIG. 8 is a schematic diagram of the composition structure of the merge candidate list in an embodiment of the application.
  • FIG. 9 is a schematic diagram of a GPM mode prediction process in an embodiment of this application.
  • FIG. 10 is a schematic diagram of a process for determining a weight index in an embodiment of this application.
  • FIG. 11 is a schematic diagram of a division method of a current block in an embodiment of the application.
  • FIG. 12a is a schematic diagram of an exemplary brightness weight value provided by an embodiment of the application.
  • FIG. 12b is a schematic diagram of an exemplary chromaticity weight value provided by an embodiment of the application.
  • FIG. 13 is a schematic flowchart of a method for determining motion index information of a sub-block in a current block in an embodiment of the application
  • FIG. 14 is a schematic diagram of a second process of an intra prediction method provided by an embodiment of this application.
  • 15 is a schematic diagram of the first composition structure of an encoder in an embodiment of the application.
  • FIG. 16 is a schematic diagram of a second composition structure of an encoder in an embodiment of the application.
  • FIG. 17 is a schematic diagram of the first composition structure of a decoder in an embodiment of the application.
  • FIG. 18 is a schematic diagram of the second composition structure of the decoder in an embodiment of the application.
  • the video encoding system 11 includes: a transformation unit 111, a quantization unit 112, a mode selection and encoding control logic unit 113, an intra prediction unit 114, and an inter prediction unit 115 (Including: motion compensation and motion estimation), inverse quantization unit 116, inverse transform unit 117, loop filter unit 118, coding unit 119 and decoded image buffer unit 110; for the input original video signal, through coding tree block (Coding Tree) Unit, CTU) can be divided to obtain a video reconstruction block, the coding mode is determined by the mode selection and coding control logic unit 113, and then the residual pixel information obtained after intra-frame or inter-frame prediction is passed through the transform unit 111 and quantized
  • the unit 112 transforms the video reconstruction block, including transforming the residual information from the pixel domain to the transform domain, and quantizing the resulting transform coefficients to further reduce the bit rate; the intra prediction unit 114 is used to reconstruct the video Block performs intra prediction; where
  • the block passes through the loop filter unit 118 to remove the block effect artifact, and then the reconstructed residual block is added to a predictive block in the frame of the decoded image buffer unit 111 to generate a reconstructed video reconstruction block; encoding;
  • the unit 119 is used to encode various coding parameters and quantized transform coefficients.
  • the decoded image buffer unit 110 is used to store the reconstructed video reconstruction block, which is configured as a prediction reference. As the video image encoding progresses, new reconstructed video reconstruction blocks will be continuously generated, and these reconstructed video reconstruction blocks will all be stored in the decoded image buffer unit 110.
  • FIG. 2 is a schematic diagram of the composition structure of a video encoding system according to an embodiment of the application.
  • the video encoding system 21 includes: a decoding unit 211, an inverse transform unit 217, and an inverse Quantization unit 212, intra-frame prediction unit 213, motion compensation unit 214, loop filter unit 215, and decoded image buffer unit 216; the input video signal is encoded by the video encoding system 11, and then the code stream of the video signal is output; The code stream is input into the video decoding system 21, and first passes through the decoding unit 211, and is configured to obtain the decoded transform coefficients; the transform coefficients are processed by the inverse transform unit 217 and the inverse quantization unit 212 to generate residuals in the pixel domain.
  • the intra prediction unit 213 can be used to generate prediction data of the current video decoding block based on the determined intra prediction direction and the data from the previous decoded block of the current frame or picture;
  • the motion compensation unit 214 analyzes the motion vector and Other associated syntax elements determine the prediction information for the video decoding block, and use the prediction information to generate the predictive block of the video decoding block being decoded; by comparing the residual blocks from the inverse transform unit 217 and the inverse quantization unit 212 Sum with the corresponding predictive blocks generated by the intra prediction unit 213 or the motion compensation unit 214 to form a decoded video block;
  • the decoded video signal is passed through the loop filter unit 215 to remove block artifacts, which can improve the video Quality; then the decoded video block is stored in the decoded image buffer unit 216, the decoded image buffer unit 216 stores the reference image used for subsequent intra prediction or motion compensation, and is also used for the output of the video signal to obtain the restored Original video signal.
  • the inter-frame prediction method provided by the embodiment of the present application mainly acts on the inter-frame prediction unit 115 of the video encoding system 11 and the intra-frame prediction unit of the video decoding system 21, that is, the motion compensation unit 214;
  • the system 11 can obtain a better prediction effect through the inter-frame prediction method provided in the embodiments of the present application, and correspondingly, at the decoding end, the video decoding restoration quality can also be improved.
  • the embodiment of the present application provides an inter-frame prediction method, which is applied to a video encoding device, that is, an encoder.
  • the functions implemented by the method can be implemented by the processor in the video encoding device calling program codes.
  • the program code can be stored in a computer storage medium. It can be seen that the video encoding device includes at least a processor and a storage medium.
  • Fig. 3 is a schematic diagram of the first flow of an intra prediction method provided by an embodiment of the application. The method is applied to an encoder. As shown in Fig. 3, the method includes:
  • Step 101 Determine the prediction mode parameter of the current block.
  • the prediction mode parameter indicates the coding mode of the current block and parameters related to the mode.
  • a rate-distortion optimization (Rate Distortion Optimization, RDO) method can be used to determine the prediction mode parameters of the current block.
  • the encoder to determine the prediction mode parameters of the current block is implemented as follows: the encoder determines the image components to be predicted for the current block; based on the parameters of the current block, multiple prediction modes are used to perform the prediction on the image components to be predicted. Predictive coding, calculate the rate-distortion cost result corresponding to each prediction mode in multiple prediction modes; select the minimum rate-distortion cost result from the calculated multiple rate-distortion cost results, and assign the minimum rate-distortion cost result to the corresponding prediction mode Determined as the prediction mode parameter of the current block.
  • multiple prediction modes can be used for the current block to respectively encode the image components to be predicted.
  • multiple prediction modes usually include inter prediction mode, traditional intra prediction mode, and non-traditional intra prediction mode
  • traditional intra prediction modes can include direct current (DC) mode and plane (PLANAR). Mode and angle mode, etc.
  • Non-traditional intra prediction modes can include MIP mode, Cross-component Linear Model Prediction (CCLM) mode, Intra Block Copy (IBC) mode and PLT (Palette) mode, etc.
  • inter-frame prediction modes include: GPM mode, triangular partition mode (Triangle partition mode, TPM), etc.
  • the rate-distortion cost result corresponding to each prediction mode can be obtained; then the minimum rate-distortion cost result is selected from the obtained multiple rate-distortion cost results, and The prediction mode corresponding to the minimum rate-distortion cost result is determined as the prediction mode parameter of the current block; in this way, the determined prediction mode can be used to encode the current block, and in this prediction mode, the prediction residual can be made small , Can improve coding efficiency.
  • Step 102 When the prediction mode parameter indicates that the geometric partition prediction mode GPM is used to determine the inter prediction value of the current block, determine the GPM parameter of the current block;
  • the GPM parameter of the current block when the prediction mode parameter indicates that the GPM is used to determine the inter-frame prediction of the current block, the GPM parameter of the current block can be obtained or determined.
  • the GPM parameter of the current block includes: the angle index information of the current block division line and the size information of the current block, and may also include: the step index information of the current block division line and so on.
  • the images of a video sequence are divided into image blocks for encoding.
  • coding techniques such as prediction, transformation, and quantization are usually implemented in units of square and rectangular blocks.
  • the edges of moving objects are not necessarily horizontal or vertical. Even if they are, they may not be exactly on the edge of the block that can be divided.
  • the motion vectors on both sides of the moving edge are often different, so in the encoding process Performing motion prediction and compensation in a whole block is prone to large prediction errors, which leads to limited coding efficiency.
  • TPM introduced a square or rectangular diagonal or anti-diagonal line as the dividing line to obtain a triangular prediction unit, as shown in Figure 4a-4b, so as to express inter-frame prediction more flexibly. Data, reduce prediction errors, thereby improving coding efficiency.
  • GEM geometrical partitioning for inter-blocks
  • each division mode corresponds to an angle ⁇ and a step size ⁇ , and there are a total of 20 angles and 4 step sizes.
  • each combination of angle and step length constitutes a division mode.
  • GPM divides the current block into two non-rectangular sub-partitions, and each sub-partition performs one-way motion compensation separately to obtain a one-way prediction value, and finally uses a weight matrix to weight and fuse the one-way prediction values of the two partitions to obtain the final GPM prediction value .
  • the encoder when the encoder side determines that GMP is used for inter-frame prediction, the encoder can obtain the GPM parameters of the current block when GPM is used for inter-frame prediction.
  • the GPM parameters include the current The block division method, the index information of the mv information of the first partition and the index information of the mv information of the second partition.
  • Sequence layer parameter set (Sequence Parameter Set, SPS) allows the use of GPM prediction mode;
  • the coded image area of the current block belongs to a bi-directional predictive slice (B slice);
  • the current block is general merge prediction, merge_subblock prediction, non-affine prediction, and non-composed intra-inter prediction (CIIP);
  • the coding unit layer syntax description corresponding to the current block is shown in Table 1.
  • ae(v) represents context-adaptive arithmetic entropy-coded syntax element, that is, context-adaptive arithmetic entropy coding syntax element.
  • merge_gpm_partition_idx[x0][y0] is the division information of the current block
  • merge_gpm_idx0[x0][y0] indicates the position of the mv of partition A in the merge list
  • merge_gpm_idx1[x0][y0] indicates that the mv of partition B is in the merge list
  • the position in MaxNumGpmMergeCand is determined by the table length of the motion information candidate list.
  • FIG. 7 is a schematic diagram of the positions of neighboring blocks in the spatial merge candidate list in the embodiment of the application.
  • the construction order of neighboring blocks in the merge candidate list is: the neighboring block A1 on the left and the neighboring block B1 on the upper side.
  • the upper right adjacent block B0, the lower left adjacent block A0, the upper left adjacent block B2, the reference frame corresponding position block col is the motion vector information of the adjacent blocks arranged in sequence, and the sources of different directions are distinguished.
  • the historical reference block his, the average MV avg of the first and second candidate MVs, and the zero motion vector 0 can also be added to the merge list.
  • the addition order of adjacent blocks represents the correlation between each mv information and the mv information of the current block, that is, the addition order of the merge candidate list represents the possibility of this candidate being selected as the mv information of the current block. Represents the accuracy of this candidate after being selected as the current block mv information.
  • FIG. 8 is a schematic diagram of the composition structure of the merge candidate list in an embodiment of the application.
  • the merge candidate list of FIG. 8 is obtained according to the position diagram of the adjacent blocks in FIG. 7.
  • the merge candidate list includes 5 adjacent blocks.
  • the mv information of, the sequence numbers are 0, 1, 2, 3, 4, and each adjacent block contains bidirectional prediction mv information, namely list0 and list1. Because in the GPM prediction mode, each partition will only use the one-way prediction mode, and each item in the merge list may be the mv information for bidirectional prediction, so the one-way prediction mv needs to be taken out for use.
  • X (m&0x01), where X is the reference list indication information, which is configured to indicate list0 and list1, and & is a bit AND operation, that is, the last bit of m is taken out (similar to parity check).
  • X the reference list indication information
  • & is a bit AND operation, that is, the last bit of m is taken out (similar to parity check).
  • the mv of two partitions (a partition first and then a partition B) is obtained, and the specific obtaining method includes the following:
  • merge_gpm_idx0[x0][y0] indicates the position of the mv of the A partition in the merge list
  • the position of the mv of the B partition in the merge list may be reduced by 1 because A first selected the option at the top position.
  • n represents the actual position of the mv selected by partition B in the merge candidate list, waiting for subsequent processing.
  • the corresponding mv information is stored in the processing variable of the A partition, and the subsequent prediction block structure is prepared.
  • each partition will only use the one-way prediction mode, and each item in the merge list may be the mv information for bidirectional prediction, so the one-way prediction mv needs to be taken out for use.
  • X is the reference list indication information, configured to indicate the priority of use of list0 and list1
  • & Is the bitwise AND operation that is, the last bit of m is taken out (similar to parity check).
  • mvA is the vector in the two directions of the mv of the A partition
  • refIdxA is the reference frame corresponding to the motion vector
  • predListFlagA indicates the component in which list of the motion vector alternatives is currently selected.
  • N mergeCandList[n]
  • the corresponding mv information is stored in the processing variables of the B partition, and the subsequent prediction block structure is prepared.
  • mvB is the vector in both directions of the mv of the B partition
  • refIdxB is the reference frame corresponding to the motion vector
  • predListFlagB indicates which component of the list of the motion vector alternatives is currently selected.
  • the method further includes: when the number of candidates in the motion information candidate list is greater than 2, obtaining the motion information corresponding to the first partition from the motion information candidate list. First index information, and second index information corresponding to the second partition motion information; write the first index information and the second index information into the code stream; or, when the motion information candidate list is a candidate When the number of items is equal to 2, obtain the first index information corresponding to the motion information of the first partition or the second index information corresponding to the second partition motion information from the GPM motion information candidate list; One index information or the second index information is written into the code stream.
  • the encoder sends the code stream to the decoder, and the decoder parses the code stream to determine the first index information of the motion information of the first partition in the motion information candidate list, and the second index information of the motion information of the second partition, and further according to the index information Obtain the motion information of each partition from the motion information candidate list established by the decoder.
  • the division information (that is, the angle index information and the step index information) also needs to be written into the code stream during encoding for use during decoding.
  • Step 103 Determine the first prediction value of the first partition of the current block and the second prediction value of the second partition of the current block according to the GPM parameter of the current block;
  • the encoder can divide the current block according to the division information to obtain the first partition and The second partition; from the motion information candidate list, determine the first motion information of the first reference block corresponding to the first partition, and the second motion information of the second reference block corresponding to the second partition; the encoder according to the first partition A motion information is subjected to motion compensation to obtain a first prediction value of the first partition, and the encoder performs motion compensation according to the second motion information to obtain a second prediction value of the second partition.
  • GPM uses the one-way Merge candidate list of the TPM in the original VVC7, that is, from the one-way Merge candidate list, find the respective MVs of the two partitions of the GPM, that is, the motion information , Obtain their respective predicted values according to their respective motion information.
  • the Merge candidate list generally includes a preset number of reference block elements, the preset number can be 6, and each element stores data in the form of a structure, and each structure can include: the reference Motion information of the block, reference frame list, prediction direction, etc.
  • the data corresponding to GPM it is stored in 4 ⁇ 4 blocks.
  • Step 104 Determine the weight index of the pixels in the current block according to the GPM parameter of the current block; wherein, the weight indexes of the pixels determined according to different GPM parameters are not all even numbers;
  • Fig. 9 is a schematic diagram of the prediction process of the GPM mode in an embodiment of the application.
  • the input of the prediction process includes:
  • predListFlagA and predListFlagB are predListFlagA and predListFlagB.
  • xCb and yCb represent the upper left pixel position of the current coding block (Cb)
  • mvA and mvB are the MV of the luminance component
  • mvCA and mvCB are the MV of the chrominance component with 1/32 pixel accuracy.
  • the output of the prediction process in Figure 9 includes: predicted pixel values predSamplesL, predSamplesCb, and predSamplesCr.
  • the intermediate prediction process for input information specifically includes:
  • the GPM mode reuses the existing conventional Merge list and constructs a one-way Merge list belonging to GPM in a parity check.
  • the Merge candidates of the two sub-partitions after GPM division are selected from the one-way Merge candidate list.
  • the reference frame list refPicLN sub-pixel predicted pixel value predSamplesLN for the three components of L, Cb, and Cr, where N is A or B, among L, Cb, and Cr, L is Luma, which means brightness; Cb and Cr are both Chroma, It is the color difference component.
  • This step is the same as the general Inter prediction technique. That is, using the existing motion compensation method, the one-way motion compensation prediction value of each of the two partitions is calculated and configured as the final weighted fusion process of the subsequent GPM.
  • the motion compensation here is the same as the conventional motion compensation process, that is, the pixel value of the corresponding area is found through the motion vector and copied.
  • the encoder determines the partition mode with the least rate-distortion cost by traversing the 64 partition models corresponding to GPM, that is, determines the target partition mode of the current block; the encoder can then preset the partition mode and angle index according to the target partition mode. Based on the mapping table of the step index, the angle index information and the step index information corresponding to the target division mode are determined.
  • the current prediction block is in GPM mode, it will look up the table according to the selected partition mode index merge_gpm_partition_idx of the current block to obtain the corresponding angle angleIdx and step distanceIdx.
  • the mapping table of this partition mode is shown in Table 2:
  • wedge_partition_idx is the partition mode index
  • angleIdx is the angle index information
  • distanceIdx is the step index information.
  • the GPM parameters of the current block include the size information and angle index information of the current block; an embodiment of the present application provides a specific implementation method of step 104, as shown in FIG. 10, the method may include:
  • Step 201 Determine position information of pixels in the current block according to the size information of the current block;
  • the size information of the current block includes the width and height of the current block. Specifically, according to the width and height of the current block, and the angle and step length of the dividing line, determine the offset value (offsetX) of the current block in the horizontal direction and the offset value (offsetY) of the current block in the vertical direction; According to the offsetX and offsetY of the current block and the position information of the pixel in the first coordinate system, the position information of the pixel in the current block in the second coordinate system is determined.
  • Figure 11 is a schematic diagram of the current block division method in an embodiment of the application.
  • the dotted line represents the dividing line.
  • the division mode calculates the offset value (OffsetX, OffsetX) of the upper left corner of the current block corresponding to the origin of the coordinate, and then determines the maximum movement range (112x112) of the largest size block (64x64) relative to the coordinate system. If the dividing line does not pass through the center point of the block, keep the relative position of the dividing line unchanged, and move the position of the block in the coordinate system to obtain a proper division.
  • the first coordinate system is the coordinate system composed of the upper left corner of the current block as the origin of the coordinates, that is, the coordinate system shown on the right in FIG. 11, and the second coordinate system is the coordinate system on the left in FIG. Pass the origin of the coordinate system.
  • the specific determination process of the offset value can be implemented by the following formula (4)-formula (7).
  • the step length used when constructing the predefined weight matrix is only the first step length (that is, the dividing line must intersect the center point of the block).
  • the partFlip value is calculated by the following formula, as shown in the following:
  • partFlip is used to indicate the distribution positions of the A partition and the B partition in the current block.
  • partFlip is 0, which means that the side where the distance between the point and the dividing line weightIdx obtained in the following equation (8) is negative is the A partition, and the opposite side of the dividing line is the B partition; when partFlip is 1, the opposite is true, that is, weightIdx
  • the side with the positive value is the A partition, and the opposite side (ie, the negative side) is the B partition.
  • the key parameter shiftHor is calculated by the following two formulas:
  • shiftHor is the determination of the displacement direction between different dividing lines at the same angle. If its value is 0, the dividing line will be shifted on the Y axis; if its value is 1, the dividing line will be shifted on the X axis.
  • the current block has an offset value related to the height of the current block in the vertical direction at this time, and the offset information at this time is as follows:
  • offsetY ((-nH)>>1)+angleIdx ⁇ 16? (distanceIdx*nH)>>3:-((distanceIdx*nH)>>3) (6)
  • the current block has an offset value related to the width of the current block in the horizontal direction.
  • the offset information at this time is as follows:
  • offsetX ((-nW)>>1)+angleIdx ⁇ 16? (distanceIdx*nW)>>3:-((distanceIdx*nW)>>3)
  • nW the width of the current block
  • nH the height of the current block
  • Step 202 According to the angle index information of the current block, use a preset determination strategy to determine the first cosine value and the first sine value corresponding to the angle index information; wherein, the first cosine value corresponding to the different angle index information The value and the first sine value are not all even numbers;
  • the determining strategy includes obtaining the first cosine value and the first sine value corresponding to the angle index information from a preset angle mapping table, or calculating the first cosine value corresponding to the angle index information according to a preset calculation strategy And the first sine value.
  • three specific implementation manners are respectively given for these two manners.
  • Step 203 Determine the weight index of the pixel in the current block based on the first cosine value and the first sine value in combination with the position information of the pixel in the current block.
  • using a preset determination strategy to determine the first cosine value and the first sine value corresponding to the angle index information includes 6 ways:
  • Manner 1 Determine the cosine angle index information and sine angle index information of the current block according to the angle index information of the current block; obtain the first cosine angle index information from a preset angle mapping table according to the cosine angle index information The sine value; according to the sine angle index information, the first sine value is obtained from a preset angle mapping table; wherein, the first cosine value and the first sine value corresponding to different angle index information in the angle mapping table Not all even numbers.
  • it also includes constructing an angle mapping table.
  • the method of constructing the angle mapping table includes: determining the cosine angle index information and the sine angle index information of the current block according to the angle index information of the current block; and mapping from a preset angle according to the cosine angle index information Obtain the first cosine value from the table; obtain the second cosine value corresponding to the M angle index information according to the M angle index information; where M is an even number; for the M angle index information corresponding to Perform power reduction processing on the second cosine value to obtain the first cosine value corresponding to the M angle index information; use the M angle index information and the corresponding first cosine value to construct the angle mapping table .
  • Table 3 provides an example of an angle mapping table in this embodiment of the application.
  • idx is the angle index information (displacementX and displacementY)
  • disLut[idx] corresponding to idx is the cosine value corresponding to the angle.
  • the displacementX lookup table 3 The first cosine value is obtained, and the second sine value is obtained according to the displacementY look-up table 3.
  • the current block can be calculated according to the position of the pixel point in the current block and the first sine value (disLut[displacementX]) and the first cosine value (disLut[displacementY]) through formula (8)
  • the weight index value at the pixel point (represented by weightIdx), and then the weight value at the current pixel point can be calculated by formulas (9) to (10) to obtain the weight matrix of the current block.
  • weightIdx (((x*subW+offsetX) ⁇ 1)+1)*disLut[displacementX]+(((y*subH+offsetY) ⁇ 1)+1)*disLut[displacementY]. (8)
  • weightIdxL partFlip? 16+weightIdx:16--weightIdx (9)
  • clip3 represents the clamp operator, 0 represents the lower bound value, and 8 represents the upper bound value.
  • clip3(i, j, x) represents: when x is less than i, its value is i; when x is greater than j, its The value is j; when x is greater than or equal to i and less than or equal to j, its value is x.
  • the disLut[] used in equation (8) is shown in Table 4.
  • subW and subH represent the downsampling rate. If the YUV format of the current block is 420 format, both subW and subH can be 2.
  • the disLut[] used is shown in Table 4.
  • subW and subH indicate the downsampling rate, if it is 420 format, both subW and subH are 2.
  • Luminance does not need to be down-sampled, and the chroma weight is obtained by down-sampling the luminance weight, see section S3.2.
  • weightIdxL in formula (9) is the expanded value of the weight index after expanding weightIdx in formula (8), and both can be regarded as weight indexes.
  • the weight index determination method proposed in the embodiments of the present application refers to weightIdx.
  • Table 4 is an example of the existing angle mapping table. Since the cosine values corresponding to the angle index are all even numbers, the weightIdx obtained by formula (8) under any angle index is all even numbers, that is to say, the last bit is always 0. In this case, unnecessary bit overhead is brought.
  • the existing angle mapping table magnifies the value of the cosine value by 8 times, resulting in each cosine value being an even number, and thus all the weight indexes are also even numbers.
  • the angle mapping table is modified, that is, the cosine value in the existing angle mapping table is raised to a power, so that the number of storage bits for each item is reduced from 5 to 4, so that the cosine in the updated angle mapping table
  • the values are not all even numbers, and the value range of the cosine value becomes [-4, -4], which reduces the number of bits in each entry of the angle mapping table from 5 to 4, saving one bit and reducing bit overhead.
  • Step 105 Determine the first weight value and the second weight value of the pixel in the current block based on the weight index of the pixel in the current block;
  • the second weight value is obtained according to the first weight value.
  • the second weight value 1-the first weight value.
  • Step 106 Based on the first predicted value and the first weight value of the pixel in the first partition, and the second predicted value and the second weight value of the pixel in the second partition, compare the first predicted value Performing weighted fusion with the second predicted value to obtain the inter-frame predicted value of the current block.
  • S3.1.2 provides the weighted fusion calculation formula of the luminance prediction value
  • S3.2 is the step of determining the chrominance prediction value.
  • BitDepth represents the bit depth
  • offset1 is used for rounding
  • shift1 is used to restore the weighted average predicted value to the same bit depth as the input video
  • predSamplesLA[x][y] is the first predicted value of the pixel brightness of the A partition
  • PredSamplesLB[x][y] is the second predicted value of the pixel brightness in the B partition
  • the brightness predicted value of the pixel in the current block is obtained by formula (11); and the calculation of offset1 and shift1 is shown in formula (12-13) Show:
  • the weight of the luminance sample in the upper left corner of each 2*2 block in Figure 12a is directly used as the weight of the chrominance sample at the current (x, y), that is, the weight of the luminance sample is down-sampled to obtain the chrominance weight of the current block in Figure 12b. matrix.
  • the calculation of chrominance weighting is also shown in formula (11), according to the first chrominance predicted value and first weight value of pixels in the first partition, and the second chrominance predicted value and first weight value of pixels in the second partition. With two weight values, weighted fusion is performed on the first predicted value and the second predicted value to calculate the chromaticity predicted value of the current block.
  • S4 Store MV information for subsequent prediction of mvN, refidxN, and predListFlagN; that is, after the prediction value of the current block is obtained, the mv information of the current block needs to be stored for subsequent image block prediction mv information.
  • storing the mv information of the current block means storing the mv information of the 4 ⁇ 4 sub-blocks in the current block. To store mv, you must first determine the motion index information of the sub-block, and determine whether the sub-block is a one-way storage based on the motion index information of the sub-block. The mv information is also two-way mv information.
  • FIG. 13 is a schematic flowchart of a method for determining motion index information of a sub-block in a current block in an embodiment of the application. As shown in FIG. 13, the method of determining motion index information of a sub-block in the current block may specifically include:
  • Step 301 Determine the position information of the center pixel of the sub-block in the current block according to the size information of the current block;
  • the size information of the current block includes the width and height of the current block. Specifically, according to the width and height of the current block, and the angle and step length of the dividing line, determine the offset value (offsetX) of the current block in the horizontal direction and the offset value (offsetY) of the current block in the vertical direction; According to the offsetX and offsetY of the current block and the position information of the central pixel of the sub-block in the first coordinate system, the position information of the central pixel of the sub-block in the second coordinate system is determined.
  • the motion mask matrix of the current block is still calculated in the unit of 4 ⁇ 4 sub-blocks.
  • the position information of the center pixel of the sub-block in the current block is the center position of each 4 ⁇ 4 sub-block (4i+2, 4j+2)
  • the calculation of the motion index (motionIdx) at the center position (4i+2, 4j+2) of each 4 ⁇ 4 sub-block is the same as the calculation of the pixel weight index in the current block, that is, as in formula (8) Calculation of weightIdx.
  • Step 302 According to the angle index information of the current block, use a preset determination strategy to determine the first cosine value and the first sine value corresponding to the angle index information; wherein, the first cosine value corresponding to the different angle index information The value and the first sine value are not all even numbers;
  • the cosine angle index information and the sine angle index information of the current block are determined according to the angle index information of the current block; and the first cosine angle index information is obtained from a preset angle mapping table according to the cosine angle index information.
  • the sine value; according to the sine angle index information, the first sine value is obtained from a preset angle mapping table; wherein, the first cosine value and the first sine value corresponding to different angle index information in the angle mapping table Not all even numbers.
  • it also includes constructing an angle mapping table.
  • the method of constructing the angle mapping table includes: determining the cosine angle index information and the sine angle index information of the current block according to the angle index information of the current block; and mapping from a preset angle according to the cosine angle index information Obtain the first cosine value from the table; obtain the second cosine value corresponding to the M angle index information according to the M angle index information; where M is an even number; for the M angle index information corresponding to Perform power reduction processing on the second cosine value to obtain the first cosine value corresponding to the M angle index information; use the M angle index information and the corresponding first cosine value to construct the angle mapping table .
  • Step 303 Based on the first cosine value and the first sine value, respectively combining the position information of the center pixel of the sub-block in the current block to determine the weight index of the center pixel of the sub-block in the current block;
  • Step 304 Use the weight index of the center pixel of the sub-block in the current block as the motion index of the sub-block in the current block;
  • Step 305 Determine the storage type of the motion information of the sub-block in the current block based on the motion index information of the sub-block in the current block; wherein the storage type includes storing one-way motion information or storing two-way motion information.
  • the storage process of motion information (also known as "mv information") is realized by using the motion mask matrix of the current luminance block. If the predicted value is completely from the A partition, the motion vector of the A partition is recorded, which is completely derived from the B partition. , Record the motion vector of the B partition; otherwise, record the motion vectors of the two partitions at the same time.
  • the calculation of the motion mask is basically the same as the process of calculating the brightness weight matrix. First, the offset value offset is calculated. The calculation of the offset is shown in equations (14-15):
  • the offset information at this time is as follows:
  • the offset information at this time is as follows:
  • offsetX ((-cbWidth)>>1)+(angleIdx ⁇ 16?(distanceIdx*cbWidth)>>3:-((distanceIdx*cbWidth)>>3))
  • cbWidth represents the width of the current block
  • cbHeight represents the height of the current block
  • motionIdx (((4*xSbIdx+offsetX) ⁇ 1)+5)*disLut[displacementX]+(((4*ySbIdx+offsetY) ⁇ 1)+5)*disLut[displacementY]
  • (((4*xSbIdx+offsetX) ⁇ 1)+5) is the original abscissa of the center pixel in the sub-block after being enlarged twice
  • (((4*ySbIdx+offsetY) ⁇ 1) +5) is the ordinate that is doubled from the original ordinate of the central pixel in the block
  • disLut[displacementX] is used to obtain the first cosine value from Table 3
  • disLut[displacementY] is used to obtain the value from Table 3.
  • the first sine value. determine the mv information that needs to be stored in the current 4 ⁇ 4 sub-block. As with the prediction weighting, it is necessary to first determine whether the current sub-block is in the A partition or the B partition.
  • (XSbIdx, ySbIdx) represents the sub-block coordinates of each 4 ⁇ 4 sub-block (subblock, sb) in the current CU.
  • the embodiments of the present application also use the aforementioned pre-modified and post-modified inter prediction.
  • sType is obtained according to the size of abs (motionIdx) at the geometric center position (4i+2, 4j+2) of each 4 ⁇ 4 sub-block, and sType is used to determine whether the current sub-block stores one-way mv or two-way mv; specific judgment
  • the process is as follows: if sType is 2, the current sub-block stores the constructed bidirectional MV; otherwise, if sType is 0, the current sub-block stores the MVA of the first partition; if sType is 1, the current sub-block stores the MVB of the second partition .
  • the encoder regards GPM and other inter-frame prediction modes as competing modes, selects between modes according to rate-distortion optimization (RDO) or other strategies, and transmits the selected result to the decoding in the form of syntax elements in the code stream end. That is, the writing operation of the syntax of the coding unit.
  • RDO rate-distortion optimization
  • This process is opposite to the parsing process. First, get the position information of the reference option selected in the merge list for the two partitions A and B of m and n, and then assign the syntax elements according to the following formula.
  • the preset calculation strategy when calculating the weight index of the pixel, can be used to reduce the power of the calculation process of the weight index, so that the weight index is not all even numbers, without changing the basis of the codec performance.
  • a second way of determining the first cosine value and the first sine value is also provided.
  • Manner 2 Determine the cosine angle index information and sine angle index information of the current block according to the angle index information of the current block; obtain the first cosine angle index information from a preset angle mapping table according to the cosine angle index information The sine value; according to the sine angle index information, the first sine value is obtained from a preset angle mapping table; wherein, the first cosine value and the first sine value corresponding to different angle index information in the angle mapping table Not all even numbers.
  • it also includes constructing an angle mapping table.
  • the method of constructing the angle mapping table includes: determining the cosine angle index information and the sine angle index information of the current block according to the angle index information of the current block; and mapping from a preset angle according to the cosine angle index information Obtain the first cosine value from the table; obtain the second cosine value corresponding to the M angle index information according to the M angle index information; where M is an even number; for the M angle index information corresponding to The second cosine value is subjected to power reduction processing to obtain the first cosine value corresponding to the M angle index information; according to the M angle index information and the corresponding first cosine value, from the M angle index information The index information obtains the first cosine value corresponding to the first M/2 angle index information; the first cosine value corresponding to the first M/2 angle index information is used to construct the angle mapping table.
  • the first cosine value corresponding to the angle index information is cyclically distributed according to the preset arrangement order. Therefore, in order to save storage space, the repetitive content in the second half of Table 3 can be omitted, and the first half can be used to push Go to the second half of the content.
  • Table 3 M is 24, and the first 12 sets of mapping relationships in Table 3 are taken to obtain a new angle mapping table (Table 5).
  • (((x*subW+offsetX) ⁇ 1)+1) is the original abscissa of the pixel after being enlarged twice
  • (((y*subH+offsetY) ⁇ 1)+1) is The ordinate after the original ordinate of the pixel is enlarged twice has the same meaning as in formula (8).
  • the motion index of the sub-block in the current block may also be determined based on the updated angle mapping table.
  • formula (16) can be transformed into formula (16-1):
  • the angle mapping table records the cosine value corresponding to 24 angles in 0-360°. Since the value and sign of the cosine value corresponding to each angle in the four quadrants show a certain cyclic law, you can only use The angle cosine value mapping relationship in the two quadrants is used to establish an angle mapping table, and then the angle mapping table is used to derive the angle cosine value mapping relationship in the remaining two quadrants. In this way, the length of the original table 3 is reduced by half, and storage space is saved. Compared with the prior art, the inter-frame prediction effect of the image is completely equivalent.
  • a third way of determining the first cosine value and the first sine value is also provided.
  • Manner 3 Determine the cosine angle index information and sine angle index information of the current block according to the angle index information of the current block; obtain the first cosine angle index information from a preset angle mapping table according to the cosine angle index information The sine value; according to the sine angle index information, the first sine value is obtained from a preset angle mapping table; wherein, the first cosine value and the first sine value corresponding to different angle index information in the angle mapping table Not all even numbers.
  • it also includes constructing an angle mapping table.
  • the first cosine value corresponding to the angle index information is cyclically distributed according to the preset arrangement order, while the absolute value of the first half of Table 3 is symmetrically distributed with the opposite sign. According to this feature, only the first half can be retained.
  • the first 7 items in the build an angle mapping table the first 7 items can be used to push out the rest of the content.
  • weightIdx (((x*subW+offsetX) ⁇ 1)+1)*(displacementX ⁇ 8?disLut[displacementX]:displacementX ⁇ 16?-disLut[16-displacementX]:displacementX ⁇ 24?-disLut[displacementX- 16]:disLut[32-displacementX])+(((y*subH+offsetY) ⁇ 1)+1)*(displacementY ⁇ 8?disLut[displacementY]:displacementY ⁇ 16?-disLut[16-displacementY]: displacementY ⁇ 24?-disLut[displacementY-16]:disLut[32-displacementY]).
  • the motion index of the sub-block in the current block may also be determined based on the updated angle mapping table.
  • motionIdx (((4*xSbIdx+offsetX) ⁇ 1)+5)*(displacementX ⁇ 8?disLut[displacementX]:displacementX ⁇ 16?-disLut[16-displacementX]:displacementX ⁇ 24?-disLut[displacementX- 16]:disLut[32-displacementX])+(((4*ySbIdx+offsetY) ⁇ 1)+5)*(displacementY ⁇ 8?disLut[displacementY]:displacementY ⁇ 16?-disLut[16-displacementY]: displacementY ⁇ 24?-disLut[displacementY-16]:disLut[32-displacementY]) (16-2)
  • the angle mapping table records the cosine value corresponding to 24 angles in 0-360°. Since the value and sign of the cosine value corresponding to each angle in the four quadrants show a certain cyclic law, you can only use The angle cosine value mapping relationship in one of the quadrants is used to establish an angle mapping table, and then the angle mapping table is used to derive the angle cosine value mapping relationship in the remaining three quadrants. In this way, the length of the original table 3 is shortened by a quarter, which saves storage space, and the inter-frame prediction effect of the image is completely equivalent compared with the prior art.
  • the updated angle mapping table is obtained by reducing the power of the angle mapping value in the original angle mapping table, and the weight index corresponding to the angle information is obtained using the updated angle mapping table, so that the weight index is not all even numbers.
  • the weight index corresponding to the angle information is obtained by using part of the angle mapping values in the updated angle mapping table, which further reduces the bit overhead of storing the angle mapping table.
  • the determining the first cosine value and the first sine value corresponding to the angle index information according to the angle index information of the current block using a preset determination strategy includes: according to the current block The first cosine value and the first sine value corresponding to the angle index information are calculated using a preset calculation strategy; wherein, the first cosine value and the second cosine value calculated from different angle index information Not all values are even.
  • the sign of the first cosine value is determined according to the cosine angle index information
  • the absolute value of the first cosine value is calculated according to the cosine angle index information
  • the sign of the first sine value is determined according to the sine angle index information, according to The sine angle index information calculates the absolute value of the first sine value.
  • the sign of the first cosine value is determined according to the sine angle index information, and the absolute value of the first cosine value is calculated according to the cosine angle index information; the sign of the first sine value is determined according to the cosine angle index information, and the sign of the first sine value is determined according to the sine
  • the angle index information calculates the absolute value of the first sine value.
  • a fourth way of determining the first cosine value and the first sine value is also provided.
  • Manner 4 According to the angle index information of the current block, the first calculation strategy is adopted and the preset calculation strategy is adopted to calculate the first cosine value and the first sine value corresponding to the angle index information; wherein, different angle index information The calculated first cosine value and second cosine value are not all even numbers.
  • Formula (8-3) is to determine the sign of the first cosine value according to the cosine angle index information, and calculate the absolute value of the first cosine value according to the cosine angle index information; determine the positive or negative of the first cosine value according to the sine angle index information Negative sign, calculate the absolute value of the first sine value according to the sine angle index information.
  • formula (8-3) is formula (8-4), and formula (8-4) is specifically:
  • the motion index of the sub-block in the current block may also be determined based on the updated angle mapping table.
  • formula (16-3) is formula (16-4), and formula (16-4) is specifically:
  • a fifth method for determining the first cosine value and the first sine value is also provided.
  • Manner 5 According to the angle index information of the current block, a second calculation strategy is adopted and a preset calculation strategy is used to calculate the first cosine value and the first sine value corresponding to the angle index information; wherein, different angle index information The calculated first cosine value and second cosine value are not all even numbers.
  • method 5 also removes the angle mapping table, and uses a different calculation strategy from method 4 to calculate the first cosine value and the first sine value corresponding to the angle index information.
  • Formula (8) can be transformed into formula (8-5) And formula (8-6):
  • formula (8-5) is formula (8-6), and formula (8-6) is specifically:
  • the motion index of the sub-block in the current block may also be determined based on the updated angle mapping table.
  • formula (16-5) is formula (16-6), and formula (16-6) is specifically:
  • a sixth way of determining the first cosine value and the first sine value is also provided.
  • Manner 6 According to the angle index information of the current block, a third calculation strategy is adopted and a preset calculation strategy is used to calculate the first cosine value and the first sine value corresponding to the angle index information; wherein, different angle index information The calculated first cosine value and second cosine value are not all even numbers.
  • the angle mapping table is also removed in the sixth mode, and the first cosine value and the first sine value corresponding to the angle index information are calculated using a calculation strategy different from the method four and the fifth method.
  • the formula (8) can be transformed into the formula (8). -7), formula (8-8) and formula (8-9):
  • weightIdx (((x*subW+offsetX) ⁇ 1)+1)*(((distancementX>8&&distancementX ⁇ 24)?(-1):1)*((abs((displacementX%16)-8)+ 1)>>1))+(((y*subH+offsetY) ⁇ 1)+1)*(((distancementY>8&&distancementY ⁇ 24) ⁇ 16?(-1):1)*((abs(( displacementY%16)-8)+1)>>1)).
  • formula (8-7) is formula (8-8), and formula (8-8) is specifically:
  • formula (8-7) is formula (8-9), and formula (8-9) is specifically:
  • weightIdx (((x*subW+offsetX) ⁇ 1)+1)*((displacementY&0x10)?(-1):1)*((displacementX&0x08)?(( ⁇ (displacementX&0x07)+2)>>1) :(((displacementX&0x07)+1)>>1))+(((y*subH+offsetY) ⁇ 1)+1)*((displacementX&0x10?1:(-1))*((displacementY&0x08)?( ( ⁇ (displacementY&0x07)+2)>>1):(((displacementY&0x07)+1)>>1)).
  • the value of the first cosine value Values include 4, 3, 2, 1, 0.
  • the motion index of the sub-block in the current block may also be determined based on the updated angle mapping table.
  • method 6 also removes the angle mapping table, and calculates the first cosine value and the first sine value corresponding to the angle index information by using a different calculation strategy from the method 4 and method 5.
  • Formula (16) can be transformed into formula (16 -7), formula (16-8) and formula (16-9):
  • motionIdx (((4*xSbIdx+offsetX) ⁇ 1)+5)*(((distancementX>8&&distancementX ⁇ 24)?(-1):1)*((abs((displacementX%16)-8)+ 1)>>1))+(((4*ySbIdx+offsetY) ⁇ 1)+1)*(((distancementY>8&&distancementY ⁇ 24) ⁇ 16?(-1):1)* ((abs(( displacementY%16)-8)+1)>>1)) (16-7)
  • formula (16-7) is formula (16-8), and formula (16-8) is specifically:
  • formula (16-7) is formula (16-9), and formula (16-9) is specifically:
  • motionIdx (((4*xSbIdx+offsetX) ⁇ 1)+5)*((displacementY&0x10)?(-1):1)*((displacementX&0x08)?(( ⁇ (displacementX&0x07)+2)>>1) :(((displacementX&0x07)+1)>>1))+(((4*ySbIdx+offsetY)*((displacementX&0x10?1:(-1))*((displacementY&0x08)?(( ⁇ (displacementY&0x07)+2 )>>1):(((displacementY&0x07)+1)>>1)).
  • the value of the first cosine value Values include 4, 3, 2, 1, 0.
  • mapping relationship between the angle index information and the first cosine value and the first sine value obtained through the third calculation strategy in the sixth manner is equivalent to the mapping relationship in Table 7.
  • the step of constructing the angle mapping table is removed, and the weight index corresponding to the angle information is directly calculated, so that the weight index is not all even numbers, and the weight index bit can be reduced without changing the codec performance.
  • the overhead and the bit overhead of storing the angle mapping table improve storage efficiency.
  • This application simplifies the calculation of the weight value calculation, and performs exponentiation processing on the items in the original angle mapping table (ie, Table 4), which reduces the number of bits required for the storage of the intermediate calculation amount. It can be seen from Table 7 that each entry in the angle mapping table is reduced by one bit, the weight index weightIdx is reduced by one bit, the weight index expansion value weightIdxL is reduced by one bit, and the motion index information motionIdx is also reduced by one bit.
  • FIG. 14 is a schematic diagram of the second process of the intra prediction method provided by an embodiment of the application, which is applied to a decoder. As shown in FIG. 14, the method includes:
  • Step 401 Parse the code stream and determine the prediction mode parameters of the current block
  • Step 402 When the prediction mode parameter indicates that the geometric partition prediction mode GPM is used to determine the inter prediction value of the current block, determine the GPM parameter of the current block;
  • Step 403 Determine the first prediction value of the first partition of the current block and the second prediction value of the second partition of the current block according to the GPM parameter of the current block;
  • Step 404 Determine the weight index of the pixel in the current block according to the GPM parameter of the current block; wherein, the weight index of the pixel determined according to different GPM parameters is not all even numbers;
  • Step 405 Determine the first weight value and the second weight value of the pixel in the current block based on the weight index of the pixel in the current block;
  • Step 406 Based on the first predicted value and the first weight value of the pixel in the first partition, and the second predicted value and the second weight value of the pixel in the second partition, perform the calculation on the first predicted value and the second predicted value. Weighted fusion to obtain the inter-frame prediction value of the current block.
  • the GPM parameter of the current block when the prediction mode parameter indicates that the GPM is used to determine the inter-frame prediction of the current block, the GPM parameter of the current block can be obtained or determined.
  • the GPM parameter of the current block includes: angle index information of the current block dividing line and size information of the current block, and may also include: step index information of the current block dividing line, and so on.
  • the decoder parses the code stream to obtain information such as the angle index information of the current block dividing line, compensation information, and size information of the current block.
  • the GPM parameter of the current block includes the size information and angle index information of the current block; determining the weight index of the pixels in the current block according to the GPM parameter of the current block includes: determining the current block size information according to the current block size information The position information of the pixel points in the block; according to the angle index information of the current block, a preset determination strategy is adopted to determine the first cosine value and the first sine value corresponding to the angle index information; among them, the first cosine value corresponding to the different angle index information The sine value and the first sine value are not all even numbers; based on the first cosine value and the first sine value, the weight index of the pixel in the current block is determined by combining the position information of the pixel in the current block.
  • determining the first cosine value and the first sine value corresponding to the angle index information according to the angle index information of the current block using a preset determination strategy includes: determining the current block according to the angle index information of the current block Obtain the first cosine value from the preset angle mapping table according to the cosine angle index information; Obtain the first cosine value from the preset angle mapping table according to the sine angle index information; Wherein, the first cosine value and the first sine value corresponding to different angle index information in the angle mapping table are not all even numbers.
  • the method before obtaining the first cosine value from the preset angle mapping table according to the cosine angle index information, the method further includes: obtaining the second cosine corresponding to the M angle index information according to the M angle index information Value; where M is an even number; the second cosine value corresponding to the M angle index information is reduced to the power to obtain the first cosine value corresponding to the M angle index information; the M angle index information and its corresponding The first cosine value is used to construct the angle mapping table.
  • the first cosine values corresponding to the M angle index information are cyclically distributed according to a preset arrangement order; using the M angle index information and the corresponding first cosine values to construct the angle mapping table includes: M angle index information and the corresponding first cosine value, obtain the first cosine value corresponding to the first M/2 angle index information from the M angle index information; use the first M/2 angle index information and its corresponding The first cosine value of, constructs the angle mapping table.
  • the first cosine values corresponding to the M angle index information are cyclically distributed according to a preset arrangement order; using the M angle index information and the corresponding first cosine values to construct the angle mapping table includes: M angle index information and the corresponding first cosine value, obtain the first cosine value corresponding to the first M/4+1 angle index information from the M angle index information; use the first front M/4+1 angle The index information and its corresponding first cosine value are used to construct an angle mapping table.
  • using a preset determination strategy to determine the first cosine value and the first sine value corresponding to the angle index information includes: adopting the preset value according to the angle index information of the current block
  • the first cosine value and the first sine value corresponding to the angle index information are calculated by the calculation strategy of, wherein, the first cosine value and the second cosine value calculated by different angle index information are not all even numbers.
  • the sign of the first cosine value is determined according to the cosine angle index information
  • the absolute value of the first cosine value is calculated according to the cosine angle index information
  • the sign of the first sine value is determined according to the sine angle index information, according to The sine angle index information calculates the absolute value of the first sine value.
  • the sign of the first cosine value is determined according to the sine angle index information, and the absolute value of the first cosine value is calculated according to the cosine angle index information; the sign of the first sine value is determined according to the cosine angle index information, and the sign of the first sine value is determined according to the sine
  • the angle index information calculates the absolute value of the first sine value.
  • the GPM parameter of the current block includes the size information and angle index information of the current block; determining the weight index of the pixels in the current block according to the GPM parameter of the current block includes: determining the current block size information according to the current block size information The position information of the center pixel of the sub-block in the block; according to the angle index information of the current block, the preset determination strategy is adopted to determine the first cosine value and the first sine value corresponding to the angle index information; among them, the first cosine value and the first sine value corresponding to the different angle index information The first cosine value and the first sine value are not all even numbers; based on the first cosine value and the first sine value, respectively combining the position information of the center pixel of the sub-block in the current block to determine the weight index of the center pixel of the sub-block in the current block; The method further includes: taking the weight index of the center pixel of the sub-block in the current block as the motion index of the sub-block in the current block;
  • using a preset determination strategy to determine the first cosine value and the first sine value corresponding to the angle index information includes 6 ways:
  • the first cosine value and the first sine value of the weight index information are obtained according to the pre-built angle mapping table.
  • the three angle mapping table construction methods are specifically given, which have been described in detail on the encoder side. No longer.
  • the embodiment of the application also provides three first cosine values and first sine values corresponding to the angle index information calculated according to the calculation strategy.
  • the specific first calculation strategy, the second calculation strategy and the third calculation strategy are in the coding
  • the device side has been elaborated in detail and will not be repeated here.
  • the method further includes constructing a motion information candidate list, analyzing the code stream, and determining the first index information corresponding to the motion information of the first partition of the current block in the motion information candidate list, and the motion information corresponding to the second partition of the current block. Based on the first index information, obtain the motion information of the first partition from the motion information candidate list; based on the second index information, obtain the motion information of the second partition from the motion information candidate list; use the first partition Calculate the first predicted value of the first partition using the motion information of the second partition, calculate the second predicted value of the second partition using the motion information of the second partition; perform weighted fusion on the first predicted value and the second predicted value to obtain the interframe of the current block Predictive value.
  • the code stream is parsed, and when the number of candidates in the motion information candidate list is greater than 2, the first index information corresponding to the motion information of the first partition and the second index corresponding to the motion information of the second partition are obtained from the motion information candidate list. information;
  • the first index information corresponding to the motion information of the first partition or the second index information corresponding to the second partition motion information is obtained from the motion information candidate list.
  • the decoder can multiply the first predicted value of each pixel by the first weight value, and add the product of the second predicted value and the second weight value of each pixel to complete
  • the weighted fusion of pixels in the current block obtains the inter-frame prediction value of the current block.
  • the decoder parses the code stream to obtain the first index information of the first partition and the second index information of the second partition, and then determines the motion information of the respective partition from the motion information candidate list established by the decoder according to the index information.
  • the method of the decoder side to check and remove duplicates of the merge list to construct the motion information candidate list is the same as that of the decoder side, and other inter-frame prediction processes at the decoder side are the same as those on the encoder side, and will not be repeated here.
  • the preset calculation strategy can be used to reduce the power of the calculation process of the weight index, so that the weight index is not all Even numbers, on the basis of not changing the codec performance, solves the problem of redundant bits in the intermediate index data in the weight calculation process in the original scheme, which can reduce bit overhead and improve storage efficiency.
  • FIG. 15 is a schematic diagram of the first composition structure of the encoder in an embodiment of the present application.
  • the encoder 50 includes:
  • the determining unit 501 is configured to determine the prediction mode parameter of the current block
  • the first processing unit 502 is configured to determine the GPM parameter of the current block when the prediction mode parameter indicates that the geometric partition prediction mode GPM is used to determine the inter prediction value of the current block; determine the first partition of the current block according to the GPM parameter of the current block The first predicted value of and the second predicted value of the second partition of the current block;
  • the first processing unit 502 is further configured to determine the weight index of pixels in the current block according to the GPM parameters of the current block; wherein, the weight indexes of pixels determined according to different GPM parameters are not all even numbers; The weight index determines the first weight value and the second weight value of the pixels in the current block;
  • the first prediction unit 503 is configured to compare the first prediction value and the first weight value of the pixel in the first partition, and the second prediction value and the second weight value of the pixel in the second partition.
  • the second prediction value is weighted and fused to obtain the inter-frame prediction value of the current block.
  • the GPM parameter of the current block includes size information and angle index information of the current block
  • the first processing unit 502 is specifically configured to determine the position information of the pixels in the current block according to the size information of the current block; according to the angle index information of the current block, use a preset determination strategy to determine the first cosine corresponding to the angle index information
  • the first processing unit 502 is specifically configured to determine the cosine angle index information and the sine angle index information of the current block according to the angle index information of the current block; Obtain the first cosine value from the mapping table; obtain the first sine value from the preset angle mapping table according to the sine angle index information; among them, the first cosine value and the first sine corresponding to the different angle index information in the angle mapping table Not all values are even.
  • the first processing unit 502 is specifically configured to obtain the second cosine value corresponding to the M angle index information according to the M angle index information; where M is an even number; and index the M angle indexes
  • the second cosine value corresponding to the information is subjected to power reduction processing to obtain the first cosine value corresponding to the M angle index information;
  • the angle mapping table is constructed by using the M angle index information and the corresponding first cosine value.
  • the first cosine values corresponding to the M angle index information are cyclically distributed according to a preset arrangement sequence
  • the first processing unit 502 is specifically configured to obtain the first cosine value corresponding to the first M/2 angle index information from the M angle index information according to the M angle index information and the corresponding first cosine value; M/2 angle index information and the corresponding first cosine value are used to construct an angle mapping table.
  • the first cosine values corresponding to the M angle index information are cyclically distributed according to a preset arrangement sequence
  • the first processing unit 502 is specifically configured to obtain the first cosine value corresponding to the first M/4+1 angle index information from the M angle index information according to the M angle index information and the corresponding first cosine value; Using the previous M/4+1 angle index information and the corresponding first cosine value, the angle mapping table is constructed.
  • the first processing unit 502 is specifically configured to use a preset calculation strategy to calculate the first cosine value and the first sine value corresponding to the angle index information according to the angle index information of the current block; Wherein, the first cosine value and the second cosine value calculated from different angle index information are not all even numbers.
  • the GPM parameter of the current block includes size information and angle index information of the current block
  • the first processing unit 502 is specifically configured to determine the position information of the center pixel of the sub-block in the current block according to the size information of the current block; according to the angle index information of the current block, use a preset determination strategy to determine the first angle index information corresponding to the first Cosine value and first sine value; among them, the first cosine value and first sine value corresponding to different angle index information are not all even numbers; based on the first cosine value and first sine value, combined with the sub-block center in the current block respectively The position information of the pixel points to determine the weight index of the center pixel point of the sub-block in the current block;
  • the first processing unit 502 is further configured to use the weight index of the center pixel of the sub-block in the current block as the motion index of the sub-block in the current block; determine the storage type of the motion information of the sub-block in the current block based on the motion index information of the sub-block in the current block ; Among them, the storage type includes storing one-way motion information or storing two-way motion information.
  • the encoder 50 further includes a writing unit configured to write the angle index information of the current block into the code stream.
  • FIG. 16 is a schematic diagram of the second composition structure of the encoder in the embodiment of the present application.
  • the encoder 50 includes:
  • the preset calculation strategy can be used to reduce the power of the calculation process of the weight index, so that the weight index is not all Even numbers, on the basis of not changing the codec performance, solves the problem of redundant bits in the intermediate index data in the weight calculation process in the original scheme, which can reduce bit overhead and improve storage efficiency.
  • FIG. 17 is a schematic diagram of the first composition structure of the decoder in an embodiment of the present application.
  • the decoder 60 includes:
  • the parsing unit 601 is configured to parse the code stream and determine the prediction mode parameter of the current block
  • the second processing unit 602 is configured to determine the GPM parameter of the current block when the prediction mode parameter indicates that the geometric partition prediction mode GPM is used to determine the inter prediction value of the current block; determine the first partition of the current block according to the GPM parameter of the current block The first predicted value of and the second predicted value of the second partition of the current block;
  • the second processing unit 602 is further configured to determine the weight index of pixels in the current block according to the GPM parameters of the current block; wherein, the weight indexes of pixels determined according to different GPM parameters are not all even numbers; The weight index determines the first weight value and the second weight value of the pixels in the current block;
  • the second prediction unit 603 is further configured to determine the first prediction value based on the first prediction value and the first weight value of the pixel in the first partition, and the second prediction value and the second weight value of the pixel in the second partition. Perform weighted fusion with the second predicted value to obtain the inter-frame predicted value of the current block.
  • the GPM parameter of the current block includes size information and angle index information of the current block
  • the second processing unit 602 is specifically configured to determine the position information of pixels in the current block according to the size information of the current block; according to the angle index information of the current block, use a preset determination strategy to determine the first cosine corresponding to the angle index information
  • the second processing unit 602 is specifically configured to determine the cosine angle index information and the sine angle index information of the current block according to the angle index information of the current block; Obtain the first cosine value from the mapping table; obtain the first sine value from the preset angle mapping table according to the sine angle index information; among them, the first cosine value and the first sine corresponding to the different angle index information in the angle mapping table Not all values are even.
  • the second processing unit 602 is specifically configured to obtain the second cosine value corresponding to the M angle index information according to the M angle index information; where M is an even number; and index the M angle indexes
  • the second cosine value corresponding to the information is subjected to power reduction processing to obtain the first cosine value corresponding to the M angle index information; the angle mapping table is constructed by using the M angle index information and the corresponding first cosine value.
  • the first cosine values corresponding to the M angle index information are cyclically distributed according to a preset arrangement sequence
  • the second processing unit 602 is specifically configured to obtain the first cosine value corresponding to the first M/2 angle index information from the M angle index information according to the M angle index information and the corresponding first cosine value; M/2 angle index information and the corresponding first cosine value are used to construct an angle mapping table.
  • the first cosine values corresponding to the M angle index information are cyclically distributed according to a preset arrangement sequence
  • the second processing unit 602 is specifically configured to obtain the first cosine value corresponding to the first M/4+1 angle index information from the M angle index information according to the M angle index information and the corresponding first cosine value; Using the previous M/4+1 angle index information and the corresponding first cosine value, the angle mapping table is constructed.
  • the second processing unit 602 is specifically configured to use a preset calculation strategy to calculate the first cosine value and the first sine value corresponding to the angle index information according to the angle index information of the current block; Wherein, the first cosine value and the second cosine value calculated from different angle index information are not all even numbers.
  • the GPM parameter of the current block includes size information and angle index information of the current block
  • the second processing unit 602 is specifically configured to determine the position information of the central pixel of the sub-block in the current block according to the size information of the current block; according to the angle index information of the current block, use a preset determination strategy to determine the first angle index information corresponding to the first Cosine value and first sine value; among them, the first cosine value and first sine value corresponding to different angle index information are not all even numbers; based on the first cosine value and first sine value, combined with the sub-block center in the current block respectively The position information of the pixel points to determine the weight index of the center pixel point of the sub-block in the current block;
  • the second processing unit 602 is further configured to use the weight index of the center pixel of the sub-block in the current block as the motion index of the sub-block in the current block; determine the storage type of the motion information of the sub-block in the current block based on the motion index information of the sub-block in the current block ; Among them, the storage type includes storing one-way motion information or storing two-way motion information.
  • FIG. 18 is a schematic diagram of the second composition structure of the decoder in the embodiment of the present application.
  • the decoder 60 includes:
  • the preset calculation strategy can be used to reduce the power of the calculation process of the weight index, so that the obtained weight index is incomplete. It is an even number.
  • the problem of redundant bits in the intermediate index data in the weight calculation process in the original scheme is solved, which can reduce bit overhead and improve storage efficiency.
  • the functional modules in this embodiment may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated unit can be realized in the form of hardware or software function module.
  • an embodiment of the present application provides a storage medium on which a computer program is stored.
  • the computer program is executed by the first processor, the inter-frame prediction method of the encoder is implemented; or, the computer program is processed by the second processor.
  • the decoder is executed, the inter-frame prediction method of the decoder is realized.
  • the prediction mode parameter of the current block is determined; when the prediction mode parameter indicates that the current block uses GPM to determine the inter prediction value, the GPM parameter of the current block is determined; the GPM parameter of the current block is determined according to the GPM parameter of the current block.
  • the first predicted value of the partition and the second predicted value of the second partition of the current block determine the weight index of the pixel in the current block according to the GPM parameter of the current block; wherein the weight index of the pixel determined according to different GPM parameters is not complete Is an even number; based on the weight index of the pixel in the current block, determine the first weight value and the second weight value of the pixel in the current block; based on the first predicted value and the first weight value of the pixel in the first partition, and the first The second predicted value and the second weight value of the pixel in the second partition are weighted and merged on the first predicted value and the second predicted value to obtain the inter-frame predicted value of the current block.
  • the preset calculation strategy when calculating the weight index of the pixel, can be used to reduce the power of the calculation process of the weight index, so that the weight index is not all even numbers. On the basis of not changing the codec performance, it can be Reduce weight index bit overhead and improve storage efficiency.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

本申请实施例提供了一种帧间预测方法、编码器、解码器及存储介质,包括:确定当前块的预测模式参数;当预测模式参数指示当前块使用GPM确定帧间预测值时,确定当前块的GPM参数;根据当前块的GPM参数,确定第一预测值和第二预测值;根据当前块的GPM参数,采用预设的计算策略确定当前块内像素点的权重索引;其中,根据不同GPM参数确定的像素点的权重索引不全为偶数;基于当前块内像素点的权重索引,确定第一权重值和第二权重值;最后通过加权融合得到当前块的帧间预测值。这样,在计算像素点的权重索引时对权重索引的计算过程进行降幂处理,使得到的权重索引不全为偶数,在不改变编解码性能的基础上,能够减少权重索引比特开销,提高存储效率。

Description

一种帧间预测方法、编码器、解码器及存储介质
相关申请的交叉引用
本申请基于申请号为202010270775.6、申请日为2020年04月08日、发明创造名称为“一种帧间预测方法、编码器、解码器及存储介质”的在先中国专利申请提出,并要求该在先中国专利申请的优先权,该在先中国专利申请的全部内容在此以全文引入的方式引入本申请作为参考。
技术领域
本申请实施例涉及视频图像处理技术,涉及但不限于帧间预测方法、编码器、解码器及存储介质。
背景技术
在视频编解码,对当前块进行编解码的过程中,除了有帧内预测外,还可以采用帧间预测方式。帧间预测可以包括运动估计和运动补偿,针对运动补偿在多功能视频编码(Versatile Video Coding,VVC)的制定过程中,引入了正方形和矩形之外的其他形状划分。首先是三角形划分模式(Triangular partition Mode,TPM)的引入,以一个正方形或矩形的对角线、或反对角线为分割线,得到三角形的预测单元,从而更灵活的表示帧间预测数据,降低预测误差,从而提高编码效率。
在联合视频专家组(Joint Video Experts Team,JVET)会议中,引入了一种比TPM更为灵活的帧间几何划分预测模式(Geometrical partition Mode,GPM),GPM的帧间预测过程中,在计算像素点的权重索引值时需要用到角度映射表,而角度映射表中所有角度映射值全部为偶数,从而导致像素点的权重索引值也全部为偶数,也就是说所有像素点的权重索引值最后一个比特始终为0,这个情况下带来没有必要的比特开销,从而使得帧间预测时的数据的存储开销较大,文本和代码比较复杂。
发明内容
本申请实施例提供了一种帧间预测方法、编码器、解码器及存储介质,能够提高运动信息的表达效率,并提高视频编码和解码效率。
第一方面,本申请实施例提供了一种帧间预测方法,应用于编码器,所述方法包括:
确定当前块的预测模式参数;
当所述预测模式参数指示使用几何划分预测模式GPM确定所述当前块的帧间预测值时,确定所述当前块的GPM参数;
根据所述当前块的GPM参数,确定所述当前块的第一分区的第一预测值和所述当前块的第二分区的第二预测值;
根据所述当前块的GPM参数,确定所述当前块内像素点的权重索引;其中,根据不同GPM参数确定的像素点的权重索引不全为偶数;
基于所述当前块内像素点的权重索引,确定所述当前块内像素点的第一权重值和第二权重值;
基于所述第一分区内像素点的第一预测值和第一权重值,以及所述第二分区内像素点的第二预测值和第二权重值,对所述第一预测值和所述第二预测值进行加权融合,得到所述当前块的帧间预测值。
第二方面,本申请实施例提供了一种帧间预测方法,应用于解码器,所述方法包括:
解析码流,确定当前块的预测模式参数;
当所述预测模式参数指示使用几何划分预测模式GPM确定所述当前块的帧间预测值时,确定所述当前块的GPM参数;
根据所述当前块的GPM参数,确定所述当前块的第一分区的第一预测值和所述当前块的第二分区的第二预测值;
根据所述当前块的GPM参数,确定所述当前块内像素点的权重索引;其中,根据不同GPM参数确定的像素点的权重索引不全为偶数;
基于所述当前块内像素点的权重索引,确定所述当前块内像素点的第一权重值和第二权重值;
基于所述第一分区内像素点的第一预测值和第一权重值,以及所述第二分区内像素点的第二预测值和第二权重值,对所述第一预测值和所述第二预测值进行加权融合,得到所述当前块的帧间预测值。
第三方面,本申请实施例提供了一种编码器,包括:
确定单元,配置为确定当前块的预测模式参数;
第一处理单元,配置为当所述预测模式参数指示使用几何划分预测模式GPM确定所述当前块的帧间预测值时,确定所述当前块的GPM参数;根据所述当前块的GPM参数,确定所述当前块的第一分区的第一预测值和所述当前块的第二分区的第二预测值;
所述第一处理单元,还用于根据所述当前块的GPM参数,确定所述当前块内像素点的权重索引;其中,根据不同GPM参数确定的像素点的权重索引不全为偶数;基于所述当前块内像素点的权重索引,确定所述当前块内像素点 的第一权重值和第二权重值;
第一预测单元,配置为基于所述第一分区内像素点的第一预测值和第一权重值,以及所述第二分区内像素点的第二预测值和第二权重值,对所述第一预测值和所述第二预测值进行加权融合,得到所述当前块的帧间预测值。
第四方面,本申请实施例提供了一种解码器,包括:
解析单元,配置为解析码流,确定当前块的预测模式参数;
第二处理单元,配置为当所述预测模式参数指示使用几何划分预测模式GPM确定所述当前块的帧间预测值时,确定所述当前块的GPM参数;根据所述当前块的GPM参数,确定所述当前块的第一分区的第一预测值和所述当前块的第二分区的第二预测值;
所述第二处理单元,还用于根据所述当前块的GPM参数,确定所述当前块内像素点的权重索引;其中,根据不同GPM参数确定的像素点的权重索引不全为偶数;基于所述当前块内像素点的权重索引,确定所述当前块内像素点的第一权重值和第二权重值;
第二预测单元,还用于基于所述第一分区内像素点的第一预测值和第一权重值,以及所述第二分区内像素点的第二预测值和第二权重值,对所述第一预测值和所述第二预测值进行加权融合,得到所述当前块的帧间预测值。
第五方面,本申请实施例还提供了一种编码器,包括:第一存储器和第一处理器;所述第一存储器存储有可在第一处理器上运行的计算机程序,所述第一处理器执行所述程序时实现编码器的所述帧间预测方法。
第六方面,本申请实施例还提供了一种解码器,包括:第二存储器和第二处理器;所述第二存储器存储有可在第二处理器上运行的计算机程序,所述第二处理器执行所述程序时实现解码器的所述帧间预测方法。
第七方面,本申请实施例提供了一种存储介质,包括:其上存储有计算机程序,该计算机程序被第一处理器执行时,实现编码器的所述帧间预测方法;或者,该计算机程序被第二处理器执行时,实现解码器的所述帧间预测方法。
本申请实施例提供了一种帧间预测方法、编码器、解码器及存储介质,包括:确定当前块的预测模式参数;当所述预测模式参数指示使用几何划分预测模式GPM确定所述当前块的帧间预测值时,确定所述当前块的GPM参数;根据所述当前块的GPM参数,确定所述当前块的第一分区的第一预测值和所述当前块的第二分区的第二预测值;根据所述当前块的GPM参数,确定所述当前块内像素点的权重索引;其中,根据不同GPM参数确定的像素点的权重索引不全为偶数;基于所述当前块内像素点的权重索引,确定所述当前块内像素点的第一权重值和第二权重值;基于所述第一分区内像素点的第一预测值和第一权重值,以及所述第二分区内像素点的第二预测值和第二权重值,对所述第一预测值和所述第二预测值进行加权融合,得到所述当前块的帧间预测值。这样,在计算像素点的权重索引时,采用预设的计算策略可以实现对权重索引的计算过程进行降幂处理,使得到的权重索引不全为偶数,在不改变编解码性能的基础上,解决了原有方案中计算权重过程中中间索引数据带有冗余比特的问题,能够减少比特开销,提高存储效率。
附图说明
图1为本申请实施例提供的一种视频编码系统的组成框图示意图;
图2为本申请实施例提供的一种视频解码系统的组成框图示意图;
图3为本申请实施例提供的帧内预测方法的第一流程示意图;
图4a-4b为TPM模式两种划分示意图;
图5a-5g为GPM模式的7种划分示意图;
图6为本申请实施例提供的示例性当前块的角度和步长的示意图;
图7为本申请实施例中空间merge候选列表的相邻块位置示意图;
图8为本申请实施例中merge候选列表的组成结构示意图;
图9为本申请实施例中GPM模式预测流程示意图;
图10为本申请实施例中权重索引的确定流程示意图;
图11为本申请实施例中当前块的划分方式示意图;
图12a为本申请实施例提供的示例性的亮度的权重值的示意图;
图12b为本申请实施例提供的示例性的色度的权重值的示意图;
图13为本申请实施例中当前块内子块的运动索引信息确定方法的流程示意图;
图14为本申请实施例提供的帧内预测方法的第二流程示意图;
图15为本申请实施例中编码器的第一组成结构示意图;
图16为本申请实施例中编码器的第二组成结构示意图;
图17为本申请实施例中解码器的第一组成结构示意图;
图18为本申请实施例中解码器的第二组成结构示意图。
具体实施方式
为了能够更加详尽地了解本申请实施例的特点与技术内容,下面结合附图对本申请实施例的实现进行详细阐述,所附附图仅供参考说明之用,并非用来限定本申请实施例。
本申请提供一种视频编码系统,如图1所示,该视频编码系统11包括:变换单元111、量化单元112、模式选择和编码控制逻辑单元113、帧内预测单元114、帧间预测单元115(包括:运动补偿和运动估计)、反量化单元116、 反变换单元117、环路滤波单元118、编码单元119和解码图像缓存单元110;针对输入的原始视频信号,通过编码树块(Coding Tree Unit,CTU)的划分可以得到一个视频重建块,通过模式选择和编码控制逻辑单元113确定编码模式,然后,对经过帧内或帧间预测后得到的残差像素信息,通过变换单元111、量化单元112对该视频重建块进行变换,包括将残差信息从像素域变换到变换域,并对所得的变换系数进行量化,用以进一步减少比特率;帧内预测单元114用于对该视频重建块进行帧内预测;其中,帧内预测单元114用于确定该视频重建块的最优帧内预测模式(即目标预测模式);帧间预测单元115用于执行所接收的视频重建块相对于一或多个参考帧中的一或多个块的帧间预测编码,以提供时间预测信息;其中吗,运动估计为产生运动向量的过程,所述运动向量可以估计该视频重建块的运动,然后,运动补偿基于由运动估计所确定的运动向量执行运动补偿;在确定帧间预测模式之后,帧间预测单元115还用于将所选择的帧间预测数据提供到编码单元119,而且,将所计算确定的运动向量数据也发送到编码单元119;此外,反量化单元116和反变换单元117用于该视频重建块的重构建,在像素域中重构建残差块,该重构建残差块通过环路滤波单元118去除方块效应伪影,然后,将该重构残差块添加到解码图像缓存单元111的帧中的一个预测性块,用以产生经重构建的视频重建块;编码单元119是用于编码各种编码参数及量化后的变换系数。而解码图像缓存单元110用于存放重构建的视频重建块,配置为预测参考。随着视频图像编码的进行,会不断生成新的重构建的视频重建块,这些重构建的视频重建块都会被存放在解码图像缓存单元110中。
本申请实施例提供一种视频解码系统,图2为本申请实施例视频编码系统的组成结构示意图,如图2所示,该视频编码系统21包括:解码单元211、反变换单元217,与反量化单元212、帧内预测单元213、运动补偿单元214、环路滤波单元215和解码图像缓存单元216单元;输入的视频信号经过视频编码系统11进行编码处理之后,输出该视频信号的码流;该码流输入视频解码系统21中,首先经过解码单元211,配置为得到解码后的变换系数;针对该变换系数通过反变换单元217与反量化单元212进行处理,以便在像素域中产生残差块;帧内预测单元213可用于基于所确定的帧内预测方向和来自当前帧或图片的先前经解码块的数据而产生当前视频解码块的预测数据;运动补偿单元214是通过剖析运动向量和其他关联语法元素来确定用于视频解码块的预测信息,并使用该预测信息以产生正被解码的视频解码块的预测性块;通过对来自反变换单元217与反量化单元212的残差块与由帧内预测单元213或运动补偿单元214产生的对应预测性块进行求和,而形成解码的视频块;该解码的视频信号通过环路滤波单元215以便去除方块效应伪影,可以改善视频质量;然后将经解码的视频块存储于解码图像缓存单元216中,解码图像缓存单元216存储用于后续帧内预测或运动补偿的参考图像,同时也用于视频信号的输出,得到所恢复的原始视频信号。
本申请实施例提供的一种帧间预测方法主要作用于视频编码系统11的帧间预测单元115和视频解码系统21的帧内预测单元,即运动补偿单元214;也就是说,如果在视频编码系统11能够通过本申请实施例提供的帧间预测方法得到一个较好的预测效果,那么,对应地,在解码端,也能够改善视频解码恢复质量。
基于此,下面结合附图和实施例对本申请的技术方案进一步详细阐述。在进行详细阐述之前,需要说明的是,说明书通篇中提到的“第一”、“第二”、“第三”等,仅仅是为了区分不同的特征,不具有限定优先级、先后顺序、大小关系等功能。
本申请实施例提供一种帧间预测方法,该方法应用于视频编码设备,即编码器。该方法所实现的功能可以通过视频编码设备中的处理器调用程序代码来实现,当然程序代码可以保存在计算机存储介质中,可见,该视频编码设备至少包括处理器和存储介质。
图3为本申请实施例提供的帧内预测方法的第一流程示意图,该方法应用于编码器,如图3所示,该方法包括:
步骤101、确定当前块的预测模式参数。
需要说明的是,预测模式参数指示了当前块的编码模式及该模式相关的参数。通常可以采用率失真优化(Rate Distortion Optimization,RDO)的方式确定当前块的预测模式参数。
具体地,在一些实施例中,编码器确定当前块的预测模式参数的实现为:编码器确定当前块的待预测图像分量;基于当前块的参数,利用多种预测模式分别对待预测图像分量进行预测编码,计算多种预测模式下每一种预测模式对应的率失真代价结果;从计算得到的多个率失真代价结果中选取最小率失真代价结果,并将最小率失真代价结果对应的预测模式确定为当前块的预测模式参数。
也就是说,在编码器侧,针对当前块可以采用多种预测模式分别对待预测图像分量进行编码。这里,多种预测模式通常包括有帧间预测模式、传统帧内预测模式和非传统帧内预测模式,而传统帧内预测模式又可以包括有直流(Direct Current,DC)模式、平面(PLANAR)模式和角度模式等,非传统帧内预测模式又可以包括有MIP模式、跨分量线性模型预测(Cross-component Linear Model Prediction,CCLM)模式、帧内块复制(Intra Block Copy,IBC)模式和PLT(Palette)模式等,帧间预测模式包括:GPM模式、三角预测模式(Triangle partition mode,TPM)等。
这样,在利用多种预测模式分别对当前块进行编码之后,可以得到每一种预测模式对应的率失真代价结果;然后从所得到的多个率失真代价结果中选取最小率失真代价结果,并将该最小率失真代价结果对应的预测模式确定为当前块的预测模式参数;如此,最终可以使用所确定的预测模式对当前块进行编码,而且在这种预测模式下,可以使得预测残差小,能够提高编码效率。
步骤102、当所述预测模式参数指示使用几何划分预测模式GPM确定所述当前块的帧间预测值时,确定所述当前块的GPM参数;
在本申请实施例中,预测模式参数指示使用GPM确定当前块的帧间预测时,就可以获取或者确定出当前块的GPM参数。
在本申请实施例中,当前块的GPM参数包括:当前块分割线的角度索引信息和当前块的尺寸信息,还可以包括:当前块分割线的步长索引信息等等。
通常情况下,视频序列的图像被划分成图像块进行编码。在视频编码混合框架中,通常只以正方形和矩形的块 为单位实施预测、变换和量化等编码技术。然而实际中运动物体的边缘并不一定都是水平或者垂直方向的,即使是,也不一定刚好在可以划分的块边缘上,而运动边缘两侧的运动矢量往往不同,这样在编码的过程中以一个整块进行运动预测和补偿,易产生较大的预测误差,从而导致编码效率受限。
在VVC的制定过程中,TPM引入以一个正方形或矩形的对角线、或反对角线为分割线,得到三角形的预测单元,如图4a-图4b所示,从而更灵活的表示帧间预测数据,降低预测误差,从而提高编码效率。
在JVET第15次会议中,提出了一种比TPM更为灵活的帧间几何划分帧间预测模式(Geometrical partitioning for inter blocks,GEO),经过两次会议的讨论,JVET正式将GEO预测模式采纳到VVC的标准中,并更名为GPM模式。GPM是针对图像中物体边缘部分,将当前块划分为两个非矩形的子分区分别进行预测后进行加权融合。例如,非矩形的形式可以如图5a-图5g所示。
在目前VVC Draft8中GPM技术总共有64种划分模式,每种划分模式对应一种角度α和一种步长ρ,总共有20种角度,4种步长。
示例性的,如图6所示,每种角度和步长的组合构成一种划分模式。GPM将当前块划分为两个非矩形的子分区,每个子分区单独进行单向的运动补偿得到单向预测值,最后利用权重矩阵对两分区的单向预测值加权融合得到最终的GPM预测值。
在本申请实施例中,在编码器侧,确定是采用GMP进行帧间预测时,该编码器就可以获取该当前块采用GPM进行帧间预测时的GPM参数了,具体的,GPM参数包括当前块的划分方式,第一分区的mv信息的索引信息和第二分区的mv信息的索引信息。
需要说明的是,目前在VTM8.0中,每个当前块对应的编码单元对GPM预测模式的使用需要满足一些限制条件。示例性地,这些限制条件可以包括:
(a)序列层参数集(Sequence Parameter Set,SPS)允许采用GPM预测模式;
(b)当前块的编码图像区域属于双向预测片(B slice);
(c)当前块的尺寸限制,宽度和高度必须都大于或等于8,且小于或等于64,并且当前块的宽高比和高宽比都小于8;
(d)当前块为非普通融合(general merge)预测,非融合子块(merge_subblock)预测,非仿射预测,也非联合帧内帧间预测(Composed Intra Inter Prediction,CIIP);
(e)对4:0:0格式的色度分量禁用GPM预测模式。
当前块对应的编码单元层语法描述如表1所示。
表1
Figure PCTCN2021076727-appb-000001
这里,ae(v)表示context-adaptive arithmetic entropy-coded syntax element,即上下文自适应的算术熵编码语法元素。merge_gpm_partition_idx[x0][y0]为当前块的划分信息,merge_gpm_idx0[x0][y0],表示A分区的mv在merge列表中的位置,merge_gpm_idx1[x0][y0],表示B分区的mv在merge列表中的位置,MaxNumGpmMergeCand由运动信息候选列表的表长所确定。
帧间预测过程中进一步的根据所述当前块的GPM参数,构建当前块的运动信息候选列表。图7为本申请实施例中空间merge候选列表的相邻块位置示意图,如图7所示,merge候选列表中相邻块的构造顺序为:左侧相邻块A1,上侧相邻块B1,右上侧相邻块B0,左下侧相邻块A0,左上侧相邻块B2,参考帧对应位置块col为相邻块的运动矢量信息依次排列,且区分不同方向来源。需要说明的是,merge列表中还可以添加历史参考块his,第一、第二候选MV的平均MV avg,以及零运动矢量0。
获取图7中5个相邻块的单向或双向mv信息,将每个相邻块的单向或双向mv信息按照相邻块的添加顺序(A1-B1-B0-A0(B2)),添加到merge候选列表中组成当前块的候选项,其中B2为替补,当前面四项有至少一项不可用时,需要使用B2的mv信息加入到候选列表。相邻块的添加顺序代表了各个mv信息与当前块的mv信息之间相关性大小,也就是merge候选列表的添加顺序代表了这个候选项被选为当前块的mv信息的可能性大小,也代表了这个候选项被选为当前块mv信息之后精确度的大小。
图8为本申请实施例中merge候选列表的组成结构示意图,根据图7相邻块的位置示意图得到图8这种merge候选列表,如图8所示,merge候选列表中包括5个相邻块的mv信息,序号分别为0、1、2、3、4,每个相邻块包含双向预测mv信息,即list0和list1。因为在GPM预测模式中,每个分区都只会使用单向预测模式,而merge列表中每一项都可能是双向预测的mv信息,因此需要取出其中的单向预测mv来供使用。令X=(m&0x01),其中,X为参考列表指示信息,配置为指示list0和list1,&为位与运算,即取出m的最后一个比特位(类似于奇偶校验)。这样,优先使用X对应的参考列表中的参考帧对应的mv信息predFlagLXM用于分区预测,如图8中的阴影区域对应的选项。如果相应的mv不可用(相邻块的mv本身也可能是单向的),才使用对向位置的mv(与阴影区域水平对应的空白区域中表示的mv),即X=1-X。
进一步的,两个分区(先A分区后B分区)的mv获取,具体的获取方法包括以下:
merge_gpm_idx0[x0][y0],表示A分区的mv在merge列表中的位置;
令m=merge_gpm_idx0[xCb][yCb],等待后续处理。
merge_gpm_idx1[x0][y0],代表B分区的mv在merge列表中的位置,B分区的mv在merge列表中的位置可能因为A先选去了靠前位置的选项,而减小1。
令n=merge_gpm_idx1[xCb][yCb]+(merge_gpm_idx1[xCb][yCb]>=m)?1:0,n表示的就是B分区选择的mv在merge候选列表中的实际位置,等待后续处理。
令M=mergeGPMCandList[m],从运动信息候选列表中取出第m项用于A分区的mv构造。将相应的mv信息存入给A分区的处理变量,准备后续的预测块构造。
因为在GPM预测模式中,每个分区都只会使用单向预测模式,而merge列表中每一项都可能是双向预测的mv信息,因此需要取出其中的单向预测mv来供使用。令X=(m&0x01),其中,X为参考列表指示信息,配置为指示list0和list1的使用优先级,X=0表示优先使用list0中的mv信息,X=1表示优先使用list1中的mv信息,&为位与运算,即取出m的最后一个比特位(类似于奇偶校验)。这样,优先使用X对应的参考列表中的参考帧对应的mv信息predFlagLXM用于分区预测,如图8中的阴影区域对应的选项。如果相应的mv不可用(相邻块的mv本身也可能是单向的),才使用对向位置的mv(与阴影区域水平对应的空白区域中表示的mv),即X=1-X。
mvA[0]=mvLXM[0]
mvA[1]=mvLXM[1]
refIdxA=refIdxLXM
predListFlagA=X
其中,mvA为A分区mv两个方向上的矢量,refIdxA为该运动矢量对应的参考帧,predListFlagA表示当前选用了该运动矢量备选项的哪个list中的分量。
令N=mergeCandList[n],从运动信息候选列表中取出第n项用于B分区的mv构造。
第n项的单向运动矢量用于mvB构造,优先使用如图8中阴影区域对应的选项,如不可用,才使用对向的mv。因此令X=(n&0x01)。如果predFlagLXN不可用,则X=1-X。
此时,再将相应的mv信息存入给B分区的处理变量,准备后续的预测块构造。
mvB[0]=mvLXN[0]
mvB[1]=mvLXN[1]
refIdxB=refIdxLXN
predListFlagB=X
其中mvB为B分区mv两个方向上的矢量,refIdxB为该运动矢量对应的参考帧,predListFlagB表示当前选用了该运动矢量备选项的哪个list中的分量。
在一些实施例中,构建运动信息候选列表之后,该方法还包括:当所述运动信息候选列表的候选项数量大于2时,从运动信息候选列表中获取所述第一分区的运动信息对应的第一索引信息,以及所述第二分区运动信息对应的第二索引信息;将所述第一索引信息和所述第二索引信息写入码流;或者,当所述运动信息候选列表的候选项数量等于2时,从所述GPM运动信息候选列表中获取所述第一分区的运动信息对应的第一索引信息,或者所述第二分区运动信息对应的第二索引信息;将所述第一索引信息或者所述第二索引信息写入码流。编码器将码流发送给解码器,解码器解析码流确定运动信息候选列表中第一分区的运动信息的第一索引信息,以及第二分区的运动信息的第二索引信息,进一步根据索引信息从解码端建立的运动信息候选列表中获取各个分区的运动信息。
在本申请实施例中,划分信息(即角度索引信息和步长索引信息)也需要在编码时被写入码流,供解码时使用。
步骤103、根据所述当前块的GPM参数,确定所述当前块的第一分区的第一预测值和所述当前块的第二分区的第二预测值;
在本申请实施例中,由于GPM参数可以包括当前块的划分信息,划分信息具体包括角度索引信息和步长索引模式,因此,编码器可以根据划分信息对当前块进行划分,得到第一分区和第二分区;从运动信息候选列表中,确定出与第一分区对应的第一参考块的第一运动信息,以及与第二分区对应的第二参考块的第二运动信息;编码器根据第一运动信息进行运动补偿,得到第一分区的第一预测值,编码器根据第二运动信息进行运动补偿,得到第二分区的第二预测值。
需要说明的是,在本申请实施例中,GPM采用原有VVC7中TPM的单向Merge候选列表,即从单向Merge候选列表,找到GPM的划分后的两个分区各自的MV,即运动信息,根据各自的运动信息获取各自的预测值。
其中,Merge候选列表中一般包括预设个数的参考块的元素,预设个数可以为6个,每个元素是以结构体的形式存储数据的,每个结构体中可以包括:该参考块的运动信息、参考帧列表,预测方向等。而存储GPM对应的数据时,是按照4×4大小的块存储的。
步骤104:根据所述当前块的GPM参数,确定所述当前块内像素点的权重索引;其中,根据不同GPM参数确定的像素点的权重索引不全为偶数;
下面对VVC Draft8相应的编码器中的GPM模式下当前块预测过程进行详细介绍:
图9为本申请实施例中GPM模式预测流程示意图,预测流程的输入包括:
a luma location(xCb,yCb)
cbWidth,cbHeight
1/16 fractional-sample accuracy mvA and mvB
mvCA and mvCB
refidxA and refidxB
predListFlagA and predListFlagB。
其中,xCb和yCb表示当前编码块(coding block,Cb)的左上角像素位置,mvA和mvB是亮度分量的MV,mvCA和mvCB是1/32像素精度的色度分量的MV。
图9中预测流程的输出包括:预测像素值predSamplesL、predSamplesCb和predSamplesCr。
针对输入信息中间预测流程具体包括:
S1:计算两个分区的单向预测值
GPM模式重用现有的常规Merge列表,按照奇偶校验的方式构造属于GPM的单向Merge列表,GPM划分后的两个子分区各自的Merge候选都是从该单向Merge候选列表中选出的。
然后为L、Cb、Cr三个分量推导参考帧列表refPicLN、亚像素预测像素值predSamplesLN,N为A或B,L、Cb、Cr中,L为Luma,表示亮度;Cb和Cr都是Chroma,为色差分量。该步骤同一般Inter预测技术相同。即用现有的运动补偿方式,计算得到两个分区各自的单向运动补偿预测值,配置为后面GPM最终的加权融合过程。这里的运动补偿和常规运动补偿过程一样,即通过运动矢量找到相应的区域的像素值并复制。
S2:获取GMP模式的角度和步长
编码器通过遍历GPM对应的64种划分模型,确定出率失真代价最小的划分模式,即确定出当前块的目标划分模式;该编码器就可以依据目标划分模式,通过预设划分模式、角度索引和步长索引的映射表,确定出该目标划分模式对应的角度索引信息和步长索引信息了。当前预测块是GPM模式时,会根据当前块选中的划分模式索引merge_gpm_partition_idx去查表得到对应的角度angleIdx和步长distanceIdx,该划分模式的映射表如表2所示:
表2
Figure PCTCN2021076727-appb-000002
其中,wedge_partition_idx为划分模式索引,angleIdx为角度索引信息,distanceIdx为步长索引信息。
本申请实施例中,所述当前块的GPM参数包括所述当前块的尺寸信息和角度索引信息;本申请实施例提供的一种步骤104的具体实现方法,如图10所示,该方法可以包括:
步骤201:根据所述当前块的尺寸信息,确定所述当前块内像素点的位置信息;
当前块的尺寸信息包括当前块的宽度和高度。具体的,根据当前块的宽度和高度,以及分割线的角度和步长,确定当前块在水平方向上的偏移值(offsetX),以及当前块在垂直方向上的偏移值(offsetY);根据当前块的offsetX和offsetY以及像素点在第一坐标系中的位置信息,确定当前块内像素点在第二坐标系中的位置信息。
图11为本申请实施例中当前块的划分方式示意图,如图11所示,虚线表示分割线,其中白色背景是根据目前的限定条件,通过当前块(阴影区域为当前块)以及当前块的划分模式去计算当前块的左上角对应于坐标原点的偏移值(OffsetX,OffsetX),进而确定最大尺寸块(64x64)相对该坐标系的最大移动范围(112x112)。如果分割线不经过块中心点,那么就保持分割线相对位置不动,移动该块在坐标系中的位置,从而得到恰当的分割。
这里,第一坐标系是以当前块左上角为坐标原点所构成的坐标系,即图11中右侧所示的坐标系,第二坐标系是如图11中左侧的坐标系,分割线经过该坐标系原点。偏移值的具体确定过程可以由如下公式(4)-公式(7)来实现。
S3:为L、Cb、Cr三个分量推导加权预测像素值predSamples
S3.1:当前块亮度预测值的计算
S3.1.1:通过对预定义的权重矩阵裁剪获取当前亮度块的权重掩码矩阵:
1)首先权重矩阵的获取需要通过当前块以及当前块的划分模式去计算当前块的左上角对应于坐标原点的偏移值Offset(x,y),而坐标原点处于同样角度分割线穿过几何中心点的同样尺寸块的几何中心点。
下面是偏移值计算所需要用到的核心参数:
因为像素点点(x1,y1)到线cosα·x-sinα·y=0的距离d=cosα·x1-sinα·y1,首先需要获取当前角度所对应的cos(α)中α的索引号displacementX,以及对应的-sin(α)=cos(α+π/2)对应的α+π/2的索引号displacementY。
displacementX=angleIdx;     (1)
displacementY=(displacementX+8)%32;     (2)
其中,构造预定义权重矩阵时所使用的步长仅仅为第一个步长(即分割线一定与块的中心点相交)。
由于A分区和B分区在码流中相关信息的传输是有先后顺序的,从而使得在两个分区的顺序安排上必须遵循一定的原则,即通过下式来计算partFlip值,具体如下所示:
partFlip=(angleIdx>=13&&angleIdx<=27)?0:1    (3)
其中,partFlip用于指示A分区和B分区在当前块内的分布位置。具体地,partFlip为0,表示后续(8)式中得到的点与分割线距离weightIdx为负值的一侧为A分区,分割线对侧为B分区;partFlip为为1时则相反,即weightIdx为正值的一侧为A分区,其对侧(即负值一侧)为B分区。
通过下面两式计算获得关键参数shiftHor:
hwRatio=nH/nW     (4)
即CU的高/CU的宽
shiftHor=(angleIdx%16==8||(angleIdx%16!=0&&hwRatio>0))?0:1   (5)
shiftHor的含义是在同一角度下不同分割线之间的位移方向的确定,如其值为0,分割线将在Y轴上偏移;其值为1,分割线将在X轴上偏移。
然后根据当前预测块的尺寸和划分信息,用式(6~7)计算当前预测块的偏移值offsetX和offsetY:
如果shiftHor==0,这时候当前块在垂直方向上存在与当前块的高度相关的偏移值,此时的偏移信息如下所示:
offsetX=(-nW)>>1
offsetY=((-nH)>>1)+angleIdx<16?(distanceIdx*nH)>>3:-((distanceIdx*nH)>>3)    (6)
如果偏移方向标识值等于1,即shiftHor等于1,这时候当前块在水平方向上存在与当前块的宽度相关的偏移值,此时的偏移信息如下所示:
offsetX=((-nW)>>1)+angleIdx<16?(distanceIdx*nW)>>3:-((distanceIdx*nW)>>3)
offsetY=(-nH)>>1     (7)
其中,“>>”表示右移运算符,nW表示当前块的宽度,nH表示当前块的高度。
步骤202:根据所述当前块的角度索引信息,采用预设的确定策略确定所述角度索引信息对应的第一余弦值和第一正弦值;其中,不同角度索引信息对应的第一余弦值和第一正弦值不全为偶数;
实际应用中,确定策略包括从预设的角度映射表获取角度索引信息对应的第一余弦值和第一正弦值,或者根据预设的计算策略计算得到角度索引信息对应的第一余弦值和第一正弦值。本申请实施例中针对这两种方式分别给出了3种具体的实现方式。
步骤203:基于所述第一余弦值和所述第一正弦值,分别结合所述当前块内像素点的位置信息,确定所述当前块内像素点的权重索引。
本申请实施例中,根据所述当前块的角度索引信息,采用预设的确定策略确定所述角度索引信息对应的第一余弦值和第一正弦值包括6种方式:
方式一:根据所述当前块的角度索引信息,确定所述当前块的余弦角度索引信息和正弦角度索引信息;根据所述余弦角度索引信息,从预设角度映射表中获取所述第一余弦值;根据所述正弦角度索引信息,从预设角度映射表中获取所述第一正弦值;其中,所述角度映射表中不同角度索引信息对应的第一余弦值和第一正弦值不全为偶数。
本申请实施例中,还包括构建角度映射表。
具体的,构建角度映射表的方法包括:根据所述当前块的角度索引信息,确定所述当前块的余弦角度索引信息和正弦角度索引信息;根据所述余弦角度索引信息,从预设角度映射表中获取所述第一余弦值;根据M个角度索引信息,得到所述M个角度索引信息对应的第二余弦值;其中,M为偶数;对所述M个角度索引信息对应的第二余弦值进行降幂处理,得到所述M个角度索引信息对应的第一余弦值;利用所述M个角度索引信息及其对应的第一余弦值,构建所述角度映射表。
也就是说,根据角度索引信息确定余弦角度索引信息和正弦角度索引信息,根据余弦角度索引信息查询角度映射表得到余弦角度索引信息对应的第一余弦值,根据正弦角度索引信息查询角度映射表得到正弦角度索引信息对应的第一正弦值。
需要说明的是,因为像素点(x1,y1)到线cosα·x-sinα·y=0的距离d=cosα·x1-sinα·y1,在得到像素点的位置信息(x1,y1),可以根据α查找预先建立的角度索引信息和余弦值映射关系表,即角度映射表,查找α对应cos(α),另外由于-sin(α)=cos(α+π/2),因此,查找α+π/2对应cos(α+π/2)即为-sin(α)。
当前角度所对应的cos(α)中α的索引号displacementX,以及对应的-sin(α)=cos(α+π/2)对应的α+π/2的索引号displacementY,根据上述公式(1)得到余弦角度索引信息,根据上述公式(2)得到正弦角度索引信息。
另外,表3为本申请实施例中提供了一种角度映射表示例,idx即为角度索引信息(displacementX和displacementY),idx对应的disLut[idx]为角度对应的余弦值,根据displacementX查找表3得到第一余弦值,根据displacementY查找表3得到第二正弦值。
表3
idx 0 2 3 4 5 6 8 10 11 12 13 14
disLut[idx] 4 4 4 2 2 1 0 -1 -2 -2 -4 -4
idx 16 18 19 20 21 22 24 26 27 28 29 30
disLut[idx] -4 -4 -4 -2 -2 -1 0 1 2 2 4 4
在确定出偏移信息offsetX和offsetY后,通过式(8)根据当前块内像素点位置位置和第一正弦值 (disLut[displacementX])和第一余弦值(disLut[displacementY])可以计算当前像素点处的权重索引值(用weightIdx表示),进而通过式(9)~(10)能够计算出当前像素点处的权重值,以得到当前块的权重矩阵。
weightIdx=(((x*subW+offsetX)<<1)+1)*disLut[displacementX]+(((y*subH+offsetY)<<1)+1)*disLut[displacementY].    (8)
weightIdxL=partFlip?16+weightIdx:16–weightIdx    (9)
wValue=Clip3(0,8,(weightIdxL+2)>>2)    (10)
其中,clip3表示钳位运算符,0表示下界值,8表示上界值,比如clip3(i,j,x)表示:当x小于i时,其取值为i;当x大于j时,其取值为j;当x大于或等于i且小于或等于j时,其取值为x。(((x*subW+offsetX)<<1)+1)为像素点的原始横坐标放大两倍后的横坐标,(((y*subH+offsetY)<<1)+1)为像素点的原始纵坐标放大两倍后的纵坐标,displacementX为余弦角度索引信息,disLut[displacementX]用于从表3中获取第一余弦值,displacementY为正弦角度索引信息,disLut[displacementY]用于从表3中获取第一正弦值。
式(8)中所使用的disLut[]如表4所示,subW和subH表示下采样率,如果当前块的YUV格式为420格式,subW和subH都可以为2。其中使用的disLut[]如表4所示。subW和subH表示下采样率,如果是420格式,subW和subH都为2。亮度不需要下采样,色度权重是对亮度权重下采样得到的,见S3.2节。
实际应用中公式(9)中weightIdxL是对公式(8)中weightIdx进行扩大后的权重索引扩大值,二者都可视为权重索引,本申请实施例中提出的权重索引确定方法是指weightIdx。
表4为现有角度映射表示例,由于角度索引对应的余弦值全部为偶数,如此,导致在任何角度索引下公式(8)得到的weightIdx全部为偶数,也就是说最后一个比特始终为0,这个情况下带来没有必要的比特开销。现有的角度映射表将余弦值的取值放大了8倍,导致每一个余弦值均为偶数,从而权重索引也全部为偶数。而本申请通过修改角度映射表,即对现有的角度映射表中的余弦值进行了一个次幂,使每项存储比特数从5项减少到4项,使更新后的角度映射表中余弦值不全为偶数,余弦值的取值范围变为[-4,-4],使角度映射表每项比特数从5降调4,省去一个比特,降低了比特开销。
表4
idx 0 2 3 4 5 6 8 10 11 12 13 14
disLut[idx] 8 8 8 4 4 2 0 -2 -4 -4 -8 -8
idx 16 18 19 20 21 22 24 26 27 28 29 30
disLut[idx] -8 -8 -8 -4 -4 -2 0 2 4 4 8 8
步骤105:基于所述当前块内像素点的权重索引,确定所述当前块内像素点的第一权重值和第二权重值;
本申请实施例中,根据第一权重值得到第二权重值。比如第二权重值=1-第一权重值。通过上述公式(9)和(10)确定当前像素点的第一权重值,由于公式(10)中权重值的取值范围为0到8,此时第二权重值=8-第一权重值。
步骤106:基于所述第一分区内像素点的第一预测值和第一权重值,以及所述第二分区内像素点的第二预测值和第二权重值,对所述第一预测值和所述第二预测值进行加权融合,得到所述当前块的帧间预测值。
本申请一些实施例中,S3.1.2给出了亮度预测值的加权融合计算公式,S3.2为色度预测值确定步骤。
S3.1.2:对两个分区的单向预测值进行逐像素加权,得到最终的GPM预测块,具体加权的计算如式(11)所示:
pbSamples[x][y]=Clip3(0,(1<<BitDepth)-1,(predSamplesLA[x][y]*wValue+predSamplesLB[x][y]*(8-wValue)+offset1)>>shift1)     (11)
其中,BitDepth表示比特深度,offset1用于四舍五入,shift1用于使得加权平均后的预测值恢复到与输入视频相同的比特深度,predSamplesLA[x][y]为A分区像素点亮度的第一预测值,predSamplesLB[x][y]为B分区像素点亮度的第二预测值,通过公式(11)得到当前块内像素点的亮度预测值;而offset1和shift1的计算如式(12~13)所示:
shift1=Max(5,17-BitDepth     (12)
offset1=1<<(shift1-1)      (13)
S3.2:当前色度块(Cb和Ct)预测值的计算
通过获取图12a中每个2*2块的左上角的亮度样本权重直接作为当前(x,y)处的色度样本权重,即对亮度样本权重进行下采样,得到图12b当前块色度权重矩阵。色度加权的计算也如式(11)所示,根据第一分区内像素点的第一色度预测值和第一权重值,以及第二分区内像素点的第二色度预测值和第二权重值,对所述第一预测值和所述第二预测值进行加权融合,计算当前块色度预测值。
亮度和色度权重矩阵的采样关系如图12a和图12b所示。
采用上述步骤S3.1和S3.2得到当前图像块的亮度预测值和色度预测值。
S4:存储MV信息用于后续预测mvN、refidxN、predListFlagN;即在得到当前块的预测值之后,还需要存储当前块的mv信息用于后续图像块预测mv信息。
实际应用中,存储当前块的mv信息即存储当前块中4×4子块的mv信息,存储mv需要先确定子块的运动索引信息,根据子块的运动索引信息判断子块是存储单向mv信息还是双向mv信息。
图13为本申请实施例中当前块内子块的运动索引信息确定方法的流程示意图,如图13所示,确定当前块内子块的运动索引信息的方法具体可以包括:
步骤301:根据所述当前块的尺寸信息,确定所述当前块内子块中心像素点的位置信息;
当前块的尺寸信息包括当前块的宽度和高度。具体的,根据当前块的宽度和高度,以及分割线的角度和步长,确定当前块在水平方向上的偏移值(offsetX),以及当前块在垂直方向上的偏移值(offsetY);根据当前块的offsetX和offsetY以及子块中心像素点在第一坐标系中的位置信息,确定子块中心像素点在第二坐标系中的位置信息。
当前块的运动掩码矩阵仍是以4×4子块为单位进行计算的,当前块内子块中心像素点的位置信息即每个4×4子块中心位置(4i+2,4j+2)的位置信息,每个4×4子块中心位置(4i+2,4j+2)处的运动索引(motionIdx)的计算与当前块内像素点权重索引的计算相同,即如式(8)中weightIdx的计算。
步骤302:根据所述当前块的角度索引信息,采用预设的确定策略确定所述角度索引信息对应的第一余弦值和第一正弦值;其中,不同角度索引信息对应的第一余弦值和第一正弦值不全为偶数;
具体的,根据所述当前块的角度索引信息,确定所述当前块的余弦角度索引信息和正弦角度索引信息;根据所述余弦角度索引信息,从预设角度映射表中获取所述第一余弦值;根据所述正弦角度索引信息,从预设角度映射表中获取所述第一正弦值;其中,所述角度映射表中不同角度索引信息对应的第一余弦值和第一正弦值不全为偶数。
本申请实施例中,还包括构建角度映射表。
具体的,构建角度映射表的方法包括:根据所述当前块的角度索引信息,确定所述当前块的余弦角度索引信息和正弦角度索引信息;根据所述余弦角度索引信息,从预设角度映射表中获取所述第一余弦值;根据M个角度索引信息,得到所述M个角度索引信息对应的第二余弦值;其中,M为偶数;对所述M个角度索引信息对应的第二余弦值进行降幂处理,得到所述M个角度索引信息对应的第一余弦值;利用所述M个角度索引信息及其对应的第一余弦值,构建所述角度映射表。
也就是说,根据角度索引信息确定余弦角度索引信息和正弦角度索引信息,根据余弦角度索引信息查询角度映射表得到余弦角度索引信息对应的第一余弦值,根据正弦角度索引信息查询角度映射表得到正弦角度索引信息对应的第一正弦值。
步骤303:基于所述第一余弦值和所述第一正弦值,分别结合所述当前块内子块中心像素点的位置信息,确定所述当前块内子块中心像素点的权重索引;
步骤304:将所述当前块内子块中心像素点的权重索引作为所述当前块内子块的运动索引;
步骤305:基于所述当前块内子块的运动索引信息,确定所述当前块内子块的运动信息的存储类型;其中,所述存储类型包括存储单向运动信息或存储双向运动信息。
运动信息(也称“mv信息”)的存储过程是利用当前亮度块的运动掩码矩阵来实现的,预测值完全来自于A分区的,则记录A分区的运动矢量,完全来自于B分区的,记录B分区的运动矢量;否则同时记录两个分区的运动矢量。运动掩码的计算同计算亮度权重矩阵的过程基本一致,首先计算偏移值offset,该offset的计算如式(14~15)所示:
如果偏移方向标识值等于0,即shiftHor等于0,这时候的偏移信息如下所示:
offsetX=(-cbWidth)>>1
offsetY=((-cbHeight)>>1)+(angleIdx<16?(distanceIdx*cbHeight)>>3:-((distanceIdx*cbHeight)>>3))    (14)
如果偏移方向标识值等于1,即shiftHor等于1,这时候的偏移信息如下所示:
offsetX=((-cbWidth)>>1)+(angleIdx<16?(distanceIdx*cbWidth)>>3:-((distanceIdx*cbWidth)>>3))
offsetY=(-cbHeight)>>1     (15)
其中,cbWidth表示当前块的宽度,cbHeight表示当前块的高度。
由于GPM预测块的运动掩码矩阵仍是以4×4子块为单位进行计算的,那么每个4×4子块的几何中心位置(4i+2,4j+2)处的运动索引(可以用motionIdx表示)的计算类似于式(8)权重索引值weightIdx的计算,具体如下所示,
motionIdx=(((4*xSbIdx+offsetX)<<1)+5)*disLut[displacementX]+(((4*ySbIdx+offsetY)<<1)+5)*disLut[displacementY]
(16)
其中,(((4*xSbIdx+offsetX)<<1)+5)为子块内中心像素点的原始横坐标放大两倍后的横坐标,(((4*ySbIdx+offsetY)<<1)+5)为自块内中心像素点的原始纵坐标放大两倍后的纵坐标,disLut[displacementX]用于从表3中获取第一余弦值,disLut[displacementY]用于从表3中获取第一正弦值。然后,再确定当前4×4的子块需要存储的mv信息。同预测加权时一样,需要首先确定出当前子块处于A分区还是B分区。
partIdx=(angleIdx>=13&&angleIdx<=27)?0:1     (17)
其中(xSbIdx,ySbIdx)表示每个4×4子块(subblock,sb)在当前CU中的子块坐标。坐标的范围为xSbIdx=0..numSbX–1和ySbIdx=0..numSbY–1。partIdx表示是否需要对两个分区进行翻转。
sType=abs(motionIdx)<32?2:(motionIdx<=0?(1-partIdx):partIdx)      (18)
需要说明的是公式(18)以上关系式应该是笔误,正确的应该是:
sType=abs(motionIdx)<16?2:(motionIdx<=0?partIdx:(1-partIdx))     (18)
或者将(17)式中的0和1取值翻转,也可以达到同样的更正效果。
本申请实施例同样使用上述修改前和修改后的帧间预测。
如此,根据每个4×4子块的几何中心位置(4i+2,4j+2)处abs(motionIdx)的大小得到sType,用sType来判断当前子块存储单向mv还是双向mv;具体判断过程如下:如果sType为2,当前子块存储构造的双向MV;否则,如果sType为0,当前子块存储第一个分区的MVA;如果sType为1,当前子块存储第二个分区的MVB。
也就是说,在基于所述当前块内子块的运动索引信息,确定所述当前块内子块的运动信息的存储类型时,先根据子块的运动索引信息确定sType,再根据sType确定子块的运动信息的存储类型。这些存储下来的mv信息将用于后续编码块的mv预测。
进一步的,编码器针对GPM预测模式相关语法的编码过程
编码器中将GPM与其他帧间预测模式视为相互竞争的模式,依照率失真优化(RDO)或其他策略在模式之间进行选择,将选择的结果以码流中语法元素的形式传送给解码端。即编码单元的语法的写入操作。该过程与解析过程相反,首先得到的m和n这两个A、B分区各自在merge列表中所选择的参考选项位置信息,然后再依照下式对语 法元素进行赋值。
merge_gpm_idx0[xCb][yCb]=m
merge_gpm_idx1[xCb][yCb]=n-(merge_gpm_idx1[xCb][yCb]>=m)?1:0
再对其进行二值化、熵编码,从而最终写入码流传输。
采用上述技术方案,在计算像素点的权重索引时,采用预设的计算策略可以实现对权重索引的计算过程进行降幂处理,使得到的权重索引不全为偶数,在不改变编解码性能的基础上,解决了原有方案中计算权重过程中中间索引数据带有冗余比特的问题,修改相应的前后文计算参数,节省了中间运算过程所需的比特数,能够减少比特开销,提高存储效率。
本申请实施例中,还给出了确定第一余弦值和第一正弦值的第二种方式。
方式二:根据所述当前块的角度索引信息,确定所述当前块的余弦角度索引信息和正弦角度索引信息;根据所述余弦角度索引信息,从预设角度映射表中获取所述第一余弦值;根据所述正弦角度索引信息,从预设角度映射表中获取所述第一正弦值;其中,所述角度映射表中不同角度索引信息对应的第一余弦值和第一正弦值不全为偶数。
本申请实施例中,还包括构建角度映射表。
具体的,构建角度映射表的方法包括:根据所述当前块的角度索引信息,确定所述当前块的余弦角度索引信息和正弦角度索引信息;根据所述余弦角度索引信息,从预设角度映射表中获取所述第一余弦值;根据M个角度索引信息,得到所述M个角度索引信息对应的第二余弦值;其中,M为偶数;对所述M个角度索引信息对应的第二余弦值进行降幂处理,得到所述M个角度索引信息对应的第一余弦值;根据所述M个角度索引信息及其对应的第一余弦值,从所述M个角度索引信息获取前M/2个角度索引信息对应的第一余弦值;利用所述前M/2个角度索引信息及其对应的第一余弦值,构建所述角度映射表。
从表3中可以看出,角度索引信息对应的第一余弦值按照预设排列顺序循环分布,因此,为了节约存储空间可以省去表3中后半部分的重复内容,利用前半部分可以推到出后半部分的内容。
表3中M为24,取表3中前12组映射关系得到新的角度映射表(表5)。
表5
idx 0 2 3 4 5 6 8 10 11 12 13 14
disLut[idx] 4 4 4 2 2 1 0 -1 -2 -2 -4 -4
根据表5公式(8)可以变形为公式(8-1):
weightIdx=(((x*subW+offsetX)<<1)+1)*(displacementX>=16?-disLut[displacementX%16]:disLut[displacementX])+(((y*subH+offsetY)<<1)+1)*(displacementY>=16?-disLut[displacementY%16]:disLut[displacementY])    (8-1)
其中,(((x*subW+offsetX)<<1)+1)为像素点的原始横坐标放大两倍后的横坐标,(((y*subH+offsetY)<<1)+1)为像素点的原始纵坐标放大两倍后的纵坐标,与公式(8)中含义相同。(displacementX>=16?-disLut[displacementX%16]:disLut[displacementX])用于从表5中获取第一余弦值,(displacementY>=16?-disLut[displacementY%16]:disLut[displacementY])用于从表5中获取第一正弦值。
当displacementX>=16,displacementX%16得到的取余值,根据取余值再查询表5即可得到displacementX对应的余弦值,将该余弦值的负值作为第一余弦值,当displacementX<16,直接获取displacementX对应的余弦值;
同理,当displacementY>=16,displacementY%16得到的取余值,根据取余值再查询表5即可得到displacementY对应的余弦值,将该余弦值的负值作为作为第一正弦值,当displacementX<16,直接获取displacementX对应的余弦值作为第一正弦值。
公式(9)和公式(10)不变。
同样的,在计算运动矢量存储相关参数时,也可以根更新后的角度映射表确定所述当前块内子块的运动索引。
根据表5公式(16)可以变形为公式(16-1):
motionIdx=(((4*xSbIdx+offsetX)<<1)+5)*(displacementX>=16?-disLut[displacementX%16]:disLut[displacementX])+(((4*ySbIdx+offsetY)<<1)+5)*(displacementY>=16?-disLut[displacementY%16]:disLut[displacementY])    (16-1)
其中,(((4*xSbIdx+offsetX)<<1)+5)为子块内中心像素点的原始横坐标放大两倍后的横坐标,(((4*ySbIdx+offsetY)<<1)+5)为自块内中心像素点的原始纵坐标放大两倍后的纵坐标,与公式(16)含义相同,(displacementX>=16?-disLut[displacementX%16]:disLut[displacementX])用于从表5中获取第一余弦值,(displacementY>=16?-disLut[displacementY%16]:disLut[displacementY])用于从表5中获取第一正弦值。
当displacementX>=16,displacementX%16得到的取余值,根据取余值再查询表5即可得到displacementX对应的余弦值,将该余弦值的负值作为第一余弦值,当displacementX<16,直接获取displacementX对应的余弦值作为第一余弦值;
同理,当displacementY>=16,displacementY%16得到的取余值,根据取余值再查询表5即可得到displacementY对应的余弦值,将该余弦值的负值作为作为第一正弦值,当displacementX<16,直接获取displacementX对应的余弦值作为第一正弦值。公式(17)和公式(18)不变。
可以理解的是,角度映射表中记录了0-360°中24个角度对应的余弦值,由于四个象限中每个角度对应的余弦值的数值和符号呈现一定循环规律,因此,可以只利用其中两个象限中的角度余弦值映射关系建立角度映射表,再利用角度映射表推导出剩余两个象限中角度余弦值的映射关系。如此,将原始表3的长度缩短的一半,节省了存储空间,与现有技术相比图像的帧间预测效果完全等同。
本申请实施例中,还给出了确定第一余弦值和第一正弦值的第三种方式。
方式三:根据所述当前块的角度索引信息,确定所述当前块的余弦角度索引信息和正弦角度索引信息;根据所 述余弦角度索引信息,从预设角度映射表中获取所述第一余弦值;根据所述正弦角度索引信息,从预设角度映射表中获取所述第一正弦值;其中,所述角度映射表中不同角度索引信息对应的第一余弦值和第一正弦值不全为偶数。
本申请实施例中,还包括构建角度映射表。
根据所述当前块的角度索引信息,确定所述当前块的余弦角度索引信息和正弦角度索引信息;根据所述余弦角度索引信息,从预设角度映射表中获取所述第一余弦值;根据M个角度索引信息,得到所述M个角度索引信息对应的第二余弦值;其中,M为偶数;对所述M个角度索引信息对应的第二余弦值进行降幂处理,得到所述M个角度索引信息对应的第一余弦值;根据所述M个角度索引信息及其对应的第一余弦值,从所述M个角度索引信息获取前M/4+1个角度索引信息对应的第一余弦值;利用所述前前M/4+1个角度索引信息及其对应的第一余弦值,构建所述角度映射表。
从表3中可以看出,角度索引信息对应的第一余弦值按照预设排列顺序循环分布,而表3的前半部分绝对值对称分布,符号相反,根据这一特征也可以只保留前半部分中的前7项构建角度映射表,利用前7项可以推到出剩余部分的内容。
表3中M为24,取表3中前7组映射关系得到新的角度映射表(表6)。
表6
idx 0 2 3 4 5 6 8
disLut[idx] 4 4 4 2 2 1 0
根据表6公式(8)可以变形为公式(8-2):
weightIdx=(((x*subW+offsetX)<<1)+1)*(displacementX<8?disLut[displacementX]:displacementX<16?-disLut[16-displacementX]:displacementX<24?-disLut[displacementX-16]:disLut[32-displacementX])+(((y*subH+offsetY)<<1)+1)*(displacementY<8?disLut[displacementY]:displacementY<16?-disLut[16-displacementY]:displacementY<24?-disLut[displacementY-16]:disLut[32-displacementY]).       (8-2)
其中,(((x*subW+offsetX)<<1)+1)为像素点的原始横坐标放大两倍后的横坐标,(((y*subH+offsetY)<<1)+1)为像素点的原始纵坐标放大两倍后的纵坐标,与公式(8)中含义相同。(displacementX<8?disLut[displacementX]:displacementX<16?-disLut[16-displacementX]:displacementX<24?-disLut[displacementX-16]:disLut[32-displacementX])用于从表6中获取第一余弦值,(displacementY<8?disLut[displacementY]:displacementY<16?-disLut[16-displacementY]:displacementY<24?-disLut[displacementY-16]:disLut[32-displacementY])用于从表6中获取第一正弦值。
当displacementX<8,直接获取displacementX对应的余弦值作为第一余弦值;当displacementX>=8且displacementX<16时,取16-displacementX对应的余弦值,将该余弦值的负值作为第一余弦值;当displacementX>=8且displacementX>=16且displacementX<24时,displacementX-16对应的余弦值,将该余弦值的负值作为第一余弦值;当displacementX>=8且displacementX>=16且displacementX>=24时,取32-displacementX对应的余弦值,将该余弦值作为第一余弦值。
当displacementY<8,直接获取displacementY对应的余弦值作为第一正弦值;当displacementY>=8且displacementY<16时,取16-displacementY对应的余弦值,将该余弦值的负值作为第一正弦值;当displacementY>=8且displacementY>=16且displacementY<24时,displacementY-16对应的余弦值,将该余弦值的负值作为第一正弦值;当displacementY>=8且displacementY>=16且displacementY>=24时,取32-displacementY对应的余弦值,将该余弦值作为第一正弦值。
公式(9)和公式(10)不变。
同样的,在计算运动矢量存储相关参数时,也可以根更新后的角度映射表确定所述当前块内子块的运动索引。
根据表6公式(16)可以变形为公式(16-2):
motionIdx=(((4*xSbIdx+offsetX)<<1)+5)*(displacementX<8?disLut[displacementX]:displacementX<16?-disLut[16-displacementX]:displacementX<24?-disLut[displacementX-16]:disLut[32-displacementX])+(((4*ySbIdx+offsetY)<<1)+5)*(displacementY<8?disLut[displacementY]:displacementY<16?-disLut[16-displacementY]:displacementY<24?-disLut[displacementY-16]:disLut[32-displacementY])       (16-2)
其中,(((4*xSbIdx+offsetX)<<1)+5)为子块内中心像素点的原始横坐标放大两倍后的横坐标,(((4*ySbIdx+offsetY)<<1)+5)为自块内中心像素点的原始纵坐标放大两倍后的纵坐标,与公式(16)含义相同,(displacementX<8?disLut[displacementX]:displacementX<16?-disLut[16-displacementX]:displacementX<24?-disLut[displacementX-16]:disLut[32-displacementX])用于从表6中获取第一余弦值,(displacementY<8?disLut[displacementY]:displacementY<16?-disLut[16-displacementY]:displacementY<24?-disLut[displacementY-16]:disLut[32-displacementY])用于从表6中获取第一正弦值。
当displacementX<8,直接获取displacementX对应的余弦值作为第一余弦值;当displacementX>=8且displacementX<16时,取16-displacementX对应的余弦值,将该余弦值的负值作为第一余弦值;当displacementX>=8且displacementX>=16且displacementX<24时,displacementX-16对应的余弦值,将该余弦值的负值作为第一余弦值;当displacementX>=8且displacementX>=16且displacementX>=24时,取32-displacementX对应的余弦值,将该余弦值作为第一余弦值。
可以理解的是,角度映射表中记录了0-360°中24个角度对应的余弦值,由于四个象限中每个角度对应的余弦值的数值和符号呈现一定循环规律,因此,可以只利用其中一个象限中的角度余弦值映射关系建立角度映射表,再利用角度映射表推导出剩余三个象限中角度余弦值的映射关系。如此,将原始表3的长度缩短的四分之一,节省了存储空间,与现有技术相比图像的帧间预测效果完全等同。
采用方式一,通过对原始角度映射表中的角度映射值进行降幂处理得到更新后的角度映射表,采用更新后的角 度映射表得到角度信息对应的权重索引,使得到的权重索引不全为偶数,在不改变编解码性能的基础上,能够减少权重索引比特开销,以及存储角度映射表的比特开销提高存储效率。方式二和方式三利用更新后的角度映射表中的部分角度映射值得到角度信息对应的权重索引,进一步减少了存储角度映射表的比特开销。
本申请实施例中,所述根据所述当前块的角度索引信息,采用预设的确定策略确定所述角度索引信息对应的第一余弦值和第一正弦值,包括:根据所述当前块的角度索引信息,采用预设的计算策略计算得到所述角度索引信息对应的第一余弦值和第一正弦值;其中,不同角度索引信息计算得到的第一余弦值和第二余弦值不全为偶数。
具体的,根据余弦角度索引信息确定第一余弦值的正负号,根据余弦角度索引信息计算第一余弦值的绝对值;根据正弦角度索引信息确定第一正弦值的正负号,根据正弦角度索引信息计算第一正弦值的绝对值。
或者,根据正弦角度索引信息确定第一余弦值的正负号,根据余弦角度索引信息计算第一余弦值的绝对值;根据余弦角度索引信息确定第一正弦值的正负号,根据正弦角度索引信息计算第一正弦值的绝对值。
本申请实施例中,还给出了确定第一余弦值和第一正弦值的第四种方式。
方式四:根据所述当前块的角度索引信息,采用第一计算策略采用预设的计算策略计算得到所述角度索引信息对应的第一余弦值和第一正弦值;其中,不同角度索引信息计算得到的第一余弦值和第二余弦值不全为偶数。
也就是说方式四去掉角度映射表,计算得到角度索引信息对应的第一余弦值和第一正弦值,公式(8)可以变形为公式(8-3)和公式(8-4):
weightIdx=displacementX%16==8?0:(((x*subW+offsetX)<<1)+1)*(((distancementX>8&&distancementX<24)?(-1):1)*(((displacementX+4)%16<=8&&(displacementX+4)%16!=0)?4:(abs(displacementX%16-8)>2?2:1)))+displacementY%16==8?0:(((x*subW+offsetX)<<1)+1)*(((distancementY>8&&distancementY<24)?(-1):1)*(((displacementY+4)%16<=8&&(displacementY+4)%16!=0)?4:(abs(displacementY%16-8)>2?2:1)))   (8-3)
其中,(((x*subW+offsetX)<<1)+1)为像素点的原始横坐标放大两倍后的横坐标,(((y*subH+offsetY)<<1)+1)为像素点的原始纵坐标放大两倍后的纵坐标,与公式(8)中含义相同。
当displacementX%16==8时,weightIdx=0;当displacementX%16不等于8时,(((distancementX>8&&distancementX<24)?(-1):1)*(((displacementX+4)%16<=8&&(displacementX+4)%16!=0)?4:(abs(displacementX%16-8)>2?2:1))用于表示获取第一余弦值,具体的,(distancementX>8&&distancementX<24)?(-1):1)用于确定第一余弦值的正负,(((displacementX+4)%16<=8&&(displacementX+4)%16!=0)?4:(abs(displacementX%16-8)>2?2:1)))用于确定第一余弦值的取值,(displacementX+4)%16<=8&&(displacementX+4)%16!=0)成立,第一余弦值取值为4;且(displacementX+4)%16<=8&&(displacementX+4)%16!=0)不成立,且abs(displacementX%16-8)>2成立,第一余弦值取值为2;(displacementX+4)%16<=8&&(displacementX+4)%16!=0)不成立,且abs(displacementX%16-8)>2不成立,第一余弦值取值为1。
当displacementY%16==8时,weightIdx=0;当displacementY%16不等于8时,(((distancementY>8&&distancementY<24)?(-1):1)*(((displacementY+4)%16<=8&&(displacementY+4)%16!=0)?4:(abs(displacementY%16-8)>2?2:1))用于表示获取第一正弦值,具体的,(distancementY>8&&distancementY<24)?(-1):1)用于确定第一正弦值的正负,(((displacementY+4)%16<=8&&(displacementY+4)%16!=0)?4:(abs(displacementY%16-8)>2?2:1)))用于确定第一正弦值的取值,(displacementY+4)%16<=8&&(displacementY+4)%16!=0)成立,第一正弦值取值为4;且(displacementY+4)%16<=8&&(displacementY+4)%16!=0)不成立,且abs(displacementY%16-8)>2成立,第一正弦值取值为2;(displacementY+4)%16<=8&&(displacementY+4)%16!=0)不成立,且abs(displacementY%16-8)>2不成立,第一正弦值取值为1。
公式(8-3)是根据余弦角度索引信息确定第一余弦值的正负号,根据余弦角度索引信息计算第一余弦值的绝对值;根据正弦角度索引信息确定第一正弦值的正负号,根据正弦角度索引信息计算第一正弦值的绝对值。
公式(8-3)的等价形式为公式(8-4),公式(8-4)具体为:
weightIdx=displacementX%16==8?0:(((x*subW+offsetX)<<1)+1)*((displacementY>16?(-1):1)*(((displacementX+4)%16<=8&&(displacementX+4)%16!=0)?4:(abs(displacementX%16-8)>2?2:1)))+displacementY%16==8?0:(((x*subW+offsetX)<<1)+1)*((displacementX>16?(-1):1)*(((displacementY+4)%16<=8&&(displacementY+4)%16!=0)?4:(abs(displacementY%16-8)>2?2:1)))      (8-4)
(displacementY>16?(-1):1)与公式(8-3)中((distancementX>8&&distancementX<24)?(-1):1)作用相同,都是为了确定第一余弦值的正负,(displacementX>16?(-1):1)与公式(8-3)((distancementY>8&&distancementY<24)?(-1):1)作用相同,都是为了确定第一正弦值的正负;即正弦角度索引信息确定第一余弦值的正负号,根据余弦角度索引信息计算第一余弦值的绝对值;根据余弦角度索引信息确定第一正弦值的正负号,根据正弦角度索引信息计算第一正弦值的绝对值。其他部分相同,在此不再赘述。
公式(9)和公式(10)不变。
同样的,在计算运动矢量存储相关参数时,也可以根更新后的角度映射表确定所述当前块内子块的运动索引。
去掉角度映射表,通过计算确定角度索引信息对应的第一余弦值和第一正弦值,公式(16)可以变形为公式(16-3)和公式(16-4):
motionIdx=displacementX%16==8?0:(((4*xSbIdx+offsetX)<<1)+5)*(((distancementX>8&&distancementX<24)?(-1):1)*(((displacementX+4)%16<=8&&(displacementX+4)%16!=0)?4:(abs(displacementX%16-8)>2?2:1)))+displacementY%16==8?0:(((4*ySbIdx+offsetY)<<1)+5)*(((distancementY>8&&distancementY<24)?(-1):1)*(((displacementY+4)%16<=8&&(displacementY+4)%16!=0)?4:(abs(displacementY%16-8)>2?2:1)))   (16-3)
其中,(((4*xSbIdx+offsetX)<<1)+5)为子块内中心像素点的原始横坐标放大两倍后的横坐标,(((4*ySbIdx+offsetY)<<1)+5)为自块内中心像素点的原始纵坐标放大两倍后的纵坐标,与公式(16)含义相同,
当displacementX%16==8时,motionIdx=0;当displacementX%16不等于8时,(((distancementX>8&&distancementX<24)?(-1):1)*(((displacementX+4)%16<=8&&(displacementX+4)%16!=0)?4:(abs(dis placementX%16-8)>2?2:1))用于表示获取第一余弦值,具体的,(distancementX>8&&distancementX<24)?(-1):1)用于确定第一余弦值的正负,(((displacementX+4)%16<=8&&(displacementX+4)%16!=0)?4:(abs(displacementX%16-8)>2?2:1)))用于确定第一余弦值的取值,(displacementX+4)%16<=8&&(displacementX+4)%16!=0)成立,第一余弦值取值为4;且(displacementX+4)%16<=8&&(displacementX+4)%16!=0)不成立,且abs(displacementX%16-8)>2成立,第一余弦值取值为2;(displacementX+4)%16<=8&&(displacementX+4)%16!=0)不成立,且abs(displacementX%16-8)>2不成立,第一余弦值取值为1。
当displacementY%16==8时,motionIdx=0;当displacementY%16不等于8时,(((distancementY>8&&distancementY<24)?(-1):1)*(((displacementY+4)%16<=8&&(displacementY+4)%16!=0)?4:(abs(displacementY%16-8)>2?2:1))用于表示获取第一正弦值,具体的,(distancementY>8&&distancementY<24)?(-1):1)用于确定第一正弦值的正负,(((displacementY+4)%16<=8&&(displacementY+4)%16!=0)?4:(abs(displacementY%16-8)>2?2:1)))用于确定第一正弦值的取值,(displacementY+4)%16<=8&&(displacementY+4)%16!=0)成立,第一正弦值取值为4;且(displacementY+4)%16<=8&&(displacementY+4)%16!=0)不成立,且abs(displacementY%16-8)>2成立,第一正弦值取值为2;(displacementY+4)%16<=8&&(displacementY+4)%16!=0)不成立,且abs(displacementY%16-8)>2不成立,第一正弦值取值为1。
公式(16-3)的等价形式为公式(16-4),公式(16-4)具体为:
motionIdx=displacementX%16==8?0:(((4*xSbIdx+offsetX)<<1)+5)*((displacementY>16?(-1):1)*(((displacementX+4)%16<=8&&(displacementX+4)%16!=0)?4:(abs(displacementX%16-8)>2?2:1)))+displacementY%16==8?0:(((4*ySbIdx+offsetY)<<1)+5)*((displacementX>16?(-1):1)*(((displacementY+4)%16<=8&&(displacementY+4)%16!=0)?4:(abs(displacementY%16-8)>2?2:1)))       (16-4)
(displacementY>16?(-1):1)与公式(16-3)中((distancementX>8&&distancementX<24)?(-1):1)作用相同,都是为了确定第一余弦值的正负,(displacementX>16?(-1):1)与公式(16-3)((distancementY>8&&distancementY<24)?(-1):1)作用相同,都是为了确定第一正弦值的正负;其他部分相同,在此不再赘述。公式(17)和公式(18)不变。
本申请实施例中,还给出了确定第一余弦值和第一正弦值的第五种方式。
方式五:根据所述当前块的角度索引信息,采用第二计算策略采用预设的计算策略计算得到所述角度索引信息对应的第一余弦值和第一正弦值;其中,不同角度索引信息计算得到的第一余弦值和第二余弦值不全为偶数。
也就是说方式五同样去掉角度映射表,采用与方式四不同的计算策略计算得到角度索引信息对应的第一余弦值和第一正弦值,公式(8)可以变形为公式(8-5)和公式(8-6):
weightIdx=displacementX%16==8?0:(((x*subW+offsetX)<<1)+1)*(((distancementX>8&&distancementX<24)?(-1):1)<<clip(0,2(abs(displacementX%16-8)-1)>>1))+displacementY%16==8?0:(((x*subW+offsetX)<<1)+1)*(((distancementY>8&&distancementY<24)?(-1):1)<<clip(0,2(abs(displacementY%16-8)-1)>>1))      (8-5)
其中,(((x*subW+offsetX)<<1)+1)为像素点的原始横坐标放大两倍后的横坐标,(((y*subH+offsetY)<<1)+1)为像素点的原始纵坐标放大两倍后的纵坐标,与公式(8)中含义相同。
当displacementX%16==8时,weightIdx=0;当displacementX%16不等于8时,(((distancementX>8&&distancementX<24)?(-1):1)<<clip(0,2(abs(displacementX%16-8)-1)>>1))用于表示获取第一余弦值,具体的,(distancementX>8&&distancementX<24)?(-1):1)用于确定第一余弦值的正负,<<clip(0,2(abs(displacementX%16-8)-1)>>1))表示将确定的+1或者-1左移0位、1位或2位,得到对应第一余弦值4、2、1、-1、-2或-4。
当displacementY%16==8时,weightIdx=0;当displacementY%16不等于8时,(((distancementY>8&&distancementY<24)?(-1):1)<<clip(0,2(abs(displacementY%16-8)-1)>>1))用于表示获取第一正弦值,具体的,(distancementY>8&&distancementY<24)?(-1):1)用于确定第一正弦值的正负,<<clip(0,2(abs(displacementY%16-8)-1)>>1))表示将确定的+1或者-1左移0位、1位或2位,得到对应第一正弦值4、2、1、-1、-2或-4。
公式(8-5)的等价形式为公式(8-6),公式(8-6)具体为:
weightIdx=displacementX%16==8?0:(((x*subW+offsetX)<<1)+1)*((displacementY>16?(-1):1)<<clip(0,2(abs(displacementX%16-8)-1)>>1))+displacementY%16==8?0:(((x*subW+offsetX)<<1)+1)*((displacementX>16?(-1):1)<<clip(0,2(abs(displacementY%16-8)-1)>>1))      (8-6)
(displacementY>16?(-1):1)与公式(8-5)中((distancementX>8&&distancementX<24)?(-1):1)作用相同,都是为了确定第一余弦值的正负,(displacementX>16?(-1):1)与公式(8-5)((distancementY>8&&distancementY<24)?(-1):1)作用相同,都是为了确定第一正弦值的正负;其他部分相同,在此不再赘述。
公式(9)和公式(10)不变。
同样的,在计算运动矢量存储相关参数时,也可以根更新后的角度映射表确定所述当前块内子块的运动索引。
去掉角度映射表,采用与方式四不同的计算策略计算得到角度索引信息对应的第一余弦值和第一正弦值,公式(16)可以变形为公式(16-5)和公式(16-6):
motionIdx=displacementX%16==8?0:(((4*xSbIdx+offsetX)<<1)+5)*(((distancementX>8&&distancementX<24)?(-1):1)<<clip(0,2(abs(displacementX%16-8)-1)>>1))+displacementY%16==8?0:(((4*ySbIdx+offsetY)<<1)+5)*(((distancementY>8&&distancementY<24)?(-1):1)<<clip(0,2(abs(displacementX%16-8)-1)>>1))       (16-5)
其中,(((4*xSbIdx+offsetX)<<1)+5)为子块内中心像素点的原始横坐标放大两倍后的横坐标, (((4*ySbIdx+offsetY)<<1)+5)为自块内中心像素点的原始纵坐标放大两倍后的纵坐标,与公式(16)含义相同。
当displacementX%16==8时,motionIdx=0;当displacementX%16不等于8时,(((distancementX>8&&distancementX<24)?(-1):1)<<clip(0,2(abs(displacementX%16-8)-1)>>1))用于表示获取第一余弦值,具体的,(distancementX>8&&distancementX<24)?(-1):1)用于确定第一余弦值的正负,<<clip(0,2(abs(displacementX%16-8)-1)>>1))表示将确定的+1或者-1左移0位、1位或2位,得到对应第一余弦值4、2、1、-1、-2或-4。
当displacementY%16==8时,motionIdx=0;当displacementY%16不等于8时,(((distancementY>8&&distancementY<24)?(-1):1)<<clip(0,2(abs(displacementY%16-8)-1)>>1))用于表示获取第一正弦值,具体的,(distancementY>8&&distancementY<24)?(-1):1)用于确定第一正弦值的正负,<<clip(0,2(abs(displacementY%16-8)-1)>>1))表示将确定的+1或者-1左移0位、1位或2位,得到对应第一正弦值4、2、1、-1、-2或-4。
公式(16-5)的等价形式为公式(16-6),公式(16-6)具体为:
motionIdx=displacementX%16==8?0:(((4*xSbIdx+offsetX)<<1)+5)*((displacementY>16?(-1):1)<<clip(0,2(abs(displacementX%16-8)-1)>>1))+displacementY%16==8?0:(((4*ySbIdx+offsetY)<<1)+5)*((displacementX>16?(-1):1)<<clip(0,2(abs(displacementY%16-8)-1)>>1))       (16-6)
(displacementY>16?(-1):1)与公式(16-5)中((distancementX>8&&distancementX<24)?(-1):1)作用相同,都是为了确定第一余弦值的正负,(displacementX>16?(-1):1)与公式(16-5)((distancementY>8&&distancementY<24)?(-1):1)作用相同,都是为了确定第一正弦值的正负;其他部分相同,在此不再赘述。
本申请实施例中,还给出了确定第一余弦值和第一正弦值的第六种方式。
方式六:根据所述当前块的角度索引信息,采用第三计算策略采用预设的计算策略计算得到所述角度索引信息对应的第一余弦值和第一正弦值;其中,不同角度索引信息计算得到的第一余弦值和第二余弦值不全为偶数。
也就是说方式六同样去掉角度映射表,采用与方式四和方式五不同的计算策略计算得到角度索引信息对应的第一余弦值和第一正弦值,公式(8)可以变形为公式(8-7)、公式(8-8)和公式(8-9):
weightIdx=(((x*subW+offsetX)<<1)+1)*(((distancementX>8&&distancementX<24)?(-1):1)*((abs((displacementX%16)-8)+1)>>1))+(((y*subH+offsetY)<<1)+1)*(((distancementY>8&&distancementY<24)<16?(-1):1)*((abs((displacementY%16)-8)+1)>>1)).      (8-7)
其中,(((x*subW+offsetX)<<1)+1)为像素点的原始横坐标放大两倍后的横坐标,(((y*subH+offsetY)<<1)+1)为像素点的原始纵坐标放大两倍后的纵坐标,与公式(8)中含义相同。
(((distancementX>8&&distancementX<24)?(-1):1)*((abs((displacementX%16)-8)+1)>>1))用于表示获取第一余弦值,具体的,(distancementX>8&&distancementX<24)?(-1):1)用于确定第一余弦值的正负,((abs((displacementX%16)-8)+1)>>1))用于确定第一余弦值的取值,第一余弦值的取值包括4、3、2、1、0。
(((distancementY>8&&distancementY<24)?(-1):1)*((abs((displacementY%16)-8)+1)>>1))用于表示获取第一正弦值,具体的,(distancementY>8&&distancementY<24)?(-1):1)用于确定第一正弦值的正负,((abs((displacementY%16)-8)+1)>>1))用于确定第一正弦值的取值,第一正弦值的取值包括4、3、2、1、0。
公式(8-7)的等价形式为公式(8-8),公式(8-8)具体为:
weightIdx=(((x*subW+offsetX)<<1)+1)*((displacementY>=16)?(-1):1)*((abs((displacementX%16)-8)+1)>>1))+(((y*subH+offsetY)<<1)+1)*(((displacementX<16)?(-1):1)*((abs((displacementY%16)-8)+1)>>1))     (8-8)
(displacementY>16?(-1):1)与公式(8-7)中((distancementX>8&&distancementX<24)?(-1):1)作用相同,都是为了确定第一余弦值的正负,(displacementX>16?(-1):1)与公式(8-7)((distancementY>8&&distancementY<24)?(-1):1)作用相同,都是为了确定第一正弦值的正负;其他部分相同,在此不再赘述。
公式(8-7)的等价形式为公式(8-9),公式(8-9)具体为:
weightIdx=(((x*subW+offsetX)<<1)+1)*((displacementY&0x10)?(-1):1)*((displacementX&0x08)?((~(displacementX&0x07)+2)>>1):(((displacementX&0x07)+1)>>1))+(((y*subH+offsetY)<<1)+1)*((displacementX&0x10?1:(-1))*((displacementY&0x08)?((~(displacementY&0x07)+2)>>1):(((displacementY&0x07)+1)>>1)).       (8-9)
((displacementY&0x10)?(-1):1)与公式(8-7)中((distancementX>8&&distancementX<24)?(-1):1)作用相同,都是为了确定第一余弦值的正负,((displacementX&0x10?1:(-1))与公式(8-7)((distancementY>8&&distancementY<24)?(-1):1)作用相同,都是为了确定第一正弦值的正负。
((displacementX&0x08)?((~(displacementX&0x07)+2)>>1):(((displacementX&0x07)+1)>>1))用于确定第一余弦值的取值,第一余弦值的取值包括4、3、2、1、0。
((displacementY&0x08)?((~(displacementY&0x07)+2)>>1):(((displacementY&0x07)+1)>>1))用于确定第一正弦值的取值,第一正弦值的取值包括4、3、2、1、0。
公式(9)和公式(10)不变。
同样的,在计算运动矢量存储相关参数时,也可以根更新后的角度映射表确定所述当前块内子块的运动索引。
也就是说方式六同样去掉角度映射表,采用与方式四和方式五不同的计算策略计算得到角度索引信息对应的第一余弦值和第一正弦值,公式(16)可以变形为公式(16-7)、公式(16-8)和公式(16-9):
motionIdx=(((4*xSbIdx+offsetX)<<1)+5)*(((distancementX>8&&distancementX<24)?(-1):1)*((abs((displacementX%16)-8)+1)>>1))+(((4*ySbIdx+offsetY)<<1)+1)*(((distancementY>8&&distancementY<24)<16?(-1):1)* ((abs((displacementY%16)-8)+1)>>1))       (16-7)
其中,(((4*xSbIdx+offsetX)<<1)+5)为子块内中心像素点的原始横坐标放大两倍后的横坐标,(((4*ySbIdx+offsetY)<<1)+5)为自块内中心像素点的原始纵坐标放大两倍后的纵坐标,与公式(16)含义相同。
(((distancementX>8&&distancementX<24)?(-1):1)*((abs((displacementX%16)-8)+1)>>1))用于表示获取第一余弦值,具体的,(distancementX>8&&distancementX<24)?(-1):1)用于确定第一余弦值的正负,((abs((displacementX%16)-8)+1)>>1))用于确定第一余弦值的取值,第一余弦值的取值包括4、3、2、1、0。
(((distancementY>8&&distancementY<24)?(-1):1)*((abs((displacementY%16)-8)+1)>>1))用于表示获取第一正弦值,具体的,(distancementY>8&&distancementY<24)?(-1):1)用于确定第一正弦值的正负,((abs((displacementY%16)-8)+1)>>1))用于确定第一正弦值的取值,第一正弦值的取值包括4、3、2、1、0。
公式(16-7)的等价形式为公式(16-8),公式(16-8)具体为:
motionIdx=(((4*xSbIdx+offsetX)<<1)+5)*((displacementY>=16)?(-1):1)*((abs((displacementX%16)-8)+1)>>1))+(((4*ySbIdx+offsetY)*(((displacementX<16)?(-1):1)*((abs((displacementY%16)-8)+1)>>1))     (16-8)
(displacementY>16?(-1):1)与公式(16-7)中((distancementX>8&&distancementX<24)?(-1):1)作用相同,都是为了确定第一余弦值的正负,(displacementX>16?(-1):1)与公式(16-7)((distancementY>8&&distancementY<24)?(-1):1)作用相同,都是为了确定第一正弦值的正负;其他部分相同,在此不再赘述。
公式(16-7)的等价形式为公式(16-9),公式(16-9)具体为:
motionIdx=(((4*xSbIdx+offsetX)<<1)+5)*((displacementY&0x10)?(-1):1)*((displacementX&0x08)?((~(displacementX&0x07)+2)>>1):(((displacementX&0x07)+1)>>1))+(((4*ySbIdx+offsetY)*((displacementX&0x10?1:(-1))*((displacementY&0x08)?((~(displacementY&0x07)+2)>>1):(((displacementY&0x07)+1)>>1)).        (16-9)
((displacementY&0x10)?(-1):1)与公式(16-7)中((distancementX>8&&distancementX<24)?(-1):1)作用相同,都是为了确定第一余弦值的正负,((displacementX&0x10?1:(-1))与公式(16-7)((distancementY>8&&distancementY<24)?(-1):1)作用相同,都是为了确定第一正弦值的正负。
((displacementX&0x08)?((~(displacementX&0x07)+2)>>1):(((displacementX&0x07)+1)>>1))用于确定第一余弦值的取值,第一余弦值的取值包括4、3、2、1、0。
((displacementY&0x08)?((~(displacementY&0x07)+2)>>1):(((displacementY&0x07)+1)>>1))用于确定第一正弦值的取值,第一正弦值的取值包括4、3、2、1、0。
通过方式六中第三计算策略得到的角度索引信息和第一余弦值和第一正弦值的映射关系,等价于表7中的映射关系。
表7
idx 0 2 3 4 5 6 8 10 11 12 13 14
disLut[idx] 4 3 3 2 2 1 0 -1 -2 -2 -3 -3
idx 16 18 19 20 21 22 24 26 27 28 29 30
disLut[idx] -4 -3 -3 -2 -2 -1 0 1 2 2 3 3
采用方式四至方式六,去掉了表构建角度映射表的步骤,直接计算得到角度信息对应的权重索引,使得到的权重索引不全为偶数,在不改变编解码性能的基础上,能够减少权重索引比特开销,以及存储角度映射表的比特开销提高存储效率。
本申请精简了权重值运算的计算,对原始角度映射表(即表4)中各项进行降幂处理,减少了中间计算量存储所需的部分比特数。从表7中可以看出,角度映射表中每项减少了一个比特,权重索引weightIdx减少了一个比特,权重索引扩大值weightIdxL减小了一个比特,运动索引信息motionIdx也减少了一个比特。
图14为本申请实施例提供的帧内预测方法的第二流程示意图,应用于解码器,如图14所示,该方法包括:
步骤401:解析码流,确定当前块的预测模式参数;
步骤402:当预测模式参数指示使用几何划分预测模式GPM确定当前块的帧间预测值时,确定当前块的GPM参数;
步骤403:根据当前块的GPM参数,确定当前块的第一分区的第一预测值和当前块的第二分区的第二预测值;
步骤404:根据当前块的GPM参数,确定当前块内像素点的权重索引;其中,根据不同GPM参数确定的像素点的权重索引不全为偶数;
步骤405:基于当前块内像素点的权重索引,确定当前块内像素点的第一权重值和第二权重值;
步骤406:基于第一分区内像素点的第一预测值和第一权重值,以及第二分区内像素点的第二预测值和第二权重值,对第一预测值和第二预测值进行加权融合,得到当前块的帧间预测值。
在本申请实施例中,预测模式参数指示使用GPM确定当前块的帧间预测时,就可以获取或者确定出当前块的GPM参数。
具体的,当前块的GPM参数包括:当前块分割线的角度索引信息和当前块的尺寸信息,还可以包括:当前块分割线的步长索引信息等等。解码器解析码流获取当前块分割线的角度索引信息、补偿信息和当前块的尺寸信息等信息。
本申请实施例中,当前块的GPM参数包括当前块的尺寸信息和角度索引信息;根据当前块的GPM参数,确定当前块内像素点的权重索引,包括:根据当前块的尺寸信息,确定当前块内像素点的位置信息;根据当前块的角度 索引信息,采用预设的确定策略确定角度索引信息对应的第一余弦值和第一正弦值;其中,不同角度索引信息对应的第一余弦值和第一正弦值不全为偶数;基于第一余弦值和第一正弦值,分别结合当前块内像素点的位置信息,确定当前块内像素点的权重索引。
本申请实施例中,根据当前块的角度索引信息,采用预设的确定策略确定角度索引信息对应的第一余弦值和第一正弦值,包括:根据当前块的角度索引信息,确定当前块的余弦角度索引信息和正弦角度索引信息;根据余弦角度索引信息,从预设角度映射表中获取第一余弦值;根据正弦角度索引信息,从预设角度映射表中获取第一正弦值;其中,角度映射表中不同角度索引信息对应的第一余弦值和第一正弦值不全为偶数。
本申请实施例中,根据余弦角度索引信息,从预设角度映射表中获取第一余弦值之前,方法还包括:根据M个角度索引信息,得到M个角度索引信息对应的第二余弦值;其中,M为偶数;对M个角度索引信息对应的第二余弦值进行降幂处理,得到M个角度索引信息对应的第一余弦值;利用M个角度索引信息及其对应的第一余弦值,构建角度映射表。
本申请实施例中,M个角度索引信息对应的第一余弦值按照预设排列顺序循环分布;利用M个角度索引信息及其对应的第一余弦值,构建角度映射表,包括:根据M个角度索引信息及其对应的第一余弦值,从M个角度索引信息获取前M/2个角度索引信息对应的第一余弦值;利用前M/2个角度索引信息及其对应的第一余弦值,构建角度映射表。
本申请实施例中,M个角度索引信息对应的第一余弦值按照预设排列顺序循环分布;利用M个角度索引信息及其对应的第一余弦值,构建角度映射表,包括:根据M个角度索引信息及其对应的第一余弦值,从M个角度索引信息获取前M/4+1个角度索引信息对应的第一余弦值;利用前前M/4+1个角度索引信息及其对应的第一余弦值,构建角度映射表。
本申请实施例中,根据当前块的角度索引信息,采用预设的确定策略确定角度索引信息对应的第一余弦值和第一正弦值,包括:根据当前块的角度索引信息,采用预设的计算策略计算得到角度索引信息对应的第一余弦值和第一正弦值;其中,不同角度索引信息计算得到的第一余弦值和第二余弦值不全为偶数。
具体的,根据余弦角度索引信息确定第一余弦值的正负号,根据余弦角度索引信息计算第一余弦值的绝对值;根据正弦角度索引信息确定第一正弦值的正负号,根据正弦角度索引信息计算第一正弦值的绝对值。
或者,根据正弦角度索引信息确定第一余弦值的正负号,根据余弦角度索引信息计算第一余弦值的绝对值;根据余弦角度索引信息确定第一正弦值的正负号,根据正弦角度索引信息计算第一正弦值的绝对值。
本申请实施例中,当前块的GPM参数包括当前块的尺寸信息和角度索引信息;根据当前块的GPM参数,确定当前块内像素点的权重索引,包括:根据当前块的尺寸信息,确定当前块内子块中心像素点的位置信息;根据当前块的角度索引信息,采用预设的确定策略确定角度索引信息对应的第一余弦值和第一正弦值;其中,不同角度索引信息对应的第一余弦值和第一正弦值不全为偶数;基于第一余弦值和第一正弦值,分别结合当前块内子块中心像素点的位置信息,确定当前块内子块中心像素点的权重索引;方法还包括:将当前块内子块中心像素点的权重索引作为当前块内子块的运动索引;基于当前块内子块的运动索引信息,确定当前块内子块的运动信息的存储类型;其中,存储类型包括存储单向运动信息或存储双向运动信息。
本申请实施例中,根据当前块的角度索引信息,采用预设的确定策略确定角度索引信息对应的第一余弦值和第一正弦值包括6种方式:
根据当前块的角度索引信息,确定当前块的余弦角度索引信息和正弦角度索引信息;根据余弦角度索引信息,从预设角度映射表中获取第一余弦值;根据正弦角度索引信息,从预设角度映射表中获取第一正弦值;其中,角度映射表中不同角度索引信息对应的第一余弦值和第一正弦值不全为偶数。
即根据预先构建角度映射表获取权重索引信息的第一余弦值和第一正弦值,本申请实施例中,具体给出的三种角度映射表的构建方式,在编码器端已经详细阐述这里不再赘述。
本申请实施例中还给出了三种根据计算策略计算得到角度索引信息对应的第一余弦值和第一正弦值,具体的第一计算策略、第二计算策略和第三计算策略在编码器端已经详细阐述这里不再赘述。
在一些实施例中,该方法还包括构建运动信息候选列表,解析码流,确定运动信息候选列表中当前块第一分区的运动信息对应的第一索引信息,以及当前块第二分区运动信息对应的第二索引信息;基于第一索引信息,从运动信息候选列表中获取第一分区的运动信息;基于第二索引信息,从运动信息候选列表中获取第二分区的运动信息;利用第一分区的运动信息计算第一分区的第一预测值,利用第二分区的运动信息计算第二分区的第二预测值;对第一预测值和第二预测值进行加权融合,得到当前块的帧间预测值。
具体的,解析码流,当运动信息候选列表的候选项数量大于2时,从运动信息候选列表中获取第一分区的运动信息对应的第一索引信息和第二分区运动信息对应的第二索引信息;
当运动信息候选列表的候选项数量等于2时,从运动信息候选列表中获取第一分区的运动信息对应的第一索引信息,或者第二分区运动信息对应的第二索引信息。
在本申请实施例中,解码器可以根据每个像素点的第一预测值与第一权重值相乘,加上对应的每个像素点的第二预测值与第二权重值之积,完成对当前块内像素点的加权融合,得到当前块的帧间预测值。
实际应用中,解码器解析码流获取第一分区的第一索引信息和第二分区的第二索引信息,再根据索引信息从解码器建立的运动信息候选列表中确定各自分区的运动信息。解码器端对merge列表查重去重操作构建运动信息候选列表的方法与解码端相同,解码器端的其他帧间预测过程与编码器端相同,这里不再赘述。
采用上述方案,解码器在进行帧间预测的过程中,在计算像素点的权重索引时,采用预设的计算策略可以实现对权重索引的计算过程进行降幂处理,使得到的权重索引不全为偶数,在不改变编解码性能的基础上,解决了原有方案中计算权重过程中中间索引数据带有冗余比特的问题,能够减少比特开销,提高存储效率。
本申请实施例提供一种编码器,图15为本申请实施例中编码器的第一组成结构示意图,如图15所示,该编码器50包括:
确定单元501,配置为确定当前块的预测模式参数;
第一处理单元502,配置为当预测模式参数指示使用几何划分预测模式GPM确定当前块的帧间预测值时,确定当前块的GPM参数;根据当前块的GPM参数,确定当前块的第一分区的第一预测值和当前块的第二分区的第二预测值;
第一处理单元502,还用于根据当前块的GPM参数,确定当前块内像素点的权重索引;其中,根据不同GPM参数确定的像素点的权重索引不全为偶数;基于当前块内像素点的权重索引,确定当前块内像素点的第一权重值和第二权重值;
第一预测单元503,配置为基于第一分区内像素点的第一预测值和第一权重值,以及第二分区内像素点的第二预测值和第二权重值,对第一预测值和第二预测值进行加权融合,得到当前块的帧间预测值。
在本申请的一些实施例中,当前块的GPM参数包括当前块的尺寸信息和角度索引信息;
第一处理单元502,具体用于根据当前块的尺寸信息,确定当前块内像素点的位置信息;根据当前块的角度索引信息,采用预设的确定策略确定角度索引信息对应的第一余弦值和第一正弦值;其中,不同角度索引信息对应的第一余弦值和第一正弦值不全为偶数;基于第一余弦值和第一正弦值,分别结合当前块内像素点的位置信息,确定当前块内像素点的权重索引。
在本申请的一些实施例中,第一处理单元502,具体用于根据当前块的角度索引信息,确定当前块的余弦角度索引信息和正弦角度索引信息;根据余弦角度索引信息,从预设角度映射表中获取第一余弦值;根据正弦角度索引信息,从预设角度映射表中获取第一正弦值;其中,角度映射表中不同角度索引信息对应的第一余弦值和第一正弦值不全为偶数。
在本申请的一些实施例中,第一处理单元502,具体用于根据M个角度索引信息,得到M个角度索引信息对应的第二余弦值;其中,M为偶数;对M个角度索引信息对应的第二余弦值进行降幂处理,得到M个角度索引信息对应的第一余弦值;利用M个角度索引信息及其对应的第一余弦值,构建角度映射表。
在本申请的一些实施例中,M个角度索引信息对应的第一余弦值按照预设排列顺序循环分布;
第一处理单元502,具体用于根据M个角度索引信息及其对应的第一余弦值,从M个角度索引信息获取前M/2个角度索引信息对应的第一余弦值;利用前M/2个角度索引信息及其对应的第一余弦值,构建角度映射表。
在本申请的一些实施例中,M个角度索引信息对应的第一余弦值按照预设排列顺序循环分布;
第一处理单元502,具体用于根据M个角度索引信息及其对应的第一余弦值,从M个角度索引信息获取前M/4+1个角度索引信息对应的第一余弦值;利用前前M/4+1个角度索引信息及其对应的第一余弦值,构建角度映射表。
在本申请的一些实施例中,第一处理单元502,具体用于根据当前块的角度索引信息,采用预设的计算策略计算得到角度索引信息对应的第一余弦值和第一正弦值;其中,不同角度索引信息计算得到的第一余弦值和第二余弦值不全为偶数。
在本申请的一些实施例中,当前块的GPM参数包括当前块的尺寸信息和角度索引信息;
第一处理单元502,具体用于根据当前块的尺寸信息,确定当前块内子块中心像素点的位置信息;根据当前块的角度索引信息,采用预设的确定策略确定角度索引信息对应的第一余弦值和第一正弦值;其中,不同角度索引信息对应的第一余弦值和第一正弦值不全为偶数;基于第一余弦值和第一正弦值,分别结合当前块内子块中心像素点的位置信息,确定当前块内子块中心像素点的权重索引;
第一处理单元502,还用于将当前块内子块中心像素点的权重索引作为当前块内子块的运动索引;基于当前块内子块的运动索引信息,确定当前块内子块的运动信息的存储类型;其中,存储类型包括存储单向运动信息或存储双向运动信息。
在本申请的一些实施例中,编码器50还包括写入单元,配置为将当前块的角度索引信息写入码流。
在实际应用中,本申请实施例还提供了一种编码器,图16为本申请实施例中编码器的第二组成结构示意图如图16所示,编码器50包括:
第一存储器504和第一处理器505;第一存储器504存储有可在第一处理器505上运行的计算机程序,第一处理器505执行程序时编码器侧的帧间预测方法。
采用上述方案,编码器在进行帧间预测的过程中,在计算像素点的权重索引时,采用预设的计算策略可以实现对权重索引的计算过程进行降幂处理,使得到的权重索引不全为偶数,在不改变编解码性能的基础上,解决了原有方案中计算权重过程中中间索引数据带有冗余比特的问题,能够减少比特开销,提高存储效率。
本申请实施例提供一种解码器器,图17为本申请实施例中解码器的第一组成结构示意图,如图17所示,该解码器60包括:
解析单元601,配置为解析码流,确定当前块的预测模式参数;
第二处理单元602,配置为当预测模式参数指示使用几何划分预测模式GPM确定当前块的帧间预测值时,确定当前块的GPM参数;根据当前块的GPM参数,确定当前块的第一分区的第一预测值和当前块的第二分区的第二预测值;
第二处理单元602,还用于根据当前块的GPM参数,确定当前块内像素点的权重索引;其中,根据不同GPM参数确定的像素点的权重索引不全为偶数;基于当前块内像素点的权重索引,确定当前块内像素点的第一权重值和第二权重值;
第二预测单元603,还用于基于第一分区内像素点的第一预测值和第一权重值,以及第二分区内像素点的第二预测值和第二权重值,对第一预测值和第二预测值进行加权融合,得到当前块的帧间预测值。
在本申请的一些实施例中,当前块的GPM参数包括当前块的尺寸信息和角度索引信息;
第二处理单元602,具体用于根据当前块的尺寸信息,确定当前块内像素点的位置信息;根据当前块的角度索引信息,采用预设的确定策略确定角度索引信息对应的第一余弦值和第一正弦值;其中,不同角度索引信息对应的第一余弦值和第一正弦值不全为偶数;基于第一余弦值和第一正弦值,分别结合当前块内像素点的位置信息,确定当前块内像素点的权重索引。
在本申请的一些实施例中,第二处理单元602,具体用于根据当前块的角度索引信息,确定当前块的余弦角度索引信息和正弦角度索引信息;根据余弦角度索引信息,从预设角度映射表中获取第一余弦值;根据正弦角度索引信息,从预设角度映射表中获取第一正弦值;其中,角度映射表中不同角度索引信息对应的第一余弦值和第一正弦值不全为偶数。
在本申请的一些实施例中,第二处理单元602,具体用于根据M个角度索引信息,得到M个角度索引信息对应的第二余弦值;其中,M为偶数;对M个角度索引信息对应的第二余弦值进行降幂处理,得到M个角度索引信息对应的第一余弦值;利用M个角度索引信息及其对应的第一余弦值,构建角度映射表。
在本申请的一些实施例中,M个角度索引信息对应的第一余弦值按照预设排列顺序循环分布;
第二处理单元602,具体用于根据M个角度索引信息及其对应的第一余弦值,从M个角度索引信息获取前M/2个角度索引信息对应的第一余弦值;利用前M/2个角度索引信息及其对应的第一余弦值,构建角度映射表。
在本申请的一些实施例中,M个角度索引信息对应的第一余弦值按照预设排列顺序循环分布;
第二处理单元602,具体用于根据M个角度索引信息及其对应的第一余弦值,从M个角度索引信息获取前M/4+1个角度索引信息对应的第一余弦值;利用前前M/4+1个角度索引信息及其对应的第一余弦值,构建角度映射表。
在本申请的一些实施例中,第二处理单元602,具体用于根据当前块的角度索引信息,采用预设的计算策略计算得到角度索引信息对应的第一余弦值和第一正弦值;其中,不同角度索引信息计算得到的第一余弦值和第二余弦值不全为偶数。
在本申请的一些实施例中,当前块的GPM参数包括当前块的尺寸信息和角度索引信息;
第二处理单元602,具体用于根据当前块的尺寸信息,确定当前块内子块中心像素点的位置信息;根据当前块的角度索引信息,采用预设的确定策略确定角度索引信息对应的第一余弦值和第一正弦值;其中,不同角度索引信息对应的第一余弦值和第一正弦值不全为偶数;基于第一余弦值和第一正弦值,分别结合当前块内子块中心像素点的位置信息,确定当前块内子块中心像素点的权重索引;
第二处理单元602,还用于将当前块内子块中心像素点的权重索引作为当前块内子块的运动索引;基于当前块内子块的运动索引信息,确定当前块内子块的运动信息的存储类型;其中,存储类型包括存储单向运动信息或存储双向运动信息。
在实际应用中,本申请实施例还提供了一种解码器,图18为本申请实施例中解码器的第二组成结构示意图,如图18所示,解码器60包括:
第二存储器604和第二处理器605;第二存储器604存储有可在第二处理器605上运行的计算机程序,第二处理器605执行程序时解码器侧的帧间预测方法。
可以理解的是,解码器在进行帧间预测的过程中,在计算像素点的权重索引时,采用预设的计算策略可以实现对权重索引的计算过程进行降幂处理,使得到的权重索引不全为偶数,在不改变编解码性能的基础上,解决了原有方案中计算权重过程中中间索引数据带有冗余比特的问题,能够减少比特开销,提高存储效率。
另外,在本实施例中的各功能模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。
相应的,本申请实施例提供了一种存储介质,其上存储有计算机程序,该计算机程序被第一处理器执行时,实现编码器的帧间预测方法;或者,该计算机程序被第二处理器执行时,实现解码器的帧间预测方法。
这里需要指出的是:以上存储介质和装置实施例的描述,与上述方法实施例的描述是类似的,具有同方法实施例相似的有益效果。对于本申请存储介质和装置实施例中未披露的技术细节,请参照本申请方法实施例的描述而理解。
以上,仅为本申请的实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。
工业实用性
本申请实施例中,确定当前块的预测模式参数;当预测模式参数指示当前块使用GPM确定帧间预测值时,确定当前块的GPM参数;根据当前块的GPM参数,确定当前块的第一分区的第一预测值和当前块的第二分区的第二预测值;根据当前块的GPM参数,确定当前块内像素点的权重索引;其中,根据不同GPM参数确定的像素点的权重索引不全为偶数;基于当前块内像素点的权重索引,确定当前块内像素点的第一权重值和第二权重值;基于第一分区内像素点的第一预测值和第一权重值,以及第二分区内像素点的第二预测值和第二权重值,对第一预测值和第二预测值进行加权融合,得到当前块的帧间预测值。这样,在计算像素点的权重索引时,采用预设的计算策略可以实现对权重索引的计算过程进行降幂处理,使得到的权重索引不全为偶数,在不改变编解码性能的基础上,能够减少权重索引比特开销,提高存储效率。

Claims (15)

  1. 一种帧间预测方法,应用于编码器,包括:
    确定当前块的预测模式参数;
    当所述预测模式参数指示使用几何划分预测模式GPM确定所述当前块的帧间预测值时,确定所述当前块的GPM参数;
    根据所述当前块的GPM参数,确定所述当前块的第一分区的第一预测值和所述当前块的第二分区的第二预测值;
    根据所述当前块的GPM参数,确定所述当前块内像素点的权重索引;其中,根据不同GPM参数确定的像素点的权重索引不全为偶数;
    基于所述当前块内像素点的权重索引,确定所述当前块内像素点的第一权重值和第二权重值;
    基于所述第一分区内像素点的第一预测值和第一权重值,以及所述第二分区内像素点的第二预测值和第二权重值,对所述第一预测值和所述第二预测值进行加权融合,得到所述当前块的帧间预测值。
  2. 根据权利要求1所述的方法,其中,所述当前块的GPM参数包括所述当前块的尺寸信息和角度索引信息;
    所述根据所述当前块的GPM参数,确定所述当前块内像素点的权重索引,包括:
    根据所述当前块的尺寸信息,确定所述当前块内像素点的位置信息;
    根据所述当前块的角度索引信息,采用预设的确定策略确定所述角度索引信息对应的第一余弦值和第一正弦值;其中,不同角度索引信息对应的第一余弦值和第一正弦值不全为偶数;
    基于所述第一余弦值和所述第一正弦值,分别结合所述当前块内像素点的位置信息,确定所述当前块内像素点的权重索引。
  3. 根据权利要求2所述的方法,其中,所述根据所述当前块的角度索引信息,采用预设的确定策略确定所述角度索引信息对应的第一余弦值和第一正弦值,包括:
    根据所述当前块的角度索引信息,确定所述当前块的余弦角度索引信息和正弦角度索引信息;
    根据所述余弦角度索引信息,从预设角度映射表中获取所述第一余弦值;
    根据所述正弦角度索引信息,从预设角度映射表中获取所述第一正弦值;
    其中,所述角度映射表中不同角度索引信息对应的第一余弦值和第一正弦值不全为偶数。
  4. 根据权利要求3所述的方法,其中,所述根据所述余弦角度索引信息,从预设角度映射表中获取所述第一余弦值之前,所述方法还包括:
    根据M个角度索引信息,得到所述M个角度索引信息对应的第二余弦值;其中,M为偶数;
    对所述M个角度索引信息对应的第二余弦值进行降幂处理,得到所述M个角度索引信息对应的第一余弦值;
    利用所述M个角度索引信息及其对应的第一余弦值,构建所述角度映射表。
  5. 根据权利要求4所述的方法,其中,所述M个角度索引信息对应的第一余弦值按照预设排列顺序循环分布;
    所述利用所述M个角度索引信息及其对应的第一余弦值,构建所述角度映射表,包括:
    根据所述M个角度索引信息及其对应的第一余弦值,从所述M个角度索引信息获取前M/2个角度索引信息对应的第一余弦值;
    利用所述前M/2个角度索引信息及其对应的第一余弦值,构建所述角度映射表。
  6. 根据权利要求4所述的方法,其中,所述M个角度索引信息对应的第一余弦值按照预设排列顺序循环分布;
    所述利用所述M个角度索引信息及其对应的第一余弦值,构建所述角度映射表,包括:
    根据所述M个角度索引信息及其对应的第一余弦值,从所述M个角度索引信息获取前M/4+1个角度索引信息对应的第一余弦值;
    利用所述前前M/4+1个角度索引信息及其对应的第一余弦值,构建所述角度映射表。
  7. 根据权利要求2所述的方法,其中,所述根据所述当前块的角度索引信息,采用预设的确定策略确定所述角度索引信息对应的第一余弦值和第一正弦值,包括:
    根据所述当前块的角度索引信息,采用预设的计算策略计算得到所述角度索引信息对应的第一余弦值和第一正弦值;其中,不同角度索引信息计算得到的第一余弦值和第二余弦值不全为偶数。
  8. 根据权利要求1所述的方法,其中,所述当前块的GPM参数包括所述当前块的尺寸信息和角度索引信息;
    所述根据所述当前块的GPM参数,确定所述当前块内像素点的权重索引,包括:
    根据所述当前块的尺寸信息,确定所述当前块内子块中心像素点的位置信息;
    根据所述当前块的角度索引信息,采用预设的确定策略确定所述角度索引信息对应的第一余弦值和第一正弦值;其中,不同角度索引信息对应的第一余弦值和第一正弦值不全为偶数;
    基于所述第一余弦值和所述第一正弦值,分别结合所述当前块内子块中心像素点的位置信息,确定所述当前块内子块中心像素点的权重索引;
    所述方法还包括:将所述当前块内子块中心像素点的权重索引作为所述当前块内子块的运动索引;
    基于所述当前块内子块的运动索引信息,确定所述当前块内子块的运动信息的存储类型;其中,所述存储类型包括存储单向运动信息或存储双向运动信息。
  9. 根据权利要求2所述的方法,其中,所述方法还包括:
    将所述当前块的角度索引信息写入码流。
  10. 一种帧间预测方法,应用于解码器,所述方法包括:
    解析码流,确定当前块的预测模式参数;
    当所述预测模式参数指示使用几何划分预测模式GPM确定所述当前块的帧间预测值时,确定所述当前块的GPM参数;
    根据所述当前块的GPM参数,确定所述当前块的第一分区的第一预测值和所述当前块的第二分区的第二预测值;
    根据所述当前块的GPM参数,确定所述当前块内像素点的权重索引;其中,根据不同GPM参数确定的像素点的权重索引不全为偶数;
    基于所述当前块内像素点的权重索引,确定所述当前块内像素点的第一权重值和第二权重值;
    基于所述第一分区内像素点的第一预测值和第一权重值,以及所述第二分区内像素点的第二预测值和第二权重值,对所述第一预测值和所述第二预测值进行加权融合,得到所述当前块的帧间预测值。
  11. 一种编码器,其中,所述编码器包括:
    确定单元,配置为确定当前块的预测模式参数;
    第一处理单元,配置为当所述预测模式参数指示使用几何划分预测模式GPM确定所述当前块的帧间预测值时,确定所述当前块的GPM参数;根据所述当前块的GPM参数,确定所述当前块的第一分区的第一预测值和所述当前块的第二分区的第二预测值;
    所述第一处理单元,还用于根据所述当前块的GPM参数,确定所述当前块内像素点的权重索引;其中,根据不同GPM参数确定的像素点的权重索引不全为偶数;基于所述当前块内像素点的权重索引,确定所述当前块内像素点的第一权重值和第二权重值;
    第一预测单元,配置为基于所述第一分区内像素点的第一预测值和第一权重值,以及所述第二分区内像素点的第二预测值和第二权重值,对所述第一预测值和所述第二预测值进行加权融合,得到所述当前块的帧间预测值。
  12. 一种解码器,其中,所述解码器包括:
    解析单元,配置为解析码流,确定当前块的预测模式参数;
    第二处理单元,配置为当所述预测模式参数指示使用几何划分预测模式GPM确定所述当前块的帧间预测值时,确定所述当前块的GPM参数;根据所述当前块的GPM参数,确定所述当前块的第一分区的第一预测值和所述当前块的第二分区的第二预测值;
    所述第二处理单元,还配置为根据所述当前块的GPM参数,确定所述当前块内像素点的权重索引;其中,根据不同GPM参数确定的像素点的权重索引不全为偶数;基于所述当前块内像素点的权重索引,确定所述当前块内像素点的第一权重值和第二权重值;
    第二预测单元,还用于基于所述第一分区内像素点的第一预测值和第一权重值,以及所述第二分区内像素点的第二预测值和第二权重值,对所述第一预测值和所述第二预测值进行加权融合,得到所述当前块的帧间预测值。
  13. 一种编码器,其中,所述编码器包括:
    第一存储器和第一处理器;
    所述第一存储器存储有可在第一处理器上运行的计算机程序,所述第一处理器执行所述程序时实现权利要求1至9任一项所述帧间预测方法。
  14. 一种解码器,其特征在于,包括:
    第二存储器和第二处理器;
    所述第二存储器存储有可在第二处理器上运行的计算机程序,所述第二处理器执行所述程序时实现权利要求10所述帧间预测方法。
  15. 一种存储介质,其特征在于,其上存储有计算机程序,该计算机程序被第一处理器执行时,实现权利要求1至9任一项所述帧间预测方法;或者,该计算机程序被第二处理器执行时,实现权利要求10所述帧间预测方法。
PCT/CN2021/076727 2020-04-08 2021-02-18 一种帧间预测方法、编码器、解码器及存储介质 WO2021203841A1 (zh)

Priority Applications (3)

Application Number Priority Date Filing Date Title
CN202180026037.XA CN115380532A (zh) 2020-04-08 2021-02-18 一种帧间预测方法、编码器、解码器及存储介质
EP21785246.6A EP4131954A4 (en) 2020-04-08 2021-02-18 INTERFRAME PREDICTION METHOD, ENCODER, DECODER AND STORAGE MEDIUM
US17/953,250 US20230052940A1 (en) 2020-04-08 2022-09-26 Inter prediction method and encoder

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010270775.6A CN113497942A (zh) 2020-04-08 2020-04-08 一种帧间预测方法、编码器、解码器及存储介质
CN202010270775.6 2020-04-08

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/953,250 Continuation US20230052940A1 (en) 2020-04-08 2022-09-26 Inter prediction method and encoder

Publications (1)

Publication Number Publication Date
WO2021203841A1 true WO2021203841A1 (zh) 2021-10-14

Family

ID=77994897

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/076727 WO2021203841A1 (zh) 2020-04-08 2021-02-18 一种帧间预测方法、编码器、解码器及存储介质

Country Status (5)

Country Link
US (1) US20230052940A1 (zh)
EP (1) EP4131954A4 (zh)
CN (2) CN113497942A (zh)
TW (1) TW202139694A (zh)
WO (1) WO2021203841A1 (zh)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023123495A1 (zh) * 2021-12-31 2023-07-06 Oppo广东移动通信有限公司 预测方法、装置、设备、系统、及存储介质
WO2023197183A1 (zh) * 2022-04-12 2023-10-19 Oppo广东移动通信有限公司 视频编解码方法、装置、设备、系统、及存储介质
WO2024055155A1 (zh) * 2022-09-13 2024-03-21 Oppo广东移动通信有限公司 一种编解码方法、装置、编码器、解码器及存储介质

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102611880A (zh) * 2011-01-19 2012-07-25 华为技术有限公司 标识图像块几何划分模式的编解码方法和设备
WO2019246535A1 (en) * 2018-06-22 2019-12-26 Op Solutions, Llc Block level geometric partitioning

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102611880A (zh) * 2011-01-19 2012-07-25 华为技术有限公司 标识图像块几何划分模式的编解码方法和设备
WO2019246535A1 (en) * 2018-06-22 2019-12-26 Op Solutions, Llc Block level geometric partitioning

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
BENJAMIN BROSS , JIANLE CHEN , SHAN LIU , YE-KUI WANG: "Versatile Video Coding (Draft 8)", 17. JVET MEETING; 20200107 - 20200117; BRUSSELS; (THE JOINT VIDEO EXPLORATION TEAM OF ISO/IEC JTC1/SC29/WG11 AND ITU-T SG.16 ), no. JVET-Q2001-vE, 12 March 2020 (2020-03-12), pages 1 - 510, XP030285390 *
Y. SUN (HIKVISION), F. CHEN, L. WANG (HIKVISION): "CE4-related: On simplification for GEO weight derivation", 17. JVET MEETING; 20200107 - 20200117; BRUSSELS; (THE JOINT VIDEO EXPLORATION TEAM OF ISO/IEC JTC1/SC29/WG11 AND ITU-T SG.16 ), 10 January 2020 (2020-01-10), XP030223136 *
Y.-L. HSIAO, C.-C. CHEN, C.-W. HSU, Y.-W. HUANG, S.-M. LEI (MEDIATEK): "CE4-related: Simplification on geometric partitioning mode by replacing motion index calculation with subsampled weight information", 17. JVET MEETING; 20200107 - 20200117; BRUSSELS; (THE JOINT VIDEO EXPLORATION TEAM OF ISO/IEC JTC1/SC29/WG11 AND ITU-T SG.16 ), 30 December 2019 (2019-12-30), XP030222838 *

Also Published As

Publication number Publication date
EP4131954A1 (en) 2023-02-08
CN115380532A (zh) 2022-11-22
US20230052940A1 (en) 2023-02-16
TW202139694A (zh) 2021-10-16
CN113497942A (zh) 2021-10-12
EP4131954A4 (en) 2023-09-13

Similar Documents

Publication Publication Date Title
WO2021203841A1 (zh) 一种帧间预测方法、编码器、解码器及存储介质
WO2021196235A1 (zh) 帧间预测方法、编码器、解码器及存储介质
CN105432082A (zh) 用于兴趣区编码的运动约束图块集合
WO2021196242A1 (zh) 一种帧间预测方法、编码器、解码器及存储介质
TW202139700A (zh) 一種幀間預測方法、編碼器、解碼器及儲存媒介
WO2021238396A1 (zh) 帧间预测方法、编码器、解码器以及计算机存储介质
EP3984229A1 (en) Simplified downsampling for matrix based intra prediction
WO2021203924A1 (zh) 编码方法、解码方法、编码器、解码器以及存储介质
CN114342378A (zh) 关于利用光流的预测细化的方法和装置
CN113225562A (zh) 图像分量预测方法、编码器、解码器以及存储介质
CN118020300A (zh) 用于视频处理的方法、装置和介质
CN117616754A (zh) 用于视频处理的方法、设备和介质
WO2021196228A1 (zh) 帧间预测方法、编码器、解码器以及存储介质
US20230045687A1 (en) Inter Prediction Method, Encoder, Decoder, and Storage Medium
WO2021134627A1 (zh) 一种帧间预测方法、编码器、解码器及存储介质
CN114503561A (zh) 用于利用光流的预测细化、双向光流和解码器侧运动矢量细化的方法和装置
WO2022022278A1 (zh) 帧间预测方法、编码器、解码器以及计算机存储介质
CN118077194A (zh) 用于视频处理的方法、装置和介质
WO2024077569A1 (zh) 编解码方法、码流、编码器、解码器以及存储介质
WO2024119521A1 (zh) 编解码方法、码流、编码器、解码器以及存储介质
RU2815175C2 (ru) Составление списка наиболее вероятных режимов для матричного внутрикадрового предсказания
CN117678223A (zh) 视频处理的方法、装置和介质
TW202209893A (zh) 幀間預測方法、編碼器、解碼器以及電腦儲存媒介
CN117581538A (zh) 视频处理的方法、设备和介质
CN118525515A (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: 21785246

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2021785246

Country of ref document: EP

Effective date: 20221028

NENP Non-entry into the national phase

Ref country code: DE