WO2023004590A1 - Video decoding and encoding methods and devices, and storage medium - Google Patents

Video decoding and encoding methods and devices, and storage medium Download PDF

Info

Publication number
WO2023004590A1
WO2023004590A1 PCT/CN2021/108723 CN2021108723W WO2023004590A1 WO 2023004590 A1 WO2023004590 A1 WO 2023004590A1 CN 2021108723 W CN2021108723 W CN 2021108723W WO 2023004590 A1 WO2023004590 A1 WO 2023004590A1
Authority
WO
WIPO (PCT)
Prior art keywords
quantization
image
encoded
scalar
quantization mode
Prior art date
Application number
PCT/CN2021/108723
Other languages
French (fr)
Chinese (zh)
Inventor
唐桐
Original Assignee
Oppo广东移动通信有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Priority to PCT/CN2021/108723 priority Critical patent/WO2023004590A1/en
Priority to CN202180099003.3A priority patent/CN117426089A/en
Publication of WO2023004590A1 publication Critical patent/WO2023004590A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/124Quantisation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/124Quantisation
    • H04N19/126Details of normalisation or weighting functions, e.g. normalisation matrices or variable uniform quantisers

Definitions

  • Embodiments of the present disclosure relate to but are not limited to the technical field of video data processing, and in particular relate to a video decoding method, encoding method, device, system, storage medium, and code stream.
  • FIG. 1 is a structural block diagram of a video codec system that can be used in an embodiment of the present disclosure
  • mainstream video codec standards include H.264/Advanced Video Coding (Advanced Video Coding, AVC), H.265/High Efficiency Video Coding (High Efficiency Video Coding, HEVC), H.266/Versatile Video Coding (Multiple Functional Video Coding, VVC), MPEG (Moving Picture Experts Group, Dynamic Image Experts Group), AOM (Open Media Alliance, Alliance for Open Media), AVS (Audio Video coding Standard, audio and video coding standards) and the expansion of these standards, Or any other custom standards, etc. These standards reduce the amount of transmitted data and stored data through video compression technology, so as to achieve more efficient video codec and transmission storage.
  • FIG. 1 is a block diagram of a video encoding and decoding system applicable to an embodiment of the present disclosure.
  • the system is divided into an encoding-side device 1 and a decoding-side device 2 , and the encoding-side device 1 encodes video images to generate a code stream.
  • the device 2 on the decoding side can decode the code stream to obtain a reconstructed video image.
  • the encoding side device 1 and the decoding side device 2 may include one or more processors and memory coupled to the one or more processors, such as random access memory, charged erasable programmable read-only memory, flash memory or other media.
  • the encoding side device 1 and the decoding side device 2 can be implemented with various devices, such as desktop computers, mobile computing devices, notebook computers, tablet computers, set-top boxes, televisions, cameras, display devices, digital media players, vehicle-mounted computers, or other similar installation.
  • the decoding side device 2 includes an input interface 21 , a decoder 23 and a display device 25 .
  • input interface 21 includes at least one of a receiver and a modem.
  • the input interface 21 can receive the code stream via the link 3 or from a storage device.
  • the decoder 23 decodes the received code stream.
  • the display device 25 is used for displaying the decoded data, and the display device 25 may be integrated with other devices of the decoding side device 2 or provided separately.
  • the display device 25 may be, for example, a liquid crystal display, a plasma display, an organic light emitting diode display or other types of display devices.
  • the device 2 on the decoding side may not include the display device 25 , or may include other devices or devices for applying the decoded data.
  • Encoder 13 and decoder 23 of Fig. 1 can use any one in the following circuits or any combination of following circuits to realize: one or more microprocessors, digital signal processors, application specific integrated circuits, field programmable gate arrays , discrete logic, hardware. If the present disclosure is implemented partially in software, instructions for the software may be stored in a suitable non-transitory computer-readable storage medium and executed in hardware using one or more processors to thereby Implement the disclosed method.
  • the video encoder 20 is used to encode video data to generate code streams.
  • the video encoder 20 includes a prediction processing unit 100, a division unit 101, a prediction residual generation unit 102, a transformation processing unit 104, a quantization unit 106, an inverse quantization unit 108, an inverse transformation processing unit 110, a reconstruction unit 112, A filter unit 113 , a decoded picture buffer 114 , and an entropy coding unit 116 .
  • the prediction processing unit 100 includes an inter prediction processing unit 121 and an intra prediction processing unit 126 .
  • video encoder 20 may contain more, fewer or different functional components than this example. Both the prediction residual generation unit 102 and the reconstruction unit 112 are represented by circles with plus signs in the figure.
  • the inter prediction processing unit 121 may perform inter prediction on the PU to generate prediction data of the PU, the prediction data including the prediction block of the PU, motion information of the PU and various syntax elements.
  • the quantization unit 106 can quantize the coefficients in the coefficient block based on a selected quantization parameter (QP). Quantization may cause quantization losses. By adjusting the QP value, the degree of quantization of the coefficient block can be adjusted.
  • QP quantization parameter
  • the inverse quantization unit 108 and the inverse transformation unit 110 may respectively apply inverse quantization and inverse transformation to the coefficient blocks to obtain TU-associated reconstructed prediction residual blocks.
  • the reconstruction unit 112 may generate a reconstructed block of the CU based on the reconstructed prediction residual block and the prediction block generated by the prediction processing unit 100 .
  • the filter unit 113 performs loop filtering on the reconstructed block and stores it in the decoded picture buffer 114 .
  • the intra prediction processing unit 126 may extract the reconstructed reference information adjacent to the PU from the reconstructed blocks cached in the decoded picture buffer 114 to perform intra prediction on the PU.
  • Inter prediction processing unit 121 may perform inter prediction on PUs of other pictures using reference pictures cached by decoded picture buffer 114 that contain reconstructed blocks.
  • the entropy coding unit 116 can perform entropy coding operations on received data (such as syntax elements, quantized system blocks, motion information, etc.), such as performing context adaptive variable length coding (CAVLC: Context Adaptive Variable Length Coding), context self- Adapt to Binary Arithmetic Coding (CABAC: Context-based Adaptive Binary Arithmetic Coding), etc., and output code stream (that is, coded video code stream).
  • CAVLC Context Adaptive Variable Length Coding
  • CABAC Context-based Adaptive Binary Arithmetic Coding
  • FIG. 3 is a structural block diagram of an exemplary video decoder.
  • the description is mainly based on the terminology and block division of the H.265/HEVC standard, but the structure of the video decoder can also be used for videos of H.264/AVC, H.266/VVC and other similar standards decoding.
  • the entropy decoding unit 150 may perform entropy decoding on the received code stream to extract information such as syntax elements, quantized coefficient blocks, and PU motion information.
  • the prediction processing unit 152 , the inverse quantization unit 154 , the inverse transform processing unit 156 , the reconstruction unit 158 and the filter unit 159 can all perform corresponding operations based on the syntax elements extracted from the code stream.
  • the inverse quantization unit 154 may inverse quantize the quantized TU-associated coefficient blocks.
  • Inverse transform processing unit 156 may apply one or more inverse transforms to the inverse quantized coefficient block in order to generate a reconstructed prediction residual block for the TU.
  • the reconstruction unit 158 may obtain the reconstruction block of the CU based on the reconstruction prediction residual block associated with the TU and the prediction block of the PU generated by the prediction processing unit 152 (ie intra prediction data or inter prediction data).
  • the filter unit 159 may perform loop filtering on the reconstructed block of the CU to obtain a reconstructed picture.
  • the reconstructed pictures are stored in the picture buffer 160 .
  • the picture buffer 160 can provide reference pictures for subsequent motion compensation, intra prediction, inter prediction, etc., and can also output the reconstructed video data as decoded video data for presentation on a display device.
  • encoding at the encoder end and decoding at the decoder end may also be collectively referred to as encoding or decoding. According to the contextual description of the relevant steps, those skilled in the art can know whether the encoding (decoding) mentioned later refers to the encoding at the encoder end or the decoding at the decoder end.
  • CTU is the abbreviation of Coding Tree Unit, which is equivalent to the macroblock in H.264/AVC.
  • a coding tree unit should contain one luma coding tree block (CTB) and two chrominance coding tree blocks (CTB) (CrCb) at the same position.
  • the coding unit CU (Coding Unit) is the basic unit for various types of coding operations or decoding operations in the video coding and decoding process, such as CU-based prediction, transformation, entropy coding, and other operations.
  • CU refers to a two-dimensional sampling point array, which may be a square array or a rectangular array.
  • a 4x8 CU can be regarded as a square sampling point array composed of 4x8 and 32 sampling points.
  • a CU may also be called a tile.
  • a CU may include a coding block and corresponding syntax elements.
  • the residual block refers to the residual image block formed by subtracting the predicted block from the current block to be coded after the predicted block of the current block is generated by inter-frame prediction and/or intra-frame prediction, which can also be called residual bad data.
  • the coefficient block includes transforming the residual block to obtain a transform block containing transform coefficients, or not transforming the residual block, including a residual block containing residual data (residual signal).
  • the coefficients include the coefficients of the transform block obtained by transforming the residual block, or the coefficients of the residual block, and performing entropy coding on the coefficients includes performing entropy coding on the coefficients of the transform block after quantization, or, if not Applying a transform to the residual data includes entropy coding the quantized coefficients of the residual block.
  • the untransformed residual signal and the transformed residual signal may also be collectively referred to as coefficients. for effective compression. Generally, the coefficients need to be quantized, and the quantized coefficients can also be called levels.
  • the realization process of dependent scalar quantization is: (a) define two scalar quantizers with different reconstruction levels; (b) define the conversion mode between the two scalar quantizers.
  • the transition between the two scalar quantizers is implemented by a state machine with 4 states, as shown in Figure 5.
  • Status can take 4 different values: 0, 1, 2, 3. It is uniquely determined by the parity of the variable coefficient level preceding the current transform coefficient in encoding/reconstruction order.
  • the state is set to 0 at the initial stage of transform block dequantization. Transform coefficients are reconstructed in scan order (eg same as entropy decoding order). After the current transform coefficient is rebuilt, its state is updated as shown above, and k represents the transform coefficient level value.
  • the scalar-dependent quantization DSQ involves the quantization unit 106 and the inverse quantization unit 108 as shown in FIG. 2 ; at the decoding end, the scalar-dependent quantization DSQ involves the inverse quantization unit 154 as shown in FIG. 3 .
  • an implementation method of an encoder using DSQ is as follows. First, the input image is partitioned into non-overlapping CTU blocks. Then, each CTU is processed sequentially according to the raster scan sequence, and the CTU is divided into several blocks (CU1, CU2, ..., CUi, ...) according to the optimal mode determined by intra/inter prediction, and the corresponding prediction residuals are obtained. difference block (resB1, resB2, ..., resBi, ). Then, transform and quantize the residual block. The main steps of quantization are as follows:
  • an implementation method of a decoder using DSQ is as follows. First, entropy decoding is performed on the input code stream, and transformed and quantized residual blocks (resB*1, resB*2, ..., resB*i, ...) are obtained. Then, the residual block is dequantized. The main steps are as follows:
  • inverse transform is performed on the inversely quantized residual block, and the inversely transformed residual value and predicted value are superimposed to obtain a reconstructed CU until the reconstruction of the current CTU is completed.
  • the DSQ technology applied to the video codec chip can further improve the coding performance.
  • an embodiment of the present disclosure proposes an adaptive quantization technology based on spatial continuity analysis.
  • the technical scheme first analyzes the video content, calculates the continuity of the image content, and then designs an adaptive quantization technology based on this. When the video image content shows strong discontinuity, non-dependent scalar quantization is adopted; otherwise, dependent scalar quantization is adopted.
  • An embodiment of the present disclosure provides a video coding method, as shown in FIG. 6 , including:
  • Step 601 determine the spatial continuity feature value of the image to be encoded
  • Step 602 Determine, according to the spatial continuity feature value, whether to quantize the image to be encoded by means of DSQ-dependent scalar quantization or non-scalar-dependent quantization.
  • the video coding method includes:
  • Step 601 determine the spatial continuity feature value of the image to be encoded
  • Step 6021 in the case that the feature value of the spatial continuity is within the feature value threshold range, quantize the image to be encoded using scalar-dependent quantization;
  • Step 6022 In the case that the spatial continuity feature value is outside the feature value threshold range, quantize the image to be coded using scalar-independent quantization.
  • the spatial continuity feature value is a value used to characterize the spatial continuity of the image content to be encoded.
  • the scalar-dependent/scalar-independent quantization method for the image to be encoded refers to: the scalar-dependent/scalar-independent quantization method is used for quantization of the coefficient block corresponding to the image to be encoded.
  • the coefficient block includes transforming the residual block to obtain a transform block containing transform coefficients; or not transforming the residual block, including a residual block containing residual data (residual signal).
  • step 6021 quantization is performed on the image to be encoded using a scalar-dependent quantization method, including: sequentially performing the following steps on each residual block obtained after dividing and predicting the image to be encoded:
  • the quantization of the image to be coded using a dependent scalar quantization method includes: sequentially performing the following steps on each residual block obtained after dividing and predicting the image to be coded:
  • the method further includes: performing entropy coding on the quantized coefficients to form an output code stream.
  • the image to be encoded is a frame to be encoded (Frame) or a slice to be encoded (Slice).
  • determining the spatial continuity feature value of the image to be encoded in step 601 includes:
  • the feature value of spatial continuity is determined according to the gradient map of the image to be encoded.
  • determining the spatial continuity feature value of the image to be encoded in step 601 includes:
  • the first gradient map is a gradient map corresponding to the image to be encoded;
  • the second gradient map is a gradient map corresponding to the first gradient map.
  • the first gradient of each pixel in the first gradient map is determined in the following manner:
  • Gmap(x,y)
  • (x, y) represents the pixel in the image to be encoded
  • I (x, y) is the pixel value of the pixel (x, y)
  • Gmap (x, y) is the pixel (x, y)
  • the pixel value I(x, y) is the luminance component Y on the pixel point (x, y).
  • the second gradient of each pixel in the second gradient map is determined in the following manner:
  • GGmap(x,y)
  • Gmap(x, y) is the first gradient of the pixel point (x, y)
  • GGmap(x, y) is the second gradient of the pixel point (x, y).
  • the calculating the average value according to the second gradient map includes: calculating the average value according to the second gradients of all pixels in the second gradient map.
  • the feature value of the spatial continuity in step 6021 is within the feature threshold range, including: the spatial continuity feature value is smaller than a preset threshold, and is determined to be within the feature threshold range. That is, the spatial continuity eigenvalue of the image to be encoded is calculated according to the above method, and when the spatial continuity eigenvalue is smaller than the preset threshold, it is determined that the spatial continuity of the image to be encoded is strong, and subsequent dependent scalar quantization DSQ Quantization and/or dequantization by way of quantization and/or dequantization; in the case that the spatial continuity feature value is greater than or equal to the preset feature threshold, it is determined that the spatial continuity of the image to be encoded is not strong, and subsequent quantization and / or dequantization. That is, in this embodiment, the feature value threshold range includes: feature values smaller than a preset threshold.
  • the spatial continuity feature value is used to characterize the spatial continuity of the image content to be encoded, except for the method of calculating the first gradient map and the second gradient map in the above example.
  • those skilled in the art can also choose other similar or equivalent methods to calculate the spatial continuity eigenvalues of the image to be encoded.
  • the specific calculation schemes are different, and their corresponding eigenvalue threshold ranges are different.
  • the image to be encoded within the eigenvalue threshold range is an image with strong spatial continuity, and the image to be encoded outside the eigenvalue threshold range is spatially continuous. Not strong image.
  • the specific calculation method of the spatial continuity feature value and the corresponding feature value threshold range are not limited to the aspects of the above examples of the present disclosure.
  • the method further includes:
  • Step 603 write the quantization mode identifier into the encoded code stream; wherein, the quantization mode identifier indicates a scalar-dependent quantization mode or a scalar-independent quantization mode.
  • writing the quantization mode identifier into the encoded code stream in step 603 includes: writing the quantization mode identifier into one of the following syntax elements of the encoded code stream: sequence (Sequence) level syntax elements, frame (Frame) level syntax elements and slice (Slice) level syntax elements.
  • the encoding end After the encoding end determines quantization modes for different images, it writes the quantization mode identification corresponding to the determined quantization mode into the coded code stream.
  • the quantization method identifies syntax elements carried at different levels in the code stream.
  • the decoder After the decoder parses the code stream and obtains the identifier, it will execute the corresponding dequantization method according to the identifier.
  • the quantization mode identifier written by the encoding end will be analyzed and obtained by the decoding end, and the identifier can also be understood as an inverse quantization mode identifier at the decoding end.
  • the quantization mode identifiers of each image to be encoded in step 603 may also be combined and set by multiple identifiers. According to the preset combination setting rules, the decoder can reversely analyze each quantization mode identifier.
  • the quantization mode of the first 5 images is marked as 1, and the quantization mode of the last 11 images is marked as 0, then 16-bit data 1111100000000000 can be set in the sequence-level syntax unit, Indicates that the quantization methods of the 16 images included in the sequence are scalar-dependent quantization DSQ or scalar-independent quantization respectively; or, 1, 5, 1; 6, 11, 0 can be set in the sequence-level syntax unit;
  • the quantization mode of 5 consecutive images from the first image is marked as 1 (indicating dependent scalar quantization DSQ), and the quantization mode of 11 consecutive images starting from the 6th image is marked as 0 (non-scalar quantization); or, also 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 can be set in 16 image-level syntax units.
  • the solution provided by the embodiments of the present disclosure can indicate the image quantization or inverse quantization mode by extending the data carried in the encoded code stream.
  • the specific position of the carried data and/or the coding method of the carried data are not limited to The content of the example is disclosed, and those skilled in the art may alternatively select different implementations according to the above examples.
  • An embodiment of the present disclosure also provides a video coding method, the steps related to quantization are shown in FIG. 8 , including:
  • Step 801 calculating the spatial continuity feature value ss of the i-th frame image
  • Step 802 judging whether the feature value ss is less than the preset feature threshold T; if it is less, then perform step 803; if it is greater than or equal to, then perform step 804;
  • Step 803 determine that the quantization mode flag pic_DSQ_enable_flag of the i-th frame image is 1;
  • Gmap(x,y)
  • the quantization mode identifier indicates that it depends on the scalar quantization mode
  • the following steps are performed for each residual block obtained by entropy decoding the code stream in turn after transformation and quantization:
  • the decoding method described in the embodiments of the present disclosure focuses on the steps related to inverse quantization in the overall decoding process.
  • the implementation details of the decoding steps in other aspects can be implemented according to relevant specifications or schemes, and do not belong to the limitations or schemes of the present disclosure. The scope of protection will not be repeated here.
  • An embodiment of the present disclosure also provides a video decoding device, as shown in FIG. 10 , including a processor and a memory storing a computer program that can run on the processor, wherein the processor executes the computer The program realizes the video decoding method described in any embodiment of the present disclosure.
  • the functions described may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functions may be stored on or transmitted over, as one or more instructions or code, a computer-readable medium and executed by a hardware-based processing unit.
  • Computer-readable media may include computer-readable storage media that correspond to tangible media such as data storage media, or communication media including any medium that facilitates transfer of a computer program from one place to another, eg, according to a communication protocol. In this manner, a computer-readable medium may generally correspond to a non-transitory tangible computer-readable storage medium or a communication medium such as a signal or carrier wave.
  • Data storage media may be any available media that can be accessed by one or more computers or one or more processors to retrieve instructions, code and/or data structures for implementation of the techniques described in this disclosure.
  • a computer program product may comprise a computer readable medium.
  • disk and disc include compact disc (CD), laser disc, optical disc, digital versatile disc (DVD), floppy disk, or blu-ray disc, etc. where disks usually reproduce data magnetically, while discs use lasers to Data is reproduced optically. Combinations of the above should also be included within the scope of computer-readable media.

