Video encoding and decoding method and device based on motion vector angle prediction
By determining the list of MVAP candidate modes based on the peripheral sub-block prediction mode of the current encoding block and selecting the optimal mode, the problem of failure to fully consider the peripheral block prediction mode in the prior art is solved, and the video encoding performance is improved.
Patent Information
- Application Number
- CN201910501806.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-06-11
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2039-06-11
AI Technical Summary
The prior art fails to fully consider the impact of the prediction mode of the peripheral block of the current coded block on the encoding and decoding in video encoding, resulting in inaccurate export of motion information and affecting encoding performance.
By determining the candidate mode list of its MVAP based on the prediction mode of the peripheral subblock of the current coded block, and selecting the optimal MVAP mode according to the calculated encoding cost, the code stream is written to optimize the encoding process.
Improves encoding performance, reduces the overhead of motion information transmitted in the code stream, and improves the decoder's decoding performance.
Smart Images

Figure CN112073733B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to a video coding and decoding method and device based on motion vector angle prediction (MVAP), and more specifically, to a coding and decoding method and device based on MVAP for candidate mode selection and context model selection. Background Art
[0002] In natural videos, there is a high degree of similarity between images. Therefore, in order to remove information redundancy between images during video compression, inter-frame prediction is often performed. The so-called inter-frame prediction is to use the already encoded image to predict the current image to be encoded, and then pass the prediction error to the decoder. Compared with directly transmitting the content of the current image, the amount of information in the prediction error is much smaller, thus achieving the purpose of compression. In fact, when performing inter-frame prediction, the encoder needs to find a reference block that matches each image block as much as possible in the previously encoded reference image, so as to minimize the prediction error. The position difference between the current block and the reference block is called a motion vector, and the motion vector information also needs to be transmitted in the bitstream so that the decoder can know which block is the reference block of the current block.
[0003] With the continuous advancement of prediction technology, image prediction residuals are constantly decreasing, and the proportion of motion information such as motion vectors in the bitstream is constantly increasing. In order to reduce the overhead of transmitting motion information, skip mode, direct mode, merge mode and other modes have been proposed. In these modes, motion information is not transmitted in the bitstream, and the encoder and decoder directly derive motion information such as motion vectors of the current image block according to certain rules based on the motion information of the previously encoded image block. Although these modes can save the transmission of motion information, the rules for deriving motion information are fixed and need to be derived based on the motion information of the previously encoded image block. When the motion of the current image block is significantly different from that of the previous image block, the derived motion information is not suitable for the current block.
[0004] In recent years, a prediction technology called motion vector angle prediction (MVAP) has emerged. MVAP technology copies the motion information of the surrounding blocks of the current coding block to each sub-block of the current coding unit through several specific methods. MVAP technology has five prediction modes, namely horizontal prediction mode, horizontal upward prediction mode, horizontal downward prediction mode, vertical prediction mode, and vertical right prediction mode. The encoder and decoder can copy the motion information of the surrounding sub-blocks to each sub-block of the current coding unit according to the selected prediction mode, and then perform prediction and other operations on each sub-block. MVAP technology assigns different motion information to each sub-block according to fixed rules, thereby saving the motion information that needs to be transmitted in the bitstream and improving the coding performance.
[0005] Although the MVAP technology allocates different motion information to each sub-block of the current coding block, this allocation rule does not consider the impact of the prediction mode of the surrounding blocks of the current coding block on the current coding block, and has certain limitations.
[0006] On the other hand, in AVS3, MVAP technology is used in skip mode and direct mode. However, due to the uncertainty of candidate modes in the candidate list in MVAP technology (for example, uncertain number of candidate modes and uncertain mode type), the MVAP candidate list needs to be reconstructed during the decoding process, affecting the decoding performance of the decoder. Summary of the invention
[0007] Aspects of the present disclosure will at least solve the above-mentioned problems and / or disadvantages, and at least provide the advantages described below. Therefore, an object of the present invention is to provide a video coding method and apparatus based on MVAP, which can consider the influence of the prediction mode of the surrounding blocks of the current coding block on the coding and decoding of the current coding block, and design a coding method more suitable for MVAP according to the characteristics of MVAP technology, thereby improving the coding and decoding performance.
[0008] An aspect of the present invention is to provide a video encoding method based on motion vector angle prediction MVAP, the method may include: determining a candidate mode list of MVAP of a current coding block according to prediction modes of surrounding sub-blocks of the current coding block, wherein the candidate mode list includes multiple MVAP modes; determining one MVAP mode among the multiple MVAP modes as the MVAP mode of the current coding block; and writing mode information corresponding to the one MVAP mode into a bitstream.
[0009] Optionally, the step of determining the candidate mode list of the MVAP of the current coding block may include: when the prediction mode of the upper sub-block of the current coding block is the number α of the sub-blocks of the intra-frame prediction mode ca and the number of unavailable sub-blocks in the upper sub-block of the current coding block βca The sum of α ca +β ca The number of sub-blocks above the current coding block γ c The ratio (α ca +β ca ) / γ c When it is greater than a preset threshold, the number of candidate modes in the candidate mode list is reduced to a predetermined number or the priorities of the candidate modes in the candidate mode list are reordered, wherein the unavailable sub-block represents a sub-block that has not been encoded.
[0010] Optionally, the step of determining the candidate mode list of the MVAP of the current coding block may include: when the prediction mode of the left sub-block of the current coding block is the number α of the sub-blocks of the intra-frame prediction mode cl and the number of unavailable sub-blocks in the left sub-block of the current coding block β cl The sum of α cl +β cl The number of sub-blocks to the left of the current coding block γ c The ratio (α cl +β cl ) / γ c When it is greater than a preset threshold, the number of candidate modes in the candidate mode list is reduced to a predetermined number or the priorities of the candidate modes in the candidate mode list are reordered, wherein the unavailable sub-block represents a sub-block that has not been encoded.
[0011] Optionally, the step of determining one MVAP mode among the multiple MVAP modes as the MVAP mode of the current coding block may include: respectively calculating the coding cost of encoding the current coding block with each MVAP mode among the multiple MVAP modes; and determining the one MVAP mode based on the calculated coding cost.
[0012] Optionally, the mode information corresponding to the MVAP mode is the index value of the MVAP mode in the candidate mode list.
[0013] Another aspect of the present disclosure is to provide a video decoding method based on motion vector angle prediction MVAP, the method may include: parsing the MVAP mode information of the current coding block from the bit stream; determining a candidate mode list of the MVAP of the current coding block according to the prediction modes of the surrounding sub-blocks of the current coding block, wherein the candidate mode list includes multiple MVAP modes; determining the motion information of the current coding block according to the candidate mode list and the parsed MVAP mode information of the current coding block.
[0014] Optionally, the MVAP mode information is an index value of the MVAP mode in the candidate mode list.
[0015] Optionally, the step of determining the candidate mode list of the MVAP of the current coding block according to the prediction modes of the surrounding sub-blocks of the current coding block may include: when the prediction mode of the upper sub-block of the current coding block is the number of sub-blocks α of the intra-frame prediction mode da and the number of unavailable sub-blocks in the upper sub-block of the current coding block β da The sum of α da +β da The number of sub-blocks above the current coding block γ d The ratio (α da +β da ) / γ d When it is greater than a preset threshold, the number of candidate modes in the candidate mode list is reduced to a predetermined number or the priorities of the candidate modes in the candidate mode list are reordered, wherein the unavailable sub-block represents a sub-block that has not been decoded.
[0016] Optionally, the step of determining the candidate mode list of the MVAP of the current coding block may include: when the prediction mode of the left sub-block of the current coding block is the number α of the sub-blocks of the intra-frame prediction mode dl and the number of unavailable sub-blocks in the left sub-block of the current coding block β dl The sum of α dl +β dl The number of sub-blocks to the left of the current coding block γ d The ratio (α dl +β dl ) / γ d When it is greater than a preset threshold, the number of candidate modes in the candidate mode list is reduced to a predetermined number or the priorities of the candidate modes in the candidate mode list are reordered, wherein the unavailable sub-block represents a sub-block that has not been decoded.
[0017] Optionally, the step of determining the motion information of the current coding block based on the candidate mode list and the parsed MVAP mode information of the current coding block may include: determining the MVAP mode in the candidate mode list having the same MVAP mode information as the MVAP mode of the current coding block, and obtaining the motion information of the current coding block based on the determined MVAP mode of the current coding block.
[0018] Another aspect of the present disclosure is to provide a video encoding method based on motion vector angle prediction MVAP, the method may include: determining whether to encode the current coding block through MVAP according to the prediction mode of the surrounding sub-blocks of the current coding block; in response to determining that the current coding block is not encoded in MVAP mode, determining not to transmit an MVAP flag in the bitstream, wherein the flag indicates whether the current coding block is encoded through MVAP.
[0019] Optionally, the step of determining whether to encode the current coding block in the MVAP mode according to the prediction mode of the surrounding sub-blocks of the current coding block may include: when the prediction mode of the surrounding sub-blocks of the current coding block is the number of sub-blocks α in the intra-frame prediction mode c and the number of unavailable sub-blocks in the surrounding sub-blocks of the current coding block β c The sum of α c +β c The number of surrounding sub-blocks of the current coding block γ c The ratio (α c +β c ) / γ c When it is greater than a preset threshold, it is determined not to encode the current coding block through MVAP, wherein the unavailable sub-block represents a sub-block that has not been encoded.
[0020] Another aspect of the present disclosure is to provide a video decoding method based on motion vector angle prediction MVAP, the method may include: determining whether to parse the MVAP identifier of the current coding block from the bitstream according to the prediction mode of the surrounding sub-blocks of the current coding block, wherein the identifier indicates whether the current coding block is encoded through MVAP; in response to determining not to parse the MVAP identifier of the current coding block from the bitstream, determining not to decode the current coding block through MVAP.
[0021] Optionally, the step of determining whether to parse the identifier of the MVAP of the current coding block from the bitstream according to the prediction mode of the surrounding sub-blocks of the current coding block may include: when the prediction mode of the surrounding sub-blocks of the current coding block is the number of sub-blocks α in the intra-frame prediction mode c and the number of unavailable sub-blocks in the surrounding sub-blocks of the current coding block β c The sum of α c +β c The number of surrounding sub-blocks of the current coding block γ c The ratio (α c +β c ) / γ c When it is greater than a preset threshold, it is determined not to parse the identifier of the MVAP of the current coding block from the bitstream, wherein the unavailable sub-block represents a sub-block that has not been decoded.
[0022] An aspect of the present disclosure is to provide a video encoding method based on a skip mode or a direct mode, the method may include: classifying the skip mode or the direct mode into multiple encoding modes, wherein each of the multiple encoding modes includes multiple sub-modes; determining a sub-mode in one of the multiple encoding modes as an optimal encoding mode for a current encoding block; and writing encoding mode information corresponding to the one encoding mode and sub-mode information corresponding to the one sub-mode into a bitstream.
[0023] Optionally, the step of classifying the skip mode or the direct mode into multiple coding modes includes classifying the skip mode or the direct mode into multiple coding modes in one of the following three classification methods: a first classification method: advanced motion vector expression mode, affine skip mode, spatial and temporal skip mode, history-based motion vector prediction mode and motion vector angle prediction mode, wherein the spatial and temporal skip mode includes spatial skip mode and temporal skip mode; a second classification method: advanced motion vector expression mode, sub-block mode, spatial, temporal and historical skip mode, wherein the spatial, temporal and historical skip mode includes spatial skip mode, temporal skip mode and historical skip mode, the sub-block mode includes affine mode and motion vector angle prediction mode, the affine motion mode and the motion vector angle prediction mode have different candidate mode lists, and the spatial, temporal and historical skip mode It includes spatial motion vector, temporal motion vector and history-based motion vector, and the spatial skip mode, temporal skip mode and historical skip mode in the spatial, temporal and historical skip modes share a candidate motion vector list; the third classification method: advanced motion vector expression mode, sub-block mode, spatial, temporal and historical skip mode, wherein the spatial, temporal and historical skip modes include spatial skip mode, temporal skip mode and historical skip mode, the sub-block mode includes affine motion mode and motion vector angle prediction mode, and the affine motion mode and motion vector angle prediction mode share a candidate mode list, the spatial, temporal and historical skip modes include spatial motion vector, temporal motion vector and history-based motion vector, and the spatial skip mode, temporal skip mode and historical skip mode in the spatial, temporal and historical skip modes share a candidate motion vector list.
[0024] Optionally, the coding mode information and the sub-mode information are respectively an index value corresponding to the one coding mode and an index value corresponding to the one sub-mode.
[0025] Another aspect of the present disclosure is to provide a video decoding method based on skip mode or direct mode, the method may include: parsing the coding mode information of the coding block corresponding to the current coding block and the sub-mode information of the coding mode from the code stream; classifying the skip mode or direct mode into multiple coding modes, wherein each of the multiple coding modes includes multiple sub-modes; determining the coding mode corresponding to the coding mode information in the coding mode obtained by classification as the coding mode of the current coding block, and determining the sub-mode corresponding to the sub-mode information in the determined coding mode of the current coding block as the sub-mode of the coding mode of the current coding block; and determining the motion information of the current coding block based on the determined coding mode and sub-mode of the current coding block.
[0026] Optionally, the coding mode information and the sub-mode information are respectively an index value corresponding to the one coding mode and an index value corresponding to the one sub-mode.
[0027] Another aspect of the present disclosure is to provide a video encoding method for context model selection based on motion vector angle prediction, the method may include: binarizing pattern information corresponding to the MVAP mode according to the prediction mode of the surrounding sub-blocks of the current coding block, wherein the first binary symbol of the binarized pattern information indicates whether the MVAP mode is a horizontal class mode or a vertical class mode, and the context model corresponding to the first binary symbol indicates the probability of occurrence of the horizontal class mode or the vertical class mode; writing the binarized pattern information corresponding to the MVAP mode of the current coding block into the bitstream according to the context model including the context model.
[0028] Optionally, the step of binarizing the mode information corresponding to the MVAP mode according to the prediction mode of the surrounding sub-blocks of the current coding block may include: when the prediction mode of the upper sub-block of the current coding block is the number α of the sub-blocks in the intra-frame prediction mode ca and the number of unavailable sub-blocks in the upper sub-block of the current coding block β ca The sum of α ca +β ca The number of sub-blocks above the current coding block γ c The ratio (α ca +β ca ) / γc is greater than the preset threshold or when the prediction mode of the left sub-block of the current coding block is the number of sub-blocks in the intra-frame prediction mode α cl and the number of unavailable sub-blocks in the left sub-block of the current coding block β cl The sum of α cl +β cl The number of sub-blocks to the left of the current coding block γ c The ratio (α cl +β cl) / γ c When it is greater than a preset threshold, the mode information corresponding to the MVAP prediction mode is binarized.
[0029] Another aspect of the present disclosure is to provide a video decoding method for context model selection based on motion vector angle prediction, the method may include: determining a context model according to the prediction mode of the surrounding sub-blocks of the current coding block, wherein the context model corresponding to the first binary symbol in the determined context model indicates the probability of the horizontal class mode or the vertical class mode occurring; parsing the mode information corresponding to the MVAP mode of the current coding block from the bitstream according to the determined context model. Optionally, the step of determining the context model according to the prediction mode of the surrounding sub-blocks of the current coding block may include: when the prediction mode in the upper sub-block of the current coding block is the number of sub-blocks α of the intra-frame prediction mode ca and the number of unavailable sub-blocks in the upper sub-block of the current coding block β ca The sum of α ca +β ca The number of sub-blocks above the current coding block γ c The ratio (α ca +β ca ) / γ c The number of sub-blocks α that are greater than a preset threshold or when the prediction mode in the left sub-block of the current coding block is the intra-frame prediction mode cl and the number of unavailable sub-blocks in the left sub-block of the current coding block β cl The sum of α cl +β cl The number of sub-blocks to the left of the current coding block γ c The ratio (α cl +β cl ) / γ c When it is greater than a preset threshold, it is determined that the context model corresponding to the first binary symbol indicates the probability of the occurrence of a horizontal class pattern or a vertical class pattern.
[0030] Another aspect of the present disclosure is to provide a video encoding device based on motion vector angle prediction MVAP, the video encoding device may include: a candidate list determination unit, configured to determine a candidate mode list of MVAP of a current coding block according to prediction modes of peripheral sub-blocks of the current coding block, wherein the candidate mode list includes multiple MVAP modes; an MVAP mode determination unit, configured to determine one MVAP mode among the multiple MVAP modes as the MVAP mode of the current coding block; and a writing unit, configured to write mode information corresponding to the one MVAP mode into a bitstream.
[0031] Optionally, the candidate list determination unit may be configured to: when the number of sub-blocks whose prediction mode in the upper sub-block of the current coding block is the intra-frame prediction mode is α ca and the number of unavailable sub-blocks in the upper sub-block of the current coding block β ca The sum of α ca +β ca The number of sub-blocks above the current coding block γ c The ratio (α ca +β ca ) / γ c When it is greater than a preset threshold, the number of candidate modes in the candidate mode list is reduced to a predetermined number or the priorities of the candidate modes in the candidate mode list are reordered, wherein the unavailable sub-block represents a sub-block that has not been encoded.
[0032] Optionally, the candidate list determination unit may be configured to: when the number of sub-blocks whose prediction mode in the left sub-block of the current coding block is the intra-frame prediction mode is α cl and the number of unavailable sub-blocks in the left sub-block of the current coding block β cl The sum of α cl +β cl The number of sub-blocks to the left of the current coding block γ c The ratio (α cl +β cl ) / γ c When it is greater than a preset threshold, the number of candidate modes in the candidate mode list is reduced to a predetermined number or the priorities of the candidate modes in the candidate mode list are reordered, wherein the unavailable sub-block represents a sub-block that has not been encoded.
[0033] Optionally, the MVAP mode determination unit may be configured to: respectively calculate the coding cost of encoding the current coding block in each of the multiple MVAP modes; and determine the one MVAP mode based on the calculated coding cost.
[0034] Optionally, the mode information corresponding to the MVAP mode is the index value of the MVAP mode in the candidate mode list.
[0035] Another aspect of the present disclosure is to provide a video decoding device based on motion vector angle prediction MVAP, the video decoding device may include: a code stream parsing unit, configured to parse the code stream to obtain MVAP mode information of the current coding block; a candidate list determination unit, configured to determine a candidate mode list of MVAP of the current coding block according to the prediction mode of the surrounding sub-blocks of the current coding block, wherein the candidate mode list includes multiple MVAP modes; a motion information determination unit, configured to determine the motion information of the current coding block according to the candidate mode list and the parsed MVAP mode information of the current coding block.
[0036] Optionally, the MVAP mode information is an index value of the MVAP mode in the candidate mode list.
[0037] Optionally, the candidate list determination unit may be configured to: when the number of sub-blocks whose prediction mode in the upper sub-block of the current coding block is the intra-frame prediction mode is α da and the number of unavailable sub-blocks in the upper sub-block of the current coding block β da The sum of α da +β da The number of sub-blocks above the current coding block γ d The ratio (α da +β da ) / γ d When it is greater than a preset threshold, the number of candidate modes in the candidate mode list is reduced to a predetermined number or the priorities of the candidate modes in the candidate mode list are reordered, wherein the unavailable sub-block represents a sub-block that has not been decoded.
[0038] Optionally, the candidate list determination unit may be configured to: when the number of sub-blocks whose prediction mode in the left sub-block of the current coding block is the intra-frame prediction mode is α dl and the number of unavailable sub-blocks in the left sub-block of the current coding block β dl The sum of α dl +β dl The number of sub-blocks to the left of the current coding block γ d The ratio (α dl +β dl ) / γ d When it is greater than a preset threshold, the number of candidate modes in the candidate mode list is reduced to a predetermined number or the priorities of the candidate modes in the candidate mode list are reordered, wherein the unavailable sub-block represents a sub-block that has not been decoded.
[0039] Optionally, the motion information determination unit may be configured to: determine an MVAP mode in the candidate mode list having the same MVAP mode information as the MVAP mode of the current coding block, and obtain the motion information of the current coding block based on the determined MVAP mode of the current coding block.
[0040] Another aspect of the present disclosure is to provide a video encoding device based on motion vector angle prediction MVAP, the video encoding device may include: an encoding determination unit, configured to determine whether to encode the current coding block through MVAP according to the prediction mode of the surrounding sub-blocks of the current coding block; a code stream transmission determination unit, configured to determine an identifier of not transmitting MVAP in the code stream in response to determining that the current coding block is not encoded in the MVAP mode, wherein the identifier indicates whether the current coding block is encoded through MVAP.
[0041] Optionally, the encoding determination unit may be configured to: when the number α of sub-blocks whose prediction mode in the peripheral sub-blocks of the current coding block is the intra-frame prediction mode c and the number of unavailable sub-blocks in the surrounding sub-blocks of the current coding block β c The sum of α c +β c The number of surrounding sub-blocks of the current coding block γ c The ratio (α c +β c ) / γ c When it is greater than a preset threshold, it is determined not to encode the current coding block through MVAP, wherein the unavailable sub-block represents a sub-block that has not been encoded.
[0042] Another aspect of the present disclosure is to provide a video decoding device based on motion vector angle prediction MVAP, the video decoding device may include: a code stream parsing determination unit, configured to determine whether to parse the MVAP identifier of the current coding block from the code stream according to the prediction mode of the surrounding sub-blocks of the current coding block, wherein the identifier indicates whether the current coding block is encoded through the MVAP; a decoding determination unit, in response to determining not to parse the MVAP identifier of the current coding block from the code stream, determines not to decode the current coding block through the MVAP.
[0043] Optionally, the code stream parsing determination unit may be configured to: when the number of sub-blocks whose prediction mode in the surrounding sub-blocks of the current coding block is the intra-frame prediction mode is α c and the number of unavailable sub-blocks in the surrounding sub-blocks of the current coding block β c The sum of α c +β c The number of surrounding sub-blocks of the current coding block γ c The ratio (α c+β c ) / γ c When it is greater than a preset threshold, it is determined not to parse the identifier of the MVAP of the current coding block from the bitstream, wherein the unavailable sub-block represents a sub-block that has not been decoded.
[0044] Another aspect of the present disclosure is to provide a video encoding device based on a skip mode or a direct mode, the video encoding device may include: a mode classification unit, configured to classify the skip mode or the direct mode into multiple encoding modes, wherein each of the multiple encoding modes includes multiple sub-modes; an optimal encoding mode determination unit, configured to determine a sub-mode in one of the multiple encoding modes as the optimal encoding mode for a current encoding block; and a code stream writing unit, configured to write encoding mode information corresponding to the one encoding mode and sub-mode information corresponding to the one sub-mode into a code stream.
[0045] Optionally, the mode classification unit may be configured to classify the skip mode or the direct mode into multiple coding modes in one of the following three classification methods: a first classification method: an advanced motion vector expression mode, an affine skip mode, a spatial and temporal skip mode, a history-based motion vector prediction mode, and a motion vector angle prediction mode, wherein the spatial and temporal skip mode includes a spatial skip mode and a temporal skip mode; a second classification method: an advanced motion vector expression mode, a sub-block mode, a spatial, temporal, and historical skip mode, wherein the spatial, temporal, and historical skip mode includes a spatial skip mode, a temporal skip mode, and a historical skip mode, the sub-block mode includes an affine mode and a motion vector angle prediction mode, the affine motion mode and the motion vector angle prediction mode have different candidate mode lists, and the spatial, temporal, and historical skip modes include spatial motion vectors. The third classification method is as follows: advanced motion vector expression mode, sub-block mode, spatial, temporal and historical skip modes, wherein the spatial, temporal and historical skip modes include spatial skip mode, temporal skip mode and historical skip mode, the sub-block mode includes affine motion mode and motion vector angle prediction mode, and the affine motion mode and motion vector angle prediction mode share a candidate mode list, the spatial, temporal and historical skip modes include spatial motion vector, temporal motion vector and history-based motion vector, and the spatial skip mode, temporal skip mode and historical skip mode share a candidate motion vector list.
[0046] Optionally, the coding mode information and the sub-mode information are respectively an index value corresponding to the one coding mode and an index value corresponding to the one sub-mode.
[0047] Another aspect of the present disclosure is to provide a video decoding device based on skip mode or direct mode, and the video decoding device may include: a code stream parsing unit, configured to parse the coding mode information of the coding block corresponding to the current coding block and the sub-mode information of the coding mode from the code stream; a mode classification unit, configured to classify the skip mode or direct mode into multiple coding modes, wherein each of the multiple coding modes includes multiple sub-modes; a mode determination unit, configured to determine the coding mode corresponding to the coding mode information in the coding mode obtained by classification as the coding mode of the current coding block, and determine the sub-mode corresponding to the sub-mode information in the determined coding mode of the current coding block as the sub-mode of the coding mode of the current coding block; a motion information determination unit, configured to determine the motion information of the current coding block based on the determined coding mode and sub-mode of the current coding block.
[0048] Optionally, the coding mode information and the sub-mode information are respectively an index value corresponding to the one coding mode and an index value corresponding to the one sub-mode.
[0049] Another aspect of the present disclosure is to provide a video encoding device for context model selection based on motion vector angle prediction, the video encoding device may include: a binarization unit, configured to binarize pattern information corresponding to the MVAP mode according to the prediction mode of the surrounding sub-blocks of the current coding block, wherein the first binary symbol of the binarized pattern information indicates whether the MVAP mode is a horizontal class mode or a vertical class mode, and the context model corresponding to the first binary symbol indicates the probability of occurrence of the horizontal class mode or the vertical class mode; a code stream writing unit, configured to write the binarized pattern information corresponding to the MVAP mode of the current coding block into the code stream according to the context model including the context model.
[0050] Optionally, the binarization unit may be configured as follows: when the number of sub-blocks whose prediction mode in the upper sub-block of the current coding block is the intra-frame prediction mode is α ca and the number of unavailable sub-blocks in the upper sub-block of the current coding block β ca The sum of α ca +β ca The number of sub-blocks above the current coding block γ c The ratio (α ca +β ca ) / γ c The number of sub-blocks α that are greater than a preset threshold or when the prediction mode in the left sub-block of the current coding block is the intra-frame prediction mode cl and the number of unavailable sub-blocks in the left sub-block of the current coding block β cl The sum of αcl +β cl The number of sub-blocks to the left of the current coding block γ c The ratio (α cl +β cl ) / γc is greater than a preset threshold, the mode information corresponding to the MVAP prediction mode is binarized.
[0051] Another aspect of the present disclosure is to provide a video decoding device for context model selection based on motion vector angle prediction, the video decoding device may include: a context model determination unit, configured to determine the context model according to the prediction mode of the surrounding sub-blocks of the current coding block, wherein the context model corresponding to the first binary symbol in the determined context model indicates the probability of the horizontal class mode or the vertical class mode occurring; a code stream parsing unit, configured to parse the code stream according to the determined context model to obtain mode information corresponding to the MVAP mode of the current coding block. Optionally, the context model determination unit may be configured to: when the prediction mode in the upper sub-block of the current coding block is the number α of the sub-blocks of the intra-frame prediction mode ca and the number of unavailable sub-blocks in the upper sub-block of the current coding block β ca The sum of α ca +β ca The number of sub-blocks above the current coding block γ c The ratio (α ca +β ca ) / γ c The number of sub-blocks α that are greater than a preset threshold or when the prediction mode in the left sub-block of the current coding block is the intra-frame prediction mode cl and the number of unavailable sub-blocks in the left sub-block of the current coding block β cl The sum of α cl +β cl The number of sub-blocks to the left of the current coding block γ c The ratio (α cl +β cl ) / γ c When it is greater than a preset threshold, it is determined that the context model corresponding to the first binary symbol indicates the probability of the occurrence of a horizontal class pattern or a vertical class pattern.
[0052] Another aspect of the present disclosure is to provide a computer-readable storage medium, wherein a computer program is stored thereon, and when the program is executed, the video encoding and decoding method as described above can be implemented.
[0053] Another aspect of the present disclosure is to provide a coding and decoding device, which may include: a processor; a memory storing a computer program, and when the computer program is executed by the processor, the video coding and decoding method as described above is implemented.
[0054] The present invention optimizes the candidate list and context model of the angle motion vector mode of the current coding block according to the prediction mode of the surrounding sub-blocks of the current coding block, reduces the overhead caused by each mode in the candidate list, and improves the coding performance.
[0055] In addition, compared with directly encoding each candidate index value of MVAP in skip mode and direct mode, the present invention designs a coding method that is more suitable for MVAP based on the characteristics of MVAP technology, which can reduce the number of times the MVAP candidate list is constructed, shorten the length of the pipeline in hardware implementation, and effectively improve the decoding performance of the decoder. This coding method that is more suitable for MVAP can also improve the coding performance.
[0056] Additional aspects and / or advantages of the present general inventive concept will be set forth in part in the following description and in part will be obvious from the description, or may be learned through practice of the present general inventive concept. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] The above and other aspects, features and advantages of certain embodiments of the present disclosure will become more apparent from the following description taken in conjunction with the accompanying drawings, in which:
[0058] Figure 1 is a schematic diagram showing video coding based on MVAP in the prior art;
[0059] Figure 2 is a flowchart illustrating a video encoding method based on MVAP according to an embodiment of the present disclosure;
[0060] Figure 3 is a schematic diagram showing how to determine a candidate mode list of a current coding block according to prediction modes of surrounding sub-blocks according to an embodiment of the present disclosure;
[0061] Figure 4 is a schematic diagram showing reordering of candidate modes in a candidate mode list according to prediction modes of surrounding sub-blocks according to an embodiment of the present disclosure;
[0062] Figure 5 is a schematic diagram showing how to determine a candidate mode list of a current coding block according to prediction modes of peripheral sub-blocks of the current coding block according to an embodiment of the present disclosure;
[0063] Figure 6 A schematic diagram showing reordering of candidate modes in a candidate mode list according to prediction modes of surrounding sub-blocks according to an embodiment of the present disclosure;
[0064] Figure 7 is a flowchart illustrating a video decoding method based on MVAP according to an embodiment of the present disclosure;
[0065] Figure 8 is a flowchart illustrating a video encoding method based on MVAP according to an embodiment of the present disclosure;
[0066] Fig. 9 is a flowchart illustrating a video decoding method based on MVAP according to an embodiment of the present disclosure;
[0067] Fig.10 is a flowchart illustrating an encoding method based on a skip mode or a direct mode according to an embodiment of the present disclosure;
[0068] Fig.11 is a flowchart illustrating a decoding method based on skip mode or direct mode according to an embodiment of the present disclosure;
[0069] Fig.12 is a flowchart illustrating an encoding method for context model selection based on MVAP according to an embodiment of the present disclosure;
[0070] Fig.13 is a flowchart illustrating a decoding method for context model selection based on MVAP according to an embodiment of the present disclosure;
[0071] Fig.14 is a block diagram showing a video encoding apparatus based on MVAP according to an embodiment of the present disclosure;
[0072] Fig.15 is a block diagram showing a video decoding apparatus based on MVAP according to an embodiment of the present disclosure;
[0073] Fig.16 is a block diagram showing a video encoding apparatus based on MVAP according to an embodiment of the present disclosure;
[0074] Fig.17 is a block diagram showing a video decoding apparatus based on MVAP according to an embodiment of the present disclosure;
[0075] Fig.18 is a block diagram illustrating an encoding apparatus based on a skip mode or a direct mode according to an embodiment of the present disclosure;
[0076] Fig.19 is a block diagram showing a decoding apparatus based on a skip mode or a direct mode according to an embodiment of the present disclosure;
[0077] Fig. 20 A block diagram showing an encoding device for context model selection based on motion vector angle prediction according to an embodiment of the present disclosure;
[0078] Fig.21 is a block diagram illustrating a decoding apparatus for context model selection based on motion vector angle prediction according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0079] Reference will now be made in detail to embodiments of the present invention, examples of which are shown in the accompanying drawings, wherein like reference numerals refer to like elements throughout. The embodiments will be described below with reference to the drawings in order to explain the present invention.
[0080] Figure 1 is a schematic diagram showing a video encoding method based on MVAP in the prior art.
[0081] Reference Figure 1 In the existing MVAP technology, the candidate mode list of the current coding block generally includes 5 prediction modes, namely horizontal mode, vertical mode, horizontal upward mode, horizontal downward mode, and vertical right prediction mode, which correspond to index values 0, 1, 2, 3, and 4 respectively. According to the selected prediction mode, the motion information of the surrounding sub-blocks can be copied to each sub-block of the current coding unit, and then prediction and other operations can be performed on each sub-block. The MVAP technology allocates different motion information to each sub-block according to fixed rules, thereby saving the motion information that needs to be transmitted in the code stream and improving the coding performance.
[0082] When determining which prediction mode in the candidate mode list is used for the current coding block, it is necessary to calculate the coding cost of the current coding block for each of the five prediction modes, and by comparing the calculated coding costs, determine the prediction mode corresponding to the minimum coding cost as the prediction mode of the current coding block. Since the existing MVAP technology does not consider the impact of the prediction mode of the surrounding sub-blocks of the current coding block on the current coding block, it is necessary to traverse each of the five prediction modes to determine which prediction mode has the minimum coding cost.
[0083] Figure 2 is a flowchart illustrating a video encoding method based on MVAP according to an embodiment of the present disclosure.
[0084] In step S20, a candidate mode list of MVAP of the current coding block is determined according to the prediction modes of the surrounding sub-blocks of the current coding block.
[0085] As an example, when the prediction mode of the upper sub-block of the current coding block is the number of sub-blocks in the intra-frame prediction mode α ca and the number of unavailable sub-blocks in the upper sub-block of the current coding block β ca The sum of α ca +β ca The number of sub-blocks above the current coding block γ c The ratio (α ca +β ca ) / γ cWhen it is greater than a preset threshold, the number of candidate modes in the candidate mode list can be reduced from the original 5 to 3. For example, the candidate mode list can be reduced to include only the following three modes: horizontal mode, horizontal up mode, and horizontal down mode, wherein the order of the three modes in the candidate mode list is not limited, wherein the unavailable sub-block represents a sub-block that has not been encoded.
[0086] Optionally, the candidate modes in the candidate mode list may be reduced from the original 5 to another number.
[0087] Figure 3 is a schematic diagram showing how to determine a candidate mode list of a current coding block according to prediction modes of surrounding sub-blocks according to an embodiment of the present disclosure.
[0088] Reference Figure 3 , when the prediction mode in the upper sub-block of the current coding block is the number of sub-blocks in intra-frame prediction mode α ca and the number of unavailable sub-blocks in the upper sub-block of the current coding block β ca The sum of α ca +β ca The number of sub-blocks above the current coding block γ c The ratio (α ca +β ca ) / γ c When it is greater than a preset threshold (for example, the upper sub-block is an unavailable sub-block or the prediction mode of the upper sub-block is intra-frame prediction), the candidate modes in the candidate mode list are determined in order: horizontal mode, horizontal upward mode and horizontal downward mode, which can correspond to index values 0, 1, and 2 respectively.
[0089] In the case that the candidate mode list includes only three prediction modes, only the three prediction modes in the candidate mode list may be traversed to calculate the encoding cost of each prediction mode to determine the prediction mode of the current coding block.
[0090] As another example, when the prediction mode of the upper sub-block of the current coding block is the number of sub-blocks in the intra-frame prediction mode α ca and the number of unavailable sub-blocks in the upper sub-block of the current coding block β ca The sum of α ca +β ca The number of sub-blocks above the current coding block γ c The ratio (α ca +β ca ) / γ cWhen the value is greater than a preset threshold, the priority of the candidate modes in the candidate mode list may be reordered. At this time, the number of prediction modes in the candidate mode list does not change, but only the order changes. As an example, the candidate mode list may be ordered into one of the following three orders: horizontal mode, horizontal upward mode, horizontal downward mode, vertical mode, and vertical right mode; horizontal mode, horizontal downward mode, horizontal upward mode, vertical mode, and vertical right mode; horizontal downward mode, horizontal mode, horizontal upward mode, vertical mode, and vertical right mode.
[0091] Figure 4 is a schematic diagram showing reordering of candidate modes in a candidate mode list according to prediction modes of neighboring sub-blocks according to an embodiment of the present disclosure.
[0092] Reference Figure 4 , since the number of sub-blocks with inter-frame prediction mode in the upper sub-block of the current coding block is small, that is, the proportion of sub-blocks with inter-frame prediction mode in the upper sub-block is too small, the number of sub-blocks with intra-frame prediction mode in the upper sub-block of the current coding block is α ca and the number of unavailable sub-blocks in the upper sub-block of the current coding block β ca The sum of α ca +β ca The number of sub-blocks above the current coding block γ c The ratio (α ca +β ca ) / γ c If the value is greater than a preset threshold, the candidate modes in the candidate mode list may be reordered into: horizontal mode, horizontal upward mode, horizontal downward mode, vertical mode and vertical right mode, corresponding to index values 0, 1, 2, 3 and 4 respectively.
[0093] As another example, when the prediction mode of the left sub-block of the current coding block is the number of sub-blocks in the intra-frame prediction mode α cl and the number of unavailable sub-blocks in the left sub-block of the current coding block β cl The sum of α cl +β cl The number of sub-blocks to the left of the current coding block γ c The ratio (α cl +β cl ) / γ c When it is greater than a preset threshold, the number of candidate modes in the candidate mode list is reduced from the original five to three. For example, the candidate mode list can be determined to include only the following three prediction modes: vertical mode, vertical right mode and horizontal upward mode, wherein the order of the three prediction modes is not limited, wherein the unavailable sub-block represents a sub-block that has not been encoded.
[0094] Optionally, the number of candidate modes in the candidate mode list may be reduced from the original five to another number.
[0095] Figure 5 is a schematic diagram showing how to determine a candidate mode list of a current coding block according to prediction modes of peripheral sub-blocks of the current coding block according to an embodiment of the present disclosure.
[0096] Reference Figure 5 , when the prediction mode in the left sub-block of the current coding block is the number of sub-blocks in intra-frame prediction mode α cl and the number of unavailable sub-blocks in the left sub-block of the current coding block β cl The sum of α cl +β cl The number of sub-blocks to the left of the current coding block γ c The ratio (α cl +β cl ) / γ c When it is greater than a preset threshold (for example, when the left sub-block is an unavailable sub-block or the prediction mode of the left sub-block is intra-frame prediction), the candidate mode list of the current coding block may be determined to include only: vertical mode, vertical right mode and horizontal upward mode, and correspond to index values 0, 1, and 2 respectively. In this case, only the three prediction modes in the candidate mode list may be traversed to calculate the encoding cost corresponding to each prediction mode to determine the prediction mode of the current coding block.
[0097] As another example, when the prediction mode of the left sub-block of the current coding block is the number of sub-blocks in the intra-frame prediction mode α cl and the number of unavailable sub-blocks in the left sub-block of the current coding block β cl The sum of α cl +β cl The number of sub-blocks to the left of the current coding block γ c The ratio (α cl +β cl ) / γ c When the value is greater than a preset threshold, the priority of the candidate modes in the candidate mode list may be reordered. At this time, the number of prediction modes in the candidate mode list does not change, but only the order changes. As an example, the candidate modes in the candidate mode list may be ordered into one of the following three orders: vertical mode, horizontal upward mode, vertical right mode, horizontal mode, and horizontal downward mode; vertical mode, vertical right mode, horizontal upward mode, horizontal mode, and horizontal downward mode; vertical right mode, horizontal upward mode, vertical mode, horizontal mode, and horizontal downward mode.
[0098] Figure 6A schematic diagram showing reordering candidate modes in a candidate mode list according to prediction modes of surrounding sub-blocks according to an embodiment of the present disclosure.
[0099] Reference Figure 6 , since the number of sub-blocks with inter-frame prediction mode in the left sub-block of the current coding block is small, that is, the proportion of the number of sub-blocks with inter-frame prediction mode in the left sub-block to the total number of sub-blocks on the left is too small, the number of sub-blocks with intra-frame prediction mode in the left sub-block of the current coding block is α cl and the number of unavailable sub-blocks in the left sub-block of the current coding block β cl The sum of α cl +β cl The number of sub-blocks to the left of the current coding block γ c The ratio (α cl +β cl ) / γ c If the value is greater than a preset threshold, the candidate mode list of the current coding block can be reordered into: vertical mode, vertical right mode, horizontal upward mode, horizontal mode and horizontal downward mode, corresponding to index values 0, 1, 2, 3 and 4 respectively.
[0100] Return again Figure 1 In step S21, a candidate mode in the candidate mode list is determined as the prediction mode of the current coding block.
[0101] Specifically, as described above, the number of candidate modes in the candidate mode list may be changed or the order of the candidate modes in the candidate mode list may be changed to determine the candidate mode list of the current coding block.
[0102] Optionally, the coding cost of encoding the current coding block in each MVAP mode of the multiple MVAP modes may be calculated respectively; and based on the calculated coding cost, the one MVAP mode may be determined.
[0103] As an example, all modes in the candidate mode list can be traversed, and for the modes in the list, the motion information of each sub-block of the current coding block can be obtained, and then the coding cost under the mode can be obtained through motion compensation, and finally the prediction mode of the current coding block can be determined by comparing the coding costs under each mode. For example, when the candidate mode list includes the horizontal mode, and the calculated coding cost under the horizontal mode is the smallest, the horizontal mode is determined as the prediction mode of the current coding block.
[0104] In step S22, mode information corresponding to the determined prediction mode of the current coding block is written into the bitstream.
[0105] As an example, the index value of the prediction mode of the current coding block determined in the candidate list may be used as the mode information of the prediction mode of the current coding block. For example, when the horizontal mode is determined as the prediction mode of the current coding block, if the index value of the horizontal mode in the candidate list is 1, the index value 1 is used as the mode information corresponding to the prediction mode of the current coding block, and the index value is written into the bitstream. In other words, the index value corresponding to the prediction mode of the current coding block in the candidate mode list may be used as the mode information corresponding to the prediction mode of the current coding block.
[0106] Figure 7 is a flowchart illustrating a video decoding method based on MVAP according to an embodiment of the present disclosure.
[0107] In step S30, the MVAP mode information of the current coding block is obtained by parsing the bitstream.
[0108] As an example, the MVAP mode information of the current coding block obtained by parsing may be an index value corresponding to the MVAP mode of the current coding block written into the bitstream in the encoding stage.
[0109] In step S31, a candidate mode list of MVAP of the current coding block is determined according to the prediction modes of the surrounding sub-blocks of the current coding block, wherein the candidate mode list includes multiple MVAP modes.
[0110] As an example, when the prediction mode of the upper sub-block of the current coding block is the number of sub-blocks in the intra-frame prediction mode α da and the number of unavailable sub-blocks in the upper sub-block of the current coding block β da The sum of α da +β da The number of sub-blocks above the current coding block γ d The ratio (α da +β da ) / γ d When it is greater than a preset threshold (for example, the upper sub-block is an unavailable sub-block or the prediction mode of the upper sub-block is intra-frame prediction), the number of modes in the candidate mode list can be reduced from the original 5 to 3, which can correspond to index values 0, 1, and 2 respectively. For example, the candidate mode list is reduced to only include the following three modes: horizontal mode, horizontal up mode, and horizontal down mode, wherein the order of the three modes in the candidate mode list is not limited, wherein the unavailable sub-block represents a sub-block that has not been encoded.
[0111] Optionally, the number of patterns in the candidate pattern list may be reduced from the original 5 to another number.
[0112] As an example, when the prediction mode of the upper sub-block of the current coding block is the number of sub-blocks in the intra-frame prediction mode αda and the number of unavailable sub-blocks in the upper sub-block of the current coding block β da The sum of α da +β da The number of sub-blocks above the current coding block γ d The ratio (α da +β da ) / γ d When it is greater than a preset threshold (for example, when the number of sub-blocks whose prediction mode is an inter-frame prediction mode in the upper sub-block of the current coding block is small, that is, the number of sub-blocks with inter-frame prediction mode in the upper sub-block accounts for too small a proportion of the total number of upper sub-blocks), the priority of the candidate modes in the candidate mode list may be reordered. At this time, the number of prediction modes in the candidate mode list does not change, only the order changes. As an example, the candidate mode list may be ordered into one of the following three orders: horizontal mode, horizontal up mode, horizontal down mode, vertical mode, and vertical right mode; horizontal mode, horizontal down mode, horizontal up mode, vertical mode, and vertical right mode; horizontal down mode, horizontal mode, horizontal up mode, vertical mode, and vertical right mode.
[0113] As an example, when the prediction mode of the left sub-block of the current coding block is the number of sub-blocks in the intra-frame prediction mode α dl and the number of unavailable sub-blocks in the left sub-block of the current coding block β dl The sum of α dl +β dl The number of sub-blocks to the left of the current coding block γ d The ratio (α dl +β dl ) / γ d When it is greater than a preset threshold (for example, the left sub-block is an unavailable sub-block or the prediction mode of the left sub-block is intra-frame prediction), the number of candidate modes in the candidate mode list is reduced from the original five to three. For example, the candidate mode list can be determined to include only the following three prediction modes: vertical mode, vertical right mode and horizontal upward mode, which can correspond to index values 0, 1, and 2 respectively, wherein the order of the three prediction modes is not limited, wherein the unavailable sub-block represents a sub-block that has not been encoded.
[0114] Optionally, the number of candidate modes in the candidate mode list may be reduced from the original five to another number.
[0115] As an example, when the prediction mode of the left sub-block of the current coding block is the number of sub-blocks in the intra-frame prediction mode α dl and the number of unavailable sub-blocks in the left sub-block of the current coding block β dl The sum of α dl +βdl The number of sub-blocks to the left of the current coding block γ d The ratio (α dl +β dl ) / γ d When it is greater than a preset threshold (for example, when the number of sub-blocks whose prediction mode is an inter-frame prediction mode in the left sub-block of the current coding block is small, that is, the number of sub-blocks with inter-frame prediction mode in the left sub-block is too small to the total number of left sub-blocks), the priority of the candidate modes in the candidate mode list can be re-ordered. At this time, the number of prediction modes in the candidate mode list does not change, only the order changes. As an example, the candidate modes in the candidate mode list can be ordered into one of the following three orders: vertical mode, horizontal upward mode, vertical right mode, horizontal mode and horizontal downward mode; vertical mode, vertical right mode, horizontal upward mode, horizontal mode and horizontal downward mode; vertical right mode, horizontal upward mode, vertical mode, horizontal mode and horizontal downward mode.
[0116] In step S32, the motion information of the current coding block is determined according to the parsed MVAP mode information of the current coding block and the determined candidate mode list of the MVAP of the current coding block.
[0117] As an example, when the MVAP mode information of the current coding block is represented by an index value, determine which mode in the candidate mode list has an index value that is the same as the parsed corresponding index value of the current coding block, and then determine the mode as the MVAP mode of the current coding block. After determining the MVAP mode of the current coding block, the current coding block can be decoded. Since decoding the current coding block according to the determined MVAP mode belongs to the prior art, it will not be elaborated here.
[0118] As described above, the present invention uses the prediction mode information of the surrounding sub-blocks of the current coding block to deduce a candidate mode list of MVAP that best suits the current coding block (the modes in the list have a predetermined number and a predetermined order), so that more efficient candidate modes can be written into the bitstream with shorter codewords. According to the entropy theorem, this can effectively improve the coding efficiency; and at the decoding end, since the number of mode lists that need to be constructed is smaller, the complexity of the decoding end in constructing the candidate list can be effectively reduced.
[0119] Figure 8 is a flowchart illustrating a video encoding method based on MVAP according to an embodiment of the present disclosure.
[0120] In step S80, it is determined whether to encode the current coding block through MVAP according to the prediction modes of the surrounding sub-blocks of the current coding block.
[0121] As an example, when the prediction mode of the surrounding sub-blocks of the current coding block is the number of sub-blocks in the intra-frame prediction mode α c and the number of unavailable sub-blocks in the surrounding sub-blocks of the current coding block β c The sum of α c +β c The number of surrounding sub-blocks of the current coding block γ c The ratio (α c +β c ) / γ c When it is greater than a preset threshold, it can be determined that the current coding block is not encoded through MVAP, where the unavailable sub-block represents an unencoded sub-block; otherwise, the current coding block needs to be encoded through MVAP.
[0122] In step S81, in response to determining that the current coding block is not encoded in the MVAP mode, it is determined that the MVAP identifier is not transmitted in the bitstream, wherein the identifier indicates whether the current coding block is encoded by MVAP; otherwise, the MVAP identifier needs to be transmitted. When the MVAP identifier is not transmitted, motion information that needs to be transmitted in the bitstream can be saved.
[0123] Fig. 9 is a flowchart illustrating a video decoding method based on MVAP according to an embodiment of the present disclosure.
[0124] In step S90, it may be determined whether to parse the MVAP identifier of the current coding block from the bitstream according to the prediction modes of the peripheral sub-blocks of the current coding block, wherein the identifier indicates whether the current coding block is encoded through the MVAP.
[0125] As an example, when the prediction mode of the surrounding sub-blocks of the current coding block is the number of sub-blocks in the intra-frame prediction mode α c and the number of unavailable sub-blocks in the surrounding sub-blocks of the current coding block β c The sum of α c +β c The number of surrounding sub-blocks of the current coding block γ c The ratio (α c +β c ) / γ c When it is greater than a third preset threshold, it is determined not to parse the MVAP identifier of the current coding block from the bitstream, wherein the unavailable sub-block represents an undecoded sub-block; otherwise, it is necessary to parse the MVAP identifier of the current coding block from the bitstream.
[0126] In step S91, in response to determining not to parse the identifier of the MVAP of the current coding block from the bitstream, it is determined not to decode the current coding block through the MVAP; otherwise, the current coding block needs to be decoded through the MVAP.
[0127] Fig.10 is a flowchart illustrating a video encoding method based on a skip mode or a direct mode according to an embodiment of the present disclosure.
[0128] In step S100, the skip mode or the direct mode is classified into a plurality of encoding modes.
[0129] As an example, the skip mode or direct mode can be classified according to the technology type as follows:
[0130] Advanced motion vector expression mode, affine skip mode, spatial and temporal skip mode, history-based motion vector prediction mode and motion vector angle prediction mode, wherein the spatial and temporal skip mode includes spatial skip mode and temporal skip mode (that is, spatial skip mode and temporal skip mode are regarded as a mode type), wherein each prediction mode may include multiple sub-modes.
[0131] Optionally, the skip mode or direct mode may be classified according to the technology type as follows:
[0132] Advanced motion vector expression mode, sub-block mode, spatial, temporal and historical skip modes, wherein the spatial, temporal and historical skip modes include spatial skip mode, temporal skip mode and historical skip mode (that is, spatial skip mode, temporal skip mode and historical skip mode are regarded as a mode type), sub-block mode includes affine mode and motion vector angle prediction mode, affine motion mode and motion vector angle prediction mode have different candidate mode lists, spatial, temporal and historical skip modes include spatial motion vector, temporal motion vector and history-based motion vector, and the spatial skip mode, temporal skip mode and historical skip mode in the spatial, temporal and historical skip modes share a candidate motion vector list, wherein each prediction mode may include multiple sub-modes.
[0133] Optionally, the skip mode or direct mode may be classified according to the technology type as follows:
[0134] Advanced motion vector expression mode, sub-block mode, spatial, temporal and historical skip modes, wherein the spatial, temporal and historical skip modes include spatial skip mode, temporal skip mode and historical skip mode, the sub-block mode includes affine motion mode and motion vector angle prediction mode, and the affine motion mode and the motion vector angle prediction mode share a candidate mode list, the spatial, temporal and historical skip modes include spatial motion vector, temporal motion vector and history-based motion vector, and the spatial skip mode, temporal skip mode and historical skip mode in the spatial, temporal and historical skip modes share a candidate motion vector list, wherein each prediction mode may include multiple sub-modes.
[0135] In step S101, a sub-mode in a coding mode among the multiple coding modes is determined as an optimal coding mode for a current coding block.
[0136] As an example, all modes in the skip mode or direct mode may be traversed, and the encoding costs of all modes may be obtained, and the optimal mode may be obtained by comparing the encoding costs.
[0137] Specifically, for each sub-mode in each coding mode type, the coding cost of the current coding block is determined, and the sub-mode in the coding mode type with the minimum coding cost is determined as the optimal coding mode of the current coding block. For example, when it is determined that the horizontal mode in the MVAP mode has the minimum coding cost, the horizontal mode in the MVAP mode is used as the optimal coding mode of the current coding block.
[0138] In step S102, the coding mode information corresponding to the one coding mode and the sub-mode information corresponding to the one sub-mode are written into the bitstream.
[0139] Specifically, for example, if it is determined that the horizontal mode in the MVAP mode has the minimum encoding cost, the mode information corresponding to the MVAP mode and the mode information corresponding to the horizontal mode are written into the code stream.
[0140] As an example, the mode information corresponding to the MVAP mode and the mode information corresponding to the horizontal mode can be written into the code stream using various existing methods. For example, the mode information corresponding to the MVAP mode and the mode information corresponding to the horizontal mode can be the index value corresponding to the MVAP mode and the index value corresponding to the horizontal mode, respectively.
[0141] Fig.11 is a flowchart illustrating a video decoding method based on a skip mode or a direct mode according to an embodiment of the present disclosure.
[0142] In step S110, coding mode information of a coding block corresponding to a current coding block and sub-mode information of the coding mode may be parsed from a bitstream.
[0143] In step S111, the skip mode or the direct mode may be classified into a plurality of encoding modes, wherein each of the plurality of encoding modes includes a plurality of sub-modes.
[0144] The classification method can be compared with the reference Fig.10 The classification method described is the same and will not be repeated here.
[0145] In step S112, the coding mode corresponding to the coding mode information in the coding mode obtained by classification can be determined as the coding mode of the current coding block, and the sub-mode corresponding to the sub-mode information in the determined coding mode of the current coding block can be determined as the sub-mode of the coding mode of the current coding block.
[0146] Optionally, the coding mode information and the sub-mode information are respectively an index value corresponding to the one coding mode and an index value corresponding to the one sub-mode.
[0147] As an example, if the mode information is an index value, it is determined which coding mode among the classified coding modes has an index value that is the same as the index value of the coding mode of the current coding block obtained by parsing, and the coding mode among the classified coding modes is determined as the coding mode of the current coding block, and it is determined which sub-mode among the coding mode has an index value that is the same as the index value of the sub-mode obtained by parsing, and the sub-mode is determined as the sub-mode of the current coding block.
[0148] In step S113, the motion information of the current coding block is determined based on the determined coding mode and sub-mode of the current coding block. Since determining the motion information of the coding block based on the determined coding mode and sub-mode is a prior art, it will not be described in detail here.
[0149] Since the number of modes of motion vector angle prediction is not fixed in the existing standards and the candidate mode list is shared with the history-based motion vector prediction technology, the worst case is that the candidate mode list of motion vector angle prediction needs to be constructed during decoding operations in order to determine whether the coding block uses the motion vector angle prediction technology or the history-based motion vector prediction technology. Therefore, the encoding and classification method proposed in the present invention distinguishes the motion vector angle prediction technology from the history-based motion vector prediction technology through identification, thereby avoiding the above situation, saving the decoder's pipeline, and making the decoder more efficient.
[0150] Fig.12 is a flowchart illustrating an encoding method for context model selection based on motion vector angle prediction according to an embodiment of the present disclosure.
[0151] In step S120, mode information corresponding to the MVAP mode is binarized according to the prediction modes of the peripheral sub-blocks of the current coding block.
[0152] As an example, when the prediction mode of the upper sub-block of the current coding block is the number of sub-blocks in the intra-frame prediction mode α ca and the number of unavailable sub-blocks in the upper sub-block of the current coding block β ca The sum of α ca +β ca The number of sub-blocks above the current coding block γc The ratio (α ca +β ca ) / γ c The number of sub-blocks α that are greater than a preset threshold or when the prediction mode in the left sub-block of the current coding block is the intra-frame prediction mode cl and the number of unavailable sub-blocks in the left sub-block of the current coding block β cl The sum of α cl +β cl The number of sub-blocks to the left of the current coding block γ c The ratio (α cl +β cl ) / γ c When it is greater than a preset threshold, the mode information corresponding to the MVAP mode is binarized.
[0153] Among them, the first binary symbol of the binarized mode information indicates whether the MVAP mode of the current coding block is a horizontal class mode (horizontal mode, horizontal downward mode or horizontal upward mode) or a vertical class mode (vertical mode or vertical right mode), and the context model corresponding to the first binary symbol indicates the probability of occurrence of a horizontal class mode or a vertical class mode.
[0154] Optionally, no restriction is placed on the context models of binary symbols other than the first binary symbol.
[0155] As an example, for example, if the first binary symbol is 0, it indicates that the prediction mode is a horizontal class mode, and accordingly, when the first binary symbol is 1, it indicates that the prediction mode is a vertical class mode. Accordingly, the context model corresponding to the first binary symbol indicates the probability of the horizontal class mode or the vertical class mode occurring.
[0156] In step S121, mode information corresponding to the MVAP mode of the current coding block is written into the bitstream according to the context model including the context model corresponding to the first binary symbol.
[0157] Fig.13 is a flowchart illustrating a decoding method for context model selection based on motion vector angle prediction according to an embodiment of the present disclosure.
[0158] In step S130, a context model is determined according to prediction modes of surrounding sub-blocks of the current coding block.
[0159] As an example, when the prediction mode of the upper sub-block of the current coding block is the number of sub-blocks in the intra-frame prediction mode α ca and the number of unavailable sub-blocks in the upper sub-block of the current coding block β ca The sum of α ca +β ca The number of sub-blocks above the current coding block γc The ratio (α ca +β ca ) / γ c The number of sub-blocks α that are greater than a preset threshold or when the prediction mode in the left sub-block of the current coding block is the intra-frame prediction mode cl and the number of unavailable sub-blocks in the left sub-block of the current coding block β cl The sum of α cl +β cl The number of sub-blocks to the left of the current coding block γ c The ratio (α cl +β cl ) / γ c When it is greater than a preset threshold, the context model is determined, wherein the context model corresponding to the first binary symbol in the determined context model indicates the probability of occurrence of a horizontal class mode (horizontal mode, horizontal downward mode or horizontal upward mode) or a vertical class mode (vertical mode or vertical right mode).
[0160] Optionally, no restriction is placed on the context models of binary symbols other than the first binary symbol.
[0161] In step S131, mode information corresponding to the MVAP mode of the current coding block is parsed from the bitstream according to the determined context model.
[0162] The above has been combined Figures 1 to 13 The encoding / decoding method according to the exemplary embodiment of the present invention is described. Figure 14 to Figure 11 A coding / decoding apparatus according to an exemplary embodiment of the present invention is described.
[0163] Fig.14 is a block diagram illustrating a MVAP-based video encoding apparatus 1400 according to an embodiment of the present disclosure.
[0164] Reference Fig.14 , the video encoding device 1400 may include a candidate list determination unit 1401, an MVAP mode determination unit 1402, and a writing unit 1403.
[0165] As an example, the candidate list determination unit 1401 may determine a candidate mode list of the MVAP of the current coding block according to prediction modes of peripheral sub-blocks of the current coding block.
[0166] As an example, the candidate list determination unit 1401 may be configured to: when the prediction mode of the upper sub-block of the current coding block is the number of sub-blocks in the intra-frame prediction mode α ca and the number of unavailable sub-blocks in the upper sub-block of the current coding block β ca The sum of α ca +βca The number of sub-blocks above the current coding block γ c The ratio (α ca +β ca ) / γ c When it is greater than a preset threshold (for example, the upper sub-block is an unavailable sub-block or the prediction mode of the upper sub-block is intra-frame prediction), the candidate modes in the candidate mode list are reduced from the original 5 to 3. For example, the candidate mode list is reduced to include only the following three modes: horizontal mode, horizontal up mode and horizontal down mode, wherein the order of the three modes in the candidate mode list is not limited, wherein the unavailable sub-block represents a sub-block that has not been encoded.
[0167] Optionally, the candidate list determining unit 1401 may also reduce the candidate modes in the candidate mode list from the original 5 to another number.
[0168] As another example, the candidate list determination unit 1401 may determine the number of sub-blocks α in which the prediction mode of the upper sub-block of the current coding block is the intra-frame prediction mode. ca and the number of unavailable sub-blocks in the upper sub-block of the current coding block β ca The sum of α ca +β ca The number of sub-blocks above the current coding block γ c The ratio (α ca +β ca ) / γ c When it is greater than a preset threshold (for example, when the number of sub-blocks whose prediction mode is an inter-frame prediction mode in the upper sub-block of the current coding block is small, that is, the number of sub-blocks with inter-frame prediction mode in the upper sub-block accounts for too small a proportion of the total number of upper sub-blocks), the priority of the candidate modes in the candidate mode list is re-sorted. At this time, the number of prediction modes in the candidate mode list does not change, only the order changes. As an example, the candidate mode list can be sorted into one of the following three orders: horizontal mode, horizontal up mode, horizontal down mode, vertical mode, and vertical right mode; horizontal mode, horizontal down mode, horizontal up mode, vertical mode, and vertical right mode; horizontal down mode, horizontal mode, horizontal up mode, vertical mode, and vertical right mode.
[0169] As an example, the candidate list determination unit 1401 may determine the number of sub-blocks α in which the prediction mode of the left sub-block of the current coding block is the intra-frame prediction mode. cl and the number of unavailable sub-blocks in the left sub-block of the current coding block β cl The sum of α cl +β cl The number of sub-blocks to the left of the current coding block γ c The ratio (αcl +β cl ) / γ c When it is greater than a preset threshold (for example, the left sub-block is an unavailable sub-block or the prediction mode of the left sub-block is intra-frame prediction), the number of candidate modes in the candidate mode list is reduced from the original five to three. For example, the candidate mode list can be determined to include only the following three prediction modes: vertical mode, vertical right mode and horizontal upward mode, wherein the order of the three prediction modes is not limited, wherein the unavailable sub-block represents a sub-block that has not been encoded.
[0170] As another example, the candidate list determination unit 1401 may determine the number of sub-blocks α in which the prediction mode of the left sub-block of the current coding block is the intra-frame prediction mode. cl and the number of unavailable sub-blocks in the left sub-block of the current coding block β cl The sum of α cl +β cl The number of sub-blocks to the left of the current coding block γ c The ratio (α cl +β cl ) / γ c When it is greater than a preset threshold (for example, when the ratio of the number of sub-blocks with inter-frame prediction mode in the left sub-block to the total number of sub-blocks on the left is too small), the priority of the candidate modes in the candidate mode list is re-ordered. At this time, the number of prediction modes in the candidate mode list does not change, but the order changes. As an example, the candidate modes in the candidate mode list can be ordered into one of the following three orders: vertical mode, horizontal upward mode, vertical right mode, horizontal mode and horizontal downward mode; vertical mode, vertical right mode, horizontal upward mode, horizontal mode and horizontal downward mode; vertical right mode, horizontal upward mode, vertical mode, horizontal mode and horizontal downward mode.
[0171] As an example, the MVAP mode determination unit 1402 may determine one of the candidate modes in the candidate mode list as the prediction mode of the current coding block.
[0172] Specifically, as described above, the candidate list determining unit 1401 may change the number of candidate modes in the candidate mode list or change the order of the candidate modes in the candidate mode list to determine the candidate mode list of the current coding block.
[0173] Optionally, the MVAP mode determination unit 1402 may respectively calculate the coding cost of encoding the current coding block in each of the multiple MVAP modes; and determine the one MVAP mode based on the calculated coding cost.
[0174] As an example, the MVAP mode determination unit 1402 may traverse all modes in the candidate mode list, obtain motion information of each sub-block of the current coding block for the modes in the list, obtain the coding cost under the mode through motion compensation, and finally determine the prediction mode of the current coding block by comparing the coding costs under each mode. For example, when the candidate mode list includes the horizontal mode, and the calculated coding cost under the horizontal mode is the smallest, the horizontal mode is determined as the prediction mode of the current coding block.
[0175] The writing unit 1403 may write mode information corresponding to the determined prediction mode of the current coding block into the bitstream.
[0176] As an example, the determined index value of the prediction mode of the current coding block in the candidate list may be used as the mode information of the prediction mode of the current coding block. For example, when the MVAP mode determination unit 1402 determines the horizontal mode as the prediction mode of the current coding block, if the index value of the horizontal mode in the candidate list is 1, the index value 1 is used as the mode information corresponding to the prediction mode of the current coding block, and the index value is written into the bitstream through the writing unit 1403. In other words, the index value corresponding to the prediction mode of the current coding block in the candidate mode list may be used as the mode information corresponding to the prediction mode of the current coding block.
[0177] Fig.15 is a block diagram showing a video decoding apparatus 1500 based on MVAP according to an embodiment of the present disclosure.
[0178] Reference Fig.15 The video decoding device 1500 may include a code stream parsing unit 1501, a candidate list determining unit 1502, and a motion information determining unit 1503.
[0179] As an example, the code stream parsing unit 1501 may parse the code stream to obtain the MVAP mode information of the current coding block.
[0180] As an example, the MVAP mode information of the current coding block obtained by parsing may be an index value corresponding to the MVAP mode of the current coding block written into the bitstream in the encoding stage.
[0181] As an example, the candidate list determination unit 1502 may be configured to: when the prediction mode of the upper sub-block of the current coding block is the number of sub-blocks in the intra-frame prediction mode α da and the number of unavailable sub-blocks in the upper sub-block of the current coding block β da The sum of α da +β da The number of sub-blocks above the current coding block γ d The ratio (α da +β da ) / γd When it is greater than a preset threshold (for example, the upper sub-block is an unavailable sub-block or the prediction mode of the upper sub-block is intra-frame prediction), the candidate mode list can be reduced from the original 5 to 3. For example, the candidate mode list is reduced to only include the following three modes: horizontal mode, horizontal upward mode and horizontal downward mode, which can correspond to index values 0, 1, and 2 respectively, wherein the order of the three modes in the candidate mode list is not limited, wherein the unavailable sub-block represents a sub-block that has not been encoded.
[0182] Optionally, the candidate list determining unit 1502 may also reduce the number of patterns in the candidate pattern list from the original 5 to another number.
[0183] As an example, the candidate list determination unit 1502 may be configured to: when the prediction mode of the upper sub-block of the current coding block is the number of sub-blocks in the intra-frame prediction mode α da and the number of unavailable sub-blocks in the upper sub-block of the current coding block β da The sum of α da +β da The number of sub-blocks above the current coding block γ d The ratio (α da +β da ) / γ d When it is greater than a preset threshold (for example, when the number of sub-blocks with inter-frame prediction mode in the upper sub-block accounts for too small a proportion of the total number of upper sub-blocks), the priority of the candidate modes in the candidate mode list may be reordered. At this time, the number of prediction modes in the candidate mode list does not change, but only the order changes. As an example, the candidate mode list may be ordered into one of the following three orders: horizontal mode, horizontal up mode, horizontal down mode, vertical mode, and vertical right mode; horizontal mode, horizontal down mode, horizontal up mode, vertical mode, and vertical right mode; horizontal down mode, horizontal mode, horizontal up mode, vertical mode, and vertical right mode.
[0184] As an example, the candidate list determination unit 1502 may be configured to: when the prediction mode of the left sub-block of the current coding block is the number of sub-blocks in the intra-frame prediction mode α dl and the number of unavailable sub-blocks in the left sub-block of the current coding block β dl The sum of α dl +β dl The number of sub-blocks to the left of the current coding block γ d The ratio (α dl +β dl ) / γ dWhen it is greater than a preset threshold (for example, when the left sub-block is an unavailable sub-block or the prediction mode of the left sub-block is intra-frame prediction), the number of candidate modes in the candidate mode list is reduced from the original five to three. For example, the candidate mode list can be determined to include only the following three prediction modes: vertical mode, vertical right mode and horizontal upward mode, which can correspond to index values 0, 1, and 2 respectively, wherein the order of the three prediction modes is not limited, wherein the unavailable sub-block represents a sub-block that has not been encoded.
[0185] Optionally, the candidate list determining unit 1502 may also reduce the number of candidate modes in the candidate mode list from the original five to another number.
[0186] As an example, the candidate list determination unit 1502 may be configured to: when the prediction mode of the left sub-block of the current coding block is the number of sub-blocks in the intra-frame prediction mode α dl and the number of unavailable sub-blocks in the left sub-block of the current coding block β dl The sum of α dl +β dl The number of sub-blocks to the left of the current coding block γ d The ratio (α dl +β dl ) / γ d When it is greater than a preset threshold (for example, when the ratio of the number of sub-blocks with inter-frame prediction mode in the left sub-block to the total number of sub-blocks on the left is too small), the priority of the candidate modes in the candidate mode list can be reordered. At this time, the number of prediction modes in the candidate mode list does not change, but the order changes. As an example, the candidate modes in the candidate mode list can be ordered into one of the following three orders: vertical mode, horizontal upward mode, vertical right mode, horizontal mode and horizontal downward mode; vertical mode, vertical right mode, horizontal upward mode, horizontal mode and horizontal downward mode; vertical right mode, horizontal upward mode, vertical mode, horizontal mode and horizontal downward mode.
[0187] The motion information determination unit 1503 may determine the motion information of the current coding block according to the parsed MVAP mode information of the current coding block and the determined candidate mode list of the MVAP of the current coding block.
[0188] Fig.16 is a block diagram showing a video encoding apparatus 1600 based on MVAP according to an embodiment of the present disclosure.
[0189] Reference Fig.16 The video encoding device 1600 may include an encoding determination unit 1601 and a code stream transmission determination unit 1602.
[0190] As an example, the encoding determination unit 1601 may be configured to determine whether to encode the current coding block through MVAP according to the prediction modes of the peripheral sub-blocks of the current coding block.
[0191] As an example, the coding determination unit 1601 may be configured to: when the number of sub-blocks in the surrounding sub-blocks of the current coding block that are in the intra-frame prediction mode is α c and the number of unavailable sub-blocks in the surrounding sub-blocks of the current coding block β c The sum of α c +β c The number of surrounding sub-blocks of the current coding block γ c The ratio (α c +β c ) / γ c When it is greater than a preset threshold, it is determined that the current coding block is not encoded through MVAP, wherein the unavailable sub-block represents an unencoded sub-block; otherwise, it is determined that the current coding block needs to be encoded through MVAP.
[0192] The code stream transmission determination unit 1602 may be configured to: in response to determining that the current coding block is not encoded in the MVAP mode, determine not to transmit the MVAP identifier in the code stream, wherein the identifier indicates whether the current coding block is encoded by the MVAP; in response to determining that the current coding block is encoded in the MVAP mode, determine to transmit the MVAP identifier in the code stream. When it is determined that the MVAP identifier is not transmitted in the code stream, motion information that needs to be transmitted in the code stream can be saved.
[0193] Fig.17 is a block diagram showing a video decoding device 1700 based on MVAP according to an embodiment of the present disclosure.
[0194] Reference Fig.17 The video decoding device 1700 may include a code stream parsing determination unit 1701 and a decoding determination unit 1702.
[0195] As an example, the code stream parsing determination unit 1701 may be configured to determine whether to parse the MVAP identifier of the current coding block from the code stream according to the prediction mode of the surrounding sub-blocks of the current coding block, wherein the identifier indicates whether the current coding block is encoded through MVAP.
[0196] As an example, the code stream parsing determination unit 1701 may be configured to: when the number of sub-blocks in the surrounding sub-blocks of the current coding block that are in the intra-frame prediction mode is α c and the number of unavailable sub-blocks in the surrounding sub-blocks of the current coding block β c The sum of α c +β c The number of surrounding sub-blocks of the current coding block γc The ratio (α c +β c ) / γ c When it is greater than a preset threshold, it is determined not to parse the MVAP identifier of the current coding block from the bitstream, wherein the unavailable sub-block represents an undecoded sub-block; otherwise, it is determined that the MVAP identifier of the current coding block needs to be parsed from the bitstream.
[0197] The decoding determination unit 1702 may be configured to: in response to determining that the MVAP identifier of the current coding block is not parsed from the code stream, determine not to decode the current coding block through the MVAP; otherwise, determine that the current coding block needs to be decoded through the MVAP.
[0198] Fig.18 is a block diagram illustrating a video encoding apparatus 1800 based on a skip mode or a direct mode according to an embodiment of the present disclosure.
[0199] Reference Fig.18 The encoding device 1800 may include a mode classification unit 1801, an optimal encoding mode determination unit 1802, and a code stream writing unit 1803.
[0200] As an example, the classification unit 1801 may be configured to classify the skip mode or the direct mode into a plurality of encoding modes, wherein each of the plurality of encoding modes includes a plurality of sub-modes.
[0201] As an example, the classification unit 1801 may be configured to classify the skip mode or the direct mode into multiple coding modes in one of the following three classification methods:
[0202] First classification mode: advanced motion vector expression mode, affine skip mode, spatial and temporal skip mode, history-based motion vector prediction mode and motion vector angle prediction mode, wherein the spatial and temporal skip mode includes spatial skip mode and temporal skip mode (that is, spatial skip mode and temporal skip mode are regarded as one mode type), wherein each prediction mode may include multiple sub-modes;
[0203] Second classification method: advanced motion vector expression mode, sub-block mode, spatial domain, temporal domain and historical skip mode, wherein the spatial domain, temporal domain and historical skip mode include spatial domain skip mode, temporal domain skip mode and historical skip mode (that is, the spatial domain skip mode, temporal domain skip mode and historical skip mode are regarded as a mode type), the sub-block mode includes affine mode and motion vector angle prediction mode, the affine motion mode and the motion vector angle prediction mode have different candidate mode lists, the spatial domain, temporal domain and historical skip mode include spatial domain motion vector, temporal domain motion vector and history-based motion vector, and the spatial domain skip mode, temporal domain skip mode and historical skip mode in the spatial domain, temporal domain and historical skip mode share a candidate motion vector list, wherein each prediction mode may include multiple sub-modes;
[0204] The third classification method: advanced motion vector expression mode, sub-block mode, spatial, temporal and historical skip modes, wherein the spatial, temporal and historical skip modes include spatial skip mode, temporal skip mode and historical skip mode, the sub-block mode includes affine motion mode and motion vector angle prediction mode, and the affine motion mode and the motion vector angle prediction mode share a candidate mode list, the spatial, temporal and historical skip modes include spatial motion vector, temporal motion vector and history-based motion vector, and the spatial skip mode, temporal skip mode and historical skip mode in the spatial, temporal and historical skip modes share a candidate motion vector list, wherein each prediction mode may include multiple sub-modes.
[0205] As an example, the optimal encoding mode determination unit 1802 may be configured to determine a sub-mode in one of the multiple encoding modes as the optimal encoding mode for the current encoding block.
[0206] As an example, the code stream writing unit 1803 may be configured to write the coding mode information corresponding to the one coding mode and the sub-mode information corresponding to the one sub-mode into the code stream.
[0207] As an example, the coding mode information and the sub-mode information are respectively an index value corresponding to the one coding mode and an index value corresponding to the one sub-mode.
[0208] Fig.19 is a block diagram illustrating a decoding device 1900 based on a skip mode or a direct mode according to an embodiment of the present disclosure.
[0209] Reference Fig.19 The decoding device 1900 may include a code stream parsing unit 1901, a mode classification unit 1902, a mode determination unit 1903, and a motion information determination unit 1904.
[0210] As an example, the code stream parsing unit 1901 may be configured to parse the coding mode information of the coding block corresponding to the current coding block and the sub-mode information of the coding mode from the code stream.
[0211] As an example, the mode classification unit 1902 may be configured to classify the skip mode or the direct mode into a plurality of encoding modes, wherein each of the plurality of encoding modes includes a plurality of sub-modes.
[0212] As an example, the mode determination unit 1903 may be configured to determine the coding mode corresponding to the coding mode information in the coding mode obtained by classification as the coding mode of the current coding block, and determine the sub-mode corresponding to the sub-mode information in the determined coding mode of the current coding block as the sub-mode of the coding mode of the current coding block.
[0213] As an example, the motion information determining unit 1904 may be configured to determine the motion information of the current coding block based on the determined coding mode and sub-mode of the current coding block.
[0214] Optionally, the coding mode information and the sub-mode information may be an index value corresponding to the one coding mode and an index value corresponding to the one sub-mode, respectively.
[0215] Fig. 20 A block diagram of an encoding apparatus 2000 for context model selection based on motion vector angle prediction according to an embodiment of the present disclosure is shown.
[0216] Reference Fig. 20 The encoding device 2000 may include a binarization unit 2001 and a code stream writing unit 2002.
[0217] As an example, the binarization unit 2001 can be configured to binarize the pattern information corresponding to the MVAP mode according to the prediction mode of the surrounding sub-blocks of the current coding block, wherein the first binary symbol of the binarized pattern information indicates whether the MVAP mode is a horizontal class mode or a vertical class mode, and the context model corresponding to the first binary symbol indicates the probability of occurrence of the horizontal class mode or the vertical class mode.
[0218] As an example, the binarization unit 2001 may be configured as follows: when the prediction mode of the upper sub-block of the current coding block is the number of sub-blocks in the intra-frame prediction mode α ca and the number of unavailable sub-blocks in the upper sub-block of the current coding block β ca The sum of α ca +β ca The number of sub-blocks above the current coding block γ c The ratio (α ca +β ca ) / γc The number of sub-blocks α that are greater than a preset threshold or when the prediction mode in the left sub-block of the current coding block is the intra-frame prediction mode cl and the number of unavailable sub-blocks in the left sub-block of the current coding block β cl The sum of α cl +β cl The number of sub-blocks to the left of the current coding block γ c The ratio (α cl +β cl ) / γ c When it is greater than a preset threshold, the mode information corresponding to the MVAP prediction mode is binarized.
[0219] As an example, the bitstream writing unit 2002 may be configured to write mode information corresponding to the MVAP mode of the current coding block into the bitstream according to a context model including the context model (ie, the context model corresponding to the first binary symbol).
[0220] Fig.21 21 is a block diagram showing a decoding device 2100 for context model selection based on motion vector angle prediction according to an embodiment of the present disclosure.
[0221] Reference Fig.21 The decoding device 2100 may include a context model determination unit 2101 and a code stream parsing unit 2102.
[0222] As an example, the context model determination unit 2101 may be configured to determine a context model based on a prediction mode of a surrounding sub-block of a current coding block, wherein the context model corresponding to the first binary symbol in the determined context model indicates the probability of occurrence of a horizontal class mode or a vertical class mode.
[0223] The context model determination unit 2101 may be configured to: when the prediction mode of the upper sub-block of the current coding block is the number of sub-blocks in the intra-frame prediction mode α ca and the number of unavailable sub-blocks in the upper sub-block of the current coding block β ca The sum of α ca +β ca The number of sub-blocks above the current coding block γ c The ratio (α ca +β ca ) / γ c The number of sub-blocks α that are greater than a preset threshold or when the prediction mode in the left sub-block of the current coding block is the intra-frame prediction mode cl and the number of unavailable sub-blocks in the left sub-block of the current coding block β cl The sum of α cl +β cl The number of sub-blocks to the left of the current coding block γc The ratio (α cl +β cl ) / γc is greater than a preset threshold, it is determined that the context model corresponding to the first binary symbol indicates the probability of a horizontal class pattern or a vertical class pattern occurring.
[0224] As an example, the code stream parsing unit 2102 may be configured to parse the code stream to obtain mode information corresponding to the MVAP mode of the current coding block according to the context model.
[0225] It should be understood that each unit in the coding and decoding device according to the exemplary embodiment of the present invention can be implemented as a hardware component and / or a software component. Those skilled in the art can, for example, use a field programmable gate array (FPGA) or an application specific integrated circuit (ASIC) to implement each unit according to the processing performed by each defined unit.
[0226] An exemplary embodiment of the present invention provides a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, a coding and decoding method as described in the exemplary embodiment described above is implemented. The computer-readable storage medium is any data storage device that can store data read out by a computer system. Examples of computer-readable storage media include: read-only memory, random access memory, read-only optical disk, magnetic tape, floppy disk, optical data storage device, and carrier wave (such as data transmission through the Internet via a wired or wireless transmission path).
[0227] The encoding and decoding device according to the exemplary embodiment of the present invention may include: a processor and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, the encoding and decoding method as described in the exemplary embodiment above is implemented.
[0228] Although some exemplary embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various modifications may be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.
Claims
1. A video coding method based on motion vector angle prediction (MVAP), the method comprising: Determine a candidate mode list of MVAP of the current coding block according to the prediction modes of the surrounding sub-blocks of the current coding block, wherein the candidate mode list includes multiple MVAP modes; Determine one of the multiple MVAP modes as the MVAP mode of the current coding block; Writing mode information corresponding to the one MVAP mode into the bitstream, The step of determining a candidate mode list of the MVAP of the current coding block includes: When the prediction mode of the upper sub-block of the current coding block is the number of sub-blocks in the intra-frame prediction mode α ca and the number of unavailable sub-blocks in the upper sub-block of the current coding block β ca The sum of α ca +β ca The number of sub-blocks above the current coding block γ c The ratio (α ca +β ca ) / γ c When the value is greater than a preset threshold, the number of candidate modes in the candidate mode list is reduced to a predetermined number or the priorities of the candidate modes in the candidate mode list are reordered, or when the prediction mode in the left sub-block of the current coding block is the number of sub-blocks in the intra-frame prediction mode α cl and the number of unavailable sub-blocks in the left sub-block of the current coding block β cl The sum of α cl +β cl The number of sub-blocks to the left of the current coding block γ c The ratio (α cl +β cl ) / γ c When the value is greater than a preset threshold, the number of candidate modes in the candidate mode list is reduced to a predetermined number or the priorities of the candidate modes in the candidate mode list are reordered. The unavailable sub-blocks represent sub-blocks that have not been encoded.
2. The method of claim 1, wherein: The step of determining one of the multiple MVAP modes as the MVAP mode of the current coding block comprises: Calculate the coding cost of encoding the current coding block in each MVAP mode of the multiple MVAP modes respectively; Based on the calculated coding cost, the one MVAP mode is determined.
3. A video decoding method based on motion vector angle prediction (MVAP), the method comprising: Parse the bitstream to obtain the MVAP mode information of the current coding block; Determine a candidate mode list of MVAP of the current coding block according to the prediction modes of the surrounding sub-blocks of the current coding block, wherein the candidate mode list includes multiple MVAP modes; Determine the motion information of the current coding block according to the candidate mode list and the parsed MVAP mode information of the current coding block, The step of determining a candidate mode list of the MVAP of the current coding block includes: When the prediction mode of the upper sub-block of the current coding block is the number of sub-blocks in the intra-frame prediction mode α da and the number of unavailable sub-blocks in the upper sub-block of the current coding block β da The sum of α da +β da The number of sub-blocks above the current coding block γ d The ratio (α da +β da ) / γ d When the value is greater than a preset threshold, the number of candidate modes in the candidate mode list is reduced to a predetermined number or the priorities of the candidate modes in the candidate mode list are reordered, or when the prediction mode in the left sub-block of the current coding block is the number of sub-blocks in the intra-frame prediction mode α dl and the number of unavailable sub-blocks in the left sub-block of the current coding block β dl The sum of α dl +β dl The number of sub-blocks to the left of the current coding block γ d The ratio (α dl +β dl ) / γ d When the value is greater than a preset threshold, the number of candidate modes in the candidate mode list is reduced to a predetermined number or the priorities of the candidate modes in the candidate mode list are reordered. The unavailable sub-blocks represent sub-blocks that have not been decoded.
4. The method of claim 3, wherein: The step of determining the motion information of the current coding block according to the candidate mode list and the parsed MVAP mode information of the current coding block comprises: An MVAP mode in the candidate mode list having the same MVAP mode information as the MVAP mode information is determined as the MVAP mode of the current coding block, and motion information of the current coding block is acquired based on the determined MVAP mode of the current coding block.
5. A video coding method based on motion vector angle prediction (MVAP), the method comprising: Determine whether to encode the current coding block through MVAP according to the prediction mode of the surrounding sub-blocks of the current coding block; In response to determining that the current coding block is not encoded in the MVAP mode, determining not to transmit an MVAP identifier in the bitstream, wherein the identifier indicates whether the current coding block is encoded by MVAP, The step of determining whether to encode the current coding block in the MVAP mode according to the prediction mode of the surrounding sub-blocks of the current coding block comprises: when the prediction mode of the surrounding sub-blocks of the current coding block is the number of sub-blocks α in the intra-frame prediction mode c and the number of unavailable sub-blocks in the surrounding sub-blocks of the current coding block β c The sum of α c +β c The number of surrounding sub-blocks of the current coding block γ c The ratio (α c +β c ) / γ c When it is greater than a preset threshold, it is determined not to encode the current coding block through MVAP, wherein the unavailable sub-block represents a sub-block that has not been encoded.
6. A video decoding method based on motion vector angle prediction (MVAP), the method comprising: Determine whether to parse the MVAP identifier of the current coding block from the bitstream according to the prediction mode of the surrounding sub-blocks of the current coding block, wherein the identifier indicates whether the current coding block is encoded through the MVAP; In response to determining not to parse the identifier of the MVAP of the current coding block from the code stream, determining not to decode the current coding block through the MVAP, The step of determining whether to parse the identifier of the MVAP of the current coding block from the bitstream according to the prediction mode of the surrounding sub-blocks of the current coding block includes: When the number of sub-blocks in the surrounding sub-blocks of the current coding block that are in intra-frame prediction mode is α and the number of unavailable sub-blocks in the surrounding sub-blocks of the current coding block is β c The sum of α c +β c The number of surrounding sub-blocks of the current coding block γ c The ratio (α c +β c ) / γ c When it is greater than a preset threshold, it is determined not to parse the identifier of the MVAP of the current coding block from the bitstream, wherein the unavailable sub-block represents a sub-block that has not been decoded.
7. A computer-readable storage medium, wherein: A computer program is stored thereon, and when the program is executed, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Video coding mode coding and decoding method and apparatus thereof
CN106878752A
A shot boundary detection method combining HEVC compressed domain and pixel domain
CN109104609A