WO2022174475A1 - 视频编解码方法与系统、及视频编码器与视频解码器 - Google Patents

视频编解码方法与系统、及视频编码器与视频解码器 Download PDF

Info

Publication number
WO2022174475A1
WO2022174475A1 PCT/CN2021/078968 CN2021078968W WO2022174475A1 WO 2022174475 A1 WO2022174475 A1 WO 2022174475A1 CN 2021078968 W CN2021078968 W CN 2021078968W WO 2022174475 A1 WO2022174475 A1 WO 2022174475A1
Authority
WO
WIPO (PCT)
Prior art keywords
coefficient
quantizer
zero
quantization
transform
Prior art date
Application number
PCT/CN2021/078968
Other languages
English (en)
French (fr)
Inventor
黄航
王凡
袁锜超
虞露
章致好
Original Assignee
浙江大学
Oppo广东移动通信有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 浙江大学, Oppo广东移动通信有限公司 filed Critical 浙江大学
Priority to CN202180091177.5A priority Critical patent/CN116918326A/zh
Publication of WO2022174475A1 publication Critical patent/WO2022174475A1/zh

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/12Selection from among a plurality of transforms or standards, e.g. selection between discrete cosine transform [DCT] and sub-band transform or selection between H.263 and H.264
    • H04N19/122Selection of transform size, e.g. 8x8 or 2x4x8 DCT; Selection of sub-band transforms of varying structure or type