Landscapes

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

Abstract

Provided are video decoding and encoding methods, devices, and systems, and a storage medium. The decoding method comprises: parsing a code stream to obtain a quantization mode identifier of an image to be decoded (901); and inversely quantizing the image according to a quantization mode indicated by the quantization mode identifier (902), wherein the quantization mode identifier is an identifier which is used for indicating a dependence scalar quantization mode or a non-dependence scalar quantization mode and which is determined according to a spatial continuity feature value of a raw image. The encoding method comprises: according to the spatial continuity feature value, determining to use the dependence scalar quantization mode or the non-dependence scalar quantization mode on an image to be encoded to carry out quantization (602). Different quantization modes are used according to spatial continuity features of an image to be encoded, so that the encoding complexity can be reduced without lowering the encoding performance.

Description

一种视频解码、编码方法及设备、存储介质A video decoding and encoding method, device, and storage medium 技术领域technical field
本公开实施例涉及但不限于视频数据处理技术领域,尤其设及一种视频解码方法、编码方法及设备、系统、存储介质和码流。Embodiments of the present disclosure relate to but are not limited to the technical field of video data processing, and in particular relate to a video decoding method, encoding method, device, system, storage medium, and code stream.
背景技术Background technique
数字视频压缩技术主要是将庞大的数字影像视频数据进行压缩,以便于传输以及存储等。随着互联网视频的激增以及人们对视频清晰度的要求越来越高,尽管已有的数字视频压缩标准能够节省不少视频数据,但目前仍然需要追求更好的数字视频压缩技术,以减少数字视频传输的带宽和流量压力,达到更高效的视频编解码和传输存储。Digital video compression technology mainly compresses huge digital image and video data to facilitate transmission and storage. With the proliferation of Internet videos and people's higher and higher requirements for video clarity, although the existing digital video compression standards can save a lot of video data, it is still necessary to pursue better digital video compression technology to reduce digital video. The bandwidth and traffic pressure of video transmission achieve more efficient video codec and transmission storage.
发明内容Contents of the invention
以下是对本文详细描述的主题的概述。本概述并非是为了限制权利要求的保护范围。The following is an overview of the topics described in detail in this article. This summary is not intended to limit the scope of the claims.
本公开实施例提供了一种视频解码方法,包括:An embodiment of the present disclosure provides a video decoding method, including:
解析码流获得待解码图像的量化方式标识;Analyze the code stream to obtain the quantization mode identification of the image to be decoded;
根据所述量化方式标识所指示的量化方式,对所述待解码图像进行反量化;Dequantize the image to be decoded according to the quantization mode indicated by the quantization mode identifier;
其中,所述量化方式标识为根据原始图像的空域连续性特征值所确定的用于指示依赖标量量化方式或非依赖标量量化方式的标识。Wherein, the quantization mode identification is an identification determined according to the spatial continuity feature value of the original image to indicate a scalar-dependent quantization mode or a scalar-independent quantization mode.
本公开实施例还提供了一种视频编码方法,包括:An embodiment of the present disclosure also provides a video coding method, including:
确定待编码图像的空域连续性特征值;Determine the spatial continuity eigenvalue of the image to be encoded;
根据所述空域连续性特征值确定对所述待编码图像采用依赖标量量化方式或非依赖标量量化方式进行量化。Determining, according to the spatial continuity feature value, that the image to be encoded is quantized in a scalar-dependent quantization manner or in a scalar-independent quantization manner.
在本公开一实施例中,在所述空域连续性特征值位于特征值阈值范围内的情况下,对所述待编码图像采用依赖标量量化方式进行量化;In an embodiment of the present disclosure, when the spatial continuity eigenvalue is within the eigenvalue threshold range, the image to be encoded is quantized using a dependent scalar quantization method;
在所述空域连续性特征值位于特征值阈值范围外的情况下,对所述待编码图像采用非依赖标量量化方式进行量化。In the case that the spatial continuity feature value is outside the feature value threshold range, the image to be encoded is quantized using a scalar-independent quantization manner.
本公开实施例还提供了一种视频解码设备,包括处理器以及存储有可在所述处理器上运行的计算机程序的存储器,其中,所述处理器执行所述计算机程序时实现如本公开任一实施例所述的解码方法。An embodiment of the present disclosure also provides a video decoding device, including a processor and a memory storing a computer program that can run on the processor, wherein, when the processor executes the computer program, any aspect of the present disclosure can be implemented. A decoding method described in an embodiment.
本公开实施例还提供了一种视频编码设备,包括处理器以及存储有可在所述处理器上运行的计算机程序的存储器,其中,所述处理器执行所述计算机程序时实现本公开任一实施例所述的编码方法。An embodiment of the present disclosure also provides a video encoding device, including a processor and a memory storing a computer program that can run on the processor, wherein, when the processor executes the computer program, any one of the present disclosure can be realized. The encoding method described in the embodiment.
本公开实施例还提供了一种视频编解码系统,其中,包括如本公开任一实施例所述的解码设备和/或如本公开任一实施例所述的编码设备。An embodiment of the present disclosure further provides a video encoding and decoding system, which includes the decoding device according to any embodiment of the present disclosure and/or the encoding device according to any embodiment of the present disclosure.
本公开实施例还提供了一种非瞬态计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,其中,所述计算机程序时被处理器执行时实现如本公开任一实施例所述的视频解码方法或编码方法。An embodiment of the present disclosure also provides a non-transitory computer-readable storage medium, the computer-readable storage medium stores a computer program, wherein, when the computer program is executed by a processor, any embodiment of the present disclosure can be implemented. The video decoding method or encoding method.
本公开实施例还提供了一种码流,其中,所述码流根据本公开任一实施例所述的编码方法生成,其中,所述码流中包括量化方式标识,所述量化方式标识用于指示编码端对图像进行量化的方式。An embodiment of the present disclosure also provides a code stream, wherein the code stream is generated according to the encoding method described in any embodiment of the present disclosure, wherein the code stream includes a quantization mode identifier, and the quantization mode identifier is used for Indicates how the encoder quantizes the image.
在阅读并理解了附图和详细描述后,可以明白其他方面。Other aspects will be apparent to others upon reading and understanding the drawings and detailed description.
附图说明Description of drawings
附图用来提供对本公开实施例的理解,并且构成说明书的一部分,与本公开实施例一起用于解释本公开的技术方案,并不构成对本公开技术方案的限制。The accompanying drawings are used to provide an understanding of the embodiments of the present disclosure, and constitute a part of the description, together with the embodiments of the present disclosure, are used to explain the technical solutions of the present disclosure, and do not constitute limitations on the technical solutions of the present disclosure.
图1是可用于本公开实施例的一种视频编解码系统的结构框图;FIG. 1 is a structural block diagram of a video codec system that can be used in an embodiment of the present disclosure;
图2是可用于本公开实施例的一种视频编码器的结构框图;FIG. 2 is a structural block diagram of a video encoder that can be used in an embodiment of the present disclosure;
图3是可用于本公开实施例的一种视频解码器的结构框图;FIG. 3 is a structural block diagram of a video decoder that can be used in an embodiment of the present disclosure;
图4是可用于本公开一实施例的依赖性量化器示意图;FIG. 4 is a schematic diagram of a dependency quantizer that can be used in an embodiment of the present disclosure;
图5是可用于本公开一实施例的决定变换系数所使用量化器的状态转移示意图;FIG. 5 is a schematic diagram of a state transition of a quantizer used for determining transform coefficients that can be used in an embodiment of the present disclosure;
图6是本公开一实施例的视频编码方法的流程图;FIG. 6 is a flowchart of a video encoding method according to an embodiment of the present disclosure;
图7是本公开另一实施例的视频编码方法的流程图;FIG. 7 is a flowchart of a video encoding method according to another embodiment of the present disclosure;
图8是本公开另一实施例的视频编码方法的流程图;FIG. 8 is a flowchart of a video encoding method according to another embodiment of the present disclosure;
图9是本公开一实施例的视频解码方法的流程图;FIG. 9 is a flowchart of a video decoding method according to an embodiment of the present disclosure;
图10是本公开一实施例视频编码设备或解码设备的结构框图。Fig. 10 is a structural block diagram of a video encoding device or a decoding device according to an embodiment of the present disclosure.
具体实施方式Detailed ways
本公开描述了多个实施例,但是该描述是示例性的,而不是限制性的,并且对于本领域的普通技术人员来说显而易见的是,在本公开所描述的实施例包含的范围内可以有更多的实施例和实现方案。The present disclosure describes a number of embodiments, but the description is illustrative rather than restrictive, and it will be apparent to those of ordinary skill in the art that within the scope encompassed by the described embodiments of the present disclosure, There are many more embodiments and implementations.
本公开中,“示例性的”或者“例如”等词用于表示作例子、例证或说明。本公开中被描述为“示例性的”或者“例如”的任何实施例不应被解释为比其他实施例更优选或更具优势。In this disclosure, the words "exemplary" or "for example" are used to mean an example, illustration or illustration. Any embodiment described in this disclosure as "exemplary" or "for example" should not be construed as preferred or advantageous over other embodiments.
在描述具有代表性的示例性实施例时,说明书可能已经将方法和/或过程呈现为特定的步骤序列。然而,在该方法或过程不依赖于本文所述步骤的特定顺序的程度上,该方法或过程不应限于所述的特定顺序的步骤。如本领域普通技术人员将理解的,其它的步骤顺序也是可能的。因此,说明书中阐述的步骤的特定顺序不应被解释为对权利要求的限制。此外,针对该方法和/或过程的权利要求不应限于按照所写顺序执行它们的步骤,本领域技术人员可以容易地理解,这些顺序可以变化,并且仍然保持在本公开实施例的精神和范围内。In describing representative exemplary embodiments, the specification may have presented a method and/or process as a particular sequence of steps. However, to the extent the method or process is not dependent on the specific order of steps described herein, the method or process should not be limited to the specific order of steps described. Other sequences of steps are also possible, as will be appreciated by those of ordinary skill in the art. Therefore, the specific order of the steps set forth in the specification should not be construed as limitations on the claims. Furthermore, claims to the method and/or process should not be limited to performing their steps in the order written, as those skilled in the art can readily appreciate that such order can be varied and still remain within the spirit and scope of the disclosed embodiments Inside.
国际上,主流的视频编解码标准包括H.264/Advanced Video Coding(高级视频编码,AVC),H.265/High Efficiency Video Coding(高效视频编码,HEVC),H.266/Versatile Video Coding(多功能视频编码,VVC),MPEG(Moving Picture Experts Group,动态图像专家组),AOM(开放媒体联盟,Alliance for Open Media),AVS(Audio Video coding Standard,音视频编码标准)以及这些标准的拓展,或任何自定义的其他标准等,这些标准通过视频压缩技术减少传输的数据量和存储的数据量,以达到更高效的视频编解码和传输储存。Internationally, mainstream video codec standards include H.264/Advanced Video Coding (Advanced Video Coding, AVC), H.265/High Efficiency Video Coding (High Efficiency Video Coding, HEVC), H.266/Versatile Video Coding (Multiple Functional Video Coding, VVC), MPEG (Moving Picture Experts Group, Dynamic Image Experts Group), AOM (Open Media Alliance, Alliance for Open Media), AVS (Audio Video coding Standard, audio and video coding standards) and the expansion of these standards, Or any other custom standards, etc. These standards reduce the amount of transmitted data and stored data through video compression technology, so as to achieve more efficient video codec and transmission storage.
在H.264/AVC中,将输入图像划分成固定的尺寸的块作为编码的基本单元,并把它称为宏块(MB,Macro Block),包括一个亮度块和两个色度块,亮度块大小为16×16。如果采用4:2:0采样,色度块大小为亮度块大小的一半。在预测环节,根据预测模式的不同,将宏块进一步划分为用于预测的小块。帧内预测中可以把宏块划分成16×16、8×8、4×4的小块,每个小块分别进行帧内预测。在变换、量化环节,将宏块划分为4×4或8×8的小块,将每个小块中的预测残差分别进行变换和量化,得到量化后的系数。In H.264/AVC, the input image is divided into blocks of fixed size as the basic unit of encoding, and it is called a macro block (MB, Macro Block), including a luma block and two chrominance blocks, luma The block size is 16×16. If 4:2:0 sampling is used, the chroma block size is half of the luma block size. In the prediction link, according to different prediction modes, the macroblock is further divided into small blocks for prediction. In the intra-frame prediction, the macroblock can be divided into small blocks of 16×16, 8×8, and 4×4, and intra-frame prediction is performed on each small block. In the transformation and quantization link, the macroblock is divided into 4×4 or 8×8 small blocks, and the prediction residual in each small block is transformed and quantized respectively to obtain quantized coefficients.
H.265/HEVC与H.264/AVC相比,在多个编码环节采取了改进措施。在H.265/HEVC中,一幅图像被分割成编码树单元(CTU,Coding Tree Unit),CTU是编码的基本单元(对应于H.264/AVC中的宏块)。一个CTU包含一个亮度编码树块(CTB,Coding Tree Block)和两个色度编码树块,H.265/HEVC标准中CU的最大尺寸一般为64×64。为了适应多种多样的视频内容和视频特征,CTU采用四叉树(QT,Quadro Tree)方式迭代划分为一系列编码单元(CU,Coding Unit),CU是帧内/帧间编码的基本单元。一个CU包含一个亮度编码块(CB,Coding Block)和两个色度编码块及相关语法结构,最大CU大小为CTU,最小CU大小为8×8。经过编码树划分得到的叶子节点CU根据预测方式的不同,可分为三种类型:帧内预测的intra CU、帧间预测的inter CU和skipped CU。skipped CU可以看作是inter CU的特例,不包含运动信息和预测残差信息。叶子节点CU包含一个或者多个预测单元(PU,Prediction Unit),H.265/HEVC支持4×4到64×64大小的PU,一共有八种划分模式。对于帧内编码模式,可能的划分模式有两种:Part_2Nx2N和Part_NxN。对于预测残差信号,CU采用预测残差四叉树划分为变换单元(TU:Transform Unit)。一个TU包含一个亮度变换块(TB,Transform Block)和两个色度变换块。仅允许方形的划分,将一个CB划分为1个或者4 个PB。同一个TU具有相同的变换和量化过程,支持的大小为4×4到32×32。与之前的编码标准不同,在帧间预测中,TB可以跨越PB的边界,以进一步最大化帧间编码的编码效率。Compared with H.264/AVC, H.265/HEVC has taken improvement measures in multiple encoding links. In H.265/HEVC, an image is divided into coding tree units (CTU, Coding Tree Unit), and CTU is the basic unit of coding (corresponding to macroblocks in H.264/AVC). A CTU includes a luma coding tree block (CTB, Coding Tree Block) and two chrominance coding tree blocks. The maximum size of a CU in the H.265/HEVC standard is generally 64×64. In order to adapt to a variety of video content and video features, CTU is iteratively divided into a series of coding units (CU, Coding Unit) in the form of quadtree (QT, Quadro Tree). CU is the basic unit of intra/inter coding. A CU includes a luma coding block (CB, Coding Block) and two chroma coding blocks and related syntax structures. The maximum CU size is CTU, and the minimum CU size is 8×8. The leaf node CUs obtained through coding tree division can be divided into three types according to different prediction methods: intra CU for intra-frame prediction, inter CU for inter-frame prediction, and skipped CU. The skipped CU can be regarded as a special case of the inter CU, which does not contain motion information and prediction residual information. The leaf node CU contains one or more prediction units (PU, Prediction Unit). H.265/HEVC supports PUs of 4×4 to 64×64 sizes, and there are eight division modes in total. For the intra coding mode, there are two possible division modes: Part_2Nx2N and Part_NxN. For the prediction residual signal, the CU uses the prediction residual quadtree to divide it into transform units (TU: Transform Unit). A TU includes a luma transform block (TB, Transform Block) and two chroma transform blocks. Only square division is allowed, and one CB is divided into 1 or 4 PBs. The same TU has the same transformation and quantization process, and the supported sizes are from 4×4 to 32×32. Different from previous coding standards, in inter prediction, TB can cross the boundary of PB to further maximize the coding efficiency of inter coding.
在H.266/VVC中,视频编码图像首先划分跟H.265/HEVC相似的编码树单元CTU,但是最大尺寸从64×64提高到了128×128。H.266/VVC提出了四叉树和嵌套多类型树(MTT,Multi-Type Tree)划分,MTT包括二叉树(BT,Binary Tree)和三叉树(TT,Ternary Tree),且统一了H.265/HEVC中CU、PU、TU的概念,并且支持更灵活的CU划分形状。CTU按照四叉树结构进行划分,叶子节点通过MTT进一步划分。多类型树叶子节点成为编码单元CU,当CU不大于最大变换单元(64×64)时,后续预测和变换不会再进一步划分。大部分情况下CU、PU、TU具有相同的大小。考虑到亮度和色度的不同特性和具体实现的并行度,H.266/VVC中,色度可以采用单独的划分树结构,而不必和亮度划分树保持一致。H.266/VVC中I帧的色度划分采用色度分离树,P帧和B帧色度划分则与亮度划分保持一致。In H.266/VVC, video coding images are first divided into coding tree units CTU similar to H.265/HEVC, but the maximum size is increased from 64×64 to 128×128. H.266/VVC proposed quadtree and nested multi-type tree (MTT, Multi-Type Tree) division, MTT includes binary tree (BT, Binary Tree) and ternary tree (TT, Ternary Tree), and unified H. 265/HEVC concepts of CU, PU, and TU, and supports more flexible CU division shapes. The CTU is divided according to the quadtree structure, and the leaf nodes are further divided by MTT. The leaf nodes of the multi-type tree become the coding unit CU. When the CU is not larger than the largest transformation unit (64×64), subsequent prediction and transformation will not be further divided. In most cases CU, PU, TU have the same size. Considering the different characteristics of luminance and chrominance and the parallelism of specific implementations, in H.266/VVC, chrominance can adopt a separate partition tree structure instead of keeping the same with the luma partition tree. The chroma division of I frame in H.266/VVC adopts chroma separation tree, and the chroma division of P frame and B frame is consistent with the luma division.
图1为可用于本公开实施例的一种视频编解码系统的框图。如图1所示,该系统分为编码侧装置1和解码侧装置2,编码侧装置1对视频图像进行编码产生码流。解码侧装置2可对码流进行解码,得到重建的视频图像。编码侧装置1和解码侧装置2可包含一个或多个处理器以及耦合到所述一个或多个处理器的存储器,如随机存取存储器、带电可擦可编程只读存储器、快闪存储器或其它媒体。编码侧装置1和解码侧装置2可以用各种装置实现,如台式计算机、移动计算装置、笔记本电脑、平板计算机、机顶盒、电视机、相机、显示装置、数字媒体播放器、车载计算机或其他类似的装置。FIG. 1 is a block diagram of a video encoding and decoding system applicable to an embodiment of the present disclosure. As shown in FIG. 1 , the system is divided into an encoding-side device 1 and a decoding-side device 2 , and the encoding-side device 1 encodes video images to generate a code stream. The device 2 on the decoding side can decode the code stream to obtain a reconstructed video image. The encoding side device 1 and the decoding side device 2 may include one or more processors and memory coupled to the one or more processors, such as random access memory, charged erasable programmable read-only memory, flash memory or other media. The encoding side device 1 and the decoding side device 2 can be implemented with various devices, such as desktop computers, mobile computing devices, notebook computers, tablet computers, set-top boxes, televisions, cameras, display devices, digital media players, vehicle-mounted computers, or other similar installation.
解码侧装置2可经由链路3从编码侧装置1接收码流。链路3包括能够将码流从编码侧装置1移动到解码侧装置2的一个或多个媒体或装置。在一个示例中,链路3包括使得编码侧装置1能够将码流直接发送到解码侧装置2的一个或多个通信媒体。编码侧装置1可根据通信标准(例如无线通信协议)来调制码流,且可将经调制的码流发送到解码侧装置2。所述一个或多个通信媒体可包含无线和/或有线通信媒体,例如射频(radio frequency,RF)频谱或一个或多个物理传输线。所述一个或多个通信媒体可形成基于分组的网络的一部分,基于分组的网络例如为局域网、广域网或全球网络(例如,因特网)。所述一个或多个通信媒体可包含路由器、交换器、基站或促进从编码侧装置1到解码侧装置2的通信的其它设备。在另一示例中,也可将码流从输出接口15输出到一个存储装置,解码侧装置2可经由流式传输或下载从该存储装置读取所存储的数据。该存储装置可包含多种分布式存取或本地存取的数据存储媒体中的任一种,例如硬盘驱动器、蓝光光盘、数字多功能光盘、只读光盘、快闪存储器、易失性或非易失性存储器、文件服务器等等。The device 2 on the decoding side can receive the code stream from the device 1 on the encoding side via the link 3 . The link 3 includes one or more media or devices capable of moving the code stream from the device 1 on the encoding side to the device 2 on the decoding side. In one example, the link 3 includes one or more communication media that enable the device 1 on the encoding side to directly transmit the code stream to the device 2 on the decoding side. The device 1 on the encoding side can modulate the code stream according to a communication standard (such as a wireless communication protocol), and can send the modulated code stream to the device 2 on the decoding side. The one or more communication media may include wireless and/or wired communication media, such as a radio frequency (RF) spectrum or one or more physical transmission lines. The one or more communication media may form part of a packet-based network, such as a local area network, a wide area network, or a global network (eg, the Internet). The one or more communication media may include routers, switches, base stations, or other devices that facilitate communication from device 1 on the encoding side to device 2 on the decoding side. In another example, the code stream can also be output from the output interface 15 to a storage device, and the decoding-side device 2 can read the stored data from the storage device via streaming or downloading. The storage device may comprise any of a variety of distributed-access or locally-accessed data storage media, such as hard disk drives, Blu-ray Discs, Digital Versatile Discs, CD-ROMs, flash memory, volatile or non-volatile Volatile memory, file servers, and more.
在图1所示的示例中,编码侧装置1包含数据源11、编码器13和输出接口15。在一些示例中。数据源11可包括视频捕获装置(例如,摄像机)、含有先前捕获的数据的存档、用以从内容提供者接收数据的馈入接口,用于产生数据的计算机图形系统,或这些来源的组合。编码器13可对来自数据源11的数据进行编码后输出到输出接口15,输出接口15可包含调节器、调制解调器和发射器中的至少之一。In the example shown in FIG. 1 , the encoding side device 1 includes a data source 11 , an encoder 13 and an output interface 15 . In some examples. Data sources 11 may include video capture devices (eg, video cameras), archives containing previously captured data, feed interfaces to receive data from content providers, computer graphics systems to generate data, or combinations of these sources. The encoder 13 can encode the data from the data source 11 and output it to the output interface 15, and the output interface 15 can include at least one of an adjuster, a modem and a transmitter.
在图1所示的示例中,解码侧装置2包含输入接口21、解码器23和显示装置25。在一些示例中,输入接口21包含接收器和调制解调器中的至少之一。输入接口21可经由链路3或从存储装置接收码流。解码器23对接收的码流进行解码。显示装置25用于显示解码后的数据,显示装置25可与解码侧装置2的其他装置集成在一起或者单独设置。显示装置25例如可以是液晶显示器、等离子显示器、有机发光二极管显示器或其它类型的显示装置。在其他示例中,解码侧装置2也可以不包含所述显示装置25,或者包含应用解码后数据的其他装置或设备。In the example shown in FIG. 1 , the decoding side device 2 includes an input interface 21 , a decoder 23 and a display device 25 . In some examples, input interface 21 includes at least one of a receiver and a modem. The input interface 21 can receive the code stream via the link 3 or from a storage device. The decoder 23 decodes the received code stream. The display device 25 is used for displaying the decoded data, and the display device 25 may be integrated with other devices of the decoding side device 2 or provided separately. The display device 25 may be, for example, a liquid crystal display, a plasma display, an organic light emitting diode display or other types of display devices. In other examples, the device 2 on the decoding side may not include the display device 25 , or may include other devices or devices for applying the decoded data.
图1的编码器13和解码器23可使用以下电路中的任意一种或者以下电路的任意组合来实现:一个或多个微处理器、数字信号处理器、专用集成电路、现场可编程门阵列、离散逻辑、硬件。如果部分地以软件来实施本公开,那么可将用于软件的指令存储在合适的非易失性计算机可读存储媒体中,且可使用一个或多个处理器在硬件中执行所述指令从而实施本公开方法。Encoder 13 and decoder 23 of Fig. 1 can use any one in the following circuits or any combination of following circuits to realize: one or more microprocessors, digital signal processors, application specific integrated circuits, field programmable gate arrays , discrete logic, hardware. If the present disclosure is implemented partially in software, instructions for the software may be stored in a suitable non-transitory computer-readable storage medium and executed in hardware using one or more processors to thereby Implement the disclosed method.
图2所示是一种示例性的视频编码器的结构框图。在该示例中,主要基于H.265/HEVC标准的术语和块划分方式进行描述,但该视频编码器的结构也可以用于H.264/AVC、H.266/VVC及其他类似标准的视频编码。Fig. 2 is a structural block diagram of an exemplary video encoder. In this example, the description is mainly based on the terminology and block division of the H.265/HEVC standard, but the structure of the video encoder can also be used for videos of H.264/AVC, H.266/VVC and other similar standards coding.
如图所示,视频编码器20用于对视频数据编码,生成码流。如图所示,视频编码器20包含预测处理单元100、划分单元101、预测残差产生单元102、变换处理单元104、量化单元106、反量化单 元108、反变换处理单元110、重建单元112、滤波器单元113、已解码图片缓冲器114,以及熵编码单元116。预测处理单元100包含帧间预测处理单元121和帧内预测处理单元126。在其他实施例中,视频编码器20可以包含比该示例更多、更少或不同功能组件。预测残差产生单元102和重建单元112在图中均用带加号的圆圈表示。As shown in the figure, the video encoder 20 is used to encode video data to generate code streams. As shown in the figure, the video encoder 20 includes a prediction processing unit 100, a division unit 101, a prediction residual generation unit 102, a transformation processing unit 104, a quantization unit 106, an inverse quantization unit 108, an inverse transformation processing unit 110, a reconstruction unit 112, A filter unit 113 , a decoded picture buffer 114 , and an entropy coding unit 116 . The prediction processing unit 100 includes an inter prediction processing unit 121 and an intra prediction processing unit 126 . In other embodiments, video encoder 20 may contain more, fewer or different functional components than this example. Both the prediction residual generation unit 102 and the reconstruction unit 112 are represented by circles with plus signs in the figure.
划分单元101与预测处理单元100配合将接收的视频数据划分为切片(Slice)、CTU或其它较大的单元。划分单元101接收的视频数据可以是包括I帧、P帧或B帧等视频帧的视频序列。The division unit 101 cooperates with the prediction processing unit 100 to divide the received video data into slices (Slices), CTUs or other larger units. The video data received by the dividing unit 101 may be a video sequence including video frames such as I frames, P frames, or B frames.
预测处理单元100可以将CTU划分为CU,对CU执行帧内预测编码或帧间预测编码。对CU做帧内编码时,可以将2N×2N的CU划分为2N×2N或N×N的预测单元(PU:prediction unit)进行帧内预测。对CU做帧间预测时,可以将2N×2N的CU划分为2N×2N、2N×N、N×2N、N×N或其他大小的PU进行帧间预测,也可以支持对PU的不对称划分。The prediction processing unit 100 may divide a CTU into CUs, and perform intra-frame predictive coding or inter-frame predictive coding on the CUs. When performing intra-frame coding on a CU, the 2N×2N CU can be divided into 2N×2N or N×N prediction units (PU: prediction unit) for intra-frame prediction. When performing inter-frame prediction on a CU, the 2N×2N CU can be divided into PUs of 2N×2N, 2N×N, N×2N, N×N or other sizes for inter-frame prediction, and asymmetrical PUs can also be supported divided.
帧间预测处理单元121可对PU执行帧间预测,产生PU的预测数据,所述预测数据包括PU的预测块、PU的运动信息和各种语法元素。The inter prediction processing unit 121 may perform inter prediction on the PU to generate prediction data of the PU, the prediction data including the prediction block of the PU, motion information of the PU and various syntax elements.
帧内预测处理单元126可对PU执行帧内预测,产生PU的预测数据。PU的预测数据可包含PU的预测块和各种语法元素。帧内预测处理单元126可尝试多种可选择的帧内预测模式,从中选取代价最小的一种帧内预测模式来执行对PU的帧内预测。The intra prediction processing unit 126 may perform intra prediction on the PU to generate prediction data for the PU. The prediction data for a PU may include the prediction block and various syntax elements for the PU. The intra-frame prediction processing unit 126 may try multiple selectable intra-frame prediction modes, and select an intra-frame prediction mode with the least cost to perform intra-frame prediction on the PU.
预测残差产生单元102可基于CU的原始块和CU划分的PU的预测块,产生CU的预测残差块。The prediction residual generation unit 102 may generate a prediction residual block of the CU based on the original block of the CU and the prediction block of the PU into which the CU is divided.
变换处理单元104可将CU划分为一个或多个变换单元(TU:Transform Unit),TU关联的预测残差块是CU的预测残差块划分得到的子块。通过将一种或多种变换应用于TU关联的预测残差块来产生TU关联的系数块。例如,变换处理单元104可将离散余弦变换(DCT:Discrete Cosine Transform)、方向性变换或其他的变换应用于TU关联的预测残差块,可将预测残差块从像素域转换到频域。The transform processing unit 104 may divide the CU into one or more transform units (TU: Transform Unit), and the prediction residual block associated with the TU is a sub-block obtained by dividing the prediction residual block of the CU. A TU-associated coefficient block is generated by applying one or more transforms to the TU-associated prediction residual block. For example, the transform processing unit 104 may apply discrete cosine transform (DCT: Discrete Cosine Transform), directional transform or other transforms to the prediction residual block associated with the TU, and may convert the prediction residual block from the pixel domain to the frequency domain.
量化单元106可基于选定的量化参数(QP)对系数块中的系数进行量化,量化可能会带来量化损失(quantitative losses),通过调整QP值可以调整对系数块的量化程度。The quantization unit 106 can quantize the coefficients in the coefficient block based on a selected quantization parameter (QP). Quantization may cause quantization losses. By adjusting the QP value, the degree of quantization of the coefficient block can be adjusted.
反量化单元108和反变换单元110可分别将反量化和反变换应用于系数块,得到TU关联的重建预测残差块。The inverse quantization unit 108 and the inverse transformation unit 110 may respectively apply inverse quantization and inverse transformation to the coefficient blocks to obtain TU-associated reconstructed prediction residual blocks.
重建单元112可基于所述重建预测残差块和预测处理单元100产生的预测块,产生CU的重建块。The reconstruction unit 112 may generate a reconstructed block of the CU based on the reconstructed prediction residual block and the prediction block generated by the prediction processing unit 100 .
滤波器单元113对所述重建块执行环路滤波后存储在已解码图片缓冲器114中。帧内预测处理单元126可以从已解码图片缓冲器114缓存的重建块中提取PU邻近的已重建参考信息以对PU执行帧内预测。帧间预测处理单元121可使用已解码图片缓冲器114缓存的含有重建块的参考图片对其他图片的PU执行帧间预测。The filter unit 113 performs loop filtering on the reconstructed block and stores it in the decoded picture buffer 114 . The intra prediction processing unit 126 may extract the reconstructed reference information adjacent to the PU from the reconstructed blocks cached in the decoded picture buffer 114 to perform intra prediction on the PU. Inter prediction processing unit 121 may perform inter prediction on PUs of other pictures using reference pictures cached by decoded picture buffer 114 that contain reconstructed blocks.
熵编码单元116可以对接收的数据(如语法元素、量化后的系统块、运动信息等)执行熵编码操作,如执行上下文自适应可变长度编码(CAVLC:Context Adaptive Variable Length Coding)、上下文自适应二进制算术编码(CABAC:Context-based Adaptive Binary Arithmetic Coding)等,输出码流(即已编码视频码流)。The entropy coding unit 116 can perform entropy coding operations on received data (such as syntax elements, quantized system blocks, motion information, etc.), such as performing context adaptive variable length coding (CAVLC: Context Adaptive Variable Length Coding), context self- Adapt to Binary Arithmetic Coding (CABAC: Context-based Adaptive Binary Arithmetic Coding), etc., and output code stream (that is, coded video code stream).
图3所示是一种示例性的视频解码器的结构框图。在该示例中,主要基于H.265/HEVC标准的术语和块划分方式进行描述,但该视频解码器的结构也可以用于H.264/AVC、H.266/VVC及其他类似标准的视频解码。FIG. 3 is a structural block diagram of an exemplary video decoder. In this example, the description is mainly based on the terminology and block division of the H.265/HEVC standard, but the structure of the video decoder can also be used for videos of H.264/AVC, H.266/VVC and other similar standards decoding.
视频解码器30可对接收的码流解码,输出已解码视频数据。如图所示,视频解码器30包含熵解码单元150、预测处理单元152、反量化单元154、反变换处理单元156、重建单元158(图中用带加号的圆圈表示)、滤波器单元159,以及图片缓冲器160。在其它实施例中,视频解码器30可以包含更多、更少或不同的功能组件。The video decoder 30 can decode the received code stream and output decoded video data. As shown in the figure, the video decoder 30 includes an entropy decoding unit 150, a prediction processing unit 152, an inverse quantization unit 154, an inverse transformation processing unit 156, a reconstruction unit 158 (indicated by a circle with a plus sign in the figure), a filter unit 159 , and the picture buffer 160. In other embodiments, video decoder 30 may contain more, fewer or different functional components.
熵解码单元150可对接收的码流进行熵解码,提取语法元素、量化后的系数块和PU的运动信息等信息。预测处理单元152、反量化单元154、反变换处理单元156、重建单元158以及滤波器单元159均可基于从码流提取的语法元素来执行相应的操作。The entropy decoding unit 150 may perform entropy decoding on the received code stream to extract information such as syntax elements, quantized coefficient blocks, and PU motion information. The prediction processing unit 152 , the inverse quantization unit 154 , the inverse transform processing unit 156 , the reconstruction unit 158 and the filter unit 159 can all perform corresponding operations based on the syntax elements extracted from the code stream.
作为执行重建操作的功能组件,反量化单元154可对量化后的TU关联的系数块进行反量化。反变换处理单元156可将一种或多种反变换应用于反量化后的系数块以便产生TU的重建预测残差块。As a functional component performing a reconstruction operation, the inverse quantization unit 154 may inverse quantize the quantized TU-associated coefficient blocks. Inverse transform processing unit 156 may apply one or more inverse transforms to the inverse quantized coefficient block in order to generate a reconstructed prediction residual block for the TU.
预测处理单元152包含帧间预测处理单元162和帧内预测处理单元164。如果PU使用帧内预测 编码,帧内预测处理单元164可基于从码流解析出的语法元素确定PU的帧内预测模式,根据确定的帧内预测模式和从图片缓冲器件60获取的PU邻近的已重建参考信息执行帧内预测,产生PU的预测块。如果PU使用帧间预测编码,帧间预测处理单元162可基于PU的运动信息和相应的语法元素来确定PU的一个或多个参考块,基于所述参考块来产生PU的预测块。Prediction processing unit 152 includes inter prediction processing unit 162 and intra prediction processing unit 164 . If the PU is encoded using intra-frame prediction, the intra-frame prediction processing unit 164 can determine the intra-frame prediction mode of the PU based on the syntax elements parsed from the code stream, and according to the determined intra-frame prediction mode and the adjacent PU obtained from the picture buffer device 60 Intra prediction is performed on the reconstructed reference information, resulting in a prediction block of the PU. If the PU is encoded using inter-prediction, inter-prediction processing unit 162 may determine one or more reference blocks for the PU based on the motion information of the PU and corresponding syntax elements to generate a predictive block for the PU.
重建单元158可基于TU关联的重建预测残差块和预测处理单元152产生的PU的预测块(即帧内预测数据或帧间预测数据),得到CU的重建块。The reconstruction unit 158 may obtain the reconstruction block of the CU based on the reconstruction prediction residual block associated with the TU and the prediction block of the PU generated by the prediction processing unit 152 (ie intra prediction data or inter prediction data).
滤波器单元159可对CU的重建块执行环路滤波,得到重建的图片。重建的图片存储在图片缓冲器160中。图片缓冲器160可提供参考图片以用于后续运动补偿、帧内预测、帧间预测等,也可将重建的视频数据作为已解码视频数据输出,在显示装置上的呈现。The filter unit 159 may perform loop filtering on the reconstructed block of the CU to obtain a reconstructed picture. The reconstructed pictures are stored in the picture buffer 160 . The picture buffer 160 can provide reference pictures for subsequent motion compensation, intra prediction, inter prediction, etc., and can also output the reconstructed video data as decoded video data for presentation on a display device.
因为视频编码包括编码和解码两部分,为方便后文描述,编码器端的编码和解码器端的解码也可以统称为编码或译码。根据相关步骤的上下文记载,本领域技术人员可以知晓后续提及的编码(译码)是指编码器端的编码,还是指解码器端的解码。本申请中可使用术语“编码块”或“视频块”以指代样本的一个或多个块,以及对于一个或多个样本块进行编码(译码)的语法结构;编码块或视频块的实例类型可包括H.265/HEVC中的CTU、CU、PUT、TU、subblock,或其他视频编解码标准中的宏块、宏块分割区等。Because video encoding includes encoding and decoding, for the convenience of description later, encoding at the encoder end and decoding at the decoder end may also be collectively referred to as encoding or decoding. According to the contextual description of the relevant steps, those skilled in the art can know whether the encoding (decoding) mentioned later refers to the encoding at the encoder end or the decoding at the decoder end. The term "coding block" or "video block" may be used in this application to refer to one or more blocks of samples, as well as the syntax structure for encoding (decoding) one or more blocks of samples; Instance types may include CTU, CU, PUT, TU, subblock in H.265/HEVC, or macroblocks and macroblock partitions in other video codec standards.
下面先对本公开实施例中涉及到的一些概念进行介绍。本公开实施例的相关记载采用了H.265/HEVC或H.266/VVC中的术语,以易于解释。然而,并不限定本公开实施例提供的方案受限于H.265/HEVC或H.266/VVC,实际上,本公实施例提供的技术方案也可以实施于H.264/AVC、MPEG、AOM、AVS等,以及这些标准的后续和扩展中。Some concepts involved in the embodiments of the present disclosure are firstly introduced below. The related descriptions of the embodiments of the present disclosure adopt terms in H.265/HEVC or H.266/VVC for easy explanation. However, it is not limited that the solutions provided by the embodiments of the present disclosure are limited to H.265/HEVC or H.266/VVC. In fact, the technical solutions provided by the embodiments of the present disclosure can also be implemented in H.264/AVC, MPEG, AOM, AVS, etc., and the follow-up and expansion of these standards.
CTU是Coding Tree Unit的缩写,相当于H.264/AVC中的宏块。根据YUV采样格式,一个编码树单元(CTU)应当是包含了同一位置处的一个亮度编码树块(CTB)和两个色度编码树块(CTB)(CrCb)。CTU is the abbreviation of Coding Tree Unit, which is equivalent to the macroblock in H.264/AVC. According to the YUV sampling format, a coding tree unit (CTU) should contain one luma coding tree block (CTB) and two chrominance coding tree blocks (CTB) (CrCb) at the same position.
编码单元CU(Coding Unit),是视频编解码过程中进行各种类型的编码操作或解码操作的基本单元,例如基于CU的预测、变换、熵编码等等操作。CU是指一个二维采样点阵列,可以是正方形阵列,或者可以是矩形阵列。例如,一个4x8大小的CU可看做4x8共32个采样点构成的方形采样点阵列。CU也可称为图像块。CU可包括译码块和对应的语法元素。The coding unit CU (Coding Unit) is the basic unit for various types of coding operations or decoding operations in the video coding and decoding process, such as CU-based prediction, transformation, entropy coding, and other operations. CU refers to a two-dimensional sampling point array, which may be a square array or a rectangular array. For example, a 4x8 CU can be regarded as a square sampling point array composed of 4x8 and 32 sampling points. A CU may also be called a tile. A CU may include a coding block and corresponding syntax elements.
残差块,是指在经帧间预测和/或帧内预测产生当前块的预测块后,将从待编码的当前块减去所述预测块形成的残差图像块,也可称为残差数据。The residual block refers to the residual image block formed by subtracting the predicted block from the current block to be coded after the predicted block of the current block is generated by inter-frame prediction and/or intra-frame prediction, which can also be called residual bad data.
系数块,包括对残差块进行变换得到含有变换系数的变换块,或者对残差块不进行变换,包括含有残差数据(残差信号)的残差块。本公开实施例中,系数包括对残差块进行变换得到的变换块的系数,或者残差块的系数,对系数进行熵编码包括对变换块的系数经量化后进行熵编码,或者,如果未将变换应用于残差数据,包括对残差块的系数经量化后进行熵编码。也可以将未经变换的残差信号和经变换的残差信号统称为系数(coefficient)。为进行有效的压缩。一般系数需进行量化处理,经量化后的系数也可以称为级别。The coefficient block includes transforming the residual block to obtain a transform block containing transform coefficients, or not transforming the residual block, including a residual block containing residual data (residual signal). In the embodiment of the present disclosure, the coefficients include the coefficients of the transform block obtained by transforming the residual block, or the coefficients of the residual block, and performing entropy coding on the coefficients includes performing entropy coding on the coefficients of the transform block after quantization, or, if not Applying a transform to the residual data includes entropy coding the quantized coefficients of the residual block. The untransformed residual signal and the transformed residual signal may also be collectively referred to as coefficients. for effective compression. Generally, the coefficients need to be quantized, and the quantized coefficients can also be called levels.
量化通常被用于降低系数的动态范围,从而达到用更少的码字表达视频的目的。量化后的数值通常称为级别(level)。量化的操作通常是用系数除以量化步长,量化步长由在码流传递的量化因子决定。反量化则是通过级别乘以量化步长来完成。对于一个N×M大小的块,所有系数的量化可以独立的完成,这一技术被广泛地应用在很多国际视频压缩标准,例如H.265/HEVC、H.266/VVC等。特定的扫描顺序可以把一个二维的系数块变换成一维系数流。扫描顺序可以是Z型,水平,垂直或者其它任何一种顺序的扫描。在国际视频压缩标准中,量化操作可以利用系数间的相关性,利用已量化系数的特性来选择更优的量化方式,从而达到优化量化的目的。Quantization is usually used to reduce the dynamic range of coefficients, so as to achieve the purpose of expressing video with fewer codewords. The quantized value is usually called a level. The operation of quantization is usually to divide the coefficient by the quantization step size, and the quantization step size is determined by the quantization factor transmitted in the code stream. Inverse quantization is done by multiplying the level by the quantization step. For a block of N×M size, the quantization of all coefficients can be done independently. This technology is widely used in many international video compression standards, such as H.265/HEVC, H.266/VVC, etc. A specific scan order can transform a two-dimensional coefficient block into a one-dimensional coefficient stream. The scan sequence can be Z-type, horizontal, vertical or any other sequential scan. In the international video compression standard, the quantization operation can use the correlation between coefficients and the characteristics of the quantized coefficients to select a better quantization method, so as to achieve the purpose of optimizing quantization.
对变换系数进行量化和反量化是编码和解码中的重要一环,包括非依赖标量量化和依赖标量量化(Dependent Scalar Quantization,DSQ)。Quantization and dequantization of transform coefficients is an important part of encoding and decoding, including non-dependent scalar quantization and dependent scalar quantization (Dependent Scalar Quantization, DSQ).
本公开实施例中,非依赖标量量化是相对概念,是指相对于依赖标量量化DSQ而言,不是依赖标量量化DSQ的标量量化方法均称为非依赖性标量量化。例如,RDOQ(Rate distortion optimized quantization,基于率失真优化的量化)也是非依赖标量量化的一种。本公开实施例中所涉及的非依赖标量量化不限于特定方法,可以采用相关标准中的对应标量量化方法。In the embodiments of the present disclosure, non-dependent scalar quantization is a relative concept, which means that relative to dependent scalar quantization DSQ, scalar quantization methods that are not dependent on scalar quantization DSQ are called non-dependent scalar quantization. For example, RDOQ (Rate distortion optimized quantization, quantization based on rate distortion optimization) is also a kind of non-dependent scalar quantization. The scalar-independent quantization involved in the embodiments of the present disclosure is not limited to a specific method, and a corresponding scalar quantization method in related standards may be used.
依赖标量量化DSQ是指变换系数的一组可容许的重构值依赖于重建顺序在当前变换系数级 (transform coefficient level)之前的变换系数级的值。该方法的主要影响是相比于H.265/HEVC中非依赖标量量化,它的可允许的重建向量在N维向量空间(N表示变换块中变换系数的数量)中密度更大。Dependent scalar quantization DSQ means that a set of admissible reconstruction values of transform coefficients depends on the value of the transform coefficient level whose reconstruction order is before the current transform coefficient level (transform coefficient level). The main impact of this approach is that its admissible reconstruction vectors are denser in the N-dimensional vector space (where N denotes the number of transform coefficients in a transform block) compared to non-dependent scalar quantization in H.265/HEVC.
依赖标量量化实现过程为:(a)定义两个不同重建水平的标量量化器;(b)定义两个标量量化器间的转换方式。The realization process of dependent scalar quantization is: (a) define two scalar quantizers with different reconstruction levels; (b) define the conversion mode between the two scalar quantizers.
两个标量量化器分别表示为Q0和Q1,如图4所示。重建水平的位置由量化步长Δ唯一确定。标量量化器(Q0或Q1)不在码流中显示传输。使用的量化器由编码/重建顺序在当前变换系数之前的变化系数层级的奇偶性决定。The two scalar quantizers are denoted as Q0 and Q1, respectively, as shown in Figure 4. The position of the reconstruction level is uniquely determined by the quantization step size Δ. The scalar quantizer (Q0 or Q1) does not show transmission in the codestream. The quantizer used is determined by the parity of the variable coefficient level preceding the current transform coefficient in encoding/reconstruction order.
两个标量量化器(Q0和Q1)间的转换由一个有4个状态的状态机实现,如图5所示。状态可以取4个不同的值:0,1,2,3。它由编码/重建顺序在当前变换系数之前的变化系数层级的奇偶性唯一决定。在变换块反量化的初始阶段状态设置为0。变换系数按扫描顺序(例如和熵解码顺序相同)重建。在当前变换系数重建后,它的状态按上图更新,k表示变换系数层级值。The transition between the two scalar quantizers (Q0 and Q1) is implemented by a state machine with 4 states, as shown in Figure 5. Status can take 4 different values: 0, 1, 2, 3. It is uniquely determined by the parity of the variable coefficient level preceding the current transform coefficient in encoding/reconstruction order. The state is set to 0 at the initial stage of transform block dequantization. Transform coefficients are reconstructed in scan order (eg same as entropy decoding order). After the current transform coefficient is rebuilt, its state is updated as shown above, and k represents the transform coefficient level value.
在编码端,依赖标量量化DSQ涉及如图2所示的量化单元106和反量化单元108;在解码端,依赖标量量化DSQ涉及如图3所示的反量化单元154。At the encoding end, the scalar-dependent quantization DSQ involves the quantization unit 106 and the inverse quantization unit 108 as shown in FIG. 2 ; at the decoding end, the scalar-dependent quantization DSQ involves the inverse quantization unit 154 as shown in FIG. 3 .
在本公开一实施例中,使用DSQ的编码器的实施方法如下。首先,输入图像被划分成不重叠的多个CTU块。然后,按照光栅扫描顺序依次处理每个CTU,根据帧内/帧间预测确定的最优模式将CTU按照划分成若干个块(CU1,CU2,…,CUi,…),并得到相应的预测残差块(resB1,resB2,…,resBi,…)。然后,对残差块做变换和量化,量化的主要步骤如下:In an embodiment of the present disclosure, an implementation method of an encoder using DSQ is as follows. First, the input image is partitioned into non-overlapping CTU blocks. Then, each CTU is processed sequentially according to the raster scan sequence, and the CTU is divided into several blocks (CU1, CU2, ..., CUi, ...) according to the optimal mode determined by intra/inter prediction, and the corresponding prediction residuals are obtained. difference block (resB1, resB2, ..., resBi, ...). Then, transform and quantize the residual block. The main steps of quantization are as follows:
(1)输入第i个残差块resBi,初始化状态state=0,j=0,依照光栅扫描顺序处理当前块的M个系数;(1) Input the i-th residual block resBi, initialize the state state=0, j=0, process the M coefficients of the current block according to the raster scanning order;
(2)输入第j个系数,确定量化步长△和编码在当前变换系数之前的变化系数层级k;(2) Input the jth coefficient, determine the quantization step size △ and the change coefficient level k encoded before the current transform coefficient;
(3)根据△和k计算两个量化器Q0和Q1;(3) Calculate two quantizers Q0 and Q1 according to △ and k;
(4)根据k和state选择量化器进行量化;(4) Select a quantizer for quantization according to k and state;
(5)更新state,若j<M,j++,跳至步骤(2),否则i++,跳至步骤(1)。(5) Update state, if j<M, j++, skip to step (2), otherwise i++, skip to step (1).
最后,对量化后的系数进行熵编码,输出码流等待传输。Finally, entropy encoding is performed on the quantized coefficients, and the output code stream is waiting for transmission.
在本公开一实施例中,一种使用DSQ的解码器的实施方法如下。首先,输入码流进行熵解码,并得到变换量化后的残差块(resB*1,resB*2,…,resB*i,…),接着,对残差块做反量化,主要步骤如下:In an embodiment of the present disclosure, an implementation method of a decoder using DSQ is as follows. First, entropy decoding is performed on the input code stream, and transformed and quantized residual blocks (resB*1, resB*2, ..., resB*i, ...) are obtained. Then, the residual block is dequantized. The main steps are as follows:
(1)输入第i个残差块resB*i,初始化状态state=0,j=0,依照光栅扫描顺序处理当前块的M个系数;(1) Input the i-th residual block resB*i, initialize the state state=0, j=0, process the M coefficients of the current block according to the raster scanning order;
(2)输入第j个系数,确定量化步长△和重建在当前变换系数之前的变化系数层级k;(2) Input the jth coefficient, determine the quantization step size △ and reconstruct the change coefficient level k before the current transform coefficient;
(3)根据△和k计算两个量化器Q0和Q1;(3) Calculate two quantizers Q0 and Q1 according to △ and k;
(4)根据k和state选择量化器进行反量化;(4) Select a quantizer for inverse quantization according to k and state;
(5)更新state,若j<M,j++,跳至步骤(2),否则i++,跳至步骤(1)。(5) Update state, if j<M, j++, skip to step (2), otherwise i++, skip to step (1).
然后,对反量化后的残差块做反变换,将反变换后的残差值和预测值叠加,得到重建CU,直到当前CTU完成重建。Then, inverse transform is performed on the inversely quantized residual block, and the inversely transformed residual value and predicted value are superimposed to obtain a reconstructed CU until the reconstruction of the current CTU is completed.
最后,将重建图像送入DBF/SAO/ALF滤波器,滤波后的图像送入缓冲区,等待视频播放。Finally, the reconstructed image is sent to the DBF/SAO/ALF filter, and the filtered image is sent to the buffer, waiting for the video to play.
可以看到,DSQ技术应用于视频编解码芯片中,可以进一步提升编码性能。It can be seen that the DSQ technology applied to the video codec chip can further improve the coding performance.
研究发现,依赖标量量化DSQ的出发点可以简单地理解为在量化时考虑图像空间上的相关性,使得每个块的重建向量更紧凑。这对于自然内容视频是适用的,因为自然内容在时域和空域上都表现为很强的连续性,所以如提案JVET-K0071所显示,DSQ能获得超过1.5%的性能增益。The study found that the starting point of relying on scalar quantization DSQ can be simply understood as considering the spatial correlation of the image during quantization, so that the reconstruction vector of each block is more compact. This is true for natural content videos, since natural content exhibits strong continuity in both temporal and spatial domains, so DSQ can achieve performance gains of more than 1.5% as shown in proposal JVET-K0071.
然而,有些视频序列(如屏幕内容视频)的内容在空间上表现出很强的非连续性,违背了DSQ技术的出发点,因此,采用DSQ技术并不能提升编码效率,反而会增加编码复杂度,产生大量不必要的开销,浪费计算资源。However, the content of some video sequences (such as screen content video) shows strong discontinuity in space, which violates the starting point of DSQ technology. Therefore, the use of DSQ technology will not improve the coding efficiency, but will increase the coding complexity. Generate a lot of unnecessary overhead and waste computing resources.
为了进一步优化视频编解码性能,本公开实施例提出一种基于空域连续性分析的自适应量化技术。 该技术方案首先对视频内容进行分析,计算图像内容的连续性,然后基于此设计了自适应量化技术。当视频图像内容表现为较强的非连续性时,采用非依赖标量量化,否则,采用依赖标量量化。In order to further optimize video encoding and decoding performance, an embodiment of the present disclosure proposes an adaptive quantization technology based on spatial continuity analysis. The technical scheme first analyzes the video content, calculates the continuity of the image content, and then designs an adaptive quantization technology based on this. When the video image content shows strong discontinuity, non-dependent scalar quantization is adopted; otherwise, dependent scalar quantization is adopted.
本公开实施例提供一种视频编码方法,如图6所示,包括,An embodiment of the present disclosure provides a video coding method, as shown in FIG. 6 , including:
步骤601,确定待编码图像的空域连续性特征值;Step 601, determine the spatial continuity feature value of the image to be encoded;
步骤602,根据所述空域连续性特征值确定对所述待编码图像采用依赖标量量化DSQ方式或非依赖标量量化方式进行量化。Step 602: Determine, according to the spatial continuity feature value, whether to quantize the image to be encoded by means of DSQ-dependent scalar quantization or non-scalar-dependent quantization.
在本公开一实施例中,所述视频编码方法,如图7所示,包括,In an embodiment of the present disclosure, the video coding method, as shown in FIG. 7 , includes:
步骤601,确定待编码图像的空域连续性特征值;Step 601, determine the spatial continuity feature value of the image to be encoded;
步骤6021,在所述空域连续性特征值位于特征值阈值范围内的情况下,对所述待编码图像采用依赖标量量化方式进行量化;Step 6021, in the case that the feature value of the spatial continuity is within the feature value threshold range, quantize the image to be encoded using scalar-dependent quantization;
步骤6022,在所述空域连续性特征值位于特征值阈值范围外的情况下,对所述待编码图像采用非依赖标量量化方式进行量化。Step 6022: In the case that the spatial continuity feature value is outside the feature value threshold range, quantize the image to be coded using scalar-independent quantization.
其中,所述空域连续性特征值为用于表征所述待编码图像内容的空间连续性的值。Wherein, the spatial continuity feature value is a value used to characterize the spatial continuity of the image content to be encoded.
需要说明的是,步骤6021/6022中对所述待编码图像采用依赖标量\非依赖标量量化方式进行量化,是指:对待编码图像对应的系数块采用依赖标量\非依赖标量量化方式进行量化。其中,系数块包括对残差块进行变换得到含有变换系数的变换块;或者对残差块不进行变换,包括含有残差数据(残差信号)的残差块。It should be noted that, in step 6021/6022, the scalar-dependent/scalar-independent quantization method for the image to be encoded refers to: the scalar-dependent/scalar-independent quantization method is used for quantization of the coefficient block corresponding to the image to be encoded. Wherein, the coefficient block includes transforming the residual block to obtain a transform block containing transform coefficients; or not transforming the residual block, including a residual block containing residual data (residual signal).
在本公开一实施例中,步骤6022中对所述待编码图像采用非依赖标量量化方式进行量化,包括:In an embodiment of the present disclosure, in step 6022, the image to be encoded is quantized using a non-dependent scalar quantization method, including:
依次对根据所述待编码图像进行划分和预测后得到每一个残差块执行以下步骤:Perform the following steps for each residual block obtained after dividing and predicting the image to be encoded in turn:
根据所量化步长确定量化器进行量化;Determine the quantizer to perform quantization according to the quantized step size;
在本公开一实施例中,步骤6021中对所述待编码图像采用依赖标量量化方式进行量化,包括:依次对根据所述待编码图像进行划分和预测后得到每一个残差块执行以下步骤:In an embodiment of the present disclosure, in step 6021, quantization is performed on the image to be encoded using a scalar-dependent quantization method, including: sequentially performing the following steps on each residual block obtained after dividing and predicting the image to be encoded:
确定量化步长△和编码在当前变换系数之前的变化系数层级k;Determine the quantization step size △ and the change coefficient level k encoded before the current transform coefficient;
根据量化步长△和变化系数层级k计算两个量化器Q0和Q1;Calculate two quantizers Q0 and Q1 according to the quantization step size △ and the variation coefficient level k;
根据变化系数层级k和状态机state选择量化器进行量化。Select a quantizer for quantization according to the variation coefficient level k and the state machine state.
在本公开一实施例中,对所述待编码图像采用依赖标量量化方式进行量化,包括:依次对根据所述待编码图像进行划分和预测后得到每一个残差块执行以下步骤:In an embodiment of the present disclosure, the quantization of the image to be coded using a dependent scalar quantization method includes: sequentially performing the following steps on each residual block obtained after dividing and predicting the image to be coded:
(1)初始化状态机state的初始值为0,j=0,依照光栅扫描顺序处理当前块的M个系数;(1) The initial value of the initialization state machine state is 0, j=0, and the M coefficients of the current block are processed according to the raster scanning order;
(2)输入第j个系数,确定量化步长△和编码在当前变换系数之前的变化系数层级k;(2) Input the jth coefficient, determine the quantization step size △ and the change coefficient level k encoded before the current transform coefficient;
(3)根据△和k计算两个量化器Q0和Q1;(3) Calculate two quantizers Q0 and Q1 according to △ and k;
(4)根据k和状态机state选择量化器进行量化;(4) Select a quantizer for quantization according to k and state machine state;
(5)更新状态机state,在j<M的情况下,j++,并跳至步骤(2);在j>=M的情况下,跳至步骤(1)处理下一个残差块。(5) Update the state machine state, in the case of j<M, j++, and skip to step (2); in the case of j>=M, skip to step (1) to process the next residual block.
在本公开一实施例中,所述方法还包括:对量化后的系数进行熵编码,形成输出码流。In an embodiment of the present disclosure, the method further includes: performing entropy coding on the quantized coefficients to form an output code stream.
在本公开一实施例中,所述待编码图像为待编码帧(Frame)或待编码片(Slice)。In an embodiment of the present disclosure, the image to be encoded is a frame to be encoded (Frame) or a slice to be encoded (Slice).
在本公开一实施例中,步骤601中确定待编码图像的空域连续性特征值,包括:In an embodiment of the present disclosure, determining the spatial continuity feature value of the image to be encoded in step 601 includes:
根据所述待编码图像的梯度图,确定所述空域连续性特征值。The feature value of spatial continuity is determined according to the gradient map of the image to be encoded.
在本公开一实施例中,步骤601中确定待编码图像的空域连续性特征值,包括:In an embodiment of the present disclosure, determining the spatial continuity feature value of the image to be encoded in step 601 includes:
根据所述待编码图像确定第一梯度图;determining a first gradient map according to the image to be encoded;
根据所述第一梯度图确定第二梯度图;determining a second gradient map based on the first gradient map;
根据所述第二梯度图计算平均值,以所述平均值作为所述待编码图像的空域连续性特征值;calculating an average value according to the second gradient map, and using the average value as the spatial continuity feature value of the image to be encoded;
其中,所述第一梯度图为所述待编码图像对应的梯度图;所述第二梯度图为所述第一梯度图对应 的梯度图。在本公开一实施例中,所述第一梯度图中各像素点的第一梯度根据以下方式确定:Wherein, the first gradient map is a gradient map corresponding to the image to be encoded; the second gradient map is a gradient map corresponding to the first gradient map. In an embodiment of the present disclosure, the first gradient of each pixel in the first gradient map is determined in the following manner:
Gmap(x,y)=|I(x,y)-I(x+1,y)|+|I(x,y)-I(x,y+1)|;Gmap(x,y)=|I(x,y)-I(x+1,y)|+|I(x,y)-I(x,y+1)|;
其中,(x,y)表示所述待编码图像中的像素点,I(x,y)为像素点(x,y)的像素值,Gmap(x,y)为像素点(x,y)的第一梯度;在本公开一实施例中,YUV空间中,像素值I(x,y)为像素点(x,y)上的亮度分量Y。Wherein, (x, y) represents the pixel in the image to be encoded, I (x, y) is the pixel value of the pixel (x, y), and Gmap (x, y) is the pixel (x, y) In an embodiment of the present disclosure, in the YUV space, the pixel value I(x, y) is the luminance component Y on the pixel point (x, y).
所述第二梯度图中各像素点的第二梯度根据以下方式确定:The second gradient of each pixel in the second gradient map is determined in the following manner:
GGmap(x,y)=|Gmap(x,y)-Gmap(x+1,y)|+|Gmap(x,y)-Gmap(x,y+1)|;GGmap(x,y)=|Gmap(x,y)-Gmap(x+1,y)|+|Gmap(x,y)-Gmap(x,y+1)|;
其中,Gmap(x,y)为像素点(x,y)的第一梯度,GGmap(x,y)为像素点(x,y)的第二梯度。Wherein, Gmap(x, y) is the first gradient of the pixel point (x, y), and GGmap(x, y) is the second gradient of the pixel point (x, y).
可选地,本领域技术人员可以采用图像的其他等效或相似的属性数据,以体现待编码图像的内容的空间连续性,不限于本公开实施例记载的特定示例。Optionally, those skilled in the art may use other equivalent or similar attribute data of the image to reflect the spatial continuity of the content of the image to be encoded, which is not limited to the specific examples described in the embodiments of the present disclosure.
在本公开一实施例中,所述根据所述第二梯度图计算平均值,包括:根据所述第二梯度图中全部像素点的第二梯度计算平均值。In an embodiment of the present disclosure, the calculating the average value according to the second gradient map includes: calculating the average value according to the second gradients of all pixels in the second gradient map.
在本公开一实施例中,步骤6021中所述空域连续性特征值位于特征值阈值范围内,包括:所述空域连续性特征值小于预设的阈值,确定位于特征值阈值范围内。即根据上述方法计算所述待编码图像的空域连续性特征值,在该空域连续性特征值小于预设的阈值的情况下,确定该待编码图像的空域连续性强,后续采用依赖标量量化DSQ方式进行量化和/或反量化;在该空域连续性特征值大于或等于预设的特征阈值的情况下,确定该待编码图像的空域连续性不强,后续采用非依赖标量量化方式进行量化和/或反量化。即,在该实施例中特征值阈值范围包括:小于预设的阈值的特征值。In an embodiment of the present disclosure, the feature value of the spatial continuity in step 6021 is within the feature threshold range, including: the spatial continuity feature value is smaller than a preset threshold, and is determined to be within the feature threshold range. That is, the spatial continuity eigenvalue of the image to be encoded is calculated according to the above method, and when the spatial continuity eigenvalue is smaller than the preset threshold, it is determined that the spatial continuity of the image to be encoded is strong, and subsequent dependent scalar quantization DSQ Quantization and/or dequantization by way of quantization and/or dequantization; in the case that the spatial continuity feature value is greater than or equal to the preset feature threshold, it is determined that the spatial continuity of the image to be encoded is not strong, and subsequent quantization and / or dequantization. That is, in this embodiment, the feature value threshold range includes: feature values smaller than a preset threshold.
需要说明的是,本公开实施例提供的方案中空域连续性特征值用于表征所述待编码图像内容的空间连续性,除了上述示例的通过计算第一梯度图以及第二梯度图的方式来计算空域连续性特征值外,本领域技术人员还可以选择其他相似或等效的方法计算待编码图像的空域连续性特征值。具体的计算方案不同,其各自对应的特征值阈值范围不同,位于特征值阈值范围内的待编码图像即为空域连续性强的图像,位于特征值阈值范围外的待编码图像即为空域连续性不强的图像。具体的空域连续性特征值的计算方法以及对应的特征值阈值范围不限于本公开上述示例的方面。It should be noted that in the solution provided by the embodiments of the present disclosure, the spatial continuity feature value is used to characterize the spatial continuity of the image content to be encoded, except for the method of calculating the first gradient map and the second gradient map in the above example. In addition to calculating the spatial continuity eigenvalues, those skilled in the art can also choose other similar or equivalent methods to calculate the spatial continuity eigenvalues of the image to be encoded. The specific calculation schemes are different, and their corresponding eigenvalue threshold ranges are different. The image to be encoded within the eigenvalue threshold range is an image with strong spatial continuity, and the image to be encoded outside the eigenvalue threshold range is spatially continuous. Not strong image. The specific calculation method of the spatial continuity feature value and the corresponding feature value threshold range are not limited to the aspects of the above examples of the present disclosure.
在本公开一实施例中,所述方法还包括:In an embodiment of the present disclosure, the method further includes:
步骤603,将量化方式标识写入编码码流中;其中,所述量化方式标识指示依赖标量量化方式或非依赖标量量化方式。Step 603, write the quantization mode identifier into the encoded code stream; wherein, the quantization mode identifier indicates a scalar-dependent quantization mode or a scalar-independent quantization mode.
在本公开一实施例中,步骤603中将量化方式标识写入编码码流中,包括:将所述量化方式标识写入所述编码码流的以下语法元素之一中:序列(Sequence)级语法元素、帧(Frame)级语法元素和片(Slice)级语法元素。In an embodiment of the present disclosure, writing the quantization mode identifier into the encoded code stream in step 603 includes: writing the quantization mode identifier into one of the following syntax elements of the encoded code stream: sequence (Sequence) level syntax elements, frame (Frame) level syntax elements and slice (Slice) level syntax elements.
可以看到,编码端针对不同图像各自确定量化方式后,将所确定的量化方式对应的量化方式标识写入编码码流。该量化方式标识承载于码流中不同层级的语法元素。解码端解析码流获得该标识后,将更加该标识的指示执行对应的反量化方法。本领域技术人员可以理解,编码端写入的量化方式标识,将被解码端解析获得,该标识在解码端也可以被理解为反量化方式标识。It can be seen that after the encoding end determines quantization modes for different images, it writes the quantization mode identification corresponding to the determined quantization mode into the coded code stream. The quantization method identifies syntax elements carried at different levels in the code stream. After the decoder parses the code stream and obtains the identifier, it will execute the corresponding dequantization method according to the identifier. Those skilled in the art can understand that the quantization mode identifier written by the encoding end will be analyzed and obtained by the decoding end, and the identifier can also be understood as an inverse quantization mode identifier at the decoding end.
在本公开一实施例中,量化方式标识为1,指示依赖标量量化方式;量化方式标识为0,指示非依赖标量量化方式。可选地,还可以是其他取值,例如true,false,或者其他的取值方式,在这里不做限定。In an embodiment of the present disclosure, the quantization mode is marked as 1, indicating a dependent scalar quantization mode; the quantization mode is marked as 0, indicating a non-scalar quantization mode. Optionally, it can also be other values, such as true, false, or other value methods, which are not limited here.
在本公开一实施例中,步骤603中各待编码图像的量化方式标识也可以采用多个标识合并设置的方式,根据预设的合并设置规则,解码端能够反向解析出各量化方式标识。例如,一个视频序列(包括16个图像)中,前5个图像的量化方式标识为1,后11个图像的量化方式标识为0,则可以在序列级的语法单元中设置16位数据1111100000000000,指示该序列所包括的16个图像的量化方式分别为依赖标量量化方式DSQ或非依赖标量量化方式;或者,可以在序列级的语法单元中设置1,5,1;6,11,0;表示从第一个图像开始连续5个图像的量化方式标识为1(指示依赖标量量化DSQ),从第6个图像开始连续11个图像的量化方式标识为0(非依赖标量量化);或者,也可以在16个图像级语法单元中分别设置1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0。可以看到,本公开实施例提 供的方案,通过扩展编码码流中的承载的数据,能够针对图像量化或反量化方式进行指示,具体承载的位置和/或承载数据的编码方式,不限于本公开示例内容,本领域技术人员根据上述示例可以替换选择不同的实施方式。In an embodiment of the present disclosure, the quantization mode identifiers of each image to be encoded in step 603 may also be combined and set by multiple identifiers. According to the preset combination setting rules, the decoder can reversely analyze each quantization mode identifier. For example, in a video sequence (including 16 images), the quantization mode of the first 5 images is marked as 1, and the quantization mode of the last 11 images is marked as 0, then 16-bit data 1111100000000000 can be set in the sequence-level syntax unit, Indicates that the quantization methods of the 16 images included in the sequence are scalar-dependent quantization DSQ or scalar-independent quantization respectively; or, 1, 5, 1; 6, 11, 0 can be set in the sequence-level syntax unit; The quantization mode of 5 consecutive images from the first image is marked as 1 (indicating dependent scalar quantization DSQ), and the quantization mode of 11 consecutive images starting from the 6th image is marked as 0 (non-scalar quantization); or, also 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 can be set in 16 image-level syntax units. It can be seen that the solution provided by the embodiments of the present disclosure can indicate the image quantization or inverse quantization mode by extending the data carried in the encoded code stream. The specific position of the carried data and/or the coding method of the carried data are not limited to The content of the example is disclosed, and those skilled in the art may alternatively select different implementations according to the above examples.
本公开实施例还提供一种视频编码方法,其量化相关步骤如图8所示,包括:An embodiment of the present disclosure also provides a video coding method, the steps related to quantization are shown in FIG. 8 , including:
获取待编码视频序列,从头(i=0)开始,根据以下步骤依次处理每一帧(第i帧)图像:Obtain the video sequence to be encoded, start from the beginning (i=0), and process each frame (frame i) sequentially according to the following steps:
步骤801,计算第i帧图像的空间连续性特征值ss;Step 801, calculating the spatial continuity feature value ss of the i-th frame image;
步骤802,判断特征值ss是否小于预设的特征阈值T;如果小于,则执行步骤803;如果大于或等于,则执行步骤804;Step 802, judging whether the feature value ss is less than the preset feature threshold T; if it is less, then perform step 803; if it is greater than or equal to, then perform step 804;
步骤803,确定第i帧图像的量化方式标识pic_DSQ_enable_flag为1;Step 803, determine that the quantization mode flag pic_DSQ_enable_flag of the i-th frame image is 1;
步骤804,确定第i帧图像的量化方式标识pic_DSQ_enable_flag为0;Step 804, determine that the quantization mode flag pic_DSQ_enable_flag of the i-th frame image is 0;
步骤805,i加1 Step 805, add 1 to i
步骤806,判断当前序列是否已完成编码,如果已完成,则该视频序列编码结束;如果未完成,则获取下一帧图像,继续执行步骤801-806。Step 806, judging whether the encoding of the current sequence has been completed, if it is completed, the encoding of the video sequence ends; if not, the next frame of image is obtained, and the execution of steps 801-806 is continued.
其中,步骤801包括:Wherein, step 801 includes:
步骤8011,计算当前帧图像的梯度图Gmap;Step 8011, calculate the gradient map Gmap of the current frame image;
步骤8012,计算梯度图Gmap的梯度图GGmap,根据GGmap计算平均值ss。Step 8012, calculate the gradient map GGmap of the gradient map Gmap, and calculate the average value ss according to the GGmap.
其中,Gmap也称为第一梯度图,根据以下方式确定:Among them, Gmap is also called the first gradient map, which is determined according to the following method:
Gmap(x,y)=|I(x,y)-I(x+1,y)|+|I(x,y)-I(x,y+1)|;Gmap(x,y)=|I(x,y)-I(x+1,y)|+|I(x,y)-I(x,y+1)|;
其中,(x,y)表示所述待编码图像中的像素点,I(x,y)为像素点(x,y)的像素值,即为像素点(x,y)上的亮度分量Y;Wherein, (x, y) represents the pixel in the image to be encoded, and I(x, y) is the pixel value of the pixel (x, y), which is the luminance component Y on the pixel (x, y) ;
GGmap也称为第二梯度图,根据以下方式确定:GGmap, also known as the second gradient map, is determined according to:
GGmap(x,y)=|Gmap(x,y)-Gmap(x+1,y)|+|Gmap(x,y)-Gmap(x,y+1)|;GGmap(x,y)=|Gmap(x,y)-Gmap(x+1,y)|+|Gmap(x,y)-Gmap(x,y+1)|;
其中,Gmap(x,y)为像素点(x,y)的第一梯度。Wherein, Gmap(x, y) is the first gradient of the pixel point (x, y).
在本公开一实施例中,还提供一种视频编码方法,包括:In an embodiment of the present disclosure, a video coding method is also provided, including:
首先,根据如图8所述方法确定每一帧图像的量化方式标识pic_DSQ_enable_flag;输入图像被划分成不重叠的多个CTU块。First, determine the quantization flag pic_DSQ_enable_flag of each frame of image according to the method as shown in Figure 8; the input image is divided into multiple non-overlapping CTU blocks.
然后,按照光栅扫描顺序依次处理每个CTU,根据帧内/帧间预测确定的最优模式将CTU按照划分成若干个块(CU1,CU2,…,CUi,…),并得到相应的预测残差块(resB1,resB2,…,resBi,…)。Then, each CTU is processed sequentially according to the raster scan sequence, and the CTU is divided into several blocks (CU1, CU2, ..., CUi, ...) according to the optimal mode determined by intra/inter prediction, and the corresponding prediction residuals are obtained. difference block (resB1, resB2, ..., resBi, ...).
然后,对残差块做变换和量化,若pic_DSQ_enable_flag=1,进行依赖标量量化,主要步骤如下:Then, transform and quantize the residual block. If pic_DSQ_enable_flag=1, perform dependent scalar quantization. The main steps are as follows:
(1)输入第i个残差块resBi,初始化状态state=0,j=0,依照光栅扫描顺序处理当前块的M个系数;(1) Input the i-th residual block resBi, initialize the state state=0, j=0, process the M coefficients of the current block according to the raster scanning order;
(2)输入第j个系数,确定量化步长△和编码在当前变换系数之前的变化系数层级k;(2) Input the jth coefficient, determine the quantization step size △ and the change coefficient level k encoded before the current transform coefficient;
(3)根据△和k计算两个量化器Q0和Q1;(3) Calculate two quantizers Q0 and Q1 according to △ and k;
(4)根据k和state选择量化器进行量化;(4) Select a quantizer for quantization according to k and state;
(5)更新state,若j<M,j++,跳至步骤(2),否则i++,跳至步骤(1)。(5) Update state, if j<M, j++, skip to step (2), otherwise i++, skip to step (1).
若pic_DSQ_enable_flag=0,进行非依赖标量量化,直接根据量化步长确定量化器进行量化。If pic_DSQ_enable_flag=0, non-dependent scalar quantization is performed, and the quantizer is directly determined according to the quantization step size for quantization.
最后,对量化后的系数进行熵编码,输出码流等待传输。Finally, entropy encoding is performed on the quantized coefficients, and the output code stream is waiting for transmission.
在本公开一实施例中,所述方法还包括:将每一帧图像的量化方式标识pic_DSQ_enable_flag写入编码码流;写入所述编码码流中的以下语法元素之一中:序列(Sequence)级语法元素、帧(Frame)级语法元素和片(Slice)级语法元素。In an embodiment of the present disclosure, the method further includes: writing the quantization mode identifier pic_DSQ_enable_flag of each frame of image into the coded code stream; writing into one of the following syntax elements in the coded code stream: Sequence level syntax elements, frame (Frame) level syntax elements and slice (Slice) level syntax elements.
可以看到,采用本公开实施例提供的方案,可以对视频序列中每个待编码图像采用不同的量化方式,并将指示各图像的量化方式的标识写入语法元素中,以指示解码端根据该标识对各图像分别进行对应方法的反量化。It can be seen that, using the solutions provided by the embodiments of the present disclosure, different quantization methods can be used for each image to be encoded in the video sequence, and the identifier indicating the quantization method of each image can be written into the syntax element, so as to indicate the decoding end according to This flag performs inverse quantization of the corresponding method for each image.
需要说明的是,本公开实施例所记载的编码方法重点体现了编码整体流程中的量化相关步骤,其他方面编码步骤的实施细节根据相关规范或方案实施即可,不属于本公开方案限定或保护的范围,在 此不一一赘述。It should be noted that the encoding method described in the embodiments of the present disclosure focuses on quantification-related steps in the overall encoding process. The implementation details of the encoding steps in other aspects can be implemented according to relevant specifications or schemes, and are not limited or protected by the disclosed scheme. range, which will not be detailed here.
本公开实施例还提供一种解码方法,如图9所示,包括:An embodiment of the present disclosure also provides a decoding method, as shown in FIG. 9 , including:
步骤901,解析码流获得待解码图像的量化方式标识;Step 901, analyzing the code stream to obtain the quantization mode identification of the image to be decoded;
步骤902,根据所述量化方式标识所指示的量化方式,对所述待解码图像进行反量化;Step 902, perform inverse quantization on the image to be decoded according to the quantization mode indicated by the quantization mode identifier;
其中,所述量化方式标识为根据原始图像的空域连续性特征值所确定的用于指示依赖标量量化方式或非依赖标量量化方式的标识。Wherein, the quantization mode identification is an identification determined according to the spatial continuity feature value of the original image to indicate a scalar-dependent quantization mode or a scalar-independent quantization mode.
需要说明的是,步骤901中解析码流获得的量化方式标识,是编码端在步骤603中写入的量化方式标识。所述对待解码图像进行反量化的方式是与编码端根据原始图像(即编码前图像)的空域连续性特征值所确定的量化方式所对应的;所述空域连续性特征值为用于表征所述原始图像内容的空间连续性的值。It should be noted that the quantization mode identifier obtained by parsing the code stream in step 901 is the quantization mode identifier written by the encoder in step 603 . The method of dequantizing the image to be decoded corresponds to the quantization method determined by the encoding end according to the spatial continuity feature value of the original image (ie, the image before encoding); the spatial continuity feature value is used to represent the A value that describes the spatial continuity of the original image content.
在本公开一实施例中,步骤902中根据所述量化方式标识所指示的量化方式,对所述待解码图像进行反量化,包括:In an embodiment of the present disclosure, in step 902, inverse quantization is performed on the image to be decoded according to the quantization mode indicated by the quantization mode identifier, including:
在所述量化方式标识指示非依赖标量量化方式的情况下,依次对所述码流进行熵解码并得到的变换量化后的每一个残差块执行以下步骤:In the case where the quantization mode identifier indicates an independent scalar quantization mode, perform entropy decoding on the code stream in turn and perform the following steps for each residual block obtained after transformation and quantization:
根据量化步长确定量化器进行反量化;Determine the quantizer for inverse quantization according to the quantization step size;
在所述量化方式标识指示依赖标量量化方式的情况下,依次对所述码流进行熵解码并得到的变换量化后的每一个残差块执行以下步骤:In the case where the quantization mode identifier indicates that it depends on the scalar quantization mode, perform entropy decoding on the code stream in turn and perform the following steps for each residual block obtained after transformation and quantization:
确定量化步长△和重建在当前变换系数之前的变化系数层级k;Determine the quantization step size △ and reconstruct the change coefficient level k before the current transform coefficient;
根据量化步长△和变化系数层级k计算两个量化器Q0和Q1;Calculate two quantizers Q0 and Q1 according to the quantization step size △ and the variation coefficient level k;
根据变化系数层级k和状态机state选择量化器进行反量化。Select a quantizer for inverse quantization according to the variation coefficient level k and the state machine state.
在本公开一实施例中,在所述量化方式标识指示依赖标量量化方式的情况下,依次对所述码流进行熵解码并得到的变换量化后的每一个残差块执行以下步骤:In an embodiment of the present disclosure, in the case where the quantization mode identifier indicates that it depends on the scalar quantization mode, the following steps are performed for each residual block obtained by entropy decoding the code stream in turn after transformation and quantization:
(1)初始化状态机state的初始值为0,j=0,依照光栅扫描顺序处理当前块的M个系数;(1) The initial value of the initialization state machine state is 0, j=0, and the M coefficients of the current block are processed according to the raster scanning order;
(2)输入第j个系数,确定量化步长△和重建在当前变换系数之前的变化系数层级k;(2) Input the jth coefficient, determine the quantization step size △ and reconstruct the change coefficient level k before the current transform coefficient;
(3)根据△和k计算两个量化器Q0和Q1;(3) Calculate two quantizers Q0 and Q1 according to △ and k;
(4)根据k和状态机state选择量化器进行反量化;(4) Select a quantizer for inverse quantization according to k and state machine state;
(5)更新状态机state,在j<M的情况下,j++,并跳至步骤(2);在j>=M的情况下,跳至步骤(1)处理下一个残差块。(5) Update the state machine state, in the case of j<M, j++, and skip to step (2); in the case of j>=M, skip to step (1) to process the next residual block.
在本公开一实施例中,所述方法还包括:In an embodiment of the present disclosure, the method further includes:
对反量化后的残差块进行反变换,将反变换后的残差值和预测值叠加,得到重建编码单元CU,直到当前编码树单元CTU完成重建;Perform inverse transformation on the inversely quantized residual block, superimpose the inversely transformed residual value and the predicted value, and obtain the reconstructed coding unit CU until the reconstruction of the current coding tree unit CTU is completed;
将重建后的图像进行滤波后存入缓冲区,等待视频播放。Filter the reconstructed image and store it in the buffer, waiting for the video to play.
在本公开一实施例中,步骤901中解析码流获得所述待解码图像的量化方式标识,包括:解析所述码流,从以下语法元素之一中获得所述待解码图像的量化方式标识:In an embodiment of the present disclosure, parsing the code stream in step 901 to obtain the quantization mode identification of the image to be decoded includes: parsing the code stream, and obtaining the quantization mode identification of the image to be decoded from one of the following syntax elements :
序列(Sequence)级语法元素、帧(Frame)级语法元素和片(Slice)级语法元素。Sequence (Sequence) level syntax elements, frame (Frame) level syntax elements and slice (Slice) level syntax elements.
即针对待解码图像的量化方式标识可以从多个层级的语法元素中解析获得。That is, the quantization mode identifier for the image to be decoded can be obtained by parsing syntax elements of multiple levels.
可以看到,解码端能够从接收到的码流中解析得到待解码图像的量化方式标识,根据该标识所指示的量化方式进行对应的反量化,以实现解码。It can be seen that the decoder can parse the received code stream to obtain the quantization mode identifier of the image to be decoded, and perform corresponding inverse quantization according to the quantization mode indicated by the identifier to realize decoding.
需要说明的是,步骤902中根据所述量化方式标识所指示的量化方式,对所述待解码图像进行反量化,是指:对待解码图像对应的量化块根据量化标识所指示的量化方式进行对应的反量化。It should be noted that, in step 902, performing inverse quantization on the image to be decoded according to the quantization method indicated by the quantization method identifier means: corresponding to the quantization block corresponding to the image to be decoded according to the quantization method indicated by the quantization identifier dequantization.
本公开实施例还提供一种解码方法,包括:An embodiment of the present disclosure also provides a decoding method, including:
首先,输入码流进行熵解码,并得到变换量化后的残差块(resB*1,resB*2,…,resB*i,…);First, entropy decoding is performed on the input code stream, and the transformed and quantized residual blocks (resB*1, resB*2, ..., resB*i, ...) are obtained;
接着,对残差块做反量化,获取量化方式标识pic_DSQ_enable_flag;若pic_DSQ_enable_flag=1, 进行依赖标量反量化,主要步骤如下:Next, dequantize the residual block to obtain the quantization mode flag pic_DSQ_enable_flag; if pic_DSQ_enable_flag=1, perform dependent scalar dequantization, the main steps are as follows:
(1)输入第i个残差块resB*i,初始化状态state=0,j=0,依照光栅扫描顺序处理当前块的M个系数;(1) Input the i-th residual block resB*i, initialize the state state=0, j=0, process the M coefficients of the current block according to the raster scanning order;
(2)输入第j个系数,确定量化步长△和重建在当前变换系数之前的变化系数层级k;(2) Input the jth coefficient, determine the quantization step size △ and reconstruct the change coefficient level k before the current transform coefficient;
(3)根据△和k计算两个量化器Q0和Q1;(3) Calculate two quantizers Q0 and Q1 according to △ and k;
(4)根据k和state选择量化器进行反量化;(4) Select a quantizer for inverse quantization according to k and state;
(5)更新state,若j<M,j++,跳至步骤(2),否则i++,跳至步骤(1)。(5) Update state, if j<M, j++, skip to step (2), otherwise i++, skip to step (1).
若pic_DSQ_enable_flag=0,进行非依赖标量反量化,直接根据量化步长确定量化器进行反量化。If pic_DSQ_enable_flag=0, non-dependent scalar inverse quantization is performed, and the quantizer is directly determined according to the quantization step size to perform inverse quantization.
然后,对反量化后的残差块做反变换,将反变换后的残差值和预测值叠加,得到重建CU,直到当前CTU完成重建。Then, inverse transform is performed on the inversely quantized residual block, and the inversely transformed residual value and predicted value are superimposed to obtain a reconstructed CU until the reconstruction of the current CTU is completed.
最后,将重建图像送入DBF/SAO/ALF滤波器,滤波后的图像送入缓冲区,等待视频播放。Finally, the reconstructed image is sent to the DBF/SAO/ALF filter, and the filtered image is sent to the buffer, waiting for the video to play.
需要说明的是,本公开实施例所记载的解码方法重点体现了解码整体流程中的反量化相关步骤,其他方面解码步骤的实施细节根据相关规范或方案实施即可,不属于本公开方案限定或保护的范围,在此不一一赘述。It should be noted that the decoding method described in the embodiments of the present disclosure focuses on the steps related to inverse quantization in the overall decoding process. The implementation details of the decoding steps in other aspects can be implemented according to relevant specifications or schemes, and do not belong to the limitations or schemes of the present disclosure. The scope of protection will not be repeated here.
本公开一实施例还提供了一种视频编码设备,如图10所示,包括处理器以及存储有可在所述处理器上运行的计算机程序的存储器,其中,所述处理器执行所述计算机程序时实现如本公开任一实施例所述的视频编码方法。An embodiment of the present disclosure also provides a video encoding device, as shown in FIG. 10 , including a processor and a memory storing a computer program that can run on the processor, wherein the processor executes the computer The program implements the video coding method described in any embodiment of the present disclosure.
本公开一实施例还提供了一种视频解码设备,如图10所示,包括处理器以及存储有可在所述处理器上运行的计算机程序的存储器,其中,所述处理器执行所述计算机程序时实现如本公开任一实施例所述的视频解码方法。An embodiment of the present disclosure also provides a video decoding device, as shown in FIG. 10 , including a processor and a memory storing a computer program that can run on the processor, wherein the processor executes the computer The program realizes the video decoding method described in any embodiment of the present disclosure.
本公开一实施例还提供了一种视频编解码系统,包括如本公开任一实施所述的视频编码设备和/或本公开任一实施所述的视频解码设备。An embodiment of the present disclosure further provides a video encoding and decoding system, including the video encoding device described in any implementation of the present disclosure and/or the video decoding device described in any implementation of the present disclosure.
本公开一实施例还提供了一种非瞬态计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,其中,所述计算机程序时被处理器执行时实现如本公开任一实施例所述的视频解码方法或编码方法。An embodiment of the present disclosure also provides a non-transitory computer-readable storage medium, the computer-readable storage medium stores a computer program, wherein, when the computer program is executed by a processor, any implementation of the present disclosure can be realized. The video decoding method or encoding method described in the example.
本公开一实施例还提供了一种码流,其中,所述码流根据如本公开任一实施例所述的视频编码方法生成,其中,所述码流中包括量化方式标识,所述量化方式标识用于指示编码端对图像进行量化的方式。An embodiment of the present disclosure also provides a code stream, wherein the code stream is generated according to the video coding method according to any embodiment of the present disclosure, wherein the code stream includes a quantization mode identifier, and the quantization The mode identifier is used to indicate the way the encoder quantizes the image.
可以看到,本公开实施例提供的编解码方法,可以在几乎不降低编码性能的前提下减少编码复杂度。相比于现有量化技术,本技术对于空域内容非连续的图像,采用非依赖标量量化技术,由于这些图像的内容非连续,统一采用原本的依赖标量量化并不能起到预期的编码优化效果,因此对于这些图像采用非依赖标量量化,不仅不会损失编码性能,还可减少总编码时间。总之,本公开实施例提供的方案,可以在保持和相关技术基本相当的编码性能的情况下显著减少编码复杂度。It can be seen that the encoding and decoding methods provided by the embodiments of the present disclosure can reduce encoding complexity without reducing encoding performance. Compared with the existing quantization technology, this technology uses non-dependent scalar quantization technology for images with discontinuous spatial content. Since the content of these images is discontinuous, the original dependent scalar quantization cannot achieve the expected coding optimization effect. Therefore, using scalar-independent quantization for these images not only does not lose coding performance, but also reduces the total coding time. In a word, the solutions provided by the embodiments of the present disclosure can significantly reduce the coding complexity while maintaining the coding performance substantially equivalent to that of the related art.
在一或多个示例性实施例中,所描述的功能可以硬件、软件、固件或其任一组合来实施。如果以软件实施,那么功能可作为一个或多个指令或代码存储在计算机可读介质上或经由计算机可读介质传输,且由基于硬件的处理单元执行。计算机可读介质可包含对应于例如数据存储介质等有形介质的计算机可读存储介质,或包含促进计算机程序例如根据通信协议从一处传送到另一处的任何介质的通信介质。以此方式,计算机可读介质通常可对应于非暂时性的有形计算机可读存储介质或例如信号或载波等通信介质。数据存储介质可为可由一或多个计算机或者一或多个处理器存取以检索用于实施本公开中描述的技术的指令、代码和/或数据结构的任何可用介质。计算机程序产品可包含计算机可读介质。In one or more exemplary embodiments, the functions described may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functions may be stored on or transmitted over, as one or more instructions or code, a computer-readable medium and executed by a hardware-based processing unit. Computer-readable media may include computer-readable storage media that correspond to tangible media such as data storage media, or communication media including any medium that facilitates transfer of a computer program from one place to another, eg, according to a communication protocol. In this manner, a computer-readable medium may generally correspond to a non-transitory tangible computer-readable storage medium or a communication medium such as a signal or carrier wave. Data storage media may be any available media that can be accessed by one or more computers or one or more processors to retrieve instructions, code and/or data structures for implementation of the techniques described in this disclosure. A computer program product may comprise a computer readable medium.
举例来说且并非限制,此类计算机可读存储介质可包括RAM、ROM、EEPROM、CD-ROM或其它光盘存储装置、磁盘存储装置或其它磁性存储装置、快闪存储器或可用来以指令或数据结构的形式存储所要程序代码且可由计算机存取的任何其它介质。而且,还可以将任何连接称作计算机可读介质举例来说,如果使用同轴电缆、光纤电缆、双绞线、数字订户线(DSL)或例如红外线、无线电及微波等无线技术从网站、服务器或其它远程源传输指令,则同轴电缆、光纤电缆、双纹线、DSL或例如红外线、无线电及微波等无线技术包含于介质的定义中。然而应了解,计算机可读存储介质和数据存 储介质不包含连接、载波、信号或其它瞬时(瞬态)介质,而是针对非瞬时有形存储介质。如本文中所使用,磁盘及光盘包含压缩光盘(CD)、激光光盘、光学光盘、数字多功能光盘(DVD)、软磁盘或蓝光光盘等,其中磁盘通常以磁性方式再生数据,而光盘使用激光以光学方式再生数据。上文的组合也应包含在计算机可读介质的范围内。By way of example and not limitation, such computer-readable storage media may include RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk or other magnetic storage, flash memory, or may be used to store instructions or data Any other medium that stores desired program code in the form of a structure and that can be accessed by a computer. Moreover, any connection could also be termed a computer-readable medium. For example, if a connection is made from a website, server or other remote source for transmitting instructions, coaxial cable, fiber optic cable, dual wire, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of medium. It should be understood, however, that computer-readable storage media and data storage media do not encompass connections, carrier waves, signals, or other transitory (transitory) media, but are instead directed to non-transitory tangible storage media. As used herein, disk and disc include compact disc (CD), laser disc, optical disc, digital versatile disc (DVD), floppy disk, or blu-ray disc, etc. where disks usually reproduce data magnetically, while discs use lasers to Data is reproduced optically. Combinations of the above should also be included within the scope of computer-readable media.
可由例如一或多个数字信号理器(DSP)、通用微处理器、专用集成电路(ASIC)现场可编程逻辑阵列(FPGA)或其它等效集成或离散逻辑电路等一或多个处理器来执行指令。因此,如本文中所使用的术语“处理器”可指上述结构或适合于实施本文中所描述的技术的任一其它结构中的任一者。另外,在一些方面中,本文描述的功能性可提供于经配置以用于编码和解码的专用硬件和/或软件模块内,或并入在组合式编解码器中。并且,可将所述技术完全实施于一个或多个电路或逻辑元件中。can be implemented by one or more processors such as one or more digital signal processors (DSPs), general purpose microprocessors, application specific integrated circuits (ASICs), field programmable logic arrays (FPGAs), or other equivalent integrated or discrete logic circuits. Execute instructions. Accordingly, the term "processor," as used herein may refer to any of the foregoing structure or any other structure suitable for implementation of the techniques described herein. In addition, in some aspects the functionality described herein may be provided within dedicated hardware and/or software modules configured for encoding and decoding, or incorporated in a combined codec. Also, the techniques may be fully implemented in one or more circuits or logic elements.
本公开实施例的技术方案可在广泛多种装置或设备中实施,包含无线手机、集成电路(IC)或一组IC(例如,芯片组)。本公开实施例中描各种组件、模块或单元以强调经配置以执行所描述的技术的装置的功能方面,但不一定需要通过不同硬件单元来实现。而是,如上所述,各种单元可在编解码器硬件单元中组合或由互操作硬件单元(包含如上所述的一个或多个处理器)的集合结合合适软件和/或固件来提供。The technical solutions of the embodiments of the present disclosure may be implemented in a wide variety of devices or devices, including a wireless handset, an integrated circuit (IC), or a set of ICs (eg, a chipset). Various components, modules, or units are described in the disclosed embodiments to emphasize functional aspects of devices configured to perform the described techniques, but do not necessarily require realization by different hardware units. Rather, as described above, the various units may be combined in a codec hardware unit or provided by a collection of interoperable hardware units (comprising one or more processors as described above) in combination with suitable software and/or firmware.
本领域普通技术人员可以理解,上文中所公开方法中的全部或某些步骤、系统、装置中的功能模块/单元可以被实施为软件、固件、硬件及其适当的组合。在硬件实施方式中,在以上描述中提及的功能模块/单元之间的划分不一定对应于物理组件的划分;例如,一个物理组件可以具有多个功能,或者一个功能或步骤可以由若干物理组件合作执行。某些组件或所有组件可以被实施为由处理器,如数字信号处理器或微处理器执行的软件,或者被实施为硬件,或者被实施为集成电路,如专用集成电路。这样的软件可以分布在计算机可读介质上,计算机可读介质可以包括计算机存储介质(或非暂时性介质)和通信介质(或暂时性介质)。如本领域普通技术人员公知的,术语计算机存储介质包括在用于存储信息(诸如计算机可读指令、数据结构、程序模块或其他数据)的任何方法或技术中实施的易失性和非易失性、可移除和不可移除介质。计算机存储介质包括但不限于RAM、ROM、EEPROM、闪存或其他存储器技术、CD-ROM、数字多功能盘(DVD)或其他光盘存储、磁盒、磁带、磁盘存储或其他磁存储装置、或者可以用于存储期望的信息并且可以被计算机访问的任何其他的介质。此外,本领域普通技术人员公知的是,通信介质通常包含计算机可读指令、数据结构、程序模块或者诸如载波或其他传输机制之类的调制数据信号中的其他数据,并且可包括任何信息递送介质。Those of ordinary skill in the art can understand that all or some of the steps in the methods disclosed above, the functional modules/units in the system, and the device can be implemented as software, firmware, hardware, and an appropriate combination thereof. In a hardware implementation, the division between functional modules/units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component may have multiple functions, or one function or step may be composed of several physical components. Components cooperate to execute. Some or all of the components may be implemented as software executed by a processor, such as a digital signal processor or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on computer readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media). As known to those of ordinary skill in the art, the term computer storage media includes both volatile and nonvolatile media implemented in any method or technology for storage of information, such as computer readable instructions, data structures, program modules, or other data. permanent, removable and non-removable media. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cartridges, tape, magnetic disk storage or other magnetic storage devices, or can Any other medium used to store desired information and which can be accessed by a computer. In addition, as is well known to those of ordinary skill in the art, communication media typically embodies computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media .

