WO2022166370A1 - 视频编解码方法、装置、计算机程序产品、计算机可读存储介质及电子设备 - Google Patents

视频编解码方法、装置、计算机程序产品、计算机可读存储介质及电子设备 Download PDF

Info

Publication number
WO2022166370A1
WO2022166370A1 PCT/CN2021/136122 CN2021136122W WO2022166370A1 WO 2022166370 A1 WO2022166370 A1 WO 2022166370A1 CN 2021136122 W CN2021136122 W CN 2021136122W WO 2022166370 A1 WO2022166370 A1 WO 2022166370A1
Authority
WO
WIPO (PCT)
Prior art keywords
weight
reference pixel
prediction mode
reference pixels
intra
Prior art date
Application number
PCT/CN2021/136122
Other languages
English (en)
French (fr)
Inventor
王英彬
Original Assignee
腾讯科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 腾讯科技(深圳)有限公司 filed Critical 腾讯科技(深圳)有限公司
Publication of WO2022166370A1 publication Critical patent/WO2022166370A1/zh
Priority to US17/981,323 priority Critical patent/US20230056211A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/103Selection of coding mode or of prediction mode
    • H04N19/105Selection of the reference unit for prediction within a chosen coding or prediction mode, e.g. adaptive choice of position and number of pixels used for prediction
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/103Selection of coding mode or of prediction mode
    • H04N19/107Selection of coding mode or of prediction mode between spatial and temporal predictive coding, e.g. picture refresh
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/124Quantisation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/13Adaptive entropy coding, e.g. adaptive variable length coding [AVLC] or context adaptive binary arithmetic coding [CABAC]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/132Sampling, masking or truncation of coding units, e.g. adaptive resampling, frame skipping, frame interpolation or high-frequency transform coefficient masking
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/157Assigned coding mode, i.e. the coding mode being predefined or preselected to be further used for selection of another element or parameter
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/157Assigned coding mode, i.e. the coding mode being predefined or preselected to be further used for selection of another element or parameter
    • H04N19/159Prediction type, e.g. intra-frame, inter-frame or bidirectional frame prediction
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/46Embedding additional information in the video signal during the compression process
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/60Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
    • H04N19/61Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding in combination with predictive coding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/70Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by syntax aspects related to video coding, e.g. related to compression standards
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/4402Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/593Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving spatial prediction techniques

