WO2021134700A1 - Method and apparatus for video encoding and decoding - Google Patents

Method and apparatus for video encoding and decoding Download PDF

Info

Publication number
WO2021134700A1
WO2021134700A1 PCT/CN2019/130941 CN2019130941W WO2021134700A1 WO 2021134700 A1 WO2021134700 A1 WO 2021134700A1 CN 2019130941 W CN2019130941 W CN 2019130941W WO 2021134700 A1 WO2021134700 A1 WO 2021134700A1
Authority
WO
WIPO (PCT)
Prior art keywords
quantization parameter
block
chrominance
offset
luminance
Prior art date
Application number
PCT/CN2019/130941
Other languages
French (fr)
Chinese (zh)
Inventor
马思伟
王苏红
郑萧桢
王苫社
Original Assignee
北京大学
深圳市大疆创新科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 北京大学, 深圳市大疆创新科技有限公司 filed Critical 北京大学
Priority to PCT/CN2019/130941 priority Critical patent/WO2021134700A1/en
Priority to CN201980050133.0A priority patent/CN112544079A/en
Publication of WO2021134700A1 publication Critical patent/WO2021134700A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/117Filters, e.g. for pre-processing or post-processing
    • 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/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock

Definitions

  • This application relates to the field of image processing, and more specifically, to a method and device for video encoding and decoding.
  • Filtering is an important module in the video coding framework. Filtering can include bilateral filtering, adaptive loop filtering, adaptive sample compensation filtering, and deblocking filtering. At present, when deblocking filtering on the boundary of adjacent chroma blocks, the quantization parameter (QP) of the chroma block needs to be used, and the quantization parameter of the chroma block is based on the quantization of the luminance block Parameters to export.
  • the current method is to add a quantization parameter offset (offset) on the basis of the quantization parameter derived from the luminance block. When determining the Chroma QP offset, there are still areas that can be improved.
  • the method and device for video encoding and decoding provided by the embodiments of the present application can improve the accuracy of deblocking filtering and improve the efficiency of video encoding and decoding.
  • a video coding and decoding method which includes: when performing deblock filtering on the boundary between a first chroma block and a second chroma block, if the quantized residuals of the first chroma block are all Zero, set the quantization parameter offset of the coding unit level of the first chroma block to the first preset value;
  • the second quantization parameter of the first chrominance block is determined according to the first quantization parameter and the quantization parameter offset at the coding unit level of the first chrominance block, wherein the first quantization parameter is based on the first quantization parameter.
  • the quantization parameter of the luminance block corresponding to the chrominance block is derived;
  • Deblock filtering is performed on the boundary between the first chroma block and the second chroma block according to the second quantization parameter.
  • a video encoding and decoding device including a processor and a memory, the memory is used to store a computer program, and the processor is used to call the computer program to perform the following operations:
  • the coding unit level of the first chroma block is The offset of the quantization parameter is set to the first preset value
  • the second quantization parameter of the first chrominance block is determined according to the first quantization parameter and the quantization parameter offset at the coding unit level of the first chrominance block, wherein the first quantization parameter is based on the first quantization parameter.
  • the quantization parameter of the luminance block corresponding to the chrominance block is derived;
  • Deblock filtering is performed on the boundary between the first chroma block and the second chroma block according to the second quantization parameter.
  • a chip is provided, which is used to implement the method in the first aspect or its implementation manners.
  • the chip includes: a processor, configured to call and run a computer program from the memory, so that the device installed with the chip executes the method in the first aspect or its implementation manners.
  • a computer-readable storage medium for storing a computer program.
  • the computer program includes instructions for executing the first aspect or any possible implementation of the first aspect.
  • a computer program product including computer program instructions that cause a computer to execute the above-mentioned first aspect or the method in each implementation manner of the first aspect.
  • the CU of the current block when deblocking and filtering the boundary of a chroma block, if the current chroma block is an all-zero block (that is, the quantization parameter is all zero), the CU of the current block can be
  • the offset of the level quantization parameter is set to a preset value (for example, 0), so as to prevent the deblocking of the chrominance component from using the wrong QP offset, improve the effect of deblocking filtering in the existing process, and enhance the effect and performance of video coding and decoding.
  • Fig. 1 is an architecture diagram of a technical solution applying an embodiment of the present application
  • Fig. 2 is a schematic diagram of a video coding framework 2 according to an embodiment of the present application.
  • FIG. 3 is a schematic flowchart of a video encoding and decoding method provided by an embodiment of the present application
  • FIG. 4 is a schematic diagram of a video encoding and decoding device provided by an embodiment of the present application.
  • FIG. 5 is a schematic structural diagram of a chip provided by an embodiment of the present application.
  • Fig. 1 is a structural diagram of a technical solution applying an embodiment of the present application.
  • the system 100 can receive the data 102 to be processed, process the data 102 to be processed, and generate processed data 108.
  • the system 100 may receive the data to be encoded and encode the data to be encoded to generate encoded data, or the system 100 may receive the data to be decoded and decode the data to be decoded to generate decoded data.
  • the components in the system 100 may be implemented by one or more processors.
  • the processor may be a processor in a computing device or a processor in a mobile device (such as a drone).
  • the processor may be any type of processor, which is not limited in the embodiment of the present invention.
  • the processor may include an encoder, a decoder, or a codec, etc.
  • One or more memories may also be included in the system 100.
  • the memory can be used to store instructions and data, for example, computer-executable instructions that implement the technical solutions of the embodiments of the present invention, to-be-processed data 102, processed data 108, and so on.
  • the memory may be any type of memory, which is not limited in the embodiment of the present invention.
  • the data to be encoded may include text, images, graphic objects, animation sequences, audio, video, or any other data that needs to be encoded.
  • the data to be encoded may include sensor data from sensors, which may be vision sensors (for example, cameras, infrared sensors), microphones, near-field sensors (for example, ultrasonic sensors, radars), position sensors, and temperature sensors. Sensors, touch sensors, etc.
  • the data to be encoded may include information from the user, for example, biological information, which may include facial features, fingerprint scans, retinal scans, voice recordings, DNA sampling, and the like.
  • Fig. 2 is a schematic diagram of a video coding framework 2 according to an embodiment of the present application.
  • each frame in the video to be coded is coded in sequence.
  • the current coded frame mainly undergoes processing such as prediction (Prediction), transformation (Transform), quantization (Quantization), and entropy coding (Entropy Coding), and finally the bit stream of the current coded frame is output.
  • the decoding process usually decodes the received code stream according to the inverse process of the above process to recover the video frame information before decoding.
  • the video encoding framework 2 includes an encoding control module 201, which is used to perform decision-making control actions and parameter selection in the encoding process.
  • the encoding control module 201 controls the parameters used in transformation, quantization, inverse quantization, and inverse transformation, controls the selection of intra-frame or inter-frame modes, and parameter control of motion estimation and filtering, and
  • the control parameters of the encoding control module 201 will also be input to the entropy encoding module, and the encoding will be performed to form a part of the encoded bitstream.
  • the encoded frame is partitioned 202, specifically, it is firstly divided into slices, and then divided into blocks.
  • the coded frame is divided into a plurality of non-overlapping largest coding tree units (Coding Tree Units, CTUs), and each CTU can also be in a quadtree, or binary tree, or triple tree manner. Iteratively divides into a series of smaller coding units (Coding Unit, CU).
  • the CU may also include a prediction unit (Prediction Unit, PU) and a transformation unit (Transform Unit, TU) associated with it.
  • the PU It is the basic unit of prediction
  • TU is the basic unit of transformation and quantization.
  • the PU and TU are respectively obtained by dividing into one or more blocks on the basis of the CU, where one PU includes multiple prediction blocks (PB) and related syntax elements.
  • the PU and TU may be the same, or obtained by the CU through different division methods.
  • at least two of the CU, PU, and TU are the same.
  • CU, PU, and TU are not distinguished, and prediction, quantization, and transformation are all performed in units of CU.
  • the CTU, CU, or other data units formed are all referred to as coding blocks in the following.
  • the data unit for video encoding may be a frame, a slice, a coding tree unit, a coding unit, a coding block, or any group of the above.
  • the size of the data unit can vary.
  • a prediction process is performed to remove the spatial and temporal redundant information of the current coded frame.
  • predictive coding methods include intra-frame prediction and inter-frame prediction.
  • Intra-frame prediction uses only the reconstructed information in the current frame to predict the current coding block
  • inter-frame prediction uses the information in other previously reconstructed frames (also called reference frames) to predict the current coding block.
  • Make predictions Specifically, in the embodiment of the present application, the encoding control module 201 is used to make a decision to select intra prediction or inter prediction.
  • the process of intra-frame prediction 203 includes obtaining the reconstructed block of the coded neighboring block around the current coding block as a reference block, and based on the pixel value of the reference block, the prediction mode method is used to calculate the predicted value to generate the predicted block , Subtracting the corresponding pixel values of the current coding block and the prediction block to obtain the residual of the current coding block, the residual of the current coding block is transformed 204, quantized 205, and entropy coding 210 to form the code stream of the current coding block. Further, after all the coded blocks of the current coded frame undergo the above-mentioned coding process, they form a part of the coded stream of the coded frame. In addition, the control and reference data generated in the intra-frame prediction 203 are also encoded by the entropy encoding 210 to form a part of the encoded bitstream.
  • the transform 204 is used to remove the correlation of the residual of the image block, so as to improve the coding efficiency.
  • the transformation of the residual data of the current coding block usually adopts two-dimensional discrete cosine transform (DCT) transformation and two-dimensional discrete sine transform (DST) transformation, for example, the residual information of the coded block Respectively multiply an N ⁇ M transformation matrix and its transposed matrix, and obtain the transformation coefficient of the current coding block after the multiplication.
  • DCT discrete cosine transform
  • DST two-dimensional discrete sine transform
  • the quantization 205 is used to further improve the compression efficiency.
  • the transform coefficients can be quantized to obtain the quantized coefficients, and then the quantized coefficients are entropy-encoded 210 to obtain the residual code stream of the current coding block.
  • the entropy coding method includes But it is not limited to content adaptive binary arithmetic coding (Context Adaptive Binary Arithmetic Coding, CABAC) entropy coding.
  • CABAC Context Adaptive Binary Arithmetic Coding
  • the bit stream obtained by entropy coding and the coding mode information after coding are stored or sent to the decoding end.
  • the quantization result is also inversely quantized 206, and the inverse quantization result is inversely transformed 207.
  • the reconstructed pixels are obtained by using the inverse transform result and the motion compensation result.
  • filtering ie, loop filtering
  • the filtered reconstructed image (belonging to the reconstructed video frame) is output.
  • the reconstructed image can be used as a reference frame image of other frame images for inter-frame prediction.
  • the reconstructed image may also be referred to as a reconstructed image or a reconstructed image.
  • the coded neighboring block in the intra prediction 203 process is: the neighboring block that has been coded before the current coding block is coded, and the residual generated in the coding process of the neighboring block is transformed 204, quantized 205, After inverse quantization 206 and inverse transform 207, the reconstructed block is obtained by adding the prediction block of the neighboring block.
  • the inverse quantization 206 and the inverse transformation 207 are the inverse processes of the quantization 206 and the transformation 204, which are used to restore the residual data before the quantization and transformation.
  • the inter prediction process includes motion estimation (ME) 208 and motion compensation (MC) 209.
  • the motion estimation is performed 208 according to the reference frame image in the reconstructed video frame, and the image block most similar to the current encoding block is searched for in one or more reference frame images according to a certain matching criterion as a matching block.
  • the relative displacement with the current coding block is the motion vector (Motion Vector, MV) of the current coding block.
  • Motion Vector Motion Vector
  • motion compensation is performed 209 on the current coding block to obtain the prediction block of the current coding block.
  • the original value of the pixel of the coding block is subtracted from the pixel value of the corresponding prediction block to obtain the residual of the coding block.
  • the residual of the current coding block undergoes transformation 204, quantization 205 and entropy coding 210 to form a part of the code stream of the coded frame.
  • the control and reference data generated in the motion compensation 209 are also encoded by the entropy encoding 210 to form a part of the encoded bitstream.
  • the reconstructed video frame is a video frame obtained after filtering 211.
  • the reconstructed video frame includes one or more reconstructed images.
  • Filtering 211 is used to reduce compression distortions such as blocking effects and ringing effects generated in the encoding process.
  • the reconstructed video frame is used to provide reference frames for inter-frame prediction during the encoding process.
  • the reconstructed video frame is output after post-processing For the final decoded video.
  • the inter prediction mode may include an advanced motion vector prediction (Advanced Motion Vector Prediction, AMVP) mode, a merge mode or a skip mode.
  • AMVP Advanced Motion Vector Prediction
  • motion vector prediction Motion Vector Prediction, MVP
  • MVP Motion Vector Prediction
  • the starting point of motion estimation can be determined according to the MVP, and the motion search is performed near the starting point, and the optimal is obtained after the search is completed MV
  • the position of the reference block in the reference image is determined by the MV
  • the reference block is subtracted from the current block to obtain the residual block
  • the MVP is subtracted from the MV to obtain the Motion Vector Difference (MVD)
  • MVD Motion Vector Difference
  • the MVP For the Merge mode, you can determine the MVP first, and directly determine the MVP as the MV of the current block. Among them, in order to obtain the MVP, you can first build a MVP candidate list (merge candidate list), in the MVP candidate list, you can include at least one candidate MVP, each candidate MVP can correspond to an index, the encoding end is from the MVP candidate list After selecting the MVP, the MVP index can be written into the code stream, and the decoder can find the MVP corresponding to the index from the MVP candidate list according to the index, so as to realize the decoding of the image block.
  • a MVP candidate list in the MVP candidate list, you can include at least one candidate MVP, each candidate MVP can correspond to an index, the encoding end is from the MVP candidate list
  • the MVP index can be written into the code stream, and the decoder can find the MVP corresponding to the index from the MVP candidate list according to the index, so as to realize the decoding of the image block.
  • Merge mode can also have other implementations.
  • Skip mode is a special case of Merge mode. After obtaining the MV according to the Merge mode, if the encoding end determines that the current block is basically the same as the reference block, then there is no need to transmit residual data, only the index of the MVP, and further a flag can be passed, which can indicate that the current block can be directly Obtained from the reference block.
  • Merge mode can be applied to geometric prediction technology.
  • the image block to be encoded can be divided into multiple polygonal sub-image blocks.
  • the motion vector can be determined for each sub-image block from the motion information candidate list, and the motion vector can be determined based on each sub-image block.
  • the motion vector determines the prediction sub-block corresponding to each sub-image block, and constructs the prediction block of the current image block based on the prediction sub-block corresponding to each sub-image block, thereby realizing the coding of the current image block.
  • For the decoding end operations corresponding to the encoding end are performed. First, use entropy decoding, inverse quantization and inverse transformation to obtain residual information, and determine whether the current image block uses intra-frame prediction or inter-frame prediction according to the decoded bitstream. If it is intra-frame prediction, the reconstructed image block in the current frame is used to construct prediction information according to the intra-frame prediction method; if it is inter-frame prediction, it is necessary to parse out the motion information, and use the parsed motion information in the reconstructed image Determine the reference block to obtain the prediction information; then, superimpose the prediction information and the residual information, and pass the filtering operation to obtain the reconstruction information.
  • This application proposes a method for video encoding and decoding, which can improve the subjective and objective quality of video encoding and decoding.
  • the subjective and objective quality in the embodiments of the present application may include subjective quality and objective quality.
  • the subjective quality can be evaluated based on human senses, and the objective quality can be evaluated based on a specific model.
  • the performance of video encoding and decoding can be improved, and the video quality can be improved.
  • Block-based loop filtering techniques may include bilateral filtering, adaptive loop filtering, adaptive sample compensation filtering, and deblocking filtering (Deblock).
  • bilateral filtering is that the current pixel is calculated by the weighted average of its own and four adjacent pixel values to achieve edge preservation and denoising.
  • Adaptive loop filtering is a Wiener filter, which is mainly used to minimize the mean square error between the original image and the reconstructed image.
  • the adaptive sample compensation filter classifies the pixels in the image block, and then adds the same compensation value to each type of pixel to make the reconstructed image closer to the original image, thereby suppressing the ringing effect.
  • Deblocking filtering is used for the boundary between the prediction unit and the transformation unit, and the low-pass filter obtained by training is used to perform non-linear weighting of the boundary pixels, thereby reducing the blocking effect; among them, the blocking effect refers to: the current video coding framework takes the block as the unit For encoding, there may be discontinuities at the block boundary due to the different encoding methods between adjacent blocks.
  • Deblocking may include the following three steps: judging the boundary, calculating the strength of the boundary filtering, and performing a deblocking filtering operation.
  • the luma component can be filtered with a 4x4 grid (High Efficiency Video Coding (HEVC) period is an 8x8 grid), and the chroma component can be filtered with an 8x8 grid.
  • the judgment of the boundary can include the following two processes. First, for each 4x4 brightness block in the current CU, it is necessary to determine whether the upper, lower, left, and right boundaries are TU boundaries, and mark them as "boundary"/"non-boundary" . Secondly, for each 4x4 brightness block, determine whether the current CU has selected the Affine mode or the Sub-block Temporal Motion Vector Prediction (SbTMVP) mode.
  • SBTMVP Sub-block Temporal Motion Vector Prediction
  • the boundary of each 4x4 grid inside the current CU is marked as "boundary”. For blocks marked as “boundary”, subsequent operations may be performed; for blocks marked as “non-boundary”, deblocking filtering operations may not be performed.
  • a CU in the Affine mode or the SbTMVP mode, a CU can be further divided into multiple 4x4 sub-CUs (Sub-CU), and each Sub-CU can have its own motion vector.
  • the pixels in the image frame may generally include multiple components, for example, may include a luminance (Luma) component and a chrominance (Chroma) component.
  • a luminance (Luma) component may include a luminance (Luma) component and a chrominance (Chroma) component.
  • the 4x4 block on the left side of the boundary is represented by P (or BlockP), and the 4x4 block on the right side is represented by Q (or BlockQ), and then the boundary filter strength can be calculated according to rule 1.
  • BDPCM block-based Delta Pulse Code Modulation
  • Both P and Q use the IBC mode, and the difference between the MV of P and Q is greater than or equal to 8 in the horizontal or vertical direction;
  • P and Q refer to different reference frames or the number of MVs is different (for example, P is dual MV, Q is single MV);
  • P and Q both use a single MV, and the difference between the two single MVs is greater than or equal to 8;
  • P and Q both use dual MVs, and P's dual MVs are from different reference frames (MV1 is from reference frame 1, MV2 is from reference frame 2), Q's dual MVs are also from two different reference frames (MV3 is from reference frame 1. MV4 comes from reference frame 2), the reference frames for P and Q references are the same. Then the absolute value of MV1-MV3, the absolute value of MV2-MV4, the difference in the horizontal or vertical direction, is greater than or equal to 8;
  • the absolute value of the difference between MV0 and MV2 in List0 is greater than or equal to 8 in the horizontal or vertical direction, or the absolute value of the difference between MV1 and MV3 in List1 is greater than or equal to 8 in the horizontal or numerical direction;
  • the absolute value of the difference between MV0 and MV3 is greater than or equal to 8 in the horizontal or vertical direction, or the absolute value of the difference between MV1 and MV2 is greater than or equal to 8 in the horizontal or numerical direction;
  • List0 and List1 mentioned above refer to reference frame lists.
  • the CU in the bidirectional prediction is predicted from one or two frames of reference images, and these reference images are stored in the reference frame list.
  • Two reference frame lists are set, namely List0 and List1, both of which can contain forward or backward encoded reference frames.
  • the current frame (number 100) has three forward reference frames and three backward reference frames, they are numbered 97, 98, 99, 100, 101, 102, 103 in the order of natural images. These frames are in List0 and The index in List1 is different. In List0, the frame closest to the current frame is marked as index0, and the previous frame is index1....The forward frame is followed by the backward frame in order.
  • the backward frame closest to the current frame in List1 is index0, and the next frame is index1...
  • the forward frame is the forward frame after the backward frames are arranged.
  • the filtering process needs to use quantization parameters (Quantization Parameter, QP), and the QP used for deblocking filtering is derived in the following way:
  • the quantization parameter of the CU where BlockP is located (assumed to be represented by QPP), the QPQ of the CU where BlockQ is located (assumed to be represented by QPQ), and the final QP is
  • QPL (QPP+QPQ+1)>>1, that is, the final quantization parameter QPL is obtained by averaging QPP and QPQ.
  • the QPL is the quantization parameter used when performing deblocking filtering on the boundary between P and Q.
  • the QP corresponding to BlockP and Q is first derived from its neighboring block QP to obtain a predicted quantization parameter (assumed to be represented by QP_Prev), and then a quantization parameter offset is added to QP_Prev (assumed to use Luma QP offset) to obtain the final QP.
  • Chroma QP is derived from Luma QP
  • Chroma QP is derived from Luma QP.
  • There is a fixed way to derive Chroma QP and a QP offset is added to the QP derived from Luma QP.
  • Chroma QP offset is obtained by adding three components, which are image-level Chroma QP offset, Slice-level QP offset, and CU-level QP offset.
  • the same method is used for averaging, as follows to obtain the Chroma QP used in the Deblocking process.
  • the role of QP in the Deblocking process is as follows: Since deblocking filtering removes blocking effects, blocking effects have a certain relationship with quantization parameters. The larger the quantization parameter, the more obvious the distortion, and the corresponding parameter selection of the deblocking filter will be different. The parameters of the deblocking filter have a mapping relationship with the QP, so it is necessary to determine the QP first, and then perform the deblocking filter.
  • the QP of this block should be equal to the predicted QP_prev, that is to say, there is no CU-level QP offset.
  • Luma QP is in one
  • Luma QP offset is set to 0, that is, Luma QP is set to QP_prev.
  • Chroma QP does not set the CU-level Chroma QP offset to 0 when a block is all zero. This will affect the deblocking process of the subsequent Chroma component, which means that the deblocking of the Chroma component may use the wrong QP offset.
  • This application aims to solve the problems of the current deblocking design, so as to improve the effect and performance of deblocking filtering, thereby improving the performance of video coding and decoding.
  • a method 300 for video encoding and decoding provided by an embodiment of this application, the method 300 may include steps S310-S330.
  • S320 Determine the second quantization parameter of the first chrominance block according to the first quantization parameter and the quantization parameter offset of the coding unit level of the first chrominance block, where the first quantization parameter is based on the luminance corresponding to the first chrominance block.
  • the quantization parameter of the block is derived.
  • S330 Perform deblocking filtering on the boundary between the first chroma block and the second chroma block according to the second quantization parameter.
  • the first chrominance block and the second chrominance block in the embodiment of the present application may be graphic blocks after inverse quantization and inverse transformation.
  • the steps can be to predict, transform, and quantize the current image block, and then encode it, where the reference image block of the current image block can be an image block that has undergone inverse quantization, inverse transformation, and filtering.
  • the bits corresponding to the residuals in the bitstream can be inversely quantized and inversely transformed to obtain the residuals, the reconstructed images are obtained according to the reference image and the residuals, and then the anti-reconstructed images are filtered.
  • the first chroma block and the second chroma block in this application may also be referred to as the first filter block and the second filter block.
  • the above-mentioned first quantization parameter is derived based on the quantization parameter (assumed as LumaQP) of the luminance block (assumed as LumaP) corresponding to the first chrominance block (assumed as ChromaP), and the color is derived from the luminance quantization parameter (assumed as Luma QP)
  • the quantization parameter of the degree block (assuming Chroma QP) has a fixed derivation method.
  • the QP of the chrominance component can be derived from the QP of the luminance component by means of table lookup or formula derivation.
  • the corresponding rule of the chrominance block and the luminance block is determined according to the video compression format.
  • each chroma block corresponds to 4 luma blocks, or it can be understood that each chroma pixel (Chroma Pixel) corresponds to four luma pixels (Luma Pixel).
  • each chrominance block corresponds to 2 luminance blocks, or it can be understood that each chrominance pixel corresponds to 2 luminance pixels.
  • each chrominance block corresponds to one luminance block, or it can be understood that each chrominance pixel corresponds to one luminance pixel.
  • each chroma block corresponds to 4 luma blocks.
  • each chrominance pixel corresponds to 4 luminance pixels.
  • the quantization parameter of the chrominance block can be derived according to the quantization parameter of the corresponding luminance block.
  • the quantization parameter of the chrominance block can be derived by averaging or weighting the quantization parameters of the multiple luminance blocks (or luminance pixels).
  • the luminance block corresponding to the first chrominance block may also be a target luminance block (or target luminance pixel) at a preset position among one or more luminance blocks (or luminance pixels) corresponding to the first chrominance block.
  • the video compression format is 4:2:0
  • the target luminance block is located in the upper left corner, lower left corner, upper right corner, or lower right corner of the multiple luminance blocks (or multiple luminance pixels) corresponding to the first chrominance block
  • the brightness block (or the brightness pixel in the upper left corner).
  • the video compression format is 4:2:2, and the target luminance block is two luminance blocks corresponding to the level of the first chrominance block, and the target luminance block is located in the corresponding level of the first chrominance block.
  • the video compression format is 4:1:1, and the target luminance block is the leftmost one, the second one from the left, the third one from the left among the plurality of luminance blocks corresponding to the first chrominance block, or The fourth brightness block (or brightness pixel) from the left.
  • the video compression format is 4:4:4, and the target luminance block is a luminance block (or luminance pixel) corresponding to the first chrominance block.
  • the quantization parameter of the chrominance block can be derived according to the quantization parameter of a corresponding luminance block.
  • the foregoing first preset value is 0. That is, in the case where the first chroma block is an all-zero block (all the quantized residuals are zero), the Chroma QP offset of the chroma block is set to 0.
  • the foregoing determining the second quantization parameter of the first chrominance block according to the first quantization parameter of the luminance block corresponding to the first chrominance block and the quantization parameter offset of the coding unit level of the first chrominance block includes:
  • the second quantization parameter is obtained according to the first quantization parameter, the quantization parameter offset of the coding unit level of the first chrominance block, and the first offset, where the first offset includes the chrominance quantization of the image level of the first chrominance block.
  • the parameter offset and/or the stripe-level chrominance quantization parameter offset of the first chrominance block are obtained according to the first quantization parameter, the quantization parameter offset of the coding unit level of the first chrominance block, and the first offset, where the first offset includes the chrominance quantization of the image level of the first chrominance block.
  • the slice-level chrominance quantization parameter offset is used to determine the second quantization parameter of the first chrominance block.
  • performing deblocking filtering on the boundary between the first chroma block and the second chroma block according to the second quantization parameter includes: obtaining the fourth quantization parameter according to the second quantization parameter and the third quantization parameter, and the third quantization parameter Is the quantization parameter corresponding to the second chrominance block; the boundary between the first chrominance block and the second chrominance block is deblocked and filtered according to the fourth quantization parameter.
  • the quantization parameters of the first chroma block (assumed as ChromaP) and the second chroma block (assumed as ChromaQ) are used. ) To calculate the quantization parameter for deblocking filtering.
  • the quantization parameter corresponding to the second chrominance block is obtained according to the quantization parameter of the luminance block corresponding to the second chrominance block, the quantization parameter offset of the coding unit level of the second chrominance block, and the second offset,
  • the second offset includes the image-level chrominance quantization parameter offset of the second chrominance block and/or the stripe-level chrominance quantization parameter offset of the second chrominance block.
  • the quantization parameter of the luminance block corresponding to the second chrominance block may be based on the quantization parameter of the luminance block corresponding to the second chrominance block, the quantization parameter offset of the coding unit (CU) level of the second chrominance block, and the chrominance quantization parameter of the image level of the second chrominance block.
  • the offset and the slice-level chrominance quantization parameter offset of the second chrominance block are used to determine the quantization parameter of the second chrominance block.
  • the calculation method of calculating the quantization parameter of the second chrominance block reference may be made to the foregoing calculation method of calculating the quantization parameter of the first chrominance block, which is not repeated here.
  • performing deblocking filtering on the boundary between the first chroma block and the second chroma block according to the fourth quantization parameter includes: determining the deblocking filter corresponding to the fourth quantization parameter according to the fourth quantization parameter and the mapping relationship
  • the mapping relationship includes the mapping relationship between at least one quantization parameter and at least one deblocking filter parameter; the boundary between the first chroma block and the second chroma block is determined according to the parameter of the deblocking filter corresponding to the fourth quantization parameter Perform deblocking filtering.
  • the parameters of the deblocking filter have a mapping relationship with QP, so it is necessary to determine the QP first, then determine the parameters of the deblocking filter corresponding to the QP in combination with the mapping relationship, and then use the parameters of the deblocking filter to perform deblocking filtering .
  • the quantization parameter of the luminance block corresponding to the first chrominance block is determined according to the predicted quantization parameter of the luminance block corresponding to the first chrominance block and the offset of the quantization parameter of the luminance block corresponding to the first chrominance block.
  • the predicted quantization parameter of the luminance block corresponding to the first chrominance block is determined by the quantization parameter of the adjacent block of the luminance block corresponding to the first chrominance block.
  • the neighboring block may be, for example, neighboring blocks on the left, top, top left, bottom left, or top right of the luminance block corresponding to the first chrominance block.
  • the luminance block corresponding to the first chrominance block is The quantization parameter offset is set to a second preset value.
  • the second preset value is 0.
  • the quantization parameter of the luminance block corresponding to the second chrominance block is determined according to the predicted quantization parameter of the luminance block corresponding to the second chrominance block and the offset of the quantization parameter of the luminance block corresponding to the second chrominance block.
  • the quantization parameter offset of the luminance block corresponding to the second chrominance block is set to a third preset value.
  • the third preset value is 0.
  • the solution provided in this application can be applied to the encoding end and also can be applied to the decoding end.
  • the encoding end after deblocking and filtering the first chrominance block and the second chrominance block in the above manner, the reconstructed image of the current encoding block/encoding frame can be obtained, and the reconstructed image can be used for subsequent encoding. Reference to other blocks.
  • the decoding end after the first chrominance block and the second chrominance block are deblocked and filtered in the above manner, the restored image of the current image block/image frame can be obtained.
  • the CU-level quantization parameter of the current block can be changed
  • the offset is set to a preset value (for example, 0), so as to prevent the deblocking of the chrominance component from using the wrong QP offset, improve the effect of deblocking filtering in the existing process, and improve the effect and performance of video coding and decoding.
  • FIG. 4 is a schematic structural diagram of a video encoding and decoding device provided by still another embodiment of the present application.
  • the video encoding and decoding apparatus 400 shown in FIG. 4 includes a processor 410 and a memory 420.
  • the processor 410 can call and run a computer program from the memory 420 to implement the method described in FIG. 3 in the embodiment of the present application.
  • the processor 410 may call and run a computer program from the memory 420 to implement the method in the embodiment of the present application.
  • the memory 420 may be a separate device independent of the processor 410, or may be integrated in the processor 410.
  • the video codec device 400 may further include a transceiver 430, and the processor 410 may control the transceiver 430 to communicate with other devices, specifically, may send information or data to other devices, or Receive information or data sent by other devices.
  • the video encoding and decoding device may be, for example, an encoder, a decoder, a terminal (including but not limited to a mobile phone, a camera, a drone, etc.), and the encoding and decoding device may implement the methods in the embodiments of the present application.
  • the encoding and decoding device may implement the methods in the embodiments of the present application.
  • the corresponding process will not be repeated here.
  • Fig. 5 is a schematic structural diagram of a chip of an embodiment of the present application.
  • the chip 500 shown in FIG. 5 includes a processor 510, and the processor 510 can call and run a computer program from the memory to implement the method in the embodiment of the present application.
  • the chip 500 may further include a memory 520.
  • the processor 510 may call and run a computer program from the memory 520 to implement the method in the embodiment of the present application.
  • the memory 520 may be a separate device independent of the processor 510, or may be integrated in the processor 510.
  • the chip 500 may further include an input interface 530.
  • the processor 510 can control the input interface 530 to communicate with other devices or chips, and specifically, can obtain information or data sent by other devices or chips.
  • the chip 500 may further include an output interface 540.
  • the processor 510 can control the output interface 540 to communicate with other devices or chips, and specifically, can output information or data to other devices or chips.
  • the chip mentioned in the embodiment of the present application may also be called a system-level chip, a system-on-chip, a system-on-chip, or a system-on-chip.
  • the processor of the embodiment of the present application may be an integrated circuit image processing system with signal processing capability.
  • the steps of the foregoing method embodiments can be completed by hardware integrated logic circuits in the processor or instructions in the form of software.
  • the above-mentioned processor may be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (ASIC), a ready-made programmable gate array (Field Programmable Gate Array, FPGA) or other Programming logic devices, discrete gates or transistor logic devices, discrete hardware components.
  • DSP Digital Signal Processor
  • ASIC application specific integrated circuit
  • FPGA Field Programmable Gate Array
  • the methods, steps, and logical block diagrams disclosed in the embodiments of the present application can be implemented or executed.
  • the general-purpose processor may be a microprocessor or the processor may also be any conventional processor or the like.
  • the steps of the method disclosed in the embodiments of the present application may be directly embodied as being executed and completed by a hardware decoding processor, or executed and completed by a combination of hardware and software modules in the decoding processor.
  • the software module can be located in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, or electrically erasable programmable memory, registers.
  • the storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.
  • the memory in the embodiments of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memory.
  • the non-volatile memory can be read-only memory (Read-Only Memory, ROM), programmable read-only memory (Programmable ROM, PROM), erasable programmable read-only memory (Erasable PROM, EPROM), and electrically available Erase programmable read-only memory (Electrically EPROM, EEPROM) or flash memory.
  • Volatile memory can be Random Access Memory (RAM), which is used as an external cache.
  • RAM random access memory
  • SRAM static random access memory
  • DRAM dynamic random access memory
  • DRAM synchronous dynamic random access memory
  • DDR SDRAM Double Data Rate Synchronous Dynamic Random Access Memory
  • Enhanced SDRAM, ESDRAM Enhanced Synchronous Dynamic Random Access Memory
  • Synchronous Link Dynamic Random Access Memory Synchronous Link Dynamic Random Access Memory
  • DR RAM Direct Rambus RAM
  • the memory in the embodiment of the present application may also be static random access memory (static RAM, SRAM), dynamic random access memory (dynamic RAM, DRAM), Synchronous dynamic random access memory (synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (double data rate SDRAM, DDR SDRAM), enhanced synchronous dynamic random access memory (enhanced SDRAM, ESDRAM), synchronous connection Dynamic random access memory (synch link DRAM, SLDRAM) and direct memory bus random access memory (Direct Rambus RAM, DR RAM) and so on. That is to say, the memory in the embodiments of the present application is intended to include but not limited to these and any other suitable types of memory.
  • the memory in the embodiment of the present application can provide instructions and data to the processor.
  • a part of the memory may also include a non-volatile random access memory.
  • the memory can also store device type information.
  • the processor may be used to execute instructions stored in the memory, and when the processor executes the instructions, the processor may execute each step corresponding to the terminal device in the foregoing method embodiment.
  • each step of the above method can be completed by an integrated logic circuit of hardware in the processor or instructions in the form of software.
  • the steps of the method disclosed in combination with the embodiments of the present application may be directly embodied as execution and completion by a hardware processor, or execution and completion by a combination of hardware and software modules in the processor.
  • the software module can be located in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, or electrically erasable programmable memory, registers.
  • the storage medium is located in the memory, and the processor executes the instructions in the memory and completes the steps of the above method in combination with its hardware. To avoid repetition, it will not be described in detail here.
  • the pixels in the image can be located in different rows and/or columns, where the length of A can correspond to the number of pixels located in the same row included in A, and the height of A can be Corresponds to the number of pixels in the same column included in A.
  • the length and height of A may also be referred to as the width and depth of A, which are not limited in the embodiment of the present application.
  • the boundary spacing distribution with A can refer to at least one pixel spaced from the boundary of A, and can also be referred to as "not adjacent to the boundary of A” or “not located at the boundary of A”.
  • “Border”, this embodiment of the application does not limit this, where A can be an image, a rectangular area, or a sub-image, and so on.
  • the embodiments of the present application also provide a computer-readable storage medium for storing computer programs.
  • the computer-readable storage medium can be applied to the codec device in the embodiment of the present application, and the computer program causes the computer to execute the corresponding process implemented by the codec device in each method of the embodiment of the present application.
  • the computer program causes the computer to execute the corresponding process implemented by the codec device in each method of the embodiment of the present application.
  • the embodiments of the present application also provide a computer program product, including computer program instructions.
  • the computer program product can be applied to the codec device in the embodiment of the present application, and the computer program instructions cause the computer to execute the corresponding process implemented by the codec device in each method of the embodiment of the present application.
  • the computer program instructions cause the computer to execute the corresponding process implemented by the codec device in each method of the embodiment of the present application.
  • the embodiment of the present application also provides a computer program.
  • the computer program can be applied to the codec device in the embodiment of the present application.
  • the computer program runs on the computer, the computer executes the corresponding process implemented by the codec device in each method of the embodiment of the present application.
  • I will not repeat them here.
  • the term "and/or” is merely an association relationship describing an associated object, indicating that there may be three relationships.
  • a and/or B can mean: A alone exists, A and B exist at the same time, and B exists alone.
  • the character "/" in this text generally indicates that the associated objects before and after are in an "or" relationship.
  • the disclosed system, device, and method can be implemented in other ways.
  • the device embodiments described above are merely illustrative.
  • the division of the units is only a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components may be combined It can be integrated into another system, or some features can be ignored or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may also be electrical, mechanical or other forms of connection.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments of the present application.
  • the functional units in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated unit can be implemented in the form of hardware or software functional unit.
  • the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium.
  • the technical solution of this application is essentially or the part that contributes to the existing technology, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium. It includes several instructions to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the method described in each embodiment of the present application.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disks or optical disks and other media that can store program codes. .

Landscapes

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

Abstract

A method and apparatus for video encoding and decoding, the method comprising: when performing deblocking filtering on a boundary between a first color block and a second color block, if the quantization residuals of the first color block are all zero, setting the quantization parameter offset of an encoding unit level of the first color block to a first preset value; determining a second quantization parameter of the first color block according to a first quantization parameter and the quantization parameter offset of an encoding unit level of the first color block, wherein, the first quantization parameter is derived according to the quantization parameter of the brightness block corresponding to the first color block; performing deblock filtering on the boundary between the first color block and the second color block according to the second quantization parameter.

Description

视频编解码的方法和装置Method and device for video coding and decoding 技术领域Technical field
本申请涉及图像处理领域,并且更为具体地,涉及一种视频编解码的方法和装置。This application relates to the field of image processing, and more specifically, to a method and device for video encoding and decoding.
背景技术Background technique
滤波是视频编码框架中的重要模块,滤波可以包括双边滤波、自适应环路滤波、自适应样值补偿滤波和去块滤波。目前,在对相邻的色度(Chroma)块的边界进行去块滤波时,需要用到色度块的量化参数(Quantization Parameter,QP),而色度块的量化参数是基于亮度块的量化参数来导出的。当前采用的方式是在亮度块导出的量化参数的基础上,增加一个量化参数偏移(offset)。在确定Chroma QP offset时,还存在可以改善的地方。Filtering is an important module in the video coding framework. Filtering can include bilateral filtering, adaptive loop filtering, adaptive sample compensation filtering, and deblocking filtering. At present, when deblocking filtering on the boundary of adjacent chroma blocks, the quantization parameter (QP) of the chroma block needs to be used, and the quantization parameter of the chroma block is based on the quantization of the luminance block Parameters to export. The current method is to add a quantization parameter offset (offset) on the basis of the quantization parameter derived from the luminance block. When determining the Chroma QP offset, there are still areas that can be improved.
发明内容Summary of the invention
本申请实施例提供的视频编解码的方法和装置,可提高去块滤波的准确性,提高视频编解码效率。The method and device for video encoding and decoding provided by the embodiments of the present application can improve the accuracy of deblocking filtering and improve the efficiency of video encoding and decoding.
第一方面,提供了一种视频编解码方法,包括:在对第一色度块和第二色度块的边界进行去块滤波时,若所述第一色度块的量化残差全为零,则将所述第一色度块的编码单元级的量化参数偏移设置为第一预设值;In a first aspect, a video coding and decoding method is provided, which includes: when performing deblock filtering on the boundary between a first chroma block and a second chroma block, if the quantized residuals of the first chroma block are all Zero, set the quantization parameter offset of the coding unit level of the first chroma block to the first preset value;
根据第一量化参数和所述第一色度块的编码单元级的量化参数偏移确定所述第一色度块的第二量化参数,其中,所述第一量化参数是根据所述第一色度块对应的亮度块的量化参数导出的;The second quantization parameter of the first chrominance block is determined according to the first quantization parameter and the quantization parameter offset at the coding unit level of the first chrominance block, wherein the first quantization parameter is based on the first quantization parameter. The quantization parameter of the luminance block corresponding to the chrominance block is derived;
根据所述第二量化参数对所述第一色度块和所述第二色度块的边界进行去块滤波。Deblock filtering is performed on the boundary between the first chroma block and the second chroma block according to the second quantization parameter.
第二方面,提供了一种视频编解码装置,包括处理器和存储器,所述存储器用于存储计算机程序,所述处理器用于调用所述计算机程序执行如下操作:In a second aspect, a video encoding and decoding device is provided, including a processor and a memory, the memory is used to store a computer program, and the processor is used to call the computer program to perform the following operations:
在对第一色度块和第二色度块的边界进行去块滤波时,若所述第一色度块的量化残差全为零,则将所述第一色度块的编码单元级的量化参数偏 移设置为第一预设值;When performing deblock filtering on the boundary between the first chroma block and the second chroma block, if the quantization residuals of the first chroma block are all zero, the coding unit level of the first chroma block is The offset of the quantization parameter is set to the first preset value;
根据第一量化参数和所述第一色度块的编码单元级的量化参数偏移确定所述第一色度块的第二量化参数,其中,所述第一量化参数是根据所述第一色度块对应的亮度块的量化参数导出的;The second quantization parameter of the first chrominance block is determined according to the first quantization parameter and the quantization parameter offset at the coding unit level of the first chrominance block, wherein the first quantization parameter is based on the first quantization parameter. The quantization parameter of the luminance block corresponding to the chrominance block is derived;
根据所述第二量化参数对所述第一色度块和所述第二色度块的边界进行去块滤波。Deblock filtering is performed on the boundary between the first chroma block and the second chroma block according to the second quantization parameter.
第三方面,提供一种芯片,用于实现上述第一方面或其各实现方式中的方法。In a third aspect, a chip is provided, which is used to implement the method in the first aspect or its implementation manners.
具体地,该芯片包括:处理器,用于从存储器中调用并运行计算机程序,使得安装有该芯片的设备执行如上述第一方面或其各实现方式中的方法。Specifically, the chip includes: a processor, configured to call and run a computer program from the memory, so that the device installed with the chip executes the method in the first aspect or its implementation manners.
第四方面,提供了一种计算机可读存储介质,用于存储计算机程序,该计算机程序包括用于执行第一方面或第一方面的任意可能的实现方式中的方法的指令。In a fourth aspect, a computer-readable storage medium is provided for storing a computer program. The computer program includes instructions for executing the first aspect or any possible implementation of the first aspect.
第五方面,提供了一种计算机程序产品,包括计算机程序指令,该计算机程序指令使得计算机执行上述第一方面或第一方面的各实现方式中的方法。In a fifth aspect, a computer program product is provided, including computer program instructions that cause a computer to execute the above-mentioned first aspect or the method in each implementation manner of the first aspect.
本申请实施例提供的视频编解码的方法,在对色度块的边界进行去块滤波时,如果当前色度块是全零块(即量化参数全为零),则可以将当前块的CU级量化参数偏移设置为预设值(例如0),从而避免色度分量的Deblocking使用错误的QP offset,改善现有流程中去块滤波的效果,提升视频编解码的效果和性能。In the video encoding and decoding method provided by the embodiments of this application, when deblocking and filtering the boundary of a chroma block, if the current chroma block is an all-zero block (that is, the quantization parameter is all zero), the CU of the current block can be The offset of the level quantization parameter is set to a preset value (for example, 0), so as to prevent the deblocking of the chrominance component from using the wrong QP offset, improve the effect of deblocking filtering in the existing process, and enhance the effect and performance of video coding and decoding.
附图说明Description of the drawings
图1是应用本申请实施例的技术方案的架构图;Fig. 1 is an architecture diagram of a technical solution applying an embodiment of the present application;
图2是根据本申请实施例的视频编码框架2示意图;Fig. 2 is a schematic diagram of a video coding framework 2 according to an embodiment of the present application;
图3是本申请一实施例提供的视频编解码方法的示意性流程图;FIG. 3 is a schematic flowchart of a video encoding and decoding method provided by an embodiment of the present application;
图4是本申请一实施例提供的视频编解码装置的示意性图;FIG. 4 is a schematic diagram of a video encoding and decoding device provided by an embodiment of the present application;
图5是本申请实施例提供的芯片的示意性结构图。FIG. 5 is a schematic structural diagram of a chip provided by an embodiment of the present application.
具体实施方式Detailed ways
下面对本申请实施例中的技术方案进行描述。The technical solutions in the embodiments of the present application are described below.
除非另有说明,本申请实施例所使用的所有技术和科学术语与本申请的技术领域的技术人员通常理解的含义相同。本申请中所使用的术语只是为了描述具体的实施例的目的,不是旨在限制本申请的范围。Unless otherwise specified, all technical and scientific terms used in the embodiments of the present application have the same meaning as commonly understood by those skilled in the technical field of the present application. The terms used in this application are only for the purpose of describing specific embodiments, and are not intended to limit the scope of this application.
图1是应用本申请实施例的技术方案的架构图。Fig. 1 is a structural diagram of a technical solution applying an embodiment of the present application.
如图1所示,***100可以接收待处理数据102,对待处理数据102进行处理,产生处理后的数据108。例如,***100可以接收待编码数据,对待编码数据进行编码以产生编码后的数据,或者,***100可以接收待解码数据,对待解码数据进行解码以产生解码后的数据。在一些实施例中,***100中的部件可以由一个或多个处理器实现,该处理器可以是计算设备中的处理器,也可以是移动设备(例如无人机)中的处理器。该处理器可以为任意种类的处理器,本发明实施例对此不做限定。在一些可能的设计中,该处理器可以包括编码器、解码器或编解码器等。***100中还可以包括一个或多个存储器。该存储器可用于存储指令和数据,例如,实现本发明实施例的技术方案的计算机可执行指令、待处理数据102、处理后的数据108等。该存储器可以为任意种类的存储器,本发明实施例对此也不做限定。As shown in FIG. 1, the system 100 can receive the data 102 to be processed, process the data 102 to be processed, and generate processed data 108. For example, the system 100 may receive the data to be encoded and encode the data to be encoded to generate encoded data, or the system 100 may receive the data to be decoded and decode the data to be decoded to generate decoded data. In some embodiments, the components in the system 100 may be implemented by one or more processors. The processor may be a processor in a computing device or a processor in a mobile device (such as a drone). The processor may be any type of processor, which is not limited in the embodiment of the present invention. In some possible designs, the processor may include an encoder, a decoder, or a codec, etc. One or more memories may also be included in the system 100. The memory can be used to store instructions and data, for example, computer-executable instructions that implement the technical solutions of the embodiments of the present invention, to-be-processed data 102, processed data 108, and so on. The memory may be any type of memory, which is not limited in the embodiment of the present invention.
待编码数据可以包括文本、图像、图形对象、动画序列、音频、视频、或者任何需要编码的其他数据。在一些情况下,待编码数据可以包括来自传感器的传感数据,该传感器可以为视觉传感器(例如,相机、红外传感器),麦克风、近场传感器(例如,超声波传感器、雷达)、位置传感器、温度传感器、触摸传感器等。在一些情况下,待编码数据可以包括来自用户的信息,例如,生物信息,该生物信息可以包括面部特征、指纹扫描、视网膜扫描、嗓音记录、DNA采样等。The data to be encoded may include text, images, graphic objects, animation sequences, audio, video, or any other data that needs to be encoded. In some cases, the data to be encoded may include sensor data from sensors, which may be vision sensors (for example, cameras, infrared sensors), microphones, near-field sensors (for example, ultrasonic sensors, radars), position sensors, and temperature sensors. Sensors, touch sensors, etc. In some cases, the data to be encoded may include information from the user, for example, biological information, which may include facial features, fingerprint scans, retinal scans, voice recordings, DNA sampling, and the like.
图2是根据本申请实施例的视频编码框架2示意图。如图2所示,在接收待编码视频后,从待编码视频的第一帧开始,依次对待编码视频中的每一帧进行编码。其中,当前编码帧主要经过:预测(Prediction)、变换(Transform)、量化(Quantization)和熵编码(Entropy Coding)等处理,最终输出当前编码帧的码流。对应的,解码过程通常是按照上述过程的逆过程对接收到的码流进行解码,以恢复出解码前的视频帧信息。Fig. 2 is a schematic diagram of a video coding framework 2 according to an embodiment of the present application. As shown in FIG. 2, after receiving the video to be coded, starting from the first frame of the video to be coded, each frame in the video to be coded is coded in sequence. Among them, the current coded frame mainly undergoes processing such as prediction (Prediction), transformation (Transform), quantization (Quantization), and entropy coding (Entropy Coding), and finally the bit stream of the current coded frame is output. Correspondingly, the decoding process usually decodes the received code stream according to the inverse process of the above process to recover the video frame information before decoding.
具体地,如图2所示,所述视频编码框架2中包括一个编码控制模块201, 用于进行编码过程中的决策控制动作,以及参数的选择。例如,如图2所示,编码控制模块201控制变换、量化、反量化、反变换的中用到的参数,控制进行帧内或者帧间模式的选择,以及运动估计和滤波的参数控制,且编码控制模块201的控制参数也将输入至熵编码模块中,进行编码形成编码码流中的一部分。Specifically, as shown in FIG. 2, the video encoding framework 2 includes an encoding control module 201, which is used to perform decision-making control actions and parameter selection in the encoding process. For example, as shown in FIG. 2, the encoding control module 201 controls the parameters used in transformation, quantization, inverse quantization, and inverse transformation, controls the selection of intra-frame or inter-frame modes, and parameter control of motion estimation and filtering, and The control parameters of the encoding control module 201 will also be input to the entropy encoding module, and the encoding will be performed to form a part of the encoded bitstream.
对当前编码帧开始编码时,对编码帧进行划分202处理,具体地,首先对其进行条带(slice)划分,再进行块划分。可选地,在一个示例中,编码帧划分为多个互不重叠的最大的编码树单元(Coding Tree Unit,CTU),各CTU还可以分别按四叉树、或二叉树、或三叉树的方式迭代划分为一系列更小的编码单元(Coding Unit,CU),一些示例中,CU还可以包含与之相关联的预测单元(Prediction Unit,PU)和变换单元(Transform Unit,TU),其中PU为预测的基本单元,TU为变换和量化的基本单元。一些示例中,PU和TU分别是在CU的基础上划分成一个或多个块得到的,其中一个PU包含多个预测块(Prediction Block,PB)以及相关语法元素。一些示例中,PU和TU可以是相同的,或者,是由CU通过不同的划分方法得到的。一些示例中,CU、PU和TU中的至少两种是相同的,例如,不区分CU、PU和TU,全部是以CU为单位进行预测、量化和变换。为方便描述,下文中将CTU、CU或者其它形成的数据单元均称为编码块。When the encoding of the current encoded frame is started, the encoded frame is partitioned 202, specifically, it is firstly divided into slices, and then divided into blocks. Optionally, in an example, the coded frame is divided into a plurality of non-overlapping largest coding tree units (Coding Tree Units, CTUs), and each CTU can also be in a quadtree, or binary tree, or triple tree manner. Iteratively divides into a series of smaller coding units (Coding Unit, CU). In some examples, the CU may also include a prediction unit (Prediction Unit, PU) and a transformation unit (Transform Unit, TU) associated with it. The PU It is the basic unit of prediction, and TU is the basic unit of transformation and quantization. In some examples, the PU and TU are respectively obtained by dividing into one or more blocks on the basis of the CU, where one PU includes multiple prediction blocks (PB) and related syntax elements. In some examples, the PU and TU may be the same, or obtained by the CU through different division methods. In some examples, at least two of the CU, PU, and TU are the same. For example, CU, PU, and TU are not distinguished, and prediction, quantization, and transformation are all performed in units of CU. For the convenience of description, the CTU, CU, or other data units formed are all referred to as coding blocks in the following.
应理解,在本申请实施例中,视频编码针对的数据单元可以为帧,条带,编码树单元,编码单元,编码块或以上任一种的组。在不同的实施例中,数据单元的大小可以变化。It should be understood that, in the embodiment of the present application, the data unit for video encoding may be a frame, a slice, a coding tree unit, a coding unit, a coding block, or any group of the above. In different embodiments, the size of the data unit can vary.
具体地,如图2所示,编码帧划分为多个编码块后,进行预测过程,用于去除当前编码帧的空域和时域冗余信息。当前比较常用的预测编码方法包括帧内预测和帧间预测两种方法。帧内预测仅利用本帧图像中己重建的信息对当前编码块进行预测,而帧间预测会利用到之前已经重建过的其它帧图像(也被称作参考帧)中的信息对当前编码块进行预测。具体地,在本申请实施例中,编码控制模块201用于决策选择帧内预测或者帧间预测。Specifically, as shown in FIG. 2, after the coded frame is divided into multiple coded blocks, a prediction process is performed to remove the spatial and temporal redundant information of the current coded frame. Currently, more commonly used predictive coding methods include intra-frame prediction and inter-frame prediction. Intra-frame prediction uses only the reconstructed information in the current frame to predict the current coding block, while inter-frame prediction uses the information in other previously reconstructed frames (also called reference frames) to predict the current coding block. Make predictions. Specifically, in the embodiment of the present application, the encoding control module 201 is used to make a decision to select intra prediction or inter prediction.
当选择帧内预测模式时,帧内预测203的过程包括获取当前编码块周围已编码相邻块的重建块作为参考块,基于该参考块的像素值,采用预测模式方法计算预测值生成预测块,将当前编码块与预测块的相应像素值相减得到 当前编码块的残差,当前编码块的残差经过变换204、量化205以及熵编码210后形成当前编码块的码流。进一步的,当前编码帧的全部编码块经过上述编码过程后,形成编码帧的编码码流中的一部分。此外,帧内预测203中产生的控制和参考数据也经过熵编码210编码,形成编码码流中的一部分。When the intra-frame prediction mode is selected, the process of intra-frame prediction 203 includes obtaining the reconstructed block of the coded neighboring block around the current coding block as a reference block, and based on the pixel value of the reference block, the prediction mode method is used to calculate the predicted value to generate the predicted block , Subtracting the corresponding pixel values of the current coding block and the prediction block to obtain the residual of the current coding block, the residual of the current coding block is transformed 204, quantized 205, and entropy coding 210 to form the code stream of the current coding block. Further, after all the coded blocks of the current coded frame undergo the above-mentioned coding process, they form a part of the coded stream of the coded frame. In addition, the control and reference data generated in the intra-frame prediction 203 are also encoded by the entropy encoding 210 to form a part of the encoded bitstream.
具体地,变换204用于去除图像块的残差的相关性,以便提高编码效率。对于当前编码块残差数据的变换通常采用二维离散余弦变换(Discrete Cosine Transform,DCT)变换和二维离散正弦变换(Discrete Sine Transform,DST)变换,例如在编码端将编码块的残差信息分别与一个N×M的变换矩阵及其转置矩阵相乘,相乘之后得到当前编码块的变换系数。Specifically, the transform 204 is used to remove the correlation of the residual of the image block, so as to improve the coding efficiency. The transformation of the residual data of the current coding block usually adopts two-dimensional discrete cosine transform (DCT) transformation and two-dimensional discrete sine transform (DST) transformation, for example, the residual information of the coded block Respectively multiply an N×M transformation matrix and its transposed matrix, and obtain the transformation coefficient of the current coding block after the multiplication.
在产生变换系数之后用量化205进一步提高压缩效率,变换系数经量化可以得到量化后的系数,然后将量化后的系数进行熵编码210得到当前编码块的残差码流,其中,熵编码方法包括但不限于内容自适应二进制算术编码(Context Adaptive Binary Arithmetic Coding,CABAC)熵编码。最后将熵编码得到的比特流及进行编码后的编码模式信息进行存储或发送到解码端。在编码端,还会对量化的结果进行反量化206,对反量化结果进行反变换207。在反变换207之后,利用反变换结果以及运动补偿结果,得到重建像素。之后,对重建像素进行滤波(即环路滤波)211。在211之后,输出滤波后的重建图像(属于重建视频帧)。后续,重建图像可以作为其他帧图像的参考帧图像进行帧间预测。本申请实施例中,重建图像又可称为重建后的图像或重构图像。After generating the transform coefficients, the quantization 205 is used to further improve the compression efficiency. The transform coefficients can be quantized to obtain the quantized coefficients, and then the quantized coefficients are entropy-encoded 210 to obtain the residual code stream of the current coding block. The entropy coding method includes But it is not limited to content adaptive binary arithmetic coding (Context Adaptive Binary Arithmetic Coding, CABAC) entropy coding. Finally, the bit stream obtained by entropy coding and the coding mode information after coding are stored or sent to the decoding end. At the encoding end, the quantization result is also inversely quantized 206, and the inverse quantization result is inversely transformed 207. After the inverse transform 207, the reconstructed pixels are obtained by using the inverse transform result and the motion compensation result. After that, filtering (ie, loop filtering) 211 is performed on the reconstructed pixels. After 211, the filtered reconstructed image (belonging to the reconstructed video frame) is output. Subsequently, the reconstructed image can be used as a reference frame image of other frame images for inter-frame prediction. In the embodiments of the present application, the reconstructed image may also be referred to as a reconstructed image or a reconstructed image.
具体地,帧内预测203过程中的已编码相邻块为:当前编码块编码之前,已进行编码的相邻块,该相邻块的编码过程中产生的残差经过变换204、量化205、反量化206、和反变换207后,与该相邻块的预测块相加得到的重建块。对应的,反量化206和反变换207为量化206和变换204的逆过程,用于恢复量化和变换前的残差数据。Specifically, the coded neighboring block in the intra prediction 203 process is: the neighboring block that has been coded before the current coding block is coded, and the residual generated in the coding process of the neighboring block is transformed 204, quantized 205, After inverse quantization 206 and inverse transform 207, the reconstructed block is obtained by adding the prediction block of the neighboring block. Correspondingly, the inverse quantization 206 and the inverse transformation 207 are the inverse processes of the quantization 206 and the transformation 204, which are used to restore the residual data before the quantization and transformation.
如图2所示,当选择帧间预测模式时,帧间预测过程包括运动估计(Motion Estimation,ME)208和运动补偿(Motion Compensation,MC)209。具体地,根据重建视频帧中的参考帧图像进行运动估计208,在一张或多张参考帧图像中根据一定的匹配准则搜索到与当前编码块最相似的图像块为匹配块,该匹配块与当前编码块的相对位移即为当前编码块的运动矢量 (Motion Vector,MV)。然后基于该运动矢量和参考帧对当前编码块进行运动补偿209,获得当前编码块的预测块。并将该编码块像素的原始值与对应的预测块像素值相减得到编码块的残差。当前编码块的残差经过变换204、量化205以及熵编码210后形成编码帧的编码码流中的一部分。此外,运动补偿209中产生的控制和参考数据也经过熵编码210编码,形成编码码流中的一部分。As shown in FIG. 2, when the inter prediction mode is selected, the inter prediction process includes motion estimation (ME) 208 and motion compensation (MC) 209. Specifically, the motion estimation is performed 208 according to the reference frame image in the reconstructed video frame, and the image block most similar to the current encoding block is searched for in one or more reference frame images according to a certain matching criterion as a matching block. The relative displacement with the current coding block is the motion vector (Motion Vector, MV) of the current coding block. Then, based on the motion vector and the reference frame, motion compensation is performed 209 on the current coding block to obtain the prediction block of the current coding block. The original value of the pixel of the coding block is subtracted from the pixel value of the corresponding prediction block to obtain the residual of the coding block. The residual of the current coding block undergoes transformation 204, quantization 205 and entropy coding 210 to form a part of the code stream of the coded frame. In addition, the control and reference data generated in the motion compensation 209 are also encoded by the entropy encoding 210 to form a part of the encoded bitstream.
其中,如图2所示,重建视频帧为经过滤波211之后得到视频帧。重建视频帧包括一个或多个重建后的图像。滤波211用于减少编码过程中产生的块效应和振铃效应等压缩失真,重建视频帧在编码过程中用于为帧间预测提供参考帧,在解码过程中,重建视频帧经过后处理后输出为最终的解码视频。Wherein, as shown in FIG. 2, the reconstructed video frame is a video frame obtained after filtering 211. The reconstructed video frame includes one or more reconstructed images. Filtering 211 is used to reduce compression distortions such as blocking effects and ringing effects generated in the encoding process. The reconstructed video frame is used to provide reference frames for inter-frame prediction during the encoding process. In the decoding process, the reconstructed video frame is output after post-processing For the final decoded video.
具体地,帧间预测模式可以包括高级运动矢量预测(Advanced Motion Vector Prediction,AMVP)模式、合并(Merge)模式或跳过(skip)模式。Specifically, the inter prediction mode may include an advanced motion vector prediction (Advanced Motion Vector Prediction, AMVP) mode, a merge mode or a skip mode.
对于AMVP模式而言,可以先确定运动矢量预测(Motion Vector Prediction,MVP),在得到MVP之后,可以根据MVP确定运动估计的起始点,在起始点附近,进行运动搜索,搜索完毕之后得到最优的MV,由MV确定参考块在参考图像中的位置,参考块减去当前块得到残差块,MV减去MVP得到运动矢量差值(Motion Vector Difference,MVD),并将该MVD和MVP的索引通过码流传输给解码端。For AMVP mode, motion vector prediction (Motion Vector Prediction, MVP) can be determined first. After obtaining the MVP, the starting point of motion estimation can be determined according to the MVP, and the motion search is performed near the starting point, and the optimal is obtained after the search is completed MV, the position of the reference block in the reference image is determined by the MV, the reference block is subtracted from the current block to obtain the residual block, and the MVP is subtracted from the MV to obtain the Motion Vector Difference (MVD), and the MVD and MVP The index is transmitted to the decoding end through the code stream.
对于Merge模式而言,可以先确定MVP,并直接将MVP确定为当前块的MV。其中,为了得到MVP,可以先构建一个MVP候选列表(merge candidate list),在MVP候选列表中,可以包括至少一个候选MVP,每个候选MVP可以对应有一个索引,编码端在从MVP候选列表中选择MVP之后,可以将该MVP索引写入到码流中,则解码端可以按照该索引从MVP候选列表中找到该索引对应的MVP,以实现对图像块的解码。For the Merge mode, you can determine the MVP first, and directly determine the MVP as the MV of the current block. Among them, in order to obtain the MVP, you can first build a MVP candidate list (merge candidate list), in the MVP candidate list, you can include at least one candidate MVP, each candidate MVP can correspond to an index, the encoding end is from the MVP candidate list After selecting the MVP, the MVP index can be written into the code stream, and the decoder can find the MVP corresponding to the index from the MVP candidate list according to the index, so as to realize the decoding of the image block.
应理解,以上过程只是Merge模式的一种具体实现方式。Merge模式还可以具有其他的实现方式。It should be understood that the above process is only a specific implementation of the Merge mode. Merge mode can also have other implementations.
例如,Skip模式是Merge模式的一种特例。按照Merge模式得到MV之后,如果编码端确定当前块和参考块基本一样,那么不需要传输残差数据,只需要传递MVP的索引,以及进一步地可以传递一个标志,该标志可以表明当前块可以直接从参考块得到。For example, Skip mode is a special case of Merge mode. After obtaining the MV according to the Merge mode, if the encoding end determines that the current block is basically the same as the reference block, then there is no need to transmit residual data, only the index of the MVP, and further a flag can be passed, which can indicate that the current block can be directly Obtained from the reference block.
也就是说,Merge模式特点为:MV=MVP(MVD=0);而Skip模式还多一个特点,即:重构值rec=预测值pred(残差值resi=0)。In other words, the feature of the Merge mode is: MV=MVP (MVD=0); and the Skip mode has one more feature, namely: reconstruction value rec=predicted value pred (residual value resi=0).
Merge模式可以应用于几何预测技术中。在几何预测技术中,可以将待编码的图像块划分为多个形状为多边形的子图像块,可以从运动信息候选列表中,分别为每个子图像块确定运动矢量,并基于每个子图像块的运动矢量,确定每个子图像块对应的预测子块,基于每个子图像块对应的预测子块,构造当前图像块的预测块,从而实现对当前图像块的编码。Merge mode can be applied to geometric prediction technology. In the geometric prediction technology, the image block to be encoded can be divided into multiple polygonal sub-image blocks. The motion vector can be determined for each sub-image block from the motion information candidate list, and the motion vector can be determined based on each sub-image block. The motion vector determines the prediction sub-block corresponding to each sub-image block, and constructs the prediction block of the current image block based on the prediction sub-block corresponding to each sub-image block, thereby realizing the coding of the current image block.
对于解码端,则进行与编码端相对应的操作。首先利用熵解码以及反量化和反变换得到残差信息,并根据解码码流确定当前图像块使用帧内预测还是帧间预测。如果是帧内预测,则利用当前帧中已重建图像块按照帧内预测方法构建预测信息;如果是帧间预测,则需要解析出运动信息,并使用所解析出的运动信息在已重建的图像中确定参考块,得到预测信息;接下来,再将预测信息与残差信息进行叠加,并经过滤波操作便可以得到重建信息。For the decoding end, operations corresponding to the encoding end are performed. First, use entropy decoding, inverse quantization and inverse transformation to obtain residual information, and determine whether the current image block uses intra-frame prediction or inter-frame prediction according to the decoded bitstream. If it is intra-frame prediction, the reconstructed image block in the current frame is used to construct prediction information according to the intra-frame prediction method; if it is inter-frame prediction, it is necessary to parse out the motion information, and use the parsed motion information in the reconstructed image Determine the reference block to obtain the prediction information; then, superimpose the prediction information and the residual information, and pass the filtering operation to obtain the reconstruction information.
然而由于当前的视频编码框架以块为单位进行编码,若相邻块之间的编码方式不同,会导致在块边界存在不连续性,降低了视频压缩的主客观质量。However, since the current video coding framework performs coding in units of blocks, if the coding methods between adjacent blocks are different, discontinuities exist at the block boundaries, which reduces the subjective and objective quality of video compression.
本申请提出了一种视频编解码的方法,该方法可以提升视频编解码的主客观质量。This application proposes a method for video encoding and decoding, which can improve the subjective and objective quality of video encoding and decoding.
本申请实施例中的主客观质量可以包括主观质量和客观质量。其中,主观质量可以基于人的感官进行评价,客观质量可以基于特定的模型进行评价。采用本申请实施例中的方法,可以提升对视频编解码的性能,改善视频质量。The subjective and objective quality in the embodiments of the present application may include subjective quality and objective quality. Among them, the subjective quality can be evaluated based on human senses, and the objective quality can be evaluated based on a specific model. By adopting the method in the embodiment of the present application, the performance of video encoding and decoding can be improved, and the video quality can be improved.
为了更加理解本申请的方案,下文先对滤波技术进行简单的介绍。In order to better understand the solution of the present application, the filtering technology will be briefly introduced below.
基于块的环路滤波技术可以包括双边滤波、自适应环路滤波、自适应样值补偿滤波和去块滤波(Deblock)。双边滤波的基本思想是当前像素由它自身和相邻四个点像素值的加权平均来计算,实现保边去噪。Block-based loop filtering techniques may include bilateral filtering, adaptive loop filtering, adaptive sample compensation filtering, and deblocking filtering (Deblock). The basic idea of bilateral filtering is that the current pixel is calculated by the weighted average of its own and four adjacent pixel values to achieve edge preservation and denoising.
自适应环路滤波是一种维纳滤波器,主要用于最小化原始图像和重构图像之间的均方误差。Adaptive loop filtering is a Wiener filter, which is mainly used to minimize the mean square error between the original image and the reconstructed image.
自适应样值补偿滤波通过对图像块内像素进行分类,进而为每类像素加上相同补偿值的方式使得重构图像更接近原始图像,从而起到抑制振铃效应的作用。The adaptive sample compensation filter classifies the pixels in the image block, and then adds the same compensation value to each type of pixel to make the reconstructed image closer to the original image, thereby suppressing the ringing effect.
去块滤波用于预测单元和变换单元的边界,利用训练得到的低通滤波器进行边界像素的非线性加权,从而减少块效应;其中,块效应是指:当前的视频编码框架以块为单位进行编码,由于相邻块之间编码方式的不同而导致的在块边界可能存在不连续性。Deblocking filtering is used for the boundary between the prediction unit and the transformation unit, and the low-pass filter obtained by training is used to perform non-linear weighting of the boundary pixels, thereby reducing the blocking effect; among them, the blocking effect refers to: the current video coding framework takes the block as the unit For encoding, there may be discontinuities at the block boundary due to the different encoding methods between adjacent blocks.
去块滤波(Deblocking)可以包括以下三个步骤:判断边界、计算边界滤波强度和进行去块滤波操作。Deblocking may include the following three steps: judging the boundary, calculating the strength of the boundary filtering, and performing a deblocking filtering operation.
(1)判断边界(1) Judging the boundary
亮度分量可以是以4x4的网格进行滤波(高效率视频编码(High Efficiency Video Coding,HEVC)时期是8x8的网格),色度分量可以是以8x8的网格进行滤波。边界的判断可以包括以下两个过程,首先,对于当前CU中每一个4x4的亮度块,需要判断其上下左右四个边界是否为TU的边界,并将其标记为“边界”/“非边界”。其次,对于每一个4x4亮度块,判断当前CU是否选用了放射运动模型(Affine)模式或子块时间运动矢量预测(Sub-block Temporal Motion Vector Prediction,SbTMVP)模式,如果选中了这两种模式中的任何一种,则将当前CU内部的每一个4x4网格的边界标记为“边界“。对于标记为“边界”的块,可以进行后续操作;对于标记为“非边界”的块,可以不进行去块滤波操作。The luma component can be filtered with a 4x4 grid (High Efficiency Video Coding (HEVC) period is an 8x8 grid), and the chroma component can be filtered with an 8x8 grid. The judgment of the boundary can include the following two processes. First, for each 4x4 brightness block in the current CU, it is necessary to determine whether the upper, lower, left, and right boundaries are TU boundaries, and mark them as "boundary"/"non-boundary" . Secondly, for each 4x4 brightness block, determine whether the current CU has selected the Affine mode or the Sub-block Temporal Motion Vector Prediction (SbTMVP) mode. If these two modes are selected For any of the above, the boundary of each 4x4 grid inside the current CU is marked as "boundary". For blocks marked as "boundary", subsequent operations may be performed; for blocks marked as "non-boundary", deblocking filtering operations may not be performed.
其中,Affine模式或SbTMVP模式,可以将一个CU进一步划分为多个4x4的子CU(Sub-CU),每一个Sub-CU可以有各自的运动矢量。Among them, in the Affine mode or the SbTMVP mode, a CU can be further divided into multiple 4x4 sub-CUs (Sub-CU), and each Sub-CU can have its own motion vector.
(2)计算边界滤波强度(Boundary Strength,BS)(2) Calculate the boundary filter strength (Boundary Strength, BS)
在介绍计算边界滤波强度之前,先对图像帧的像素包括的分量进行简单说明。图像帧中的像素通常可以包括多个分量,例如,可以包括亮度(Luma)分量和色度(Chroma)分量。Before introducing the calculation of the boundary filter strength, a brief description of the components included in the pixels of the image frame will be given. The pixels in the image frame may generally include multiple components, for example, may include a luminance (Luma) component and a chrominance (Chroma) component.
以垂直边界为例,将边界左侧的4x4块用P(或BlockP)表示,右侧的4x4块用Q(或BlockQ)表示,则可以按照规则一来进行计算边界滤波强度。Taking the vertical boundary as an example, the 4x4 block on the left side of the boundary is represented by P (or BlockP), and the 4x4 block on the right side is represented by Q (or BlockQ), and then the boundary filter strength can be calculated according to rule 1.
规则一:Rule 1:
1)、如果是亮度分量,P、Q所属CU都是基于块的脉冲编码调制(Block-based Delta Pulse Code Modulation,BDPCM)模式,BS=0;1). If it is the brightness component, the CU to which P and Q belong are all in block-based Delta Pulse Code Modulation (BDPCM) mode, BS=0;
2)、否则,如果P或Q是帧内预测的CU,BS=2;2) Otherwise, if P or Q is an intra-predicted CU, BS=2;
3)、否则,如果P、Q之间的边界是TU边界,而且P或Q是组合帧间 帧内预测(Combine Intra Inter Prediction,CIIP)模式,BS=2;3) Otherwise, if the boundary between P and Q is a TU boundary, and P or Q is a combined inter-frame intra prediction (Combine Intra Inter Prediction, CIIP) mode, BS=2;
4)、否则,如果P、Q之间的边界是TU边界,而且P或Q所在变换块包含至少一个非零变换系数,BS=1;4) Otherwise, if the boundary between P and Q is a TU boundary, and the transform block where P or Q contains at least one non-zero transform coefficient, BS=1;
5)、否则,如果P、Q之间的边界是TU边界,而且是色度分量,而且P或Q所在CU使用色度联合编码方式,BS=1;5) Otherwise, if the boundary between P and Q is a TU boundary, and it is a chrominance component, and the CU where P or Q is located uses chrominance joint coding, BS=1;
6)、否则,如果P、Q所在CU使用不同的编码模式(比如P使用帧间预测模式,Q使用帧内块拷贝(Intra Block Copy,IBC)模式),BS=1;6) Otherwise, if the CU where P and Q are located uses different coding modes (for example, P uses inter prediction mode and Q uses Intra Block Copy (IBC) mode), BS=1;
7)、否则,对于亮度分量,如果以下条件中,至少一个符合,BS=1;7) Otherwise, for the luminance component, if at least one of the following conditions is met, BS=1;
①、P、Q都是用IBC模式,而且P、Q的MV的差值,在水平方向、或竖直方向上大于等于8;① Both P and Q use the IBC mode, and the difference between the MV of P and Q is greater than or equal to 8 in the horizontal or vertical direction;
②、P、Q参考不同的参考帧或者MV的数量不同(比如P为双MV,Q为单MV);②, P and Q refer to different reference frames or the number of MVs is different (for example, P is dual MV, Q is single MV);
③、P、Q都使用了单MV,且这两个单MV差值大于等于8;③, P and Q both use a single MV, and the difference between the two single MVs is greater than or equal to 8;
④、P、Q都使用了双MV,且P的双MV来自不同参考帧(MV1来自参考帧1,MV2来自参考帧2),Q的双MV也来自两个不同参考帧(MV3来自参考帧1,MV4来自参考帧2),P、Q参考的参考帧是相同的。那么MV1-MV3的绝对值、MV2-MV4的绝对值,在水平或竖直方向的差值,大于等于8;④, P and Q both use dual MVs, and P's dual MVs are from different reference frames (MV1 is from reference frame 1, MV2 is from reference frame 2), Q's dual MVs are also from two different reference frames (MV3 is from reference frame 1. MV4 comes from reference frame 2), the reference frames for P and Q references are the same. Then the absolute value of MV1-MV3, the absolute value of MV2-MV4, the difference in the horizontal or vertical direction, is greater than or equal to 8;
⑤、如果P、Q都使用了双MV,且双MV来自同一个参考帧,如下两个条件需要同时成立(假设P(MV0来自List0,MV1来自List1),Q(MV2来自List0,MV3来自List1));⑤. If both P and Q use dual MVs, and the dual MVs come from the same reference frame, the following two conditions need to be met at the same time (assuming P (MV0 comes from List0, MV1 comes from List1), Q (MV2 comes from List0, MV3 comes from List1) ));
List0中的MV0和MV2作差绝对值在水平或竖直方向上大于等于8,或者List1中MV1和MV3的作差绝对值在水平或数值方向大于等于8;The absolute value of the difference between MV0 and MV2 in List0 is greater than or equal to 8 in the horizontal or vertical direction, or the absolute value of the difference between MV1 and MV3 in List1 is greater than or equal to 8 in the horizontal or numerical direction;
MV0和MV3作差绝对值在水平或竖直方向上大于等于8,或者MV1和MV2的作差绝对值在水平或数值方向大于等于8;The absolute value of the difference between MV0 and MV3 is greater than or equal to 8 in the horizontal or vertical direction, or the absolute value of the difference between MV1 and MV2 is greater than or equal to 8 in the horizontal or numerical direction;
8)、否则,BS=0。8). Otherwise, BS=0.
(3)、进行去块滤波操作(3) Perform deblocking filtering operation
对于BS=0的情况,不进行滤波;For the case of BS=0, no filtering is performed;
对于BS=1的情况,进行弱滤波;For the case of BS=1, perform weak filtering;
对于BS=2的情况,进行强滤波。For the case of BS=2, strong filtering is performed.
其中,上述提及的List0和List1是指参考帧列表。Among them, List0 and List1 mentioned above refer to reference frame lists.
双向预测中的CU由一帧或者两帧参考图像预测得到,这些参考图像存储在参考帧列表中。设置了两个参考帧列表,也就是List0和List1,这两个列表中都可以包含前向或后向已编码的参考帧。The CU in the bidirectional prediction is predicted from one or two frames of reference images, and these reference images are stored in the reference frame list. Two reference frame lists are set, namely List0 and List1, both of which can contain forward or backward encoded reference frames.
举例说明,如果当前帧(编号100)有三个前向参考帧和三个后向参考帧,按照自然图像的顺序标号为97、98、99、100、101、102、103.这些帧在List0和List1中的索引不同,在List0中,最靠近当前帧的前面的一帧标志为index0,再前一帧为index1....前向帧之后是按照顺序的后向帧。For example, if the current frame (number 100) has three forward reference frames and three backward reference frames, they are numbered 97, 98, 99, 100, 101, 102, 103 in the order of natural images. These frames are in List0 and The index in List1 is different. In List0, the frame closest to the current frame is marked as index0, and the previous frame is index1....The forward frame is followed by the backward frame in order.
List1中和当前帧最靠近的后向帧为index0,再后一帧为index1...后向帧排完之后是前向帧。The backward frame closest to the current frame in List1 is index0, and the next frame is index1...The forward frame is the forward frame after the backward frames are arranged.
Figure PCTCN2019130941-appb-000001
Figure PCTCN2019130941-appb-000001
其中,滤波过程需要使用量化参数(Quantization Parameter,QP),用于去块滤波的QP通过以下方式导出,Among them, the filtering process needs to use quantization parameters (Quantization Parameter, QP), and the QP used for deblocking filtering is derived in the following way:
亮度(Luma)QP:Luma QP:
BlockP所在CU的量化参数(假设用QPP表示),BlockQ所在CU的QPQ(假设用QPQ表示),最终的QP为The quantization parameter of the CU where BlockP is located (assumed to be represented by QPP), the QPQ of the CU where BlockQ is located (assumed to be represented by QPQ), and the final QP is
QPL=(QPP+QPQ+1)>>1,即对QPP和QPQ求均值得到最终的量化参数QPL。该QPL即为对P和Q的边界进行去块滤波时使用的量化参数。QPL=(QPP+QPQ+1)>>1, that is, the final quantization parameter QPL is obtained by averaging QPP and QPQ. The QPL is the quantization parameter used when performing deblocking filtering on the boundary between P and Q.
BlockP和Q对应的QP,首先由其临近块QP导出得到一个预测量化参数(假设用QP_Prev表示),再对QP_Prev加上一个量化参数偏移(假设用Luma QP offset),得到最终的QP。The QP corresponding to BlockP and Q is first derived from its neighboring block QP to obtain a predicted quantization parameter (assumed to be represented by QP_Prev), and then a quantization parameter offset is added to QP_Prev (assumed to use Luma QP offset) to obtain the final QP.
色度(Chroma)QP:Chroma QP:
Chroma QP由Luma QP导出,从Luma QP导出Chroma QP有一个固定的导出方式,并在Luma QP导出的QP基础上,加上一个QP offset。Chroma QP offset由三个分量相加得到,分别是图像级的Chroma QP offset,Slice级QP offset,以及CU级QP offset。Chroma QP is derived from Luma QP, and Chroma QP is derived from Luma QP. There is a fixed way to derive Chroma QP, and a QP offset is added to the QP derived from Luma QP. Chroma QP offset is obtained by adding three components, which are image-level Chroma QP offset, Slice-level QP offset, and CU-level QP offset.
在得到P和Q对应的Chroma QP后,采用相同方式进行平均,如下,得到用于Deblocking过程的Chroma QP。After obtaining the Chroma QP corresponding to P and Q, the same method is used for averaging, as follows to obtain the Chroma QP used in the Deblocking process.
QPC=(QPP+QPQ+1)>>1QPC=(QPP+QPQ+1)>>1
QP在Deblocking过程中的作用如下:由于去块滤波是去除块效应,块效应与量化参数有一定的关系,量化参数越大失真越明显,对应的去块滤波器的参数选择会不同。去块滤波器的参数与QP有一个映射关系,因此需要先确定QP,再进行去块滤波。The role of QP in the Deblocking process is as follows: Since deblocking filtering removes blocking effects, blocking effects have a certain relationship with quantization parameters. The larger the quantization parameter, the more obvious the distortion, and the corresponding parameter selection of the deblocking filter will be different. The parameters of the deblocking filter have a mapping relationship with the QP, so it is necessary to determine the QP first, and then perform the deblocking filter.
在一个块为全零块(量化残差全部为零)的情况下,这个块的QP应该等于预测得到的QP_prev,也就是说没有CU级QP offset,在已有的设计中,Luma QP在一个块为全零块时,将Luma QP offset设置为了0,也就是Luma QP设置为了QP_prev。Chroma QP在一个块为全零块的时候,没有把CU级Chroma QP offset设置为0。这将影响后续Chroma分量的Deblocking过程,也就是说Chroma分量的Deblocking有可能使用了错误的QP offset。本申请旨在解决当前Deblocking设计的问题,以提高去块滤波的效果和性能,从而提高视频编解码的性能。In the case of a block with all zeros (all quantized residuals are zero), the QP of this block should be equal to the predicted QP_prev, that is to say, there is no CU-level QP offset. In the existing design, Luma QP is in one When the block is an all-zero block, Luma QP offset is set to 0, that is, Luma QP is set to QP_prev. Chroma QP does not set the CU-level Chroma QP offset to 0 when a block is all zero. This will affect the deblocking process of the subsequent Chroma component, which means that the deblocking of the Chroma component may use the wrong QP offset. This application aims to solve the problems of the current deblocking design, so as to improve the effect and performance of deblocking filtering, thereby improving the performance of video coding and decoding.
下面将结合图3详细描述本申请实施例提供的视频编解码的方法300。The method 300 for video encoding and decoding provided by an embodiment of the present application will be described in detail below with reference to FIG. 3.
如图3所示为本申请一实施例提供的视频编解码的方法300,该方法300可以包括步骤S310-S330。As shown in FIG. 3, a method 300 for video encoding and decoding provided by an embodiment of this application, the method 300 may include steps S310-S330.
S310,在对第一色度块和第二色度块的边界进行去块滤波时,若第一色度块的量化残差全为零,则将第一色度块的编码单元级的量化参数偏移设置为第一预设值。S310. When performing deblocking filtering on the boundary between the first chroma block and the second chroma block, if the quantization residuals of the first chroma block are all zero, quantize the coding unit level of the first chroma block The parameter offset is set to the first preset value.
S320,根据第一量化参数和第一色度块的编码单元级的量化参数偏移确定第一色度块的第二量化参数,其中,第一量化参数是根据第一色度块对应的亮度块的量化参数导出的。S320: Determine the second quantization parameter of the first chrominance block according to the first quantization parameter and the quantization parameter offset of the coding unit level of the first chrominance block, where the first quantization parameter is based on the luminance corresponding to the first chrominance block. The quantization parameter of the block is derived.
S330,根据第二量化参数对第一色度块和第二色度块的边界进行去块滤波。S330: Perform deblocking filtering on the boundary between the first chroma block and the second chroma block according to the second quantization parameter.
本申请实施例中的第一色度块和第二色度块可以是经过反量化、反变换后的图形块。对于编码端而言,其步骤可以是对当前图像块进行预测、变换、量化,再对其进行编码,其中,当前图像块的参考图像块可以是经过反量化、反变换以及滤波后的图像块;对于解码端而言,可以先对码流中的残差对应的比特进行反量化、反变换得到残差,根据参考图像和残差得到重建图像,再对反重建图像进行滤波。The first chrominance block and the second chrominance block in the embodiment of the present application may be graphic blocks after inverse quantization and inverse transformation. For the encoding end, the steps can be to predict, transform, and quantize the current image block, and then encode it, where the reference image block of the current image block can be an image block that has undergone inverse quantization, inverse transformation, and filtering. ; For the decoding end, the bits corresponding to the residuals in the bitstream can be inversely quantized and inversely transformed to obtain the residuals, the reconstructed images are obtained according to the reference image and the residuals, and then the anti-reconstructed images are filtered.
在一些实施例中,本申请中的第一色度块和第二色度块也可以称为第一滤波块和第二滤波块。In some embodiments, the first chroma block and the second chroma block in this application may also be referred to as the first filter block and the second filter block.
上述第一量化参数是根据第一色度块(假设为ChromaP)对应的亮度块(假设为LumaP)的量化参数(假设为LumaQP)导出的,由亮度的量化参数(假设为Luma QP)导出色度块的量化参数(假设为Chroma QP)有一个固定的导出方式。例如,可以通过查表或者公式导出的方式,通过亮度分量的QP导出色度分量的QP。The above-mentioned first quantization parameter is derived based on the quantization parameter (assumed as LumaQP) of the luminance block (assumed as LumaP) corresponding to the first chrominance block (assumed as ChromaP), and the color is derived from the luminance quantization parameter (assumed as Luma QP) The quantization parameter of the degree block (assuming Chroma QP) has a fixed derivation method. For example, the QP of the chrominance component can be derived from the QP of the luminance component by means of table lookup or formula derivation.
示例性的,色度块与亮度块的对应规则根据视频压缩格式确定。例如,对于编码压缩格式为4∶2∶0的视频,每个色度块对应着4个亮度块,或者可以理解为每个色度像素(Chroma Pixel)对应四个亮度像素(Luma Pixel)。对于编码压缩格式为4∶2∶2的视频,每个色度块对应着2个亮度块,或者可以理解为每个色度像素对应2个亮度像素。对于编码压缩格式为4∶4∶4的视频,每个色度块对应着1个亮度块,或者可以理解为每个色度像素对应1个亮度像素。对于编码压缩格式为4∶1∶1的视频,每个色度块对应着4个亮度块。或者可以理解为每个色度像素对应4个亮度像素。这种情况下,色度块的量化参数可以根据其对应的亮度块的量化参数来导出。其中,如果色度块对应多个亮度块,则可以根据这多个亮度块(或亮度像素)的量化参数求均值或加权均值来导出该色度块的量化参数。Exemplarily, the corresponding rule of the chrominance block and the luminance block is determined according to the video compression format. For example, for a video with a coding compression format of 4:2:0, each chroma block corresponds to 4 luma blocks, or it can be understood that each chroma pixel (Chroma Pixel) corresponds to four luma pixels (Luma Pixel). For a video with a coding compression format of 4:2:2, each chrominance block corresponds to 2 luminance blocks, or it can be understood that each chrominance pixel corresponds to 2 luminance pixels. For a video with a coding compression format of 4:4:4, each chrominance block corresponds to one luminance block, or it can be understood that each chrominance pixel corresponds to one luminance pixel. For a video with a coding compression format of 4:1:1, each chroma block corresponds to 4 luma blocks. Or it can be understood that each chrominance pixel corresponds to 4 luminance pixels. In this case, the quantization parameter of the chrominance block can be derived according to the quantization parameter of the corresponding luminance block. Wherein, if the chrominance block corresponds to multiple luminance blocks, the quantization parameter of the chrominance block can be derived by averaging or weighting the quantization parameters of the multiple luminance blocks (or luminance pixels).
可选的,第一色度块对应的亮度块还可以是第一色度块对应的一个或多个亮度块(或亮度像素)中位于预设位置的目标亮度块(或目标亮度像素)。例如,视频压缩格式为4∶2∶0,目标亮度块是位于所述第一色度块对应的多个亮度块(或者多个亮度像素)中左上角、左下角、右上角或右下角的亮度块(或者左上角的亮度像素)。又例如,视频压缩格式为4∶2∶2,目标亮度块在所述第一色度块对应水平的两个亮度块的情况下,所述目标亮度块是位于所述第一色度块对应的两个亮度块中左边或右边的亮度块(或者亮度像素);或在所述第一色度块对应竖直的两个亮度块的情况下,所述目标亮度块是位于所述第一色度块对应的两个亮度块中上边或下边的亮度块(或者亮度像素)。又例如,视频压缩格式为4∶1∶1,所述目标亮度块是位于所述第一色度块对应的多个亮度块中最左侧、左侧第二个、左侧第三个或者左侧第四个的亮度块(或者亮度像素)。又例如,视频压缩格式为4∶4∶4,所述目标亮度块 是所述第一色度块对应的一个亮度块(或者亮度像素)。这种情况下,色度块的量化参数可以根据其对应的一个亮度块的量化参数来导出。Optionally, the luminance block corresponding to the first chrominance block may also be a target luminance block (or target luminance pixel) at a preset position among one or more luminance blocks (or luminance pixels) corresponding to the first chrominance block. For example, the video compression format is 4:2:0, and the target luminance block is located in the upper left corner, lower left corner, upper right corner, or lower right corner of the multiple luminance blocks (or multiple luminance pixels) corresponding to the first chrominance block The brightness block (or the brightness pixel in the upper left corner). For another example, the video compression format is 4:2:2, and the target luminance block is two luminance blocks corresponding to the level of the first chrominance block, and the target luminance block is located in the corresponding level of the first chrominance block. The left or right luminance block (or luminance pixel) of the two luminance blocks; or in the case where the first chrominance block corresponds to two vertical luminance blocks, the target luminance block is located in the first The upper or lower luminance block (or luminance pixel) of the two luminance blocks corresponding to the chrominance block. For another example, the video compression format is 4:1:1, and the target luminance block is the leftmost one, the second one from the left, the third one from the left among the plurality of luminance blocks corresponding to the first chrominance block, or The fourth brightness block (or brightness pixel) from the left. For another example, the video compression format is 4:4:4, and the target luminance block is a luminance block (or luminance pixel) corresponding to the first chrominance block. In this case, the quantization parameter of the chrominance block can be derived according to the quantization parameter of a corresponding luminance block.
可选的,上述第一预设值为0。即,在第一色度块为全零块(量化残差全部为零)的情况下,将该色度块的Chroma QP offset设置为0。Optionally, the foregoing first preset value is 0. That is, in the case where the first chroma block is an all-zero block (all the quantized residuals are zero), the Chroma QP offset of the chroma block is set to 0.
可选的,上述根据第一色度块对应的亮度块的第一量化参数和第一色度块的编码单元级的量化参数偏移确定第一色度块的第二量化参数,包括:Optionally, the foregoing determining the second quantization parameter of the first chrominance block according to the first quantization parameter of the luminance block corresponding to the first chrominance block and the quantization parameter offset of the coding unit level of the first chrominance block includes:
根据第一量化参数、第一色度块的编码单元级的量化参数偏移以及第一偏移得到第二量化参数,其中,第一偏移包括第一色度块的图像级的色度量化参数偏移和/或第一色度块的条带级的色度量化参数偏移。The second quantization parameter is obtained according to the first quantization parameter, the quantization parameter offset of the coding unit level of the first chrominance block, and the first offset, where the first offset includes the chrominance quantization of the image level of the first chrominance block The parameter offset and/or the stripe-level chrominance quantization parameter offset of the first chrominance block.
示例性的,可以根据第一量化参数、第一色度块的编码单元(CU)级的量化参数偏移、第一色度块的图像级的色度量化参数偏移以及第一色度块的条带(slice)级的色度量化参数偏移来确定第一色度块的第二量化参数。用公式表示为:QP_ChromaP=QP_LumaP+图像级的Chroma QP offset+Slice级QP offse+CU级QP offset。Exemplarily, it may be based on the first quantization parameter, the quantization parameter offset at the coding unit (CU) level of the first chroma block, the chroma quantization parameter offset at the image level of the first chroma block, and the first chroma block The slice-level chrominance quantization parameter offset is used to determine the second quantization parameter of the first chrominance block. The formula is expressed as: QP_ChromaP=QP_LumaP+Image-level Chroma QP offset+Slice-level QP offset+CU-level QP offset.
可选的,根据第二量化参数对第一色度块和第二色度块的边界进行去块滤波,包括:根据第二量化参数和第三量化参数得到第四量化参数,第三量化参数是第二色度块对应的量化参数;根据第四量化参数对第一色度块和第二色度块的边界进行去块滤波。Optionally, performing deblocking filtering on the boundary between the first chroma block and the second chroma block according to the second quantization parameter includes: obtaining the fourth quantization parameter according to the second quantization parameter and the third quantization parameter, and the third quantization parameter Is the quantization parameter corresponding to the second chrominance block; the boundary between the first chrominance block and the second chrominance block is deblocked and filtered according to the fourth quantization parameter.
也即是说,在对第一色度块和第二色度块的边界进行去块滤波时,采用第一色度块(假设为ChromaP)的量化参数和第二色度块(假设为ChromaQ)的量化参数来计算得到用于去块滤波的量化参数。In other words, when deblocking filtering is performed on the boundary between the first chroma block and the second chroma block, the quantization parameters of the first chroma block (assumed as ChromaP) and the second chroma block (assumed as ChromaQ) are used. ) To calculate the quantization parameter for deblocking filtering.
一种示例中,根据第二量化参数和第三量化参数得到第四量化参数,包括:根据第二量化参数和第三量化参数的均值得到第四量化参数。比如,采用如下公式计算得到:QP C=(QP P+QP Q+1)>>1,其中,QP C是最终计算得到的量化参数,QP P是ChromaP的量化参数,QP Q是ChromaQ的量化参数。 In an example, obtaining the fourth quantization parameter according to the second quantization parameter and the third quantization parameter includes: obtaining the fourth quantization parameter according to an average value of the second quantization parameter and the third quantization parameter. For example, calculated by the following formula: QP C =(QP P +QP Q +1)>>1, where QP C is the final calculated quantization parameter, QP P is the quantization parameter of ChromaP, and QP Q is the quantization of ChromaQ parameter.
可选的,第二色度块对应的量化参数是根据第二色度块对应的亮度块的量化参数、第二色度块的编码单元级的量化参数偏移以及第二偏移得到的,其中,第二偏移包括第二色度块的图像级的色度量化参数偏移和/或第二色度块的条带级的色度量化参数偏移。Optionally, the quantization parameter corresponding to the second chrominance block is obtained according to the quantization parameter of the luminance block corresponding to the second chrominance block, the quantization parameter offset of the coding unit level of the second chrominance block, and the second offset, Wherein, the second offset includes the image-level chrominance quantization parameter offset of the second chrominance block and/or the stripe-level chrominance quantization parameter offset of the second chrominance block.
示例性的,可以根据第二色度块对应的亮度块的量化参数、第二色度块的编码单元(CU)级的量化参数偏移、第二色度块的图像级的色度量化参数偏移以及第二色度块的条带(slice)级的色度量化参数偏移来确定第二色度块的量化参数。关于计算第二色度块的量化参数的计算方式可以参考上述关于计算第一色度块的量化参数的计算方式,此处不再赘述。Exemplarily, it may be based on the quantization parameter of the luminance block corresponding to the second chrominance block, the quantization parameter offset of the coding unit (CU) level of the second chrominance block, and the chrominance quantization parameter of the image level of the second chrominance block. The offset and the slice-level chrominance quantization parameter offset of the second chrominance block are used to determine the quantization parameter of the second chrominance block. Regarding the calculation method of calculating the quantization parameter of the second chrominance block, reference may be made to the foregoing calculation method of calculating the quantization parameter of the first chrominance block, which is not repeated here.
可选的,根据第四量化参数对第一色度块和第二色度块的边界进行去块滤波,包括:根据第四量化参数以及映射关系,确定第四量化参数对应的去块滤波器的参数,映射关系包括至少一个量化参数与至少一个去块滤波器的参数的映射关系;根据第四量化参数对应的去块滤波器的参数对第一色度块和第二色度块的边界进行去块滤波。其中,去块滤波器的参数与QP有一个映射关系,因此需要先确定QP,再结合映射关系确定该QP对应的去块滤波器的参数,然后再利用去块滤波器的参数进行去块滤波。Optionally, performing deblocking filtering on the boundary between the first chroma block and the second chroma block according to the fourth quantization parameter includes: determining the deblocking filter corresponding to the fourth quantization parameter according to the fourth quantization parameter and the mapping relationship The mapping relationship includes the mapping relationship between at least one quantization parameter and at least one deblocking filter parameter; the boundary between the first chroma block and the second chroma block is determined according to the parameter of the deblocking filter corresponding to the fourth quantization parameter Perform deblocking filtering. Among them, the parameters of the deblocking filter have a mapping relationship with QP, so it is necessary to determine the QP first, then determine the parameters of the deblocking filter corresponding to the QP in combination with the mapping relationship, and then use the parameters of the deblocking filter to perform deblocking filtering .
可选的,第一色度块对应的亮度块的量化参数是根据第一色度块对应的亮度块的预测量化参数和第一色度块对应的亮度块的量化参数偏移确定的。用公式表示为:QP_LumaP=QP_prev+Luma QP offset。Optionally, the quantization parameter of the luminance block corresponding to the first chrominance block is determined according to the predicted quantization parameter of the luminance block corresponding to the first chrominance block and the offset of the quantization parameter of the luminance block corresponding to the first chrominance block. The formula is expressed as: QP_LumaP=QP_prev+Luma QP offset.
可选的,第一色度块对应的亮度块的预测量化参数是由第一色度块对应的亮度块的相邻块的量化参数确定的。该相邻块例如可以是第一色度块对应的亮度块的左边、上边、左上边、左下边或右上的相邻块。Optionally, the predicted quantization parameter of the luminance block corresponding to the first chrominance block is determined by the quantization parameter of the adjacent block of the luminance block corresponding to the first chrominance block. The neighboring block may be, for example, neighboring blocks on the left, top, top left, bottom left, or top right of the luminance block corresponding to the first chrominance block.
可选的,若第一色度块对应的亮度块的量化残差全为零(即第一色度块对应的亮度块为全零块),则将第一色度块对应的亮度块的量化参数偏移设置为第二预设值。可选的,第二预设值为0。以P块为例,即上述Luma QP offset为0。Optionally, if the quantization residuals of the luminance block corresponding to the first chrominance block are all zero (that is, the luminance block corresponding to the first chrominance block is an all-zero block), then the luminance block corresponding to the first chrominance block is The quantization parameter offset is set to a second preset value. Optionally, the second preset value is 0. Take the P block as an example, that is, the above-mentioned Luma QP offset is 0.
可选的,第二色度块对应的亮度块的量化参数是根据第二色度块对应的亮度块的预测量化参数和第二色度块对应的亮度块的量化参数偏移确定的。Optionally, the quantization parameter of the luminance block corresponding to the second chrominance block is determined according to the predicted quantization parameter of the luminance block corresponding to the second chrominance block and the offset of the quantization parameter of the luminance block corresponding to the second chrominance block.
可选的,若第二色度块对应的亮度块的量化残差全为零,则将第二色度块对应的亮度块的量化参数偏移设置为第三预设值。可选的,第三预设值为0。Optionally, if the quantization residuals of the luminance block corresponding to the second chrominance block are all zero, the quantization parameter offset of the luminance block corresponding to the second chrominance block is set to a third preset value. Optionally, the third preset value is 0.
需要说明的是,本申请提供的方案可以应用于编码端,也可以应用于解码端。针对编码端来说,在通过上述方式对第一色度块和第二色度块进行去 块滤波后,即可以得到当前编码块/编码帧的重建图像,重建图像可以供后续需要进行编码的其他块进行参考。针对解码端来说,在通过上述方式对第一色度块和第二色度块进行去块滤波后,即可得到当前图像块/图像帧恢复后的图像。It should be noted that the solution provided in this application can be applied to the encoding end and also can be applied to the decoding end. For the encoding end, after deblocking and filtering the first chrominance block and the second chrominance block in the above manner, the reconstructed image of the current encoding block/encoding frame can be obtained, and the reconstructed image can be used for subsequent encoding. Reference to other blocks. For the decoding end, after the first chrominance block and the second chrominance block are deblocked and filtered in the above manner, the restored image of the current image block/image frame can be obtained.
实施本申请所描述的实施例,在对色度块的边界进行去块滤波时,如果当前色度块是全零块(即量化参数全为零),则可以将当前块的CU级量化参数偏移设置为预设值(例如0),从而避免色度分量的Deblocking使用错误的QP offset,改善现有流程中去块滤波的效果,提升视频编解码的效果和性能。To implement the embodiment described in this application, when performing deblocking filtering on the boundary of a chroma block, if the current chroma block is an all-zero block (that is, the quantization parameter is all zero), the CU-level quantization parameter of the current block can be changed The offset is set to a preset value (for example, 0), so as to prevent the deblocking of the chrominance component from using the wrong QP offset, improve the effect of deblocking filtering in the existing process, and improve the effect and performance of video coding and decoding.
图4是本申请再一实施例提供的视频编解码装置的示意性结构图。图4所示的视频编解码装置400包括处理器410和存储器420,处理器410可以从存储器420中调用并运行计算机程序,以实现本申请实施例中图3所述的方法。FIG. 4 is a schematic structural diagram of a video encoding and decoding device provided by still another embodiment of the present application. The video encoding and decoding apparatus 400 shown in FIG. 4 includes a processor 410 and a memory 420. The processor 410 can call and run a computer program from the memory 420 to implement the method described in FIG. 3 in the embodiment of the present application.
其中,处理器410可以从存储器420中调用并运行计算机程序,以实现本申请实施例中的方法。The processor 410 may call and run a computer program from the memory 420 to implement the method in the embodiment of the present application.
其中,存储器420可以是独立于处理器410的一个单独的器件,也可以集成在处理器410中。The memory 420 may be a separate device independent of the processor 410, or may be integrated in the processor 410.
可选地,如图4所示,视频编解码装置400还可以包括收发器430,处理器410可以控制该收发器430与其他装置进行通信,具体地,可以向其他装置发送信息或数据,或接收其他装置发送的信息或数据。Optionally, as shown in FIG. 4, the video codec device 400 may further include a transceiver 430, and the processor 410 may control the transceiver 430 to communicate with other devices, specifically, may send information or data to other devices, or Receive information or data sent by other devices.
可选地,该视频编解码装置例如可以是编码器、解码器、终端(包括但不限于手机、相机、无人机等),并且该编解码装置可以实现本申请实施例的各个方法中的相应流程,为了简洁,在此不再赘述。Optionally, the video encoding and decoding device may be, for example, an encoder, a decoder, a terminal (including but not limited to a mobile phone, a camera, a drone, etc.), and the encoding and decoding device may implement the methods in the embodiments of the present application. For the sake of brevity, the corresponding process will not be repeated here.
图5是本申请实施例的芯片的示意性结构图。图5所示的芯片500包括处理器510,处理器510可以从存储器中调用并运行计算机程序,以实现本申请实施例中的方法。Fig. 5 is a schematic structural diagram of a chip of an embodiment of the present application. The chip 500 shown in FIG. 5 includes a processor 510, and the processor 510 can call and run a computer program from the memory to implement the method in the embodiment of the present application.
可选地,如图5所示,芯片500还可以包括存储器520。其中,处理器510可以从存储器520中调用并运行计算机程序,以实现本申请实施例中的方法。Optionally, as shown in FIG. 5, the chip 500 may further include a memory 520. The processor 510 may call and run a computer program from the memory 520 to implement the method in the embodiment of the present application.
其中,存储器520可以是独立于处理器510的一个单独的器件,也可以集成在处理器510中。The memory 520 may be a separate device independent of the processor 510, or may be integrated in the processor 510.
可选地,该芯片500还可以包括输入接口530。其中,处理器510可以控制该输入接口530与其他装置或芯片进行通信,具体地,可以获取其他装置或芯片发送的信息或数据。Optionally, the chip 500 may further include an input interface 530. The processor 510 can control the input interface 530 to communicate with other devices or chips, and specifically, can obtain information or data sent by other devices or chips.
可选地,该芯片500还可以包括输出接口540。其中,处理器510可以控制该输出接口540与其他装置或芯片进行通信,具体地,可以向其他装置或芯片输出信息或数据。Optionally, the chip 500 may further include an output interface 540. The processor 510 can control the output interface 540 to communicate with other devices or chips, and specifically, can output information or data to other devices or chips.
应理解,本申请实施例提到的芯片还可以称为***级芯片,***芯片,芯片***或片上***芯片等。It should be understood that the chip mentioned in the embodiment of the present application may also be called a system-level chip, a system-on-chip, a system-on-chip, or a system-on-chip.
应理解,本申请实施例的处理器可能是一种集成电路图像处理***,具有信号的处理能力。在实现过程中,上述方法实施例的各步骤可以通过处理器中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器可以是通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器,处理器读取存储器中的信息,结合其硬件完成上述方法的步骤。It should be understood that the processor of the embodiment of the present application may be an integrated circuit image processing system with signal processing capability. In the implementation process, the steps of the foregoing method embodiments can be completed by hardware integrated logic circuits in the processor or instructions in the form of software. The above-mentioned processor may be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (ASIC), a ready-made programmable gate array (Field Programmable Gate Array, FPGA) or other Programming logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps, and logical block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor or the like. The steps of the method disclosed in the embodiments of the present application may be directly embodied as being executed and completed by a hardware decoding processor, or executed and completed by a combination of hardware and software modules in the decoding processor. The software module can be located in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, or electrically erasable programmable memory, registers. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.
可以理解,本申请实施例中的存储器可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(Read-Only Memory,ROM)、可编程只读存储器(Programmable ROM,PROM)、可擦除可编程只读存储器(Erasable PROM,EPROM)、电可擦除可编程只读存储器(Electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(Random Access Memory,RAM),其用作 外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(Static RAM,SRAM)、动态随机存取存储器(Dynamic RAM,DRAM)、同步动态随机存取存储器(Synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(Double Data Rate SDRAM,DDR SDRAM)、增强型同步动态随机存取存储器(Enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(Synchlink DRAM,SLDRAM)和直接内存总线随机存取存储器(Direct Rambus RAM,DR RAM)。应注意,本文描述的***和方法的存储器旨在包括但不限于这些和任意其它适合类型的存储器。It can be understood that the memory in the embodiments of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memory. Among them, the non-volatile memory can be read-only memory (Read-Only Memory, ROM), programmable read-only memory (Programmable ROM, PROM), erasable programmable read-only memory (Erasable PROM, EPROM), and electrically available Erase programmable read-only memory (Electrically EPROM, EEPROM) or flash memory. Volatile memory can be Random Access Memory (RAM), which is used as an external cache. By way of exemplary but not restrictive description, many forms of RAM are available, such as static random access memory (Static RAM, SRAM), dynamic random access memory (Dynamic RAM, DRAM), synchronous dynamic random access memory (Synchronous DRAM, SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (Double Data Rate SDRAM, DDR SDRAM), Enhanced Synchronous Dynamic Random Access Memory (Enhanced SDRAM, ESDRAM), Synchronous Link Dynamic Random Access Memory (Synchlink DRAM, SLDRAM) ) And Direct Rambus RAM (DR RAM). It should be noted that the memories of the systems and methods described herein are intended to include, but are not limited to, these and any other suitable types of memories.
应理解,上述存储器为示例性但不是限制性说明,例如,本申请实施例中的存储器还可以是静态随机存取存储器(static RAM,SRAM)、动态随机存取存储器(dynamic RAM,DRAM)、同步动态随机存取存储器(synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(double data rate SDRAM,DDR SDRAM)、增强型同步动态随机存取存储器(enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(synch link DRAM,SLDRAM)以及直接内存总线随机存取存储器(Direct Rambus RAM,DR RAM)等等。也就是说,本申请实施例中的存储器旨在包括但不限于这些和任意其它适合类型的存储器。It should be understood that the foregoing memory is exemplary but not restrictive. For example, the memory in the embodiment of the present application may also be static random access memory (static RAM, SRAM), dynamic random access memory (dynamic RAM, DRAM), Synchronous dynamic random access memory (synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (double data rate SDRAM, DDR SDRAM), enhanced synchronous dynamic random access memory (enhanced SDRAM, ESDRAM), synchronous connection Dynamic random access memory (synch link DRAM, SLDRAM) and direct memory bus random access memory (Direct Rambus RAM, DR RAM) and so on. That is to say, the memory in the embodiments of the present application is intended to include but not limited to these and any other suitable types of memory.
本申请实施例中的存储器可以向处理器提供指令和数据。存储器的一部分还可以包括非易失性随机存取存储器。例如,存储器还可以存储设备类型的信息。该处理器可以用于执行存储器中存储的指令,并且该处理器执行该指令时,该处理器可以执行上述方法实施例中与终端设备对应的各个步骤。The memory in the embodiment of the present application can provide instructions and data to the processor. A part of the memory may also include a non-volatile random access memory. For example, the memory can also store device type information. The processor may be used to execute instructions stored in the memory, and when the processor executes the instructions, the processor may execute each step corresponding to the terminal device in the foregoing method embodiment.
在实现过程中,上述方法的各步骤可以通过处理器中的硬件的集成逻辑电路或者软件形式的指令完成。结合本申请实施例所公开的方法的步骤可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器,处理器执行存储器中的指令,结合其硬件完成上述方法的步骤。为避免重复,这里不再详细描述。In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor or instructions in the form of software. The steps of the method disclosed in combination with the embodiments of the present application may be directly embodied as execution and completion by a hardware processor, or execution and completion by a combination of hardware and software modules in the processor. The software module can be located in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, or electrically erasable programmable memory, registers. The storage medium is located in the memory, and the processor executes the instructions in the memory and completes the steps of the above method in combination with its hardware. To avoid repetition, it will not be described in detail here.
还应理解,在本申请实施例中,图像中的像素点可以位于不同的行和/ 或列,其中,A的长度可以对应于A包括的位于同一行的像素点个数,A的高度可以对应于A包括的位于同一列的像素点个数。此外,A的长度和高度也可以分别称为A的宽度和深度,本申请实施例对此不做限定。It should also be understood that, in the embodiments of the present application, the pixels in the image can be located in different rows and/or columns, where the length of A can correspond to the number of pixels located in the same row included in A, and the height of A can be Corresponds to the number of pixels in the same column included in A. In addition, the length and height of A may also be referred to as the width and depth of A, which are not limited in the embodiment of the present application.
还应理解,在本申请实施例中,“与A的边界间隔分布”可以指与A的边界间隔至少一个像素点,也可以称为“不与A的边界相邻”或者“不位于A的边界”,本申请实施例对此不做限定,其中,A可以是图像、矩形区域或子图像,等等。It should also be understood that in the embodiments of the present application, "the boundary spacing distribution with A" can refer to at least one pixel spaced from the boundary of A, and can also be referred to as "not adjacent to the boundary of A" or "not located at the boundary of A". "Border", this embodiment of the application does not limit this, where A can be an image, a rectangular area, or a sub-image, and so on.
还应理解,上文对本申请实施例的描述着重于强调各个实施例之间的不同之处,未提到的相同或相似之处可以互相参考,为了简洁,这里不再赘述。It should also be understood that the above description of the embodiments of the present application focuses on emphasizing the differences between the various embodiments, and the same or similarities that are not mentioned can be referred to each other, and for the sake of brevity, details are not repeated here.
本申请实施例还提供了一种计算机可读存储介质,用于存储计算机程序。The embodiments of the present application also provide a computer-readable storage medium for storing computer programs.
可选的,该计算机可读存储介质可应用于本申请实施例中的编解码装置,并且该计算机程序使得计算机执行本申请实施例的各个方法中由编解码装置实现的相应流程,为了简洁,在此不再赘述。Optionally, the computer-readable storage medium can be applied to the codec device in the embodiment of the present application, and the computer program causes the computer to execute the corresponding process implemented by the codec device in each method of the embodiment of the present application. For the sake of brevity, I won't repeat them here.
本申请实施例还提供了一种计算机程序产品,包括计算机程序指令。The embodiments of the present application also provide a computer program product, including computer program instructions.
可选的,该计算机程序产品可应用于本申请实施例中的编解码装置,并且该计算机程序指令使得计算机执行本申请实施例的各个方法中由编解码装置实现的相应流程,为了简洁,在此不再赘述。Optionally, the computer program product can be applied to the codec device in the embodiment of the present application, and the computer program instructions cause the computer to execute the corresponding process implemented by the codec device in each method of the embodiment of the present application. For the sake of brevity, This will not be repeated here.
本申请实施例还提供了一种计算机程序。The embodiment of the present application also provides a computer program.
可选的,该计算机程序可应用于本申请实施例中的编解码装置,当该计算机程序在计算机上运行时,使得计算机执行本申请实施例的各个方法中由编解码装置实现的相应流程,为了简洁,在此不再赘述。Optionally, the computer program can be applied to the codec device in the embodiment of the present application. When the computer program runs on the computer, the computer executes the corresponding process implemented by the codec device in each method of the embodiment of the present application. For the sake of brevity, I will not repeat them here.
应理解,在本申请实施例中,术语“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系。例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中字符“/”,一般表示前后关联对象是一种“或”的关系。It should be understood that, in the embodiments of the present application, the term "and/or" is merely an association relationship describing an associated object, indicating that there may be three relationships. For example, A and/or B can mean: A alone exists, A and B exist at the same time, and B exists alone. In addition, the character "/" in this text generally indicates that the associated objects before and after are in an "or" relationship.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执 行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。A person of ordinary skill in the art may be aware that the units and algorithm steps of the examples described in the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of both, in order to clearly illustrate the hardware and software Interchangeability, in the above description, the composition and steps of each example have been generally described in accordance with the function. Whether these functions are implemented by hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians can use different methods for each specific application to implement the described functions, but such implementation should not be considered beyond the scope of this application.
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,上述描述的***、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and conciseness of description, the specific working process of the above-described system, device, and unit may refer to the corresponding process in the foregoing method embodiment, which will not be repeated here.
在本申请所提供的几个实施例中,应该理解到,所揭露的***、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个***,或一些特征可以忽略,或不执行。另外,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口、装置或单元的间接耦合或通信连接,也可以是电的,机械的或其它的形式连接。In the several embodiments provided in this application, it should be understood that the disclosed system, device, and method can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components may be combined It can be integrated into another system, or some features can be ignored or not implemented. In addition, the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may also be electrical, mechanical or other forms of connection.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本申请实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments of the present application.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以是两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, the functional units in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or software functional unit.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分,或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, the technical solution of this application is essentially or the part that contributes to the existing technology, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium. It includes several instructions to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disks or optical disks and other media that can store program codes. .
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。The above are only specific implementations of this application, but the protection scope of this application is not limited to this. Anyone familiar with the technical field can easily think of various equivalents within the technical scope disclosed in this application. Modifications or replacements, these modifications or replacements shall be covered within the protection scope of this application. Therefore, the protection scope of this application should be subject to the protection scope of the claims.

Claims (29)

  1. 一种视频编解码的方法,其特征在于,包括:A method for video encoding and decoding, characterized in that it comprises:
    在对第一色度块和第二色度块的边界进行去块滤波时,若所述第一色度块的量化残差全为零,则将所述第一色度块的编码单元级的量化参数偏移设置为第一预设值;When deblocking filtering is performed on the boundary between the first chroma block and the second chroma block, if the quantization residuals of the first chroma block are all zero, the coding unit level of the first chroma block The offset of the quantization parameter is set to the first preset value;
    根据第一量化参数和所述第一色度块的编码单元级的量化参数偏移确定所述第一色度块的第二量化参数,其中,所述第一量化参数是根据所述第一色度块对应的亮度块的量化参数导出的;The second quantization parameter of the first chrominance block is determined according to the first quantization parameter and the quantization parameter offset at the coding unit level of the first chrominance block, wherein the first quantization parameter is based on the first quantization parameter. The quantization parameter of the luminance block corresponding to the chrominance block is derived;
    根据所述第二量化参数对所述第一色度块和所述第二色度块的边界进行去块滤波。Deblock filtering is performed on the boundary between the first chroma block and the second chroma block according to the second quantization parameter.
  2. 根据权利要求1所述的方法,其特征在于,所述第一预设值为0。The method according to claim 1, wherein the first preset value is zero.
  3. 根据权利要求1或2所述的方法,其特征在于,所述根据所述第一色度块对应的亮度块的第一量化参数和所述第一色度块的编码单元级的量化参数偏移确定所述第一色度块的第二量化参数,包括:The method according to claim 1 or 2, wherein the first quantization parameter of the luminance block corresponding to the first chrominance block and the quantization parameter of the coding unit level of the first chrominance block are offset Shifting and determining the second quantization parameter of the first chrominance block includes:
    根据所述第一量化参数、所述第一色度块的编码单元级的量化参数偏移以及第一偏移得到所述第二量化参数,其中,所述第一偏移包括所述第一色度块的图像级的色度量化参数偏移和/或所述第一色度块的条带级的色度量化参数偏移。The second quantization parameter is obtained according to the first quantization parameter, the quantization parameter offset of the coding unit level of the first chrominance block, and the first offset, wherein the first offset includes the first offset The image-level chrominance quantization parameter offset of the chrominance block and/or the stripe-level chrominance quantization parameter offset of the first chrominance block.
  4. 根据权利要求1至3任一项所述的方法,其特征在于,所述根据所述第二量化参数对所述第一色度块和所述第二色度块的边界进行去块滤波,包括:The method according to any one of claims 1 to 3, wherein the deblocking filtering is performed on the boundary between the first chroma block and the second chroma block according to the second quantization parameter, include:
    根据所述第二量化参数和第三量化参数得到第四量化参数,所述第三量化参数是所述第二色度块对应的量化参数;Obtaining a fourth quantization parameter according to the second quantization parameter and the third quantization parameter, where the third quantization parameter is a quantization parameter corresponding to the second chrominance block;
    根据所述第四量化参数对所述第一色度块和所述第二色度块的边界进行去块滤波。Deblock filtering is performed on the boundary between the first chroma block and the second chroma block according to the fourth quantization parameter.
  5. 根据权利要求4所述的方法,其特征在于,所述第二色度块对应的量化参数是根据所述第二色度块对应的亮度块的量化参数、所述第二色度块的编码单元级的量化参数偏移以及第二偏移得到的,其中,所述第二偏移包括所述第二色度块的图像级的色度量化参数偏移和/或所述第二色度块的条 带级的色度量化参数偏移。The method according to claim 4, wherein the quantization parameter corresponding to the second chrominance block is based on the quantization parameter of the luminance block corresponding to the second chrominance block and the coding of the second chrominance block. Unit-level quantization parameter offset and a second offset, where the second offset includes the image-level chrominance quantization parameter offset of the second chrominance block and/or the second chrominance The stripe-level color quantization parameter offset of the block.
  6. 根据权利要求4或5所述的方法,其特征在于,所述根据所述第二量化参数和第三量化参数得到第四量化参数,包括:The method according to claim 4 or 5, wherein the obtaining a fourth quantization parameter according to the second quantization parameter and the third quantization parameter comprises:
    根据所述第二量化参数和所述第三量化参数的均值得到所述第四量化参数。Obtain the fourth quantization parameter according to an average value of the second quantization parameter and the third quantization parameter.
  7. 根据权利要求4至6任一项所述的方法,其特征在于,所述根据所述第四量化参数对所述第一色度块和所述第二色度块的边界进行去块滤波,包括:The method according to any one of claims 4 to 6, wherein the deblocking filtering is performed on the boundary between the first chroma block and the second chroma block according to the fourth quantization parameter, include:
    根据所述第四量化参数以及映射关系,确定所述第四量化参数对应的去块滤波器的参数,所述映射关系包括至少一个量化参数与至少一个去块滤波器的参数的映射关系;Determining a parameter of a deblocking filter corresponding to the fourth quantization parameter according to the fourth quantization parameter and a mapping relationship, where the mapping relationship includes a mapping relationship between at least one quantization parameter and a parameter of at least one deblocking filter;
    根据所述第四量化参数对应的去块滤波器的参数对所述第一色度块和所述第二色度块的边界进行去块滤波。Perform deblocking filtering on the boundary between the first chrominance block and the second chrominance block according to the parameter of the deblocking filter corresponding to the fourth quantization parameter.
  8. 根据权利要求1至7任一项所述的方法,其特征在于,所述第一色度块对应的亮度块的量化参数是根据所述第一色度块对应的亮度块的预测量化参数和所述第一色度块对应的亮度块的量化参数偏移确定的。The method according to any one of claims 1 to 7, wherein the quantization parameter of the luminance block corresponding to the first chrominance block is based on the predicted quantization parameter of the luminance block corresponding to the first chrominance block and The quantization parameter offset of the luminance block corresponding to the first chrominance block is determined.
  9. 根据权利要求8所述的方法,其特征在于,若所述第一色度块对应的亮度块的量化残差全为零,则将所述第一色度块对应的亮度块的量化参数偏移设置为第二预设值。The method according to claim 8, wherein if the quantization residuals of the luminance block corresponding to the first chrominance block are all zero, then the quantization parameter of the luminance block corresponding to the first chrominance block is offset The shift is set to the second preset value.
  10. 根据权利要求9所述的方法,其特征在于,所述第二预设值为0。The method according to claim 9, wherein the second preset value is zero.
  11. 根据权利要求8至10任一项所述的方法,其特征在于,所述第一色度块对应的亮度块的预测量化参数是由所述第一色度块对应的亮度块的相邻块的量化参数确定的。The method according to any one of claims 8 to 10, wherein the predictive quantization parameter of the luminance block corresponding to the first chrominance block is determined by the adjacent block of the luminance block corresponding to the first chrominance block The quantization parameter is determined.
  12. 根据权利要求5所述的方法,其特征在于,所述第二色度块对应的亮度块的量化参数是根据所述第二色度块对应的亮度块的预测量化参数和所述第二色度块对应的亮度块的量化参数偏移确定的。The method according to claim 5, wherein the quantization parameter of the luminance block corresponding to the second chrominance block is based on the predicted quantization parameter of the luminance block corresponding to the second chrominance block and the second chrominance block. The quantization parameter offset of the brightness block corresponding to the degree block is determined.
  13. 根据权利要求12所述的方法,其特征在于,若所述第二色度块对应的亮度块的量化残差全为零,则将所述第二色度块对应的亮度块的量化参数偏移设置为第三预设值。The method according to claim 12, wherein if the quantization residuals of the luminance block corresponding to the second chrominance block are all zero, then the quantization parameter of the luminance block corresponding to the second chrominance block is offset. The shift is set to the third preset value.
  14. 根据权利要求13所述的方法,其特征在于,所述第三预设值为0。The method according to claim 13, wherein the third preset value is zero.
  15. 一种视频编解码的装置,其特征在于,包括处理器和存储器,所述存储器用于存储计算机程序,所述处理器用于调用所述计算机程序执行如下操作:A video encoding and decoding device, characterized by comprising a processor and a memory, the memory is used to store a computer program, and the processor is used to call the computer program to perform the following operations:
    在对第一色度块和第二色度块的边界进行去块滤波时,若所述第一色度块的量化残差全为零,则将所述第一色度块的编码单元级的量化参数偏移设置为第一预设值;When deblocking filtering is performed on the boundary between the first chroma block and the second chroma block, if the quantization residuals of the first chroma block are all zero, the coding unit level of the first chroma block The offset of the quantization parameter is set to the first preset value;
    根据第一量化参数和所述第一色度块的编码单元级的量化参数偏移确定所述第一色度块的第二量化参数,其中,所述第一量化参数是根据所述第一色度块对应的亮度块的量化参数导出的;The second quantization parameter of the first chrominance block is determined according to the first quantization parameter and the quantization parameter offset at the coding unit level of the first chrominance block, wherein the first quantization parameter is based on the first quantization parameter. The quantization parameter of the luminance block corresponding to the chrominance block is derived;
    根据所述第二量化参数对所述第一色度块和所述第二色度块的边界进行去块滤波。Deblock filtering is performed on the boundary between the first chroma block and the second chroma block according to the second quantization parameter.
  16. 根据权利要求15所述的装置,其特征在于,所述第一预设值为0。The device according to claim 15, wherein the first preset value is zero.
  17. 根据权利要求15或16所述的装置,其特征在于,所述根据所述第一色度块对应的亮度块的第一量化参数和所述第一色度块的编码单元级的量化参数偏移确定所述第一色度块的第二量化参数,包括:The apparatus according to claim 15 or 16, wherein the first quantization parameter of the luminance block corresponding to the first chrominance block and the quantization parameter of the coding unit level of the first chrominance block are offset Shifting and determining the second quantization parameter of the first chrominance block includes:
    根据所述第一量化参数、所述第一色度块的编码单元级的量化参数偏移以及第一偏移得到所述第二量化参数,其中,所述第一偏移包括所述第一色度块的图像级的色度量化参数偏移和/或所述第一色度块的条带级的色度量化参数偏移。The second quantization parameter is obtained according to the first quantization parameter, the quantization parameter offset of the coding unit level of the first chrominance block, and the first offset, wherein the first offset includes the first offset The image-level chrominance quantization parameter offset of the chrominance block and/or the stripe-level chrominance quantization parameter offset of the first chrominance block.
  18. 根据权利要求15至17任一项所述的装置,其特征在于,所述根据所述第二量化参数对所述第一色度块和所述第二色度块的边界进行去块滤波,包括:The apparatus according to any one of claims 15 to 17, wherein the deblocking filtering is performed on the boundary between the first chroma block and the second chroma block according to the second quantization parameter, include:
    根据所述第二量化参数和第三量化参数得到第四量化参数,所述第三量化参数是所述第二色度块对应的量化参数;Obtaining a fourth quantization parameter according to the second quantization parameter and the third quantization parameter, where the third quantization parameter is a quantization parameter corresponding to the second chrominance block;
    根据所述第四量化参数对所述第一色度块和所述第二色度块的边界进行去块滤波。Deblock filtering is performed on the boundary between the first chroma block and the second chroma block according to the fourth quantization parameter.
  19. 根据权利要求18所述的装置,其特征在于,所述第二色度块对应的量化参数是根据所述第二色度块对应的亮度块的量化参数、所述第二色度块的编码单元级的量化参数偏移以及第二偏移得到的,其中,所述第二偏移包括所述第二色度块的图像级的色度量化参数偏移和/或所述第二色度块的 条带级的色度量化参数偏移。The apparatus according to claim 18, wherein the quantization parameter corresponding to the second chrominance block is based on the quantization parameter of the luminance block corresponding to the second chrominance block and the coding of the second chrominance block. Unit-level quantization parameter offset and a second offset, where the second offset includes the image-level chrominance quantization parameter offset of the second chrominance block and/or the second chrominance The stripe-level color quantization parameter offset of the block.
  20. 根据权利要求18或19所述的装置,其特征在于,所述根据所述第二量化参数和第三量化参数得到第四量化参数,包括:The device according to claim 18 or 19, wherein the obtaining a fourth quantization parameter according to the second quantization parameter and the third quantization parameter comprises:
    根据所述第二量化参数和所述第三量化参数的均值得到所述第四量化参数。Obtain the fourth quantization parameter according to an average value of the second quantization parameter and the third quantization parameter.
  21. 根据权利要求18至20任一项所述的装置,其特征在于,所述根据所述第四量化参数对所述第一色度块和所述第二色度块的边界进行去块滤波,包括:The apparatus according to any one of claims 18 to 20, wherein the deblocking filtering is performed on the boundary between the first chroma block and the second chroma block according to the fourth quantization parameter, include:
    根据所述第四量化参数以及映射关系,确定所述第四量化参数对应的去块滤波器的参数,所述映射关系包括至少一个量化参数与至少一个去块滤波器的参数的映射关系;Determining a parameter of a deblocking filter corresponding to the fourth quantization parameter according to the fourth quantization parameter and a mapping relationship, where the mapping relationship includes a mapping relationship between at least one quantization parameter and a parameter of at least one deblocking filter;
    根据所述第四量化参数对应的去块滤波器的参数对所述第一色度块和所述第二色度块的边界进行去块滤波。Perform deblocking filtering on the boundary between the first chrominance block and the second chrominance block according to the parameter of the deblocking filter corresponding to the fourth quantization parameter.
  22. 根据权利要求15至21任一项所述的装置,其特征在于,所述第一色度块对应的亮度块的量化参数是根据所述第一色度块对应的亮度块的预测量化参数和所述第一色度块对应的亮度块的量化参数偏移确定的。The apparatus according to any one of claims 15 to 21, wherein the quantization parameter of the luminance block corresponding to the first chrominance block is based on the predicted quantization parameter of the luminance block corresponding to the first chrominance block and The quantization parameter offset of the luminance block corresponding to the first chrominance block is determined.
  23. 根据权利要求22所述的装置,其特征在于,若所述第一色度块对应的亮度块的量化残差全为零,则将所述第一色度块对应的亮度块的量化参数偏移设置为第二预设值。The apparatus according to claim 22, wherein if the quantization residuals of the luminance block corresponding to the first chrominance block are all zero, the quantization parameter of the luminance block corresponding to the first chrominance block is offset The shift is set to the second preset value.
  24. 根据权利要求23所述的装置,其特征在于,所述第二预设值为0。The device according to claim 23, wherein the second preset value is zero.
  25. 根据权利要求22至24任一项所述的装置,其特征在于,所述第一色度块对应的亮度块的预测量化参数是由所述第一色度块对应的亮度块的相邻块的量化参数确定的。The apparatus according to any one of claims 22 to 24, wherein the predictive quantization parameter of the luminance block corresponding to the first chrominance block is determined by the adjacent block of the luminance block corresponding to the first chrominance block The quantization parameter is determined.
  26. 根据权利要求19所述的装置,其特征在于,所述第二色度块对应的亮度块的量化参数是根据所述第二色度块对应的亮度块的预测量化参数和所述第二色度块对应的亮度块的量化参数偏移确定的。The apparatus according to claim 19, wherein the quantization parameter of the luminance block corresponding to the second chrominance block is based on the predicted quantization parameter of the luminance block corresponding to the second chrominance block and the second chrominance block. The quantization parameter offset of the brightness block corresponding to the degree block is determined.
  27. 根据权利要求26所述的装置,其特征在于,若所述第二色度块对应的亮度块的量化残差全为零,则将所述第二色度块对应的亮度块的量化参数偏移设置为第三预设值。The device according to claim 26, wherein if the quantization residuals of the luminance block corresponding to the second chrominance block are all zero, the quantization parameter of the luminance block corresponding to the second chrominance block is offset The shift is set to the third preset value.
  28. 根据权利要求27所述的装置,其特征在于,所述第三预设值为0。The device according to claim 27, wherein the third preset value is zero.
  29. 一种计算机可读存储介质,其特征在于,包括用于执行权利要求1至14中任一项所述的编解码方法的指令。A computer-readable storage medium, characterized by comprising instructions for executing the encoding and decoding method according to any one of claims 1 to 14.
PCT/CN2019/130941 2019-12-31 2019-12-31 Method and apparatus for video encoding and decoding WO2021134700A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2019/130941 WO2021134700A1 (en) 2019-12-31 2019-12-31 Method and apparatus for video encoding and decoding
CN201980050133.0A CN112544079A (en) 2019-12-31 2019-12-31 Video coding and decoding method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2019/130941 WO2021134700A1 (en) 2019-12-31 2019-12-31 Method and apparatus for video encoding and decoding

Publications (1)

Publication Number Publication Date
WO2021134700A1 true WO2021134700A1 (en) 2021-07-08

Family

ID=75013400

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/130941 WO2021134700A1 (en) 2019-12-31 2019-12-31 Method and apparatus for video encoding and decoding

Country Status (2)

Country Link
CN (1) CN112544079A (en)
WO (1) WO2021134700A1 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101267560A (en) * 2008-03-19 2008-09-17 浙江大学 Block-removal filtering method and device
CN106464885A (en) * 2014-06-20 2017-02-22 高通股份有限公司 Block adaptive color-space conversion coding
WO2018237146A1 (en) * 2017-06-21 2018-12-27 Vid Scale, Inc. Adaptive quantization for 360-degree video coding
CN109479152A (en) * 2016-05-13 2019-03-15 交互数字Vc控股公司 The method and apparatus of the intra-frame prediction block of decoding picture and coding method and equipment
WO2019188944A1 (en) * 2018-03-30 2019-10-03 Sharp Kabushiki Kaisha Systems and methods for applying deblocking filters to reconstructed video data

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8279924B2 (en) * 2008-10-03 2012-10-02 Qualcomm Incorporated Quantization parameter selections for encoding of chroma and luma video blocks
US9025675B2 (en) * 2011-06-22 2015-05-05 Texas Instruments Incorporated Systems and methods for reducing blocking artifacts
KR102519728B1 (en) * 2011-11-04 2023-04-10 엘지전자 주식회사 Method and apparatus for encoding/decoding image information
US9451258B2 (en) * 2012-04-03 2016-09-20 Qualcomm Incorporated Chroma slice-level QP offset and deblocking
US9591302B2 (en) * 2012-07-02 2017-03-07 Microsoft Technology Licensing, Llc Use of chroma quantization parameter offsets in deblocking
US20140079135A1 (en) * 2012-09-14 2014-03-20 Qualcomm Incoporated Performing quantization to facilitate deblocking filtering
US9788000B2 (en) * 2013-10-28 2017-10-10 Electronics And Telecommunications Research Institute Method and apparatus for inter color component prediction
CN109889853A (en) * 2019-02-26 2019-06-14 北京大学深圳研究生院 A kind of block-eliminating effect filtering method, system, equipment and computer-readable medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101267560A (en) * 2008-03-19 2008-09-17 浙江大学 Block-removal filtering method and device
CN106464885A (en) * 2014-06-20 2017-02-22 高通股份有限公司 Block adaptive color-space conversion coding
CN109479152A (en) * 2016-05-13 2019-03-15 交互数字Vc控股公司 The method and apparatus of the intra-frame prediction block of decoding picture and coding method and equipment
WO2018237146A1 (en) * 2017-06-21 2018-12-27 Vid Scale, Inc. Adaptive quantization for 360-degree video coding
WO2019188944A1 (en) * 2018-03-30 2019-10-03 Sharp Kabushiki Kaisha Systems and methods for applying deblocking filters to reconstructed video data

Also Published As

Publication number Publication date
CN112544079A (en) 2021-03-23

Similar Documents

Publication Publication Date Title
JP7239732B2 (en) Video encoding and decoding based on bidirectional optical flow
CN114630132B (en) Model selection in neural network based in-loop filters for video codec
US11350125B2 (en) Method and device for intra-prediction
CN113196783B (en) Deblocking filtering adaptive encoder, decoder and corresponding methods
WO2021134706A1 (en) Loop filtering method and device
US11962803B2 (en) Method and device for intra-prediction
WO2021196035A1 (en) Video coding method and apparatus
CN116918331A (en) Coding method and coding device
CN110771166B (en) Intra-frame prediction device and method, encoding device, decoding device, and storage medium
WO2021134700A1 (en) Method and apparatus for video encoding and decoding
WO2022140905A1 (en) Prediction methods, encoder, decoder, and storage medium
TWI752488B (en) Method and apparatus for video coding
CN112534824B (en) Method and apparatus for video encoding
TWI704799B (en) Shape dependent interpolation order
WO2021056219A1 (en) Video coding and decoding method and device
WO2022016535A1 (en) Video coding and decoding method and device
EP4391534A1 (en) Inter-frame prediction method, coder, decoder, and storage medium
CN114598873B (en) Decoding method and device for quantization parameter
CN113840142B (en) Image component prediction method, device and computer storage medium
CN112204986A (en) Video coding and decoding method and device
WO2020258053A1 (en) Image component prediction method and apparatus, and computer storage medium
CN118042136A (en) Encoding and decoding method and device
WO2023200907A1 (en) Methods and devices for geometric partitioning mode with adaptive blending
KR101906831B1 (en) Method and Apparatus for image encoding
CN117941352A (en) Inter prediction method, encoder, decoder, 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: 19958588

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19958588

Country of ref document: EP

Kind code of ref document: A1