Claims (22)

  1. 一种视频解码方法,其特征在于,包括:A video decoding method, characterized in that, comprising:
    解析码流获得待解码图像的量化方式标识;Analyze the code stream to obtain the quantization mode identification of the image to be decoded;
    根据所述量化方式标识所指示的量化方式,对所述待解码图像进行反量化;Dequantize the image to be decoded according to the quantization mode indicated by the quantization mode identifier;
    其中,所述量化方式标识为根据原始图像的空域连续性特征值所确定的用于指示依赖标量量化方式或非依赖标量量化方式的标识。Wherein, the quantization mode identification is an identification determined according to the spatial continuity feature value of the original image to indicate a scalar-dependent quantization mode or a scalar-independent quantization mode.
  2. 如权利要求1所述的解码方法,其特征在于,The decoding method according to claim 1, characterized in that,
    所述方法还包括:The method also includes:
    对反量化后的残差块进行反变换,将反变换后的残差值和预测值叠加,得到重建编码单元CU,直到当前编码树单元CTU完成重建;Perform inverse transformation on the inversely quantized residual block, superimpose the inversely transformed residual value and the predicted value, and obtain the reconstructed coding unit CU until the reconstruction of the current coding tree unit CTU is completed;
    将重建后的图像进行滤波后存入缓冲区。The reconstructed image is filtered and stored in the buffer.
  3. 如权利要求1或2所述的解码方法,其特征在于,The decoding method according to claim 1 or 2, characterized in that,
    解析码流获得所述待解码图像的量化方式标识,包括:解析所述码流,从以下语法元素之一中获得所述待解码图像的量化方式标识:Analyzing the code stream to obtain the quantization mode identification of the image to be decoded includes: parsing the code stream, and obtaining the quantization mode identification of the image to be decoded from one of the following syntax elements:
    序列级语法元素、帧级语法元素、片级语法元素。Sequence-level syntax elements, frame-level syntax elements, and slice-level syntax elements.
  4. 如权利要求1或2所述的解码方法,其特征在于,The decoding method according to claim 1 or 2, characterized in that,
    所述根据所述量化方式标识所指示的量化方式,对所述待解码图像进行反量化,包括:The dequantization of the image to be decoded according to the quantization mode indicated by the quantization mode identification includes:
    在所述量化方式标识指示非依赖标量量化方式的情况下,依次对所述码流进行熵解码并得到的变换量化后的每一个残差块执行以下步骤:In the case where the quantization mode identifier indicates an independent scalar quantization mode, perform entropy decoding on the code stream in turn and perform the following steps for each residual block obtained after transformation and quantization:
    根据量化步长确定量化器进行反量化;Determine the quantizer for inverse quantization according to the quantization step size;
    在所述量化方式标识指示依赖标量量化方式的情况下,依次对所述码流进行熵解码并得到的变换量化后的每一个残差块执行以下步骤:In the case where the quantization mode identifier indicates that it depends on the scalar quantization mode, perform entropy decoding on the code stream in turn and perform the following steps for each residual block obtained after transformation and quantization:
    确定量化步长△和重建在当前变换系数之前的变化系数层级k;Determine the quantization step size △ and reconstruct the change coefficient level k before the current transform coefficient;
    根据量化步长△和变化系数层级k计算两个量化器Q0和Q1;Calculate two quantizers Q0 and Q1 according to the quantization step size △ and the variation coefficient level k;
    根据变化系数层级k和状态机state选择量化器进行反量化。Select a quantizer for inverse quantization according to the variation coefficient level k and the state machine state.
  5. 一种视频编码方法,其特征在于,包括:A video coding method, characterized in that, comprising:
    确定待编码图像的空域连续性特征值;Determine the spatial continuity eigenvalue of the image to be encoded;
    根据所述空域连续性特征值确定对所述待编码图像采用依赖标量量化方式或非依赖标量量化方式进行量化。Determining, according to the spatial continuity feature value, that the image to be encoded is quantized in a scalar-dependent quantization manner or in a scalar-independent quantization manner.
  6. 如权利要求5所述的编码方法,其特征在于,The encoding method according to claim 5, characterized in that,
    所述根据所述空域连续性特征值确定对所述待编码图像采用依赖标量量化方式或非依赖标量量化方式进行量化,包括:The determining according to the spatial continuity eigenvalues to quantize the image to be encoded using a scalar-dependent quantization method or a scalar-independent quantization method includes:
    在所述空域连续性特征值位于特征值阈值范围内的情况下,对所述待编码图像采用依赖标量量化方式进行量化;When the spatial continuity eigenvalue is within the eigenvalue threshold range, performing quantization on the image to be encoded using a dependent scalar quantization method;
    在所述空域连续性特征值位于特征值阈值范围外的情况下,对所述待编码图像采用非依赖标量量化方式进行量化。In the case that the spatial continuity feature value is outside the feature value threshold range, the image to be encoded is quantized using a scalar-independent quantization manner.
  7. 如权利要求5或6所述的编码方法,其特征在于,The coding method according to claim 5 or 6, characterized in that,
    所述空域连续性特征值为用于表征所述待编码图像内容的空间连续性的值。The spatial continuity feature value is a value used to characterize the spatial continuity of the image content to be encoded.
  8. 如权利要求5或6所述的编码方法,其特征在于,The coding method according to claim 5 or 6, characterized in that,
    所述方法还包括:The method also includes:
    对量化后的系数进行熵编码,形成输出码流。Entropy encoding is performed on the quantized coefficients to form an output code stream.
  9. 如权利要求5或6所述的编码方法,其特征在于,The coding method according to claim 5 or 6, characterized in that,
    所述对所述待编码图像采用非依赖标量量化方式进行量化,包括:The quantization of the image to be encoded using a non-dependent scalar quantization method includes:
    依次对根据所述待编码图像进行划分和预测后得到每一个残差块执行以下步骤:Perform the following steps for each residual block obtained after dividing and predicting the image to be encoded in turn:
    根据所量化步长确定量化器进行量化;Determine the quantizer to perform quantization according to the quantized step size;
    所述对所述待编码图像采用依赖标量量化方式进行量化,包括:依次对根据所述待编码图像进行划分和预测后得到每一个残差块执行以下步骤:The quantization of the image to be coded by relying on scalar quantization includes: sequentially performing the following steps on each residual block obtained after dividing and predicting the image to be coded:
    确定量化步长△和编码在当前变换系数之前的变化系数层级k;Determine the quantization step size △ and the change coefficient level k encoded before the current transform coefficient;
    根据量化步长△和变化系数层级k计算两个量化器Q0和Q1;Calculate two quantizers Q0 and Q1 according to the quantization step size △ and the variation coefficient level k;
    根据变化系数层级k和状态机state选择量化器进行量化。Select a quantizer for quantization according to the variation coefficient level k and the state machine state.
  10. 如权利要求5或6所述的编码方法,其特征在于,The coding method according to claim 5 or 6, characterized in that,
    所述待编码图像为待编码帧或待编码片。The image to be encoded is a frame to be encoded or a slice to be encoded.
  11. 如权利要求5或6所述的编码方法,其特征在于,The coding method according to claim 5 or 6, characterized in that,
    所述确定待编码图像的空域连续性特征值,包括:The determination of the spatial continuity feature value of the image to be encoded includes:
    根据所述待编码图像的梯度图,确定所述空域连续性特征值。The feature value of spatial continuity is determined according to the gradient map of the image to be encoded.
  12. 如权利要求11所述的编码方法,其特征在于,The encoding method according to claim 11, characterized in that,
    所述根据所述待编码图像的梯度图,确定所述空域连续性特征值,包括:The determining the spatial continuity feature value according to the gradient map of the image to be encoded includes:
    根据所述待编码图像确定第一梯度图;determining a first gradient map according to the image to be encoded;
    根据所述第一梯度图确定第二梯度图;determining a second gradient map based on the first gradient map;
    根据所述第二梯度图计算平均值,以所述平均值作为所述待编码图像的空域连续性特征值;calculating an average value according to the second gradient map, and using the average value as the spatial continuity feature value of the image to be encoded;
    其中,所述第一梯度图为所述待编码图像对应的梯度图;所述第二梯度图为所述第一梯度图对应的梯度图。Wherein, the first gradient map is a gradient map corresponding to the image to be encoded; the second gradient map is a gradient map corresponding to the first gradient map.
  13. 如权利要求12所述的编码方法,其特征在于,The encoding method according to claim 12, characterized in that,
    所述第一梯度图中各像素点的第一梯度根据以下方式确定:The first gradient of each pixel in the first gradient map is determined in the following manner:
    Gmap(x,y)=|I(x,y)-I(x+1,y)|+|I(x,y)-I(x,y+1)|;Gmap(x,y)=|I(x,y)-I(x+1,y)|+|I(x,y)-I(x,y+1)|;
    其中,(x,y)表示所述待编码图像中的像素点,I(x,y)为像素点(x,y)的像素值,Gmap(x,y)为像素点(x,y)的第一梯度;Wherein, (x, y) represents the pixel in the image to be encoded, I (x, y) is the pixel value of the pixel (x, y), and Gmap (x, y) is the pixel (x, y) the first gradient of
    所述第二梯度图中各像素点的第二梯度根据以下方式确定:The second gradient of each pixel in the second gradient map is determined in the following manner:
    GGmap(x,y)=|Gmap(x,y)-Gmap(x+1,y)|+|Gmap(x,y)-Gmap(x,y+1)|;GGmap(x,y)=|Gmap(x,y)-Gmap(x+1,y)|+|Gmap(x,y)-Gmap(x,y+1)|;
    其中,Gmap(x,y)为像素点(x,y)的第一梯度,GGmap(x,y)为像素点(x,y)的第二梯度。Wherein, Gmap(x, y) is the first gradient of the pixel point (x, y), and GGmap(x, y) is the second gradient of the pixel point (x, y).
  14. 如权利要求13所述的编码方法,其特征在于,The encoding method according to claim 13, characterized in that,
    所述根据所述第二梯度图计算平均值,包括:The calculation of the average value according to the second gradient map includes:
    根据所述第二梯度图中全部像素点的第二梯度计算平均值。An average value is calculated according to the second gradients of all pixels in the second gradient map.
  15. 如权利要求6所述的编码方法,其特征在于,The encoding method according to claim 6, characterized in that,
    所述空域连续性特征值位于特征值阈值范围内,包括:The characteristic value of the spatial continuity is located in the characteristic value threshold range, including:
    所述空域连续性特征值小于预设的阈值的情况下,确定所述空域连续性特征值位于特征值阈值范围内。In a case where the characteristic value of the spatial continuity is smaller than a preset threshold, it is determined that the characteristic value of the spatial continuity is within a range of the characteristic value threshold.
  16. 如权利要求5或6所述的编码方法,其特征在于,The coding method according to claim 5 or 6, characterized in that,
    所述方法还包括:将量化方式标识写入编码码流中;其中,所述量化方式标识指示依赖标量量化方式或非依赖标量量化方式。The method further includes: writing the quantization mode identifier into the coded code stream; wherein, the quantization mode identifier indicates a dependent scalar quantization mode or an independent scalar quantization mode.
  17. 如权利要求16所述的编码方法,其特征在于,The encoding method according to claim 16, characterized in that,
    所述将量化方式标识写入编码码流中,包括:The writing of the quantization mode identification into the encoded code stream includes:
    将所述量化方式标识写入所述编码码流的以下语法元素之一中:Write the quantization mode identifier into one of the following syntax elements of the encoded code stream:
    序列级语法元素、帧级语法元素和片级语法元素。Sequence-level syntax elements, frame-level syntax elements, and slice-level syntax elements.
  18. 一种视频解码设备,其特征在于,包括处理器以及存储有可在所述处理器上运行的计算机程序的存储器,其中,所述处理器执行所述计算机程序时实现如权利要求1至4任一项所述的解码方法。A video decoding device, characterized by comprising a processor and a memory storing a computer program that can run on the processor, wherein when the processor executes the computer program, any of claims 1 to 4 can be realized. One of the described decoding methods.
  19. 一种视频编码设备,其特征在于,包括处理器以及存储有可在所述处理器上运行的计算机程序的存储器,其中,所述处理器执行所述计算机程序时实现如权利要求5至17任一所述的编码方法。A video encoding device, characterized by comprising a processor and a memory storing a computer program that can run on the processor, wherein when the processor executes the computer program, any of claims 5 to 17 can be realized. - said encoding method.
  20. 一种视频编解码系统,其中,包括如权利要求18所述的解码设备和/或如权利要求19所述的编码设备。A video codec system, comprising the decoding device as claimed in claim 18 and/or the encoding device as claimed in claim 19.
  21. 一种非瞬态计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,其中,所述计算机程序时被处理器执行时实现如权利要求1至17中任一所述的方法。A non-transitory computer-readable storage medium, the computer-readable storage medium stores a computer program, wherein the computer program implements the method according to any one of claims 1 to 17 when executed by a processor.
  22. 一种码流,其中,所述码流根据如权利要求5至17中任一所述的编码方法生成,其中,所述码流中包括量化方式标识,所述量化方式标识用于指示编码端对图像进行量化的方式。A code stream, wherein the code stream is generated according to the encoding method according to any one of claims 5 to 17, wherein the code stream includes a quantization mode identification, and the quantization mode identification is used to indicate that the coding end How to quantize the image.