Definitions

  • the present disclosure relates to the technical field of video encoding and decoding, and in particular, to a video encoding and decoding method, a video encoding and decoding device, a computer program product, a computer-readable storage medium, and an electronic device.
  • video encoding is basically used in the industry. Decoding technology compresses video, storing or transmitting it in a compressed format.
  • Modern mainstream video coding technologies mainly include international video coding standards such as High Efficiency Video Coding (HEVC, High Efficiency Video Coding), Universal Video Coding (VVC, Versatile Video Coding) and China's national video coding standards, such as Source Coding Standard (AVS, Audio Video coding Standard), which all use a hybrid coding framework to process the input original video signal.
  • HEVC High Efficiency Video Coding
  • VVC Universal Video Coding
  • VVS Versatile Video Coding
  • AVS Audio Video coding Standard
  • the video image is usually divided into a series of non-overlapping rectangular coding blocks or decoding blocks according to the block division structure, and then an appropriate coding method is selected for each coding block, and the coding method is adopted accordingly.
  • the decoding block is decoded in the corresponding manner.
  • For coding blocks using intra-frame prediction only one of the specified intra-frame prediction modes can be selected to derive the prediction value of the current coding/decoding block, and there are multiple textures in a rectangular block, the current intra-frame prediction
  • Embodiments of the present disclosure provide a video decoding method, a video decoding apparatus, a computer program product, a computer-readable storage medium, and an electronic device, so as to improve the accuracy of prediction values derived from different encoding/decoding blocks to a certain extent , to improve the encoding and decoding efficiency.
  • a video decoding method including: decoding a code stream to obtain a first flag, a first index value and a second index value, wherein the first flag is used to identify whether the current
  • the block to be decoded uses an intra-frame weighted prediction mode; when the value of the first flag satisfies the first preset condition, the target intra-frame prediction mode is determined in the first intra-frame prediction mode list according to the first index value, and A target weight list is determined in the weight list set according to the second index value; the first type of reference pixels and the second type of reference pixels are determined according to the reference pixels corresponding to the current block to be decoded, and based on the target weight list The first type of reference pixels and the second type of reference pixels are weighted to obtain weighted reference pixels; the current block to be decoded is predicted according to the weighted reference pixels and the target intra-frame prediction mode to obtain the same The prediction block corresponding to the block currently to be decoded.
  • a video decoding apparatus comprising: a code stream decoding module configured to decode a code stream to obtain a first flag, a first index value and a second index value, wherein the first The flag is used to identify whether to use the intra-frame weighted prediction mode for the current block to be decoded; the index matching module is configured to, when the value of the first flag satisfies the first preset condition, according to the first index value in the first frame A target intra-frame prediction mode is determined in the intra-prediction mode list, and a target weight list is determined in the weight list set according to the second index value; the pixel weighting module is configured to determine the first according to the reference pixel corresponding to the current block to be decoded.
  • class reference pixels and second class reference pixels and perform weighting processing on the first class reference pixels and the second class reference pixels based on the target weight list to obtain weighted reference pixels;
  • a pixel prediction module configured to The weighted reference pixels and the target intra-frame prediction mode are used to predict the current block to be decoded to obtain a prediction block corresponding to the current block to be decoded.
  • a video encoding method comprising: determining a target intra prediction mode corresponding to a current block to be encoded from an intra prediction mode list, and determining a target intra prediction mode corresponding to the current block to be encoded from a weight list set A target weight list corresponding to the block to be coded; determining the first type of reference pixels and the second type of reference pixels according to the reference pixels corresponding to the current block to be coded, and based on the target weight list, the first type of reference pixels and the second type of reference pixels are determined.
  • the second type of reference pixels are subjected to weighting processing to obtain weighted reference pixels; the current block to be encoded is predicted according to the weighted reference pixels and the target intra-frame prediction mode, and a corresponding block to be encoded is obtained.
  • a video encoding apparatus comprising: a determining module configured to determine a target intra prediction mode corresponding to a current block to be encoded from an intra prediction mode list, and select a target intra prediction mode from a weight list set determining a target weight list corresponding to the current block to be encoded; a weighting module configured to determine a first type of reference pixels and a second type of reference pixels according to the reference pixels corresponding to the current to-be-encoded block, and based on the target weight The list performs weighting processing on the first type of reference pixels and the second type of reference pixels to obtain weighted reference pixels; the prediction module is configured to perform weighting on the currently pending reference pixels according to the weighted reference pixels and the target intra-frame prediction mode.
  • the coding block is predicted to obtain a prediction block corresponding to the current block to be coded;
  • a code stream generation module is configured to form a code stream according to the predicted block, and add a first flag and a first index value to the code stream and a second index value, wherein the first flag is used to identify whether to use the intra-frame weighted prediction mode for the block to be decoded; the first index value is used to determine from the first intra-frame prediction mode list and the block to be decoded the corresponding target intra prediction mode; the second index value is used to determine the target weight list corresponding to the block to be decoded in the weight list set.
  • a computer storage medium on which a computer program is stored, and when the program is executed by a processor, implements the video decoding method and the video encoding method provided in the foregoing optional implementation manners.
  • a computer program product or computer program including computer instructions stored in a computer-readable storage medium.
  • the processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the video decoding method and the video encoding method provided in the above-mentioned optional implementation manner.
  • an electronic device comprising: one or more processors; and a storage device for storing one or more programs, when the one or more programs are stored by the one or more programs When executed by multiple processors, the one or more processors are made to implement the methods provided in the foregoing optional implementation manners.
  • the present disclosure can perform weighted combination of two types of intra-frame prediction reference pixels, and derive a predicted value based on the weighted and combined reference pixels, thereby improving the accuracy of the predicted value; on the other hand, the prediction method in the present disclosure can be applied to In video encoding and decoding, the encoding and decoding efficiency is improved.
  • FIG. 1 shows a schematic diagram of an exemplary system architecture to which the technical solutions of the embodiments of the present disclosure can be applied;
  • FIG. 2 schematically shows a schematic structural diagram of an intra prediction mode
  • FIG. 3 schematically shows a schematic flowchart of a video decoding method according to an embodiment of the present disclosure
  • FIG. 4 schematically shows a schematic flowchart of acquiring a target intra prediction mode according to an embodiment of the present disclosure
  • FIG. 5 schematically shows a schematic flowchart of determining a target weight list according to an embodiment of the present disclosure
  • FIG. 6 schematically shows a schematic flowchart of determining a weight list according to an embodiment of the present disclosure
  • FIG. 7 schematically shows a schematic structural diagram of the length of a reference pixel determined according to the width and height of a block to be decoded according to an embodiment of the present disclosure
  • 8A-8B schematically illustrate a flow chart of how to determine the effective reference pixel and the length of the effective reference pixel when the prediction angle is clockwise in the diagonal mode according to one embodiment of the present disclosure
  • 8C-8D schematically illustrate a flow chart of how to determine the effective reference pixel and the length of the effective reference pixel when the prediction angle is in a counterclockwise direction in the diagonal mode according to an embodiment of the present disclosure
  • FIG. 9 schematically shows a schematic diagram of the position of a preset point according to an embodiment of the present disclosure.
  • FIG. 10 schematically shows a schematic diagram of reference pixel weights according to an embodiment of the present disclosure
  • FIG. 11 schematically shows a schematic flowchart of determining a first type of reference pixel and a second type of reference pixel according to a third flag according to an embodiment of the present disclosure
  • FIG. 12 schematically shows a schematic flowchart of storing an intra prediction mode according to a minimum division unit according to an embodiment of the present disclosure
  • FIG. 13 schematically shows a schematic flowchart of video encoding and decoding
  • FIG. 14 schematically shows a schematic flowchart of a video encoding method according to an embodiment of the present disclosure
  • FIG. 15 schematically shows a block diagram of a video decoding apparatus according to an embodiment of the present disclosure
  • FIG. 16 schematically shows a block diagram of a video encoding apparatus according to an embodiment of the present disclosure
  • FIG. 17 shows a schematic structural diagram of a computer system suitable for implementing an electronic device of an embodiment of the present disclosure.
  • Example embodiments will now be described more fully with reference to the accompanying drawings.
  • Example embodiments can be embodied in various forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art.
  • FIG. 1 shows a schematic diagram of an exemplary system architecture to which the technical solutions of the embodiments of the present disclosure may be applied.
  • the system architecture may include a first terminal device 101 , an encoder 102 , a decoder 103 , a network 104 and a second terminal device 105 .
  • the first terminal device 101 may specifically be a terminal device that includes a display screen and can be used to capture or produce video, such as a smartphone, notebook, tablet computer, desktop computer, portable computer, video camera, camera, etc., for capturing video Signal.
  • the encoder 102 is configured to encode and compress the video signal collected by the first terminal device 101 to reduce the data volume of the video.
  • the decoder 103 is used for decoding the code stream output by the encoder 102, and predicting the encoded and compressed video image, thereby obtaining a reconstructed image.
  • the second terminal device 105 may specifically be a terminal device including a display screen, such as a TV, a smart phone, a notebook, a tablet computer, a desktop computer, a portable computer, etc., for playing a video composed of reconstructed images.
  • the network 104 is a medium used to provide a communication link between the first terminal device 101 and the encoder 102, the encoder 102 and the decoder 103, and the decoder and the second terminal device 105.
  • the network 104 may include various connection types such as A wired communication link, a wireless communication link, etc., in the embodiment of the present disclosure, the network between the terminal device 101 and the server 103 may be a wireless communication link, and may specifically be a mobile network.
  • first terminal device the encoder, the decoder, the network and the second terminal device in FIG. 1 are only illustrative. According to implementation requirements, there may be any number of first terminal devices, encoders, decoders, networks and second terminal devices. It should be noted that the encoder and decoder or the encoder, the decoder and the second terminal device in the present disclosure may also be an independent integrated terminal, and multiple functions may be implemented in the integrated terminal.
  • a video is shot or produced by the first terminal device 101, and the original video signal is sent to the encoder 102 through the network 104.
  • the encoder 102 uses the intra-frame weighted prediction mode to analyze the video signal. Encoding and compression are performed to form a code stream, which also contains parameters required for decoding the compressed video signal, such as intra-frame prediction mode, decoding-related flags and indexes, and the like.
  • the decoder 103 After the decoder 103 receives the code stream, it can decode the code stream to obtain the parameters and the video data to be decoded, and predict the video data to be decoded according to the intra-frame weighted prediction mode, and then obtain the reproducing signal corresponding to the original video signal.
  • a video signal is constructed, and the reconstructed video signal is sent to the second terminal device 105 for display.
  • the video decoding method provided by the embodiments of the present disclosure is generally performed by a terminal device, and correspondingly, the video decoding apparatus is generally set in the terminal device.
  • the video decoding method provided by the embodiments of the present disclosure may also be executed by the server.
  • the modern mainstream video coding technology taking the international video coding standards HEVC, VVC, and the Chinese national video coding standard AVS as examples, adopts the hybrid coding framework to perform the following series of operations and processing on the input original video signal:
  • Block Partition Structure The input image is divided into several non-overlapping processing units according to the size of one, and each processing unit will perform similar compression operations.
  • This processing unit is called a coding tree unit (CTU, Coding Tree Unit), or the largest coding unit (LCU, Largest Coding Unit). Further down the CTU, you can continue to perform finer divisions to obtain one or more basic coding units, which are called coding units (CU, Coding Unit).
  • CU Coding Unit
  • Each CU is the most basic element in a coding session. Described below are various encoding methods that may be used for each CU.
  • Predictive Coding It includes intra-frame prediction and inter-frame prediction. After the original video signal is predicted by the selected reconstructed video signal, a residual video signal is obtained. The encoder needs to decide among many possible predictive coding modes for the current CU, select the most suitable one, and inform the decoder. Among them, intra-frame prediction means that the predicted signal comes from the area that has been coded and reconstructed in the same image; inter-frame prediction means that the predicted signal comes from other images (called reference images) that have been coded and different from the current image.
  • intra-frame prediction means that the predicted signal comes from the area that has been coded and reconstructed in the same image
  • inter-frame prediction means that the predicted signal comes from other images (called reference images) that have been coded and different from the current image.
  • Transform & Quantization The residual video signal undergoes transformation operations such as Discrete Fourier Transform (DFT, Discrete Fourier Transform), Discrete Cosine Transform (DCT, Discrete Cosine Transform) to convert the signal into the transform domain, are called transform coefficients.
  • DFT Discrete Fourier Transform
  • DCT Discrete Cosine Transform
  • the signal in the transform domain is further subjected to a lossy quantization operation, which loses certain information, so that the quantized signal is beneficial to the compressed expression.
  • the encoder also needs to select one transformation for the current encoding CU and inform the decoder.
  • the fineness of quantization is usually determined by the quantization parameter (QP, Quantizer Parameter).
  • Entropy Coding or Statistical Coding The quantized transform domain signal will undergo statistical compression coding according to the frequency of occurrence of each value, and finally output a binarized (0 or 1) compressed code stream. At the same time, the encoding produces other information, such as the selected mode, motion vector, etc., and entropy encoding is also required to reduce the bit rate.
  • Statistical coding is a lossless coding method that can effectively reduce the code rate required to express the same signal. Common statistical coding methods include variable length coding (VLC, Variable Length Coding) or context-based binary arithmetic coding (CABAC, Content Adaptive Binary Arithmetic Coding).
  • Loop Filtering The decoded image can be reconstructed by inverse quantization, inverse transformation and prediction compensation operations (the inverse operations of the above 2 to 4) for the coded image. Compared with the original image, the reconstructed image has some information different from the original image due to the influence of quantization, resulting in distortion (Distortion). Perform filtering operations on reconstructed images, such as deblocking, sample adaptive compensation (SAO, Sample Adaptive Offset) or pre-analog low-pass (ALF, Analog Low-pass filter) filters, which can effectively to reduce the amount of distortion produced by quantization.
  • SAO sample adaptive compensation
  • ALF Analog Low-pass filter
  • Intra prediction is a commonly used predictive coding technique. Intra prediction derives the prediction value of the current coded block from adjacent coded regions based on the spatial correlation of the pixels of the video image. There are a total of 33 intra prediction modes in AVS2, including 30 angle modes and 3 special modes (for example, Plane mode, DC mode and Bilinear mode), which are encoded using the most probable mode (MPM, Most Possible Mode), and the rest modes. 5-bit fixed-length encoding is used.
  • the second stage of AVS3 adopts the Extended Intra Prediction Mode (EIPM, Extended Intra Prediction Mode).
  • EIPM Extended Intra Prediction Mode
  • the angle prediction mode is expanded to 62, as shown in Figure 2, with arrows
  • the solid line is the original angle prediction mode
  • the dotted line with arrows is the new angle mode
  • the original angle mode number remains unchanged
  • the new angle mode numbers are 34 to 65.
  • the pixel points in the current prediction block use the reference pixel value at the corresponding position on the reference pixel row or column as the prediction value according to the direction corresponding to the angle of the prediction mode.
  • a video image is usually divided into a series of non-overlapping rectangular coding/decoding blocks according to a block division structure, and then an appropriate coding mode is selected for each coding block.
  • an encoding block using intra-frame prediction only one of the specified intra-frame prediction modes can be selected to derive the prediction value of the current encoding/decoding block, which results in low encoding efficiency and poor prediction value accuracy.
  • the current intra prediction methods cannot give accurate prediction values.
  • the present disclosure first proposes a video decoding method. Since the video encoding method and the video decoding method are corresponding, the exemplary embodiments of the present disclosure mainly focus on the technology of the present disclosure from the decoder side. plan is explained.
  • FIG. 3 schematically shows a flowchart of a video decoding method according to an embodiment of the present disclosure.
  • the video decoding method may be performed by a decoder, which may be the decoder 103 shown in FIG. 1 .
  • the video decoding method at least includes steps S310 to S340, which are described in detail as follows:
  • step S310 the code stream is decoded to obtain a first flag, a first index value and a second index value.
  • the first flag is used to identify whether to use the intra-frame weighted prediction mode for the current block to be decoded.
  • the original video signal after the original video signal is captured or produced, in order to compress the size of the original video signal, the original video signal needs to be encoded and compressed by an encoder.
  • the encoder When compressing, the encoder usually selects one or more predictive coding modes among multiple predictive coding modes for compression coding. Since even in the same image, the image textures at different positions are different, so when the image is After being divided into multiple coding units, different predictive coding modes can be selected for different coding units for coding, and then a code stream formed by the final compressed coded data can be obtained.
  • the process that the decoder decodes the compressed encoded data compressed by the encoder to form a reconstructed image can be regarded as the inverse process of the encoding process.
  • the decoder needs to use the prediction mode used by the encoder to encode the encoding unit according to the encoding process. and other parameters to decode the block to be decoded corresponding to the coding unit, and then in addition to the encoded video data, it is also necessary to write a flag or index value for instructing the acquisition of the required parameters in the code stream.
  • the code stream includes a first flag
  • the first flag is used to identify whether to use the intra-frame weighted prediction mode (IWP: Intra Weighted Prediction) for the block to be decoded. Therefore, the first flag can be obtained by decoding the code stream. , and according to the first flag, the intra prediction mode that needs to be adopted for the block to be decoded at present can be determined. Specifically, when the value of the first flag satisfies the first preset condition, the intra-frame weighted prediction mode is used to predict the block currently to be decoded; when the value of the first flag does not satisfy the first preset condition, the current block to be decoded is predicted Blocks are not predicted using intra-weighted prediction mode.
  • IWP Intra Weighted Prediction
  • the value of the first flag may also be other values than 0 and 1, as long as it can be clearly indicated whether to adopt the intra-frame weighted prediction mode.
  • other information may also be acquired before acquiring the first flag, and according to the other information, it is determined whether further decoding is required to obtain the first flag, so as to determine whether to use the IWP prediction mode for the current block to be decoded.
  • other information may be the width and height of the current block to be decoded, an image header flag, a sequence header flag, etc., specifically:
  • the third preset condition can be set according to actual needs.
  • the third preset condition can be set to be that when the height and width of the current decoding block are both greater than or equal to 8, the code stream needs to be decoded to obtain the first flag, and according to the first The value of the flag determines whether the IWP prediction mode can be used for each block to be decoded, and the conditions that the height and width need to meet can be set to different conditions in the third preset condition, for example, the third preset condition can be set.
  • the IWP prediction mode is allowed to be used, and so on, which is not specifically limited in this embodiment of the present disclosure.
  • the image header flag is used to identify whether the IWP prediction mode can be used for multiple blocks to be decoded in the same video image. If it is determined that the IWP prediction mode cannot be used according to the image header flag, there is no need to decode the code stream to obtain the first flag, that is, the current image. IWP prediction mode cannot be used for all blocks to be decoded in Blocks use the IWP prediction mode.
  • the image header flag can be marked as pic_header_flag_iwp, and its value can be set to 0 or 1.
  • the sequence header flag is used to identify whether all blocks to be decoded in an image sequence can use the IWP prediction mode. Only when the sequence header flag indicates that all blocks to be decoded in the image sequence can use the IWP prediction mode, further decoding is required to obtain the image header. flag and the first flag, if there is no image header flag, only the first flag needs to be acquired, and then it is determined whether the IWP prediction mode can be used for the block to be decoded according to the value of the first flag. For example, the sequence header flag can be marked as seq_header_flag_iwp, and its value can be 0 or 1.
  • the width and height of the block to be decoded and/or the image header flag and/or the sequence header flag it can be quickly determined whether the IWP prediction mode can be used for multiple blocks to be decoded in the same image or multiple blocks to be decoded in a sequence of images , compared to determining whether the IWP prediction mode can be used according to the first flag of each block to be decoded one by one, the data processing efficiency is improved.
  • the value of the flag determines whether to use the IWP prediction mode for the current block to be decoded.
  • other judgment manners may also be used, and details are not described herein again in this embodiment of the present disclosure.
  • step S320 when the value of the first flag satisfies the first preset condition, the target intra-frame prediction mode is determined in the first intra-frame prediction mode list according to the first index value, and the target intra-frame prediction mode is set in the weight list set according to the second index value Determine the list of target weights.
  • the target intra prediction mode and target weight list corresponding to the current block to be decoded can be obtained, and then according to the reference pixels of the current block to be decoded,
  • the target intra-frame prediction mode and the target weight list determine weighted reference pixels, and predict the current block to be decoded according to the weighted reference pixels.
  • both the target intra-frame prediction mode and the target weight list can be determined by matching.
  • the target intra-frame prediction mode list can be matched in the first intra-frame prediction mode list according to the first index value obtained by decoding.
  • the prediction mode is obtained, and the target weight list is obtained by matching in the weight list set according to the second index value obtained by decoding.
  • the first intra-frame prediction mode list includes multiple intra-frame prediction modes and sequence numbers corresponding to each intra-frame prediction mode, for example, the sequence number 1 corresponds to the intra-frame prediction mode numbered 3, and so on. After obtaining the first index value, the first index value can be matched with the sequence number in the first intra-frame prediction mode list to obtain the target sequence number matching the first index value; then the frame corresponding to the target sequence number The intra prediction mode serves as the target intra prediction mode.
  • the first intra prediction mode list may contain all possible intra prediction modes, but when the first intra prediction mode list is set to have a maximum length, the first intra prediction mode list may not contain all possible intra prediction modes, Therefore, when obtaining the target intra prediction mode, it is necessary to determine whether the target intra prediction mode is in the first intra prediction mode list. If the target intra prediction mode does not exist in the first intra prediction mode list, it needs to Get the target intra prediction mode from the list of intra prediction modes. In the embodiment of the present disclosure, how to acquire the target intra prediction mode may be determined according to the second flag related to the target intra prediction mode in the code stream.
  • FIG. 4 shows a schematic flowchart of acquiring the target intra prediction mode, as shown in FIG.
  • step S401 the code stream is decoded to obtain a second flag; in step S402, when it is determined according to the second flag that the target intra-frame prediction mode is in the first intra-frame prediction mode list, according to the first index value Determine the target intra-frame prediction mode in the first intra-frame prediction mode list; in step S403, when it is determined according to the second flag that the target intra-frame prediction mode is not in the first intra-frame prediction mode list, decode the code stream to obtain the third index value to determine the target intra prediction mode in the second intra prediction mode list according to the third index value, wherein the intra prediction modes included in the first intra prediction mode list and the second intra prediction mode list are different.
  • the target intra prediction mode can be uniquely determined.
  • the decoding end determines the intra-frame prediction mode for prediction according to the index value sent by the encoding end, so the decoding end can form the first intra-frame prediction mode list according to the intra-frame prediction mode used in each prediction and the preset intra-frame prediction mode. and the second intra-frame prediction mode list, how to form the first intra-frame prediction mode list and the second intra-frame prediction mode list will be described below.
  • the intra prediction mode in the MPM can be the frame corresponding to the decoded block adjacent to the current block to be decoded Intra prediction mode
  • the intra prediction mode of the adjacent intra prediction block in the spatial domain other than the MPM can be added to the first intra prediction mode list, for example, the intra prediction corresponding to the decoded block in the image frame adjacent to the current block to be decoded mode
  • a preset intra-frame angle prediction mode may be added to the first intra-frame prediction mode list, for example, intra-frame prediction modes numbered 3-32 may be added to the first intra-frame prediction mode list.
  • a special prediction mode in the intra prediction mode may also be added to the first intra prediction mode list, for example A bilinear mode and a plane mode can be added to the first intra prediction mode list.
  • the direct current (DC) mode is not included in the first intra-frame prediction mode list. If the added mode is the DC mode, the addition can be abandoned or the DC mode can be replaced with other intra-frame prediction modes for addition. This is because in the embodiments of the present disclosure, the DC mode is used when determining the second type of reference pixels. In order to ensure the technical effect that the technical solution can achieve, the first intra-frame prediction mode list does not include the DC mode.
  • the first intra-frame prediction mode can include all possible prediction modes.
  • the length of the first intra-frame prediction mode list can also be set. When the first intra-frame prediction mode list reaches the preset length, no new prediction modes will be added. .
  • the target weight list may also be determined by matching according to the index value.
  • the target weight list is a weight list composed of the weights of reference pixels corresponding to the current block to be decoded, and the first type of reference pixels and the second type of reference pixels can be weighted according to the target weight list. , to obtain weighted reference pixels.
  • Fig. 5 shows a schematic flowchart of determining the target weight list. As shown in Fig.
  • step S501 an identifier is determined according to the second index value, the width and height of the current block to be decoded, and the target intra prediction mode; in step S501 In S502, the identifier is matched with the serial number in the weight list set to obtain the target serial number, and the weight list corresponding to the target serial number is used as the target weight list.
  • the weight list set includes multiple weight lists and a sequence number corresponding to each weight list, and the sequence number is generated according to the index value, the intra prediction mode, and the width and height of the block to be decoded
  • the type of the index value is the same as the type of the second index value, so when the target weight list corresponding to the current block to be decoded is determined, the corresponding first index value and second index value can be obtained from the code stream.
  • An index value can determine the corresponding intra-frame prediction mode, and then an identifier can be generated according to the second index value, the intra-frame prediction mode, and the width and height of the current block to be decoded, and matched in the weight list set according to the identifier. Identifies the corresponding target weight list.
  • the target weight list may also be determined according to other methods, which will not be repeated in this embodiment of the present disclosure.
  • the second index value when there is only one weight list corresponding to the weight list set according to the intra prediction mode and the width and height of the current block to be decoded, the second index value may be obtained without decoding the code stream, and the second index value may be obtained according to the The second index value determines the target weight list, and the target weight list corresponding to the current block to be decoded can be directly obtained from the weight list set.
  • the weight list may be derived according to the effective reference pixels, and specifically, the weight list corresponding to the block to be decoded may be determined according to the intra prediction mode corresponding to the block to be decoded and the width and height of the block to be decoded.
  • Fig. 6 shows a schematic flowchart of determining the weight list, as shown in Fig. 6, specifically:
  • step S601 the length of the reference pixel corresponding to the block to be decoded is determined according to the width and height of the block to be decoded.
  • the length of the reference weight list is equal to the length of the reference pixel, and the length of the reference pixel is related to the width and height of the block to be decoded. If the width of the block to be decoded is M and the height is N, where M, N is a positive integer, then the length of the reference pixel is 2(M+N)+1. It is worth noting that for the case where the reference pixel is not available, the available reference pixel or preset value can be used for padding, so that the length of the reference pixel remains 2(M+N)+1, for example, for the most edge of an image.
  • FIG. 7 shows the length of the reference pixel determined according to the width and height of the block to be decoded. As shown in FIG.
  • the reference pixel of the block to be decoded is composed of the upper reference pixel and the left reference pixel adjacent to the block to be decoded,
  • the width M of the block to be decoded is 8 pixels, and the height N is also 8 pixels, so the length of the finally determined reference pixel is 33 pixels.
  • step S602 the effective reference pixels and the effective reference pixel lengths are determined in the length direction of the reference pixels according to the intra prediction mode corresponding to the block to be decoded.
  • the effective reference pixels and the lengths of the effective reference pixels may be determined according to the intra prediction mode corresponding to the block to be decoded. Since the intra prediction modes include an angular mode and a non-angular mode, the methods of determining the effective reference pixels and the lengths of the effective reference pixels are also different.
  • the prediction angle can be obtained, and the block to be decoded is projected along the prediction angle in the direction of the reference pixel. Completion in the direction determines the valid reference pixel.
  • the angle mode is the prediction mode numbered 9.
  • the size of the coding block can determine that the projection point is located at point A on the reference pixel row, so the effective reference pixels corresponding to the block to be coded are all reference pixels between point O and point A on the reference pixel row; as shown in Figure 8B,
  • the angle mode is the prediction mode numbered 15.
  • the projection point is located at point B on the extension line of the reference pixel row, then pixel completion can be performed between point O and point B, and then It can be obtained that the valid reference pixels corresponding to the block to be decoded are all reference pixels between points B and C on the reference pixel row.
  • the effective reference pixels are all pixels in the reference pixel row, so when calculating the length of the effective reference pixel, only the projection length in the horizontal direction needs to be considered, and the calculation formula is as shown in Equation (1) Show:
  • Valid-len is the length of the valid reference pixel
  • M is the width of the block to be decoded
  • N is the height of the block to be decoded
  • is the angle between the prediction mode and the vertical direction.
  • the angle mode is the prediction mode numbered 28.
  • the size of the coding block can determine that the projection point is located at point D on the reference pixel column, so the effective reference pixels corresponding to the block to be coded are all reference pixels between points O and D on the reference pixel row; as shown in Figure 8D,
  • the angle mode is the prediction mode numbered 20.
  • the effective reference pixels corresponding to the block to be decoded are all reference pixels between points E and F on the reference pixel row.
  • the effective reference pixels are all pixels in the reference pixel column, so when calculating the length of the effective reference pixel, only the projection length in the vertical direction needs to be considered, and the calculation formula is as shown in Equation (2) shown:
  • Valid-len is the length of the valid reference pixel
  • M is the width of the block to be decoded
  • N is the height of the block to be decoded
  • is the angle between the prediction mode and the horizontal direction.
  • the effective reference pixel is the reference pixel, and the length of the effective reference pixel is the same as the length of the reference pixel.
  • step S603 one or more preset points are set in the effective reference pixel based on the effective reference pixel length, the first position is determined in the effective reference pixel according to the index value and the preset point, and the first position is determined according to the position of the preset reference pixel. second position.
  • one or more preset points may be set in the effective reference pixels, and different positions of the preset points will result in different final weight lists.
  • the first position can be determined in the effective reference pixel according to the index value and the preset point
  • the second position can be determined according to the position of the preset reference pixel
  • different positions can be set for the reference pixel according to the relationship between the first position and the second position.
  • Weight to get the weight list corresponding to the block to be decoded.
  • the preset reference pixel may be a reference pixel obtained by projecting the reference pixel according to the prediction angle, or may be a reference pixel at any position in the reference pixel.
  • a plurality of preset points can be sorted in a preset order to form a preset point sequence, each preset point corresponds to a serial number, and the serial number and the index value
  • a preset point can be uniquely determined in the preset point sequence according to the index value
  • the first position is the position where the preset point is located.
  • FIG. 9 there are three preset points p0, p1 and p2 in the reference pixel in FIG.
  • the way of determining the second position is different for different types of intra prediction modes.
  • the intra prediction mode is the angle mode
  • the position ref_valid_i corresponding to the i-th reference pixel ref_i in the direction of the valid reference pixel can be determined according to the prediction angle
  • ref_valid_i is the second position; continue to take FIG. 9 as an example, the reference pixel Including the reference pixel row and the reference pixel column, since the effective reference pixel and the reference pixel row are on the same row, the reference pixel on the reference pixel row is projected according to the predicted angle and falls in the direction of the effective reference pixel.
  • the pixels on the reference pixel column can be projected according to the predicted angle and fall in the direction of the effective reference pixel, for example, the reference pixel P in FIG. 9 is predicted according to the After the angle projection, it falls on the pixel B in the direction of the effective reference pixel, so the position where the effective reference pixel B is located is the second position.
  • the intra-frame prediction mode is the non-angle mode
  • the position where the i-th reference pixel ref_i is located is the second position.
  • step S604 the weight of the reference pixel is set according to the relationship between the first position and the second position, and a weight list corresponding to the block to be decoded is obtained.
  • the weight of the reference pixel may be determined according to the sequence relationship between the first position and the second position. Specifically, when the coordinates of the first position are smaller than those of the second position When the coordinates of the preset reference pixels and the reference pixels whose position coordinates are smaller than the coordinates of the first position are set as the first weight, the weights of the remaining reference pixels are set as the second weight; when the coordinates of the first position are greater than or When it is equal to the coordinates of the second position, the weights of the preset reference pixels and the reference pixels whose position coordinates are smaller than the coordinates of the first position are set as the second weight, and the weights of the remaining reference pixels are set as the first weight, wherein the first weight Different from the second weight, for example, if the second position is before the first position, then the weight corresponding to the reference pixel ref_i can be set to 0, otherwise set to 8, which is equivalent to dividing the current block into two sub-blocks, For example,
  • FIG. 10 shows a schematic diagram of the reference pixel weight.
  • the reference pixel weight corresponds to the reference pixel shown in FIG. 9 , wherein the reference weight row has a weight of 8, and the reference weight column has a weight of 0.
  • a transition weight may also be added at the first position, and the transition weight may be set in various ways.
  • the transition weight of the reference pixel located before the first position is the weight taken For any weight in the value range, the transition weight of the reference pixel located after the first position varies with the distance between the position of the reference pixel and the first position, wherein the transition weight of the reference pixel after the first position is greater than that of the first position
  • the weight of the previous reference pixel is less than or equal to the maximum weight in the value range of the weight; or, the transition weight of the reference pixel before the first position changes with the absolute distance between the position of the reference pixel and the first position.
  • the transition weight of the reference pixel after the first position is any weight in the weight value range, wherein the transition weight of the reference pixel before the first position is greater than the weight of the reference pixel after the first position and less than or equal to the weight value range maximum weight in .
  • the weight value range is [0, 8]
  • the first position is the position where p1 is located
  • the reference pixel row located before p1 can be
  • the weight of the reference pixel and the reference pixel whose position of the projected pixel on the reference pixel column is before p1 is set to any value from 0 to 7, and the weight is recorded as w1.
  • the reference pixel on the reference pixel row is located after p1 (including p1)
  • the weight of the pixel and the reference pixel whose position of the projected pixel on the reference pixel column is before p1 is set to increase or decrease as the absolute distance between the reference pixel position and p1 increases, the weight is recorded as w1, and the reference pixel row is located after p1 (
  • the weight of the reference pixel including p1) is any value from 0 to 7, and the weight is recorded as w2.
  • w2 0
  • w1 can be from left to right: 1, 2, 3, 4, 5, 6 , 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, where the first 16 bits correspond to the reference pixels on the reference pixel column projected along the prediction angle in the direction of the effective reference pixels, The last three bits correspond to the three reference pixels located before p1 on the reference pixel row.
  • the weight of the reference pixel can also be set according to other criteria. For example, the weight increases by 1 for every 2 increase in the distance. For example, the weight of the reference pixel before the first position is 0, and the weight of the reference pixel after the first position is 0. 1122334455667788, or the increase of the weight is not incremental, but increases irregularly with the increase of the distance.
  • the weight of the reference pixel before the first position is 2, and the weight of the reference pixel after the first position is 456666777888. It is also possible that the weights of the reference pixels before and after the first position change with the distance from the first position, but the value ranges of the weights on both sides are different. For example, the weights of the reference pixels before the first position are in [0, 4 ] value, the weight of the reference pixel after the first position is in [5, 8], etc.
  • the setting of the weight of the reference pixel in the embodiment of the present disclosure includes all possible weight setting deformations, which will not be repeated here. .
  • step S330 the first type of reference pixels and the second type of reference pixels are determined according to the reference pixels corresponding to the current block to be decoded, and the first type of reference pixels and the second type of reference pixels are weighted based on the target weight list to obtain Weighted reference pixels.
  • the block to be decoded is divided into different sub-blocks by setting different weights for the reference pixels, and each sub-block corresponds to a different weight of the reference pixels.
  • different types of reference pixels can be weighted based on the weight list corresponding to the reference pixels, and then the block to be decoded can be predicted based on the weighted reference pixels.
  • the different types of reference pixels are determined based on the reference pixels corresponding to the block to be decoded.
  • the different types of reference pixels include a first type of reference pixels and a second type of reference pixels.
  • an auxiliary reference pixel of the same size can be constructed according to the reference pixel, and then target processing is performed on the pixel value of the reference pixel to obtain the pixel value of each pixel in the auxiliary reference pixel;
  • the reference pixels and auxiliary reference pixels are classified to obtain reference pixels of the first type and reference pixels of the second type.
  • the reference pixel corresponding to the block to be decoded may be denoted as R_org
  • the auxiliary reference pixel derived by performing target processing on R_org may be denoted as R_tmp.
  • R_tmp there are various methods for deriving R_tmp by processing R_org, for example: (i) Use the DC mode to average all pixel values in R_org, and use the average value as the pixel value of each pixel in R_tmp; (ii) Obtain the reference pixel weight in R_org at the position where the weight is greater than or equal to (or less than or equal to) a preset threshold , and use the DC mode to average these pixels, and then use the average value as the pixel value of each pixel in R_tmp; (iii) use a filter to filter R_org to obtain R_tmp, remove outliers in R_org, Make the value in R_tmp smoother; (iv) Pixels in R-tmp are derived from reconstructed pixels farther from the current block to be decoded, for example, R_tmp is derived from reconstructed pixels 3 lines away from the current block to be decoded according to the prediction angle.
  • R_tmp can also be derived according to other
  • R_org and R_tmp After R_org and R_tmp are determined, they can be classified according to preset rules to obtain reference pixels of the first type and reference pixels of the second type.
  • the preset rule may be to directly use the reference pixel R_org as the first type of reference pixel, and use the auxiliary reference pixel R-tmp as the second type of reference pixel; it may also be to determine the first type of reference pixel and the third type of reference pixel according to the third flag.
  • Class II reference pixels FIG. 11 shows a schematic flowchart of determining the first type of reference pixels and the second type of reference pixels according to the third flag. As shown in FIG.
  • step S1101 the code stream is decoded to obtain the third flag; in step S1102, When the value of the third flag satisfies the second preset condition, the reference pixel is used as the first type of reference pixel, and the auxiliary reference pixel is used as the second type of reference pixel; in step S1103, when the value of the third flag does not satisfy the second type of reference pixel In a preset condition, the auxiliary reference pixels are used as the first type of reference pixels, and the reference pixels are used as the second type of reference pixels.
  • the second preset condition may specifically be that the value of the third flag is 1, that is, when the value of the third flag is 1, R_org is the reference pixel of the first type, and R_tmp is the reference pixel of the second type; When the flag value is not 1, R_tmp is the reference pixel of the first type, and R-org is the reference pixel of the second type.
  • weighting processing may be performed on the reference pixels of the first type and the reference pixels of the second type according to the weight list corresponding to the reference pixels to obtain the weighted reference pixels.
  • the formula for calculating the weighted reference pixel is shown in formula (3):
  • R[x][y] (R 0 [x][y] ⁇ R W [x][y]+R 1 [x][y] ⁇ (max_w-R W [x][y]))/ max_w(3);
  • the weighted reference pixel can be obtained according to the above calculation formula, and then the weighted reference pixel can be used to predict the current block to be decoded.
  • luminance and chrominance are important parameters of a video image.
  • the reference pixels corresponding to the block to be decoded may include luminance reference pixels and chrominance reference pixels.
  • a luminance reference pixel weight list and a chrominance reference pixel weight list corresponding to the current block to be decoded may be determined, Further, the luminance weighted reference pixel and the chrominance weighted reference pixel can be determined according to the luminance reference pixel weight list and the chrominance reference pixel weight list and the luminance reference pixel and the chrominance reference pixel corresponding to the current block to be decoded.
  • the prediction is performed according to the luma weighted reference pixels and the chrominance weighted reference pixels, respectively, and the current block to be decoded is reconstructed according to the luma predicted value and the chrominance predicted value.
  • the reference pixels in the above embodiments may be luminance reference pixels.
  • the weights of the chrominance reference pixels can be calculated according to the weights of the luminance reference pixels to obtain the weight list of the chrominance reference pixels.
  • the calculation formula for calculating the weight of the chrominance reference pixel according to the weight of the luminance reference pixel is shown in formula (4):
  • R W _Chorma[x][y] is the weight of the chrominance reference pixel located at the coordinates (x, y)
  • R W _Luma is the weight list corresponding to the luminance reference pixel
  • scale_x is the luminance component and chrominance component of the video image.
  • the size scaling factor in the x direction scale_y is the size scaling factor of the luminance component and chrominance component of the video image in the y direction
  • is the left shift operation symbol
  • the value of x ⁇ 1 is equal to the value of x*2.
  • the input image is in YcbCr420 format
  • 1 luminance reference pixel corresponds to 4 chrominance reference pixels
  • scale_x and scale_y are set to 1
  • the weight matrix of the luminance reference pixel is R W _Luma
  • the weight of the chrominance reference pixel is R W _Chorma
  • the first type of chrominance reference pixels and the second type of chrominance reference pixels can be determined according to the chrominance reference pixels corresponding to the block to be decoded, and the pair of chrominance reference pixels based on the weight list of the chrominance reference pixels can be determined.
  • the first type of chrominance reference pixels and the second type of chrominance reference pixels are subjected to weighting processing to obtain chrominance weighted reference pixels, wherein the calculation formula corresponding to the weighting processing is the same as formula (2), which is not repeated here.
  • step S340 the current block to be decoded is predicted according to the weighted reference pixels and the target intra-frame prediction mode to obtain a prediction block corresponding to the current block to be decoded.
  • the current block to be decoded may be predicted according to the weighted reference pixel and the target intra prediction mode to obtain the predicted block corresponding to the current block to be decoded , and then obtain the reconstructed image according to the prediction blocks corresponding to the multiple to-be-decoded blocks corresponding to the video image.
  • the intra prediction mode corresponding to the current block to be decoded may be stored for predicting the intra prediction mode of the subsequent block to be decoded.
  • the intra prediction mode of the current block to be decoded it can be implemented in various ways.
  • the intra frame weighted prediction mode corresponding to the current block to be decoded can be stored as the final intra prediction mode, or the intra prediction mode can be stored according to the current block to be decoded.
  • the intra prediction modes corresponding to the smallest division unit in the block are stored separately. Next, how to store the intra prediction mode corresponding to the smallest division unit in the current block to be decoded is described in detail.
  • the reference pixels of the first type and the reference pixels of the second type are determined according to different methods.
  • the weighted reference pixels are determined according to the first type of reference pixels, the second type of reference pixels, and the weight of the reference pixels. Therefore, when performing prediction, some pixels in the block to be decoded are performed according to the intra prediction mode corresponding to the first type of reference pixels.
  • To predict and derive the predicted value some pixels are predicted to derive the predicted value according to the intra-frame prediction mode corresponding to the second type of reference pixels. That is to say, the intra-frame weighted prediction mode includes two prediction modes, so it is necessary to determine which frame Intra prediction mode is used for prediction. By storing the intra prediction mode corresponding to the minimum division unit in the decoding block, the accuracy of the prediction mode can be improved, thereby improving the prediction accuracy.
  • Fig. 12 shows a schematic flowchart of storing intra prediction modes according to the minimum division unit.
  • step S1201 the current block to be decoded is decomposed into multiple sub-decoding blocks according to a preset value; in step S1202, The storage mode index value is determined according to the preset pixels in each sub-decoding block, the target intra-frame prediction mode and the target weight list; in step S1203, the intra-frame prediction mode corresponding to the sub-decoding block is determined according to the storage mode index value, and the The sub-decoding block and the intra-frame prediction mode corresponding to the sub-decoding block are stored correspondingly.
  • the preset value may be the size corresponding to the minimum division unit, such as 4 ⁇ 4, etc.; in step S1202, the preset pixel in the sub-decoding block may specifically be located in the upper left corner of the minimum division unit Pixels, pixels located at other corners of the minimum division unit, or pixels located at the center of the minimum division unit, of course, can also be pixels at other positions in the minimum division unit.
  • the target intra-frame prediction mode includes angular mode and non-angle mode, and the target frame Different intra-prediction modes have different methods for determining the storage method index value.
  • the target intra-frame prediction mode is the angle mode
  • the reference pixels corresponding to the sub-decoding blocks are classified according to the target weight list and the second preset threshold, and the reference pixels corresponding to the sub-decoding blocks whose weights are smaller than the second preset threshold are obtained.
  • the first number and weight of the threshold are greater than or equal to the second number of the second preset threshold; when the first number is less than or equal to the second number, the storage mode index value is marked as the first value; when the first number is greater than the second number Quantity, the storage mode index value is marked as the second value.
  • the first preset threshold and the second preset threshold may be set according to actual needs.
  • the first preset threshold and the second preset threshold may be the same or different.
  • the first numerical value may be 0, the second numerical value may be 1, and of course other numerical values may also be set, which are not specifically limited in this embodiment of the present disclosure.
  • the first numerical value and the second numerical value correspond to different intra-frame prediction modes
  • the intra-frame prediction mode corresponding to the first type of reference pixels is used as the prediction corresponding to the minimum division unit
  • the mode is stored, and when it is determined that the storage mode index value is the second value, the intra prediction mode corresponding to the second type of reference pixels is stored as the prediction mode corresponding to the minimum division unit.
  • the intra prediction mode corresponding to the first type of reference pixels is the angle mode
  • the intra prediction mode corresponding to the second type of reference pixels is the DC mode
  • the intra prediction corresponding to the minimum division unit is determined.
  • the mode is the angle mode
  • the above embodiment describes from the decoding end how the decoder predicts the block to be decoded to obtain the corresponding prediction block, and then obtains the reconstructed image.
  • the operations performed by the decoding end can be regarded as the inverse operations of the encoding end, as shown in Figure 13. It is shown that the main process when the encoder encodes and compresses the original video signal is prediction-transformation-quantization-entropy coding to form a code stream.
  • the main process of the decoding end when decoding the code stream is entropy coding-reverse Quantization-inverse transform-prediction, so the method for prediction based on the intra-frame weighted prediction mode adopted in the embodiment of the present disclosure is also applicable to the coding end.
  • FIG. 14 schematically shows a flowchart of a video encoding method according to an embodiment of the present disclosure.
  • the video encoding method may be performed by an encoder, which may be the encoder 102 shown in FIG. 1 .
  • the video coding method includes at least steps S1410 to S1440, and the details are as follows:
  • step S1410 a target intra-frame prediction mode corresponding to the current block to be encoded is determined from the intra-frame prediction mode list, and a target weight list corresponding to the current to-be-encoded block is determined from the weight list set.
  • each video image after acquiring the original video signal, each video image may be divided into blocks, the video image may be divided into multiple non-overlapping processing units (blocks to be encoded), and then each video image is divided into multiple non-overlapping processing units (blocks to be encoded) by the encoder.
  • the processing unit performs the encoding operation.
  • the encoder When the encoder performs an encoding operation on a processing unit, it first performs predictive encoding on the processing unit, and the predictive encoding mode can select an intra-frame prediction mode or an inter-frame prediction mode according to different needs.
  • the mode is intra prediction mode.
  • an optimal intra-frame prediction mode may be selected from multiple intra-frame prediction modes to perform prediction on each processing unit, wherein the multiple intra-frame prediction modes may be the same as those currently pending.
  • the coded block is one or more of the intra prediction mode, the preset angle mode, the bilinear mode and the plane mode corresponding to the adjacent or non-adjacent coded blocks.
  • a target weight list corresponding to the current block to be encoded may also be determined from the weight list set, where the target weight list is used to subsequently perform weighting processing on different types of reference pixels corresponding to the current block to be encoded.
  • the weight list set includes multiple weight lists and sequence numbers corresponding to each weight list, wherein the sequence numbers corresponding to each weight list are based on an index value, an intra prediction mode, and a width of a block to be encoded.
  • an identifier when the width and height of the current block to be encoded and the intra prediction mode are obtained, an identifier can be determined according to the preset index value, the width and height of the current block to be encoded, and the intra prediction mode, and then the identifier is
  • the target weight list corresponding to the current block to be encoded can be determined by matching with the sequence numbers in the weight list set.
  • Each weight list in the weight list set can be derived according to the effective reference pixels corresponding to the block to be coded. Specifically, first, the length of the reference pixel corresponding to the block to be coded can be determined according to the width and height of the block to be coded, and then the length of the reference pixel corresponding to the block to be coded can be determined according to the width and height of the block to be coded.
  • the corresponding intra prediction mode determines the effective reference pixel and the effective reference pixel length in the length direction of the reference pixel, and then sets one or more preset points in the effective reference pixel based on the effective reference pixel length.
  • the weight list set can be generated only according to the width and height of the block to be coded and the corresponding
  • the intra prediction mode of the to-be-coded block determines the sequence number corresponding to the reference pixel weight list of the block to be coded.
  • step S1420 the first type of reference pixels and the second type of reference pixels are determined according to the reference pixels corresponding to the current block to be encoded, and the first type of reference pixels and the second type of reference pixels are weighted based on the target weight list to obtain Weighted reference pixels.
  • the block to be encoded is divided into different sub-blocks by setting different weights for the reference pixels, and each sub-block corresponds to a different weight of the reference pixel.
  • each sub-block corresponds to a different weight of the reference pixel.
  • different types of reference pixels can be weighted based on the weight list corresponding to the reference pixels, and then the block to be encoded can be predicted based on the weighted reference pixels.
  • the first type of reference pixels and the second type of reference pixels may be determined according to the reference pixels corresponding to the current block to be encoded, and the method for determining the first type of reference pixels and the second type of reference pixels at the decoder side
  • an auxiliary reference pixel of the same size can be constructed according to the reference pixel corresponding to the current block to be encoded, and then target processing is performed on the pixel value of the reference pixel to obtain the pixel value of each pixel in the auxiliary reference pixel;
  • the reference pixels and auxiliary reference pixels are classified to obtain reference pixels of the first type and reference pixels of the second type.
  • the reference pixel corresponding to the current block to be coded may be denoted as R_org
  • the auxiliary reference pixel derived by performing target processing on R_org may be denoted as R_tmp.
  • the R_tmp can also be derived according to other methods, and the valid reference pixels corresponding to the current block to be encoded can also be used as the R_org, and the R_tmp can be determined according to the R_org, etc., which are not described herein again in this embodiment of the present disclosure.
  • the first type of reference pixels and the second type of reference pixels may be determined according to a preset rule, for example, the reference pixels corresponding to the current to-be-encoded block are determined.
  • the reference pixel corresponding to the current block to be encoded is taken as the first type of reference pixel
  • the auxiliary reference pixel corresponding to the current block to be encoded is taken as the second type of reference pixel.
  • the reference pixel corresponding to the current block to be encoded can be taken as the second type of reference pixel.
  • the auxiliary reference pixels corresponding to the block to be encoded currently are used as the first type of reference pixels.
  • the first type of reference pixels and the second type of reference pixels can be weighted according to the target weight list corresponding to the current block to be encoded to obtain weighted reference pixels.
  • the calculation formula is shown in formula (3):
  • R[x][y] (R 0 [x][y] ⁇ R W [x][y]+R 1 [x][y] ⁇ (max_w-R W [x][y]))/ max_w(3);
  • R[x][y] is the weighted reference pixel at coordinates (x, y)
  • R 0 [x][y] is the first type of reference pixel at coordinates (x, y)
  • R W [ x][y] is the weight corresponding to the reference pixel located at the coordinate (x, y) in the target weight list
  • R 1 [x][y] is the second type of reference pixel located at the coordinate (x, y)
  • max_w is the maximum value in the weight value range.
  • luminance and chrominance are the characteristics of different channels of the video image.
  • the luminance information and chrominance information of the video image are also encoded respectively.
  • the reference pixels corresponding to the coding block include luminance reference pixels and chrominance reference pixels, and the luminance reference pixel weight list and the chrominance reference pixel weight list corresponding to the current block to be coded can also be obtained respectively according to the method of the above embodiment, and then according to the luminance reference pixel weight list.
  • the luminance weighted reference pixel and the chrominance weighted reference pixel can be determined by referring to the pixel weight list and the chrominance reference pixel weight list, as well as the luminance reference pixel and the chrominance reference pixel corresponding to the current block to be encoded.
  • the prediction is performed according to the luminance weighted reference pixels and the chrominance weighted reference pixels, respectively, and the current block to be encoded is encoded according to the luminance predicted value and the chrominance predicted value.
  • the reference pixel corresponding to the current block to be encoded in the above embodiment may be a luminance reference pixel.
  • the weight of the chrominance reference pixel may be calculated according to the weight of the luminance reference pixel to obtain the chrominance reference pixel.
  • a list of weights for reference pixels. The calculation formula for calculating the weight of the chrominance reference pixel according to the weight of the luminance reference pixel is shown in formula (4)
  • R W _Chorma[x][y] is the weight of the chrominance reference pixel located at the coordinates (x, y)
  • R W _Luma is the weight list corresponding to the luminance reference pixel
  • scale_x is the luminance component and chrominance component of the video image.
  • the size scaling factor in the x direction scale_y is the size scaling factor of the luminance component and chrominance component of the video image in the y direction
  • is the left shift operation symbol
  • the value of x ⁇ 1 is equal to the value of x*2.
  • the first type of chrominance reference pixels and the second type of chrominance reference pixels can be determined according to the chrominance reference pixels corresponding to the blocks to be encoded, and the pair of chrominance reference pixels based on the weight list of the chrominance reference pixels can be determined.
  • the first type of chrominance reference pixels and the second type of chrominance reference pixels are subjected to weighting processing to obtain chrominance weighted reference pixels, wherein the calculation formula corresponding to the weighting processing is the same as formula (3), which is not repeated here.
  • step S1430 the current block to be encoded is predicted according to the weighted reference pixels and the target intra prediction mode to obtain a prediction block corresponding to the current block to be encoded.
  • the current block to be decoded after determining the weighted reference pixel corresponding to the current block to be coded, the current block to be decoded can be predicted according to the weighted reference pixel and the target intra prediction mode corresponding to the current block to be coded to obtain The prediction block corresponding to the current block to be decoded.
  • the intra prediction mode corresponding to the current block to be coded may be stored for predicting the intra prediction mode of the subsequent block to be coded.
  • the intra prediction mode of the current block to be coded it can be implemented in various ways.
  • the intra frame weighted prediction mode corresponding to the current block to be coded can be stored as the final intra prediction mode, or the intra prediction mode can be stored according to the current block to be coded.
  • the intra prediction modes corresponding to the smallest division unit in the block are stored separately.
  • the method of storing the intra prediction mode of the current block to be encoded is similar to the method of storing the intra prediction mode of the current block to be decoded in the above-mentioned embodiment, the difference is only in that the objects are different, and the application scenarios are also different, one is for the block to be encoded, For the encoding process, the other is for the block to be decoded, for the decoding process.
  • step S1440 a code stream is formed according to the prediction block, and a first flag, a first index value and a second index value are added to the code stream.
  • the first flag is used to identify whether to use the intra-frame weighted prediction mode for the block to be decoded; the first index value is used to determine the target intra-frame prediction mode corresponding to the to-be-decoded block from the first intra-frame prediction mode list; the second The index value is used to determine the target weight list corresponding to the block to be decoded in the weight list set.
  • the encoder encodes and compresses the original video signal
  • a code stream is formed, and then the code stream is decoded by the decoding end to form a reconstructed image, so as a
  • the encoder side after completing the prediction of all processing units, it is also necessary to perform transform coding, quantization and entropy coding on the prediction block corresponding to the block to be coded to form a code stream, and some identification information needs to be added to the code stream.
  • the decoder side obtains the specific processing method adopted by the encoder side according to the identification information, and applies the specific processing method to the decoding process.
  • the identification information may include a first flag, a first index value, and a second index value, where the first flag is used to identify whether to use the intra-frame weighted prediction mode for the current block to be encoded, and the first index value is used to start from the first
  • the target intra-frame prediction mode corresponding to the block to be decoded is determined in an intra-frame prediction mode list, and the second index value is used to determine the target weight list corresponding to the to-be-decoded block in the weight list set.
  • the identification information may further include a second flag, a third flag, and a third index value, where the second flag is used to identify whether the target intra-frame prediction mode is in the first intra-frame prediction mode list, and the third flag is used for How to determine the reference pixels of the first type and the reference pixels of the second type is identified, and the third index value is used to identify whether the target intra prediction mode is in the first intra prediction mode list.
  • the code stream is first decoded to obtain a first flag, and whether to use the intra-frame weighted prediction mode is determined according to the first flag, and after determining to use the intra-frame weighted prediction mode,
  • the target intra-frame prediction mode is determined in the first intra-frame prediction mode list according to the first index value obtained from the decoded code stream, and the target weight list is determined in the weight list set according to the second index value; and then according to the reference corresponding to the block to be decoded
  • the pixels determine the first type of reference pixels and the second type of reference pixels, and perform weighting processing on the first type of reference pixels and the second type of reference pixels based on the target weight list to obtain weighted reference pixels; finally, according to the weighted reference pixels and target intra prediction
  • the mode predicts the block to be decoded, and the predicted block corresponding to the block to be decoded can be obtained.
  • a prediction method similar to the decoder side is used to perform predictive coding on the block to be coded, and then a code stream is generated, and the code stream is sent to the decoder for decoding.
  • the technical solutions of the present disclosure can perform weighted combination of two types of intra-frame prediction reference pixels, and derive a predicted value based on the weighted and combined reference pixels, thereby improving the accuracy of the predicted value; on the other hand, for a coding block/ When there are multiple textures in the decoding block, an accurate prediction value can be given; on the other hand, the prediction method in the present disclosure can be applied to video encoding and decoding, thereby improving encoding and decoding efficiency.
  • FIG. 15 schematically shows a block diagram of a video decoding apparatus according to an embodiment of the present disclosure.
  • a video decoding apparatus 1500 includes: a code stream decoding module 1501 , an index matching module 1502 , a pixel weighting module 1503 and a pixel prediction module 1504 .
  • the code stream decoding module 1501 is configured to decode the code stream to obtain a first flag, a first index value and a second index value, wherein the first flag is configured to identify whether to use the intra-frame weighted prediction mode for the current block to be decoded; the index The matching module 1502 is configured to, when the value of the first flag satisfies the first preset condition, determine the target intra prediction mode in the first intra prediction mode list according to the first index value, and determine the target intra prediction mode in the weight list according to the second index value. Centrally determine the target weight list; the pixel weighting module 1503 is configured to determine the first type of reference pixels and the second type of reference pixels according to the reference pixels corresponding to the current block to be decoded, and based on the target weight list.
  • the class reference pixels are weighted to obtain weighted reference pixels; the pixel prediction module 1504 is configured to predict the current block to be decoded according to the weighted reference pixels and the target intra prediction mode to obtain the predicted block corresponding to the current block to be decoded.
  • the first intra-frame prediction mode list includes multiple intra-frame prediction modes and sequence numbers corresponding to each intra-frame prediction mode; the index matching module 1502 is configured to: match the first index value with the first intra-frame prediction mode The sequence numbers in the mode list are matched to obtain a target sequence number matching the first index value; the intra-frame prediction mode corresponding to the target sequence number is used as the target intra-frame prediction mode.
  • the video decoding apparatus 1500 is further configured to: obtain a second flag; when it is determined according to the second flag that the target intra-frame prediction mode is in the first intra-frame prediction mode list, use the first index value in the first frame Determine the target intra-frame prediction mode in the intra-prediction mode list; when it is determined that the target intra-frame prediction mode is not in the first intra-frame prediction mode list according to the second flag, the decoding code stream obtains the third index value, and according to the third index value in the The target intra-frame prediction mode is determined in the second intra-frame prediction mode list; wherein the intra-frame prediction modes included in the first intra-frame prediction mode list and the second intra-frame prediction mode list are different.
  • the first intra-prediction mode list includes intra-prediction modes corresponding to decoded blocks that are adjacent or non-adjacent to the current block to be decoded, preset angular modes, bilinear modes, and planar modes One or more of , and the intra prediction modes included in the first intra prediction mode list are different from each other.
  • the weight list set includes multiple weight lists and sequence numbers corresponding to the weight lists, wherein the sequence numbers corresponding to the weight lists are based on the index value, the intra prediction mode, and the width and height of the block to be decoded generated, the type of the index value is the same as the type of the second index value; the index matching module 1502 is further configured to: determine an identifier according to the second index value, the width and height of the current block to be decoded, and the target intra prediction mode; Match with the sequence numbers in the weight list set to obtain the target sequence number, and use the weight list corresponding to the target sequence number as the target weight list.
  • the video decoding apparatus 1500 further includes: a weight list construction module configured to determine the weight list corresponding to the to-be-decoded block according to the intra-frame prediction mode corresponding to the to-be-decoded block and the width and height of the to-be-decoded block.
  • the weight list construction module includes: a first length determination unit configured to determine the length of reference pixels corresponding to the to-be-decoded block according to the width and height of the to-be-decoded block; and a second length determination unit configured to The intra prediction mode corresponding to the block to be decoded determines the effective reference pixel and the effective reference pixel length in the length direction of the reference pixel; the position determination unit is configured to set one or more preset points in the effective reference pixel based on the effective reference pixel length , determine the first position in the effective reference pixel according to the index value and the preset point, and determine the second position according to the position of the preset reference pixel; the weight setting unit is configured to set the reference pixel according to the relationship between the first position and the second position to obtain the weight list corresponding to the block to be decoded.
  • the second length determination unit is configured to: when the intra prediction mode is the angle mode, obtain the prediction angle, and determine the effective reference pixel and the effective reference pixel length according to the width and height of the block to be decoded and the prediction angle; when When the intra prediction mode is the non-angle mode, the effective reference pixel is determined as the reference pixel, and the effective reference pixel length is determined as the length of the reference pixel.
  • the weight setting unit is configured to: when the coordinates of the first position are smaller than the coordinates of the second position, set the weight of the preset reference pixel and the reference pixel whose position coordinates are smaller than the coordinates of the first position as the first weight , set the weight of the remaining reference pixels as the second weight; when the coordinates of the first position are greater than or equal to the coordinates of the second position, set the weights of the preset reference pixels and the reference pixels whose position coordinates are smaller than the coordinates of the first position For the second weight, set the weight of the remaining reference pixels to the first weight.
  • the weight setting unit is configured to: add a transition weight at the first position, wherein the transition weight of the reference pixel located before the first position is any weight in the weight value range, and the transition weight of the reference pixel located after the first position
  • the transition weight of the reference pixel changes with the distance between the position of the reference pixel and the first position, wherein the transition weight of the reference pixel after the first position is greater than the weight of the reference pixel before the first position and less than or equal to the weight value range
  • the maximum weight in The transition weight of the reference pixel is any weight in the weight value range, wherein the transition weight of the reference pixel before the first position is greater than the weight of the reference pixel after the first position and less than or equal to the maximum weight in the weight value range .
  • the pixel weighting module 1503 includes: a pixel processing unit configured to construct auxiliary reference pixels of the same size according to the reference pixels, and perform target processing on the pixel values of the reference pixels to obtain the pixel values of each pixel in the auxiliary reference pixels a classification unit, configured to classify the reference pixels and the auxiliary reference pixels according to preset rules to obtain the first type of reference pixels and the second type of reference pixels.
  • the classification unit is configured to: take the reference pixel as the first type of reference pixel and the auxiliary reference pixel as the second type of reference pixel; or, decode the code stream to obtain a third flag; when the value of the third flag satisfies the first
  • the reference pixels are used as the first type of reference pixels
  • the auxiliary reference pixels are used as the second type of reference pixels
  • the auxiliary reference pixels are used as the first type of reference pixels.
  • the reference pixel is used as the second type of reference pixel.
  • the pixel weighting module 1503 is configured to: determine the weighted reference pixels according to the calculation formula (3):
  • R[x][y] (R 0 [x][y] ⁇ R W [x][y]+R 1 [x][y] ⁇ (max_w-R W [x][y]))/ max_w(3);
  • R[x][y] is the weighted reference pixel at coordinates (x, y)
  • R 0 [x][y] is the first type of reference pixel at coordinates (x, y)
  • R W [ x][y] is the weight corresponding to the reference pixel located at the coordinate (x, y) in the target weight list
  • R 1 [x][y] is the second type of reference pixel located at the coordinate (x, y)
  • max_w is the maximum value in the weight value range.
  • the reference pixels include luma reference pixels and chrominance reference pixels
  • the weighted reference pixels include luma weighted reference pixels and chrominance weighted reference pixels.
  • the reference pixel is a luminance reference pixel
  • the weighted reference pixel is a luminance weighted reference pixel
  • the video decoding apparatus 1500 is further configured to: process the weight of the luminance reference pixel according to the calculation formula (4) to obtain the chrominance reference pixel
  • R W _Chorma[x][y] is the weight of the chrominance reference pixel located at the coordinates (x, y)
  • R W _Luma is the weight list corresponding to the luminance reference pixel
  • scale_x is the luminance component and chrominance component of the video image.
  • the size scaling factor in the x direction scale_y is the size scaling factor of the luminance component and chrominance component of the video image in the y direction
  • is the left shift operation symbol.
  • the pixel prediction module 1504 is configured to predict the current block to be decoded according to the luma weighted reference pixels, the chroma weighted reference pixels and the target intra prediction mode.
  • the video decoding apparatus 1500 is further configured to: before acquiring the first flag, acquire the width and height of the current block to be decoded, and when the width and height of the current block to be decoded satisfy a third preset condition, decode the code stream to obtain the first flag; or, before acquiring the first flag, decoding the code stream to obtain the image header flag, when the image header flag satisfies the fourth preset condition, decoding the code stream to obtain the first flag; or, after acquiring the first flag Before, the code stream is decoded to obtain the sequence header flag, and when the sequence header flag satisfies the fifth preset condition, the code stream is decoded to obtain the first flag or the image header flag and the first flag.
  • the video decoding apparatus 1500 further includes: a first storage module, configured to store the intra-frame weighted prediction mode corresponding to the current block to be decoded as the final intra-frame prediction mode; or, a decomposition module, configured to store according to the The preset value decomposes the current block to be decoded into a plurality of sub-decoding blocks; the index value determination module is configured to determine the storage mode index value according to the preset pixels in each sub-decoding block, the target intra-frame prediction mode and the target weight list; the second The storage module is configured to determine the intra-frame prediction mode corresponding to the sub-decoding block according to the storage mode index value, and store the sub-decoding block and the intra-frame prediction mode corresponding to the sub-decoding block correspondingly.
  • a first storage module configured to store the intra-frame weighted prediction mode corresponding to the current block to be decoded as the final intra-frame prediction mode
  • a decomposition module configured to store according to the The preset value decomposes the
  • the index value determination module is configured to: when the target intra-frame prediction mode is the angle mode, project the preset pixel in the direction of the effective reference pixel according to the prediction angle in the angle mode to obtain the target reference pixel; obtain The weight corresponding to the target reference pixel in the target weight list; when the weight corresponding to the target reference pixel is greater than or equal to the first preset threshold, the storage mode index value is marked as the first value; when the weight corresponding to the target reference pixel is less than the first value When the threshold is preset, the storage mode index value is marked as a second value different from the first value; or, when the target intra-frame prediction mode is the non-angle mode, the sub-decoding is performed according to the target weight list and the second preset threshold.
  • the reference pixels corresponding to the block are classified to obtain a first number of reference pixels corresponding to the sub-decoding blocks whose weights are less than the second preset threshold and a second number whose weights are greater than or equal to the second preset threshold; when the first number is less than or When it is equal to the second quantity, the storage mode index value is marked as the first numerical value; when the first quantity is greater than the second quantity, the storage mode index value is marked as the second numerical value.
  • the second storage module is configured to: when the storage mode index value is a first value, the intra prediction mode corresponding to the sub-decoding block is the intra prediction mode corresponding to the first type of reference pixels; when the storage mode index is the intra prediction mode corresponding to the first type of reference pixels; When the value is the second value, the intra-frame prediction mode corresponding to the sub-decoding block is the intra-frame prediction mode corresponding to the second type of reference pixels.
  • FIG. 16 schematically shows a block diagram of a video encoding apparatus according to an embodiment of the present disclosure.
  • a video encoding apparatus 1600 includes: a determination module 1601 , a weighting module 1602 , a prediction module 1603 and a code stream generation module 1604 .
  • the determining module 1601 is configured to determine the target intra-frame prediction mode corresponding to the current block to be coded, and to determine the target weight list corresponding to the current block to be coded from the weight list set;
  • the weighting module 1602 is configured to determine the target weight list corresponding to the current block to be coded;
  • the reference pixels corresponding to the block determine the reference pixels of the first type and the reference pixels of the second type, and perform weighting processing on the reference pixels of the first type and the reference pixels of the second type based on the target weight list to obtain the weighted reference pixels;
  • the prediction module 1603 is configured as Predict the current block to be coded according to the weighted reference pixels and the target intra-frame prediction mode, and obtain the predicted block corresponding to the current block to be coded;
  • the code stream generation module 1604 is configured to form a code stream according to the predicted block, and add a code stream to the code stream.
  • a first flag, a first index value, and a second index value wherein the first flag is used to identify whether to use the intra-frame weighted prediction mode for the block to be decoded; the first index value is used to determine from the first intra-frame prediction mode list and The target intra prediction mode corresponding to the decoded block; the second index value is used to determine the target weight list corresponding to the block to be decoded in the weight list set.
  • the video encoding apparatus 1600 is configured to: determine the target intra-prediction mode from a list of intra-prediction modes, wherein the list of intra-prediction modes includes coded blocks that are adjacent or non-adjacent to the current block to be coded One or more of the corresponding intra prediction mode, preset angle mode, bilinear mode and plane mode, and the intra prediction modes included in the intra prediction mode list are different from each other
  • the weight list set includes multiple weight lists and sequence numbers corresponding to the weight lists, wherein the sequence numbers corresponding to the weight lists are based on the index value, the intra prediction mode, and the width and height of the block to be decoded
  • the determining module 1601 is configured to: determine an identifier according to the preset index value, the width and height of the current block to be encoded, and the target intra-frame prediction mode; match the identifier with the serial number in the weight list set to obtain the target serial number, And take the weight list corresponding to the target serial number as the target weight list.
  • the video encoding apparatus 1600 further includes: a weight list construction module configured to determine a weight list corresponding to the to-be-encoded block according to the intra prediction mode corresponding to the to-be-encoded block and the width and height of the to-be-encoded block.
  • the second length determination unit is configured to: when the intra prediction mode is the angle mode, obtain the prediction angle, and determine the effective reference pixel and the effective reference pixel length according to the width and height of the block to be encoded and the prediction angle; when When the intra prediction mode is the non-angle mode, the effective reference pixel is determined as the reference pixel, and the effective reference pixel length is determined as the length of the reference pixel.
  • the weight setting unit is configured to: when the coordinates of the first position are smaller than the coordinates of the second position, set the weight of the preset reference pixel and the reference pixel whose position coordinates are smaller than the coordinates of the first position as the first weight , set the weight of the remaining reference pixels as the second weight; when the coordinates of the first position are greater than or equal to the coordinates of the second position, set the weights of the preset reference pixels and the reference pixels whose position coordinates are smaller than the coordinates of the first position For the second weight, set the weight of the remaining reference pixels to the first weight.
  • the weight setting unit is configured to: add a transition weight at the first position, wherein the transition weight of the reference pixel located before the first position is any weight in the weight value range, and the transition weight of the reference pixel located after the first position
  • the transition weight of the reference pixel changes with the distance between the position of the reference pixel and the first position, wherein the transition weight of the reference pixel after the first position is greater than the weight of the reference pixel before the first position and less than or equal to the weight value range
  • the maximum weight in The transition weight of the reference pixel is any weight in the weight value range, wherein the transition weight of the reference pixel before the first position is greater than the weight of the reference pixel after the first position and less than or equal to the maximum weight in the weight value range .
  • the weighting module 1602 includes: a pixel processing unit configured to construct auxiliary reference pixels of the same size according to the reference pixels, and perform target processing on the pixel values of the reference pixels to obtain pixel values of each pixel in the auxiliary reference pixels;
  • the classification unit is configured to classify the reference pixels and the auxiliary reference pixels according to a preset rule to obtain the first type of reference pixels and the second type of reference pixels.
  • the classification unit is configured to: take the reference pixels as the first type of reference pixels and the auxiliary reference pixels as the second type of reference pixels; or obtain a third flag from the encoded code stream; if the value of the third flag satisfies the third flag When there are two preset conditions, the reference pixels are used as the first type of reference pixels, and the auxiliary reference pixels are used as the second type of reference pixels; when the value of the third flag does not meet the second preset condition, the auxiliary reference pixels are used as the first type of reference pixels. The reference pixel is used as the second type of reference pixel.
  • the weighting module 1602 is configured to: determine the weighted reference pixels according to the calculation formula (3):
  • R[x][y] (R 0 [x][y] ⁇ R W [x][y]+R 1 [x][y] ⁇ (max_w-R W [x][y]))/ max_w(3);
  • R[x][y] is the weighted reference pixel at coordinates (x, y)
  • R 0 [x][y] is the first type of reference pixel at coordinates (x, y)
  • R W [ x][y] is the weight corresponding to the reference pixel located at the coordinate (x, y) in the target weight list
  • R 1 [x][y] is the second type of reference pixel located at the coordinate (x, y)
  • max_w is the maximum value in the weight value range.
  • the reference pixels include luma reference pixels and chrominance reference pixels
  • the weighted reference pixels include luma weighted reference pixels and chrominance weighted reference pixels.
  • the reference pixel is a luminance reference pixel
  • the weighted reference pixel is a luminance weighted reference pixel
  • the video encoding apparatus 1600 is further configured to: process the weight of the luminance reference pixel according to the calculation formula (4) to obtain the chrominance reference pixel Determine the first type of chrominance reference pixel and the second type of chrominance reference pixel according to the chrominance reference pixel corresponding to the current block to be encoded, and based on the weight list of the chrominance reference pixel, the first type of chrominance reference pixel Perform weighting processing with the second type of chrominance reference pixels to obtain chrominance weighted reference pixels;
  • R W _Chorma[x][y] is the weight of the chrominance reference pixel located at the coordinates (x, y)
  • R W _Luma is the weight list corresponding to the luminance reference pixel
  • scale_x is the luminance component and chrominance component of the video image.
  • the size scaling factor in the x direction scale_y is the size scaling factor of the luminance component and chrominance component of the video image in the y direction
  • is the left shift operation symbol.
  • the prediction module 1603 is configured to predict the current block to be encoded according to the luma weighted reference pixels, the chroma weighted reference pixels and the target intra prediction mode.
  • the video encoding apparatus 1600 further includes: a first storage module, configured to store the intra-frame weighted prediction mode corresponding to the current block to be encoded as the final intra-frame prediction mode; or, a decomposition module, configured to store according to The preset value decomposes the current block to be coded into a plurality of sub-coding blocks; the index value determination module is configured to determine the storage mode index value according to the preset pixels in each sub-coding block, the target intra-frame prediction mode and the target weight list; the second The storage module is configured to determine the intra-frame prediction mode corresponding to the sub-coding block according to the storage mode index value, and store the sub-coding block and the intra-frame prediction mode corresponding to the sub-coding block correspondingly.
  • a first storage module configured to store the intra-frame weighted prediction mode corresponding to the current block to be encoded as the final intra-frame prediction mode
  • a decomposition module configured to store according to The preset value decomposes the current block to be coded into a
  • the index value determination module is configured to: when the target intra-frame prediction mode is the angle mode, project the preset pixel in the direction of the effective reference pixel according to the prediction angle in the angle mode to obtain the target reference pixel; obtain The weight corresponding to the target reference pixel in the target weight list; when the weight corresponding to the target reference pixel is greater than or equal to the first preset threshold, the storage mode index value is marked as the first value; when the weight corresponding to the target reference pixel is less than the first value When the threshold is preset, the storage method index value is marked as a second value different from the first value; or, when the target intra-frame prediction mode is the non-angle mode, the sub-coding is paired with the target weight list and the second preset threshold.
  • the reference pixels corresponding to the block are classified to obtain a first number of reference pixels corresponding to the sub-coding block whose weights are less than the second preset threshold and a second number whose weights are greater than or equal to the second preset threshold; when the first number is less than or When it is equal to the second quantity, the storage mode index value is marked as the first numerical value; when the first quantity is greater than the second quantity, the storage mode index value is marked as the second numerical value.
  • the second storage module is configured to: when the storage mode index value is a first value, the intra prediction mode corresponding to the sub-coding block is the intra prediction mode corresponding to the first type of reference pixels; When the value is the second value, the intra-frame prediction mode corresponding to the sub-coding block is the intra-frame prediction mode corresponding to the second type of reference pixels.
  • FIG. 17 shows a schematic structural diagram of a computer system suitable for implementing an electronic device of an embodiment of the present disclosure.
  • the computer system 1700 includes a central processing unit (Central Processing Unit, CPU) 1701, which can be loaded into a random device according to a program stored in a read-only memory (Read-Only Memory, ROM) 1702 or from a storage part 1708
  • the program in the memory (Random Access Memory, RAM) 1703 is accessed to perform various appropriate actions and processes, so as to implement the video encoding and decoding methods in the above-mentioned embodiments.
  • RAM 1703 various programs and data necessary for system operation are also stored.
  • the CPU 1701, the ROM 1702, and the RAM 1703 are connected to each other through a bus 1704.
  • An Input/Output (I/O) interface 1705 is also connected to the bus 1704 .
  • the following components are connected to the I/O interface 1705: an input section 1706 including a keyboard, a mouse, etc.; an output section 1707 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc. ; a storage part 1708 including a hard disk and the like; and a communication part 1709 including a network interface card such as a LAN (Local Area Network) card, a modem, and the like.
  • the communication section 1709 performs communication processing via a network such as the Internet.
  • Drivers 1710 are also connected to I/O interface 1705 as needed.
  • a removable medium 1711 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is mounted on the drive 1710 as needed, so that a computer program read therefrom is installed into the storage section 1708 as needed.
  • embodiments of the present disclosure include a computer program product comprising a computer program carried on a computer-readable storage medium, the computer program containing program code for performing the method illustrated in the flowchart.
  • the computer program may be downloaded and installed from the network via the communication portion 1709, and/or installed from the removable medium 1711.
  • CPU central processing unit
  • the computer-readable storage medium shown in the embodiments of the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the above two.
  • the computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or a combination of any of the above.
  • Computer readable storage media may include, but are not limited to, electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read only memory (ROM), erasable Erasable Programmable Read Only Memory (EPROM), flash memory, optical fiber, portable Compact Disc Read-Only Memory (CD-ROM), optical storage device, magnetic storage device, or any suitable of the above The combination.
  • a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
  • a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code therein.
  • Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • a computer-readable signal medium can also be any computer-readable storage medium other than a computer-readable storage medium that can be sent, propagated, or transmitted for use by or in connection with an instruction execution system, apparatus, or device program of.
  • Program code embodied on a computer-readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wired, etc., or any suitable combination of the foregoing.
  • each block in the flowchart or block diagrams may represent a module, segment, or portion of code that contains one or more logical functions for implementing the specified functions executable instructions.
  • the functions noted in the blocks may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved.
  • the units involved in the embodiments of the present disclosure may be implemented in software or hardware, and the described units may also be provided in a processor. Among them, the names of these units do not constitute a limitation on the unit itself under certain circumstances.
  • the present disclosure also provides a computer-readable storage medium.
  • the computer-readable storage medium may be included in the electronic device described in the above embodiments; in electronic equipment.
  • the above-mentioned computer-readable storage medium carries one or more programs, and when the above-mentioned one or more programs are executed by an electronic device, the electronic device enables the electronic device to implement the methods in the above-mentioned embodiments.
  • modules or units of the apparatus for action performance are mentioned in the above detailed description, this division is not mandatory. Indeed, according to embodiments of the present disclosure, the features and functions of two or more modules or units described above may be embodied in one module or unit. Conversely, the features and functions of one module or unit described above may be further divided into multiple modules or units to be embodied.
  • the exemplary embodiments described herein may be implemented by software, or may be implemented by software combined with necessary hardware. Therefore, the technical solutions according to the embodiments of the present disclosure may be embodied in the form of software products, and the software products may be stored in a non-volatile storage medium (which may be CD-ROM, U disk, mobile hard disk, etc.) or on the network , which includes several instructions to cause a computing device (which may be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to an embodiment of the present disclosure.
  • a computing device which may be a personal computer, a server, a touch terminal, or a network device, etc.

Landscapes

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

Abstract

本公开提供一种视频编解码方法、装置及电子设备,涉及视频编解码技术领域。方法包括:解码码流,得到第一标志、第一索引值和第二索引值;在所述第一标志的值满足第一预设条件时,根据所述第一索引值在第一帧内预测模式列表中确定目标帧内预测模式,并根据所述第二索引值在权重列表集中确定目标权重列表;根据与所述当前待解码块对应的参考像素确定第一类参考像素和第二类参考像素,并基于所述目标权重列表对所述第一类参考像素和所述第二类参考像素进行加权处理,得到加权参考像素;根据所述加权参考像素和所述目标帧内预测模式对所述当前待解码块进行预测,得到与所述当前待解码块对应的预测块。

Description

视频编解码方法、装置、计算机程序产品、计算机可读存储介质及电子设备
相关申请的交叉引用
本申请基于申请号为202110164797.9、申请日为2021年02月05日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本申请作为参考。
技术领域
本公开涉及视频编解码技术领域,具体而言,涉及一种视频编解码方法、视频编解码装置、计算机程序产品、计算机可读存储介质及电子设备。
背景技术
随着用户对视频图像的分辨率和帧频率的高需求,视频数据也随之增大,通常需要较大的存储空间来存储或者较宽的带宽来传输,因此,目前业界基本都会使用视频编解码技术对视频进行压缩,以已压缩的格式存储或传输视频。
现代主流的视频编码技术主要有高效视频编码(HEVC,High Efficiency Video Coding)、通用视频编码(VVC,Versatile Video Coding)等国际视频编码标准和中国国家视频编码标准,例如信源编码标准(AVS,Audio Video coding Standard),其均采用混合编码框架对输入的原始视频信号进行处理。但是现有的视频编解码标准中,通常将视频图像按照块划分结构划分为一系列不重叠的矩形编码块或解码块,然后为每个编码块选择合适的编码方式,相应地采用与该编码方式对应的方式对解码块进行解码。对于使用帧内预测的编码块,只能从规定的帧内预测模式中选择一种导出当前编/解码块的预测值,并且对于一个矩形块中存在多种纹理,当前的帧内预测方法无法给出准确的预测值。
需要说明的是,在上述背景技术部分公开的信息仅用于加强对本公开的背景的理解,因此可以包括不构成对本领域普通技术人员已知的现有技术的信息。
发明内容
本公开的实施例提供了一种视频解码方法、视频解码装置、计算机程序产品、计算机可读存储介质及电子设备,进而在一定程度上可以提高对不同编/解码块导出的预测值的准确性,提升编解码效率。
本公开的其他特性和优点将通过下面的详细描述变得显然,或部分地通过本公开的实践而习得。
根据本公开实施例的一个方面,提供了一种视频解码方法,包括:解码码流,得到第一标志、第一索引值和第二索引值,其中所述第一标志用于标识是否对当前待解码块使用帧内加权预测模式;在所述第一标志的值满足第一预设条件时,根据所述第一索引值在第一帧内预测模式列表中确定目标帧内预测模式,并根据所述第二索引值在权重列表集中确定目标权重列表;根据与所述当前待解码块对应的参考像素确定第一类参考像素和第二类参考像素,并基于所述目标权重列表对所述第一类参考像素和所述第二类参考像素进行加权处理,得到加权参考像素;根据所述加权参考像素和所述目标帧内预测模式对所述当前待解码块进行预测,得到与所述当前待解码块对应的预测块。
根据本公开实施例的一个方面,提供了一种视频解码装置,包括:码流解码模块,配置为解码码流,得到第一标志、第一索引值和第二索引值,其中所述第一标志用于标识是否对当前待解码块使用帧内加权预测模式;索引匹配模块,配置为在所述第一标志的值满足第一预设条件时,根据所述第一索引值在第一帧内预测模式列表中确定目标帧内预测模式,并根据所述第二索引值在权重列表集中确定目标权重列表;像素加权模块,配置为根据与所述当前待解码块对应的参考像素确定第一类参考像素和第二类参考像素,并基于所述目标权重列表对所述第一类参考像素和所述第二类参考像素进行加权处理,得到加权参考像素;像素预测模块,配置为根据所述加权参考像素和所述目标帧内预测模式对所述当前待解码块进行预测,得到与所述当前待解码块对应的预测块。
根据本公开实施例的一个方面,提供了一种视频编码方法,包括:从帧内预测模式列表中确定与当前待编码块对应的目标帧内预测模式,并从权重列表集中确定与所述当前待编码块对应的目标权重列表;根据与所述当前待编码块对应的参考像素确定第一类参考像素和第二类参考像素,并基于所述目标权重列表对所述第一类参考像素和所述第二类参考像素进行加权处理,得到加权参考像素;根据所述加权参考像素和所述目标帧内预测模式对所述当前待编码块进行预测,得到与所述当前待编码块对应的预测块;根据所述预测块形成码流,并在所述码流中添加第一标志、第一索引值和第二索引值,其中所述第一标志用于标识是否对待解码块使用帧内加权预测模式;所述第一索引值用于从第一帧内预测模式列表中确定与所述待解码块对应的目标帧内预测模式;所述第二索引值用于在权重列表集中确定与所述待解码块对应的目标权重列表。
根据本公开实施例的一个方面,提供了一种视频编码装置,包括:确定模块,配置为从帧内预测模式列表中确定与当前待编码块对应的目标帧内预测模式,并从权重列表集中确定与所述当前待编码块对应的目标权重列表;加权模块,配置为根据与所述当前待编码块对应的参考像素确定第一类参考像素和第二类参考像素,并基于所述目标权重列表对所述第一类参考像素和所述第二类参考像素进行加权处理,得到加权参考像素;预测模块,配置为根据所述加权参考像素和所述目标帧内预测模式对所述当前待编码块进行预测,得到与所述当前待编码块对应的预测块;码流生成模块,配置为根据所述预测块形成码流,并在所述码流中添加第一标志、第一索引值和第二索引值,其中所述第一标志用于标识是否对待解码块使用帧内加权预测模式;所述第一索引值用于从第一帧内预测模式列表中确定与所述待解码块对应的目标帧内预测模式;所述第二索引值用于在权重列表集中确定与所述待解码块对应的目标权重列表。
根据本公开实施例的一个方面,提供了一种计算机存储介质,其上存储有计算机程序,所述程序被处理器执行时实现上述的可选实现方式中提供的视频解码方法和视频编码方法。
根据本公开实施例的一个方面,提供了一种计算机程序产品或计算机程序,该计算机程序产品或计算机程序包括计算机指令,该计算机指令存储在计算机可读存储介质中。计算机设备的处理器从计算机可读存储介质读取该计算机指令,处理器执行该计算机指令,使得该计算机设备执行上述的可选实现方式中提供的视频解码方法和视频编码方法。
根据本公开实施例的一个方面,提供了一种电子设备,包括:一个或多个处理器;存储装置,用于存储一个或多个程序,当所述一个或多个程序被所述一个或多个处理器执行时,使得所述一个或多个处理器实现上述的可选实现方式中提供的方法。
本公开一方面能够将两种类型的帧内预测参考像素进行加权组合,并基于加权组合后的参考像素导出预测值,提高了预测值的准确性;另一方面本公开中的预测方法可以应用于视频编解码中,进而提升编解码效率。
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本公开。
附图说明
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用于解释本公开的原理。显而易见地,下面描述中的附图仅仅是本公开的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。在附图中:
图1示出了可以应用本公开实施例的技术方案的示例性系统架构的示意图;
图2示意性示出了帧内预测模式的结构示意图;
图3示意性示出了根据本公开的一个实施例的视频解码方法的流程示意图;
图4示意性示出了根据本公开的一个实施例的获取目标帧内预测模式的流程示意图;
图5示意性示出了根据本公开的一个实施例的确定目标权重列表的流程示意图;
图6示意性示出了根据本公开的一个实施例的确定权重列表的流程示意图;
图7示意性示出了根据本公开的一个实施例的根据待解码块的宽度和高度确定的参考像素的长度的结构示意图;
图8A-8B示意性示出了根据本公开的一个实施例的预测角度在对角模式顺时针方向时如何确定有效参考像素和有效参考像素的长度的流程示意图;
图8C-8D示意性示出了根据本公开的一个实施例的预测角度在对角模式逆时针方向时如何确定有效参考像素和有效参考像素的长度的流程示意图;
图9示意性示出了根据本公开的一个实施例的预设点的位置示意图;
图10示意性示出了根据本公开的一个实施例的参考像素权重的示意图;
图11示意性示出了根据本公开的一个实施例的根据第三标志确定第一类参考像素和第二类参考像素的流程示意图;
图12示意性示出了根据本公开的一个实施例的根据最小划分单元存储帧内预测模式的流程示意图;
图13示意性示出了视频编解码的流程示意图;
图14示意性示出了根据本公开的一个实施例的视频编码方法的流程示意图;
图15示意性示出了根据本公开的一个实施例的视频解码装置的框图;
图16示意性示出了根据本公开的一个实施例的视频编码装置的框图;
图17示出了适于用来实现本公开实施例的电子设备的计算机系统的结构示意图。
具体实施方式
现在将参考附图更全面地描述示例实施方式。然而,示例实施方式能够以多种形式实施,且不应被理解为限于在此阐述的范例;相反,提供这些实施方式使得本公开将更加全面和完整,并将示例实施方式的构思全面地传达给本领域的技术人员。
此外,所描述的特征、结构或特性可以以任何合适的方式结合在一个或更多实施例中。在下面的描述中,提供许多具体细节从而给出对本公开的实施例的充分理解。然而,本领域技术人员将意识到,可以实践本公开的技术方案而没有特定细节中的一个或更多,或者可以采用其它的方法、组元、装置、步骤等。在其它情况下,不详细示出或描述公知方法、装置、实现或者操作以避免模糊本公开的各方面。
附图中所示的方框图仅仅是功能实体,不一定必须与物理上独立的实体相对应。即,可以采用软件形式来实现这些功能实体,或在一个或多个硬件模块或集成电路中实现这些功能实体,或在不同网络和/或处理器装置和/或微控制器装置中实现这些功能实体。
附图中所示的流程图仅是示例性说明,不是必须包括所有的内容和操作/步骤,也不是必须按所描述的顺序执行。例如,有的操作/步骤还可以分解,而有的操作/步骤可以合并或部分合并,因此实际执行的顺序有可能根据实际情况改变。
图1示出了可以应用本公开实施例的技术方案的示例性系统架构的示意图。
如图1所示,系统架构可以包括第一终端设备101、编码器102、解码器103、网络104以及第二终端设备105。其中,第一终端设备101具体可以是包含显示屏幕且可用于拍摄或制作视频的终端设备,例如可以是智能手机、笔记本、平板电脑、台式电脑、便携式电脑、摄像机、照相机等,用于采集视频信号。编码器102用于对第一终端设备101采集的视频信号进行编码压缩,以减小视频的数据量。解码器103用于对编码器102输出的码流进行解码,并对编码压缩后的视频图像进行预测,进而得到重构图像。第二终端设备105具体可以是包含显示屏幕的终端设备,例如可以是电视机、智能手机、笔记本、平板电脑、台式电脑、便携式电脑等,用于播放由重构图像构成的视频。网络104用以在第一终端设备101和编码器102、编码器102和解码器103、解码器和第二终端设备105之间提供通信链路的介质,网络104可以包括各种连接类型,例如有线通信链路、无线通信链路等等,在本公开实施例中,终端设备101和服务器103之间的网络可以是无线通信链路,具体地可以是移动网络。
应该理解,图1中的第一终端设备、编码器、解码器、网络和第二终端设备的数目仅仅是示意性的。根据实现需要,可以具有任意数目的第一终端设备、编码器、解码器、网络和第二终端设备。值得说明的是,本公开中的编码器和解码器或者编码器、解码器和第二终端设备还可以是一个独立的集成终端,在该集成终端中可以实现多个功能。
在一些实施例中,通过第一终端设备101拍摄或制作视频,并将原始视频信号通过网络104发送至编码器102,编码器102接收到原始视频信号后,采用帧内加权预测模式对视频信号进行编码压缩以形成码流,该码流中还包含解码压缩后的视频信号时所需的参数,例如帧内预测模式、与解码相关的标志和索引等等。解码器103接收到码流后,可以对码流进行解码获取其中的参数和待解码的视频数据,并根据帧内加权预测模式对待解码的视频数据进行预测,进而获取与原始视频信号对应的重构视频信号,并将该重构视频信号发送至第二终端设备105进行显示。
需要说明的是,本公开实施例所提供的视频解码方法一般由终端设备执行,相应地,视频解码装置一般设置于终端设备中。但是,在本公开的其它实施例中,也可以由服务器执行本公开实施例所提供的视频解码方法。
在对本公开的技术方案进行详细说明之前,首先对相关技术中的视频编解码技术进行大概介绍。现代主流视频编码技术,以国际视频编码标准HEVC,VVC,以及中国国家视频编码标准AVS为例,采用了混合编码框架,对输入的原始视频信号,进行了如下一系列的操作和处理:
1)块划分结构(Block Partition Structure):输入图像根据一个的大小,划分成若干个不重叠的处理单元,每个处理单元将进行类似的压缩操作。这个处理单元被称作编码树单元(CTU,Coding Tree Unit),或者最大编码单元(LCU,Largest Coding Unit)。CTU再往下,可以继续进行更加精细的划分,得到一个或多个基本编码的单元,称之为编码单元(CU,Coding Unit)。每个CU是一个编码环节中最基本的元素。以下描述的是对每一个CU可能采用的各种编码方式。
2)预测编码(Predictive Coding):包括了帧内预测和帧间预测等方式,原始视频信号经过选定的已重建视频信号的预测后,得到残差视频信号。编码端需要为当前CU决定在众多可能的预测编码模式中,选择最适合的一种,并告知解码端。其中,帧内预测是预测的信号来自于同一图像内已经编码重建过的区域;帧间预测是预测的信号来自已经编码过的,不同于当前图像的其他图像(称 之为参考图像)。
3)变换编码及量化(Transform&Quantization):残差视频信号经过离散傅里叶变换(DFT,Discrete Fourier Transform),离散余弦变换(DCT,Discrete Cosine Transform)等变换操作,将信号转换到变换域中,称之为变换系数。在变换域中的信号,进一步的进行有损的量化操作,丢失掉一定的信息,使得量化后的信号有利于压缩表达。在一些视频编码标准中,可能有多于一种变换方式可以选择,因此,编码端也需要为当前编码CU选择其中的一种变换,并告知解码端。量化的精细程度通常由量化参数(QP,Quantizer Parameter)来决定,QP取值较大,表示更大取值范围的系数将被量化为同一个输出,因此通常会带来更大的失真,及较低的码率;相反,QP取值较小,表示较小取值范围的系数将被量化为同一个输出,因此通常会带来较小的失真,同时对应较高的码率。
4)熵编码(Entropy Coding)或统计编码:量化后的变换域信号,将根据各个值出现的频率,进行统计压缩编码,最后输出二值化(0或者1)的压缩码流。同时,编码产生其他信息,例如选择的模式,运动矢量等,也需要进行熵编码以降低码率。统计编码是一种无损编码方式,可以有效的降低表达同样的信号所需要的码率。常见的统计编码方式有变长编码(VLC,Variable Length Coding)或者基于上下文的二值化算术编码(CABAC,Content Adaptive Binary Arithmetic Coding)。
5)环路滤波(Loop Filtering):已经编码过的图像,经过反量化,反变换及预测补偿的操作(上述2~4的反向操作),可获得重建的解码图像。重构图像与原始图像相比,由于存在量化的影响,部分信息与原始图像有所不同,产生失真(Distortion)。对重构图像进行滤波操作,例如去块效应滤波(deblocking),样点自适应补偿(SAO,Sample Adaptive Offset)或者前置模拟低通(ALF,Analog Low-pass filter)等滤波器,可以有效的降低量化所产生的失真程度。
接下来对相关技术中的帧内预测技术进行说明。
帧内预测是一种常用的预测编码技术。帧内预测基于视频图像的像素在空域存在的相关性,从相邻已编码区域导出当前编码块的预测值。在AVS2中共有33种帧内预测模式,包括30个角度模式和3个特殊模式(例如,Plane模式,DC模式和Bilinear模式),采用最可能模式(MPM,Most Possible Mode)编码,其余的模式采用5位定长编码。为支持更精细的角度预测,AVS3第二阶段采纳了扩展的帧内角度预测模式(EIPM,Extended Intra Prediction Mode),AVS3中将角度预测模式扩展为62个,如图2所示,其中带箭头的实线为原有的角度预测模式,带箭头的虚线为新增的角度模式,原有角度模式编号不变,新增的角度模式编号为34到65。当采用角度预测模式时,当前预测块内的像素点根据预测模式的角度所对应的方向,将参考像素行或列上对应位置的参考像素值作为预测值。
相关技术的视频编码标准中,通常将视频图像按照块划分结构划分为一系列不重叠的矩形编/解码块,然后为每个编码块选择合适的编码方式。对于使用帧内预测的编码块,只能从规定的帧内预测模式中选择一种导出当前编/解码块的预测值,编码效率低且预测值准确度差。并且对于一个矩形块中存在多种纹理,当前的帧内预测方法无法给出准确的预测值。
为了克服相关技术中存在的问题,本公开首先提出了一种视频解码方法,由于视频编码方法和视频解码方法是对应的,因此本公开的示例性实施例中主要从解码器端对本公开的技术方案进行说明。
图3示意性示出了根据本公开的一个实施例的视频解码方法的流程图,该视频解码方法可以由解码器来执行,该解码器可以是图1中所示的解码器103。参照图3所示,该视频解码方法至少包括步骤S310至步骤S340,详细介绍如下:
在步骤S310中,解码码流,得到第一标志、第一索引值和第二索引值。
作为示例,第一标志用于标识是否对当前待解码块使用帧内加权预测模式。
在一些实施例中,当拍摄或制作得到原始视频信号后,为了压缩原始视频信号的大小,需要通过编码器对原始视频信号进行编码压缩。在压缩的时候,编码器通常会在多种预测编码模式中选择一种或多种预测编码模式进行压缩编码,由于即使是在同一图像中,不同位置的图像纹理也有所不同,因此在将图像划分为多个编码单元后,可以针对不同的编码单元选择不同的预测编码模式进行编码,进而获取由最终的压缩编码数据形成的码流。同时,解码器对编码器压缩后的压缩编码数据进行解码形成重构图像的过程,可以看作是编码过程的反过程,因此解码器需要根据编码器对编码单元进行编码时所采用的预测模式以及其它参数对与编码单元对应的待解码块进行解码,进而在码流中除了需要写入编码后的视频数据,还需要写入用于指示获取所需参数的标志或索引值。
在本公开的实施例中,码流包含第一标志,该第一标志用于标识是否对待解码块使用帧内加权 预测模式(IWP:Intra Weighted Prediction),因此通过解码码流可得到第一标志,并根据该第一标志可以确定对当前待解码块所需采用的帧内预测模式。具体地,当第一标志的值满足第一预设条件时,对当前待解码块使用帧内加权预测模式进行预测;当第一标志的值不满足第一预设条件时,对当前待解码块不使用帧内加权预测模式进行预测。在本公开的实施例中,该第一标志可以标记为cu_flag_iwp,其值可以是0或1,第一预设条件具体可以是cu_flag_iwp=1,也就是说,当cu_flag_iwp=1时采用IWP预测模式对当前待解码块进行预测,当cu_flag_iwp=0时不采用IWP预测模式对当前待解码块进行预测。值得注意的是,第一标志的值还可以是除0、1之外的其它数值,只要可以明确指示是否采用帧内加权预测模式即可。
为了提高处理效率,还可以在获取第一标志之前获取其它信息,并根据其它信息确定是否需要进一步解码得到第一标志,以确定是否对当前待解码块使用IWP预测模式。在本公开的实施例中,其它信息可以是当前待解码块的宽度和高度、图像头标志、序列头标志等,具体地:
根据当前待解码块的宽度和高度确定是否对当前待解码块使用IWP预测模式,具体地,获取当前待解码块的宽度和高度,若当前待解码块的宽度和高度满足第三预设条件时,则需要解码码流获取第一标志,并根据第一标志的值确定是否可以对每个待解码块使用IWP预测模式,若当前待解码块的宽度和高度不满足第三预设条件时,则无需解码码流获取第一标志,第一标志的值默认为0,也就是说,当前图像中所有待解码块都不可使用IWP预测模式。其中,第三预设条件可以根据实际需要设置,例如可以设定第三预设条件为当前解码块的高度和宽度均大于等于8时,则需要解码码流得到第一标志,并根据第一标志的值确定是否可以对每个待解码块使用IWP预测模式,还可以在第三预设条件中将高度和宽度所需满足的条件设置为不同的条件,例如可以设定第三预设条件为当前解码块的高度大于8、宽度大于10时,允许使用IWP预测模式,等等,本公开实施例对此不作具体限定。
图像头标志用于标识对应同一视频图像中的多个待解码块是否可以使用IWP预测模式,若根据图像头标志确定不可使用IWP预测模式时,则无需解码码流获取第一标志,即当前图像中所有待解码块都不可使用IWP预测模式,若根据图像头标志确定可以使用IWP预测模式时,则需要解码码流获取第一标志,并根据第一标志的值确定是否可以对每个待解码块使用IWP预测模式。举例而言,图像头标志可以标记为pic_header_flag_iwp,其值可以设置为0或1,当pic_header_flag_iwp=0时,当前图像所有待解码块的cu_flag_iwp=0,无需对码流进行解码,即当前图像中所有待解码块均不使用IWP预测模式;当pic_header_flag_iwp=1时,需要解码获取当前图像所有待解码块的cu_flag_iwp,并根据各待解码块对应的cu_flag_iwp确定是否对该待解码块使用IWP预测模式。
序列头标志用于标识一个图像序列中的所有待解码块是否可以使用IWP预测模式,只有当序列头标志指示图像序列中的所有待解码块可以使用IWP预测模式时,才需进一步解码获取图像头标志和第一标志,如果不存在图像头标志则只需获取第一标志即可,进而根据第一标志的值确定是否可以对待解码块使用IWP预测模式。举例而言,序列头标志可以标记为seq_header_flag_iwp,其值可以是0或1,当seq_header_flag_iwp=0时,当前图像序列中的所有待解码块均不可使用IWP预测模式,进而无需解码获取cu_flag_iwp或者pic_header_flag_iwp和cu_flag_iwp;当seq_header_flag_iwp=1时,需要解码获取图像序列中所有待解码块的cu_flag_iwp或者pic_header_flag_iwp和cu_flag_iwp,并根据各待解码块对应的cu_flag_iwp确定是否对该待解码块使用IWP预测模式。
根据待解码块的宽度和高度和/或图像头标志和/或序列头标志可以快速确定是否可以对同一图像中的多个待解码块或者一个图像序列中的多个待解码块使用IWP预测模式,相比于逐个根据各待解码块的第一标志确定是否可以使用IWP预测模式,提高了数据处理效率。
除此之外,还可以采用其它的方式判断是否对当前待解码块使用IWP预测模式,例如可以先解码得到帧内预测模式,根据帧内预测模式判断是否需要解码第一标志,并根据第一标志的值判断是否对当前待解码块使用IWP预测模式,作为一个具体示例,当帧内预测模式为角度模式时才需要解码获取cu_flag_iwp,否则cu_flag_iwp=0,即不对当前待解码块使用IWP预测模式。当然还可以是其它的判断方式,本公开实施例在此不再赘述。
在步骤S320中,在第一标志的值满足第一预设条件时,根据第一索引值在第一帧内预测模式列表中确定目标帧内预测模式,并根据第二索引值在权重列表集中确定目标权重列表。
在本公开的实施例中,在确定对当前待解码块使用IWP预测模式后,可得到与当前待解码块对应的目标帧内预测模式和目标权重列表,进而根据当前待解码块的参考像素、目标帧内预测模式和目标权重列表确定加权参考像素,并根据加权参考像素对当前待解码块进行预测。在本公开的实 施例中,目标帧内预测模式和目标权重列表均可通过匹配方式确定,具体地,可以根据解码得到的第一索引值在第一帧内预测模式列表中匹配得到目标帧内预测模式,并根据解码得到的第二索引值在权重列表集中匹配得到目标权重列表。
第一帧内预测模式列表包括多种帧内预测模式和与各帧内预测模式对应的序列号,例如序列号1对应编号为3的帧内预测模式,等等。在获取第一索引值后,可以将第一索引值与第一帧内预测模式列表中的序列号进行匹配,得到与第一索引值匹配的目标序列号;然后将与目标序列号对应的帧内预测模式作为目标帧内预测模式。
第一帧内预测模式列表可以包含所有可能的帧内预测模式,但是当设置第一帧内预测模式列表具有最大长度时,第一帧内预测模式列表可能无法包含所有可能的帧内预测模式,因此在获取目标帧内预测模式时需要判断目标帧内预测模式是否在第一帧内预测模式列表中,如果目标帧内预测模式不存在于第一帧内预测模式列表中时,则需要从其它的帧内预测模式列表中获取目标帧内预测模式。在本公开的实施例中,可以根据码流中与目标帧内预测模式相关的第二标志确定如何获取目标帧内预测模式,图4示出了获取目标帧内预测模式的流程示意图,如图4所示,在步骤S401中,解码码流,得到第二标志;在步骤S402中,当根据第二标志确定目标帧内预测模式在第一帧内预测模式列表中时,根据第一索引值在第一帧内预测模式列表中确定目标帧内预测模式;在步骤S403中,当根据第二标志确定目标帧内预测模式不在第一帧内预测模式列表中时,解码码流获取第三索引值,以根据第三索引值在第二帧内预测模式列表中确定目标帧内预测模式,其中第一帧内预测模式列表与第二帧内预测模式列表所包含的帧内预测模式不同。通过图4所示的流程示意图,可以唯一确定目标帧内预测模式。
解码端根据编码端发送的索引值确定帧内预测模式进行预测,因此在解码端可以根据每次预测时所采用的帧内预测模式以及预设的帧内预测模式形成第一帧内预测模式列表及第二帧内预测模式列表,下面对如何形成第一帧内预测模式列表和第二帧内预测模式列表进行说明。
首先将MPM(最可能模式)中的帧内预测模式加入到第一帧内预测模式列表中,其中MPM中的帧内预测模式可以是与当前待解码块相邻的已解码块所对应的帧内预测模式;接着可以将MPM以外空域相邻帧内预测块的帧内预测模式加入第一帧内预测模式列表,例如与当前待解码块相邻的图像帧中已解码块对应的帧内预测模式;然后可以将预设的帧内角度预测模式加入第一帧内预测模式列表,例如将编号为3-32的帧内预测模式加入第一帧内预测模式列表。作为示例,除了可以将帧内预测模式中的角度预测模式加入到第一帧内预测模式列表中,还可以将帧内预测模式中的特殊预测模式加入到第一帧内预测模式列表中,例如可以将双线性(bilinear)模式、平面(plane)模式加入到第一帧内预测模式列表中。值得说明的是,在第一帧内预测模式列表中不包含直流(DC)模式,如果加入的模式为DC模式时,则放弃添加或将DC模式换成其它帧内预测模式进行添加即可,这是因为在本公开的实施例中,在确定第二类参考像素时用到了DC模式,为了保证技术方案所能实现的技术效果,第一帧内预测模式列表中不包含DC模式。
作为示例,在向第一帧内预测模式列表中添加帧内预测模式时,需要进行去重处理,以保证第一帧内预测模式列表中各帧内预测模式均不同。第一帧内预测模式可以包含所有可能的预测模式,当然也可以为第一帧内预测模式列表设定长度,当第一帧内预测模式列表达到预设长度时,不再添加新的预测模式。
与确定目标帧内预测模式相似的,在确定目标权重列表时也可以根据索引值进行匹配确定。在本公开的实施例中,目标权重列表是与当前待解码块对应的参考像素的权重所构成的权重列表,根据该目标权重列表可以对第一类参考像素和第二类参考像素进行加权处理,获取加权参考像素。图5示出了确定目标权重列表的流程示意图,如图5所示,在步骤S501中,根据第二索引值、当前待解码块的宽度和高度以及目标帧内预测模式确定一标识;在步骤S502中,将标识与权重列表集中的序列号进行匹配,得到目标序列号,并将与目标序列号对应的权重列表作为目标权重列表。在本公开的实施例中,权重列表集中包括多个权重列表以及与各权重列表对应的序列号,并且该序列号是根据索引值、帧内预测模式及待解码块的宽度和高度生成的,其中索引值的类型与第二索引值的类型相同,因此在确定与当前待解码块对应的目标权重列表时,从码流中可得到与其对应的第一索引值和第二索引值,根据第一索引值可以确定与其对应的帧内预测模式,进而可以根据第二索引值、帧内预测模式和当前待解码块的宽度和高度生成一标识,并根据该标识在权重列表集中匹配得到与该标识对应的目标权重列表。除了上述确定目标权重列表的方法之外,还可以根据其它的方法确定目标权重列表,本公开实施例在此不再赘述。
在本公开的实施例中,当根据帧内预测模式及当前待解码块的宽度和高度在权重列表集中只有一个权重列表与之对应时,也可以不用解码码流获取第二索引值,并根据第二索引值确定目标权重 列表,直接从权重列表集中获取与当前待解码块对应的目标权重列表即可。
在本公开的实施例中,可以根据有效参考像素导出权重列表,具体地可以根据与待解码块对应的帧内预测模式以及待解码块的宽度和高度确定与待解码块对应的权重列表。图6示出了确定权重列表的流程示意图,如图6所示,具体为:
在步骤S601中,根据待解码块的宽度和高度确定与待解码块对应的参考像素的长度。
在本公开的实施例中,参考权重列表的长度与参考像素的长度相等,参考像素的长度与待解码块的宽度和高度相关,若待解码块的宽度为M,高度为N,其中M、N均为正整数,那么参考像素的长度为2(M+N)+1。值得注意的是,对于参考像素不可用的情况,可以使用可用的参考像素或预设值进行填充,使参考像素的长度保持2(M+N)+1,例如对于一幅图像最边缘处的像素不存在参考像素,或者对应一个待解码块的参考像素中存在未解码的参考像素时,那么参考像素都是不可用的,这时就可以根据预设值进行填充或采用已有的参考像素,如临近的存在像素值的参考像素,进行填充形成参考权重。图7示出了根据待解码块的宽度和高度确定的参考像素的长度,如图7所示,待解码块的参考像素为与待解码块相邻的上方参考像素和左侧参考像素组成,待解码块的宽度M为8个像素,高度N也为8个像素,那么最终确定的参考像素的长度为33个像素。
在步骤S602中,根据与待解码块对应的帧内预测模式在参考像素的长度方向上确定有效参考像素和有效参考像素长度。
在本公开的实施例中,在确定参考像素及参考像素的长度后,可以根据与待解码块对应的帧内预测模式确定有效参考像素以及有效参考像素的长度。由于帧内预测模式包括角度模式和非角度模式,因此确定有效参考像素和有效参考像素的长度的方法也有所区别。
当帧内预测模式为角度模式时,可得到预测角度,并将待解码块沿着预测角度在参考像素的方向上进行投影,若投影点位于参考像素方向的延长线上,则在参考像素的方向上进行补全即可确定有效参考像素。
图8A-8B示出了预测角度在对角模式顺时针方向时如何确定有效参考像素和有效参考像素的长度,如图8A所示,角度模式为编号9的预测模式,根据该角度模式和待编码块的大小可以确定投影点位于参考像素行上的A点,因此与待编码块对应的有效参考像素为参考像素行上O点-A点之间的所有参考像素;如图8B所示,角度模式为编号15的预测模式,根据该角度模式和待解码块的大小可以确定投影点位于参考像素行延长线上的B点,那么可以对O点-B点之间进行像素补全,进而可以得到与待解码块对应的有效参考像素为参考像素行上B点-C点之间的所有参考像素。对于图8A和8B中的预测角度,有效参考像素均为参考像素行中的像素,因此在计算有效参考像素的长度的时候只需考虑水平方向的投影长度,其计算公式如式(1)所示:
Valid-len=M+N×tan(α)     (1);
其中,Valid-len为有效参考像素的长度,M为待解码块的宽度,N为待解码块的高度,α为预测模式与竖直方向的夹角。
图8C-8D示出了预测角度在对角模式逆时针方向时如何确定有效参考像素和有效参考像素的长度,如图8C所示,角度模式为编号28的预测模式,根据该角度模式和待编码块的大小可以确定投影点位于参考像素列上的D点,因此与待编码块对应的有效参考像素为参考像素行上O点-D点之间的所有参考像素;如图8D所示,角度模式为编号20的预测模式,根据该角度模式和待解码块的大小可以确定投影点位于参考像素列的延长线上的E点,那么可以对O点-E点之间进行像素补全,进而可以得到与待解码块对应的有效参考像素为参考像素行上E点-F点之间的所有参考像素。对于图8C和8D中的预测角度,有效参考像素均为参考像素列中的像素,因此在计算有效参考像素的长度的时候只需考虑竖直方向的投影长度,其计算公式如式(2)所示:
Valid-len=N+M×tan(θ)       (2);
其中,Valid-len为有效参考像素的长度,M为待解码块的宽度,N为待解码块的高度,θ为预测模式与水平方向的夹角。
当帧内预测模式为非角度模式时,有效参考像素即为参考像素,有效参考像素的长度与参考像素的长度。
在步骤S603中,基于有效参考像素长度在有效参考像素中设置一个或多个预设点,根据索引值和预设点在有效参考像素中确定第一位置,同时根据预设参考像素的位置确定第二位置。
在本公开的实施例中,在有效参考像素中可以设置一个或多个预设点,预设点位置的不同会导致最终的权重列表不同。根据索引值和预设点可以在有效参考像素中确定第一位置,同时根据预设参考像素的位置可以确定第二位置,进而根据第一位置和第二位置的关系可以为参考像素设置不同的权重,得到与待解码块对应的权重列表。其中,预设参考像素可以是参考像素根据预测角度进行 投影所得的参考像素,也可以是参考像素中任意位置的参考像素。
根据索引值和预设点在有效参考像素中确定第一位置时,可以将多个预设点按照预设顺序排序形成预设点序列,每个预设点对应一序号,该序号与索引值对应,那么可以根据索引值在预设点序列中唯一确定一预设点,第一位置即为该预设点所在的位置。如图9所示,在图9中的参考像素中存在三个预设点p0、p1和p2,将该三个预设点由左向右依次编号形成预设点序列[0,p0]、[1,p1]、[2,p2],当索引值为0时,第一位置即为p0所在的位置,当索引值为2时,第一位置即为p2所在的位置。
但是对于不同类型的帧内预测模式,确定第二位置的方式有所不同。当帧内预测模式为角度模式时,可以根据预测角度,确定第i个参考像素ref_i在有效参考像素所在方向上对应的位置ref_valid_i,ref_valid_i即为第二位置;继续以图9为例,参考像素包括参考像素行和参考像素列,由于有效参考像素与参考像素行在同一行上,因此参考像素行上的参考像素根据预测角度进行投影落在有效参考像素所在方向上的位置还是该参考像素所在的位置,而参考像素列与有效参考像素所在的方向垂直,参考像素列上的像素可以根据预测角度进行投影,并落在有效参考像素所在的方向上,例如图9中的参考像素P根据预测角度投影后落在有效参考像素所在方向上的像素B上,因此有效参考像素B所在的位置即为第二位置。当帧内预测模式为非角度模式时,第i个参考像素ref_i所在的位置即为第二位置。
在步骤S604中,根据第一位置和第二位置的关系设置参考像素的权重,得到与待解码块对应的权重列表。
在本公开的实施例中,在确定第一位置和第二位置后,可以根据第一位置和第二位置的先后关系确定参考像素的权重,具体地,当第一位置的坐标小于第二位置的坐标时,将预设参考像素和位置坐标小于第一位置的坐标的参考像素的权重设置为第一权重,将剩余的参考像素的权重设置为第二权重;当第一位置的坐标大于或等于第二位置的坐标时,将预设参考像素和位置坐标小于第一位置的坐标的参考像素的权重设置为第二权重,将剩余的参考像素的权重设置为第一权重,其中第一权重不同于第二权重,例如,如果第二位置在第一位置之前,那么可以将参考像素ref_i对应的权重设为0,否则设为8,这种方式相当于把当前块分为两个子块,例如,子块1和子块2,分别由不同类型的参考像素导出预测值。值得说明的是,权重的具体设置可以根据实际需要进行设置,不仅限于0和8,其可以是权重取值范围中的任意值,例如权重取值范围可以是[0,8],那么权重可以取该范围中的任意一个数值。图10示出了参考像素权重的示意图,如图10所示,该参考像素权重与图9所示的参考像素对应,其中参考权重行的权重均为8,参考权重列的权重均为0。
值得注意的是,由于权重的设置需要根据第一位置和第二位置的前后顺序确定,因此第一位置与有效参考像素的两端像素不能重合。另外,作为确定参考像素的权重的一个实施例,还可以在第一位置处添加过渡权重,该过渡权重的设置可以有多种方式,例如位于第一位置之前的参考像素的过渡权重为权重取值范围中的任一权重,位于第一位置之后的参考像素的过渡权重随参考像素的位置与第一位置的距离的变化而变化,其中第一位置之后的参考像素的过渡权重大于第一位置之前的参考像素的权重且小于或等于权重取值范围中的最大权重;或者,位于第一位置之前的参考像素的过渡权重随参考像素的位置与第一位置的绝对距离的变化而变化,位于第一位置之后的参考像素的过渡权重为权重取值范围中的任一权重,其中第一位置之前的参考像素的过渡权重大于第一位置之后的参考像素的权重且小于或等于权重取值范围中的最大权重。举例而言,继续以图9所示的参考权重和预测角度为例,权重取值范围为[0,8],第一位置为p1所在的位置,那么可以将参考像素行上位于p1之前的参考像素以及参考像素列上投影像素的位置在p1之前的参考像素的权重设置为0-7中的任意一个值,该权重记为w1,参考像素行上位于p1之后(包含p1)的参考像素的权重随参考像素位置距离p1的距离增大而递增或递减,该权重记为w2,比如w1=2,那么w2从左至右依次可以为3、4、5、6、7、8、8、8、8、8、8、8或者8、8、8、8、8、8、8、7、6、5、4、3,相应地,还可以将参考像素行上位于p1之前的参考像素以及参考像素列上投影像素的位置在p1之前的参考像素的权重设置为随参考像素位置距离p1的绝对距离增大而递增或递减,该权重记为w1,参考像素行上位于p1之后(包含p1)的参考像素的权重为0-7中的任意一个值,该权重记为w2,比如w2=0,那么w1从左至右依次可以为:1、2、3、4、5、6、7、8、8、8、8、8、8、8、8、8、8、8、8,其中前16位对应参考像素列上沿预测角度投影在有效参考像素方向上的参考像素,后三位对应参考像素行上位于p1之前的三个参考像素。除此之外,参考像素的权重还可以根据其它标准设置,例如距离每增加2,权重增加1,比如第一位置之前的参考像素的权重均为0,第一位置之后的参考像素的权重为1122334455667788,又或者权重的增加不是递增的,而是随距离的增大成无规律的增大,比如第一位置之前的参考像素的权重均为2,第一位置之后的参考像素的权重为 456666777888,再有可能第一位置前后的参考像素的权重都随距离第一位置的距离变化而变化,但是两侧的权重的取值范围不同,比如第一位置之前的参考像素的权重在[0,4]取值,第一位置之后的参考像素的权重在[5,8]取值,等等,本公开实施例中参考像素的权重的设置包含了所有可能的权重设置变形,在此不再赘述。
在步骤S330中,根据与当前待解码块对应的参考像素确定第一类参考像素和第二类参考像素,并基于目标权重列表对第一类参考像素和第二类参考像素进行加权处理,得到加权参考像素。
在一些实施例中,在步骤S320中,通过为参考像素设置不同的权重实现了将待解码块分为不同的子块,且每个子块对应不同的参考像素的权重,为了获取更准确的待解码块的预测值,可以基于参考像素对应的权重列表对不同类型的参考像素进行加权处理,再通过加权处理后的参考像素对待解码块进行预测。其中不同类型的参考像素是基于与待解码块对应的参考像素确定的,在本公开实施例中,不同类型的参考像素包括第一类参考像素和第二类参考像素,在获取第一类参考像素和第二类参考像素时,首先可以根据参考像素构建相同大小的辅助参考像素,然后对参考像素的像素值进行目标处理,得到辅助参考像素中各像素的像素值;最后根据预设规则对参考像素和辅助参考像素进行分类,得到第一类参考像素和第二类参考像素。具体地,可以将与待解码块对应的参考像素记为R_org,将对R_org进行目标处理所导出的辅助参考像素记为R_tmp,对R_org进行处理导出R_tmp的方法有多种,例如:(i)使用DC模式对R_org中的所有像素值求平均值,并将该平均值作为R_tmp中每个像素的像素值;(ii)获取R_org中参考像素权重大于等于(或小于等于)预设阈值位置处的像素,并使用DC模式对该些像素求平均值,进而将该平均值作为R_tmp中每个像素的像素值;(iii)使用滤波器对R_org进行滤波得到R_tmp,去除R_org中的异常值,使R_tmp中的值更平滑;(iv)R-tmp中的像素由距离当前待解码块更远的重构像素导出,例如根据预测角度由距离当前待解码块3行的重构像素导出R_tmp。当然还可以根据其它方法导出R_tmp,另外还可以将与当前待解码块对应的有效参考像素作为R_org,并根据该R_org确定R_tmp,等等,本公开实施例在此不再赘述。
在确定R_org和R_tmp后,可以根据预设规则对二者进行分类,得到第一类参考像素和第二类参考像素。具体地,该预设规则可以是直接将参考像素R_org作为第一类参考像素,将辅助参考像素R-tmp作为第二类参考像素;还可以是根据第三标志确定第一类参考像素和第二类参考像素。图11示出了根据第三标志确定第一类参考像素和第二类参考像素的流程示意图,如图11所示,在步骤S1101中,解码码流,得到第三标志;在步骤S1102中,在第三标志的值满足第二预设条件时,将参考像素作为第一类参考像素,将辅助参考像素作为第二类参考像素;在步骤S1103中,在第三标志的值不满足第二预设条件时,将辅助参考像素作为第一类参考像素,将参考像素作为第二类参考像素。其中,第二预设条件具体可以是第三标志的值为1,也就是说,当第三标志值为1时,R_org为第一类参考像素,R_tmp为第二类参考像素;当第三标志值不为1时,R_tmp为第一类参考像素,R-org为第二类参考像素。
在确定第一类参考像素和第二类参考像素后,可以根据参考像素对应的权重列表对第一类参考像素和第二类参考像素进行加权处理,得到加权参考像素。计算加权参考像素的公式如公式(3)所示:
R[x][y]=(R 0[x][y]×R W[x][y]+R 1[x][y]×(max_w-R W[x][y]))/max_w  (3);
其中,R[x][y]为位于坐标(x,y)处的加权参考像素,R 0[x][y]为位于坐标(x,y)处的第一类参考像素,R W[x][y]为目标权重列表中与位于坐标(x,y)处的参考像素对应的权重,R 1[x][y]为位于坐标(x,y)处的第二类参考像素,max_w为权重取值范围中的最大值。
根据上述计算公式即可得到加权参考像素,进而可以采用加权参考像素对当前待解码块进行预测。
在本公开的实施例中,亮度和色度是视频图像的重要参数,相应地,在对视频进行编码压缩的时候,视频图像的亮度和色度会被改变,进而在解码阶段,为了恢复视频图像,对待解码块的亮度和色度均进行预测进而得到重构图像是很必要的。在上述实施例中,待解码块对应的参考像素可以包括亮度参考像素和色度参考像素,根据上述实施例可以确定与当前待解码块对应的亮度参考像素权重列表和色度参考像素权重列表,进而根据亮度参考像素权重列表和色度参考像素权重列表以及当前待解码块对应的亮度参考像素和色度参考像素即可确定亮度加权参考像素和色度加权参考像素。在对当前待解码块进行预测时,分别根据亮度加权参考像素和色度加权参考像素进行预测,并根据亮度预测值和色度预测值对当前待解码块进行重构。另外,上述实施例中的参考像素可以是亮度参考像素,当获取亮度参考像素的权重列表后,可以根据亮度参考像素的权重计算色度参考像素的权重,得到色度参考像素的权重列表。根据亮度参考像素的权重计算色度参考像素的权重的计算 公式如公式(4)所示:
R W_Chorma[x][y]=R W_Luma[x<<scale_x][y<<scale_y]     (4);
其中,R W_Chorma[x][y]为位于坐标(x,y)处的色度参考像素的权重,R W_Luma为亮度参考像素对应的权重列表,scale_x为视频图像亮度分量和色度分量在x方向的尺寸放缩系数,scale_y为视频图像亮度分量和色度分量在y方向的尺寸放缩系数,<<为左移运算符号,x<<1的值等于x*2的值。
例如,输入图像为YcbCr420格式,1个亮度参考像素对应4个色度参考像素,scale_x和scale_y设为1,记亮度参考像素的权重矩阵为R W_Luma,色度参考像素的权重为R W_Chorma,位于坐标(x,y)处的色度权重R W_Chorma[x][y]=R W_Luma[x<<1][y<<1]。
在确定色度参考像素的权重列表后,可以根据与待解码块对应的色度参考像素确定第一类色度参考像素和第二类色度参考像素,并基于色度参考像素的权重列表对第一类色度参考像素和第二类色度参考像素进行加权处理,得到色度加权参考像素,其中加权处理所对应的计算公式与公式(2)相同,在此不再赘述。
在步骤S340中,根据加权参考像素和目标帧内预测模式对当前待解码块进行预测,得到与当前待解码块对应的预测块。
在一些实施例中,在确定与当前待解码块对应的加权参考像素后,可以根据该加权参考像素和目标帧内预测模式对当前待解码块进行预测,得到与当前待解码块对应的预测块,进而根据与视频图像对应的多个待解码块对应的预测块得到重构图像。
在一些实施例中,在完成对当前待解码块的预测后,可以将与该当前待解码块对应的帧内预测模式进行存储,用于预测后续待解码块的帧内预测模式。在存储当前待解码块的帧内预测模式时,可以通过多种方式实现,例如,可以将当前待解码块对应的帧内加权预测模式作为最终帧内预测模式进行存储,或者可以根据当前待解码块中最小划分单元对应的帧内预测模式进行分别存储。接下来,对如何存储与当前待解码块中最小划分单元对应的帧内预测模式进行详细说明。
根据上述实施例分析可知,第一类参考像素和第二类参考像素是根据不同的方式确定的,同时在对待解码块进行预测时是根据加权参考像素和目标帧内预测模式进行预测的,而加权参考像素是根据第一类参考像素、第二类参考像素和参考像素权重确定的,因此在进行预测时,待解码块中部分像素是根据与第一类参考像素对应的帧内预测模式进行预测导出预测值的,部分像素是根据与第二类参考像素对应的帧内预测模式进行预测导出预测值的,也就是说,帧内加权预测模式包含两种预测模式,因此需要确定哪种帧内预测模式用作预测。通过对解码块中最小划分单元对应的帧内预测模式进行存储可以提高预测模式的精准度,进而提高预测准确度。
图12示出了根据最小划分单元存储帧内预测模式的流程示意图,如图12所示,在步骤S1201中,根据预设值将当前待解码块分解为多个子解码块;在步骤S1202中,根据各子解码块中的预设像素、目标帧内预测模式和目标权重列表确定存储方式索引值;在步骤S1203中,根据存储方式索引值确定该子解码块对应的帧内预测模式,并将该子解码块和与该子解码块对应的帧内预测模式进行对应存储。
其中,在步骤S1201中,预设值可以是最小划分单元对应的大小,例如4×4,等等;在步骤S1202中,子解码块中的预设像素具体可以是位于最小划分单元左上角的像素、位于最小划分单元其它角点的像素、或者位于最小划分单元中心点的像素,当然还可以是最小划分单元中其它位置的像素,目标帧内预测模式包括角度模式和非角度模式,目标帧内预测模式不同,确定存储方式索引值的方法也不同。
当目标帧内预测模式为角度模式时,首先将预设像素根据角度预测模式中的预测角度在有效参考像素的方向进行投影,得到目标参考像素;接着获取目标权重列表中与目标参考像素对应的权重,当目标参考像素对应的权重大于或等于第一预设阈值时,将存储方式索引值标记为第一数值;当目标参考像素对应的权重小于第一预设阈值时,将存储方式索引值标记为不同于第一数值的第二数值。
当目标帧内预测模式为非角度模式时,根据目标权重列表和第二预设阈值对与子解码块对应的参考像素进行分类,得到与子解码块对应的参考像素中权重小于第二预设阈值的第一数量和权重大于或等于第二预设阈值的第二数量;当第一数量小于或等于第二数量时,将存储方式索引值标记为第一数值;当第一数量大于第二数量时,将存储方式索引值标记为第二数值。
其中,第一预设阈值和第二预设阈值可以根据实际需要设定,作为示例,第一预设阈值和第二预设阈值可以相同,也可以不同。另外,第一数值可以为0,第二数值可以为1,当然还可以设置为其它的数值,本公开实施例对此不作具体限定。
作为示例,第一数值和第二数值对应不同的帧内预测模式,当确定存储方式索引值为第一数值时,将第一类参考像素对应的帧内预测模式作为该最小划分单元对应的预测模式进行存储,当确定存储方式索引值为第二数值时,将第二类参考像素对应的帧内预测模式作为该最小划分单元对应的预测模式进行存储。例如第一类参考像素对应的帧内预测模式为角度模式,第二类参考像素对应的帧内预测模式为DC模式时,当存储方式索引值为0时,确定最小划分单元对应的帧内预测模式为角度模式,当存储方式索引值为1时,确定最小划分单元对应的帧内预测模式为DC模式。
上述实施例从解码端描述了解码器如何对待解码块进行预测获取对应的预测块,进而获取重构图像,解码端所进行的操作都可以看作是编码端操作的反操作,如图13所示,编码器对原始视频信号进行编码压缩时主要流程为预测—变换—量化—熵编码,以形成码流,相应地,解码端在对码流进行解码时的主要流程则为熵编码—反量化—反变换—预测,因此就本公开实施例中所采用的基于帧内加权预测模式进行预测的方法同样适用于编码端。
图14示意性示出了根据本公开的一个实施例的视频编码方法的流程图,该视频编码方法可以由编码器来执行,该编码器可以是图1中所示的编码器102。参照图14所示,该视频编码方法至少包括步骤S1410至步骤S1440,详细介绍如下:
在步骤S1410中,从帧内预测模式列表中确定与当前待编码块对应的目标帧内预测模式,并从权重列表集中确定与当前待编码块对应的目标权重列表。
在本公开的实施例中,在获取原始视频信号后,可以对每个视频图像进行块划分,将视频图像划分为多个不重叠的处理单元(待编码块),然后通过编码器对每个处理单元进行编码操作。编码器在对处理单元进行编码操作时,首先是对处理单元进行预测编码,该预测编码方式可以根据不同的需要选择帧内预测模式或帧间预测模式,在本公开的实施例中,预测编码方式为帧内预测模式。
在本公开的实施例中,针对不同的处理单元,可以从多个帧内预测模式中选择最优的帧内预测模式对各个处理单元进行预测,其中多个帧内预测模式可以是与当前待编码块是相邻或不相邻的已编码块对应的帧内预测模式、预设的角度模式、双线性模式和平面模式中的一种或多种。在确定与各处理单元对应的最优帧内预测模式时可以通过尝试多种帧内预测模式,并根据每种帧内预测模式处理后的率失真进行确定。
在本公开的实施例中,还可以从权重列表集中确定与当前待编码块对应的目标权重列表,该目标权重列表用于后续对与当前待编码块对应的不同类型的参考像素进行加权处理。在本公开的实施例中,权重列表集中包括多个权重列表和与各权重列表对应的序列号,其中与各权重列表对应的序列号是根据索引值、帧内预测模式及待编码块的宽度和高度生成的,当获取当前待编码块的宽度和高度和帧内预测模式后,可以根据预设索引值和当前待编码块的宽度和高度以及帧内预测模式确定一标识,然后通过将标识与权重列表集中的序号进行匹配即可确定与当前待编码块对应的目标权重列表。
权重列表集中各权重列表可以根据与待编码块对应的有效参考像素导出,具体地,首先可以根据待编码块的宽度和高度确定与待编码块对应的参考像素的长度,然后根据与待编码块对应的帧内预测模式在参考像素的长度方向上确定有效参考像素和有效参考像素长度,接着基于有效参考像素长度在有效参考像素中设置一个或多个预设点,根据预设索引值和预设点在有效参考像素中确定第一位置,同时根据预设参考像素的位置确定第二位置,最后根据第一位置和第二位置的关系设置参考像素的权重,得到与待编码块对应的权重列表。其中各步骤的实现方式与解码器端的权重列表的导出方式相同,在此不再赘述。值得说明的是,还可以根据其它的方式生成权重列表集,例如,当待编码块的宽度和高度很小,只存在一个预设点时,那么可以只根据待编码块的宽度和高度以及对应的帧内预测模式确定与该待编码块的参考像素权重列表对应的序号。当然还可以有其它的方式,本公开实施例在此不再赘述。
在步骤S1420中,根据与当前待编码块对应的参考像素确定第一类参考像素和第二类参考像素,并基于目标权重列表对第一类参考像素和第二类参考像素进行加权处理,得到加权参考像素。
在本公开的实施例中,通过为参考像素设置不同的权重实现了将待编码块分为不同的子块,且每个子块对应不同的参考像素的权重,为了获取更准确的待编码块的预测值,可以基于参考像素对应的权重列表对不同类型的参考像素进行加权处理,再通过加权处理后的参考像素对待编码块进行预测。在本公开的实施例中,可以根据与当前待编码块对应的参考像素确定第一类参考像素和第二类参考像素,与解码器端确定第一类参考像素和第二类参考像素的方法类似,首先可以根据与当前待编码块对应的参考像素构建相同大小的辅助参考像素,然后对参考像素的像素值进行目标处理,得到辅助参考像素中各像素的像素值;最后根据预设规则对参考像素和辅助参考像素进行分类,得到第一类参考像素和第二类参考像素。具体地,可以将与当前待编码块对应的参考像素记为 R_org,将对R_org进行目标处理所导出的辅助参考像素记为R_tmp,目标处理具体可以是:使用DC模式对R_org中的所有像素值求平均值,并将该平均值作为R_tmp中每个像素的像素值;或者,获取R_org中参考像素权重大于等于(或小于等于)预设阈值位置处的像素,并使用DC模式对该些像素求平均值,进而将该平均值作为R_tmp中每个像素的像素值;或者,使用滤波器对R_org进行滤波得到R_tmp,去除R_org中的异常值,使R_tmp中的值更平滑;或者,R-tmp中的像素由距离当前待编码块更远的重构像素导出,例如根据预测角度由距离当前待解码块3行的重构像素导出R_tmp。当然还可以根据其它方法导出R_tmp,另外还可以将与当前待编码块对应的有效参考像素作为R_org,并根据该R_org确定R_tmp,等等,本公开实施例在此不再赘述。
在本公开的实施例中,确定与当前待编码块对应的参考像素和辅助参考像素后,可以根据预设规则确定第一类参考像素和第二类参考像素,例如将与当前待编码块对应的参考像素作为第一类参考像素,将与当前待编码块对应的辅助参考像素作为第二类参考像素,当然还可以将与当前待编码块对应的参考像素作为第二类参考像素,将与当前待编码块对应的辅助参考像素作为第一类参考像素。
接着,可以根据与当前待编码块对应的目标权重列表对第一类参考像素和第二类参考像素进行加权处理,得到加权参考像素,计算公式如式(3)所示:
R[x][y]=(R 0[x][y]×R W[x][y]+R 1[x][y]×(max_w-R W[x][y]))/max_w  (3);
其中,R[x][y]为位于坐标(x,y)处的加权参考像素,R 0[x][y]为位于坐标(x,y)处的第一类参考像素,R W[x][y]为目标权重列表中与位于坐标(x,y)处的参考像素对应的权重,R 1[x][y]为位于坐标(x,y)处的第二类参考像素,max_w为权重取值范围中的最大值。
在本公开的实施例中,亮度和色度是视频图像不同信道的特征,在编码时,也会分别对视频图像的亮度信息和色度信息分别进行编码,因此上述实施例中的与当前待编码块对应的参考像素包括亮度参考像素和色度参考像素,并且也可以根据上述实施例的方法分别获取与当前待编码块对应的亮度参考像素权重列表和色度参考像素权重列表,进而根据亮度参考像素权重列表和色度参考像素权重列表以及当前待编码块对应的亮度参考像素和色度参考像素即可确定亮度加权参考像素和色度加权参考像素。在对当前待编码块进行预测时,分别根据亮度加权参考像素和色度加权参考像素进行预测,并根据亮度预测值和色度预测值对当前待编码块进行编码。另外,上述实施例中的与当前待编码块对应的参考像素可以是亮度参考像素,当获取亮度参考像素的权重列表后,可以根据亮度参考像素的权重计算色度参考像素的权重,得到色度参考像素的权重列表。根据亮度参考像素的权重计算色度参考像素的权重的计算公式如公式(4)所示
R W_Chorma[x][y]=R W_Luma[x<<scale_x][y<<scale_y]    (4);
其中,R W_Chorma[x][y]为位于坐标(x,y)处的色度参考像素的权重,R W_Luma为亮度参考像素对应的权重列表,scale_x为视频图像亮度分量和色度分量在x方向的尺寸放缩系数,scale_y为视频图像亮度分量和色度分量在y方向的尺寸放缩系数,<<为左移运算符号,x<<1的值等于x*2的值。
在确定色度参考像素的权重列表后,可以根据与待编码块对应的色度参考像素确定第一类色度参考像素和第二类色度参考像素,并基于色度参考像素的权重列表对第一类色度参考像素和第二类色度参考像素进行加权处理,得到色度加权参考像素,其中加权处理所对应的计算公式与公式(3)相同,在此不再赘述。
在步骤S1430中,根据加权参考像素和目标帧内预测模式对当前待编码块进行预测,得到与当前待编码块对应的预测块。
在本公开的实施例中,在确定与当前待编码块对应的加权参考像素后,可以根据该加权参考像素和与当前待编码块对应的目标帧内预测模式对当前待解码块进行预测,得到与当前待解码块对应的预测块。
在一些实施例中,在完成对当前待编码块的预测后,可以将与该当前待编码块对应的帧内预测模式进行存储,用于预测后续待编码块的帧内预测模式。在存储当前待编码块的帧内预测模式时,可以通过多种方式实现,例如,可以将当前待编码块对应的帧内加权预测模式作为最终帧内预测模式进行存储,或者可以根据当前待编码块中最小划分单元对应的帧内预测模式进行分别存储。存储当前待编码块的帧内预测模式的方法与上述实施例中存储当前待解码块的帧内预测模式的方法相似,区别仅在于对象不同,应用的场景也不同,一个是针对待编码块,用于编码过程,另一个是针对待解码块,用于解码过程。
在步骤S1440中,根据预测块形成码流,并在码流中添加第一标志、第一索引值和第二索引值。
作为示例,第一标志用于标识是否对待解码块使用帧内加权预测模式;第一索引值用于从第一帧内预测模式列表中确定与待解码块对应的目标帧内预测模式;第二索引值用于在权重列表集中确定与待解码块对应的目标权重列表。
在本公开的实施例中,根据图13所示的流程图可知,编码器对原始视频信号进行编码压缩后,形成码流,进而通过解码端对码流进行解码以形成重构图像,因此作为编码器端,在完成对所有处理单元的预测后,还需要对与待编码块对应的预测块进行变换编码及量化以及熵编码形成码流,在该码流中还需要添加一些标识信息,以使解码器端根据该些标识信息获取编码器端所采用的具体处理方式,并将该具体处理方式应用到解码过程中。
作为示例,标识信息可以包括第一标志、第一索引值和第二索引值,该第一标志用于标识是否对当前待编码块使用帧内加权预测模式,该第一索引值用于从第一帧内预测模式列表中确定与待解码块对应的目标帧内预测模式,该第二索引值用于在权重列表集中确定与待解码块对应的目标权重列表。
作为示例,标识信息还可以包括第二标志、第三标志、第三索引值,该第二标志用于标识目标帧内预测模式是否在第一帧内预测模式列表内,该第三标志用于标识如何确定第一类参考像素和第二类参考像素,该第三索引值用于标识目标帧内预测模式是否在第一帧内预测模式列表中。
本公开实施例中的视频编解码方法,在解码器端,首先解码码流以得到第一标志,并根据第一标志判断是否采用帧内加权预测模式,在确定采用帧内加权预测模式后,根据解码码流所得到的第一索引值在第一帧内预测模式列表中确定目标帧内预测模式,以及根据第二索引值在权重列表集中确定目标权重列表;然后根据待解码块对应的参考像素确定第一类参考像素和第二类参考像素,并基于目标权重列表对第一类参考像素和第二类参考像素进行加权处理,得到加权参考像素;最后根据加权参考像素和目标帧内预测模式对待解码块进行预测,即可获取与待解码块对应的预测块。在编码器端,采用与解码器端相似的预测方法对待编码块进行预测编码,进而生成码流,并将码流发送至解码器进行解码。本公开的技术方案一方面能够将两种类型的帧内预测参考像素进行加权组合,并基于加权组合后的参考像素导出预测值,提高了预测值的准确性;另一方面对于一个编码块/解码块中存在多种纹理时,可以给出准确的预测值;再一方面本公开中的预测方法可以应用于视频编解码中,进而提升编解码效率。
以下介绍本公开的装置实施例,可以用于执行本公开上述实施例中的视频解码方法。对于本公开装置实施例中未披露的细节,请参照本公开上述的视频解码方法的实施例。
图15示意性示出了根据本公开的一个实施例的视频解码装置的框图。
参照图15所示,根据本公开的一个实施例的视频解码装置1500,包括:码流解码模块1501、索引匹配模块1502、像素加权模块1503和像素预测模块1504。
其中,码流解码模块1501,配置为解码码流,得到第一标志、第一索引值和第二索引值,其中第一标志配置为标识是否对当前待解码块使用帧内加权预测模式;索引匹配模块1502,配置为在第一标志的值满足第一预设条件时,根据第一索引值在第一帧内预测模式列表中确定目标帧内预测模式,并根据第二索引值在权重列表集中确定目标权重列表;像素加权模块1503,配置为根据与当前待解码块对应的参考像素确定第一类参考像素和第二类参考像素,并基于目标权重列表对第一类参考像素和第二类参考像素进行加权处理,得到加权参考像素;像素预测模块1504,配置为根据加权参考像素和目标帧内预测模式对当前待解码块进行预测,得到与当前待解码块对应的预测块。
在一些实施例中,第一帧内预测模式列表包括多种帧内预测模式和与各帧内预测模式对应的序列号;索引匹配模块1502配置为:将第一索引值与第一帧内预测模式列表中的序列号进行匹配,得到与第一索引值匹配的目标序列号;将与目标序列号对应的帧内预测模式作为目标帧内预测模式。
在一些实施例中,视频解码装置1500还配置为:获取第二标志;当根据第二标志确定目标帧内预测模式在第一帧内预测模式列表中时,根据第一索引值在第一帧内预测模式列表中确定目标帧内预测模式;当根据第二标志确定目标帧内预测模式不在第一帧内预测模式列表中时,解码码流获取第三索引值,并根据第三索引值在第二帧内预测模式列表中确定目标帧内预测模式;其中第一帧内预测模式列表与第二帧内预测模式列表所包含的帧内预测模式不同。
在一些实施例中,第一帧内预测模式列表包括与当前待解码块是相邻或不相邻的已解码块对应的帧内预测模式、预设的角度模式、双线性模式和平面模式中的一个或多个,并且第一帧内预测模式列表所包含的帧内预测模式各不相同。
在一些实施例中,权重列表集中包括多个权重列表和与各权重列表对应的序列号,其中与各权重列表对应的序列号是根据索引值、帧内预测模式及待解码块的宽度和高度生成的,索引值的类型 与第二索引值的类型相同;索引匹配模块1502还配置为:根据第二索引值、当前待解码块的宽度和高度以及目标帧内预测模式确定一标识;将标识与权重列表集中的序列号进行匹配,得到目标序列号,并将与目标序列号对应的权重列表作为目标权重列表。
在一些实施例中,视频解码装置1500还包括:权重列表构建模块,配置为根据与待解码块对应的帧内预测模式以及待解码块的宽度和高度确定与待解码块对应的权重列表。
在一些实施例中,权重列表构建模块包括:第一长度确定单元,配置为根据待解码块的宽度和高度确定与待解码块对应的参考像素的长度;第二长度确定单元,配置为根据与待解码块对应的帧内预测模式在参考像素的长度方向上确定有效参考像素和有效参考像素长度;位置确定单元,配置为基于有效参考像素长度在有效参考像素中设置一个或多个预设点,根据索引值和预设点在有效参考像素中确定第一位置,同时根据预设参考像素的位置确定第二位置;权重设置单元,配置为根据第一位置和第二位置的关系设置参考像素的权重,得到与待解码块对应的权重列表。
在一些实施例中,第二长度确定单元配置为:当帧内预测模式为角度模式时,获取预测角度,根据待解码块的宽度和高度以及预测角度确定有效参考像素和有效参考像素长度;当帧内预测模式为非角度模式时,将有效参考像素确定为参考像素,将有效参考像素长度确定为参考像素的长度。
在一些实施例中,权重设置单元配置为:当第一位置的坐标小于第二位置的坐标时,将预设参考像素和位置坐标小于第一位置的坐标的参考像素的权重设置为第一权重,将剩余的参考像素的权重设置为第二权重;当第一位置的坐标大于或等于第二位置的坐标时,将预设参考像素和位置坐标小于第一位置的坐标的参考像素的权重设置为第二权重,将剩余的参考像素的权重设置为第一权重。
在一些实施例中,权重设置单元配置为:在第一位置处添加过渡权重,其中位于第一位置之前的参考像素的过渡权重为权重取值范围中的任一权重,位于第一位置之后的参考像素的过渡权重随参考像素的位置与第一位置的距离的变化而变化,其中第一位置之后的参考像素的过渡权重大于第一位置之前的参考像素的权重且小于或等于权重取值范围中的最大权重;或者,在第一位置处添加过渡权重,其中位于第一位置之前的参考像素的过渡权重随参考像素的位置与第一位置的绝对距离的变化而变化,位于第一位置之后的参考像素的过渡权重为权重取值范围中的任一权重,其中第一位置之前的参考像素的过渡权重大于第一位置之后的参考像素的权重且小于或等于权重取值范围中的最大权重。
在一些实施例中,像素加权模块1503包括:像素处理单元,配置为根据参考像素构建相同大小的辅助参考像素,并对参考像素的像素值进行目标处理,得到辅助参考像素中各像素的像素值;分类单元,配置为根据预设规则对参考像素和辅助参考像素进行分类,得到第一类参考像素和第二类参考像素。
在一些实施例中,分类单元配置为:将参考像素作为第一类参考像素,将辅助参考像素作为第二类参考像素;或者,解码码流得到第三标志;在第三标志的值满足第二预设条件时,将参考像素作为第一类参考像素,将辅助参考像素作为第二类参考像素;在第三标志的值不满足第二预设条件时,将辅助参考像素作为第一类参考像素,将参考像素作为第二类参考像素。
在一些实施例中,像素加权模块1503配置为:根据计算公式(3)确定加权参考像素:
R[x][y]=(R 0[x][y]×R W[x][y]+R 1[x][y]×(max_w-R W[x][y]))/max_w  (3);
其中,R[x][y]为位于坐标(x,y)处的加权参考像素,R 0[x][y]为位于坐标(x,y)处的第一类参考像素,R W[x][y]为目标权重列表中与位于坐标(x,y)处的参考像素对应的权重,R 1[x][y]为位于坐标(x,y)处的第二类参考像素,max_w为权重取值范围中的最大值。
在一些实施例中,参考像素包括亮度参考像素和色度参考像素,加权参考像素包括亮度加权参考像素和色度加权参考像素。
在一些实施例中,参考像素为亮度参考像素,加权参考像素为亮度加权参考像素;视频解码装置1500还配置为:根据计算公式(4)对亮度参考像素的权重进行处理,得到色度参考像素的权重列表;根据与当前待解码块对应的色度参考像素确定第一类色度参考像素和第二类色度参考像素,并基于色度参考像素的权重列表对第一类色度参考像素和第二类色度参考像素进行加权处理,得到色度加权参考像素;
其中,计算公式(4)如下所示:
R W_Chorma[x][y]=R W_Luma[x<<scale_x][y<<scale_y]    (4);
其中,R W_Chorma[x][y]为位于坐标(x,y)处的色度参考像素的权重,R W_Luma为亮度参考像素对应的权重列表,scale_x为视频图像亮度分量和色度分量在x方向的尺寸放缩系数,scale_y为视频图像亮度分量和色度分量在y方向的尺寸放缩系数,<<为左移运算符号。
在一些实施例中,像素预测模块1504配置为:根据亮度加权参考像素、色度加权参考像素和目标帧内预测模式对当前待解码块进行预测。
在一些实施例中,视频解码装置1500还配置为:在获取第一标志之前,获取当前待解码块的宽度和高度,当当前待解码块的宽度和高度满足第三预设条件时,解码码流得到第一标志;或者,在获取第一标志之前,解码码流得到图像头标志,当图像头标志满足第四预设条件时,解码码流得到第一标志;或者,在获取第一标志之前,解码码流得到序列头标志,当序列头标志满足第五预设条件时,解码码流得到第一标志或者图像头标志和第一标志。
在一些实施例中,视频解码装置1500还包括:第一存储模块,配置为将当前待解码块对应的帧内加权预测模式作为最终的帧内预测模式进行存储;或者,分解模块,配置为根据预设值将当前待解码块分解为多个子解码块;索引值确定模块,配置为根据各子解码块中的预设像素、目标帧内预测模式和目标权重列表确定存储方式索引值;第二存储模块,配置为根据存储方式索引值确定子解码块对应的帧内预测模式,并将子解码块和与子解码块对应的帧内预测模式进行对应存储。
在一些实施例中,索引值确定模块配置为:当目标帧内预测模式为角度模式时,将预设像素根据角度模式中的预测角度在有效参考像素的方向进行投影,得到目标参考像素;获取目标权重列表中与目标参考像素对应的权重;当目标参考像素对应的权重大于或等于第一预设阈值时,将存储方式索引值标记为第一数值;当目标参考像素对应的权重小于第一预设阈值时,将存储方式索引值标记为不同于第一数值的第二数值;或者,当目标帧内预测模式为非角度模式时,根据目标权重列表和第二预设阈值对与子解码块对应的参考像素进行分类,得到与子解码块对应的参考像素中权重小于第二预设阈值的第一数量和权重大于或等于第二预设阈值的第二数量;当第一数量小于或等于第二数量时,将存储方式索引值标记为第一数值;当第一数量大于第二数量时,将存储方式索引值标记为第二数值。
在一些实施例中,第二存储模块配置为:当存储方式索引值为第一数值时,子解码块对应的帧内预测模式为第一类参考像素对应的帧内预测模式;当存储方式索引值为第二数值时,子解码块对应的帧内预测模式为第二类参考像素对应的帧内预测模式。
图16示意性示出了根据本公开的一个实施例的视频编码装置的框图。
参照图16所示,根据本公开的一个实施例的视频编码装置1600,包括:确定模块1601、加权模块1602、预测模块1603和码流生成模块1604。
其中,确定模块1601,配置为确定与当前待编码块对应的目标帧内预测模式,并从权重列表集中确定与当前待编码块对应的目标权重列表;加权模块1602,配置为根据与当前待编码块对应的参考像素确定第一类参考像素和第二类参考像素,并基于目标权重列表对第一类参考像素和第二类参考像素进行加权处理,得到加权参考像素;预测模块1603,配置为根据加权参考像素和目标帧内预测模式对当前待编码块进行预测,得到与当前待编码块对应的预测块;码流生成模块1604,配置为根据预测块形成码流,并在码流中添加第一标志、第一索引值和第二索引值,其中第一标志用于标识是否对待解码块使用帧内加权预测模式;第一索引值用于从第一帧内预测模式列表中确定与待解码块对应的目标帧内预测模式;第二索引值用于在权重列表集中确定与待解码块对应的目标权重列表。
在一些实施例中,视频编码装置1600配置为:从帧内预测模式列表中确定目标帧内预测模式,其中帧内预测模式列表包括与当前待编码块是相邻或不相邻的已编码块对应的帧内预测模式、预设的角度模式、双线性模式和平面模式中的一个或多个,并且帧内预测模式列表所包含的帧内预测模式各不相同
在一些实施例中,权重列表集中包括多个权重列表和与各权重列表对应的序列号,其中与各权重列表对应的序列号是根据索引值、帧内预测模式及待解码块的宽度和高度生成的;确定模块1601配置为:根据预设索引值、当前待编码块的宽度和高度以及目标帧内预测模式确定一标识;将标识与权重列表集中的序列号进行匹配,得到目标序列号,并将与目标序列号对应的权重列表作为目标权重列表。
在一些实施例中,视频编码装置1600还包括:权重列表构建模块,配置为根据与待编码块对应的帧内预测模式以及待编码块的宽度和高度确定与待编码块对应的权重列表。
在一些实施例中,权重列表构建模块包括:第一长度确定单元,配置为根据待编码块的宽度和高度确定与待编码块对应的参考像素的长度;第二长度确定单元,配置为根据与待编码块对应的帧内预测模式在参考像素的长度方向上确定有效参考像素和有效参考像素长度;位置确定单元,配置为基于有效参考像素长度在有效参考像素中设置一个或多个预设点,根据索引值和预设点在有效参考像素中确定第一位置,同时根据预设参考像素的位置确定第二位置;权重设置单元,配置为根据 第一位置和第二位置的关系设置参考像素的权重,得到与待编码块对应的权重列表。
在一些实施例中,第二长度确定单元配置为:当帧内预测模式为角度模式时,获取预测角度,根据待编码块的宽度和高度以及预测角度确定有效参考像素和有效参考像素长度;当帧内预测模式为非角度模式时,将有效参考像素确定为参考像素,将有效参考像素长度确定为参考像素的长度。
在一些实施例中,权重设置单元配置为:当第一位置的坐标小于第二位置的坐标时,将预设参考像素和位置坐标小于第一位置的坐标的参考像素的权重设置为第一权重,将剩余的参考像素的权重设置为第二权重;当第一位置的坐标大于或等于第二位置的坐标时,将预设参考像素和位置坐标小于第一位置的坐标的参考像素的权重设置为第二权重,将剩余的参考像素的权重设置为第一权重。
在一些实施例中,权重设置单元配置为:在第一位置处添加过渡权重,其中位于第一位置之前的参考像素的过渡权重为权重取值范围中的任一权重,位于第一位置之后的参考像素的过渡权重随参考像素的位置与第一位置的距离的变化而变化,其中第一位置之后的参考像素的过渡权重大于第一位置之前的参考像素的权重且小于或等于权重取值范围中的最大权重;或者,在第一位置处添加过渡权重,其中位于第一位置之前的参考像素的过渡权重随参考像素的位置与第一位置的绝对距离的变化而变化,位于第一位置之后的参考像素的过渡权重为权重取值范围中的任一权重,其中第一位置之前的参考像素的过渡权重大于第一位置之后的参考像素的权重且小于或等于权重取值范围中的最大权重。
在一些实施例中,加权模块1602包括:像素处理单元,配置为根据参考像素构建相同大小的辅助参考像素,并对参考像素的像素值进行目标处理,得到辅助参考像素中各像素的像素值;分类单元,配置为根据预设规则对参考像素和辅助参考像素进行分类,得到第一类参考像素和第二类参考像素。
在一些实施例中,分类单元配置为:将参考像素作为第一类参考像素,将辅助参考像素作为第二类参考像素;或者,编码码流得到第三标志;在第三标志的值满足第二预设条件时,将参考像素作为第一类参考像素,将辅助参考像素作为第二类参考像素;在第三标志的值不满足第二预设条件时,将辅助参考像素作为第一类参考像素,将参考像素作为第二类参考像素。
在一些实施例中,加权模块1602配置为:根据计算公式(3)确定加权参考像素:
R[x][y]=(R 0[x][y]×R W[x][y]+R 1[x][y]×(max_w-R W[x][y]))/max_w  (3);
其中,R[x][y]为位于坐标(x,y)处的加权参考像素,R 0[x][y]为位于坐标(x,y)处的第一类参考像素,R W[x][y]为目标权重列表中与位于坐标(x,y)处的参考像素对应的权重,R 1[x][y]为位于坐标(x,y)处的第二类参考像素,max_w为权重取值范围中的最大值。
在一些实施例中,参考像素包括亮度参考像素和色度参考像素,加权参考像素包括亮度加权参考像素和色度加权参考像素。
在一些实施例中,参考像素为亮度参考像素,加权参考像素为亮度加权参考像素;视频编码装置1600还配置为:根据计算公式(4)对亮度参考像素的权重进行处理,得到色度参考像素的权重列表;根据与当前待编码块对应的色度参考像素确定第一类色度参考像素和第二类色度参考像素,并基于色度参考像素的权重列表对第一类色度参考像素和第二类色度参考像素进行加权处理,得到色度加权参考像素;
其中,计算公式(4)如下所示:
R W_Chorma[x][y]=R W_Luma[x<<scale_x][y<<scale_y]    (4);
其中,R W_Chorma[x][y]为位于坐标(x,y)处的色度参考像素的权重,R W_Luma为亮度参考像素对应的权重列表,scale_x为视频图像亮度分量和色度分量在x方向的尺寸放缩系数,scale_y为视频图像亮度分量和色度分量在y方向的尺寸放缩系数,<<为左移运算符号。
在一些实施例中,预测模块1603配置为:根据亮度加权参考像素、色度加权参考像素和目标帧内预测模式对当前待编码块进行预测。
在一些实施例中,视频编码装置1600还包括:第一存储模块,配置为将当前待编码块对应的帧内加权预测模式作为最终的帧内预测模式进行存储;或者,分解模块,配置为根据预设值将当前待编码块分解为多个子编码块;索引值确定模块,配置为根据各子编码块中的预设像素、目标帧内预测模式和目标权重列表确定存储方式索引值;第二存储模块,配置为根据存储方式索引值确定子编码块对应的帧内预测模式,并将子编码块和与子编码块对应的帧内预测模式进行对应存储。
在一些实施例中,索引值确定模块配置为:当目标帧内预测模式为角度模式时,将预设像素根据角度模式中的预测角度在有效参考像素的方向进行投影,得到目标参考像素;获取目标权重列表中与目标参考像素对应的权重;当目标参考像素对应的权重大于或等于第一预设阈值时,将存储方 式索引值标记为第一数值;当目标参考像素对应的权重小于第一预设阈值时,将存储方式索引值标记为不同于第一数值的第二数值;或者,当目标帧内预测模式为非角度模式时,根据目标权重列表和第二预设阈值对与子编码块对应的参考像素进行分类,得到与子编码块对应的参考像素中权重小于第二预设阈值的第一数量和权重大于或等于第二预设阈值的第二数量;当第一数量小于或等于第二数量时,将存储方式索引值标记为第一数值;当第一数量大于第二数量时,将存储方式索引值标记为第二数值。
在一些实施例中,第二存储模块配置为:当存储方式索引值为第一数值时,子编码块对应的帧内预测模式为第一类参考像素对应的帧内预测模式;当存储方式索引值为第二数值时,子编码块对应的帧内预测模式为第二类参考像素对应的帧内预测模式。
图17示出了适于用来实现本公开实施例的电子设备的计算机系统的结构示意图。
需要说明的是,图17示出的电子设备的计算机系统1700仅是一个示例,不应对本公开实施例的功能和使用范围带来任何限制。
如图17所示,计算机系统1700包括中央处理单元(Central Processing Unit,CPU)1701,其可以根据存储在只读存储器(Read-Only Memory,ROM)1702中的程序或者从存储部分1708加载到随机访问存储器(Random Access Memory,RAM)1703中的程序而执行各种适当的动作和处理,实现上述实施例中的视频编解码方法。在RAM 1703中,还存储有系统操作所需的各种程序和数据。CPU 1701、ROM 1702以及RAM 1703通过总线1704彼此相连。输入/输出(Input/Output,I/O)接口1705也连接至总线1704。
以下部件连接至I/O接口1705:包括键盘、鼠标等的输入部分1706;包括诸如阴极射线管(Cathode Ray Tube,CRT)、液晶显示器(Liquid Crystal Display,LCD)等以及扬声器等的输出部分1707;包括硬盘等的存储部分1708;以及包括诸如LAN(Local Area Network,局域网)卡、调制解调器等的网络接口卡的通信部分1709。通信部分1709经由诸如因特网的网络执行通信处理。驱动器1710也根据需要连接至I/O接口1705。可拆卸介质1711,诸如磁盘、光盘、磁光盘、半导体存储器等等,根据需要安装在驱动器1710上,以便于从其上读出的计算机程序根据需要被安装入存储部分1708。
特别地,根据本公开的实施例,下文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在计算机可读存储介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信部分1709从网络上被下载和安装,和/或从可拆卸介质1711被安装。在该计算机程序被中央处理单元(CPU)1701执行时,执行本公开的系统中限定的各种功能。
需要说明的是,本公开实施例所示的计算机可读存储介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是但不限于电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(Erasable Programmable Read Only Memory,EPROM)、闪存、光纤、便携式紧凑磁盘只读存储器(Compact Disc Read-Only Memory,CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开中,计算机可读的信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读的信号介质还可以是计算机可读存储介质以外的任何计算机可读存储介质,该计算机可读存储介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读存储介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:无线、有线等等,或者上述的任意合适的组合。
附图中的流程图和框图,图示了按照本公开各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,上述模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图或流程图中的每个方框、以及框图或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以 用专用硬件与计算机指令的组合来实现。
描述于本公开实施例中所涉及到的单元可以通过软件的方式实现,也可以通过硬件的方式来实现,所描述的单元也可以设置在处理器中。其中,这些单元的名称在某种情况下并不构成对该单元本身的限定。
作为另一方面,本公开还提供了一种计算机可读存储介质,该计算机可读存储介质可以是上述实施例中描述的电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。上述计算机可读存储介质承载有一个或者多个程序,当上述一个或者多个程序被一个该电子设备执行时,使得该电子设备实现上述实施例中的方法。
应当注意,尽管在上文详细描述中提及了用于动作执行的设备的若干模块或者单元,但是这种划分并非强制性的。实际上,根据本公开的实施方式,上文描述的两个或更多模块或者单元的特征和功能可以在一个模块或者单元中具体化。反之,上文描述的一个模块或者单元的特征和功能可以进一步划分为由多个模块或者单元来具体化。
通过以上的实施方式的描述,本领域的技术人员易于理解,这里描述的示例实施方式可以通过软件实现,也可以通过软件结合必要的硬件的方式来实现。因此,根据本公开实施方式的技术方案可以以软件产品的形式体现出来,该软件产品可以存储在一个非易失性存储介质(可以是CD-ROM,U盘,移动硬盘等)中或网络上,包括若干指令以使得一台计算设备(可以是个人计算机、服务器、触控终端、或者网络设备等)执行根据本公开实施方式的方法。
本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本公开的其它实施方案。本公开旨在涵盖本公开的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本公开的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。
应当理解的是,本公开并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本公开的范围仅由所附的权利要求来限制。

Claims (42)

  1. 一种视频解码方法,所述方法包括:
    解码码流,得到第一标志、第一索引值和第二索引值,其中所述第一标志用于标识是否对当前待解码块使用帧内加权预测模式;
    当所述第一标志的值满足第一预设条件时,根据所述第一索引值在第一帧内预测模式列表中确定目标帧内预测模式,并根据所述第二索引值在权重列表集中确定目标权重列表;
    根据与所述当前待解码块对应的参考像素确定第一类参考像素和第二类参考像素,并基于所述目标权重列表对所述第一类参考像素和所述第二类参考像素进行加权处理,得到加权参考像素;
    根据所述加权参考像素和所述目标帧内预测模式对所述当前待解码块进行预测,得到与所述当前待解码块对应的预测块。
  2. 根据权利要求1所述的方法,其中,所述第一帧内预测模式列表包括多种帧内预测模式和与各所述帧内预测模式对应的序列号;
    所述根据所述第一索引值在第一帧内预测模式列表中确定目标帧内预测模式,包括:
    将所述第一索引值与所述第一帧内预测模式列表中的序列号进行匹配处理,得到与所述第一索引值匹配的目标序列号;
    将与所述目标序列号对应的帧内预测模式作为所述目标帧内预测模式。
  3. 根据权利要求1所述的方法,其中,所述方法还包括:
    获取第二标志;
    当根据所述第二标志确定所述目标帧内预测模式在所述第一帧内预测模式列表中时,根据所述第一索引值在所述第一帧内预测模式列表中确定所述目标帧内预测模式;
    当根据所述第二标志确定所述目标帧内预测模式不在所述第一帧内预测模式列表中时,解码所述码流得到第三索引值,并根据所述第三索引值在第二帧内预测模式列表中确定所述目标帧内预测模式;
    其中,所述第一帧内预测模式列表与所述第二帧内预测模式列表所包含的帧内预测模式不同。
  4. 根据权利要求1-3中任一项所述的方法,其中,所述第一帧内预测模式列表包括已解码块对应的帧内预测模式、预设的角度模式、双线性模式和平面模式中的一种或多种,所述已解码块与所述当前待解码块是相邻或不相邻的,并且所述第一帧内预测模式列表所包含的帧内预测模式各不相同。
  5. 根据权利要求1所述的方法,其中,所述权重列表集中包括多个权重列表和与各所述权重列表对应的序列号,其中,与各所述权重列表对应的序列号是根据索引值、帧内预测模式及待解码块的宽度和高度生成的,所述索引值的类型与所述第二索引值的类型相同;
    所述根据所述第二索引值在权重列表集中确定目标权重列表,包括:
    根据所述第二索引值、所述当前待解码块的宽度和高度以及所述目标帧内预测模式确定标识;
    将所述标识与所述权重列表集中的序列号进行匹配,得到目标序列号,并将与所述目标序列号对应的权重列表作为所述目标权重列表。
  6. 根据权利要求5所述的方法,其中,所述方法还包括:
    根据与所述待解码块对应的帧内预测模式以及所述待解码块的宽度和高度确定与所述待解码块对应的权重列表。
  7. 根据权利要求6所述的方法,其中,所述根据与所述待解码块对应的帧内预测模式以及所述待解码块的宽度和高度确定与所述待解码块对应的权重列表,包括:
    根据所述待解码块的宽度和高度确定与所述待解码块对应的参考像素的长度;
    根据与所述待解码块对应的帧内预测模式在所述参考像素的长度方向上确定有效参考像素和有效参考像素长度;
    基于所述有效参考像素长度在所述有效参考像素中设置一个或多个预设点,根据所述索引值和所述预设点在所述有效参考像素中确定第一位置,同时根据预设参考像素的位置确定第二位置;
    根据所述第一位置和所述第二位置的关系设置所述参考像素的权重,得到与所述待解码块对应的权重列表。
  8. 根据权利要求7所述的方法,其中,所述根据与所述待解码块对应的帧内预测模式在所述参考像素的长度方向上确定有效参考像素和有效参考像素长度,包括:
    当所述帧内预测模式为角度模式时,获取预测角度,根据所述待解码块的宽度和高度以及所述预测角度确定所述有效参考像素和所述有效参考像素长度;
    当所述帧内预测模式为非角度模式时,将有效参考像素确定为参考像素,将有效参考像素长度 确定为参考像素的长度。
  9. 根据权利要求7所述的方法,其中,所述根据所述第一位置和所述第二位置的关系设置所述参考像素的权重,包括:
    当所述第一位置的坐标小于所述第二位置的坐标时,将所述预设参考像素和位置坐标小于所述第一位置的坐标的参考像素的权重设置为第一权重,将剩余的参考像素的权重设置为第二权重;
    当所述第一位置的坐标大于或等于所述第二位置的坐标时,将所述预设参考像素和位置坐标小于所述第一位置的坐标的参考像素的权重设置为所述第二权重,将剩余的参考像素的权重设置为所述第一权重。
  10. 根据权利要求7所述的方法,其中,所述根据所述第一位置和所述第二位置的关系设置所述参考像素的权重,包括:
    在所述第一位置处添加过渡权重,其中,位于所述第一位置之前的参考像素的过渡权重为权重取值范围中的任一权重,位于所述第一位置之后的参考像素的过渡权重随参考像素的位置与所述第一位置的距离的变化而变化,其中,所述第一位置之后的参考像素的过渡权重大于所述第一位置之前的参考像素的权重且小于或等于所述权重取值范围中的最大权重;或者
    在所述第一位置处添加过渡权重,其中,位于所述第一位置之前的参考像素的过渡权重随参考像素的位置与所述第一位置的绝对距离的变化而变化,位于所述第一位置之后的参考像素的过渡权重为所述权重取值范围中的任一权重,其中,所述第一位置之前的参考像素的过渡权重大于所述第一位置之后的参考像素的权重且小于或等于所述权重取值范围中的最大权重。
  11. 根据权利要求1所述的方法,其中,所述根据与所述当前待解码块对应的参考像素确定第一类参考像素和第二类参考像素,包括:
    根据所述参考像素构建相同大小的辅助参考像素,并对所述参考像素的像素值进行目标处理,得到所述辅助参考像素中各像素的像素值;
    根据预设规则对所述参考像素和所述辅助参考像素进行分类,得到所述第一类参考像素和所述第二类参考像素。
  12. 根据权利要求11所述的方法,其中,所述根据预设规则对所述参考像素和所述辅助参考像素进行分类,得到所述第一类参考像素和所述第二类参考像素,包括:
    将所述参考像素作为所述第一类参考像素,将所述辅助参考像素作为所述第二类参考像素;或者
    解码所述码流得到第三标志;
    当所述第三标志的值满足第二预设条件时,将所述参考像素作为所述第一类参考像素,将所述辅助参考像素作为所述第二类参考像素;
    当所述第三标志的值不满足所述第二预设条件时,将所述辅助参考像素作为所述第一类参考像素,将所述参考像素作为所述第二类参考像素。
  13. 根据权利要求1所述的方法,其中,所述基于所述目标权重列表对所述第一类参考像素和所述第二类参考像素进行加权处理,得到加权参考像素,包括:
    根据以下计算公式确定加权参考像素:
    R[x][y]=(R 0[x][y]×R W[x][y]+R 1[x][y]×(max_w-R W[x][y]))/max_w;
    其中,R[x][y]为位于坐标(x,y)处的加权参考像素,R 0[x][y]为位于坐标(x,y)处的第一类参考像素,R W[x][y]为目标权重列表中与位于坐标(x,y)处的参考像素对应的权重,R 1[x][y]为位于坐标(x,y)处的第二类参考像素,max_w为权重取值范围中的最大值。
  14. 根据权利要求1所述的方法,其中,所述参考像素包括亮度参考像素和色度参考像素,所述加权参考像素包括亮度加权参考像素和色度加权参考像素。
  15. 根据权利要求1所述的方法,其中,所述参考像素为亮度参考像素,所述加权参考像素为亮度加权参考像素;所述方法还包括:
    根据以下计算公式对所述亮度参考像素的权重进行处理,得到色度参考像素的权重列表:
    R W_Chorma[x][y]=R W_Luma[x<<scale_x][y<<scale_y];
    其中,R W_Chorma[x][y]为位于坐标(x,y)处的色度参考像素的权重,R W_Luma为亮度参考像素对应的权重列表,scale_x为视频图像亮度分量和色度分量在x方向的尺寸放缩系数,scale_y为视频图像亮度分量和色度分量在y方向的尺寸放缩系数,<<为左移运算符号;
    根据与所述当前待解码块对应的色度参考像素确定第一类色度参考像素和第二类色度参考像素,并基于所述色度参考像素的权重列表对所述第一类色度参考像素和所述第二类色度参考像素进行加权处理,得到色度加权参考像素。
  16. 根据权利要求14或15所述的方法,其中,所述根据所述加权参考像素和所述目标帧内预测模式对所述当前待解码块进行预测,包括:
    根据所述亮度加权参考像素、所述色度加权参考像素和所述目标帧内预测模式对所述当前待解码块进行预测。
  17. 根据权利要求1-15任一项所述的方法,其中,在获取所述第一标志之前,所述方法还包括:
    获取所述当前待解码块的宽度和高度,当所述当前待解码块的宽度和高度满足第三预设条件时,解码所述码流得到所述第一标志;或者
    解码所述码流得到图像头标志,当所述图像头标志满足第四预设条件时,解码所述码流得到所述第一标志;或者
    解码所述码流得到序列头标志,当所述序列头标志满足第五预设条件时,解码所述码流得到所述第一标志或者所述图像头标志和所述第一标志。
  18. 根据权利要求1-15任一项所述的方法,其中,所述方法还包括:
    将所述当前待解码块对应的帧内加权预测模式作为最终的帧内预测模式进行存储;或者
    根据预设值将所述当前待解码块分解为多个子解码块;
    根据各所述子解码块中的预设像素、所述目标帧内预测模式和所述目标权重列表确定存储方式索引值;
    根据所述存储方式索引值确定所述子解码块对应的帧内预测模式,并将所述子解码块和与所述子解码块对应的帧内预测模式进行对应存储。
  19. 根据权利要求18所述的方法,其中,所述根据各所述子解码块中的预设像素、所述目标帧内预测模式和所述目标权重列表确定存储方式索引值,包括:
    当所述目标帧内预测模式为角度模式时,将所述预设像素根据所述角度模式中的预测角度在有效参考像素的方向进行投影,得到目标参考像素;
    获取所述目标权重列表中与所述目标参考像素对应的权重;
    当所述目标参考像素对应的权重大于或等于第一预设阈值时,将所述存储方式索引值标记为第一数值;当所述目标参考像素对应的权重小于所述第一预设阈值时,将所述存储方式索引值标记为不同于所述第一数值的第二数值;或者
    当所述目标帧内预测模式为非角度模式时,根据所述目标权重列表和第二预设阈值对与所述子解码块对应的参考像素进行分类,得到与所述子解码块对应的参考像素中权重小于所述第二预设阈值的第一数量和权重大于或等于所述第二预设阈值的第二数量;
    当所述第一数量小于或等于所述第二数量时,将所述存储方式索引值标记为所述第一数值;当所述第一数量大于所述第二数量时,将所述存储方式索引值标记为所述第二数值。
  20. 根据权利要求18所述的方法,其中,所述根据所述存储方式索引值确定所述子解码块对应的帧内预测模式,包括:
    当所述存储方式索引值为所述第一数值时,所述子解码块对应的帧内预测模式为所述第一类参考像素对应的帧内预测模式;
    当所述存储方式索引值为所述第二数值时,所述子解码块对应的帧内预测模式为所述第二类参考像素对应的帧内预测模式。
  21. 一种视频编码方法,所述方法包括:
    从帧内预测模式列表中确定与当前待编码块对应的目标帧内预测模式,并从权重列表集中确定与所述当前待编码块对应的目标权重列表;
    根据与所述当前待编码块对应的参考像素确定第一类参考像素和第二类参考像素,并基于所述目标权重列表对所述第一类参考像素和所述第二类参考像素进行加权处理,得到加权参考像素;
    根据所述加权参考像素和所述目标帧内预测模式对所述当前待编码块进行预测,得到与所述当前待编码块对应的预测块;
    根据所述预测块形成码流,并在所述码流中添加第一标志、第一索引值和第二索引值,其中所述第一标志用于标识是否对待解码块使用帧内加权预测模式;所述第一索引值用于从第一帧内预测模式列表中确定与所述待解码块对应的目标帧内预测模式;所述第二索引值用于在权重列表集中确定与所述待解码块对应的目标权重列表。
  22. 根据权利要求21所述的方法,其中,所述帧内预测模式列表包括与所述当前待编码块是相邻或不相邻的已编码块对应的帧内预测模式、预设的角度模式、双线性模式和平面模式中的一个或多个,并且所述帧内预测模式列表所包含的帧内预测模式各不相同。
  23. 根据权利要求21所述的方法,其中,所述权重列表集中包括多个权重列表和与各所述权重列表对应的序列号,与各所述权重列表对应的序列号是根据索引值、帧内预测模式及待解码块的宽度和高度生成的,
    所述从权重列表集中确定与所述当前待编码块对应的目标权重列表,包括:根据预设索引值、所述当前待编码块的宽度和高度以及所述目标帧内预测模式确定一标识;将所述标识与所述权重列表集中的序列号进行匹配,得到目标序列号,并将与所述目标序列号对应的权重列表作为所述目标权重列表。
  24. 根据权利要求23所述的方法,其中,所述方法还包括:
    根据与所述待编码块对应的帧内预测模式以及所述待编码块的宽度和高度,确定与所述待编码块对应的权重列表。
  25. 根据权利要求24所述的方法,其中,所述根据与所述待编码块对应的帧内预测模式以及所述待编码块的宽度和高度确定与所述待编码块对应的权重列表,包括:
    根据所述待编码块的宽度和高度确定与所述待编码块对应的参考像素的长度;根据与所述待编码块对应的帧内预测模式在所述参考像素的长度方向上确定有效参考像素和有效参考像素长度;
    基于所述有效参考像素长度在所述有效参考像素中设置一个或多个预设点,根据所述索引值和所述预设点在所述有效参考像素中确定第一位置,并根据预设参考像素的位置确定第二位置;
    根据所述第一位置和所述第二位置的关系设置所述参考像素的权重,得到与所述待编码块对应的权重列表。
  26. 根据权利要求25所述的方法,其中,所述根据与所述待编码块对应的帧内预测模式在所述参考像素的长度方向上确定有效参考像素和有效参考像素长度,包括:
    当所述帧内预测模式为角度模式时,获取预测角度,根据所述待编码块的宽度和高度以及所述预测角度确定所述有效参考像素和所述有效参考像素长度;
    当所述帧内预测模式为非角度模式时,将所述有效参考像素确定为所述参考像素,将所述有效参考像素长度确定为所述参考像素的长度。
  27. 根据权利要求25所述的方法,其中,所述根据所述第一位置和所述第二位置的关系设置所述参考像素的权重,包括:
    当所述第一位置的坐标小于所述第二位置的坐标时,将所述预设参考像素和位置坐标小于所述第一位置的坐标的参考像素的权重设置为第一权重,将剩余的参考像素的权重设置为第二权重;
    当所述第一位置的坐标大于或等于所述第二位置的坐标时,将所述预设参考像素和位置坐标小于所述第一位置的坐标的参考像素的权重设置为所述第二权重,将剩余的参考像素的权重设置为所述第一权重。
  28. 根据权利要求25所述的方法,其中,所述根据所述第一位置和所述第二位置的关系设置所述参考像素的权重,包括:
    在所述第一位置处添加过渡权重,其中,位于所述第一位置之前的参考像素的过渡权重为权重取值范围中的任一权重,位于所述第一位置之后的参考像素的过渡权重随参考像素的位置与所述第一位置的距离的变化而变化,所述第一位置之后的参考像素的过渡权重大于所述第一位置之前的参考像素的权重,且小于或等于所述权重取值范围中的最大权重;
    或者,在所述第一位置处添加过渡权重,其中,位于所述第一位置之前的参考像素的过渡权重随参考像素的位置与所述第一位置的绝对距离的变化而变化,位于所述第一位置之后的参考像素的过渡权重为所述权重取值范围中的任一权重,所述第一位置之前的参考像素的过渡权重大于所述第一位置之后的参考像素的权重,且小于或等于所述权重取值范围中的最大权重。
  29. 根据权利要求21所述的方法,其中,所述根据与所述当前待编码块对应的参考像素确定第一类参考像素和第二类参考像素,包括:
    根据所述参考像素构建相同大小的辅助参考像素,并对所述参考像素的像素值进行目标处理,得到所述辅助参考像素中各像素的像素值;
    根据预设规则对所述参考像素和所述辅助参考像素进行分类,得到所述第一类参考像素和所述第二类参考像素。
  30. 根据权利要求21所述的方法,其中,所述根据预设规则对所述参考像素和所述辅助参考像素进行分类,得到所述第一类参考像素和所述第二类参考像素,包括:
    将所述参考像素作为所述第一类参考像素,将所述辅助参考像素作为所述第二类参考像素;
    或者,编码所述码流得到第三标志;当所述第三标志的值满足第二预设条件时,将所述参考像素作为所述第一类参考像素,将所述辅助参考像素作为所述第二类参考像素;当所述第三标志的值 不满足所述第二预设条件时,将所述辅助参考像素作为所述第一类参考像素,将所述参考像素作为所述第二类参考像素。
  31. 根据权利要求21所述的方法,其中,所述基于所述目标权重列表对所述第一类参考像素和所述第二类参考像素进行加权处理,得到加权参考像素,包括:
    根据以下计算公式确定加权参考像素:
    R[x][y]=(R 0[x][y]×R W[x][y]+R 1[x][y]×(max_w-R W[x][y]))/max_w;
    其中,R[x][y]为位于坐标(x,y)处的加权参考像素,R 0[x][y]为位于坐标(x,y)处的第一类参考像素,R W[x][y]为目标权重列表中与位于坐标(x,y)处的参考像素对应的权重,R 1[x][y]为位于坐标(x,y)处的第二类参考像素,max_w为权重取值范围中的最大值。
  32. 根据权利要求21所述的方法,其中,所述参考像素包括亮度参考像素和色度参考像素,所述加权参考像素包括亮度加权参考像素和色度加权参考像素。
  33. 根据权利要求21所述的方法,其中,所述参考像素为亮度参考像素,所述加权参考像素为亮度加权参考像素;
    所述方法还包括:
    根据以下计算公式对所述亮度参考像素的权重进行处理,得到色度参考像素的权重列表:
    R W_Chorma[x][y]=R W_Luma[x<<scale_x][y<<scale_y];
    其中,R W_Chorma[x][y]为位于坐标(x,y)处的色度参考像素的权重,R W_Luma为亮度参考像素对应的权重列表,scale_x为视频图像亮度分量和色度分量在x方向的尺寸放缩系数,scale_y为视频图像亮度分量和色度分量在y方向的尺寸放缩系数,<<为左移运算符号;
    根据与所述当前待编码块对应的色度参考像素确定第一类色度参考像素和第二类色度参考像素,并基于所述色度参考像素的权重列表对所述第一类色度参考像素和所述第二类色度参考像素进行加权处理,得到色度加权参考像素。
  34. 根据权利要求32或33所述的方法,其中,所述根据所述加权参考像素和所述目标帧内预测模式对所述当前待编码块进行预测,包括:
    根据所述亮度加权参考像素、所述色度加权参考像素和所述目标帧内预测模式对所述当前待编码块进行预测。
  35. 根据权利要求21-33任一项所述的方法,其中,所述方法还包括:
    将所述当前待编码块对应的帧内加权预测模式作为最终的帧内预测模式进行存储;或者,根据预设值将所述当前待编码块分解为多个子编码块;
    根据各所述子编码块中的预设像素、所述目标帧内预测模式和所述目标权重列表确定存储方式索引值;
    根据所述存储方式索引值确定所述子编码块对应的帧内预测模式,并将所述子编码块和与所述子编码块对应的帧内预测模式进行对应存储。
  36. 根据权利要求35所述的方法,其中,所述根据各所述子编码块中的预设像素、所述目标帧内预测模式和所述目标权重列表确定存储方式索引值,包括:
    当所述目标帧内预测模式为角度模式时,将所述预设像素根据所述角度模式中的预测角度在有效参考像素的方向进行投影,得到目标参考像素;获取所述目标权重列表中与所述目标参考像素对应的权重;
    当所述目标参考像素对应的权重大于或等于第一预设阈值时,将所述存储方式索引值标记为第一数值;
    当所述目标参考像素对应的权重小于所述第一预设阈值时,将所述存储方式索引值标记为不同于所述第一数值的第二数值;或者,
    当所述目标帧内预测模式为非角度模式时,根据所述目标权重列表和第二预设阈值对与所述子编码块对应的参考像素进行分类,得到与所述子编码块对应的参考像素中权重小于所述第二预设阈值的第一数量和权重大于或等于所述第二预设阈值的第二数量;
    当所述第一数量小于或等于所述第二数量时,将所述存储方式索引值标记为所述第一数值;
    当所述第一数量大于所述第二数量时,将所述存储方式索引值标记为所述第二数值。
  37. 根据权利要求35所述的方法,其中,所述根据所述存储方式索引值确定所述子编码块对应的帧内预测模式,包括:
    当所述存储方式索引值为所述第一数值时,所述子编码块对应的帧内预测模式为所述第一类参考像素对应的帧内预测模式;
    当所述存储方式索引值为所述第二数值时,所述子编码块对应的帧内预测模式为所述第二类参 考像素对应的帧内预测模式。
  38. 一种视频解码装置,所述装置包括:
    码流解码模块,配置为解码码流,得到第一标志、第一索引值和第二索引值,其中所述第一标志用于标识是否对当前待解码块使用帧内加权预测模式;
    索引匹配模块,配置为当所述第一标志的值满足第一预设条件时,根据所述第一索引值在第一帧内预测模式列表中确定目标帧内预测模式,并根据所述第二索引值在权重列表集中确定目标权重列表;
    像素加权模块,配置为根据与所述当前待解码块对应的参考像素确定第一类参考像素和第二类参考像素,并基于所述目标权重列表对所述第一类参考像素和所述第二类参考像素进行加权处理,得到加权参考像素;
    像素预测模块,配置为根据所述加权参考像素和所述目标帧内预测模式对所述当前待解码块进行预测,得到与所述当前待解码块对应的预测块。
  39. 一种视频编码装置,所述装置包括:
    确定模块,配置为确定与当前待编码块对应的目标帧内预测模式,并从权重列表集中确定与所述当前待编码块对应的目标权重列表;
    加权模块,配置为根据与所述当前待编码块对应的参考像素确定第一类参考像素和第二类参考像素,并基于所述目标权重列表对所述第一类参考像素和所述第二类参考像素进行加权处理,得到加权参考像素;
    预测模块,配置为根据所述加权参考像素和所述目标帧内预测模式对所述当前待编码块进行预测,得到与所述当前待编码块对应的预测块;
    码流生成模块,配置为根据所述预测块形成码流,并在所述码流中添加第一标志、第一索引值和第二索引值,其中所述第一标志用于标识是否对待解码块使用帧内加权预测模式;所述第一索引值用于从第一帧内预测模式列表中确定与所述待解码块对应的目标帧内预测模式;所述第二索引值用于在权重列表集中确定与所述待解码块对应的目标权重列表。
  40. 一种电子设备,所述电子设备包括:
    一个或多个处理器;
    存储装置,用于存储一个或多个程序,当所述一个或多个程序被所述一个或多个处理器执行时,使得所述一个或多个处理器实现如权利要求1至20中任意一项所述的视频解码方法或如权利要求21-37中任意一项所述的视频编码方法。
  41. 一种计算机可读存储介质,存储有可执行指令,用于被处理器执行时实现如权利要求1至20中任意一项所述的视频解码方法或如权利要求21-37中任意一项所述的视频编码方法。
  42. 一种计算机程序产品,包括计算机程序,所述计算机程序被处理器执行时实现如权利要求1至20中任意一项所述的视频解码方法或如权利要求21-37中任意一项所述的视频编码方法。
PCT/CN2021/136122 2021-02-05 2021-12-07 视频编解码方法、装置、计算机程序产品、计算机可读存储介质及电子设备 WO2022166370A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US17/981,323 US20230056211A1 (en) 2021-02-05 2022-11-04 Video encoding method and apparatus, video decoding method and apparatus, computer program product, computer-readable storage medium, and electronic device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110164797.9A CN114885160A (zh) 2021-02-05 2021-02-05 视频编解码方法、装置、计算机可读介质及电子设备
CN202110164797.9 2021-02-05

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/981,323 Continuation US20230056211A1 (en) 2021-02-05 2022-11-04 Video encoding method and apparatus, video decoding method and apparatus, computer program product, computer-readable storage medium, and electronic device

Publications (1)

Publication Number Publication Date
WO2022166370A1 true WO2022166370A1 (zh) 2022-08-11

Family

ID=82666489

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/136122 WO2022166370A1 (zh) 2021-02-05 2021-12-07 视频编解码方法、装置、计算机程序产品、计算机可读存储介质及电子设备

Country Status (3)

Country Link
US (1) US20230056211A1 (zh)
CN (1) CN114885160A (zh)
WO (1) WO2022166370A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115633168A (zh) * 2022-09-30 2023-01-20 腾讯科技(深圳)有限公司 一种视频处理方法及相关设备

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170347103A1 (en) * 2016-05-25 2017-11-30 Arris Enterprises Llc Weighted angular prediction coding for intra coding
CN109845263A (zh) * 2016-10-14 2019-06-04 华为技术有限公司 用于视频编码的设备和方法
EP3606069A1 (en) * 2018-08-03 2020-02-05 InterDigital VC Holdings, Inc. Multiple reference intra prediction using variable weights
CN111447440A (zh) * 2020-03-13 2020-07-24 浙江大华技术股份有限公司 帧内像素预测值的计算方法、电子设备及装置
WO2021015934A1 (en) * 2019-07-22 2021-01-28 Interdigital Vc Holdings, Inc. Method and apparatus for video encoding and decoding with matrix based intra-prediction

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170347103A1 (en) * 2016-05-25 2017-11-30 Arris Enterprises Llc Weighted angular prediction coding for intra coding
CN109845263A (zh) * 2016-10-14 2019-06-04 华为技术有限公司 用于视频编码的设备和方法
EP3606069A1 (en) * 2018-08-03 2020-02-05 InterDigital VC Holdings, Inc. Multiple reference intra prediction using variable weights
WO2021015934A1 (en) * 2019-07-22 2021-01-28 Interdigital Vc Holdings, Inc. Method and apparatus for video encoding and decoding with matrix based intra-prediction
CN111447440A (zh) * 2020-03-13 2020-07-24 浙江大华技术股份有限公司 帧内像素预测值的计算方法、电子设备及装置

Also Published As

Publication number Publication date
CN114885160A (zh) 2022-08-09
US20230056211A1 (en) 2023-02-23

Similar Documents

Publication Publication Date Title
KR102551731B1 (ko) 화면 내 예측을 이용한 영상 부호화/복호화 방법 및 장치
TWI625962B (zh) 取樣自適應偏移解碼方法
TWI632805B (zh) 視訊解碼方法、視訊編碼方法、視訊解碼裝置、視訊編碼裝置以及非暫態的電腦可讀取儲存媒體
TW201817236A (zh) 用於視頻寫碼之線性模型色度內預測
TW201813386A (zh) 用於視訊寫碼之樹型寫碼
CN114554201A (zh) 视频译码中的帧内滤波旗标
CN112533000B (zh) 视频解码方法、装置、计算机可读介质及电子设备
TW201334553A (zh) 具有根據對於每個最大碼單元的畫素分類而調整偏移的視訊編碼方法與裝置,具有根據對於每個最大碼單元的畫素分類而調整偏移的視訊解碼方法與裝置
US11695962B2 (en) Encoding and decoding methods and corresponding devices
TWI813922B (zh) 從視訊位元流解碼影像和編碼影像為視訊位元流的方法及其解碼設備和編碼設備以及非暫態電腦可讀取媒體
WO2022063033A1 (zh) 视频解码方法、视频编码方法、装置、计算机可读介质及电子设备
JP2020537468A (ja) ビデオコーディングのための空間変動変換
WO2022062880A1 (zh) 视频解码方法、装置、计算机可读介质及电子设备
KR20200096227A (ko) 블록 형상에 기초한 비디오 인코딩 및 디코딩을 위한 방법 및 장치
WO2022174660A1 (zh) 视频编解码方法、装置、计算机可读介质及电子设备
CN113207002B (zh) 视频编解码方法、装置、计算机可读介质及电子设备
WO2022166370A1 (zh) 视频编解码方法、装置、计算机程序产品、计算机可读存储介质及电子设备
WO2019219066A1 (zh) 一种编解码方法及装置
JP7483029B2 (ja) ビデオ復号方法、ビデオ符号化方法、装置、媒体、及び電子機器
WO2022174637A1 (zh) 视频编解码方法、装置、计算机可读介质及电子设备
CN114079772B (zh) 视频解码方法、装置、计算机可读介质及电子设备
WO2022116854A1 (zh) 视频解码方法、装置、可读介质、电子设备及程序产品
WO2024145851A1 (zh) 帧内模板匹配预测方法、视频编解码方法、装置和系统
US20230291922A1 (en) Encoding and decoding methods and corresponding devices
WO2023130899A1 (zh) 环路滤波方法、视频编解码方法、装置、介质及电子设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21924363

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 11/12/2023)