Definitions

  • the present application relates to the technical field of video encoding and decoding, and in particular, to a video encoding and decoding method and system, as well as a video encoder and a video decoder.
  • Digital video technology can be incorporated into a variety of video devices, such as digital televisions, smartphones, computers, e-readers or video players, and the like. With the development of video technology, the amount of data included in video data is relatively large. In order to facilitate the transmission of video data, video devices implement video compression technology to enable more efficient transmission or storage of video data.
  • the transform coefficients are quantized.
  • dual quantization is used to quantize the transform coefficients.
  • Dual quantization includes two quantizers. Although these two quantizers have the same quantization step size, they are different from The matching of transform coefficients is staggered. Dual quantization enables a quantizer with a large step size to complete finer quantization, thereby reducing the loss between the reconstructed transform coefficients and the original transform coefficients, thereby improving coding efficiency.
  • Embodiments of the present application provide a video encoding and decoding method and system, as well as a video encoder and a video decoder, which reduce the loss between reconstructed transform coefficients and original transform coefficients, improve encoding efficiency, and reduce encoding costs.
  • the present application provides a video encoding method, including:
  • a target quantizer is determined from N quantizers to quantize the transform coefficient to obtain a quantization coefficient, where N is a positive integer greater than or equal to 2, so At least one of the N quantizers is a non-zero quantizer that can quantize the transform coefficients into non-zero quantized coefficients;
  • the quantized coefficients are encoded to obtain a code stream.
  • an embodiment of the present application provides a video decoding method, including:
  • the quantization coefficient is obtained by quantization by one of the N quantizers, the N is a positive integer greater than or equal to 2, and the N quantizers At least one quantizer in the device is a non-zero quantizer that can quantize the transform coefficients into non-zero quantized coefficients;
  • inverse quantization is performed on the quantized coefficient to obtain a transform coefficient
  • the reconstructed block of the image block is obtained.
  • the present application provides a video encoder for performing the method in the first aspect or each of its implementations.
  • the encoder includes a functional unit for executing the method in the above-mentioned first aspect or each of its implementations.
  • the present application provides a video decoder for executing the method in the second aspect or each of its implementations.
  • the decoder includes functional units for performing the methods in the second aspect or the respective implementations thereof.
  • a video encoder including a processor and a memory.
  • the memory is used for storing a computer program
  • the processor is used for calling and running the computer program stored in the memory, so as to execute the method in the above-mentioned first aspect or each implementation manner thereof.
  • a video decoder including a processor and a memory.
  • the memory is used for storing a computer program
  • the processor is used for calling and running the computer program stored in the memory, so as to execute the method in the above-mentioned second aspect or each implementation manner thereof.
  • a video encoding and decoding system including a video encoder and a video decoder.
  • the video encoder is used to perform the method in the first aspect or each of its implementations
  • the video decoder is used to perform the method in the above-mentioned second aspect or each of its implementations.
  • a chip for implementing any one of the above-mentioned first aspect to the second aspect or the method in each implementation manner thereof.
  • the chip includes: a processor for invoking and running a computer program from a memory, so that a device on which the chip is installed executes any one of the above-mentioned first to second aspects or each of its implementations method.
  • a computer-readable storage medium for storing a computer program, the computer program causing a computer to execute the method in any one of the above-mentioned first aspect to the second aspect or each of its implementations.
  • a computer program product comprising computer program instructions, the computer program instructions causing a computer to perform the method of any one of the above-mentioned first to second aspects or implementations thereof.
  • a computer program which, when run on a computer, causes the computer to perform the method in any one of the above-mentioned first to second aspects or the respective implementations thereof.
  • a target quantizer is determined from N quantizers to quantize the transform coefficient to obtain a quantization coefficient, where N is a positive integer greater than or equal to 2, At least one of the N quantizers is a non-zero quantizer that can quantize the transform coefficients into non-zero quantized coefficients; the quantized coefficients are encoded to obtain a code stream. Since at least one of the N quantizers is a non-zero quantizer that can quantize the transform coefficients into non-zero quantization coefficients, the non-zero quantizer does not need to calculate the cost of quantizing the transform coefficients to 0, thereby reducing coding At the cost, the coding efficiency is further improved.
  • FIG. 1 is a schematic block diagram of a video encoding and decoding system 100 involved in an embodiment of the present application
  • FIG. 2 is a schematic block diagram of a video encoder 200 provided by an embodiment of the present application.
  • FIG. 3 is a schematic block diagram of a decoding framework 300 provided by an embodiment of the present application.
  • Fig. 4 is the schematic diagram that two kinds of quantizers Q0 and Q1 carry out quantization
  • FIG. 5 is a schematic diagram of state transition of a quantizer used for determining transform coefficients
  • FIG. 6 is a schematic diagram of the dependency of the grid structure representation state and transform coefficient level
  • FIG. 8 is a schematic flowchart of a video encoding method provided by an embodiment of the present application.
  • Fig. 9 is the schematic diagram of the quantizer of Q0, Q1 of the original DQ technology
  • FIG. 10 is a schematic diagram of a quantizer of Q0 and Q1 involved in the application.
  • FIG. 11 is a schematic flowchart of another video encoding method provided by an embodiment of the present application.
  • FIG. 12 is a schematic flowchart of a video decoding method provided by an embodiment of the present application.
  • FIG. 13 is a schematic diagram of coefficient coding of a scanning area involved in an embodiment of the present application.
  • FIG. 14 is a schematic block diagram of a video encoder provided by an embodiment of the present application.
  • FIG. 15 is a schematic block diagram of a video decoder provided by an embodiment of the present application.
  • 16 is a schematic block diagram of an electronic device provided by an embodiment of the present application.
  • FIG. 17 is a schematic block diagram of a video encoding and decoding system provided by an embodiment of the present application.
  • the present application can be applied to the field of image encoding and decoding, the field of video encoding and decoding, the field of hardware video encoding and decoding, the field of dedicated circuit video encoding and decoding, the field of real-time video encoding and decoding, and the like.
  • audio video coding standard audio video coding standard, AVS for short
  • H.264/audio video coding audio video coding, AVC for short
  • H.265/High Efficiency Video Coding High efficiency video coding, referred to as HEVC
  • H.266/versatile video coding versatile video coding, referred to as VVC
  • the schemes of the present application may operate in conjunction with other proprietary or industry standards including ITU-TH.261, ISO/IECMPEG-1 Visual, ITU-TH.262 or ISO/IECMPEG-2 Visual, ITU-TH.263 , ISO/IECMPEG-4Visual, ITU-TH.264 (also known as ISO/IECMPEG-4AVC), including Scalable Video Codec (SVC) and Multi-View Video Codec (MVC) extensions.
  • SVC Scalable Video Codec
  • MVC Multi-View Video Codec
  • FIG. 1 For ease of understanding, the video coding and decoding system involved in the embodiments of the present application is first introduced with reference to FIG. 1 .
  • FIG. 1 is a schematic block diagram of a video encoding and decoding system 100 according to an embodiment of the present application. It should be noted that FIG. 1 is only an example, and the video encoding and decoding systems in the embodiments of the present application include, but are not limited to, those shown in FIG. 1 .
  • the video codec system 100 includes an encoding device 110 and a decoding device 120 .
  • the encoding device is used to encode the video data (which can be understood as compression) to generate a code stream, and transmit the code stream to the decoding device.
  • the decoding device decodes the code stream encoded by the encoding device to obtain decoded video data.
  • the encoding device 110 in this embodiment of the present application may be understood as a device with a video encoding function
  • the decoding device 120 may be understood as a device with a video decoding function, that is, the encoding device 110 and the decoding device 120 in the embodiments of the present application include a wider range of devices, Examples include smartphones, desktop computers, mobile computing devices, notebook (eg, laptop) computers, tablet computers, set-top boxes, televisions, cameras, display devices, digital media players, video game consoles, in-vehicle computers, and the like.
  • the encoding device 110 may transmit the encoded video data (eg, a code stream) to the decoding device 120 via the channel 130 .
  • Channel 130 may include one or more media and/or devices capable of transmitting encoded video data from encoding device 110 to decoding device 120 .
  • channel 130 includes one or more communication media that enables encoding device 110 to transmit encoded video data directly to decoding device 120 in real-time.
  • encoding apparatus 110 may modulate the encoded video data according to a communication standard and transmit the modulated video data to decoding apparatus 120 .
  • the communication medium includes a wireless communication medium, such as a radio frequency spectrum, optionally, the communication medium may also include a wired communication medium, such as one or more physical transmission lines.
  • channel 130 includes a storage medium that can store video data encoded by encoding device 110.
  • Storage media include a variety of locally accessible data storage media such as optical discs, DVDs, flash memory, and the like.
  • the decoding apparatus 120 may obtain the encoded video data from the storage medium.
  • channel 130 may include a storage server that may store video data encoded by encoding device 110 .
  • the decoding device 120 may download the stored encoded video data from the storage server.
  • the storage server may store the encoded video data and may transmit the encoded video data to the decoding device 120, such as a web server (eg, for a website), a file transfer protocol (FTP) server, and the like.
  • FTP file transfer protocol
  • encoding apparatus 110 includes video encoder 112 and output interface 113 .
  • the output interface 113 may include a modulator/demodulator (modem) and/or a transmitter.
  • encoding device 110 may include video source 111 in addition to video encoder 112 and input interface 113 .
  • the video source 111 may include at least one of a video capture device (eg, a video camera), a video archive, a video input interface, a computer graphics system for receiving video data from a video content provider, a computer graphics system Used to generate video data.
  • a video capture device eg, a video camera
  • a video archive e.g., a video archive
  • a video input interface e.g., a video input interface
  • a computer graphics system for receiving video data from a video content provider e.g., a computer graphics system Used to generate video data.
  • the video encoder 112 encodes the video data from the video source 111 to generate a code stream.
  • Video data may include one or more pictures or a sequence of pictures.
  • the code stream contains the encoding information of the image or image sequence in the form of bit stream.
  • the encoded information may include encoded image data and associated data.
  • the associated data may include a sequence parameter set (SPS for short), a picture parameter set (PPS for short), and other syntax structures.
  • SPS sequence parameter set
  • PPS picture parameter set
  • An SPS may contain parameters that apply to one or more sequences.
  • a PPS may contain parameters that apply to one or more images.
  • a syntax structure refers to a set of zero or more syntax elements in a codestream arranged in a specified order.
  • the video encoder 112 directly transmits the encoded video data to the decoding device 120 via the output interface 113 .
  • the encoded video data may also be stored on a storage medium or a storage server for subsequent reading by the decoding device 120 .
  • decoding device 120 includes input interface 121 and video decoder 122 .
  • the decoding device 120 may include a display device 123 in addition to the input interface 121 and the video decoder 122 .
  • the input interface 121 includes a receiver and/or a modem.
  • the input interface 121 may receive the encoded video data through the channel 130 .
  • the video decoder 122 is configured to decode the encoded video data, obtain the decoded video data, and transmit the decoded video data to the display device 123 .
  • the display device 123 displays the decoded video data.
  • the display device 123 may be integrated with the decoding apparatus 120 or external to the decoding apparatus 120 .
  • the display device 123 may include various display devices, such as a liquid crystal display (LCD), a plasma display, an organic light emitting diode (OLED) display, or other types of display devices.
  • LCD liquid crystal display
  • plasma display a plasma display
  • OLED organic light emitting diode
  • FIG. 1 is only an example, and the technical solutions of the embodiments of the present application are not limited to FIG. 1 .
  • the technology of the present application may also be applied to single-side video encoding or single-side video decoding.
  • FIG. 2 is a schematic block diagram of a video encoder 200 provided by an embodiment of the present application. It should be understood that the video encoder 200 can be used to perform lossy compression on images, and can also be used to perform lossless compression on images.
  • the lossless compression may be visually lossless compression (visually lossless compression) or mathematically lossless compression (mathematically lossless compression).
  • the video encoder 200 can be applied to image data in luminance chrominance (YCbCr, YUV) format.
  • the YUV ratio can be 4:2:0, 4:2:2 or 4:4:4, Y represents the luminance (Luma), Cb(U) represents the blue chromaticity, Cr(V) represents the red chromaticity, U and V are expressed as chroma (Chroma) to describe color and saturation.
  • 4:2:0 means that every 4 pixels has 4 luma components
  • 2 chrominance components YYYYCbCr
  • 4:2:2 means that every 4 pixels has 4 luma components
  • 4 Chroma component YYYYCbCrCbCr
  • 4:4:4 means full pixel display (YYYYCbCrCbCrCbCrCbCr).
  • the video encoder 200 reads video data, and for each frame of image in the video data, divides one frame of image into several coding tree units (CTUs).
  • CTUs coding tree units
  • the CTB may be referred to as “Tree block", “Largest Coding Unit” (LCU for short) or “coding tree block” (CTB for short).
  • LCU Large Coding Unit
  • CTB coding tree block
  • Each CTU may be associated with a block of pixels of equal size within the image.
  • Each pixel may correspond to one luminance (luma) sample and two chrominance (chrominance or chroma) samples.
  • each CTU may be associated with one block of luma samples and two blocks of chroma samples.
  • the size of one CTU is, for example, 128 ⁇ 128, 64 ⁇ 64, 32 ⁇ 32, and so on.
  • a CTU can be further divided into several coding units (Coding Unit, CU) for coding, and the CU can be a rectangular block or a square block.
  • the CU can be further divided into a prediction unit (PU for short) and a transform unit (TU for short), so that coding, prediction, and transformation are separated and processing is more flexible.
  • the CTU is divided into CUs in a quadtree manner, and the CUs are divided into TUs and PUs in a quadtree manner.
  • Video encoders and video decoders may support various PU sizes. Assuming the size of a particular CU is 2Nx2N, video encoders and video decoders may support PU sizes of 2Nx2N or NxN for intra prediction, and support 2Nx2N, 2NxN, Nx2N, NxN or similar sized symmetric PUs for inter prediction. Video encoders and video decoders may also support 2NxnU, 2NxnD, nLx2N, and nRx2N asymmetric PUs for inter prediction.
  • the video encoder 200 may include: a prediction unit 210, a residual unit 220, a transform/quantization unit 230, an inverse transform/quantization unit 240, a reconstruction unit 250, a loop filtering unit 260 , a decoded image buffer 270 and an entropy encoding unit 280 . It should be noted that the video encoder 200 may include more, less or different functional components.
  • a current block may be referred to as a current coding unit (CU) or a current prediction unit (PU), or the like.
  • a prediction block may also be referred to as a predicted image block or an image prediction block, and a reconstructed image block may also be referred to as a reconstructed block or an image reconstructed image block.
  • prediction unit 210 includes an inter prediction unit 211 and an intra prediction unit 212 . Since there is a strong correlation between adjacent pixels in a frame of a video, the method of intra-frame prediction is used in video coding and decoding technology to eliminate the spatial redundancy between adjacent pixels. Due to the strong similarity between adjacent frames in the video, the inter-frame prediction method is used in the video coding and decoding technology to eliminate the temporal redundancy between adjacent frames, thereby improving the coding efficiency.
  • the inter-frame prediction unit 211 can be used for inter-frame prediction, and the inter-frame prediction can refer to image information of different frames, and the inter-frame prediction uses motion information to find a reference block from the reference frame, and generates a prediction block according to the reference block for eliminating temporal redundancy;
  • Frames used for inter-frame prediction may be P frames and/or B frames, where P frames refer to forward predicted frames, and B frames refer to bidirectional predicted frames.
  • the motion information includes the reference frame list where the reference frame is located, the reference frame index, and the motion vector.
  • the motion vector can be of whole pixel or sub-pixel. If the motion vector is sub-pixel, then it is necessary to use interpolation filtering in the reference frame to make the required sub-pixel block.
  • the reference frame found according to the motion vector is used.
  • the whole pixel or sub-pixel block is called the reference block.
  • the reference block is directly used as the prediction block, and some technologies are processed on the basis of the reference block to generate the prediction block.
  • Reprocessing to generate a prediction block on the basis of the reference block can also be understood as taking the reference block as a prediction block and then processing it on the basis of the prediction block to generate a new prediction block.
  • inter-frame prediction methods include: geometric partitioning mode (GPM) in the VVC video codec standard, and angular weighted prediction (AWP) in the AVS3 video codec standard. These two intra prediction modes have something in common in principle.
  • GPM geometric partitioning mode
  • AVS3 angular weighted prediction
  • the intra-frame prediction unit 212 only refers to the information of the same frame image, and predicts the pixel information in the current code image block, so as to eliminate the spatial redundancy.
  • Frames used for intra prediction may be I-frames.
  • the white 4 ⁇ 4 block is the current block
  • the gray pixels in the left row and upper column of the current block are the reference pixels of the current block
  • the intra prediction uses these reference pixels to predict the current block.
  • These reference pixels may already be all available, ie all already coded and decoded. Some parts may not be available. For example, if the current block is the leftmost part of the whole frame, the reference pixels on the left side of the current block are not available.
  • the lower left part of the current block has not been encoded or decoded, so the reference pixels at the lower left are also unavailable.
  • the available reference pixel or some value or some method can be used for padding, or no padding is performed.
  • the intra prediction method further includes a multiple reference line intra prediction method (multiple reference line, MRL), which can use more reference pixels to improve coding efficiency.
  • MRL multiple reference line intra prediction method
  • mode 0 is to copy the pixels above the current block to the current block in the vertical direction as the predicted value
  • mode 1 is to copy the reference pixel on the left to the current block in the horizontal direction as the predicted value
  • mode 2 (DC) is to copy A ⁇
  • the average value of the 8 points D and I to L is used as the predicted value of all points.
  • Modes 3 to 8 copy the reference pixels to the corresponding position of the current block according to a certain angle respectively. Because some positions of the current block cannot exactly correspond to the reference pixels, it may be necessary to use a weighted average of the reference pixels, or sub-pixels of the interpolated reference pixels.
  • the intra-frame prediction modes used by HEVC include Planar mode, DC and 33 angle modes, for a total of 35 prediction modes.
  • the intra-frame modes used by VVC are Planar, DC, and 65 angular modes, for a total of 67 prediction modes.
  • the intra-frame modes used by AVS3 are DC, Plane, Bilinear and 63 angle modes, a total of 66 prediction modes.
  • the intra-frame prediction will be more accurate and more in line with the demand for the development of high-definition and ultra-high-definition digital video.
  • Residual unit 220 may generate a residual block of the CU based on the pixel blocks of the CU and the prediction blocks of the PUs of the CU. For example, residual unit 220 may generate a residual block of the CU such that each sample in the residual block has a value equal to the difference between the samples in the CU's pixel block, and the CU's PU's Corresponding samples in the prediction block.
  • Transform/quantization unit 230 may quantize transform coefficients. Transform/quantization unit 230 may quantize transform coefficients associated with TUs of the CU based on quantization parameter (QP) values associated with the CU. Video encoder 200 may adjust the degree of quantization applied to transform coefficients associated with the CU by adjusting the QP value associated with the CU.
  • QP quantization parameter
  • Inverse transform/quantization unit 240 may apply inverse quantization and inverse transform, respectively, to the quantized transform coefficients to reconstruct a residual block from the quantized transform coefficients.
  • Reconstruction unit 250 may add the samples of the reconstructed residual block to corresponding samples of the one or more prediction blocks generated by prediction unit 210 to generate a reconstructed image block associated with the TU. By reconstructing the block of samples for each TU of the CU in this manner, video encoder 200 may reconstruct the block of pixels of the CU.
  • In-loop filtering unit 260 may perform deblocking filtering operations to reduce blocking artifacts for pixel blocks associated with the CU.
  • loop filtering unit 260 includes a deblocking filtering unit, a sample adaptive compensation SAO unit, an adaptive loop filtering ALF unit.
  • the decoded image buffer 270 may store the reconstructed pixel blocks.
  • Inter-prediction unit 211 may use the reference picture containing the reconstructed pixel block to perform inter-prediction on PUs of other pictures.
  • intra-prediction unit 212 may use the reconstructed pixel blocks in decoded picture buffer 270 to perform intra-prediction on other PUs in the same picture as the CU.
  • Entropy encoding unit 280 may receive the quantized transform coefficients from transform/quantization unit 230 . Entropy encoding unit 280 may perform one or more entropy encoding operations on the quantized transform coefficients to generate entropy encoded data.
  • the basic flow of video coding involved in the present application is as follows: at the coding end, the current image is divided into blocks, and for the current block, the prediction unit 210 uses intra-frame prediction or inter-frame prediction to generate a prediction block of the current block.
  • the residual unit 220 may calculate a residual block based on the predicted block and the original block of the current block, that is, the difference between the predicted block and the original block of the current block, and the residual block may also be referred to as residual information.
  • the residual block can be transformed and quantized by the transform/quantization unit 230 to remove information insensitive to human eyes, so as to eliminate visual redundancy.
  • the residual block before being transformed and quantized by the transform/quantization unit 230 may be referred to as a time-domain residual block, and the time-domain residual block after being transformed and quantized by the transform/quantization unit 230 may be referred to as a frequency residual block. or a frequency domain residual block.
  • the entropy encoding unit 280 receives the quantized transform coefficient output by the transform and quantization unit 230, and can perform entropy encoding on the quantized transform coefficient to output a code stream.
  • the entropy encoding unit 280 may eliminate character redundancy according to the target context model and the probability information of the binary code stream.
  • the video encoder performs inverse quantization and inverse transformation on the quantized transform coefficient output by the transform and quantization unit 230 to obtain a residual block of the current block, and then adds the residual block of the current block to the prediction block of the current block, Get the reconstructed block of the current block.
  • reconstructed blocks corresponding to other image blocks in the current image can be obtained, and these reconstructed blocks are spliced to obtain a reconstructed image of the current image.
  • the reconstructed image is filtered, for example, ALF is used to filter the reconstructed image to reduce the difference between the pixel value of the pixel in the reconstructed image and the original pixel value of the pixel in the current image. difference.
  • the filtered reconstructed image is stored in the decoded image buffer 270, and can be used as a reference frame for inter-frame prediction for subsequent frames.
  • the block division information determined by the coding end, and mode information or parameter information such as prediction, transformation, quantization, entropy coding, and loop filtering, etc. are carried in the code stream when necessary.
  • the decoding end determines the same block division information, prediction, transformation, quantization, entropy coding, loop filtering and other mode information or parameter information as the encoding end by analyzing the code stream and analyzing the existing information, so as to ensure the decoded image obtained by the encoding end. It is the same as the decoded image obtained by the decoder.
  • FIG. 3 is a schematic block diagram of a decoding framework 300 provided by an embodiment of the present application.
  • the video decoder 300 includes an entropy decoding unit 310 , a prediction unit 320 , an inverse quantization/transformation unit 330 , a reconstruction unit 340 , a loop filtering unit 350 , and a decoded image buffer 360 . It should be noted that the video decoder 300 may include more, less or different functional components.
  • the video decoder 300 may receive the code stream.
  • Entropy decoding unit 310 may parse the codestream to extract syntax elements from the codestream. As part of parsing the codestream, entropy decoding unit 310 may parse the entropy-encoded syntax elements in the codestream.
  • the prediction unit 320, the inverse quantization/transform unit 330, the reconstruction unit 340, and the in-loop filtering unit 350 may decode the video data according to the syntax elements extracted from the code stream, ie, generate decoded video data.
  • prediction unit 320 includes intra prediction unit 321 and inter prediction unit 322 .
  • Intra-prediction unit 321 may perform intra-prediction to generate prediction blocks for the PU. Intra-prediction unit 321 may use an intra-prediction mode to generate prediction blocks for a PU based on pixel blocks of spatially neighboring PUs. Intra-prediction unit 321 may also determine an intra-prediction mode for the PU from one or more syntax elements parsed from the codestream.
  • Inter-prediction unit 322 may construct a first reference picture list (List 0) and a second reference picture list (List 1) from the syntax elements parsed from the codestream. Furthermore, if the PU is encoded using inter-prediction, entropy decoding unit 310 may parse the motion information for the PU. Inter-prediction unit 322 may determine one or more reference blocks for the PU according to the motion information of the PU. Inter-prediction unit 322 may generate a prediction block for the PU from one or more reference blocks of the PU.
  • the inverse quantization/transform unit 330 inversely quantizes (ie, dequantizes) the transform coefficients associated with the TUs.
  • Inverse quantization/transform unit 330 may use the QP value associated with the CU of the TU to determine the degree of quantization.
  • inverse quantization/transform unit 330 may apply one or more inverse transforms to the inverse quantized transform coefficients to generate a residual block associated with the TU.
  • Reconstruction unit 340 uses the residual blocks associated with the TUs of the CU and the prediction blocks of the PUs of the CU to reconstruct the pixel blocks of the CU. For example, reconstruction unit 340 may add samples of the residual block to corresponding samples of the prediction block to reconstruct the pixel block of the CU, resulting in a reconstructed image block.
  • In-loop filtering unit 350 may perform deblocking filtering operations to reduce blocking artifacts for pixel blocks associated with the CU.
  • the loop filtering unit 350 includes a deblocking filtering unit, a sample adaptive compensation SAO unit, an adaptive loop filtering ALF unit.
  • Video decoder 300 may store the reconstructed images of the CU in decoded image buffer 360 .
  • the video decoder 300 may use the reconstructed image in the decoded image buffer 360 as a reference image for subsequent prediction, or transmit the reconstructed image to a display device for presentation.
  • the entropy decoding unit 310 can parse the code stream to obtain the prediction information, quantization coefficient matrix, etc. of the current block, and the prediction unit 320 uses intra prediction or inter prediction for the current block to generate the current block based on the prediction information.
  • the predicted block for the block The inverse quantization/transform unit 330 performs inverse quantization and inverse transformation on the quantized coefficient matrix using the quantized coefficient matrix obtained from the code stream to obtain a residual block.
  • the reconstruction unit 340 adds the prediction block and the residual block to obtain a reconstructed block.
  • the reconstructed blocks form a reconstructed image
  • the loop filtering unit 350 performs loop filtering on the reconstructed image based on the image or based on the block to obtain a decoded image.
  • the decoded image may also be referred to as a reconstructed image.
  • the reconstructed image may be displayed by a display device, and on the other hand, the reconstructed image may be stored in the decoded image buffer 360 to serve as a reference frame for inter-frame prediction for subsequent frames.
  • the above is the basic process of the video codec under the block-based hybrid coding framework. With the development of technology, some modules or steps of the framework or process may be optimized. This application is applicable to the block-based hybrid coding framework.
  • the basic process of the video codec but not limited to the framework and process.
  • Dual Quantization (Dependent Quantization, DQ) is a quantization method defined in VVC. Dual quantization acts on the transformed block. Different from traditional quantization, dual quantization includes two quantizers. Although these two quantizers have the same quantization step size, the matching with the transform coefficients is interleaved. of.
  • FIG. 4 is a schematic diagram of the dual quantization quantizer Q0 and the quantizer Q1 matching the transform coefficients.
  • the quantizer Q0 matches an even multiple of the quantization step size ⁇ and the transform coefficient level (ie, the numbers corresponding to points A and B), and the quantizer Q1 matches an odd multiple of the quantization step size ⁇ and the transform coefficient level (ie, C, D). point the corresponding number).
  • dependent quantization enables the quantizer with large step size to complete finer quantization, reducing the difference between the reconstructed transform coefficients and the original transform coefficients. loss, thereby improving coding efficiency.
  • quantization can be performed using the two quantizers Q0, Q1 described in FIG. 4, and the quantization methods of these two quantizers are similar to the conventional quantizer (quantization in HEVC).
  • the reconstruction coefficients of the two quantizers can be represented by the quantization step size ⁇ , and the reconstruction coefficients of the two quantizers are defined as follows:
  • the reconstruction level of the quantizer is an even multiple of the quantization step size ⁇ .
  • the reconstructed transform coefficient t' can be calculated according to the following formula (1),
  • k represents the associated transform coefficient level described in FIG. 4 .
  • the reconstruction level of the quantizer is an odd or zero-fold quantization step size ⁇ .
  • the reconstructed transform coefficient t' can be calculated according to the following formula (2),
  • sgn( ) represents the symbolic function
  • Quantization using Q0 or Q1 is not controlled by encoding flags. Instead, the parity of the transform coefficient level of the previous coefficient in coefficient scan order (the transform coefficient level described in Figure 4) is used to decide whether the current transform coefficient uses Q0 or Q1.
  • FIG. 5 is a schematic diagram of the state transition of the quantizer used to determine the transform coefficients, (a) using a state machine to determine the use of the quantizer, and (b) a state transition table.
  • the reconstructed value of the current coefficient can determine the state of the next coefficient through the transition method shown in FIG. For example, when the state of the current coefficient is 2 and the current transform coefficient level is 5, since 5 is an odd number, it is determined that the state of the next coefficient is jumped to state 3.
  • the state of the first coefficient in scan order of each transform block is set to the initial state 0.
  • Status 0, 1, 2, and 3 also determine which quantizer is used for the current coefficient. Status 0, 1 corresponds to using quantizer Q0, and status 2, 3 corresponds to using quantizer Q1.
  • the encoder's decision on dual quantization is similar to the implementation of rate-distortion optimized quantization (RDOQ), and the value of the transform coefficient level ⁇ q k ⁇ is minimized as follows: a process of cost,
  • t k and q k represent the original transform coefficient and transform coefficient level, respectively
  • %) represents the reconstructed transform coefficient value at the current transform coefficient level q k
  • %) represents the estimated number of bits consumed by encoding q k .
  • FIG. 6 is a schematic diagram showing the dependency of states and transform coefficient levels in a trellis structure, with the coding order from left to right.
  • the dependencies between the quantizer and the transform coefficient levels can be represented as a trellis diagram as shown in Figure 6, with the four states in each column representing the possible four states of the current coefficient , each node is connected to a possible two state nodes of the next coefficient in coding order.
  • the current quantizer can be used to quantize the corresponding transform coefficient level.
  • the encoder can choose to use an odd-numbered transform coefficient level or an even-numbered transform coefficient level.
  • the odd-numbered transform coefficients The levels correspond to B (Q0 with parity 1) and D (Q1 with parity 1) in Figure 6, and the even-numbered transform coefficient levels correspond to A (Q0 with parity 0) and C (Q1 with parity 0).
  • the transform coefficient level q k It can be determined by finding a route with the minimum cost sum, and determining the minimum cost sum can be achieved by the Viterbi algorithm.
  • Step 1 find 4 candidate transform coefficient levels from Q0 and Q1 corresponding to the original transform coefficients, as shown in Figure 7;
  • Step 2 using the Viterbi algorithm to determine the transform coefficient levels q k of a series of current nodes by using the estimated rate-distortion sum (the cost synthesis corresponding to the transform coefficient levels determined by the previous nodes).
  • both quantizers in the existing DQ technology can try to quantize the transform coefficients to 0.
  • both quantizers need to calculate the cost of quantizing the transform coefficients to 0, and add them to the state.
  • the decision candidates for jumping a certain complexity will be introduced, and the coding cost will be high.
  • At least one of the N quantizers in the present application is a non-zero quantizer, and the non-zero quantizer does not need to calculate the cost of quantizing the transform coefficient to 0, thereby reducing the coding complexity and cost.
  • the encoding end will be introduced below with reference to FIG. 8 .
  • FIG. 8 is a schematic flowchart of a video encoding method provided by an embodiment of the present application, and the embodiment of the present application is applied to the video encoder shown in FIG. 1 and FIG. 2 .
  • the method of the embodiment of the present application includes:
  • each transform coefficient in the at least one transform coefficient determines a target quantizer from the N quantizers to quantize the transform coefficient to obtain a quantization coefficient, where N is a positive integer greater than or equal to 2, and N quantizers At least one of the quantizers is a non-zero quantizer that can quantize the transform coefficients into non-zero quantized coefficients;
  • the quantized coefficients of the present application may also be referred to as current coefficients, or quantized coefficients, or coefficients to be encoded.
  • the video encoder receives a video stream, which consists of a series of image frames, and performs video encoding for each frame of image in the video stream.
  • a video stream which consists of a series of image frames
  • this application uses a frame of image currently to be encoded Record as the current image.
  • the video encoder divides the current image into one or more image blocks to be encoded, and for each image block to be encoded, the prediction unit 210 in the video encoder uses inter-frame prediction, intra-frame prediction After the prediction block of the image block to be encoded is generated, the prediction block is sent to the residual unit 220, which can be understood as a summer, including one or more components that perform a subtraction operation.
  • the residual unit 220 subtracts the prediction block from the image block to be encoded to form a residual block, and sends the residual block to the transform and quantization unit 230 .
  • the transform and quantization unit 230 transforms the residual block using, for example, discrete cosine transform (DCT) or the like, to obtain transform coefficients.
  • DCT discrete cosine transform
  • the transform and quantization unit 230 further quantizes the transform coefficients to obtain quantized transform coefficients.
  • the transform and quantization unit 230 forwards the quantized transform coefficients to the entropy encoding unit 280 .
  • the entropy encoding unit 280 entropy encodes the quantized transform coefficients.
  • entropy encoding unit 280 may perform context adaptive variable length coding (CAVLC), context adaptive binary arithmetic coding (CABAC), syntax-based context adaptive binary arithmetic coding (SBAC), probability interval partitioning entropy (PIPE) ) coding and other coding methods, entropy coding is performed on the quantized transform coefficients to obtain a code stream.
  • CAVLC context adaptive variable length coding
  • CABAC context adaptive binary arithmetic coding
  • SBAC syntax-based context adaptive binary arithmetic coding
  • PIPE probability interval partitioning entropy
  • This application is mainly aimed at the above-mentioned quantification process.
  • the design of DQ in VVC mainly includes three parts
  • This application mainly proposes new methods for the first part and the third part in the DQ design. These include the use of a new interleaved quantizer, as well as a new method of encoding coefficients. There is no specific limitation on the state transition method of the second part.
  • the present application first proposes that a quantizer can quantize the transformed coefficients.
  • the present application may quantize non-transform skip coefficients.
  • At least one of the N quantizers in the present application is a non-zero quantizer that can quantize all transform coefficients into non-zero quantized coefficients, where N is a positive integer greater than or equal to 2.
  • At least one of the N quantizers is a zero-point quantizer that can quantize transform coefficients to zero.
  • the N quantizers include one zero-point quantizer and one non-zero quantizer.
  • FIG. 9 is a schematic diagram of the quantizers of Q0 and Q1 of the original DQ technology.
  • the N quantizers include a Q0 quantizer and a Q1 quantizer.
  • the Q0 quantizer has not changed, while the Q1 quantizer has removed the point quantized to 0, that is, the Q1 quantizer can only quantize the coefficients into non-zero coefficients, where Q0 is a zero-point quantizer, and Q1 is a non-zero quantizer.
  • the non-zero quantizer may also be Q0, that is, the Q0 quantizer has no zeros, but the Q1 quantizer has zeros.
  • both quantizers have no zeros, that is, Q0 and Q1 are both zero-point quantizers.
  • the number of quantizers may be further expanded, and may be two or more than two quantizers.
  • the zero-point quantizer among the N quantizers may be any one of them, or may be any of them.
  • a target quantizer is determined from the N quantizers to quantize the transform coefficients to obtain quantized coefficients, including the following steps S805-A1 and S805-A2:
  • S805-A2 use the target quantizer to quantize the transform coefficient to obtain the quantized coefficient.
  • the encoder will determine the target quantizer used in the current quantization process according to the current state of the state machine. For a non-zero quantizer, it will no longer be able to quantize the coefficients to zero when trying to quantize.
  • the current state of the state machine may be referred to as the current state of the quantized coefficients.
  • the initial state of the state machine is included in the codestream.
  • the initial state of a state machine is 0.
  • a non-zero quantizer identifier is included in the code stream, and the non-zero quantizer identifier is used to identify whether the target quantizer is a non-zero quantizer.
  • coefficient non-zero flag bit is used to indicate whether the quantization coefficient is zero, in some embodiments, if the value of the coefficient non-zero flag bit is '0 ' indicates that the current coefficient is '0'; a value of '1' indicates that the current coefficient is a non-zero coefficient.
  • the absolute value of the coefficient is greater than 1 flag coeff_abs_level_greater1_flag, the value of coeff_abs_level_greater1_flag is '0', indicating that the absolute value of the current coefficient is '1'; the value of '1' indicates that the absolute value of the current coefficient is greater than 1.
  • the absolute value of the coefficient is greater than 2 flag coeff_abs_level_greater2_flag, the value of coeff_abs_level_greater2_flag is '0', indicating that the absolute value of the current coefficient is '2'; the value of '1' indicates that the absolute value of the current coefficient is greater than 2.
  • the coefficient absolute value remaining value coeff_abs_level_remaining if the current coefficient has a coefficient absolute value remaining value, the absolute value of the current coefficient is 3+coeff_abs_level_remaining.
  • the coding of the coefficients quantized by the zero-point quantizer remains unchanged according to the existing coding methods of coefficients.
  • the present application proposes a new coefficient coding method as follows. Because the encoder knows that the absolute value of the minimum value of the data quantized by the non-zero quantizer is 1, that is to say, all coefficients quantized by the non-zero quantizer are non-zero values, so the coefficients quantized by the non-zero quantizer do not need to encode non-zero quantizers. Zero flag sig_flag, thus saving codewords.
  • the current coding block of the present application is subjected to the prediction part, or by inter-frame prediction, or by means of intra-frame prediction, etc., to obtain the current prediction block by predicting the current block.
  • the prediction part Take the image block at the corresponding position of the original image and the coordinates of the current prediction block, and make a difference with the current prediction block to obtain the residual block of the current coding unit.
  • two-dimensional transformation is performed on the residual block or no transformation is performed, and a transformed block containing transformed coefficients or a non-transformed coefficient block can be obtained, which are collectively referred to as coefficient blocks here.
  • This block of coefficients is then quantized.
  • the coefficients obtained by quantization are non-zero coefficients; when a zero-point quantizer, such as quantizer 0, is used, the coefficients obtained by quantization may have zero coefficients or non-zero coefficients.
  • the coefficient-related flag bits are written in the coefficient scanning order.
  • the quantized coefficients are located in the lower left corner of the coefficient scanning area and are the only non-zero coefficients for the current row, or the quantized coefficients are located in the upper right corner of the coefficient scanning area and are the only non-zero coefficients in the current column, or
  • the target quantizer is a non-zero quantizer
  • the code stream does not include a coefficient non-zero flag bit, and the coefficient non-zero flag bit is used to indicate whether the quantization coefficient is zero.
  • the position of the currently coded coefficient ie, the quantized coefficient
  • the position of the currently coded coefficient is in the lower left corner of the coefficient scanning area and is the only non-zero coefficient in the current row, or whether the position of the currently coded coefficient is in the upper right corner of the coefficient scanning area and It is the only non-zero coefficient for the current column, or it is judged whether a non-zero quantizer is used according to the state of the state machine in which the currently encoded coefficient is located. If any one of the conditions is met, there is no need to encode sig_flag (coefficient non-zero flag). If not, write the sig_flag of the current coefficient into the code stream. Then other flag bits related to the current coefficient are written according to the original scheme of the encoder.
  • sig_flag coefficient non-zero flag
  • the value of the coefficient non-zero flag bit is the second value.
  • the second value is 1.
  • the state of the state machine is updated according to the current state of the state machine and the magnitude of the absolute value of the currently encoded coefficients, and then begins to encode the next coefficient until the entire coefficient block is encoded.
  • state represents the state of the current state machine
  • nz_quantizer_flag represents a non-zero quantizer flag, which is used to identify whether the target quantizer is a non-zero quantizer, or whether the quantizer corresponding to the current state is a non-zero quantizer.
  • device The value of nz_quantizer(state) can be obtained using Table 2 below.
  • update_state(abs_coef[blkpos]) indicates that the state of the state machine is updated according to the absolute value of the current coefficient, and there is no specific limitation on the specific state machine update scheme, for example, the jump scheme in FIG. 5 may be adopted.
  • the coefficients using a non-zero quantizer are encoded in a manner of subtracting one from the original value during encoding.
  • the parsed value in the code stream is added by one.
  • the above S805 includes steps as shown in FIG. 11 .
  • FIG. 11 is a schematic flowchart of another video encoding method provided by an embodiment of the present application. As shown in FIG. 11 , the foregoing S805 includes:
  • the current coded block is predicted by the prediction part, or by inter-frame prediction, or by means of intra-frame prediction, etc., to obtain the current prediction block.
  • the prediction part Take the image block at the corresponding position of the original image and the coordinates of the current prediction block, and make a difference with the current prediction block to obtain the residual block of the current coding unit.
  • two-dimensional transformation is performed on the residual block or no transformation is performed, and a transformed block containing transformed coefficients or a non-transformed coefficient block can be obtained, which are collectively referred to as coefficient blocks herein.
  • This block of coefficients is then quantized.
  • the coefficients obtained by quantization are non-zero coefficients; when a zero-point quantizer, such as quantizer 0, is used, the coefficients obtained by quantization may have zero coefficients or non-zero coefficients.
  • the coefficient-related flag bits are written in the coefficient scanning order.
  • the position of the quantized coefficient is in the lower left corner of the coefficient scanning area and is the only non-zero coefficient of the current row, or the position of the quantized coefficient is in the upper right corner of the coefficient scanning area and is the only non-zero coefficient in the current column, or the target quantization
  • the coefficient non-zero flag bit is not included in the code stream, and the coefficient non-zero flag bit is used to indicate whether the quantization coefficient is zero.
  • first determine whether the position of the currently coded coefficient (such as a quantized coefficient) is in the lower left corner of the coefficient scanning area and is the only non-zero coefficient in the current row, or whether the position of the currently coded coefficient is in the upper right corner of the coefficient scanning area and It is the only non-zero coefficient for the current column, or it is judged whether a non-zero quantizer is used according to the state of the state machine in which the currently encoded coefficient is located. If any one of these conditions is met, there is no need to encode sig_flag. If not, write the sig_flag of the current coefficient into the code stream.
  • the position of the currently coded coefficient such as a quantized coefficient
  • a non-zero quantizer that is, whether the target quantizer is a non-zero quantizer. If a non-zero quantizer is used, subtract one from the current coefficient. quantizer, no changes are made. Then other flag bits related to the current coefficient are written according to the original scheme of the encoder.
  • the state of the state machine is updated according to the current state of the state machine and the absolute value of the current coding coefficient, and then the coding of the next coefficient is started until the coding of the entire coefficient block is completed.
  • the technical solution of the present application improves the original quantizer.
  • it can be judged whether the current coefficient must be a non-zero coefficient according to which quantizer in the dual quantization used by the current coefficient, and skip the coefficient according to the information.
  • the non-zero coefficient flag bits are encoded, thereby saving codewords and improving the efficiency of the encoder. Or according to the information, reduce the coefficient value into the code stream to save the code word.
  • the video encoding method involved in the embodiments of the present application is described above. Based on this, the following describes the video decoding method involved in the present application for the decoding end.
  • FIG. 12 is a schematic flowchart of a video decoding method provided by an embodiment of the present application. As shown in FIG. 12 , the method of the embodiment of the present application includes:
  • the quantization coefficient is obtained through quantization by one of the N quantizers, where N is a positive integer greater than or equal to 2, and at least one of the N quantizers has A quantizer is a non-zero quantizer that can quantize the transform coefficients into non-zero quantized coefficients;
  • the entropy decoding unit 310 in the decoder can parse the code stream to obtain prediction information, quantization coefficient matrix, etc. of the current block in the current image, and the prediction unit 320 uses intra prediction or Inter prediction produces a predicted block for the current block.
  • the inverse quantization/transform unit 330 performs inverse quantization and inverse transformation on the quantized coefficient matrix using the quantized coefficient matrix obtained from the code stream to obtain a residual block.
  • the reconstruction unit 340 adds the prediction block and the residual block to obtain a reconstructed block.
  • the reconstructed blocks of other image blocks in the current image can be obtained, and each reconstructed block constitutes a reconstructed image.
  • the quantization coefficient of the present application is obtained by quantizing one of the N quantizers, where N is a positive integer greater than or equal to 2, and at least one of the N quantizers can quantize the transform coefficients into A non-zero quantizer for non-zero quantized coefficients.
  • performing inverse quantization on the quantized coefficients in the above S902 to obtain transform coefficients including the following steps:
  • S902-A1 determine the value of the non-zero flag bit of the quantization coefficient
  • S902-A3 Perform inverse quantization on the quantization coefficient according to the value of the non-zero flag bit of the quantization coefficient and the absolute value of the quantization coefficient to obtain the transform coefficient.
  • determining the value of the non-zero flag bit of the quantized coefficient in the above S902-A1 includes: if the quantized coefficient is in the lower left corner of the coefficient scanning area and is the only non-zero coefficient of the current row, or the quantized coefficient is If the coefficient is in the upper right corner of the coefficient scanning area and is the only non-zero coefficient in the current column, or it is determined that the quantized coefficient is obtained by using a non-zero quantizer according to the current state of the state machine, the non-zero coefficient of the quantized coefficient is determined.
  • the value of the flag bit is a second value, and the second value is used to indicate that the quantization coefficient is a non-zero value.
  • the second value is 1.
  • the decoding end obtains the code stream information and parses the identification bit of the current encoding block.
  • the coefficient scanning area is determined, and the coefficient scanning area is a rectangular area with the position (0, 0) as the upper left corner and the position (SRx, SRy) as the lower right corner.
  • a schematic diagram of coefficient coding based on this scanning area is shown in Figure 13, where 0 represents a zero coefficient and 1 represents a non-zero coefficient.
  • the coefficient decoding order is a reverse zigzag scan from the lower right corner to the upper left corner (can also be used for any other form of scanning, such as horizontal scanning, vertical scanning, diagonal scanning, etc.).
  • the decoder determines the position of the current decoding coefficient, it first determines whether the position of the current coefficient (such as the quantization coefficient) is in the lower left corner of the coefficient scanning area and is the only non-zero coefficient of the current row, or whether the position of the currently encoded coefficient is in the coefficient scanning area.
  • the upper right corner of the area is the only non-zero coefficient of the current column, or it is determined whether a non-zero quantizer is used according to the state of the state machine where the currently encoded coefficient is located. If any of these conditions are met, the sig_flag of the current coefficient is directly set to one. Then, the next bin parsed from the code stream is the coeff_abs_level_greater1_flag of the current coefficient.
  • coefficient coding According to the default scheme of coefficient coding, continue to parse the relevant flags to determine the absolute value of the current coefficient, including flags such as coeff_abs_level_greater2_flag, coeff_abs_level_remaining, etc. The coefficient value of will not be zero.
  • the next bin parsed from the code stream is the sig_flag of the current coefficient.
  • sig_flag it is judged whether the current coefficient is a non-zero coefficient. If it is a non-zero coefficient, continue to parse the relevant flag bits according to the default scheme. Determine the absolute value of the current coefficient, including flag bits such as coeff_abs_level_greater1_flag, coeff_abs_level_greater2_flag, and coeff_abs_level_remaining. If the current coefficient is not a non-zero coefficient, the value of the current coefficient is 0.
  • the present application further includes: according to the current state of the state machine, determining whether the quantizer used for quantizing the quantization coefficient is a non-zero quantizer, specifically referring to the above shown in FIG. 5 .
  • the above S902-A3 includes the following steps:
  • S902-A32 Obtain the transform coefficient according to the value of the non-zero flag bit of the quantization coefficient and the summed absolute value of the quantization coefficient.
  • the first value is 1.
  • the decoding end obtains the code stream information and parses the identification bit of the current encoding block.
  • the coefficient scanning area is determined, and the coefficient scanning area is a rectangular area with the position (0, 0) as the upper left corner and the position (SRx, SRy) as the lower right corner.
  • a schematic diagram of coefficient coding based on this scanning area is shown in Figure 13, where 0 represents a zero coefficient and 1 represents a non-zero coefficient.
  • the coefficient decoding order is a reverse zigzag scan from the lower right corner to the upper left corner (can also be used for any other form of scanning, such as horizontal scanning, vertical scanning, diagonal scanning, etc.).
  • the decoder determines the position of the current decoding coefficient, it first determines whether the position of the current coefficient (such as the quantization coefficient) is in the lower left corner of the coefficient scanning area and is the only non-zero coefficient of the current row, or whether the position of the currently encoded coefficient is in the coefficient scanning area.
  • the upper right corner of the area is the only non-zero coefficient of the current column, or it is determined whether a non-zero quantizer is used according to the state of the state machine where the currently encoded coefficient is located. If any of these conditions are met, the sig_flag of the current coefficient is directly set to one, and the next bin parsed from the code stream is the coeff_abs_level_greater1_flag of the current coefficient.
  • coefficient coding continue to parse the relevant flag bits to determine the absolute value of the current coefficient. , including coeff_abs_level_greater2_flag, coeff_abs_level_remaining and other flags, and finally parse the sign flag to determine the positive or negative of the current coefficient.
  • the next bin parsed from the code stream is the sig_flag of the current coefficient.
  • sig_flag it is judged whether the current coefficient is a non-zero coefficient. If it is a non-zero coefficient, continue to parse the relevant flag bits according to the default scheme. Determine the absolute value of the current coefficient, including flag bits such as coeff_abs_level_greater1_flag, coeff_abs_level_greater2_flag, and coeff_abs_level_remaining. If the current coefficient is not a non-zero coefficient, the value of the current coefficient is 0.
  • the present application also proposes a solution without modifying the original syntax elements and semantics. Instead, when a non-zero quantizer is used, a Pmps probability model with a fixed maximum probability is used for the non-zero coefficient flag bit sig_flag to perform entropy coding. Therefore, for quantized coefficients using a non-zero quantizer, when decoding or encoding the non-zero coefficient flag bit, the context probability model is not updated.
  • FIG. 8 to FIG. 13 are only examples of the present application, and should not be construed as a limitation of the present application.
  • the size of the sequence numbers of the above-mentioned processes does not mean the sequence of execution, and the execution sequence of each process should be determined by its functions and internal logic, and should not be dealt with in the present application.
  • the implementation of the embodiments constitutes no limitation.
  • the term "and/or" is only an association relationship for describing associated objects, indicating that there may be three kinds of relationships. Specifically, A and/or B can represent three situations: A exists alone, A and B exist at the same time, and B exists alone.
  • the character "/" in this document generally indicates that the related objects are an "or" relationship.
  • FIG. 14 is a schematic block diagram of a video encoder provided by an embodiment of the present application.
  • the video encoder 10 includes:
  • Obtaining unit 11 for obtaining the image block to be encoded
  • a prediction unit 12 configured to predict the image block to obtain a prediction block of the image block
  • a residual unit 13 configured to obtain a residual block of the image block according to the image block and the prediction block;
  • a transform unit 14 configured to transform the residual block to obtain at least one transform coefficient
  • the quantization unit 15 is configured to, for each transform coefficient in the at least one transform coefficient, determine a target quantizer from N quantizers to quantize the transform coefficient to obtain a quantization coefficient, where N is greater than or equal to a positive integer of 2, at least one of the N quantizers is a non-zero quantizer that can quantize the transform coefficients into non-zero quantized coefficients;
  • the encoding unit 16 is configured to encode the quantized coefficients to obtain a code stream.
  • At least one of the N quantizers is a zero-point quantizer capable of quantizing the transform coefficients to zero.
  • the N quantizers include one zero-point quantizer and one non-zero quantizer.
  • the quantization unit 15 is specifically configured to determine the target quantizer from the N quantizers according to the state of the current state machine; use the target quantizer to quantize the transform coefficient , to obtain the quantized coefficients.
  • the code stream includes an initial state of the state machine.
  • the initial state of the state machine is zero.
  • the code stream includes a non-zero quantizer identifier, and the non-zero quantizer identifier is used to identify whether the target quantizer is a non-zero quantizer.
  • the quantization unit 15 is specifically configured to determine the target quantizer from the N quantizers according to the current state of the state machine corresponding to the transform coefficient; if the target quantizer is If a non-zero quantizer is used, the target quantizer is used to quantize the transform coefficient to obtain an initial quantized value; the first value is subtracted from the initial quantized value to obtain the quantized coefficient.
  • the first value is a positive integer of 1.
  • the position of the quantized coefficient is in the lower left corner of the coefficient scanning area and is the only non-zero coefficient in the current row, or the position of the quantized coefficient is in the upper right corner of the coefficient scanning area and is the only non-zero coefficient in the current column , or when the target quantizer is a non-zero quantizer, the code stream does not include a coefficient non-zero flag bit, and the coefficient non-zero flag bit is used to indicate whether the quantization coefficient is zero.
  • the value of the coefficient non-zero flag bit is a second value.
  • the second value is 1.
  • the encoding unit 16 is further configured to update the state of the state machine according to the current state of the state machine and the absolute value of the quantization coefficient.
  • the apparatus embodiments and the method embodiments may correspond to each other, and similar descriptions may refer to the method embodiments. To avoid repetition, details are not repeated here.
  • the video encoder 10 shown in FIG. 14 can execute the methods of the embodiments of the present application, and the aforementioned and other operations and/or functions of the various units in the video encoder 10 are for the purpose of realizing the corresponding processes in the methods, such as the method, respectively. , and are not repeated here for brevity.
  • FIG. 15 is a schematic block diagram of a video decoder provided by an embodiment of the present application.
  • the video decoder 20 may include:
  • the decoding unit 21 is configured to decode the code stream to obtain at least one quantized coefficient of the image block to be decoded, and the quantized coefficient is obtained through quantization by one of the N quantizers, where N is a positive integer greater than or equal to 2 , at least one of the N quantizers is a non-zero quantizer that can quantize the transform coefficients into non-zero quantized coefficients;
  • an inverse quantization unit 22 for performing inverse quantization on the quantized coefficients for each quantized coefficient in the at least one quantized coefficient to obtain a transform coefficient
  • an inverse transform unit 23 configured to perform inverse transform on the transform coefficient to obtain a residual block of the image block
  • a prediction unit 24 configured to determine a prediction block of the image block
  • the reconstruction unit 25 is configured to obtain the reconstructed block of the image block according to the prediction block and the residual block of the image block.
  • the inverse quantization unit 22 is specifically configured to determine the value of the non-zero flag bit of the quantization coefficient
  • the inverse quantization unit 22 is specifically configured to: if the quantized coefficient is in the lower left corner of the coefficient scanning area and is the only non-zero coefficient in the current row, or if the quantized coefficient is in the upper right corner of the coefficient scanning area and is the only non-zero coefficient in the current column, or it is determined according to the current state of the state machine that the quantized coefficient is obtained by quantization using a non-zero quantizer, then it is determined that the value of the non-zero flag bit of the quantized coefficient is the second value, and the The second value is used to indicate that the quantization coefficient is a non-zero value.
  • the second value is 1.
  • the inverse quantization unit 22 is specifically configured to determine whether the quantizer used for quantizing the quantization coefficient is a non-zero quantizer according to the current state of the state machine;
  • the device is a non-zero quantizer, summing the absolute value of the quantization coefficient and the first value; according to the value of the non-zero flag bit of the quantization coefficient and the absolute value of the quantization coefficient after the summation, the obtained the transformation coefficients.
  • the first value is 1.
  • the inverse quantization unit 22 is further configured to update the state of the state machine according to the current state of the state machine and the absolute value of the quantization coefficient.
  • the apparatus embodiments and the method embodiments may correspond to each other, and similar descriptions may refer to the method embodiments. To avoid repetition, details are not repeated here.
  • the video decoder 20 shown in FIG. 15 may correspond to the corresponding subject in executing the method of the embodiments of the present application, and the aforementioned and other operations and/or functions of each unit in the video decoder 20 are for the purpose of implementing the method, etc. For the sake of brevity, the corresponding processes in each method will not be repeated here.
  • the functional unit may be implemented in the form of hardware, may also be implemented by an instruction in the form of software, or may be implemented by a combination of hardware and software units.
  • the steps of the method embodiments in the embodiments of the present application may be completed by hardware integrated logic circuits in the processor and/or instructions in the form of software, and the steps of the methods disclosed in conjunction with the embodiments of the present application may be directly embodied as hardware
  • the execution of the decoding processor is completed, or the execution is completed by a combination of hardware and software units in the decoding processor.
  • the software unit may be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, and other storage media that are well known in the art.
  • the storage medium is located in the memory, and the processor reads the information in the memory, and completes the steps in the above method embodiments in combination with its hardware.
  • FIG. 16 is a schematic block diagram of an electronic device 30 provided by an embodiment of the present application.
  • the electronic device 30 may be the video encoder or the video decoder described in this embodiment of the application, and the electronic device 30 may include:
  • the processor 32 can call and run the computer program 34 from the memory 33 to implement the methods in the embodiments of the present application.
  • the processor 32 may be adapted to perform the steps of the above-described methods according to instructions in the computer program 34 .
  • the processor 32 may include, but is not limited to:
  • DSP Digital Signal Processor
  • ASIC Application Specific Integrated Circuit
  • FPGA Field Programmable Gate Array
  • the memory 33 includes but is not limited to:
  • Non-volatile memory may be a read-only memory (Read-Only Memory, ROM), a programmable read-only memory (Programmable ROM, PROM), an erasable programmable read-only memory (Erasable PROM, EPROM), an electrically programmable read-only memory (Erasable PROM, EPROM). Erase programmable read-only memory (Electrically EPROM, EEPROM) or flash memory. Volatile memory may be Random Access Memory (RAM), which acts as an external cache.
  • RAM Random Access Memory
  • RAM Static RAM
  • DRAM Dynamic RAM
  • SDRAM Synchronous DRAM
  • SDRAM double data rate synchronous dynamic random access memory
  • Double Data Rate SDRAM DDR SDRAM
  • enhanced SDRAM ESDRAM
  • synchronous link dynamic random access memory SLDRAM
  • Direct Rambus RAM Direct Rambus RAM
  • the computer program 34 may be divided into one or more units, and the one or more units are stored in the memory 33 and executed by the processor 32 to complete the procedures provided by the present application.
  • the one or more units may be a series of computer program instruction segments capable of performing specific functions, and the instruction segments are used to describe the execution process of the computer program 34 in the electronic device 30 .
  • the electronic device 30 may further include:
  • a transceiver 33 which can be connected to the processor 32 or the memory 33 .
  • the processor 32 can control the transceiver 33 to communicate with other devices, specifically, can send information or data to other devices, or receive information or data sent by other devices.
  • the transceiver 33 may include a transmitter and a receiver.
  • the transceiver 33 may further include antennas, and the number of the antennas may be one or more.
  • each component in the electronic device 30 is connected through a bus system, wherein the bus system includes a power bus, a control bus and a status signal bus in addition to a data bus.
  • FIG. 17 is a schematic block diagram of a video coding and decoding system 40 provided by an embodiment of the present application.
  • the video encoding and decoding system 40 may include: a video encoder 41 and a video decoder 42 , wherein the video encoder 41 is used to perform the video encoding method involved in the embodiments of the present application, and the video decoder 42 is used to perform The video decoding method involved in the embodiments of the present application.
  • the present application also provides a computer storage medium on which a computer program is stored, and when the computer program is executed by a computer, enables the computer to execute the methods of the above method embodiments.
  • the embodiments of the present application further provide a computer program product including instructions, when the instructions are executed by a computer, the instructions cause the computer to execute the methods of the above method embodiments.
  • the computer program product includes one or more computer instructions.
  • the computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable device.
  • the computer instructions may be stored on or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions may be transmitted over a wire from a website site, computer, server or data center (eg coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (eg infrared, wireless, microwave, etc.) means to another website site, computer, server or data center.
  • the computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that includes one or more available media integrated.
  • the available media may be magnetic media (eg, floppy disk, hard disk, magnetic tape), optical media (eg, digital video disc (DVD)), or semiconductor media (eg, solid state disk (SSD)), and the like.
  • the disclosed system, apparatus and method may be implemented in other manners.
  • the apparatus embodiments described above are only illustrative.
  • the division of the unit is only a logical function division.
  • there may be other division methods for example, multiple units or components may be combined or Integration into another system, or some features can be ignored, or not implemented.
  • the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
  • Units described as separate components may or may not be physically separated, and components shown as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.

Landscapes

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

Abstract

本申请实施例提供一种视频编解码方法与系统、及视频编码器与视频解码器,在视频编码过程中,针对每个变换系数,从N个量化器中确定一个目标量化器对所述变换系数进行量化,得到量化系数,所述N为大于或等于2的正整数,所述N个量化器中至少有一个量化器为可以将所述变换系数均量化为非零量化系数的非零量化器;对所述量化系数进行编码,得到码流。由于N个量化器中至少有一个量化器为可以将所述变换系数均量化为非零量化系数的非零量化器,而该非零量化器不需要计算变换系数量化成0的代价,进而降低了编码代价,进一步提高编码效率。

Description

视频编解码方法与系统、及视频编码器与视频解码器
本申请要求于2021年02月22日提交中国专利局、申请号为202110200043.4、申请名称为“视频编解码方法与系统、及视频编码器与视频解码器”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及视频编解码技术领域,尤其涉及一种视频编解码方法与系统、及视频编码器与视频解码器。
背景技术
数字视频技术可以并入多种视频装置中,例如数字电视、智能手机、计算机、电子阅读器或视频播放器等。随着视频技术的发展,视频数据所包括的数据量较大,为了便于视频数据的传输,视频装置执行视频压缩技术,以使视频数据更加有效的传输或存储。
在视频压缩过程中为了便于编码,对变换系数进行量化,例如使用对偶量化对变换系数进行量化,对偶量化共包含了两个量化器,这两个量化器虽然有着相同的量化步长,但与变换系数的匹配却是交错的。对偶量化使得大步长的量化器能够完成更精细的量化,达到减小了重建的变换系数与原始变换系数之间的损失,从而提高编码效率。
但是,对偶量化的编码代价大。
发明内容
本申请实施例提供了一种视频编解码方法与系统、及视频编码器与视频解码器,在减小重建的变换系数与原始变换系数之间的损失,提高编码效率的同时,降低编码代价。
第一方面,本申请提供了一种视频编码方法,包括:
获取待编码的图像块;
对所述图像块进行预测,得到所述图像块的预测块;
根据所述图像块和所述预测块,得到所述图像块的残差块;
对所述残差块进行变换,得到至少一个变换系数;
针对所述至少一个变换系数中的每个变换系数,从N个量化器中确定一个目标量化器对所述变换系数进行量化,得到量化系数,所述N为大于或等于2的正整数,所述N个量化器中至少有一个量化器为可以将变换系数均量化为非零量化系数的非零量化器;
对所述量化系数进行编码,得到码流。
第二方面,本申请实施例提供一种视频解码方法,包括:
解码码流,得到待解码的图像块的至少一个量化系数,所述量化系数经过N个量化器中的一个量化器量化得到,所述N为大于或等于2的正整数,所述N个量化器中至少有一个量化器为可以将变换系数均量化为非零量化系数的非零量化器;
针对所述至少一个量化系数中的每个量化系数,对所述量化系数进行反量化,得到变换系数;
对所述变换系数进行反变换,得到所述图像块的残差块;
确定所述图像块的预测块;
根据所述图像块的预测块和残差块,得到所述图像块的重建块。
第三方面,本申请提供了一种视频编码器,用于执行上述第一方面或其各实现方式中的方法。具体地,该编码器包括用于执行上述第一方面或其各实现方式中的方法的功能单元。
第四方面,本申请提供了一种视频解码器,用于执行上述第二方面或其各实现方式中的方法。具体地,该解码器包括用于执行上述第二方面或其各实现方式中的方法的功能单元。
第五方面,提供了一种视频编码器,包括处理器和存储器。该存储器用于存储计算机程序,该处理器用于调用并运行该存储器中存储的计算机程序,以执行上述第一方面或其各实现方式中的方法。
第六方面,提供了一种视频解码器,包括处理器和存储器。该存储器用于存储计算机程序,该处理器用于调用并运行该存储器中存储的计算机程序,以执行上述第二方面或其各实现方式中的方法。
第七方面,提供了一种视频编解码系统,包括视频编码器和视频解码器。视频编码器用于执行上述第一方面或其各实现方式中的方法,视频解码器用于执行上述第二方面或其各实现方式中的方法。
第八方面,提供了一种芯片,用于实现上述第一方面至第二方面中的任一方面或其各实现方式中的方法。具体地,该芯片包括:处理器,用于从存储器中调用并运行计算机程序,使得安装有该芯片的设备执行如上述第一方面至第二方面中的任一方面或其各实现方式中的方法。
第九方面,提供了一种计算机可读存储介质,用于存储计算机程序,该计算机程序使得计算机执行上述第一方面至第二方面中的任一方面或其各实现方式中的方法。
第十方面,提供了一种计算机程序产品,包括计算机程序指令,该计算机程序指令 使得计算机执行上述第一方面至第二方面中的任一方面或其各实现方式中的方法。
第十一方面,提供了一种计算机程序,当其在计算机上运行时,使得计算机执行上述第一方面至第二方面中的任一方面或其各实现方式中的方法。
基于以上技术方案,在视频编码过程中,针对每个变换系数,从N个量化器中确定一个目标量化器对该变换系数进行量化,得到量化系数,其中N为大于或等于2的正整数,N个量化器中至少有一个量化器为可以将变换系数均量化为非零量化系数的非零量化器;对量化系数进行编码,得到码流。由于N个量化器中至少有一个量化器为可以将变换系数均量化为非零量化系数的非零量化器,而该非零量化器不需要计算变换系数量化成0的代价,进而降低了编码代价,进一步提高编码效率。
附图说明
图1为本申请实施例涉及的一种视频编解码系统100的示意性框图;
图2是本申请实施例提供的视频编码器200的示意性框图;
图3是本申请实施例提供的解码框架300的示意性框图;
图4为两种量化器Q0和Q1进行量化的示意图;
图5为决定变换系数所使用量化器的状态转移示意图;
图6为网格结构表示状态与变换系数级别的依赖性示意图;
图7为Q0和Q1的候选变换系数级别示意图;
图8为本申请实施例提供的一种视频编码方法的流程示意图;
图9为原有DQ技术的Q0,Q1的量化器示意图;
图10为本申请涉及的Q0,Q1的量化器示意图;
图11为本申请实施例提供的另一种视频编码方法的流程示意图;
图12为本申请实施例提供的视频解码方法的一种流程示意图;
图13为本申请实施例涉及的扫描区域的系数编码示意图;
图14是本申请实施例提供的视频编码器的示意性框图;
图15是本申请实施例提供的视频解码器的示意性框图;
图16是本申请实施例提供的电子设备的示意性框图;
图17是本申请实施例提供的视频编解码系统的示意性框图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行描述。
本申请可应用于图像编解码领域、视频编解码领域、硬件视频编解码领域、专用电路视频编解码领域、实时视频编解码领域等。例如,本申请的方案可结合至音视频编码标准(audio video coding standard,简称AVS),例如,H.264/音视频编码(audio video coding,简称AVC)标准,H.265/高效视频编码(high efficiency video coding,简称HEVC)标准以及H.266/多功能视频编码(versatile video coding,简称VVC)标准。或者,本申请的方案可结合至其它专属或行业标准而操作,所述标准包含ITU-TH.261、ISO/IECMPEG-1Visual、ITU-TH.262或ISO/IECMPEG-2Visual、ITU-TH.263、ISO/IECMPEG-4Visual,ITU-TH.264(还称为ISO/IECMPEG-4AVC),包含可分级视频编解码(SVC)及多视图视频编解码(MVC)扩展。应理解,本申请的技术不限于任何特定编解码标准或技术。
为了便于理解,首先结合图1对本申请实施例涉及的视频编解码系统进行介绍。
图1为本申请实施例涉及的一种视频编解码系统100的示意性框图。需要说明的是,图1只是一种示例,本申请实施例的视频编解码系统包括但不限于图1所示。如图1所示,该视频编解码系统100包含编码设备110和解码设备120。其中编码设备用于对视频数据进行编码(可以理解成压缩)产生码流,并将码流传输给解码设备。解码设备对编码设备编码产生的码流进行解码,得到解码后的视频数据。
本申请实施例的编码设备110可以理解为具有视频编码功能的设备,解码设备120可以理解为具有视频解码功能的设备,即本申请实施例对编码设备110和解码设备120包括更广泛的装置,例如包含智能手机、台式计算机、移动计算装置、笔记本(例如,膝上型)计算机、平板计算机、机顶盒、电视、相机、显示装置、数字媒体播放器、视频游戏控制台、车载计算机等。
在一些实施例中,编码设备110可以经由信道130将编码后的视频数据(如码流)传输给解码设备120。信道130可以包括能够将编码后的视频数据从编码设备110传输到解码设备120的一个或多个媒体和/或装置。
在一个实例中,信道130包括使编码设备110能够实时地将编码后的视频数据直接发射到解码设备120的一个或多个通信媒体。在此实例中,编码设备110可根据通信标准来调制编码后的视频数据,且将调制后的视频数据发射到解码设备120。其中通信媒体包含无线通信媒体,例如射频频谱,可选的,通信媒体还可以包含有线通信媒体,例如一根或多根物理传输线。
在另一实例中,信道130包括存储介质,该存储介质可以存储编码设备110编码后 的视频数据。存储介质包含多种本地存取式数据存储介质,例如光盘、DVD、快闪存储器等。在该实例中,解码设备120可从该存储介质中获取编码后的视频数据。
在另一实例中,信道130可包含存储服务器,该存储服务器可以存储编码设备110编码后的视频数据。在此实例中,解码设备120可以从该存储服务器中下载存储的编码后的视频数据。可选的,该存储服务器可以存储编码后的视频数据且可以将该编码后的视频数据发射到解码设备120,例如web服务器(例如,用于网站)、文件传送协议(FTP)服务器等。
一些实施例中,编码设备110包含视频编码器112及输出接口113。其中,输出接口113可以包含调制器/解调器(调制解调器)和/或发射器。
在一些实施例中,编码设备110除了包括视频编码器112和输入接口113外,还可以包括视频源111。
视频源111可包含视频采集装置(例如,视频相机)、视频存档、视频输入接口、计算机图形系统中的至少一个,其中,视频输入接口用于从视频内容提供者处接收视频数据,计算机图形系统用于产生视频数据。
视频编码器112对来自视频源111的视频数据进行编码,产生码流。视频数据可包括一个或多个图像(picture)或图像序列(sequence of pictures)。码流以比特流的形式包含了图像或图像序列的编码信息。编码信息可以包含编码图像数据及相关联数据。相关联数据可包含序列参数集(sequence parameter set,简称SPS)、图像参数集(picture parameter set,简称PPS)及其它语法结构。SPS可含有应用于一个或多个序列的参数。PPS可含有应用于一个或多个图像的参数。语法结构是指码流中以指定次序排列的零个或多个语法元素的集合。
视频编码器112经由输出接口113将编码后的视频数据直接传输到解码设备120。编码后的视频数据还可存储于存储介质或存储服务器上,以供解码设备120后续读取。
在一些实施例中,解码设备120包含输入接口121和视频解码器122。
在一些实施例中,解码设备120除包括输入接口121和视频解码器122外,还可以包括显示装置123。
其中,输入接口121包含接收器及/或调制解调器。输入接口121可通过信道130接收编码后的视频数据。
视频解码器122用于对编码后的视频数据进行解码,得到解码后的视频数据,并将解码后的视频数据传输至显示装置123。
显示装置123显示解码后的视频数据。显示装置123可与解码设备120整合或在解码设备120外部。显示装置123可包括多种显示装置,例如液晶显示器(LCD)、等离子体显示器、有机发光二极管(OLED)显示器或其它类型的显示装置。
此外,图1仅为实例,本申请实施例的技术方案不限于图1,例如本申请的技术还可以应用于单侧的视频编码或单侧的视频解码。
下面对本申请实施例涉及的视频编码框架进行介绍。
图2是本申请实施例提供的视频编码器200的示意性框图。应理解,该视频编码器200可用于对图像进行有损压缩(lossy compression),也可用于对图像进行无损压缩(lossless compression)。该无损压缩可以是视觉无损压缩(visually lossless compression),也可以是数学无损压缩(mathematically lossless compression)。
该视频编码器200可应用于亮度色度(YCbCr,YUV)格式的图像数据上。例如,YUV比例可以为4:2:0、4:2:2或者4:4:4,Y表示明亮度(Luma),Cb(U)表示蓝色色度,Cr(V)表示红色色度,U和V表示为色度(Chroma)用于描述色彩及饱和度。例如,在颜色格式上,4:2:0表示每4个像素有4个亮度分量,2个色度分量(YYYYCbCr),4:2:2表示每4个像素有4个亮度分量,4个色度分量(YYYYCbCrCbCr),4:4:4表示全像素显示(YYYYCbCrCbCrCbCrCbCr)。
例如,该视频编码器200读取视频数据,针对视频数据中的每帧图像,将一帧图像划分成若干个编码树单元(coding tree unit,CTU),在一些例子中,CTB可被称作“树型块”、“最大编码单元”(Largest Coding unit,简称LCU)或“编码树型块”(coding tree block,简称CTB)。每一个CTU可以与图像内的具有相等大小的像素块相关联。每一像素可对应一个亮度(luminance或luma)采样及两个色度(chrominance或chroma)采样。因此,每一个CTU可与一个亮度采样块及两个色度采样块相关联。一个CTU大小例如为128×128、64×64、32×32等。一个CTU又可以继续被划分成若干个编码单元(Coding Unit,CU)进行编码,CU可以为矩形块也可以为方形块。CU可以进一步划分为预测单元(prediction Unit,简称PU)和变换单元(transform unit,简称TU),进而使得编码、预测、变换分离,处理的时候更灵活。在一种示例中,CTU以四叉树方式划分为CU,CU以四叉树方式划分为TU、PU。
视频编码器及视频解码器可支持各种PU大小。假定特定CU的大小为2N×2N,视频编码器及视频解码器可支持2N×2N或N×N的PU大小以用于帧内预测,且支持2N×2N、 2N×N、N×2N、N×N或类似大小的对称PU以用于帧间预测。视频编码器及视频解码器还可支持2N×nU、2N×nD、nL×2N及nR×2N的不对称PU以用于帧间预测。
在一些实施例中,如图2所示,该视频编码器200可包括:预测单元210、残差单元220、变换/量化单元230、反变换/量化单元240、重建单元250、环路滤波单元260、解码图像缓存270和熵编码单元280。需要说明的是,视频编码器200可包含更多、更少或不同的功能组件。
可选的,在本申请中,当前块(current block)可以称为当前编码单元(CU)或当前预测单元(PU)等。预测块也可称为预测图像块或图像预测块,重建图像块也可称为重建块或图像重建图像块。
在一些实施例中,预测单元210包括帧间预测单元211和帧内预测单元212。由于视频的一个帧中的相邻像素之间存在很强的相关性,在视频编解码技术中使用帧内预测的方法消除相邻像素之间的空间冗余。由于视频中的相邻帧之间存在着很强的相似性,在视频编解码技术中使用帧间预测方法消除相邻帧之间的时间冗余,从而提高编码效率。
帧间预测单元211可用于帧间预测,帧间预测可以参考不同帧的图像信息,帧间预测使用运动信息从参考帧中找到参考块,根据参考块生成预测块,用于消除时间冗余;帧间预测所使用的帧可以为P帧和/或B帧,P帧指的是向前预测帧,B帧指的是双向预测帧。运动信息包括参考帧所在的参考帧列表,参考帧索引,以及运动矢量。运动矢量可以是整像素的或者是分像素的,如果运动矢量是分像素的,那么需要再参考帧中使用插值滤波做出所需的分像素的块,这里把根据运动矢量找到的参考帧中的整像素或者分像素的块叫参考块。有的技术会直接把参考块作为预测块,有的技术会在参考块的基础上再处理生成预测块。在参考块的基础上再处理生成预测块也可以理解为把参考块作为预测块然后再在预测块的基础上处理生成新的预测块。
目前最常用的帧间预测方法包括:VVC视频编解码标准中的几何划分模式(geometric partitioning mode,GPM),以及AVS3视频编解码标准中的角度加权预测(angular weighted prediction,AWP)。这两种帧内预测模式在原理上有共通之处。
帧内预测单元212只参考同一帧图像的信息,预测当前码图像块内的像素信息,用于消除空间冗余。帧内预测所使用的帧可以为I帧。例如图5所示,白色的4×4块是当前块,当前块左边一行和上面一列的灰色的像素为当前块的参考像素,帧内预测使用这些参考像素对当前块进行预测。这些参考像素可能已经全部可得,即全部已经编解码。也可能有部分不可得,比如当前块是整帧的最左侧,那么当前块的左边的参考像素不可 得。或者编解码当前块时,当前块左下方的部分还没有编解码,那么左下方的参考像素也不可得。对于参考像素不可得的情况,可以使用可得的参考像素或某些值或某些方法进行填充,或者不进行填充。
在一些实施例中,帧内预测方法还包括多参考行帧内预测方法(multiple reference line,MRL),MRL可以使用更多的参考像素从而提高编码效率。
帧内预测有多种预测模式,H.264中对4×4的块进行帧内预测的9种模式。其中模式0是将当前块上面的像素按竖直方向复制到当前块作为预测值;模式1是将左边的参考像素按水平方向复制到当前块作为预测值;模式2(DC)是将A~D和I~L这8个点的平均值作为所有点的预测值,模式3至模式8是分别按某一个角度将参考像素复制到当前块的对应位置。因为当前块某些位置不能正好对应到参考像素,可能需要使用参考像素的加权平均值,或者说是插值的参考像素的分像素。
HEVC使用的帧内预测模式有平面模式(Planar)、DC和33种角度模式,共35种预测模式。VVC使用的帧内模式有Planar、DC和65种角度模式,共67种预测模式。AVS3使用的帧内模式有DC、Plane、Bilinear和63种角度模式,共66种预测模式。
需要说明的是,随着角度模式的增加,帧内预测将会更加精确,也更加符合对高清以及超高清数字视频发展的需求。
残差单元220可基于CU的像素块及CU的PU的预测块来产生CU的残差块。举例来说,残差单元220可产生CU的残差块,使得残差块中的每一采样具有等于以下两者之间的差的值:CU的像素块中的采样,及CU的PU的预测块中的对应采样。
变换/量化单元230可量化变换系数。变换/量化单元230可基于与CU相关联的量化参数(QP)值来量化与CU的TU相关联的变换系数。视频编码器200可通过调整与CU相关联的QP值来调整应用于与CU相关联的变换系数的量化程度。
反变换/量化单元240可分别将逆量化及逆变换应用于量化后的变换系数,以从量化后的变换系数重建残差块。
重建单元250可将重建后的残差块的采样加到预测单元210产生的一个或多个预测块的对应采样,以产生与TU相关联的重建图像块。通过此方式重建CU的每一个TU的采样块,视频编码器200可重建CU的像素块。
环路滤波单元260可执行消块滤波操作以减少与CU相关联的像素块的块效应。
在一些实施例中,环路滤波单元260包括去块滤波单元、样点自适应补偿SAO单元、自适应环路滤波ALF单元。
解码图像缓存270可存储重建后的像素块。帧间预测单元211可使用含有重建后的像素块的参考图像来对其它图像的PU执行帧间预测。另外,帧内预测单元212可使用解码图像缓存270中的重建后的像素块来对在与CU相同的图像中的其它PU执行帧内预测。
熵编码单元280可接收来自变换/量化单元230的量化后的变换系数。熵编码单元280可对量化后的变换系数执行一个或多个熵编码操作以产生熵编码后的数据。
本申请涉及的视频编码的基本流程如下:在编码端,将当前图像划分成块,针对当前块,预测单元210使用帧内预测或帧间预测产生当前块的预测块。残差单元220可基于预测块与当前块的原始块计算残差块,即预测块和当前块的原始块的差值,该残差块也可称为残差信息。该残差块经由变换/量化单元230变换与量化等过程,可以去除人眼不敏感的信息,以消除视觉冗余。可选的,经过变换/量化单元230变换与量化之前的残差块可称为时域残差块,经过变换/量化单元230变换与量化之后的时域残差块可称为频率残差块或频域残差块。熵编码单元280接收到变换量化单元230输出的量化后的变换系数,可对该量化后的变换系数进行熵编码,输出码流。例如,熵编码单元280可根据目标上下文模型以及二进制码流的概率信息消除字符冗余。
另外,视频编码器对变换量化单元230输出的量化后的变换系数进行反量化和反变换,得到当前块的残差块,再将当前块的残差块与当前块的预测块进行相加,得到当前块的重建块。随着编码的进行,可以得到当前图像中其他图像块对应的重建块,这些重建块进行拼接,得到当前图像的重建图像。由于编码过程中引入误差,为了降低误差,对重建图像进行滤波,例如,使用ALF对重建图像进行滤波,以减小重建图像中像素点的像素值与当前图像中像素点的原始像素值之间差异。将滤波后的重建图像存放在解码图像缓存270中,可以为后续的帧作为帧间预测的参考帧。
需要说明的是,编码端确定的块划分信息,以及预测、变换、量化、熵编码、环路滤波等模式信息或者参数信息等在必要时携带在码流中。解码端通过解析码流及根据已有信息进行分析确定与编码端相同的块划分信息,预测、变换、量化、熵编码、环路滤波等模式信息或者参数信息,从而保证编码端获得的解码图像和解码端获得的解码图像相同。
图3是本申请实施例提供的解码框架300的示意性框图。
如图3所示,视频解码器300包含:熵解码单元310、预测单元320、反量化/变换单元330、重建单元340、环路滤波单元350及解码图像缓存360。需要说明的是,视频 解码器300可包含更多、更少或不同的功能组件。
视频解码器300可接收码流。熵解码单元310可解析码流以从码流提取语法元素。作为解析码流的一部分,熵解码单元310可解析码流中的经熵编码后的语法元素。预测单元320、反量化/变换单元330、重建单元340及环路滤波单元350可根据从码流中提取的语法元素来解码视频数据,即产生解码后的视频数据。
在一些实施例中,预测单元320包括帧内预测单元321和帧间预测单元322。
帧内预测单元321可执行帧内预测以产生PU的预测块。帧内预测单元321可使用帧内预测模式以基于空间相邻PU的像素块来产生PU的预测块。帧内预测单元321还可根据从码流解析的一个或多个语法元素来确定PU的帧内预测模式。
帧间预测单元322可根据从码流解析的语法元素来构造第一参考图像列表(列表0)及第二参考图像列表(列表1)。此外,如果PU使用帧间预测编码,则熵解码单元310可解析PU的运动信息。帧间预测单元322可根据PU的运动信息来确定PU的一个或多个参考块。帧间预测单元322可根据PU的一个或多个参考块来产生PU的预测块。
反量化/变换单元330可逆量化(即,解量化)与TU相关联的变换系数。反量化/变换单元330可使用与TU的CU相关联的QP值来确定量化程度。
在逆量化变换系数之后,反量化/变换单元330可将一个或多个逆变换应用于逆量化变换系数,以便产生与TU相关联的残差块。
重建单元340使用与CU的TU相关联的残差块及CU的PU的预测块以重建CU的像素块。例如,重建单元340可将残差块的采样加到预测块的对应采样以重建CU的像素块,得到重建图像块。
环路滤波单元350可执行消块滤波操作以减少与CU相关联的像素块的块效应。
在一些实施例中,环路滤波单元350包括去块滤波单元、样点自适应补偿SAO单元、自适应环路滤波ALF单元。
视频解码器300可将CU的重建图像存储于解码图像缓存360中。视频解码器300可将解码图像缓存360中的重建图像作为参考图像用于后续预测,或者,将重建图像传输给显示装置呈现。
本申请涉及的视频解码的基本流程如下:熵解码单元310可解析码流得到当前块的预测信息、量化系数矩阵等,预测单元320基于预测信息对当前块使用帧内预测或帧间预测产生当前块的预测块。反量化/变换单元330使用从码流得到的量化系数矩阵,对量化系数矩阵进行反量化、反变换得到残差块。重建单元340将预测块和残差块相加得到 重建块。重建块组成重建图像,环路滤波单元350基于图像或基于块对重建图像进行环路滤波,得到解码图像。该解码图像也可以称为重建图像,该重建图像一方面可以被显示设备进行显示,另一方面可以存放在解码图像缓存360中,为后续的帧作为帧间预测的参考帧。
上述是基于块的混合编码框架下的视频编解码器的基本流程,随着技术的发展,该框架或流程的一些模块或步骤可能会被优化,本申请适用于该基于块的混合编码框架下的视频编解码器的基本流程,但不限于该框架及流程。
下面对本申请涉及的对偶量化技术进行介绍。
对偶量化(Dependent Quantization,DQ)是在VVC中定义的一种量化方式。对偶量化作用在变换后的块上,与传统的量化不同的是,对偶量化共包含了两个量化器,这两个量化器虽然有着相同的量化步长,但与变换系数的匹配却是交错的。图4是对偶量化的量化器Q0和量化器Q1与变换系数匹配的示意图。
其中,量化器Q0匹配了偶数倍的量化步长Δ与变换系数级别(即A,B点对应的数字),量化器Q1匹配了奇数倍的量化步长Δ与变换系数级别(即C,D点对应的数字)。
依赖量化通过引入两个交错的量化器,以及量化器之间跳转的原则,使得大步长的量化器能够完成更精细的量化,达到减小了重建的变换系数与原始变换系数之间的损失,从而提高编码效率。
对于每个变换系数,都可以使用图4中描述的两种量化器Q0,Q1进行量化,这两个量化器的量化的方式与传统的量化器(HEVC中的量化)相似。两个量化器的重建系数都可以用量化步长Δ表示,两个量化器的重建系数定义如下:
Q0:该量化器的重建级别为偶数倍的量化步长Δ,当使用这个量化器时,重建的变换系数t'可根据如下公式(1)计算,
t'=2·k·Δ          (1)
其中,k表示图4中所述相关的变换系数级别。
Q1:该量化器的重建级别为奇数或零倍的量化步长Δ,当使用这个量化器时,重建的变换系数t'可根据如下公式(2)计算,
t'=(2·k-sgn(k))·Δ       (2)
其中,sgn(·)代表符号函数,
Figure PCTCN2021078968-appb-000001
使用Q0或Q1进行量化并不会通过编码标志位来进行控制。取而代之的是,使用在系数扫描顺序上的上一个系数的变换系数级别(图4中所述的变换系数级别)的奇偶性来决定当前变换系数使用Q0或Q1。
图5为决定变换系数所使用量化器的状态转移示意图,(a)使用状态机决策量化器的使用,(b)状态转移表。在系数扫描顺序上,当前系数的重建值可以通过图5中所示的转移方法决定下一个系数的状态,状态共有四种,分别由0,1,2,3这四个值来表示。例如当前系数的状态为2且当前变换系数级别为5时,由于5是奇数,所以决定下一个系数的状态跳转为状态3。每一个变换块在扫描顺序上的第一个系数的状态被设定为初始状态0。状态的0,1,2,3也决定这当前的系数使用哪一个量化器,状态0,1对应着使用量化器Q0,状态2,3对应着使用量化器Q1。
编码器对对偶量化的决策与率失真优化量化(rate-distortion optimized quantization,RDOQ)的实现方式相似,变换系数级别{q k}的取值为最小化如下公式(3)拉格朗日率失真代价的一个过程,
J=D+λ·R=∑ k(t k-t' k(q k|q k-1,q k-2,...)) 2+λ·R k(q k|q k-1,q k-2,...)      (3)
其中,t k和q k分别代表原始的表换系数和变换系数级别,t' k(q k|...)代表在当前变换系数级别q k下重建出的变换系数值,R K(q k|...)代表估计出的编码q k需要消耗的比特数。
图6为网格结构表示状态与变换系数级别的依赖性示意图,其编码顺序从左到右。如之前所介绍的状态机的转移,可以将量化器与变换系数级别之间的依赖性表示成如图6所示的网格图,每一列的四个状态表示当前系数的可能的四种状态,每个节点与编码顺序上下一个系数的可能的两个状态节点相连。对于一个给定的当前状态和当前变换系数t k,可以使用当前量化器量化出对应的变换系数级别,编码器可以选择使用奇数的变换系数级别也可以选择使用偶数的变换系数级别,奇数变换系数级别对应图6中B(Q0 with parity 1)和D(Q1 with parity 1),偶数变换系数级别对应A(Q0 with parity 0)和C(Q1 with parity 0)。当算出所有节点的代价J K(q k)=(t k-t' k(q k|...)) 2+λ·R k(q k|...)后,变换系数级别q k就可以通过找到一条代价总和最小的路线来决定,而确定最小代价和可以通过维特比算法(Viterbi algorithm)来实现。
具体的实现由两步组成:
步骤1,找到4个与原始变换系数对应的4个分别来自Q0和Q1的候选变换系数级别如图7所示;
步骤2,使用维特比算法以估计出的rate-distortion总和(之前节点已确定的变换系数级别对应的代价综合)来确定一系列当前节点的变换系数级别q k
由上述可知,现有DQ技术中的两个量化器均可以尝试将变换系数量化为0,在编码端决策时,由于两种量化器都需要计算变换系数量化成0的代价,并添加到状态跳转的决策候选当中,会引入一定的复杂度,编码代价大。
为了解决上述技术问题,本申请的N个量化器中至少有一个量化器为非零量化器,该非零量化器不需要计算变换系数量化成0的代价,进而降低了编码复杂度和代价。
下面结合具体的实施例对本申请实施例提供的技术方案进行详细描述。
下面结合图8对编码端进行介绍。
图8为本申请实施例提供的一种视频编码方法的流程示意图,本申请实施例应用于图1和图2所示视频编码器。如图8所示,本申请实施例的方法包括:
S801、获取待编码的图像块;
S802、对图像块进行预测,得到图像块的预测块;
S803、根据图像块和预测块,得到图像块的残差块;
S804、对残差块进行变换,得到至少一个变换系数;
S805、针对至少一个变换系数中的每个变换系数,从N个量化器中确定一个目标量化器对该变换系数进行量化,得到量化系数,N为大于或等于2的正整数,N个量化器中至少有一个量化器为可以将变换系数均量化为非零量化系数的非零量化器;
S806、对量化系数进行编码,得到码流。
在一些实施例中,本申请的量化系数也可以称为当前系数,或量化后的系数,或者待编码的系数。
在视频编码过程中,视频编码器接收视频流,该视频流由一系列图像帧组成,针对视频流中的每一帧图像进行视频编码,为了便于描述,本申请将当前待编码的一帧图像记为当前图像。
具体的,参照图2所示,视频编码器将当前图像划分成一个或多个待编码图像块,针对每个待编码图像块,视频编码器中的预测单元210经由帧间预测、帧内预测产生待编码图像块的预测块之后,将预测块发送给残差单元220,该残差单元220可以理解为求 和器,包括执行减法运算的一个或多个组建。残差单元220从待编码图像块中减去预测块形成残差块,并将残差块发送给变换量化单元230。变换量化单元230使用例如离散余弦变换(DCT)或者类似的变换将残差块进行变换处理,得到变换系数。变换量化单元230进一步对变换系数进行量化,得到量化后的变换系数。
由图2可知,一方面,变换量化单元230将量化后的变换系数转发给熵编码单元280。熵编码单元280对量化后的变换系数进行熵编码。举例来说,熵编码单元280可执行上下文自适应可变长度编码(CAVLC)、上下文自适应二进制算术编码(CABAC)、基于语法的上下文自适应二进制算术编码(SBAC)、概率区间分割熵(PIPE)编码等编码方法,对量化后的变换系数进行熵编码,得到码流。
本申请主要针对的是上述量化过程。
目前VVC中DQ的设计主要包含三个部分
1)两个交错的量化器Q0,Q1;
2)使用状态机控制状态转移;
3)变换系数级别的编码;
本申请主要对于DQ设计中的第一部分以及第三部分提出新的方法。其中包括使用了一种新的交错量化器,以及新的系数编码方法。对第二部分的状态转移方法不做具体限制。
在一些实施例中,本申请首先提出量化器可以量化变换后的系数。
在一些实施例中,本申请可以量化非变换的系数(transform skip coefficients)。
本申请的N个量化器中至少有一个量化器为可以将变换系数均量化为非零量化系数的非零量化器,其中N为大于等于2的正整数。
在一些实施例中,N个量化器中至少有一个量化器为可以将变换系数量化为零的零点量化器。
在一些实施例中,N个量化器包括一个零点量化器和一个非零量化器。
图9为原有DQ技术的Q0,Q1的量化器示意图,相对于图9,在一些实施例中,上述N=2,即本申请提出在两个量化器中,只有一个量化器有零点,即一个量化器可以把系数量化为零,这样的量化器称为零点量化器;另一个量化器不可以把系数量化为零,这样的量化器称为非零量化器。
在一些实施例中,如图10所示,N个量化器包括Q0量化器和Q1量化器。其中Q0量化器并未作出改变,Q1量化器则是去掉了量化为0的点,即Q1量化器只能将系数量化 成非零系数,这里Q0是零点量化器,Q1是非零量化器。
在一些实施例中,非零量化器也可以是Q0,也就是说Q0量化器没有零点,但Q1量化器有零点。
在一些实施例中,本申请提出如下特殊的编解码设计,两个量化器都没有零点,即Q0和Q1都是零点量化器。
可选的,量化器的个数也可以进一步扩展,可以是两个也可以是两个以上的量化器。对于两个以上量化器的情况,即N大于2时,N个量化器中零点量化器可以是其中任意一个,也可以是其中任意多个。
在一些实施例中,上述S805中从N个量化器中确定一个目标量化器对变换系数进行量化,得到量化系数,包括如下步骤S805-A1和S805-A2:
S805-A1,根据当前状态机所处的状态,从所述N个量化器中确定所述目标量化器;
S805-A2,使用所述目标量化器对所述变换系数进行量化,得到所述量化系数。
在实际编码过程中,编码器会根据状态机的当前状态判断当前量化过程中所使用的目标量化器,对非零量化器,在尝试量化的时候将不再能够把系数量化成零。
在一些实施例中,可以将状态机的当前状态称为量化系数的当前状态。
在一些实施例中,码流中包括状态机的初始状态。例如,状态机的初始状态为0。
在一些实施例中,码流中包括非零量化器标识,所述非零量化器标识用于标识所述目标量化器是否为非零量化器。
在系数编码方面,本申请遵循AVS3标准中系数编码部分的原有编码方式。其中编码一个系数包括这些标志位,系数非零标志sig_flag,sig_flag,系数非零标志位用于指示所述量化系数是否为零,在一些实施例中,若系数非零标志位的值为‘0’表示当前系数是‘0’;值为‘1’表示当前系数是非零系数。系数绝对值大于1标志coeff_abs_level_greater1_flag,coeff_abs_level_greater1_flag的值为‘0’表示当前系数的绝对值是‘1’;值为‘1’表示当前系数的绝对值大于1。系数绝对值大于2标志coeff_abs_level_greater2_flag,coeff_abs_level_greater2_flag的值为‘0’表示当前系数的绝对值是‘2’;值为‘1’表示当前系数的绝对值大于2。系数绝对值剩余值coeff_abs_level_remaining,如果当前系数有系数绝对值剩余值,当前系数的绝对值为3+coeff_abs_level_remaining。
对使用零点量化器量化后的系数编码,仍然按照现有系数编码的方式不变。对使用非零量化器进行量化的系数编码,本申请提出如下新的系数编码方法。因为编码器已知 非零量化器量化的数据最小值的绝对值为1,也就是说所有非零量化器量化后的系数都是非零值,因此非零量化器量化后的系数不需要编码非零标志sig_flag,从而节省码字。
在一具体的实施例中,本申请当前编码块经过预测部分,或通过帧间预测,或通过帧内预测等方式,对当前块进行预测得到当前预测块。取原始图像与当前预测块坐标等相对应位置的图像块,与当前预测块做差得到当前编码单元的残差块。然后对残差块进行二维变换或不进行变换,可以得到含有变换后系数的变换块或非变换的系数块,这里我们统称为系数块。然后对该系数块进行量化。使用DQ技术进行量化确定好状态跳转路径。其中使用非零量化器,例如量化器1,量化得到的系数为非零系数;使用零点量化器,例如量化器0,量化得到的系数可能有零系数或者非零系数。
在写码流过程中,按照系数扫描顺序写入系数相关标志位。
开始写入时,将状态机初始状态设为0。
在一些实施例中,量化系数的位置在系数扫描区域的左下角且为当前行唯一非零系数,或者所述量化系数的位置在系数扫描区域的右上角且为当前列唯一非零系数,或者所述目标量化器为非零量化器时,所述码流中不包括系数非零标志位,所述系数非零标志位用于指示所述量化系数是否为零。
具体的,首先判断当前编码的系数(即量化系数)的位置是否在系数扫描区域的左下角且为当前行唯一非零系数,或者该当前编码的系数的位置是否在系数扫描区域的右上角且为当前列唯一非零系数,或者根据当前编码的系数所处状态机的状态判断是否使用了非零量化器。若满足其中任意一个条件,则无需编码sig_flag(系数非零标志位)。若不满足,则将当前系数的sig_flag写入码流。之后按照编码器原有方案写入与当前系数相关的其它标志位。
在一些实施例中,在目标量化器为非零量化器时,系数非零标志位的值为第二数值。例如第二数值为1。
在一些实施例中,根据状态机的当前状态以及当前编码系数的绝对值大小更新状态机的状态,然后开始编码下一个系数直至整个系数块编码完成。
本方案对变换块语法结构的改变如表1所示。
表1 变换块定义
Figure PCTCN2021078968-appb-000002
Figure PCTCN2021078968-appb-000003
其中,state表示当前状态机所处的状态,nz_quantizer_flag表示非零量化器标识,用于标识所述目标量化器是否为非零量化器,或者用于标识当前状态对应的量化器是否为非零量化器。nz_quantizer(state)的值可以用下面表2得到。
表2 由状态决定选择哪一个量化器
Figure PCTCN2021078968-appb-000004
若返回结果为“1”,表示该状态对应的量化器为非零量化器,若返回结果为“0”,表示该状态对应的量化器为零点量化器。update_state(abs_coef[blkpos])表示根据当前系数的绝对值大小更新状态机的状态,对于具体的状态机更新方案并不做具体限制,例如可以采用图5的跳转方案。
在本申请另一种实施例中,对于使用非零量化器的系数,在编码时按照原值减一的方式进行编码。解码时,码流中解析出来的值进行加一处理。此时,上述S805包括如图11所示的步骤。
图11为本申请实施例提供的另一种视频编码方法的流程示意图,如图11所示,上述S805包括:
S805-1,根据变换系数对应的状态机当前所处的状态,从N个量化器中确定目标量化器;
S805-2,若该目标量化器为非零量化器,则使用该目标量化器对变换系数进行量化,得到初始量化值;
S805-3,对初始量化值减去第一数值,得到量化系数。
具体的,当前编码块经过预测部分,或通过帧间预测,或通过帧内预测等方式,对当前块进行预测得到当前预测块。取原始图像与当前预测块坐标等相对应位置的图像块,与当前预测块做差得到当前编码单元的残差块。然后对残差块进行二维变换或不进行变换,可以得到含有变换后系数的变换块或非变换的系数块,这里统称为系数块。然后对该系数块进行量化。使用DQ技术进行量化确定好状态跳转路径。其中使用非零量化器,例如量化器1,量化得到的系数为非零系数;使用零点量化器,例如量化器0,量化得到的系数可能有零系数或者非零系数。
在写码流过程中,按照系数扫描顺序写入系数相关标志位。
开始写入时,将状态机初始状态设为0。
在一些实施例中,量化系数的位置在系数扫描区域的左下角且为当前行唯一非零系数,或者量化系数的位置在系数扫描区域的右上角且为当前列唯一非零系数,或者目标 量化器为非零量化器时,码流中不包括系数非零标志位,系数非零标志位用于指示量化系数是否为零。
具体的,首先判断当前编码的系数(例如量化系数)的位置是否在系数扫描区域的左下角且为当前行唯一非零系数,或者该当前编码的系数的位置是否在系数扫描区域的右上角且为当前列唯一非零系数,或者根据当前编码的系数所处状态机的状态判断是否使用了非零量化器。若满足其中任意一个条件,则无需编码sig_flag。若不满足,则将当前系数的sig_flag写入码流。
根据当前系数对应的状态机所处的状态判断是否使用了非零量化器,即目标量化器是否为非零量化器,若使用了非零量化器,对当前系数减一,若没有使用非零量化器,则不做任何改变。之后按照编码器原有方案写入与当前系数相关的其它标志位。
最后根据状态机的当前状态以及当前编码系数的绝对值大小更新状态机的状态,然后开始编码下一个系数直至整个系数块编码完成。
在一些实施例中,本申请对变换块语法结构的改变如表3所示。
表3 变换块定义
Figure PCTCN2021078968-appb-000005
Figure PCTCN2021078968-appb-000006
本申请的技术方案,改进了原有的量化器,在编码过程中,可以根据当前系数所使用的对偶量化中的哪一个量化器判断当前系数是否必定为非零系数,并根据该信息跳过编码非零系数标志位,从而节省码字,提高编码器效率。或者根据该信息减小编入码流中的系数值来节省码字。
上文对本申请实施例涉及的视频编码方法进行了描述,在此基础上,下面针对解码端,对本申请涉及的视频解码方法进行描述。
图12为本申请实施例提供的视频解码方法的一种流程示意图,如图12所示,本申请实施例的方法包括:
S901、解码码流,得到待解码的图像块的至少一个量化系数,量化系数经过N个量化器中的一个量化器量化得到,N为大于或等于2的正整数,N个量化器中至少有一个量化器为可以将变换系数均量化为非零量化系数的非零量化器;
S902、针对至少一个量化系数中的每个量化系数,对该量化系数进行反量化,得到变换系数;
S903、对该变换系数进行反变换,得到图像块的残差块;
S904、确定图像块的预测块;
S905、根据图像块的预测块和残差块,得到图像块的重建块。
具体的,参照图3所示,解码器中的熵解码单元310可解析码流得到当前图像中当前块的预测信息、量化系数矩阵等,预测单元320基于预测信息对当前块使用帧内预测或帧间预测产生当前块的预测块。反量化/变换单元330使用从码流得到的量化系数矩阵,对量化系数矩阵进行反量化、反变换得到残差块。重建单元340将预测块和残差块相加得到重建块。依次类推,可以得到当前图像中其他图像块的重建块,各重建块组成重建图像。
本申请的量化系数经过N个量化器中的一个量化器量化得到,所述N为大于或等于2的正整数,所述N个量化器中至少有一个量化器为可以将变换系数均量化为非零量化系数的非零量化器。
在一些实施例中,上述S902中对量化系数进行反量化,得到变换系数,包括如下步骤:
S902-A1、确定所述量化系数的非零标志位的值;
S902-A2、解码所述码流,得到所述量化系数的绝对值;
S902-A3、根据所述量化系数的非零标志位的值和所述量化系数的绝对值,对所述量化系数进行反量化,得到所述变换系数。
在一些实施例中,上述S902-A1中确定所述量化系数的非零标志位的值包括:若所述量化系数在系数扫描区域的左下角且为当前行唯一非零系数,或者所述量化系数在所述系数扫描区域的右上角且为当前列唯一非零系数,或者根据状态机的当前状态确定所述量化系数是使用非零量化器量化得到的,则确定所述量化系数的非零标志位的值为第二数值,所述第二数值用于指示所述量化系数为非零值。
可选的,第二数值为1。
本申请方案的一种实施例解码端实现如下:
解码端获取码流信息,解析当前编码块的标识位。
获取当前编码块变换块中系数扫描范围信息,包括扫描区域右端横坐标SRx,扫描区域下端纵坐标SRy。确定系数扫描区域,系数扫描区域为以(0,0)位置为左上角,以(SRx,SRy)位置为右下角的矩形区域。基于该扫描区域的系数编码示意图如图13所示,其中0表示零系数,1表示非零系数。系数解码顺序是从右下角到左上角的反向Z字型扫描(也可用于其它任何形式的扫描方式,例如,水平扫描,垂直扫描,对角扫描等)。
将状态机状态初始化为0。
解码器确定当前解码系数的位置后,首先判断当前系数(例如量化系数)的位置是否在系数扫描区域的左下角且为当前行唯一非零系数,或者该当前编码的系数的位置是否在系数扫描区域的右上角且为当前列唯一非零系数,或者根据当前编码的系数所处状态机的状态判断是否使用了非零量化器。若满足其中任意一个条件,则当前系数的sig_flag直接置一。接着,从码流中解析出的下一个bin是当前系数的coeff_abs_level_greater1_flag,依据系数编码的默认方案继续解析相关标志位以确定当前系数绝对值大小,包含coeff_abs_level_greater2_flag、coeff_abs_level_remaining等标志位,注意到这样解码出的系数值不会是零。
若不满足上述条件,从码流中解析出的下一个bin是当前系数的sig_flag,依据sig_flag的值判断当前系数是否为非零系数,若是非零系数,则依据默认方案继续解析相关标志位以确定当前系数绝对值大小,包含coeff_abs_level_greater1_flag、coeff_abs_level_greater2_flag、coeff_abs_level_remaining等标志位。如果当前系数不为非零系数,则当前系数的值为0。
最后解析符号标志位确定当前系数的正负。
根据当前系数绝对值大小以及所处状态更新下一个系数所处状态,按照扫描顺序解析下一个系数。
在一些实施例中,在上述S902-A3之前,本申请还包括:根据状态机的当前状态,确定量化所述量化系数所使用的量化器是否为非零量化器,具体参照上述图5所示。
若确定量化所述量化系数所使用的量化器为非零量化器,则上述S902-A3包括如下步骤:
S902-A31、对所述量化系数的绝对值和第一数值求和;
S902-A32、根据所述量化系数的非零标志位的值,以及求和后的所述量化系数的绝对值,得到所述变换系数。
可选的,第一数值为1。
本申请方案的一种实施例解码端实现如下:
解码端获取码流信息,解析当前编码块的标识位。
获取当前编码块变换块中系数扫描范围信息,包括扫描区域右端横坐标SRx,扫描区域下端纵坐标SRy。确定系数扫描区域,系数扫描区域为以(0,0)位置为左上角,以(SRx, SRy)位置为右下角的矩形区域。基于该扫描区域的系数编码示意图如图13所示,其中0表示零系数,1表示非零系数。系数解码顺序是从右下角到左上角的反向Z字型扫描(也可用于其它任何形式的扫描方式,例如,水平扫描,垂直扫描,对角扫描等)。
将状态机状态初始化为0。
解码器确定当前解码系数的位置后,首先判断当前系数(例如量化系数)的位置是否在系数扫描区域的左下角且为当前行唯一非零系数,或者该当前编码的系数的位置是否在系数扫描区域的右上角且为当前列唯一非零系数,或者根据当前编码的系数所处状态机的状态判断是否使用了非零量化器。若满足其中任意一个条件,则当前系数的sig_flag直接置一,从码流中解析出的下一个bin是当前系数的coeff_abs_level_greater1_flag,依据系数编码的默认方案继续解析相关标志位以确定当前系数绝对值大小,包含coeff_abs_level_greater2_flag、coeff_abs_level_remaining等标志位,最后解析符号标志位确定当前系数的正负。
若不满足上述条件,从码流中解析出的下一个bin是当前系数的sig_flag,依据sig_flag的值判断当前系数是否为非零系数,若是非零系数,则依据默认方案继续解析相关标志位以确定当前系数绝对值大小,包含coeff_abs_level_greater1_flag、coeff_abs_level_greater2_flag、coeff_abs_level_remaining等标志位。如果当前系数不为非零系数,则当前系数的值为0。
根据状态机当前状态判断当前系数所使用的量化器,若使用的是非零量化器,则解析出来的系数绝对值大小加一,否则不做任何额外操作。
最后解析符号标志位确定当前系数的正负。
根据当前系数绝对值大小以及所处状态更新下一个系数所处状态,按照扫描顺序解析下一个系数。
本申请还提出了一种不用修改原语法元素以及语义的方案。而是在使用非零量化器时,对非零系数标志位sig_flag采用一个固定最大概率的Pmps概率模型进行熵编码。因此,对于使用非零量化器的量化系数在解码或编码非零系数标志位时,其上下文概率模型不会更新。
应理解,图8至图13仅为本申请的示例,不应理解为对本申请的限制。
以上结合附图详细描述了本申请的优选实施方式,但是,本申请并不限于上述实施方式中的具体细节,在本申请的技术构思范围内,可以对本申请的技术方案进行多种简 单变型,这些简单变型均属于本申请的保护范围。例如,在上述具体实施方式中所描述的各个具体技术特征,在不矛盾的情况下,可以通过任何合适的方式进行组合,为了避免不必要的重复,本申请对各种可能的组合方式不再另行说明。又例如,本申请的各种不同的实施方式之间也可以进行任意组合,只要其不违背本申请的思想,其同样应当视为本申请所公开的内容。
还应理解,在本申请的各种方法实施例中,上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。另外,本申请实施例中,术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系。具体地,A和/或B可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中字符“/”,一般表示前后关联对象是一种“或”的关系。
上文结合图8至图13,详细描述了本申请的方法实施例,下文结合图14至图16,详细描述本申请的装置实施例。
图14是本申请实施例提供的视频编码器的示意性框图。
如图14所示,视频编码器10包括:
获取单元11,用于获取待编码的图像块;
预测单元12,用于对所述图像块进行预测,得到所述图像块的预测块;
残差单元13,用于根据所述图像块和所述预测块,得到所述图像块的残差块;
变换单元14,用于对所述残差块进行变换,得到至少一个变换系数;
量化单元15,用于针对所述至少一个变换系数中的每个变换系数,从N个量化器中确定一个目标量化器对所述变换系数进行量化,得到量化系数,所述N为大于或等于2的正整数,所述N个量化器中至少有一个量化器为可以将所述变换系数均量化为非零量化系数的非零量化器;
编码单元16,用于对所述量化系数进行编码,得到码流。
在一些实施例中,所述N个量化器中至少有一个量化器为可以将所述变换系数量化为零的零点量化器。
在一些实施例中,所述N个量化器包括一个零点量化器和一个非零量化器。
在一些实施例中,量化单元15,具体用于根据当前状态机所处的状态,从所述N个量化器中确定所述目标量化器;使用所述目标量化器对所述变换系数进行量化,得到所 述量化系数。
在一些实施例中,所述码流中包括所述状态机的初始状态。
在一些实施例中,所述状态机的初始状态为0。
在一些实施例中,所述码流中包括非零量化器标识,所述非零量化器标识用于标识所述目标量化器是否为非零量化器。
在一些实施例中,量化单元15,具体用于根据所述变换系数对应的状态机当前所处的状态,从所述N个量化器中确定所述目标量化器;若所述目标量化器为非零量化器,则使用所述目标量化器对所述变换系数进行量化,得到初始量化值;对所述初始量化值减去第一数值,得到所述量化系数。
可选的,所述第一数值为正整数1。
在一些实施例中,所述量化系数的位置在系数扫描区域的左下角且为当前行唯一非零系数,或者所述量化系数的位置在系数扫描区域的右上角且为当前列唯一非零系数,或者所述目标量化器为非零量化器时,所述码流中不包括系数非零标志位,所述系数非零标志位用于指示所述量化系数是否为零。
在一些实施例中,在所述目标量化器为非零量化器时,所述系数非零标志位的值为第二数值。
可选的,所述第二数值为1。
在一些实施例中,编码单元16,还用于根据所述状态机的当前状态和所述量化系数的绝对值,更新所述状态机的状态。
应理解,装置实施例与方法实施例可以相互对应,类似的描述可以参照方法实施例。为避免重复,此处不再赘述。具体地,图14所示的视频编码器10可以执行本申请实施例的方法,并且视频编码器10中的各个单元的前述和其它操作和/或功能分别为了实现方法等各个方法中的相应流程,为了简洁,在此不再赘述。
图15是本申请实施例提供的视频解码器的示意性框图。
如图15所示,该视频解码器20可包括:
解码单元21,用于解码码流,得到待解码的图像块的至少一个量化系数,所述量化系数经过N个量化器中的一个量化器量化得到,所述N为大于或等于2的正整数,所述N个量化器中至少有一个量化器为可以将变换系数均量化为非零量化系数的非零量化器;
反量化单元22,用于针对所述至少一个量化系数中的每个量化系数,对所述量化系 数进行反量化,得到变换系数;
反变换单元23,用于对所述变换系数进行反变换,得到所述图像块的残差块;
预测单元24,用于确定所述图像块的预测块;
重建单元25,用于根据所述图像块的预测块和残差块,得到所述图像块的重建块。
在一些实施例中,反量化单元22,具体用于确定所述量化系数的非零标志位的值;
解码所述码流,得到所述量化系数的绝对值;根据所述量化系数的非零标志位的值和所述量化系数的绝对值,对所述量化系数进行反量化,得到所述变换系数。
在一些实施例中,反量化单元22,具体用于若所述量化系数在系数扫描区域的左下角且为当前行唯一非零系数,或者所述量化系数在所述系数扫描区域的右上角且为当前列唯一非零系数,或者根据状态机的当前状态确定所述量化系数是使用非零量化器量化得到的,则确定所述量化系数的非零标志位的值为第二数值,所述第二数值用于指示所述量化系数为非零值。
可选的,所述第二数值为1。
在一些实施例中,反量化单元22,具体用于根据状态机的当前状态,确定量化所述量化系数所使用的量化器是否为非零量化器;若确定量化所述量化系数所使用的量化器为非零量化器,对所述量化系数的绝对值和第一数值求和;根据所述量化系数的非零标志位的值,以及求和后的所述量化系数的绝对值,得到所述变换系数。
可选的,所述第一数值为1。
在一些实施例中,反量化单元22,还用于根据状态机的当前状态和所述量化系数的绝对值,更新所述状态机的状态。
应理解,装置实施例与方法实施例可以相互对应,类似的描述可以参照方法实施例。为避免重复,此处不再赘述。具体地,图15所示的视频解码器20可以对应于执行本申请实施例的方法中的相应主体,并且视频解码器20中的各个单元的前述和其它操作和/或功能分别为了实现方法等各个方法中的相应流程,为了简洁,在此不再赘述。
上文中结合附图从功能单元的角度描述了本申请实施例的装置和系统。应理解,该功能单元可以通过硬件形式实现,也可以通过软件形式的指令实现,还可以通过硬件和软件单元组合实现。具体地,本申请实施例中的方法实施例的各步骤可以通过处理器中的硬件的集成逻辑电路和/或软件形式的指令完成,结合本申请实施例公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件单元组合执行完成。可选地,软件单元可以位于随机存储器,闪存、只读存储器、可编程只读存 储器、电可擦写可编程存储器、寄存器等本领域的成熟的存储介质中。该存储介质位于存储器,处理器读取存储器中的信息,结合其硬件完成上述方法实施例中的步骤。
图16是本申请实施例提供的电子设备30的示意性框图。
如图16所示,该电子设备30可以为本申请实施例所述的视频编码器,或者视频解码器,该电子设备30可包括:
存储器33和处理器32,该存储器33用于存储计算机程序34,并将该程序代码34传输给该处理器32。换言之,该处理器32可以从存储器33中调用并运行计算机程序34,以实现本申请实施例中的方法。
例如,该处理器32可用于根据该计算机程序34中的指令执行上述方法中的步骤。
在本申请的一些实施例中,该处理器32可以包括但不限于:
通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等等。
在本申请的一些实施例中,该存储器33包括但不限于:
易失性存储器和/或非易失性存储器。其中,非易失性存储器可以是只读存储器(Read-Only Memory,ROM)、可编程只读存储器(Programmable ROM,PROM)、可擦除可编程只读存储器(Erasable PROM,EPROM)、电可擦除可编程只读存储器(Electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(Random Access Memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(Static RAM,SRAM)、动态随机存取存储器(Dynamic RAM,DRAM)、同步动态随机存取存储器(Synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(Double Data Rate SDRAM,DDR SDRAM)、增强型同步动态随机存取存储器(Enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(synch link DRAM,SLDRAM)和直接内存总线随机存取存储器(Direct Rambus RAM,DR RAM)。
在本申请的一些实施例中,该计算机程序34可以被分割成一个或多个单元,该一个或者多个单元被存储在该存储器33中,并由该处理器32执行,以完成本申请提供的方法。该一个或多个单元可以是能够完成特定功能的一系列计算机程序指令段,该指令段用于描述该计算机程序34在该电子设备30中的执行过程。
如图16所示,该电子设备30还可包括:
收发器33,该收发器33可连接至该处理器32或存储器33。
其中,处理器32可以控制该收发器33与其他设备进行通信,具体地,可以向其他设备发送信息或数据,或接收其他设备发送的信息或数据。收发器33可以包括发射机和接收机。收发器33还可以进一步包括天线,天线的数量可以为一个或多个。
应当理解,该电子设备30中的各个组件通过总线系统相连,其中,总线系统除包括数据总线之外,还包括电源总线、控制总线和状态信号总线。
图17是本申请实施例提供的视频编解码系统40的示意性框图。
如图17所示,该视频编解码系统40可包括:视频编码器41和视频解码器42,其中视频编码器41用于执行本申请实施例涉及的视频编码方法,视频解码器42用于执行本申请实施例涉及的视频解码方法。
本申请还提供了一种计算机存储介质,其上存储有计算机程序,该计算机程序被计算机执行时使得该计算机能够执行上述方法实施例的方法。或者说,本申请实施例还提供一种包含指令的计算机程序产品,该指令被计算机执行时使得计算机执行上述方法实施例的方法。
当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。该计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行该计算机程序指令时,全部或部分地产生按照本申请实施例该的流程或功能。该计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。该计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,该计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(digital subscriber line,DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。该计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。该可用介质可以是磁性介质(例如,软盘、硬盘、磁带)、光介质(例如数字视频光盘(digital video disc,DVD))、或者半导体介质(例如固态硬盘(solid state disk,SSD))等。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术 人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,该单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。例如,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。
以上该,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以该权利要求的保护范围为准。

Claims (25)

  1. 一种视频编码方法,其特征在于,包括:
    获取待编码的图像块;
    对所述图像块进行预测,得到所述图像块的预测块;
    根据所述图像块和所述预测块,得到所述图像块的残差块;
    对所述残差块进行变换,得到至少一个变换系数;
    针对所述至少一个变换系数中的每个变换系数,从N个量化器中确定一个目标量化器对所述变换系数进行量化,得到量化系数,所述N为大于或等于2的正整数,所述N个量化器中至少有一个量化器为可以将变换系数均量化为非零量化系数的非零量化器;
    对所述量化系数进行编码,得到码流。
  2. 根据权利要求1所述的方法,其特征在于,所述N个量化器中至少有一个量化器为可以将变换系数量化为零的零点量化器。
  3. 根据权利要求2所述的方法,其特征在于,所述N个量化器包括一个零点量化器和一个非零量化器。
  4. 根据权利要求1所述的方法,其特征在于,所述从N个量化器中确定一个目标量化器对所述变换系数进行量化,得到量化系数,包括:
    根据当前状态机所处的状态,从所述N个量化器中确定所述目标量化器;
    使用所述目标量化器对所述变换系数进行量化,得到所述量化系数。
  5. 根据权利要求4所述的方法,其特征在于,所述码流中包括所述状态机的初始状态。
  6. 根据权利要求5所述的方法,其特征在于,所述状态机的初始状态为0。
  7. 根据权利要求4所述的方法,其特征在于,所述码流中包括非零量化器标识,所述非零量化器标识用于标识所述目标量化器是否为非零量化器。
  8. 根据权利要求1所述的方法,其特征在于,所述从N个量化器中确定一个目标量化器对所述变换系数进行量化,得到量化系数,包括:
    根据所述变换系数对应的状态机当前所处的状态,从所述N个量化器中确定所述目标量化器;
    若所述目标量化器为非零量化器,则使用所述目标量化器对所述变换系数进行量化,得到初始量化值;
    对所述初始量化值减去第一数值,得到所述量化系数。
  9. 根据权利要求8所述的方法,其特征在于,所述第一数值为正整数1。
  10. 根据权利要求4-9任一项所述的方法,其特征在于,
    所述目标量化器为非零量化器时,所述码流中不包括系数非零标志位,所述系数非零标志位用于指示所述量化系数是否为零。
  11. 根据权利要求10所述的方法,其特征在于,在所述目标量化器为非零量化器时,所述系数非零标志位的值为第二数值。
  12. 根据权利要求11所述的方法,其特征在于,所述第二数值为1。
  13. 根据权利要求4-9任一项所述的方法,其特征在于,所述方法还包括:
    根据所述状态机的当前状态和所述量化系数的绝对值,更新所述状态机的状态。
  14. 一种视频解码方法,其特征在于,包括:
    解码码流,得到待解码的图像块的至少一个量化系数,所述量化系数经过N个量化器中的一个量化器量化得到,所述N为大于或等于2的正整数,所述N个量化器中至少有一个量化器为可以将变换系数均量化为非零量化系数的非零量化器;
    针对所述至少一个量化系数中的每个量化系数,对所述量化系数进行反量化,得到变换系数;
    对所述变换系数进行反变换,得到所述图像块的残差块;
    确定所述图像块的预测块;
    根据所述图像块的预测块和残差块,得到所述图像块的重建块。
  15. 根据权利要求14所述的方法,其特征在于,所述对所述量化系数进行反量化,得到变换系数,包括:
    确定所述量化系数的非零标志位的值;
    解码所述码流,得到所述量化系数的绝对值;
    根据所述量化系数的非零标志位的值和所述量化系数的绝对值,对所述量化系数进行反量化,得到所述变换系数。
  16. 根据权利要求15所述的方法,其特征在于,所述确定所述量化系数的非零标志位的值,包括:
    若根据状态机的当前状态确定所述量化系数是使用非零量化器量化得到的,则确定所述量化系数的非零标志位的值为第二数值,所述第二数值用于指示所述量化系数为非零值。
  17. 根据权利要求16所述的方法,其特征在于,所述第二数值为1。
  18. 根据权利要求15所述的方法,其特征在于,所述根据所述量化系数的非零标志位的值和所述量化系数的绝对值,得到所述变换系数之前,所述方法还包括:
    根据状态机的当前状态,确定量化所述量化系数所使用的量化器是否为非零量化器;
    若确定量化所述量化系数所使用的量化器为非零量化器,则所述根据所述量化系数的非零标志位的值和所述量化系数的绝对值,得到所述变换系数,包括:
    对所述量化系数的绝对值和第一数值求和;
    根据所述量化系数的非零标志位的值,以及求和后的所述量化系数的绝对值,得到所述变换系数。
  19. 根据权利要求18所述的方法,其特征在于,所述第一数值为1。
  20. 根据权利要求15所述的方法,其特征在于,所述方法还包括:
    根据状态机的当前状态和所述量化系数的绝对值,更新所述状态机的状态。
  21. 一种视频编码器,其特征在于,包括:
    获取单元,用于获取待编码的图像块;
    预测单元,用于对所述图像块进行预测,得到所述图像块的预测块;
    残差单元,用于根据所述图像块和所述预测块,得到所述图像块的残差块;
    变换单元,用于对所述残差块进行变换,得到至少一个变换系数;
    量化单元,用于针对所述至少一个变换系数中的每个变换系数,从N个量化器中确定一个目标量化器对所述变换系数进行量化,得到量化系数,所述N为大于或等于2的正整数,所述N个量化器中至少有一个量化器为可以将变换系数均量化为非零量化系数的非零量化器;
    编码单元,用于对所述量化系数进行编码,得到码流。
  22. 一种视频解码器,其特征在于,包括:
    解码单元,用于解码码流,得到待解码的图像块的至少一个量化系数,所述量化系数经过N个量化器中的一个量化器量化得到,所述N为大于或等于2的正整数,所述N个量化器中至少有一个量化器为可以将变换系数均量化为非零量化系数的非零量化器;
    反量化单元,用于针对所述至少一个量化系数中的每个量化系数,对所述量化系数进行反量化,得到变换系数;
    反变换单元,用于对所述变换系数进行反变换,得到所述图像块的残差块;
    预测单元,用于确定所述图像块的预测块;
    重建单元,用于根据所述图像块的预测块和残差块,得到所述图像块的重建块。
  23. 一种视频编解码系统,其特征在于,包括:
    根据权利要求21所述的视频编码器;
    以及根据权利要求22所述的视频解码器。
  24. 一种电子设备,其特征在于,包括:存储器,处理器;
    所述存储器,用于存储计算机程序;
    所述处理器,用于执行所述计算机程序以实现如上述权利要求1至13或14至20任一项所述方法。
  25. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有计算机执行指令,所述计算机执行指令被处理器执行时用于实现如权利要求1-20任一项所述的方法。
PCT/CN2021/078968 2021-02-22 2021-03-03 视频编解码方法与系统、及视频编码器与视频解码器 WO2022174475A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202180091177.5A CN116918326A (zh) 2021-02-22 2021-03-03 视频编解码方法与系统、及视频编码器与视频解码器

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110200043.4 2021-02-22
CN202110200043 2021-02-22

Publications (1)

Publication Number Publication Date
WO2022174475A1 true WO2022174475A1 (zh) 2022-08-25

Family

ID=82932072

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/078968 WO2022174475A1 (zh) 2021-02-22 2021-03-03 视频编解码方法与系统、及视频编码器与视频解码器

Country Status (2)

Country Link
CN (1) CN116918326A (zh)
WO (1) WO2022174475A1 (zh)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111131819A (zh) * 2018-10-31 2020-05-08 北京字节跳动网络技术有限公司 依赖性量化的编码工具下的量化参数
EP3742730A1 (en) * 2019-05-20 2020-11-25 InterDigital VC Holdings, Inc. Scalar quantizer decision scheme for dependent scalar quantization
CN112352429A (zh) * 2018-07-02 2021-02-09 高通股份有限公司 利用分组的旁路剩余级别进行系数编码以用于依赖量化

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112352429A (zh) * 2018-07-02 2021-02-09 高通股份有限公司 利用分组的旁路剩余级别进行系数编码以用于依赖量化
CN111131819A (zh) * 2018-10-31 2020-05-08 北京字节跳动网络技术有限公司 依赖性量化的编码工具下的量化参数
EP3742730A1 (en) * 2019-05-20 2020-11-25 InterDigital VC Holdings, Inc. Scalar quantizer decision scheme for dependent scalar quantization

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
H. SCHWARZ (FRAUNHOFER), T. NGUYEN (FRAUNHOFER), D. MARPE (FRAUNHOFER), T. WIEGAND (FRAUNHOFER HHI): "CE7: Transform coefficient coding and dependent quantization (Tests 7.1.2, 7.2.1)", 11. JVET MEETING; 20180711 - 20180718; LJUBLJANA; (THE JOINT VIDEO EXPLORATION TEAM OF ISO/IEC JTC1/SC29/WG11 AND ITU-T SG.16 ), 11 July 2018 (2018-07-11), XP030199394 *

Also Published As

Publication number Publication date
CN116918326A (zh) 2023-10-20

Similar Documents

Publication Publication Date Title
TWI755376B (zh) 用於視訊寫碼之濾波器之幾何轉換
TWI666920B (zh) 用於視訊寫碼之具有執行長度碼之調色盤預測器信令
TWI714548B (zh) 用於視訊寫碼之調色盤索引分組
TWI827606B (zh) 網格寫碼之量化係數寫碼
CN112352429B (zh) 对视频数据进行编解码的方法、设备和存储介质
WO2020125595A1 (zh) 视频译码器及相应方法
WO2020143585A1 (zh) 视频编码器、视频解码器及相应方法
WO2023039859A1 (zh) 视频编解码方法、设备、系统、及存储介质
CN113647103A (zh) 用于基于矩阵的帧内预测技术的量化系数的方法和设备
CN113170108A (zh) 使用显式和隐式信令对不可用参考帧进行自适应块更新
WO2022193868A1 (zh) 未匹配像素的解码方法、编码方法、解码器以及编码器
CN112567740A (zh) 用于帧内预测的方法和装置
WO2022174475A1 (zh) 视频编解码方法与系统、及视频编码器与视频解码器
WO2022193390A1 (zh) 视频编解码方法与系统、及视频编解码器
WO2022217447A1 (zh) 视频编解码方法与系统、及视频编解码器
WO2022193389A1 (zh) 视频编解码方法与系统、及视频编解码器
WO2022155922A1 (zh) 视频编解码方法与系统、及视频编码器与视频解码器
WO2023092404A1 (zh) 视频编解码方法、设备、系统、及存储介质
CN112135149A (zh) 语法元素的熵编码/解码方法、装置以及编解码器
WO2023236113A1 (zh) 视频编解码方法、装置、设备、系统及存储介质
WO2023122968A1 (zh) 帧内预测方法、设备、系统、及存储介质
WO2022179394A1 (zh) 图像块预测样本的确定方法及编解码设备
WO2023184250A1 (zh) 视频编解码方法、装置、设备、系统及存储介质
WO2023173255A1 (zh) 图像编解码方法、装置、设备、系统、及存储介质
WO2022116105A1 (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: 21926192

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 202180091177.5

Country of ref document: CN

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21926192

Country of ref document: EP

Kind code of ref document: A1