PCT/CN2021/108723 2021-07-27 2021-07-27 Video decoding and encoding methods and devices, and storage medium WO2023004590A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2021/108723 WO2023004590A1 (en) 2021-07-27 2021-07-27 Video decoding and encoding methods and devices, and storage medium
CN202180099003.3A CN117426089A (en) 2021-07-27 2021-07-27 Video decoding and encoding method and device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2021/108723 WO2023004590A1 (en) 2021-07-27 2021-07-27 Video decoding and encoding methods and devices, and storage medium

Publications (1)

Publication Number Publication Date
WO2023004590A1 true WO2023004590A1 (en) 2023-02-02

Family

ID=85086175

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/108723 WO2023004590A1 (en) 2021-07-27 2021-07-27 Video decoding and encoding methods and devices, and storage medium

Country Status (2)

Country Link
CN (1) CN117426089A (en)
WO (1) WO2023004590A1 (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110944179A (en) * 2018-11-18 2020-03-31 北京达佳互联信息技术有限公司 Video data decoding method and device
CN111131819A (en) * 2018-10-31 2020-05-08 北京字节跳动网络技术有限公司 Quantization parameter under coding tool of dependent quantization
WO2020106668A1 (en) * 2018-11-22 2020-05-28 Interdigital Vc Holdings, Inc. Quantization for video encoding and decoding
US20200244995A1 (en) * 2019-01-28 2020-07-30 Mediatek Inc. Methods and Apparatuses for Coding Transform Blocks
CN112236999A (en) * 2018-03-29 2021-01-15 弗劳恩霍夫应用研究促进协会 Dependency quantization
CN112840656A (en) * 2018-08-24 2021-05-25 三星电子株式会社 Method and apparatus for image encoding and method and apparatus for image decoding
WO2021123250A1 (en) * 2019-12-20 2021-06-24 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. Decoder, encoder and method for supporting adaptive dependent quantization of transform coefficient levels
US20210218966A1 (en) * 2020-01-10 2021-07-15 Mediatek Inc. Signaling Quantization Related Parameters

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112236999A (en) * 2018-03-29 2021-01-15 弗劳恩霍夫应用研究促进协会 Dependency quantization
CN112840656A (en) * 2018-08-24 2021-05-25 三星电子株式会社 Method and apparatus for image encoding and method and apparatus for image decoding
CN111131819A (en) * 2018-10-31 2020-05-08 北京字节跳动网络技术有限公司 Quantization parameter under coding tool of dependent quantization
CN110944179A (en) * 2018-11-18 2020-03-31 北京达佳互联信息技术有限公司 Video data decoding method and device
WO2020106668A1 (en) * 2018-11-22 2020-05-28 Interdigital Vc Holdings, Inc. Quantization for video encoding and decoding
US20200244995A1 (en) * 2019-01-28 2020-07-30 Mediatek Inc. Methods and Apparatuses for Coding Transform Blocks
WO2021123250A1 (en) * 2019-12-20 2021-06-24 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. Decoder, encoder and method for supporting adaptive dependent quantization of transform coefficient levels
US20210218966A1 (en) * 2020-01-10 2021-07-15 Mediatek Inc. Signaling Quantization Related Parameters

Non-Patent Citations (2)

* 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)", 123. MPEG MEETING; 20180716 - 20180720; LJUBLJANA; (MOTION PICTURE EXPERT GROUP OR ISO/IEC JTC1/SC29/WG11), 3 July 2018 (2018-07-03), XP030195734 *
LIU DAN, CHEN GUISHENG, SONG CHUANMING, HE XING, WANG XIANGHAI: "Research Advances in Screen Content Coding Methods", JOURNAL OF COMPUTER RESEARCH AND DEVELOPMENT, KEXUE CHUBANSHE, BEIJING, CN, vol. 54, no. 9, 30 September 2017 (2017-09-30), CN , pages 2059 - 2076, XP093030128, ISSN: 1000-1239, DOI: 10.7544/issn1000-1239.2017.20160649 *

Also Published As

Publication number Publication date
CN117426089A (en) 2024-01-19

Similar Documents

Publication Publication Date Title
US10609375B2 (en) Sample adaptive offset (SAO) adjustment method and apparatus and SAO adjustment determination method and apparatus
WO2018001207A1 (en) Coding and decoding method and apparatus
RU2678490C2 (en) Determining palette size, palette entries and filtering of palette coded blocks in video coding
JP6266605B2 (en) Unified signaling for lossless coding mode and pulse code modulation (PCM) mode in video coding
AU2016211519B2 (en) Clipping for cross-component prediction and adaptive color transform for video coding
JP6046235B2 (en) Coded block flag inference in video coding
JP6396439B2 (en) Residual differential pulse code modulation (DPCM) expansion and harmony with conversion skip, rotation, and scanning
TWI527465B (en) Coded block flag coding
RU2580066C2 (en) Memory efficient context modelling
RU2645291C2 (en) Quantization parameter (qp) encoding when encoding video
TWI520583B (en) Method, device, and computer-readable storage medium for decoding and encoding video data
TWI686080B (en) Contexts for large coding tree units
TW201841503A (en) Intra filtering flag in video coding
TW201804806A (en) Signaling of quantization information in non-quadtree-only partitioned video coding
TWI827606B (en) Trellis coded quantization coefficient coding
KR20110071231A (en) Encoding method, decoding method and apparatus thereof
TW201408076A (en) Sign hiding techniques for quantized transform coefficients in video coding
KR20160070808A (en) Systems and methods for inter-layer rps derivation based on sub-layer reference prediction dependency
JP2018511232A (en) Optimization for encoding video data using non-square sections
US9961351B2 (en) Palette mode coding
US20220385903A1 (en) Image or video coding based on signaling of transform skip - and palette coding related information
US20220385925A1 (en) Method and device for coding transform coefficient
WO2023004590A1 (en) Video decoding and encoding methods and devices, and storage medium
WO2022257142A1 (en) Video decoding and coding method, device and storage medium
WO2023039856A1 (en) Video decoding method and device, video encoding method and device, and storage medium

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: 21951206

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE