WO2022155922A1 - Video coding method and system, video decoding method and system, video coder and video decoder - Google Patents

Video coding method and system, video decoding method and system, video coder and video decoder Download PDF

Info

Publication number
WO2022155922A1
WO2022155922A1 PCT/CN2021/073409 CN2021073409W WO2022155922A1 WO 2022155922 A1 WO2022155922 A1 WO 2022155922A1 CN 2021073409 W CN2021073409 W CN 2021073409W WO 2022155922 A1 WO2022155922 A1 WO 2022155922A1
Authority
WO
WIPO (PCT)
Prior art keywords
alf
coefficient
quantization scale
quantization
target
Prior art date
Application number
PCT/CN2021/073409
Other languages
French (fr)
Chinese (zh)
Inventor
戴震宇
Original Assignee
Oppo广东移动通信有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Priority to PCT/CN2021/073409 priority Critical patent/WO2022155922A1/en
Priority to CN202311245327.0A priority patent/CN117082239A/en
Priority to CN202180090973.7A priority patent/CN116746152A/en
Publication of WO2022155922A1 publication Critical patent/WO2022155922A1/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/186Methods 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 a colour or a chrominance component
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/80Details of filtering operations specially adapted for video compression, e.g. for pixel interpolation
    • H04N19/82Details of filtering operations specially adapted for video compression, e.g. for pixel interpolation involving filtering within a prediction loop

Definitions

  • the present application relates to the technical field of video encoding and decoding, and in particular, to a video encoding and decoding method and system, as well as a video encoder and a video decoder.
  • Digital video technology can be incorporated into a variety of video devices, such as digital televisions, smartphones, computers, e-readers or video players, and the like. With the development of video technology, the amount of data included in video data is relatively large. In order to facilitate the transmission of video data, video devices implement video compression technology to enable more efficient transmission or storage of video data.
  • Errors are introduced in the video compression process.
  • the reconstructed image is filtered, for example, the reconstructed image is filtered using an adaptive correction filter to minimize the mean square error between the reconstructed image and the original image.
  • ALF adaptive correction filter
  • a fixed quantization scale is currently collected, and the coefficients of the floating point type of the ALF are quantized into an integer type.
  • Different regions of the reconstructed image or reconstructed images of different frames may have different ranges of ALF coefficients of floating point type derived, and may also have different filter gains.
  • a fixed quantization scale is used to quantize the floating-point type coefficients, the coding overhead of the filter coefficients and the gain brought by the filter cannot be balanced.
  • Embodiments of the present application provide a video encoding and decoding method and system, as well as a video encoder and a video decoder, to achieve a balance between the encoding overhead of filter coefficients and the gain brought by the filter.
  • the present application provides a video encoding method, including:
  • the reconstructed image includes a first component, and the first component is a luminance component or a chrominance component;
  • the maximum quantization scale determine the target quantization scale of the floating-point type ALF coefficient of the first ALF, where the target quantization scale is less than or equal to the maximum quantization scale;
  • an embodiment of the present application provides a video decoding method, including:
  • the reconstructed image includes a first component, and the first component is a luminance component or a chrominance component;
  • Decoding code stream obtains the ALF coefficient information of the first adaptive correction filter ALF corresponding to the target area in the described reconstruction image under the described first component;
  • the target area in the reconstructed image under the first component is filtered using the first ALF.
  • the present application provides a video encoder for performing the method in the first aspect or each of its implementations.
  • the encoder includes a functional unit for executing the method in the above-mentioned first aspect or each of its implementations.
  • the present application provides a video decoder for executing the method in the second aspect or each of its implementations.
  • the decoder includes functional units for performing the methods in the second aspect or the respective implementations thereof.
  • a video encoder including a processor and a memory.
  • the memory is used for storing a computer program
  • the processor is used for calling and running the computer program stored in the memory, so as to execute the method in the above-mentioned first aspect or each implementation manner thereof.
  • a video decoder including a processor and a memory.
  • the memory is used for storing a computer program
  • the processor is used for calling and running the computer program stored in the memory, so as to execute the method in the above-mentioned second aspect or each implementation manner thereof.
  • a video encoding and decoding system including a video encoder and a video decoder.
  • the video encoder is used to perform the method in the first aspect or each of its implementations
  • the video decoder is used to perform the method in the above-mentioned second aspect or each of its implementations.
  • a chip for implementing any one of the above-mentioned first aspect to the second aspect or the method in each implementation manner thereof.
  • the chip includes: a processor for invoking and running a computer program from a memory, so that a device on which the chip is installed executes any one of the above-mentioned first to second aspects or each of its implementations method.
  • a computer-readable storage medium for storing a computer program, the computer program causing a computer to execute the method in any one of the above-mentioned first aspect to the second aspect or each of its implementations.
  • a computer program product comprising computer program instructions, the computer program instructions causing a computer to perform the method in any one of the above-mentioned first to second aspects or the implementations thereof.
  • a computer program which, when run on a computer, causes the computer to perform the method in any one of the above-mentioned first to second aspects or the respective implementations thereof.
  • the reconstructed image of the current image is obtained; when the target area in the reconstructed image under the first component is filtered using the first ALF, the floating-point type ALF coefficient of the first ALF is determined; Determine the maximum quantization scale of the ALF coefficients of the floating point type of the first ALF according to the ALF coefficients of the floating point type of the first ALF; according to the maximum quantization scale, determine the target quantization scale of the ALF coefficients of the floating point type of the first ALF; use The target quantization scale is to quantize the ALF coefficients of the floating point type of the first ALF into ALF coefficients of the integer type; encode the ALF coefficients of the integer type of the first ALF to obtain a code stream.
  • the present application determines the target quantization scale of the ALF coefficient according to the size of the ALF coefficient of the floating point type of the first ALF, and uses the target quantization scale to quantize the ALF coefficient of the floating point type, so that when the ALF coefficient of the floating point type is large , the target quantization scale of the determined ALF coefficient is relatively large, and then the filter gain corresponding to the ALF coefficient quantized by using the target quantization scale is relatively large.
  • the target quantization scale of the determined ALF coefficient is relatively small.
  • the coding overhead is small, thereby achieving a balance between the coding overhead of the filter coefficients and the gain brought by the filter, thereby improving the effect of video coding and decoding.
  • FIG. 1 is a schematic block diagram of a video encoding and decoding system 100 involved in an embodiment of the present application
  • FIG. 2 is a schematic block diagram of a video encoder 200 provided by an embodiment of the present application.
  • FIG. 3 is a schematic block diagram of a decoding framework 300 provided by an embodiment of the present application.
  • FIG. 4 is a schematic flowchart of a video encoding method 400 provided by an embodiment of the present application.
  • 5A is a schematic diagram of an ALF shape involved in an embodiment of the application.
  • 5B is a schematic diagram of another ALF shape involved in an embodiment of the application.
  • FIG. 6 is another schematic flowchart of a video encoding method 600 provided by an embodiment of the present application.
  • FIG. 7 is another schematic flowchart of a video encoding method 700 provided by an embodiment of the present application.
  • FIG. 8 is a schematic flowchart of a video decoding method 800 provided by an embodiment of the present application.
  • FIG. 9 is a schematic flowchart of a video decoding method 900 provided by an embodiment of the present application.
  • FIG. 10 is a schematic flowchart of a video decoding method 1000 provided by an embodiment of the present application.
  • FIG. 11 is a schematic block diagram of a video encoder 10 provided by an embodiment of the present application.
  • FIG. 12 is a schematic block diagram of a video decoder 20 provided by an embodiment of the present application.
  • FIG. 13 is a schematic block diagram of an electronic device 30 provided by an embodiment of the present application.
  • FIG. 14 is a schematic block diagram of a video encoding and decoding system 40 provided by an embodiment of the present application.
  • the present application can be applied to the field of image encoding and decoding, the field of video encoding and decoding, the field of hardware video encoding and decoding, the field of dedicated circuit video encoding and decoding, the field of real-time video encoding and decoding, and the like.
  • audio video coding standard audio video coding standard, AVS for short
  • H.264/audio video coding audio video coding, AVC for short
  • H.265/High Efficiency Video Coding High efficiency video coding, referred to as HEVC
  • H.266/versatile video coding versatile video coding, referred to as VVC
  • the schemes of the present application may operate in conjunction with other proprietary or industry standards including ITU-TH.261, ISO/IECMPEG-1 Visual, ITU-TH.262 or ISO/IECMPEG-2 Visual, ITU-TH.263 , ISO/IECMPEG-4Visual, ITU-TH.264 (also known as ISO/IECMPEG-4AVC), including Scalable Video Codec (SVC) and Multi-View Video Codec (MVC) extensions.
  • SVC Scalable Video Codec
  • MVC Multi-View Video Codec
  • FIG. 1 For ease of understanding, the video coding and decoding system involved in the embodiments of the present application is first introduced with reference to FIG. 1 .
  • FIG. 1 is a schematic block diagram of a video encoding and decoding system 100 according to an embodiment of the present application. It should be noted that FIG. 1 is only an example, and the video encoding and decoding systems in the embodiments of the present application include, but are not limited to, those shown in FIG. 1 .
  • the video codec system 100 includes an encoding device 110 and a decoding device 120 .
  • the encoding device is used to encode the video data (which can be understood as compression) to generate a code stream, and transmit the code stream to the decoding device.
  • the decoding device decodes the code stream encoded by the encoding device to obtain decoded video data.
  • the encoding device 110 in this embodiment of the present application may be understood as a device with a video encoding function
  • the decoding device 120 may be understood as a device with a video decoding function, that is, the encoding device 110 and the decoding device 120 in the embodiments of the present application include a wider range of devices, Examples include smartphones, desktop computers, mobile computing devices, notebook (eg, laptop) computers, tablet computers, set-top boxes, televisions, cameras, display devices, digital media players, video game consoles, in-vehicle computers, and the like.
  • the encoding device 110 may transmit the encoded video data (eg, a code stream) to the decoding device 120 via the channel 130 .
  • Channel 130 may include one or more media and/or devices capable of transmitting encoded video data from encoding device 110 to decoding device 120 .
  • channel 130 includes one or more communication media that enables encoding device 110 to transmit encoded video data directly to decoding device 120 in real-time.
  • encoding apparatus 110 may modulate the encoded video data according to a communication standard and transmit the modulated video data to decoding apparatus 120 .
  • the communication medium includes a wireless communication medium, such as a radio frequency spectrum, optionally, the communication medium may also include a wired communication medium, such as one or more physical transmission lines.
  • channel 130 includes a storage medium that can store video data encoded by encoding device 110 .
  • Storage media include a variety of locally accessible data storage media such as optical discs, DVDs, flash memory, and the like.
  • the decoding apparatus 120 may obtain the encoded video data from the storage medium.
  • channel 130 may include a storage server that may store video data encoded by encoding device 110 .
  • the decoding device 120 may download the stored encoded video data from the storage server.
  • the storage server may store the encoded video data and may transmit the encoded video data to the decoding device 120, such as a web server (eg, for a website), a file transfer protocol (FTP) server, and the like.
  • FTP file transfer protocol
  • encoding apparatus 110 includes video encoder 112 and output interface 113 .
  • the output interface 113 may include a modulator/demodulator (modem) and/or a transmitter.
  • encoding device 110 may include video source 111 in addition to video encoder 112 and input interface 113 .
  • the video source 111 may include at least one of a video capture device (eg, a video camera), a video archive, a video input interface, a computer graphics system for receiving video data from a video content provider, a computer graphics system Used to generate video data.
  • a video capture device eg, a video camera
  • a video archive e.g., a video archive
  • a video input interface e.g., a video input interface
  • a computer graphics system for receiving video data from a video content provider e.g., a computer graphics system Used to generate video data.
  • the video encoder 112 encodes the video data from the video source 111 to generate a code stream.
  • Video data may include one or more pictures or a sequence of pictures.
  • the code stream contains the encoding information of the image or image sequence in the form of bit stream.
  • the encoded information may include encoded image data and associated data.
  • the associated data may include a sequence parameter set (SPS for short), a picture parameter set (PPS for short), and other syntax structures.
  • SPS sequence parameter set
  • PPS picture parameter set
  • An SPS may contain parameters that apply to one or more sequences.
  • a PPS may contain parameters that apply to one or more images.
  • a syntax structure refers to a set of zero or more syntax elements in a codestream arranged in a specified order.
  • the video encoder 112 directly transmits the encoded video data to the decoding device 120 via the output interface 113 .
  • the encoded video data may also be stored on a storage medium or a storage server for subsequent reading by the decoding device 120 .
  • decoding device 120 includes input interface 121 and video decoder 122 .
  • the decoding device 120 may include a display device 123 in addition to the input interface 121 and the video decoder 122 .
  • the input interface 121 includes a receiver and/or a modem.
  • the input interface 121 may receive the encoded video data through the channel 130 .
  • the video decoder 122 is configured to decode the encoded video data, obtain the decoded video data, and transmit the decoded video data to the display device 123 .
  • the display device 123 displays the decoded video data.
  • the display device 123 may be integrated with the decoding apparatus 120 or external to the decoding apparatus 120 .
  • the display device 123 may include various display devices, such as a liquid crystal display (LCD), a plasma display, an organic light emitting diode (OLED) display, or other types of display devices.
  • LCD liquid crystal display
  • plasma display a plasma display
  • OLED organic light emitting diode
  • FIG. 1 is only an example, and the technical solutions of the embodiments of the present application are not limited to FIG. 1 .
  • the technology of the present application may also be applied to single-side video encoding or single-side video decoding.
  • FIG. 2 is a schematic block diagram of a video encoder 200 provided by an embodiment of the present application. It should be understood that the video encoder 200 can be used to perform lossy compression on images, and can also be used to perform lossless compression on images.
  • the lossless compression may be visually lossless compression (visually lossless compression) or mathematically lossless compression (mathematically lossless compression).
  • the video encoder 200 can be applied to image data in luminance chrominance (YCbCr, YUV) format.
  • the YUV ratio can be 4:2:0, 4:2:2 or 4:4:4, Y represents the luminance (Luma), Cb(U) represents the blue chromaticity, Cr(V) represents the red chromaticity, U and V are expressed as chroma (Chroma) to describe color and saturation.
  • 4:2:0 means that every 4 pixels has 4 luma components
  • 2 chrominance components YYYYCbCr
  • 4:2:2 means that every 4 pixels has 4 luma components
  • 4 Chroma component YYYYCbCrCbCr
  • 4:4:4 means full pixel display (YYYYCbCrCbCrCbCrCbCr).
  • the video encoder 200 reads video data, and for each frame of image in the video data, divides one frame of image into several coding tree units (CTUs).
  • CTUs coding tree units
  • the CTB may be referred to as “Tree block", “Largest Coding Unit” (LCU for short) or “coding tree block” (CTB for short).
  • LCU Large Coding Unit
  • CTB coding tree block
  • Each CTU may be associated with a block of pixels of equal size within the image.
  • Each pixel may correspond to one luminance (luma) sample and two chrominance (chrominance or chroma) samples.
  • each CTU may be associated with one block of luma samples and two blocks of chroma samples.
  • the size of one CTU is, for example, 128 ⁇ 128, 64 ⁇ 64, 32 ⁇ 32, and so on.
  • a CTU can be further divided into several coding units (Coding Unit, CU) for coding, and the CU can be a rectangular block or a square block.
  • the CU can be further divided into a prediction unit (PU for short) and a transform unit (TU for short), so that coding, prediction, and transformation are separated and processing is more flexible.
  • the CTU is divided into CUs in a quadtree manner, and the CUs are divided into TUs and PUs in a quadtree manner.
  • Video encoders and video decoders may support various PU sizes. Assuming the size of a particular CU is 2Nx2N, video encoders and video decoders may support PU sizes of 2Nx2N or NxN for intra prediction, and support 2Nx2N, 2NxN, Nx2N, NxN or similar sized symmetric PUs for inter prediction. Video encoders and video decoders may also support 2NxnU, 2NxnD, nLx2N, and nRx2N asymmetric PUs for inter prediction.
  • the video encoder 200 may include: a prediction unit 210, a residual unit 220, a transform/quantization unit 230, an inverse transform/quantization unit 240, a reconstruction unit 250, a loop filtering unit 260 , a decoded image buffer 270 and an entropy encoding unit 280 . It should be noted that the video encoder 200 may include more, less or different functional components.
  • a current block may be referred to as a current coding unit (CU) or a current prediction unit (PU), or the like.
  • a prediction block may also be referred to as a predicted image block or an image prediction block, and a reconstructed image block may also be referred to as a reconstructed block or an image reconstructed image block.
  • prediction unit 210 includes an inter prediction unit 211 and an intra prediction unit 212 . Since there is a strong correlation between adjacent pixels in a frame of a video, the method of intra-frame prediction is used in video coding and decoding technology to eliminate the spatial redundancy between adjacent pixels. Due to the strong similarity between adjacent frames in the video, the inter-frame prediction method is used in the video coding and decoding technology to eliminate the temporal redundancy between adjacent frames, thereby improving the coding efficiency.
  • the inter-frame prediction unit 211 can be used for inter-frame prediction, and the inter-frame prediction can refer to image information of different frames, and the inter-frame prediction uses motion information to find a reference block from the reference frame, and generates a prediction block according to the reference block for eliminating temporal redundancy;
  • Frames used for inter-frame prediction may be P frames and/or B frames, where P frames refer to forward predicted frames, and B frames refer to bidirectional predicted frames.
  • the motion information includes the reference frame list where the reference frame is located, the reference frame index, and the motion vector.
  • the motion vector can be of whole pixel or sub-pixel. If the motion vector is sub-pixel, then it is necessary to use interpolation filtering in the reference frame to make the required sub-pixel block.
  • the reference frame found according to the motion vector is used.
  • the whole pixel or sub-pixel block is called the reference block.
  • the reference block is directly used as the prediction block, and some technologies are processed on the basis of the reference block to generate the prediction block.
  • Reprocessing to generate a prediction block on the basis of the reference block can also be understood as taking the reference block as a prediction block and then processing it on the basis of the prediction block to generate a new prediction block.
  • inter-frame prediction methods include: geometric partitioning mode (GPM) in the VVC video codec standard, and angular weighted prediction (AWP) in the AVS3 video codec standard. These two intra prediction modes have something in common in principle.
  • GPM geometric partitioning mode
  • AVS3 angular weighted prediction
  • the intra-frame prediction unit 212 only refers to the information of the same frame image, and predicts the pixel information in the current code image block, so as to eliminate the spatial redundancy.
  • Frames used for intra prediction may be I-frames.
  • the white 4 ⁇ 4 block is the current block
  • the gray pixels in the left row and upper column of the current block are the reference pixels of the current block
  • the intra prediction uses these reference pixels to predict the current block.
  • These reference pixels may already be all available, ie all already coded and decoded. Some parts may not be available. For example, if the current block is the leftmost part of the whole frame, the reference pixels to the left of the current block are not available.
  • the lower left part of the current block has not been encoded or decoded, so the reference pixels at the lower left are also unavailable.
  • the available reference pixel or some value or some method can be used for padding, or no padding is performed.
  • the intra prediction method further includes a multiple reference line intra prediction method (multiple reference line, MRL), which can use more reference pixels to improve coding efficiency.
  • MRL multiple reference line intra prediction method
  • mode 0 is to copy the pixels above the current block to the current block in the vertical direction as the predicted value
  • mode 1 is to copy the reference pixel on the left to the current block in the horizontal direction as the predicted value
  • mode 2 (DC) is to copy A ⁇
  • the average value of the 8 points D and I to L is used as the predicted value of all points.
  • Modes 3 to 8 copy the reference pixels to the corresponding position of the current block according to a certain angle respectively. Because some positions of the current block cannot exactly correspond to the reference pixels, it may be necessary to use a weighted average of the reference pixels, or sub-pixels of the interpolated reference pixels.
  • the intra-frame prediction modes used by HEVC include Planar mode, DC and 33 angle modes, for a total of 35 prediction modes.
  • the intra-frame modes used by VVC are Planar, DC, and 65 angular modes, for a total of 67 prediction modes.
  • the intra-frame modes used by AVS3 are DC, Plane, Bilinear and 63 angle modes, a total of 66 prediction modes.
  • the intra-frame prediction will be more accurate and more in line with the demand for the development of high-definition and ultra-high-definition digital video.
  • Residual unit 220 may generate a residual block of the CU based on the pixel blocks of the CU and the prediction blocks of the PUs of the CU. For example, residual unit 220 may generate a residual block of the CU such that each sample in the residual block has a value equal to the difference between the samples in the CU's pixel block, and the CU's PU's Corresponding samples in the prediction block.
  • Transform/quantization unit 230 may quantize transform coefficients. Transform/quantization unit 230 may quantize transform coefficients associated with TUs of the CU based on quantization parameter (QP) values associated with the CU. Video encoder 200 may adjust the degree of quantization applied to transform coefficients associated with the CU by adjusting the QP value associated with the CU.
  • QP quantization parameter
  • Inverse transform/quantization unit 240 may apply inverse quantization and inverse transform, respectively, to the quantized transform coefficients to reconstruct a residual block from the quantized transform coefficients.
  • Reconstruction unit 250 may add the samples of the reconstructed residual block to corresponding samples of the one or more prediction blocks generated by prediction unit 210 to generate a reconstructed image block associated with the TU. By reconstructing the block of samples for each TU of the CU in this manner, video encoder 200 may reconstruct the block of pixels of the CU.
  • In-loop filtering unit 260 may perform deblocking filtering operations to reduce blocking artifacts for pixel blocks associated with the CU.
  • loop filtering unit 260 includes a deblocking filtering unit, a sample adaptive compensation SAO unit, an adaptive loop filtering ALF unit.
  • the decoded image buffer 270 may store the reconstructed pixel blocks.
  • Inter-prediction unit 211 may use the reference picture containing the reconstructed pixel block to perform inter-prediction on PUs of other pictures.
  • intra-prediction unit 212 may use the reconstructed pixel blocks in decoded picture buffer 270 to perform intra-prediction on other PUs in the same picture as the CU.
  • Entropy encoding unit 280 may receive the quantized transform coefficients from transform/quantization unit 230 . Entropy encoding unit 280 may perform one or more entropy encoding operations on the quantized transform coefficients to generate entropy encoded data.
  • the basic flow of video coding involved in the present application is as follows: at the coding end, the current image is divided into blocks, and for the current block, the prediction unit 210 uses intra-frame prediction or inter-frame prediction to generate a prediction block of the current block.
  • the residual unit 220 may calculate a residual block based on the predicted block and the original block of the current block, that is, the difference between the predicted block and the original block of the current block, and the residual block may also be referred to as residual information.
  • the residual block can be transformed and quantized by the transform/quantization unit 230 to remove information insensitive to human eyes, so as to eliminate visual redundancy.
  • the residual block before being transformed and quantized by the transform/quantization unit 230 may be referred to as a time-domain residual block, and the time-domain residual block after being transformed and quantized by the transform/quantization unit 230 may be referred to as a frequency residual block. or a frequency domain residual block.
  • the entropy coding unit 280 receives the quantized variation coefficient output by the variation quantization unit 230, and can perform entropy coding on the quantized variation coefficient to output a code stream. For example, the entropy encoding unit 280 may eliminate character redundancy according to the target context model and the probability information of the binary code stream.
  • the video encoder performs inverse quantization and inverse variation on the quantized variation coefficient output by the variation quantization unit 230 to obtain the residual block of the current block, and then adds the residual block of the current block to the prediction block of the current block, Get the reconstructed block of the current block.
  • reconstructed blocks corresponding to other image blocks in the current image can be obtained, and these reconstructed blocks are spliced to obtain a reconstructed image of the current image.
  • the reconstructed image is filtered, for example, ALF is used to filter the reconstructed image to reduce the difference between the pixel value of the pixel in the reconstructed image and the original pixel value of the pixel in the current image. difference.
  • the filtered reconstructed image is stored in the decoded image buffer 270, and can be used as a reference frame for inter-frame prediction for subsequent frames.
  • the block division information determined by the coding end, and mode information or parameter information such as prediction, transformation, quantization, entropy coding, and loop filtering, etc. are carried in the code stream when necessary.
  • the decoding end determines the same block division information, prediction, transformation, quantization, entropy coding, loop filtering and other mode information or parameter information as the encoding end by analyzing the code stream and analyzing the existing information, so as to ensure the decoded image obtained by the encoding end. It is the same as the decoded image obtained by the decoder.
  • FIG. 3 is a schematic block diagram of a decoding framework 300 provided by an embodiment of the present application.
  • the video decoder 300 includes an entropy decoding unit 310 , a prediction unit 320 , an inverse quantization/transformation unit 330 , a reconstruction unit 340 , a loop filtering unit 350 , and a decoded image buffer 360 . It should be noted that the video decoder 300 may include more, less or different functional components.
  • the video decoder 300 may receive the code stream.
  • Entropy decoding unit 310 may parse the codestream to extract syntax elements from the codestream. As part of parsing the codestream, entropy decoding unit 310 may parse the entropy-encoded syntax elements in the codestream.
  • the prediction unit 320, the inverse quantization/transform unit 330, the reconstruction unit 340, and the in-loop filtering unit 350 may decode the video data according to the syntax elements extracted from the code stream, ie, generate decoded video data.
  • prediction unit 320 includes intra prediction unit 321 and inter prediction unit 322 .
  • Intra-prediction unit 321 may perform intra-prediction to generate prediction blocks for the PU. Intra-prediction unit 321 may use an intra-prediction mode to generate prediction blocks for a PU based on pixel blocks of spatially neighboring PUs. Intra-prediction unit 321 may also determine an intra-prediction mode for the PU from one or more syntax elements parsed from the codestream.
  • Inter-prediction unit 322 may construct a first reference picture list (List 0) and a second reference picture list (List 1) from the syntax elements parsed from the codestream. Furthermore, if the PU is encoded using inter-prediction, entropy decoding unit 310 may parse the motion information for the PU. Inter-prediction unit 322 may determine one or more reference blocks for the PU according to the motion information of the PU. Inter-prediction unit 322 may generate a prediction block for the PU from one or more reference blocks of the PU.
  • the inverse quantization/transform unit 330 inversely quantizes (ie, dequantizes) the transform coefficients associated with the TUs.
  • Inverse quantization/transform unit 330 may use the QP value associated with the CU of the TU to determine the degree of quantization.
  • inverse quantization/transform unit 330 may apply one or more inverse transforms to the inverse quantized transform coefficients to generate a residual block associated with the TU.
  • Reconstruction unit 340 uses the residual blocks associated with the TUs of the CU and the prediction blocks of the PUs of the CU to reconstruct the pixel blocks of the CU. For example, reconstruction unit 340 may add samples of the residual block to corresponding samples of the prediction block to reconstruct the pixel block of the CU, resulting in a reconstructed image block.
  • In-loop filtering unit 350 may perform deblocking filtering operations to reduce blocking artifacts for pixel blocks associated with the CU.
  • the loop filtering unit 350 includes a deblocking filtering unit, a sample adaptive compensation SAO unit, an adaptive loop filtering ALF unit.
  • Video decoder 300 may store the reconstructed images of the CU in decoded image buffer 360 .
  • the video decoder 300 may use the reconstructed image in the decoded image buffer 360 as a reference image for subsequent prediction, or transmit the reconstructed image to a display device for presentation.
  • the entropy decoding unit 310 can parse the code stream to obtain the prediction information, quantization coefficient matrix, etc. of the current block, and the prediction unit 320 uses intra prediction or inter prediction for the current block to generate the current block based on the prediction information.
  • the predicted block for the block The inverse quantization/transform unit 330 performs inverse quantization and inverse transformation on the quantized coefficient matrix using the quantized coefficient matrix obtained from the code stream to obtain a residual block.
  • the reconstruction unit 340 adds the prediction block and the residual block to obtain a reconstructed block.
  • the reconstructed blocks form a reconstructed image
  • the loop filtering unit 350 performs loop filtering on the reconstructed image based on the image or based on the block to obtain a decoded image.
  • the decoded image may also be referred to as a reconstructed image.
  • the reconstructed image may be displayed by a display device, and on the other hand, the reconstructed image may be stored in the decoded image buffer 360 to serve as a reference frame for inter-frame prediction for subsequent frames.
  • the above is the basic process of the video codec under the block-based hybrid coding framework. With the development of technology, some modules or steps of the framework or process may be optimized. This application is applicable to the block-based hybrid coding framework.
  • the basic process of the video codec but not limited to the framework and process.
  • the encoding end will be introduced below with reference to FIG. 4 .
  • FIG. 4 is a schematic flowchart of a video encoding method 400 provided by an embodiment of the present application, and the embodiment of the present application is applied to the video encoder shown in FIG. 1 and FIG. 2 .
  • the method of the embodiment of the present application includes:
  • the video encoder receives a video stream, which consists of a series of image frames, and performs video encoding for each frame of image in the video stream.
  • a video stream which consists of a series of image frames
  • this application uses a frame of image currently to be encoded Record as the current image.
  • the video encoder divides the current image into one or more image blocks to be encoded, and for each image block to be encoded, the prediction unit 210 in the video encoder uses inter-frame prediction, intra-frame prediction After the prediction block of the image block to be encoded is generated, the prediction block is sent to the residual unit 220, which can be understood as a summer, including one or more components that perform a subtraction operation.
  • the residual unit 220 subtracts the prediction block from the image block to be encoded to form a residual block, and sends the residual block to the transform and quantization unit 230 .
  • the transform and quantization unit 230 transforms the residual block using, for example, discrete cosine transform (DCT) or the like, to obtain transform coefficients.
  • DCT discrete cosine transform
  • the transform and quantization unit 230 further quantizes the transform coefficients to obtain quantized transform coefficients.
  • the transform and quantization unit 230 forwards the quantized transform coefficients to the entropy encoding unit 280 .
  • the entropy encoding unit 280 entropy encodes the quantized transform coefficients.
  • entropy encoding unit 280 may perform context adaptive variable length coding (CAVLC), context adaptive binary arithmetic coding (CABAC), syntax-based context adaptive binary arithmetic coding (SBAC), probability interval partitioning entropy (PIPE) ) coding and other coding methods, entropy coding is performed on the quantized transform coefficients to obtain a code stream.
  • CAVLC context adaptive variable length coding
  • CABAC context adaptive binary arithmetic coding
  • SBAC syntax-based context adaptive binary arithmetic coding
  • PIPE probability interval partitioning entropy
  • the transform and quantization unit 230 forwards the quantized transform coefficients to the inverse transform and quantization unit 240 .
  • the inverse transform and quantization unit 240 inversely quantizes and inversely transforms the quantized transform coefficients to reconstruct the residual block in the pixel domain.
  • Reconstruction unit 250 is understood to be a summer, including one or more components that perform subtraction operations.
  • the reconstruction unit 250 adds the reconstructed residual block to the prediction block generated by the prediction unit 210 to generate a partial or complete reconstructed image of the current image, the partial or complete reconstructed image including one or more reconstructed image blocks.
  • the reconstructed image includes a first component, and the first component may be a luminance component or a chrominance component.
  • S402. Determine the ALF coefficients of the floating point type of the first ALF when the target area in the reconstructed image under the first component is filtered using the first ALF.
  • the video encoder in this embodiment of the present application can be used for images in different formats, such as YUV format or YCbCr format.
  • AVS3 there is an independent adaptive correction filter (ALF for short) for each channel in the YUV or YCbCr format.
  • the first chrominance component of a frame image (such as U component or Cb component) corresponds to an ALF
  • the second chrominance component (eg, V component or Cr component) of a frame of image corresponds to an ALF.
  • a frame of image is divided into multiple regions, for example, into 16 regions or 64 regions, and each region corresponds to an ALF. Based on this, when the first component is a chrominance component, the present application uses the entire reconstructed image under the first component as the target area to be filtered.
  • the present application divides the reconstructed image under the first component into regions, for example, into 16 regions or 64 regions, and takes one of the regions to be filtered as the target region.
  • the ALF that performs adaptive correction filtering on the target area is denoted as the first ALF.
  • the form of the first ALF may be as shown in FIG. 5A , the form of the first ALF is a 7 ⁇ 7 cross plus a 3 ⁇ 3 square, and a set of ALF coefficients of the first ALF includes 9 ALF coefficients , C0, C1, C2, C3, C4, C5, C6, C7, and C8, respectively, where C8 is the ALF coefficient corresponding to the center point of the first ALF, and other ALF coefficients in the first ALF are related to the first ALF Center point symmetry.
  • the form of the first ALF may be as shown in FIG. 5B , the form of the first ALF is a 7 ⁇ 7 cross plus a 5 ⁇ 5 square, and a set of ALF coefficients of the first ALF includes 15 ALF coefficients , respectively C0, C1, C2...C13 and C14, wherein C14 is the ALF coefficient corresponding to the center point of the first ALF, wherein other ALF coefficients in the first ALF are symmetrical with respect to the center point of the first ALF.
  • the Wienerhoff method is used to derive the ALF coefficients of the floating point type of the first ALF.
  • the ALF coefficient of the floating point type of the first ALF is derived:
  • represents the number of pixels in the target area R
  • s[r] represents the original pixel value of the pixel r
  • t[r] Represents the reconstructed pixel value of the pixel point r, that is, the pixel value of the pixel point r in the reconstructed image.
  • s[r] represents the original pixel value of pixel r.
  • C0, C1...CN-1 are the ALF coefficients of the floating point type of the first ALF. ⁇ P 0 , P 1 , P 2 ,...,P N-1 ⁇ is a position offset relative to r.
  • the above N is 8
  • the above N is 14.
  • the floating point type ALF coefficients C0, C1...CN-1 of the first ALF can be derived.
  • the value range of ALF coefficients of floating-point type is almost unlimited.
  • S403. Determine the maximum quantization scale of the ALF coefficients of the floating-point number type of the first ALF according to the ALF coefficients of the floating-point number type of the first ALF.
  • the first 8 ALF coefficients (ie C0, C1, C2, C3, C4, C5, C6 and C7) of the first ALF after quantization
  • the coefficients of integer type are limited in the range of -64 to 63
  • the coefficients of integer type after the quantization of the ninth ALF coefficient (ie, C8) are limited in the range of 0 to 127.
  • the quantized integer-type coefficients of the first 14 ALF coefficients of the first ALF are limited to -64 to 63 Within the range of , the quantized integer type coefficient of the 15th ALF coefficient (ie, C14) is limited to the range of 0-127.
  • the maximum quantization scale of the floating-point ALF coefficient of the first ALF can be determined according to the floating-point ALF coefficient of the first ALF and the integer coefficient threshold corresponding to the quantization of the floating-point ALF coefficient to the integer type.
  • the above S403 includes the following S403-A1 and S403-A2:
  • S403-A2 Determine the maximum quantization scale of the floating-point type ALF coefficient of the first ALF according to the maximum shift value.
  • the ALF coefficient corresponding to the center position of the first ALF for example, C8 or C14 is the largest, and the ALF coefficient corresponding to the non-center position of the first ALF is smaller.
  • the above-mentioned first coefficient may be a floating-point type ALF coefficient corresponding to the center position of the first ALF, or may be a floating-point type ALF coefficient corresponding to a non-center position of the first ALF.
  • the maximum integer coefficient threshold corresponding to the ALF coefficient W min(x, y) is b1. In this way, according to the ALF coefficients W min(x, y) and b1, the maximum shift value allowed when the floating-point type ALF coefficient W min(x, y) is quantized into an integer type can be determined.
  • the maximum shift value bitshift allowed when quantizing the ALF coefficient of the floating-point type into an integer type is determined:
  • W max(x, y) is the largest ALF coefficient among the floating-point type ALF coefficients corresponding to the non-center position of the first ALF, and neither x nor y is equal to 0.
  • d1 is the maximum integer coefficient threshold corresponding to W max(x, y) , for example, d1 is 63.
  • the first coefficient is a coefficient of floating point type corresponding to the center position of the first ALF, it can be determined according to the following formula (3) when the ALF coefficient of floating point type is quantized into an integer type Maximum allowed shift value bitshift:
  • W f(0,0) is the floating-point type coefficient corresponding to the center position of the first ALF
  • d is the maximum integer coefficient threshold corresponding to W f(0,0) , for example, d is 127.
  • the maximum quantization scale of the ALF coefficients of the floating point type of the first ALF is determined:
  • Scale max is the maximum quantization scale.
  • the following S404 is performed to determine the target quantization scale of the ALF coefficients of the floating point type of the first ALF.
  • the target quantization scale is less than or equal to the maximum quantization scale.
  • the maximum quantization scale is 2 8 , in this way, it can be determined that the target quantization scale is 2 7 or 2 6 or 2 5 smaller than or equal to 2 8 and greater than 1 to the power of 2.
  • the methods for determining the target quantization scale of the ALF coefficients of the floating point type of the first ALF include but are not limited to the following:
  • the second quantization scale is determined as the target quantization scale of the floating-point type ALF coefficient of the second ALF, and the second quantization scale is less than or equal to the maximum quantization scale.
  • the third quantization scale is determined as the target quantization scale of the floating-point type ALF coefficients of the third ALF, and the third ALF is the target quantization scale for the chrominance components.
  • the eye is more sensitive to luminance, so higher quantization precision is used for the reconstructed image under the luminance component to improve the luminance information of the reconstructed image.
  • the eye is less sensitive to chrominance, so a lower quantization precision is used for the reconstructed image under the chrominance component to improve coding efficiency.
  • the larger second quantization scale is determined as the target quantization scale of the floating-point type ALF coefficient of the second ALF.
  • the second ALF quantized by using the second quantization scale has higher quantization accuracy, and when the reconstructed image under the luminance component is filtered by using the second ALF, the filtering accuracy can be improved.
  • the maximum quantization scale is 2 8
  • the second quantization scale is determined to be 2 8 , 2 7 or 2 6 and so on.
  • the third quantization scale smaller than the second quantization scale is directly determined as the target quantization scale corresponding to the chrominance component, that is, the third ALF is used to quantify the chrominance component.
  • the third quantization scale can be determined as the target quantization scale of the floating-point type ALF coefficient of the third ALF, and there is no need to additionally calculate the target quantization scale corresponding to the chrominance component, reducing the amount of calculation and improving the coding efficiency.
  • the largest quantization scale is 2 8
  • the second quantization scale is 2 8 , 2 7 or 2 6
  • the third quantization scale is 2 5 or 2 4 and so on.
  • the fourth quantization scale is determined as the target quantization scale of the floating-point type ALF coefficient of the second ALF, and the fourth quantization scale is smaller than the maximum quantization scale.
  • the fifth quantization scale is determined as the target quantization scale of the floating-point type ALF coefficient of the fourth ALF, and the fourth ALF is a filter used when performing ALS filtering on the reconstructed image under the luminance component , the fifth quantization scale is larger than the fourth quantization scale.
  • a smaller fourth quantization scale is determined as the target quantization scale of the ALF coefficients of the floating point type of the second ALF.
  • the coding scale of the ALF coefficients of the second ALF quantized by using the fourth quantization scale is shorter, which is convenient for coding. For example, if the maximum quantization scale is 2 8 , the fourth quantization scale is determined to be 2 5 , or 2 4 and so on.
  • the fifth quantization scale larger than the fourth quantization scale is directly determined as the target quantization scale corresponding to the luminance component, and there is no need to additionally calculate the target quantization scale corresponding to the luminance component , reduce the amount of calculation and improve the coding efficiency.
  • the largest quantization scale is 28
  • the third quantization scale is 25 or 24 , etc.
  • the fifth quantization scale is 28 , 27 , 26 , etc.
  • S404 includes the following S404-A1 and S404-A2:
  • S404-A2 Determine, according to the quantization cost of each first quantization scale, the target quantization cost of the floating-point type ALF coefficient of the first ALF.
  • the maximum quantization scale and the preset minimum quantization scale constitute a quantization interval.
  • each quantization scale in the quantization interval is the first quantization scale.
  • the quantization cost of each first quantization scale in the quantization interval is determined, and according to the quantization cost of each first quantization scale, the target quantization cost of the ALF coefficient of the floating point type of the first ALF is determined.
  • the first quantization scale with the smallest quantization cost is determined as the target quantization cost of the floating point type ALF coefficients of the first ALF.
  • the average value of the quantization costs of the first quantization scales is determined as the target quantization cost of the floating-point type ALF coefficients of the first ALF, where the average value may be an arithmetic average value or a weighted average value.
  • the above preset minimum quantization scale is 2 0 , that is, 1.
  • the above preset minimum quantization scale is 2 1 or 2 2 or the like.
  • the quantization cost is determined in the same manner.
  • the present application takes a first quantization scale as an example for description.
  • the encoding cost of the first quantization scale is determined as the quantization cost of the first quantization scale, for example, the floating-point type ALF coefficients of the first ALF are quantized using the first quantization scale to the integer type first ALF
  • the coefficient, the number of bits occupied by the first ALF coefficient of the encoding integer type, is determined as the quantization cost of the first quantization scale.
  • determining the quantization cost of the first quantization scale in the above S404-A1 includes the following steps S404-A11 to S404-A13:
  • S404-A13 Determine the quantization cost of the first quantization scale according to the quantization distortion result corresponding to the first ALF coefficient and the number of bits consumed by encoding the first ALF coefficient.
  • the first quantization scale is used to quantize the ALF coefficients of the floating point type of the first ALF into the first ALF coefficients of the integer type.
  • the floating point coefficients of the first ALF are quantized
  • An ALF coefficient of type is quantized to the first ALF coefficient of an integer type:
  • AlfCoeff integer round(AlfCoeff float ⁇ 2 p ) (5)
  • AlfCoeff integer is the first ALF coefficient of the integer type
  • AlfCoeff float is the ALF coefficient of the floating point type of the first ALF
  • round is the rounding operation
  • 2 P is the first quantization scale.
  • the manner of the quantization distortion result corresponding to the first ALF coefficient includes but is not limited to the following:
  • Method 1 Determine the autocorrelation coefficient of the pixels in the target area according to the reconstructed pixel values of the pixels in the target area; determine the cross-correlation coefficient of the pixels in the target area according to the original pixel values of the pixels in the target area; According to the target area The product of the autocorrelation coefficient of the middle pixel and the first ALF coefficient, and the cross-correlation coefficient of the pixel in the target area, determine the quantization distortion result corresponding to the first ALF coefficient.
  • the autocorrelation coefficient E of the pixels in the target area can be determined:
  • represents the number of pixels in the target area R
  • s[r] represents the original pixel value of the pixel r
  • t[r] Represents the reconstructed pixel value of the pixel point r, that is, the pixel value of the pixel point r in the reconstructed image.
  • ⁇ P 0 , P 1 , P 2 ,...,P N-1 ⁇ is a position offset relative to r.
  • the cross-correlation coefficient Y of pixels in the target area can be determined:
  • s[r] represents the original pixel value of the pixel point r.
  • D is the quantization distortion result corresponding to the first ALF coefficient
  • C is the first ALF coefficient
  • the autocorrelation coefficient and cross-correlation coefficient of the target area are respectively denoted as E[15][15] and y[15], where 15 is the number of ALF coefficients of the first ALF, and coeff[i] is the first ALF coefficient.
  • E[15][15] and y[15] 15 is the number of ALF coefficients of the first ALF
  • coeff[i] is the first ALF coefficient.
  • the value of dist is D.
  • Method 2 Use the first ALF coefficient to filter the target area of the reconstructed image; determine the quantization distortion result corresponding to the first ALF coefficient according to the difference between the filtered pixel value and the original pixel value of the pixel in the target area.
  • the first ALF is used to filter the target area of the reconstructed image under the first component to obtain the filtered target area.
  • the filtered pixel values of the pixel points in the filtered target area are compared with the original pixel values to obtain the interpolation of the pixel values, and the quantization distortion result corresponding to the first ALF coefficient is determined according to the difference of the pixel values. For example, the larger the difference value, the larger the quantization distortion corresponding to the first ALF coefficient, and the smaller the difference value, the smaller the quantization distortion corresponding to the first ALF coefficient.
  • the quantization distortion result corresponding to the first ALF coefficient is determined.
  • the quantization cost of the first quantization scale is determined according to the quantization distortion result corresponding to the first ALF coefficient and the number of bits consumed for encoding the first ALF coefficient.
  • J is the quantization cost of the first quantization scale
  • D is the quantization distortion result corresponding to the first ALF coefficient
  • R is the number of bits consumed for encoding the first ALF coefficient
  • is a variable value.
  • R is an estimate of the number of bits consumed to encode the first ALF coefficient.
  • Coefficient value numbers consume bits 0 1 1 1 010 3 -1 011 3 2 00100 5 -2 00101 5 3 00110 5 -3 00111 5
  • the filter coefficient For example, if the filter coefficient is 0, the number of bits consumed is 1 bit, and if the filter coefficient is 3, the number of bits consumed is 5 bits. Look up Table 1 to obtain the number of bits consumed by each ALF coefficient in the encoding of the first ALF coefficients. The sum of the bits consumed by the coefficients, as the value of R, is brought into the above formula (9) to obtain the quantization cost of the first quantization scale.
  • the quantization cost corresponding to each first quantization scale in the quantization interval formed by the maximum quantization scale and the preset minimum quantization scale can be determined.
  • the target quantization cost of the floating-point type ALF coefficient of the first ALF is determined.
  • the first quantization scale with the smallest quantization cost is determined as the target quantization cost of the floating point type ALF coefficients of the first ALF.
  • the ALF coefficients of the floating point type of the first ALF are quantized into the ALF coefficients of the integer type:
  • AlfCoeff integer round(AlfCoeff float ⁇ 2 Alfshift ) (10)
  • AlfCoeff integer is an ALF coefficient of integer type
  • AlfCoeff float is an ALF coefficient of floating point type of the first ALF
  • round is a rounding operation
  • 2 Alfshift is a target quantization scale.
  • S406 Encode the integer-type ALF coefficients of the first ALF to obtain a code stream.
  • the ALF coefficients of the integer type of the first ALF are encoded, carried in the code stream, and sent to the decoding end.
  • the decoding end decodes the residual value of the current image from the code stream, determines the reconstructed image of the current image according to the residual value, and decodes the integer type ALF coefficient of the first ALF from the code stream.
  • the integer-type ALF coefficients are used to filter the target area in the reconstructed image under the first component using the first ALF to improve the accuracy of the reconstructed image.
  • all integer-type ALF coefficients of the first ALF are included in the codestream.
  • the decoding end can directly decode all integer-type ALF coefficients of the first ALF from the code stream, which are used for later filtering without the need to calculate the amount of ALF coefficients, thereby improving the filtering efficiency of the decoding end.
  • the code stream includes integer-type second ALF coefficients of the first ALF and first information
  • the second ALF coefficients are integer-type ALF coefficients corresponding to non-central points in the first ALF
  • the first information is an integer-type ALF coefficient. to indicate the target quantization scale.
  • the decoding end needs to determine the first ALF coefficient of the first ALF according to the second ALF coefficient and the first information, and then according to The first ALF coefficient and the second ALF coefficient are used to filter the target area in the reconstructed image under the first component by using the first ALF, wherein the first ALF coefficient reference of the first ALF is determined according to the second ALF coefficient and the first information
  • the specific description of the decoding end above will not be repeated here.
  • the first information includes a target shift value corresponding to the target quantization scale. For example, if the target quantization scale is 2 Alfshift , the target shift value is Alfshift.
  • the first information includes the absolute value of the difference between the target shift value corresponding to the target quantization scale and the first numerical value. For example, if the target shift value corresponding to the target quantization scale is Alfshift and the first value is a, the first information includes
  • the first value is 6, 5, or 4, etc.
  • adaptive_filter_shift_enable_flag is the adaptive modification filter shape quantization scale flag, which is a binary variable.
  • a value of '1' indicates that the adaptive correction filtering can use a 7 ⁇ 7 cross plus a 5 ⁇ 5 square filter shape; a value of '0' indicates that the adaptive correction filtering uses a 7 ⁇ 7 cross plus a 3 ⁇ 3 square filter shape .
  • adaptive_filter_shift_enable_flag is the adaptive modification filter shift enable flag, which is a binary variable.
  • a value of '1' indicates that the solution of the present application is adopted, and the shift value of the adaptive correction filter changes; a value of '0' indicates that the solution of the present application is not adopted, and the shift value of the adaptive correction filter does not change, for example, still is 6.
  • AlfShiftEnableFlag is equal to the value of adaptive_filter_shift_enable_flag.
  • the first information in the code stream includes the shift information corresponding to the luminance component and the shift information corresponding to the chrominance component, as shown in the following table. 3 shows:
  • alf_luma_shift_num_minus6[i] is the coefficient shift of the adaptive correction filter corresponding to the image luminance component sample.
  • the luminance component may correspond to multiple adaptive correction filters, for example, 16 or 64.
  • alf_coeff_luma[i][j] represents the j-th ALF coefficient of the i-th adaptive correction filter corresponding to the luminance component, and the j-th ALF coefficient can be understood as the above-mentioned second ALF coefficient.
  • alf_luma_shift_num_minus6[i] represents the quantization scale shift value of the i-th adaptive correction filter corresponding to the luminance component minus 6, where 6 can be understood as the above-mentioned first value.
  • AlfLumaShift[i] alf_luma_shift_num_minus6[i]+6.
  • alf_coeff_chroma[0][j] represents the jth ALF parameter of the adaptive correction filter corresponding to the Cb component.
  • the jth ALF coefficient can be understood as the above-mentioned second ALF coefficient.
  • alf_chroma_shift_num_minus6[0] represents the quantization scale shift value of the adaptive correction filter corresponding to the Cb component minus 6.
  • AlfChromaShift[0] alf_chroma_shift_num_minus6[0]+6.
  • alf_coeff_chroma[1][j] represents the jth ALF parameter of the adaptive correction filter corresponding to the Cr component.
  • the jth ALF coefficient can be understood as the above-mentioned second ALF coefficient.
  • alf_chroma_shift_num_minus6[1] represents the quantization scale shift value of the adaptive correction filter corresponding to the Cr component minus 6.
  • AlfChromaShift[1] alf_chroma_shift_num_minus6[1]+6.
  • the present application further includes: filtering the target region of the reconstructed image under the first component using integer-type ALF coefficients of the first AFL.
  • I rec(0,0) ' is the reconstructed pixel value filtered by the current point (0,0) in the target area
  • (x, y) is the position relative to the current point
  • W j is the jth of the first ALF ALF coefficients of integer type
  • W n-1 is the ALF coefficient of integer type corresponding to the center point of the first ALF
  • I rec(0,0) is the reconstructed pixel value of the current point
  • Alfshif is the target shift corresponding to the target quantization scale Bit value
  • n is the number of ALF coefficients included in the first ALF.
  • the first ALF when the shape of the first ALF is a 7 ⁇ 7 cross plus a 3 ⁇ 3 square as shown in FIG. 5A , the first ALF includes 9 ALF coefficients, where (x, y) takes the same value as Wj The corresponding relationship is shown in Table 4 below:
  • the first ALF when the shape of the first ALF is a 7 ⁇ 7 cross plus a 5 ⁇ 5 square as shown in FIG. 5B , the first ALF includes 15 ALF coefficients, where (x, y) takes the same value as Wj
  • Table 5 The corresponding relationship is shown in Table 5 below:
  • the encoder can firstly encode the integer-type ALF coefficients of the first ALF, and then use the integer-type ALF coefficients of the first AFL to filter the target area of the reconstructed image under the first component, or First use the ALF coefficients of the integer type of the first AFL to filter the target area of the reconstructed image under the first component, and then encode the ALF coefficients of the integer type of the first AFL, or use the integer type of the first AFL.
  • the ALF coefficients of the first ALF are encoded with the integer type ALF coefficients of the first ALF while filtering the target area of the reconstructed image under the first component.
  • the floating-point ALF coefficient of the first ALF is determined, and the floating-point ALF coefficient of the first ALF is determined according to the floating-point ALF coefficient of the first ALF.
  • the maximum quantization scale of the floating-point type ALF coefficients of the first ALF is determined.
  • the target quantization scale of the floating-point type ALF coefficients of the first ALF is determined.
  • the ALF coefficients of the floating point type of the first ALF are quantized into ALF coefficients of the integer type.
  • the present application Compared with the current use of a fixed quantization scale to quantize the ALF coefficients of the floating point type of the first ALF, the present application considers The range of floating-point type ALF coefficients derived from different regions or different frames may be different, resulting in the problem that the filter gain may also be different.
  • the variable quantization scale is used to quantize the ALF coefficients corresponding to different target regions, so that after quantization, the ALF coefficients corresponding to different target regions are quantized.
  • the ALF coefficients can achieve a better balance between coding filter coefficient overhead and filter gain.
  • Tongjia 4K represents the test video with 4K resolution, and its resolution is 3840x2160
  • Tongyi 1080p represents the test video with 1080p resolution
  • its resolution is 1920x1080
  • Tong Bing 720p means the test video of 720p resolution
  • its resolution is 1280x720.
  • EncT is the ratio of the encoding time of the application to the encoding time of the original algorithm
  • DecT is the ratio of the decoding time of the application to the decoding time of the original algorithm.
  • BD-Rate is one of the main parameters for evaluating the performance of a video coding algorithm, which indicates that the video encoded by the new algorithm (that is, the technical solution of the present application) has a higher bit rate and PSNR (Peak Signal to Noise Ratio, peak signal-to-noise ratio) than the original algorithm.
  • PSNR Peak Signal to Noise Ratio, peak signal-to-noise ratio
  • the change in the above that is, the change in the code rate of the new algorithm and the original algorithm under the same signal-to-noise ratio.
  • "-" indicates performance improvement, such as bit rate and PSNR performance improvement.
  • Table 6 under the condition of All intra configuration, the average changes of BD-rate on Y, Cb, and Cr components are -0.14%, 0.01%, and -0.00%, respectively.
  • test sequence required by AVS3 is tested under the configuration conditions of both intra-frame and inter-frame (Random Access), and the test results are shown in Table 7:
  • the coding end increases with very little computational complexity and the decoding end complexity remains unchanged, which brings additional performance gains to the ALF design.
  • FIG. 6 is another schematic flowchart of a video encoding method 600 provided by an embodiment of the present application. Taking the first component as a luminance component as an example, as shown in FIG. 6 , it includes:
  • a preset area division rule perform area division on the reconstructed image under the luminance component to obtain a target area to be filtered.
  • the preset area division rule is to divide the reconstructed image under the luminance component into 16 areas, so that the reconstructed image under the luminance component is divided into 16 areas according to a preset division method (eg, uniform division).
  • the preset area division rule is to divide the reconstructed image under the luminance component into 64 areas, so that the reconstructed image under the luminance component is divided into 64 areas according to a preset division method (eg, uniform division).
  • S604 Determine the maximum quantization scale of the ALF coefficients of the floating-point number type of the first ALF according to the ALF coefficients of the floating-point number type of the first ALF.
  • S605. Determine, according to the maximum quantization scale, the target quantization scale of the ALF coefficients of the floating point type of the first ALF.
  • S607 Encode the integer-type ALF coefficients of the first ALF to obtain a code stream.
  • S608 and S607 have no sequence in the execution process, and S608 may be executed before S607, may be executed after S607, or may be executed simultaneously with S607.
  • the present application may only use the variable quantization scale of the present application to perform ALF coefficient quantization on the luminance component of the reconstructed image, while the chrominance component of the reconstructed image still uses the current fixed quantization scale, such as 2 6 .
  • the encoder carries the variable quantization scale information corresponding to the luminance component in the code stream and sends it to the decoder, but does not carry the quantization scale corresponding to the chrominance component in the code stream.
  • the definition of adaptive correction filtering parameters is shown in Table 8.
  • variable quantization scale information corresponding to the luminance component is parsed from Table 8, and the variable quantization scale information can be the difference between the target shift value corresponding to the target quantization scale and the first numerical value.
  • Absolute value in this way, the decoding end can determine the absolute value of the difference between the target shift value corresponding to the target quantization scale and the first value according to the second ALF coefficient corresponding to the luminance component (ie alf_coeff_luma[i][j])
  • the first ALF coefficient of the first ALF is obtained, and then the first ALF is used to filter the target area in the reconstructed image under the luminance component according to the first ALF coefficient and the second ALF coefficient of the first ALF, so as to improve the filtering accuracy.
  • variable quantization scale information corresponding to the chrominance component is not resolved at the decoding end in Table 8, the decoding end uses the fixed quantization scale information, such as a fixed shift value of 6, to filter the reconstructed image under the chrominance component. .
  • the decoding end can determine the first ALF according to the second ALF coefficient corresponding to the chrominance component in Table 6 (ie alf_coeff_chroma[0][j] or alf_coeff_chroma[1][j]) and the fixed shift value 6 Then, according to the first ALF coefficient and the second ALF coefficient of the first ALF, the first ALF is used to filter the target area in the reconstructed image under the luminance component, so as to improve the filtering accuracy.
  • FIG. 7 is another schematic flowchart of a video encoding method 700 provided by an embodiment of the present application. Taking the first component as a luminance component as an example, as shown in FIG. 7 , the method includes:
  • the reconstructed image includes chrominance components, wherein the chrominance components include a first chrominance component and/or include a second chrominance component, wherein the first chrominance component is, for example, U or Cb, and the first chrominance component is U or Cb.
  • Two chrominance components such as V or Cr.
  • S703 Determine the ALF coefficient of the floating point type of the first ALF when the target area under the chrominance component is filtered using the first ALF.
  • S704. Determine the maximum quantization scale of the ALF coefficients of the floating-point number type of the first ALF according to the ALF coefficients of the floating-point number type of the first ALF.
  • S705. Determine, according to the maximum quantization scale, the target quantization scale of the ALF coefficients of the floating point type of the first ALF.
  • S707 Encode the integer-type ALF coefficients of the first ALF to obtain a code stream.
  • S708 and S707 have no sequence in the execution process, and S708 may be executed before S707, or after S707, and may also be executed simultaneously with S707.
  • the present application may only use the variable quantization scale of the present application to perform ALF coefficient quantization on the first chrominance component of the reconstructed image, while the second chrominance component and luminance component of the reconstructed image still use the currently fixed quantization scale.
  • Quantization scale eg 2 6 .
  • the encoder carries the variable quantization scale information corresponding to the first chrominance component in the code stream and sends it to the decoder, but does not carry the quantization corresponding to the second chrominance component and the luminance component in the code stream scale.
  • Table 9 the definition of adaptive correction filtering parameters is shown in Table 9:
  • variable quantization scale information corresponding to the first chrominance component is parsed from Table 9, and the ALF coefficient of the first ALF is determined according to the variable quantization scale information corresponding to the first chrominance component, And according to the determined ALF coefficient of the first ALF, the first ALF is used to filter the reconstructed image under the first chrominance component, so as to improve the filtering precision.
  • the decoding end uses an existing method to determine the ALF coefficient corresponding to the second chrominance component and/or the luminance component, and uses the determined ALF coefficient to filter the reconstructed image under the second chrominance component and/or the luminance component.
  • the present application may only use the variable quantization scale of the present application to perform ALF coefficient quantization on the second chrominance component of the reconstructed image, while the first chrominance component and luminance component of the reconstructed image still use the currently fixed Quantization scale, eg 2 6 .
  • the encoder carries the variable quantization scale information corresponding to the second chrominance component in the code stream and sends it to the decoder, but does not carry the quantization corresponding to the first chrominance component and the luminance component in the code stream scale.
  • the definition of adaptive correction filtering parameters is shown in Table 10:
  • variable quantization scale information corresponding to the second chrominance component is parsed from Table 10, and the ALF coefficient of the first ALF is determined according to the variable quantization scale information corresponding to the second chrominance component, And according to the determined ALF coefficient of the first ALF, the first ALF is used to filter the reconstructed image under the second chrominance component, so as to improve the filtering precision.
  • the decoding end uses an existing method to determine the ALF coefficient corresponding to the first chrominance component and/or the luminance component, and uses the determined ALF coefficient to filter the reconstructed image under the first chrominance component and/or the luminance component.
  • the present application may only perform ALF coefficient quantization on the chrominance components of the reconstructed image (including the first chrominance component and the second chrominance component) using the variable quantization scale of the present application, while the luminance of the reconstructed image
  • the components still use the current fixed quantization scale, for example, 2 6 .
  • the encoder carries the variable quantization scale information corresponding to the chrominance component in the code stream and sends it to the decoder, but does not carry the quantization scale corresponding to the luminance component in the code stream.
  • the definition of adaptive correction filtering parameters is shown in Table 11.
  • the decoding end parses out the variable quantization scale information corresponding to the first chrominance component and the second chrominance component from Table 11.
  • the ALF coefficient corresponding to the first chrominance component is determined according to the variable quantization scale information corresponding to the first chrominance component, and the reconstructed image under the first chrominance component is filtered according to the determined ALF coefficient.
  • the ALF coefficient corresponding to the second chrominance component is determined according to the variable quantization scale information corresponding to the second chrominance component, and the reconstructed image under the second chrominance component is filtered according to the determined ALF coefficient.
  • the decoding end uses the existing method to determine the ALF coefficient corresponding to the luminance component, and uses the determined ALF coefficient to filter the reconstructed image under the luminance component.
  • the video encoding method involved in the embodiments of the present application is described above. Based on this, the following describes the video decoding method involved in the present application for the decoding end.
  • FIG. 8 is a schematic flowchart of a video decoding method 800 provided by an embodiment of the present application. As shown in FIG. 8 , the method of the embodiment of the present application includes:
  • the entropy decoding unit 310 in the decoder can parse the code stream to obtain prediction information, quantization coefficient matrix, etc. of the current block in the current image, and the prediction unit 320 uses intra prediction or Inter prediction produces a predicted block for the current block.
  • the inverse quantization/transform unit 330 performs inverse quantization and inverse transformation on the quantized coefficient matrix using the quantized coefficient matrix obtained from the code stream to obtain a residual block.
  • the reconstruction unit 340 adds the prediction block and the residual block to obtain a reconstructed block.
  • the reconstructed blocks of other image blocks in the current image can be obtained, and each reconstructed block constitutes a reconstructed image.
  • the reconstructed image includes a first component, which is a luminance component or a chrominance component.
  • an adaptive correction filter switch when the adaptive correction filter switch corresponding to the target area of the reconstruction area under the first component is on, for example, the control signal of the switch is 1, it means that the reconstruction area under the first component is The target region is filtered using the first ALF. If the adaptive correction filter switch corresponding to the target area of the reconstruction area under the first component is off, for example, the control signal of the switch is 0, it means that the target area of the reconstruction area under the first component is not subjected to adaptive correction filtering.
  • the code stream is decoded to obtain the ALF coefficient information of the first ALF carried in the code stream.
  • the target region in the reconstructed image under the first component is filtered using the first ALF according to the ALF coefficient information of the first ALF.
  • the ALF coefficient information of the first ALF includes all integer-type ALF coefficients of the first ALF.
  • the decoding end directly uses the first ALF to filter the target region in the reconstructed image under the first component according to all integer-type ALF coefficients of the first ALF decoded, and the filtering process is simple.
  • the ALF coefficient information of the first ALF includes an integer-type second ALF coefficient of the first ALF and the first information, wherein the second ALF coefficient is an integer-type ALF corresponding to a non-center point in the first ALF coefficient, the first information is used to indicate the target quantization scale.
  • the first information includes a target shift value corresponding to the target quantization scale.
  • the first information includes the absolute value of the difference between the target shift value corresponding to the target quantization scale and the first numerical value.
  • the above S804 includes the following steps S804-A1 and S804-A2:
  • the code stream includes the second ALF coefficient of the first ALF and the target quantization scale information, so that the center position of the first ALF can be determined according to the second ALF coefficient of the first ALF and the target quantization scale information.
  • the first ALF coefficient of the first ALF can be determined according to the following formula (12):
  • AlfCoeffLuma[i][k] is the first ALF coefficient of the first ALF, and k is the number of ALF coefficients included in the first ALF minus one.
  • AlfLumaShift[i] is the target quantization scale corresponding to the first ALF
  • AlfCoeffLuma[i][j ] is the jth second ALF coefficient in the first ALF.
  • the decoder decodes the second ALF coefficient of the first ALF from the code stream, and determines the first ALF coefficient according to the above formula (12). coefficient, and the first ALF is used to filter the target area in the reconstructed image under the first component, thereby improving the accuracy of the reconstructed image.
  • the decoder filters the target region in the reconstructed image under the first component according to the following formula (13):
  • I rec(0,0) ′ is the reconstructed pixel value of the current point (0,0) in the target area after filtering
  • (x, y) is the position relative to the current point
  • W j is the jth of the first ALF ALF coefficients of integer type
  • W n-1 is the ALF coefficient of integer type corresponding to the center point of the first ALF
  • I rec(0,0) is the reconstructed pixel value of the current point
  • Alfshif is the target shift corresponding to the target quantization scale Bit value
  • n is the number of ALF coefficients included in the first ALF.
  • the filtered reconstructed image can be sent to the display device for display, and on the other hand, the filtered reconstructed image can be stored in the decoded image buffer for subsequent frames as inter-frame prediction. frame of reference.
  • FIG. 9 is a schematic flowchart of a video decoding method 900 provided by an embodiment of the present application.
  • the method of the embodiment of the present application includes:
  • S903 Divide the reconstructed image under the luminance component into regions to obtain a target area of the reconstructed image under the luminance component, where the target area is an area using adaptive correction filtering.
  • the ALF coefficient information of the first ALF includes an integer-type second ALF coefficient of the first ALF and the first information, wherein the second ALF coefficient is an integer-type ALF coefficient corresponding to a non-center point in the first ALF,
  • the first information is used to indicate the target quantization scale.
  • the shape information of the first ALF by parsing the code stream, and determine the type of the first ALF according to the shape information of the first ALF. If the shape of the first ALF is the shape of a 7 ⁇ 7 cross plus a 3 ⁇ 3 square filter, the first ALF includes 9 ALF coefficients; if the shape of the first ALF is a 7 ⁇ 7 cross plus 5 ⁇ 5 square filter shape, the first ALF includes 15 ALF coefficients.
  • S906 Determine the first ALF coefficient of the first ALF according to the second ALF coefficient of the first ALF and the target quantization scale, where the first ALF coefficient is an integer type ALF coefficient corresponding to the center point of the first ALF.
  • AlfCoeffLuma[i][8] is the first ALF coefficient of the first ALF
  • i is the number of ALFs corresponding to the luminance component, such as 16 or 64
  • AlfCoeffLuma[i][j] is the i-th first ALF
  • alf_filter_num_minus1 is the number of ALFs corresponding to the luminance component minus one
  • alf_filter_num_minus1 can be understood as p.
  • the bit width of AlfCoeffLuma[i][j] is 7 bits, the value range is -64 to 63, and the value range of AlfCoeffLuma[i][8] is 0 to 127.
  • the decoder filters the target area in the reconstructed image under the first component according to the following formula (16):
  • I rec(0,0) ′ is the reconstructed pixel value of the current point (0,0) in the target area after filtering
  • (x, y) is the position relative to the current point
  • W j is the jth of the first ALF a second ALF coefficient
  • W n-1 is the first ALF coefficient
  • I rec(0,0) is the reconstructed pixel value of the current point
  • Alfshif is the target shift value corresponding to the target quantization scale
  • n is the first ALF included The number of ALF coefficients.
  • FIG. 10 is a schematic flowchart of a video decoding method 1000 provided by an embodiment of the present application.
  • the method of the embodiment of the present application includes:
  • the ALF coefficient information of the first ALF includes an integer-type second ALF coefficient of the first ALF and the first information, wherein the second ALF coefficient is an integer-type ALF coefficient corresponding to a non-center point in the first ALF,
  • the first information is used to indicate the target quantization scale.
  • S160 Determine the first ALF coefficient of the first ALF according to the second ALF coefficient of the first ALF and the target quantization scale, where the first ALF coefficient is an integer type ALF coefficient corresponding to the center point of the first ALF.
  • the first ALF coefficient of the first ALF is determined according to the following method.
  • AlfCoeffLuma[0][8] is the first ALF coefficient of the first ALF
  • AlfCoeffLuma[0][j] is the jth ALF coefficient of the first ALF
  • j 0 ⁇ 7.
  • the bit width of AlfCoeffLuma[0][j] is 7 bits, the value range is -64 to 63, and the value range of AlfCoeffLuma[0][8] is 0 to 127.
  • the first ALF coefficient of the first ALF is determined according to the following method.
  • AlfCoeffLuma[1][8] is the first ALF coefficient of the first ALF
  • AlfCoeffLuma[1][j] is the jth ALF coefficient of the first ALF
  • j 0 ⁇ 7.
  • the bit width of AlfCoeffLuma[1][j] is 7 bits, the value range is -64 to 63, and the value range of AlfCoeffLuma[1][8] is 0 to 127.
  • the filtered reconstructed image can be sent to the display device for display, and on the other hand, the filtered reconstructed image can be stored in the decoded image buffer for subsequent frames as inter-frame prediction. frame of reference.
  • FIG. 4 to FIG. 10 are only examples of the present application, and should not be construed as limiting the present application.
  • the present application determines that the quantization scale corresponding to the luminance component is larger than the quantization scale corresponding to the chrominance component. For example, the quantization scale corresponding to the luminance component is fixed to 2 7 , and the quantization scale corresponding to the chrominance component is fixed to 2 6 , so that Adjusting the fixed quantization scale can also improve filtering performance, and no bit overhead is required to encode the variable quantization scale.
  • the size of the sequence numbers of the above-mentioned processes does not mean the sequence of execution, and the execution sequence of each process should be determined by its functions and internal logic, and should not be dealt with in the present application.
  • the implementation of the embodiments constitutes no limitation.
  • the term "and/or" is only an association relationship for describing associated objects, indicating that there may be three kinds of relationships. Specifically, A and/or B can represent three situations: A exists alone, A and B exist at the same time, and B exists alone.
  • the character "/" in this document generally indicates that the related objects are an "or" relationship.
  • FIG. 11 is a schematic block diagram of a video encoder 10 provided by an embodiment of the present application.
  • the video encoder 10 includes:
  • an obtaining unit 110 configured to obtain a reconstructed image of the current image, where the reconstructed image includes a first component, and the first component is a luminance component or a chrominance component;
  • a first determining unit 120 configured to determine, when filtering the target region in the reconstructed image under the first component using the first adaptive correction filter ALF, an ALF coefficient of the floating point type of the first ALF ;
  • a second determining unit 130 configured to determine the maximum quantization scale of the ALF coefficients of the floating point type of the first ALF according to the ALF coefficients of the floating point type of the first ALF;
  • a third determining unit 140 configured to determine, according to the maximum quantization scale, a target quantization scale of the floating-point type ALF coefficient of the first ALF, where the target quantization scale is less than or equal to the maximum quantization scale;
  • a quantization unit 150 configured to use the target quantization scale to quantize the floating-point ALF coefficients of the first ALF into integer-type ALF coefficients
  • the encoding unit 160 is configured to encode the integer-type ALF coefficients of the first ALF to obtain a code stream.
  • the second determining unit 130 is specifically configured to determine, according to a first coefficient in the floating-point type ALF coefficients of the first ALF and a maximum integer coefficient threshold corresponding to the first coefficient The maximum shift value allowed when the ALF coefficient of the floating point type is quantized into an integer type; according to the maximum shift value, the maximum quantization scale of the ALF coefficient of the floating point type of the first ALF is determined.
  • the first coefficient is a floating-point type coefficient corresponding to the center position of the first ALF.
  • the second determining unit 130 is specifically configured to determine the maximum shift value according to the following formula:
  • the d is 127.
  • the second determining unit 130 is specifically configured to determine the maximum quantization scale of the ALF coefficients of the floating point type of the first ALF according to the following formula:
  • Scale max is the maximum quantization scale.
  • the third determining unit 140 is specifically configured to determine the first quantization scale as the target quantization scale of the floating-point ALF coefficient of the first ALF , the first quantization scale is smaller than or equal to the maximum quantization scale.
  • the third determining unit 140 is further configured to determine the second quantization scale as the target quantization scale of the ALF coefficients of the floating point type of the second ALF, where the second ALF is a pair of all the chrominance components.
  • a filter used when performing ALS filtering on the reconstructed image, and the second quantization scale is smaller than the first quantization scale.
  • the third determining unit 140 is specifically configured to determine the third quantization scale as the target of the floating-point type ALF coefficient of the first ALF a quantization scale, the third quantization scale is smaller than the maximum quantization scale.
  • the third determining unit 140 is further configured to determine the fourth quantization scale as the target quantization scale of the floating-point type ALF coefficient of the third ALF, where the third ALF is the A filter used when performing ALS filtering on the reconstructed image, where the fourth quantization scale is larger than the third quantization scale.
  • the third determining unit 140 is specifically configured to, for each first quantization scale in the quantization interval formed by the maximum quantization scale and the preset minimum quantization scale, determine the quantization of the first quantization scale cost, the first quantization scale is a positive integer of the power of 2; according to the quantization cost of each first quantization scale, the target quantization cost of the ALF coefficient of the floating point type of the first ALF is determined.
  • the third determining unit 140 is specifically configured to determine the first quantization scale with the smallest quantization cost as the target quantization cost of the floating-point type ALF coefficient of the first ALF.
  • the third determining unit 140 is specifically configured to use the first quantization scale to quantize the ALF coefficients of the floating point type of the first ALF into the first ALF coefficients of the integer type; determine to use When the first ALF coefficient encodes the target area of the reconstructed image, the quantization distortion result corresponding to the first ALF coefficient; and encoding the first ALF according to the quantization distortion result corresponding to the first ALF coefficient The number of bits consumed by the coefficient determines the quantization cost of the first quantization scale.
  • the third determining unit 140 is specifically configured to determine the autocorrelation coefficient of the pixels in the target area according to the reconstructed pixel values of the pixels in the target area; The original pixel value, determine the cross-correlation coefficient of the pixels in the target area; according to the product of the autocorrelation coefficient of the pixels in the target area and the first ALF coefficient, and the cross-correlation coefficient of the pixels in the target area , and determine the quantization distortion result corresponding to the first ALF coefficient.
  • the third determining unit 140 is specifically configured to use the first ALF coefficient to filter the target area of the reconstructed image; according to the filtered pixel value and the original pixel value of the pixel in the target area The difference value of , determines the quantization distortion result corresponding to the first ALF coefficient.
  • the third determining unit 140 is specifically configured to determine the quantization cost of the first quantization scale according to the following formula:
  • the J is the quantization cost of the first quantization scale
  • the D is the quantization distortion result corresponding to the first ALF coefficient
  • the R is the number of bits consumed by encoding the first ALF coefficient
  • the The ⁇ is a variable value.
  • the codestream includes all integer-type ALF coefficients of the first ALF.
  • the code stream includes a second ALF coefficient of an integer type of the first ALF and first information, and the second ALF coefficient is an integer type corresponding to a non-central point in the first ALF
  • the ALF coefficient, the first information is used to indicate the target quantization scale.
  • the first information includes a target shift value corresponding to the target quantization scale.
  • the first information includes the absolute value of the difference between the target shift value corresponding to the target quantization scale and the first numerical value.
  • the first numerical value is 6, 5 or 4.
  • the encoding unit 160 is further configured to use the integer-type ALF coefficients of the first AFL to filter the target area of the reconstructed image under the first component.
  • the encoding unit 160 is specifically configured to filter the target area of the reconstructed image under the first component according to the following formula:
  • the I rec(0,0) ' is the reconstructed pixel value after filtering by the current point (0,0) in the target area
  • the (x, y) is the position relative to the current point
  • the W j is the ALF coefficient of the jth integer type of the first ALF
  • the W n-1 is the ALF coefficient of the integer type corresponding to the center point of the first ALF
  • the I rec(0,0 ) is the reconstructed pixel value of the current point
  • the Alfshif is the target shift value corresponding to the target quantization scale
  • the n is the number of ALF coefficients included in the first ALF.
  • the apparatus embodiments and the method embodiments may correspond to each other, and similar descriptions may refer to the method embodiments. To avoid repetition, details are not repeated here.
  • the video encoder 10 shown in FIG. 11 can perform the methods of the embodiments of the present application, and the aforementioned and other operations and/or functions of the various units in the video encoder 10 are for implementing the methods 400, 600, and 700, respectively. For the sake of brevity, the corresponding processes in the method will not be repeated here.
  • FIG. 12 is a schematic block diagram of a video decoder 20 provided by an embodiment of the present application.
  • the video decoder 20 may include:
  • the first decoding unit 210 is used for decoding the code stream to obtain the residual value of the current image
  • a determining unit 220 configured to determine a reconstructed image of the current image according to the residual value of the current image, where the reconstructed image includes a first component, and the first component is a luminance component or a chrominance component;
  • the second decoding unit 230 is configured to decode the code stream to obtain the ALF coefficient information of the first adaptive correction filter ALF corresponding to the target area in the reconstructed image under the first component;
  • the filtering unit 240 is configured to use the first ALF to filter the target area in the reconstructed image under the first component according to the ALF coefficient information of the first ALF.
  • the ALF coefficient information of the first ALF includes all integer-type ALF coefficients of the first ALF.
  • the ALF coefficient information of the first ALF includes an integer-type second ALF coefficient of the first ALF and first information, and the second ALF coefficient is a non-center point in the first ALF Corresponding integer type ALF coefficients, the first information is used to indicate the target quantization scale.
  • the first information includes a target shift value corresponding to the target quantization scale.
  • the first information includes the absolute value of the difference between the target shift value corresponding to the target quantization scale and the first numerical value.
  • the first numerical value is 6, 5 or 4.
  • the filtering unit 240 is specifically configured to determine the first ALF coefficient of the first ALF according to the second ALF coefficient of the first ALF and the target quantization scale, where the first ALF coefficient is The integer-type ALF coefficient corresponding to the center point of the first ALF; according to the second ALF coefficient and the first ALF coefficient of the first ALF, use the first ALF to perform a downlink on the first component.
  • the target region in the reconstructed image is filtered.
  • the filtering unit 240 is specifically configured to determine the first ALF coefficient of the first ALF according to the following formula:
  • the AlfCoeffLuma[i][k] is the first ALF coefficient of the i-th first ALF
  • the k is the number of ALF coefficients included in the first ALF minus one
  • the first ALF The AlfLumaShift[i] is the target quantization scale corresponding to the first ALF
  • the AlfCoeffLuma[i][j] is the jth second ALF coefficient in the first ALF.
  • the i value ranges from 0 to p
  • the p is the number of ALFs corresponding to the luminance component minus one.
  • the p is 15 or 63.
  • the i is equal to the first value
  • the first component is the Cr component
  • the first value is 0 and the second value is 1.
  • the second decoding unit 230 is specifically configured to parse and obtain the shape information of the first ALF from the code stream; and determine the type of the first ALF according to the shape information of the first ALF .
  • the first ALF includes 9 ALF coefficients; if the shape of the first ALF is A 7x7 cross plus a 5x5 square filter shape, the first ALF includes 15 ALF coefficients.
  • the filtering unit 240 is specifically configured to filter the target area in the reconstructed image under the first component according to the following formula:
  • the I rec(0,0) ′ is the reconstructed pixel value filtered by the current point (0,0) in the target area, and the (x, y) is the position relative to the current point, so
  • the W j is the ALF coefficient of the jth integer type of the first ALF
  • the W n-1 is the ALF coefficient of the integer type corresponding to the center point of the first ALF
  • the I rec(0,0 ) is the reconstructed pixel value of the current point
  • the Alfshi is the target shift value corresponding to the target quantization scale
  • the n is the number of ALF coefficients included in the first ALF.
  • the apparatus embodiments and the method embodiments may correspond to each other, and similar descriptions may refer to the method embodiments. To avoid repetition, details are not repeated here.
  • the video decoder 20 shown in FIG. 20 may correspond to the corresponding subject in performing the method 800 or 900 or 1000 of the embodiments of the present application, and the aforementioned and other operations and/or functions of the respective units in the video decoder 20 In order to implement the corresponding processes in each method such as method 800 or 900 or 1000, for the sake of brevity, details are not repeated here.
  • the functional unit may be implemented in the form of hardware, may also be implemented by an instruction in the form of software, or may be implemented by a combination of hardware and software units.
  • the steps of the method embodiments in the embodiments of the present application may be completed by hardware integrated logic circuits in the processor and/or instructions in the form of software, and the steps of the methods disclosed in conjunction with the embodiments of the present application may be directly embodied as hardware
  • the execution of the decoding processor is completed, or the execution is completed by a combination of hardware and software units in the decoding processor.
  • the software unit may be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, and other storage media mature in the art.
  • the storage medium is located in the memory, and the processor reads the information in the memory, and completes the steps in the above method embodiments in combination with its hardware.
  • FIG. 13 is a schematic block diagram of an electronic device 30 provided by an embodiment of the present application.
  • the electronic device 30 may be the video encoder or the video decoder described in this embodiment of the application, and the electronic device 30 may include:
  • the processor 32 can call and run the computer program 34 from the memory 33 to implement the method in the embodiment of the present application.
  • the processor 32 may be configured to perform the steps of the method 200 described above according to instructions in the computer program 34 .
  • the processor 32 may include, but is not limited to:
  • DSP Digital Signal Processor
  • ASIC Application Specific Integrated Circuit
  • FPGA Field Programmable Gate Array
  • the memory 33 includes but is not limited to:
  • Non-volatile memory may be a read-only memory (Read-Only Memory, ROM), a programmable read-only memory (Programmable ROM, PROM), an erasable programmable read-only memory (Erasable PROM, EPROM), an electrically programmable read-only memory (Erasable PROM, EPROM). Erase programmable read-only memory (Electrically EPROM, EEPROM) or flash memory. Volatile memory may be Random Access Memory (RAM), which acts as an external cache.
  • RAM Random Access Memory
  • RAM Static RAM
  • DRAM Dynamic RAM
  • SDRAM Synchronous DRAM
  • SDRAM double data rate synchronous dynamic random access memory
  • Double Data Rate SDRAM DDR SDRAM
  • enhanced SDRAM ESDRAM
  • synchronous link dynamic random access memory SLDRAM
  • Direct Rambus RAM Direct Rambus RAM
  • the computer program 34 may be divided into one or more units, and the one or more units are stored in the memory 33 and executed by the processor 32 to complete the procedures provided by the present application.
  • the one or more units may be a series of computer program instruction segments capable of performing specific functions, and the instruction segments are used to describe the execution process of the computer program 34 in the electronic device 30 .
  • the electronic device 30 may further include:
  • a transceiver 33 which can be connected to the processor 32 or the memory 33 .
  • the processor 32 can control the transceiver 33 to communicate with other devices, specifically, can send information or data to other devices, or receive information or data sent by other devices.
  • the transceiver 33 may include a transmitter and a receiver.
  • the transceiver 33 may further include antennas, and the number of the antennas may be one or more.
  • each component in the electronic device 30 is connected through a bus system, wherein the bus system includes a power bus, a control bus and a status signal bus in addition to a data bus.
  • FIG. 14 is a schematic block diagram of a video encoding and decoding system 40 provided by an embodiment of the present application.
  • the video encoding and decoding system 40 may include: a video encoder 41 and a video decoder 42 , wherein the video encoder 41 is used for executing the video encoding method involved in the embodiments of the present application, and the video decoder 42 is used for executing The video decoding method involved in the embodiments of the present application.
  • the present application also provides a computer storage medium on which a computer program is stored, and when the computer program is executed by a computer, enables the computer to execute the methods of the above method embodiments.
  • the embodiments of the present application further provide a computer program product including instructions, when the instructions are executed by a computer, the instructions cause the computer to execute the methods of the above method embodiments.
  • the computer program product includes one or more computer instructions.
  • the computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable device.
  • the computer instructions may be stored on or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions may be transmitted over a wire from a website site, computer, server or data center (eg coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (eg infrared, wireless, microwave, etc.) means to another website site, computer, server or data center.
  • the computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that includes one or more available media integrated.
  • the available media may be magnetic media (eg, floppy disk, hard disk, magnetic tape), optical media (eg, digital video disc (DVD)), or semiconductor media (eg, solid state disk (SSD)), and the like.
  • the disclosed system, apparatus and method may be implemented in other manners.
  • the device embodiments described above are only illustrative.
  • the division of the unit is only a logical function division.
  • multiple units or components may be combined or may be Integration into another system, or some features can be ignored, or not implemented.
  • the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
  • Units described as separate components may or may not be physically separated, and components shown as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

Provided are a video coding method and system, a video decoding method and system, a video coder and a video decoder. The video coding method comprises: by means of an ALF coefficient of a floating-point number type of a first ALF, determining the maximum quantization scale of the ALF coefficient of the floating-point number type of the first ALF; according to the maximum quantization scale, determining a target quantization scale of the ALF coefficient of the floating-point number type of the first ALF; using the target quantization scale to quantize the ALF coefficient of the floating-point number type of the first ALF as an ALF coefficient of an integer type; and coding the ALF coefficient of the integer type of the first ALF to obtain a code stream. The balance of gains brought by coding overheads of a filter coefficient and by a filter is realized, thereby improving the video coding and decoding effects.

Description

视频编解码方法与系统、及视频编码器与视频解码器Video encoding and decoding method and system, and video encoder and video decoder 技术领域technical field
本申请涉及视频编解码技术领域,尤其涉及一种视频编解码方法与系统、及视频编码器与视频解码器。The present application relates to the technical field of video encoding and decoding, and in particular, to a video encoding and decoding method and system, as well as a video encoder and a video decoder.
背景技术Background technique
数字视频技术可以并入多种视频装置中,例如数字电视、智能手机、计算机、电子阅读器或视频播放器等。随着视频技术的发展,视频数据所包括的数据量较大,为了便于视频数据的传输,视频装置执行视频压缩技术,以使视频数据更加有效的传输或存储。Digital video technology can be incorporated into a variety of video devices, such as digital televisions, smartphones, computers, e-readers or video players, and the like. With the development of video technology, the amount of data included in video data is relatively large. In order to facilitate the transmission of video data, video devices implement video compression technology to enable more efficient transmission or storage of video data.
在视频压缩过程中会带来误差,为了降低误差,对重建图像进行滤波,例如,使用自适应修正滤波器对重建图像进行滤波,以最小化重建图像与原始图像之间的均方误差。在使用自适应修正滤波器(以下简称ALF)进行滤波时,目前采集固定的量化尺度,将ALF的浮点类型的系数量化为整数类型。Errors are introduced in the video compression process. In order to reduce the error, the reconstructed image is filtered, for example, the reconstructed image is filtered using an adaptive correction filter to minimize the mean square error between the reconstructed image and the original image. When an adaptive correction filter (hereinafter referred to as ALF) is used for filtering, a fixed quantization scale is currently collected, and the coefficients of the floating point type of the ALF are quantized into an integer type.
重建图像的不同的区域或不同的帧的重建图像导出的浮点数类型的ALF系数范围可能不同,且滤波增益可能也不同。但是,使用固定的量化尺度对浮点类型的系数进行量化时,使得滤波器系数的编码开销和滤波器带来的增益无法达到平衡。Different regions of the reconstructed image or reconstructed images of different frames may have different ranges of ALF coefficients of floating point type derived, and may also have different filter gains. However, when a fixed quantization scale is used to quantize the floating-point type coefficients, the coding overhead of the filter coefficients and the gain brought by the filter cannot be balanced.
发明内容SUMMARY OF THE INVENTION
本申请实施例提供了一种视频编解码方法与系统、及视频编码器与视频解码器,实现滤波器系数的编码开销和滤波器带来的增益的平衡。Embodiments of the present application provide a video encoding and decoding method and system, as well as a video encoder and a video decoder, to achieve a balance between the encoding overhead of filter coefficients and the gain brought by the filter.
第一方面,本申请提供了一种视频编码方法,包括:In a first aspect, the present application provides a video encoding method, including:
获得当前图像的重建图像,所述重建图像包括第一分量,所述第一分量为亮度分量或色度分量;obtaining a reconstructed image of the current image, where the reconstructed image includes a first component, and the first component is a luminance component or a chrominance component;
确定对所述第一分量下的所述重建图像中的目标区域使用第一自适应修正滤波器ALF进行滤波时,所述第一ALF的浮点数类型的ALF系数;determining the ALF coefficient of the floating point type of the first ALF when the target area in the reconstructed image under the first component is filtered using the first adaptive correction filter ALF;
根据所述第一ALF的浮点数类型的ALF系数,确定所述第一ALF的浮点数类型的ALF系数的最大量化尺度;determining the maximum quantization scale of the ALF coefficients of the floating point type of the first ALF according to the ALF coefficients of the floating point type of the first ALF;
根据所述最大量化尺度,确定所述第一ALF的浮点数类型的ALF系数的目标量化尺度,所述目标量化尺度小于或等于所述最大量化尺度;According to the maximum quantization scale, determine the target quantization scale of the floating-point type ALF coefficient of the first ALF, where the target quantization scale is less than or equal to the maximum quantization scale;
使用所述目标量化尺度,将所述第一ALF的浮点数类型的ALF系数量化为整数类型的ALF系数;Using the target quantization scale, quantizing the floating-point type ALF coefficients of the first ALF into integer-type ALF coefficients;
对所述第一ALF的整数类型的ALF系数进行编码,得到码流。Encoding the integer-type ALF coefficients of the first ALF to obtain a code stream.
第二方面,本申请实施例提供一种视频解码方法,包括:In a second aspect, an embodiment of the present application provides a video decoding method, including:
解码码流,得到当前图像的残差值;Decode the code stream to obtain the residual value of the current image;
根据所述当前图像的残差值,确定所述当前图像的重建图像,所述重建图像包括第一分量,所述第一分量为亮度分量或色度分量;determining a reconstructed image of the current image according to the residual value of the current image, where the reconstructed image includes a first component, and the first component is a luminance component or a chrominance component;
解码码流,得到所述第一分量下所述重建图像中的目标区域对应的第一自适应修正 滤波器ALF的ALF系数信息;Decoding code stream, obtains the ALF coefficient information of the first adaptive correction filter ALF corresponding to the target area in the described reconstruction image under the described first component;
根据所述第一ALF的ALF系数信息,使用所述第一ALF对所述第一分量下的所述重建图像中的目标区域进行滤波。According to the ALF coefficient information of the first ALF, the target area in the reconstructed image under the first component is filtered using the first ALF.
第三方面,本申请提供了一种视频编码器,用于执行上述第一方面或其各实现方式中的方法。具体地,该编码器包括用于执行上述第一方面或其各实现方式中的方法的功能单元。In a third aspect, the present application provides a video encoder for performing the method in the first aspect or each of its implementations. Specifically, the encoder includes a functional unit for executing the method in the above-mentioned first aspect or each of its implementations.
第四方面,本申请提供了一种视频解码器,用于执行上述第二方面或其各实现方式中的方法。具体地,该解码器包括用于执行上述第二方面或其各实现方式中的方法的功能单元。In a fourth aspect, the present application provides a video decoder for executing the method in the second aspect or each of its implementations. Specifically, the decoder includes functional units for performing the methods in the second aspect or the respective implementations thereof.
第五方面,提供了一种视频编码器,包括处理器和存储器。该存储器用于存储计算机程序,该处理器用于调用并运行该存储器中存储的计算机程序,以执行上述第一方面或其各实现方式中的方法。In a fifth aspect, a video encoder is provided, including a processor and a memory. The memory is used for storing a computer program, and the processor is used for calling and running the computer program stored in the memory, so as to execute the method in the above-mentioned first aspect or each implementation manner thereof.
第六方面,提供了一种视频解码器,包括处理器和存储器。该存储器用于存储计算机程序,该处理器用于调用并运行该存储器中存储的计算机程序,以执行上述第二方面或其各实现方式中的方法。In a sixth aspect, a video decoder is provided, including a processor and a memory. The memory is used for storing a computer program, and the processor is used for calling and running the computer program stored in the memory, so as to execute the method in the above-mentioned second aspect or each implementation manner thereof.
第七方面,提供了一种视频编解码系统,包括视频编码器和视频解码器。视频编码器用于执行上述第一方面或其各实现方式中的方法,视频解码器用于执行上述第二方面或其各实现方式中的方法。In a seventh aspect, a video encoding and decoding system is provided, including a video encoder and a video decoder. The video encoder is used to perform the method in the first aspect or each of its implementations, and the video decoder is used to perform the method in the above-mentioned second aspect or each of its implementations.
第八方面,提供了一种芯片,用于实现上述第一方面至第二方面中的任一方面或其各实现方式中的方法。具体地,该芯片包括:处理器,用于从存储器中调用并运行计算机程序,使得安装有该芯片的设备执行如上述第一方面至第二方面中的任一方面或其各实现方式中的方法。In an eighth aspect, a chip is provided for implementing any one of the above-mentioned first aspect to the second aspect or the method in each implementation manner thereof. Specifically, the chip includes: a processor for invoking and running a computer program from a memory, so that a device on which the chip is installed executes any one of the above-mentioned first to second aspects or each of its implementations method.
第九方面,提供了一种计算机可读存储介质,用于存储计算机程序,该计算机程序使得计算机执行上述第一方面至第二方面中的任一方面或其各实现方式中的方法。In a ninth aspect, a computer-readable storage medium is provided for storing a computer program, the computer program causing a computer to execute the method in any one of the above-mentioned first aspect to the second aspect or each of its implementations.
第十方面,提供了一种计算机程序产品,包括计算机程序指令,该计算机程序指令使得计算机执行上述第一方面至第二方面中的任一方面或其各实现方式中的方法。In a tenth aspect, a computer program product is provided, comprising computer program instructions, the computer program instructions causing a computer to perform the method in any one of the above-mentioned first to second aspects or the implementations thereof.
第十一方面,提供了一种计算机程序,当其在计算机上运行时,使得计算机执行上述第一方面至第二方面中的任一方面或其各实现方式中的方法。In an eleventh aspect, there is provided a computer program which, when run on a computer, causes the computer to perform the method in any one of the above-mentioned first to second aspects or the respective implementations thereof.
基于以上技术方案,在视频编码过程中,获得当前图像的重建图像;确定对第一分量下的重建图像中的目标区域使用第一ALF进行滤波时,第一ALF的浮点数类型的ALF系数;根据第一ALF的浮点数类型的ALF系数,确定第一ALF的浮点数类型的ALF系数的最大量化尺度;根据最大量化尺度,确定第一ALF的浮点数类型的ALF系数的目标量化尺度;使用目标量化尺度,将第一ALF的浮点数类型的ALF系数量化为整数类型的ALF系数;对第一ALF的整数类型的ALF系数进行编码,得到码流。即本申请根据第一ALF的浮点数类型的ALF系数的大小,确定ALF系数的目标量化尺度,使用该目标量化尺度来量化浮点数类型的ALF系数,这样当浮点数类型的ALF系数较大时,确定的ALF系数的目标量化尺度较大,进而使用目标量化尺度量化后的ALF系数对应的滤波增益较大,当浮点数类型的ALF系数较小时,确定的ALF系数的目标量化尺度较小,其编码开销较小,进而实现了滤波器系数的编码开销和滤波器带来的增益上的平 衡,进而提高了视频编解码的效果。Based on the above technical solutions, in the video encoding process, the reconstructed image of the current image is obtained; when the target area in the reconstructed image under the first component is filtered using the first ALF, the floating-point type ALF coefficient of the first ALF is determined; Determine the maximum quantization scale of the ALF coefficients of the floating point type of the first ALF according to the ALF coefficients of the floating point type of the first ALF; according to the maximum quantization scale, determine the target quantization scale of the ALF coefficients of the floating point type of the first ALF; use The target quantization scale is to quantize the ALF coefficients of the floating point type of the first ALF into ALF coefficients of the integer type; encode the ALF coefficients of the integer type of the first ALF to obtain a code stream. That is, the present application determines the target quantization scale of the ALF coefficient according to the size of the ALF coefficient of the floating point type of the first ALF, and uses the target quantization scale to quantize the ALF coefficient of the floating point type, so that when the ALF coefficient of the floating point type is large , the target quantization scale of the determined ALF coefficient is relatively large, and then the filter gain corresponding to the ALF coefficient quantized by using the target quantization scale is relatively large. When the ALF coefficient of the floating-point type is small, the target quantization scale of the determined ALF coefficient is relatively small. The coding overhead is small, thereby achieving a balance between the coding overhead of the filter coefficients and the gain brought by the filter, thereby improving the effect of video coding and decoding.
附图说明Description of drawings
图1为本申请实施例涉及的一种视频编解码系统100的示意性框图;FIG. 1 is a schematic block diagram of a video encoding and decoding system 100 involved in an embodiment of the present application;
图2是本申请实施例提供的视频编码器200的示意性框图;FIG. 2 is a schematic block diagram of a video encoder 200 provided by an embodiment of the present application;
图3是本申请实施例提供的解码框架300的示意性框图;FIG. 3 is a schematic block diagram of a decoding framework 300 provided by an embodiment of the present application;
图4为本申请实施例提供的视频编码方法400的一种流程示意图;FIG. 4 is a schematic flowchart of a video encoding method 400 provided by an embodiment of the present application;
图5A为本申请实施例涉及的一种ALF形状示意图;5A is a schematic diagram of an ALF shape involved in an embodiment of the application;
图5B为本申请实施例涉及的另一种ALF形状示意图;5B is a schematic diagram of another ALF shape involved in an embodiment of the application;
图6为本申请实施例提供的视频编码方式600的另一流程示意图;FIG. 6 is another schematic flowchart of a video encoding method 600 provided by an embodiment of the present application;
图7为本申请实施例提供的视频编码方式700的另一流程示意图;FIG. 7 is another schematic flowchart of a video encoding method 700 provided by an embodiment of the present application;
图8为本申请实施例提供的视频解码方法800的一种流程示意图;FIG. 8 is a schematic flowchart of a video decoding method 800 provided by an embodiment of the present application;
图9为本申请实施例提供的视频解码方法900的一种流程示意图;FIG. 9 is a schematic flowchart of a video decoding method 900 provided by an embodiment of the present application;
图10为本申请实施例提供的视频解码方法1000的一种流程示意图;FIG. 10 is a schematic flowchart of a video decoding method 1000 provided by an embodiment of the present application;
图11是本申请实施例提供的视频编码器10的示意性框图;FIG. 11 is a schematic block diagram of a video encoder 10 provided by an embodiment of the present application;
图12是本申请实施例提供的视频解码器20的示意性框图;12 is a schematic block diagram of a video decoder 20 provided by an embodiment of the present application;
图13是本申请实施例提供的电子设备30的示意性框图;FIG. 13 is a schematic block diagram of an electronic device 30 provided by an embodiment of the present application;
图14是本申请实施例提供的视频编解码系统40的示意性框图。FIG. 14 is a schematic block diagram of a video encoding and decoding system 40 provided by an embodiment of the present application.
具体实施方式Detailed ways
本申请可应用于图像编解码领域、视频编解码领域、硬件视频编解码领域、专用电路视频编解码领域、实时视频编解码领域等。例如,本申请的方案可结合至音视频编码标准(audio video coding standard,简称AVS),例如,H.264/音视频编码(audio video coding,简称AVC)标准,H.265/高效视频编码(high efficiency video coding,简称HEVC)标准以及H.266/多功能视频编码(versatile video coding,简称VVC)标准。或者,本申请的方案可结合至其它专属或行业标准而操作,所述标准包含ITU-TH.261、ISO/IECMPEG-1Visual、ITU-TH.262或ISO/IECMPEG-2Visual、ITU-TH.263、ISO/IECMPEG-4Visual,ITU-TH.264(还称为ISO/IECMPEG-4AVC),包含可分级视频编解码(SVC)及多视图视频编解码(MVC)扩展。应理解,本申请的技术不限于任何特定编解码标准或技术。The present application can be applied to the field of image encoding and decoding, the field of video encoding and decoding, the field of hardware video encoding and decoding, the field of dedicated circuit video encoding and decoding, the field of real-time video encoding and decoding, and the like. For example, the solution of the present application can be combined with audio video coding standard (audio video coding standard, AVS for short), for example, H.264/audio video coding (audio video coding, AVC for short) standard, H.265/High Efficiency Video Coding ( High efficiency video coding, referred to as HEVC) standard and H.266/versatile video coding (versatile video coding, referred to as VVC) standard. Alternatively, the schemes of the present application may operate in conjunction with other proprietary or industry standards including ITU-TH.261, ISO/IECMPEG-1 Visual, ITU-TH.262 or ISO/IECMPEG-2 Visual, ITU-TH.263 , ISO/IECMPEG-4Visual, ITU-TH.264 (also known as ISO/IECMPEG-4AVC), including Scalable Video Codec (SVC) and Multi-View Video Codec (MVC) extensions. It should be understood that the techniques of this application are not limited to any particular codec standard or technique.
为了便于理解,首先结合图1对本申请实施例涉及的视频编解码系统进行介绍。For ease of understanding, the video coding and decoding system involved in the embodiments of the present application is first introduced with reference to FIG. 1 .
图1为本申请实施例涉及的一种视频编解码系统100的示意性框图。需要说明的是,图1只是一种示例,本申请实施例的视频编解码系统包括但不限于图1所示。如图1所示,该视频编解码系统100包含编码设备110和解码设备120。其中编码设备用于对视频数据进行编码(可以理解成压缩)产生码流,并将码流传输给解码设备。解码设备对编码设备编码产生的码流进行解码,得到解码后的视频数据。FIG. 1 is a schematic block diagram of a video encoding and decoding system 100 according to an embodiment of the present application. It should be noted that FIG. 1 is only an example, and the video encoding and decoding systems in the embodiments of the present application include, but are not limited to, those shown in FIG. 1 . As shown in FIG. 1 , the video codec system 100 includes an encoding device 110 and a decoding device 120 . The encoding device is used to encode the video data (which can be understood as compression) to generate a code stream, and transmit the code stream to the decoding device. The decoding device decodes the code stream encoded by the encoding device to obtain decoded video data.
本申请实施例的编码设备110可以理解为具有视频编码功能的设备,解码设备120可以理解为具有视频解码功能的设备,即本申请实施例对编码设备110和解码设备120包括更广泛的装置,例如包含智能手机、台式计算机、移动计算装置、笔记本(例如,膝 上型)计算机、平板计算机、机顶盒、电视、相机、显示装置、数字媒体播放器、视频游戏控制台、车载计算机等。The encoding device 110 in this embodiment of the present application may be understood as a device with a video encoding function, and the decoding device 120 may be understood as a device with a video decoding function, that is, the encoding device 110 and the decoding device 120 in the embodiments of the present application include a wider range of devices, Examples include smartphones, desktop computers, mobile computing devices, notebook (eg, laptop) computers, tablet computers, set-top boxes, televisions, cameras, display devices, digital media players, video game consoles, in-vehicle computers, and the like.
在一些实施例中,编码设备110可以经由信道130将编码后的视频数据(如码流)传输给解码设备120。信道130可以包括能够将编码后的视频数据从编码设备110传输到解码设备120的一个或多个媒体和/或装置。In some embodiments, the encoding device 110 may transmit the encoded video data (eg, a code stream) to the decoding device 120 via the channel 130 . Channel 130 may include one or more media and/or devices capable of transmitting encoded video data from encoding device 110 to decoding device 120 .
在一个实例中,信道130包括使编码设备110能够实时地将编码后的视频数据直接发射到解码设备120的一个或多个通信媒体。在此实例中,编码设备110可根据通信标准来调制编码后的视频数据,且将调制后的视频数据发射到解码设备120。其中通信媒体包含无线通信媒体,例如射频频谱,可选的,通信媒体还可以包含有线通信媒体,例如一根或多根物理传输线。In one example, channel 130 includes one or more communication media that enables encoding device 110 to transmit encoded video data directly to decoding device 120 in real-time. In this example, encoding apparatus 110 may modulate the encoded video data according to a communication standard and transmit the modulated video data to decoding apparatus 120 . Wherein the communication medium includes a wireless communication medium, such as a radio frequency spectrum, optionally, the communication medium may also include a wired communication medium, such as one or more physical transmission lines.
在另一实例中,信道130包括存储介质,该存储介质可以存储编码设备110编码后的视频数据。存储介质包含多种本地存取式数据存储介质,例如光盘、DVD、快闪存储器等。在该实例中,解码设备120可从该存储介质中获取编码后的视频数据。In another example, channel 130 includes a storage medium that can store video data encoded by encoding device 110 . Storage media include a variety of locally accessible data storage media such as optical discs, DVDs, flash memory, and the like. In this example, the decoding apparatus 120 may obtain the encoded video data from the storage medium.
在另一实例中,信道130可包含存储服务器,该存储服务器可以存储编码设备110编码后的视频数据。在此实例中,解码设备120可以从该存储服务器中下载存储的编码后的视频数据。可选的,该存储服务器可以存储编码后的视频数据且可以将该编码后的视频数据发射到解码设备120,例如web服务器(例如,用于网站)、文件传送协议(FTP)服务器等。In another example, channel 130 may include a storage server that may store video data encoded by encoding device 110 . In this instance, the decoding device 120 may download the stored encoded video data from the storage server. Optionally, the storage server may store the encoded video data and may transmit the encoded video data to the decoding device 120, such as a web server (eg, for a website), a file transfer protocol (FTP) server, and the like.
一些实施例中,编码设备110包含视频编码器112及输出接口113。其中,输出接口113可以包含调制器/解调器(调制解调器)和/或发射器。In some embodiments, encoding apparatus 110 includes video encoder 112 and output interface 113 . Among them, the output interface 113 may include a modulator/demodulator (modem) and/or a transmitter.
在一些实施例中,编码设备110除了包括视频编码器112和输入接口113外,还可以包括视频源111。In some embodiments, encoding device 110 may include video source 111 in addition to video encoder 112 and input interface 113 .
视频源111可包含视频采集装置(例如,视频相机)、视频存档、视频输入接口、计算机图形系统中的至少一个,其中,视频输入接口用于从视频内容提供者处接收视频数据,计算机图形系统用于产生视频数据。The video source 111 may include at least one of a video capture device (eg, a video camera), a video archive, a video input interface, a computer graphics system for receiving video data from a video content provider, a computer graphics system Used to generate video data.
视频编码器112对来自视频源111的视频数据进行编码,产生码流。视频数据可包括一个或多个图像(picture)或图像序列(sequence of pictures)。码流以比特流的形式包含了图像或图像序列的编码信息。编码信息可以包含编码图像数据及相关联数据。相关联数据可包含序列参数集(sequence parameter set,简称SPS)、图像参数集(picture parameter set,简称PPS)及其它语法结构。SPS可含有应用于一个或多个序列的参数。PPS可含有应用于一个或多个图像的参数。语法结构是指码流中以指定次序排列的零个或多个语法元素的集合。The video encoder 112 encodes the video data from the video source 111 to generate a code stream. Video data may include one or more pictures or a sequence of pictures. The code stream contains the encoding information of the image or image sequence in the form of bit stream. The encoded information may include encoded image data and associated data. The associated data may include a sequence parameter set (SPS for short), a picture parameter set (PPS for short), and other syntax structures. An SPS may contain parameters that apply to one or more sequences. A PPS may contain parameters that apply to one or more images. A syntax structure refers to a set of zero or more syntax elements in a codestream arranged in a specified order.
视频编码器112经由输出接口113将编码后的视频数据直接传输到解码设备120。编码后的视频数据还可存储于存储介质或存储服务器上,以供解码设备120后续读取。The video encoder 112 directly transmits the encoded video data to the decoding device 120 via the output interface 113 . The encoded video data may also be stored on a storage medium or a storage server for subsequent reading by the decoding device 120 .
在一些实施例中,解码设备120包含输入接口121和视频解码器122。In some embodiments, decoding device 120 includes input interface 121 and video decoder 122 .
在一些实施例中,解码设备120除包括输入接口121和视频解码器122外,还可以包括显示装置123。In some embodiments, the decoding device 120 may include a display device 123 in addition to the input interface 121 and the video decoder 122 .
其中,输入接口121包含接收器及/或调制解调器。输入接口121可通过信道130接收编码后的视频数据。The input interface 121 includes a receiver and/or a modem. The input interface 121 may receive the encoded video data through the channel 130 .
视频解码器122用于对编码后的视频数据进行解码,得到解码后的视频数据,并将解码后的视频数据传输至显示装置123。The video decoder 122 is configured to decode the encoded video data, obtain the decoded video data, and transmit the decoded video data to the display device 123 .
显示装置123显示解码后的视频数据。显示装置123可与解码设备120整合或在解码设备120外部。显示装置123可包括多种显示装置,例如液晶显示器(LCD)、等离子体显示器、有机发光二极管(OLED)显示器或其它类型的显示装置。The display device 123 displays the decoded video data. The display device 123 may be integrated with the decoding apparatus 120 or external to the decoding apparatus 120 . The display device 123 may include various display devices, such as a liquid crystal display (LCD), a plasma display, an organic light emitting diode (OLED) display, or other types of display devices.
此外,图1仅为实例,本申请实施例的技术方案不限于图1,例如本申请的技术还可以应用于单侧的视频编码或单侧的视频解码。In addition, FIG. 1 is only an example, and the technical solutions of the embodiments of the present application are not limited to FIG. 1 . For example, the technology of the present application may also be applied to single-side video encoding or single-side video decoding.
下面对本申请实施例涉及的视频编码框架进行介绍。The following describes the video coding framework involved in the embodiments of the present application.
图2是本申请实施例提供的视频编码器200的示意性框图。应理解,该视频编码器200可用于对图像进行有损压缩(lossy compression),也可用于对图像进行无损压缩(lossless compression)。该无损压缩可以是视觉无损压缩(visually lossless compression),也可以是数学无损压缩(mathematically lossless compression)。FIG. 2 is a schematic block diagram of a video encoder 200 provided by an embodiment of the present application. It should be understood that the video encoder 200 can be used to perform lossy compression on images, and can also be used to perform lossless compression on images. The lossless compression may be visually lossless compression (visually lossless compression) or mathematically lossless compression (mathematically lossless compression).
该视频编码器200可应用于亮度色度(YCbCr,YUV)格式的图像数据上。例如,YUV比例可以为4:2:0、4:2:2或者4:4:4,Y表示明亮度(Luma),Cb(U)表示蓝色色度,Cr(V)表示红色色度,U和V表示为色度(Chroma)用于描述色彩及饱和度。例如,在颜色格式上,4:2:0表示每4个像素有4个亮度分量,2个色度分量(YYYYCbCr),4:2:2表示每4个像素有4个亮度分量,4个色度分量(YYYYCbCrCbCr),4:4:4表示全像素显示(YYYYCbCrCbCrCbCrCbCr)。The video encoder 200 can be applied to image data in luminance chrominance (YCbCr, YUV) format. For example, the YUV ratio can be 4:2:0, 4:2:2 or 4:4:4, Y represents the luminance (Luma), Cb(U) represents the blue chromaticity, Cr(V) represents the red chromaticity, U and V are expressed as chroma (Chroma) to describe color and saturation. For example, in color format, 4:2:0 means that every 4 pixels has 4 luma components, 2 chrominance components (YYYYCbCr), 4:2:2 means that every 4 pixels has 4 luma components, 4 Chroma component (YYYYCbCrCbCr), 4:4:4 means full pixel display (YYYYCbCrCbCrCbCrCbCr).
例如,该视频编码器200读取视频数据,针对视频数据中的每帧图像,将一帧图像划分成若干个编码树单元(coding tree unit,CTU),在一些例子中,CTB可被称作“树型块”、“最大编码单元”(Largest Coding unit,简称LCU)或“编码树型块”(coding tree block,简称CTB)。每一个CTU可以与图像内的具有相等大小的像素块相关联。每一像素可对应一个亮度(luminance或luma)采样及两个色度(chrominance或chroma)采样。因此,每一个CTU可与一个亮度采样块及两个色度采样块相关联。一个CTU大小例如为128×128、64×64、32×32等。一个CTU又可以继续被划分成若干个编码单元(Coding Unit,CU)进行编码,CU可以为矩形块也可以为方形块。CU可以进一步划分为预测单元(prediction Unit,简称PU)和变换单元(transform unit,简称TU),进而使得编码、预测、变换分离,处理的时候更灵活。在一种示例中,CTU以四叉树方式划分为CU,CU以四叉树方式划分为TU、PU。For example, the video encoder 200 reads video data, and for each frame of image in the video data, divides one frame of image into several coding tree units (CTUs). In some examples, the CTB may be referred to as "Tree block", "Largest Coding Unit" (LCU for short) or "coding tree block" (CTB for short). Each CTU may be associated with a block of pixels of equal size within the image. Each pixel may correspond to one luminance (luma) sample and two chrominance (chrominance or chroma) samples. Thus, each CTU may be associated with one block of luma samples and two blocks of chroma samples. The size of one CTU is, for example, 128×128, 64×64, 32×32, and so on. A CTU can be further divided into several coding units (Coding Unit, CU) for coding, and the CU can be a rectangular block or a square block. The CU can be further divided into a prediction unit (PU for short) and a transform unit (TU for short), so that coding, prediction, and transformation are separated and processing is more flexible. In one example, the CTU is divided into CUs in a quadtree manner, and the CUs are divided into TUs and PUs in a quadtree manner.
视频编码器及视频解码器可支持各种PU大小。假定特定CU的大小为2N×2N,视频编码器及视频解码器可支持2N×2N或N×N的PU大小以用于帧内预测,且支持2N×2N、2N×N、N×2N、N×N或类似大小的对称PU以用于帧间预测。视频编码器及视频解码器还可支持2N×nU、2N×nD、nL×2N及nR×2N的不对称PU以用于帧间预测。Video encoders and video decoders may support various PU sizes. Assuming the size of a particular CU is 2Nx2N, video encoders and video decoders may support PU sizes of 2Nx2N or NxN for intra prediction, and support 2Nx2N, 2NxN, Nx2N, NxN or similar sized symmetric PUs for inter prediction. Video encoders and video decoders may also support 2NxnU, 2NxnD, nLx2N, and nRx2N asymmetric PUs for inter prediction.
在一些实施例中,如图2所示,该视频编码器200可包括:预测单元210、残差单元220、变换/量化单元230、反变换/量化单元240、重建单元250、环路滤波单元260、解码图像缓存270和熵编码单元280。需要说明的是,视频编码器200可包含更多、更少或不同的功能组件。In some embodiments, as shown in FIG. 2, the video encoder 200 may include: a prediction unit 210, a residual unit 220, a transform/quantization unit 230, an inverse transform/quantization unit 240, a reconstruction unit 250, a loop filtering unit 260 , a decoded image buffer 270 and an entropy encoding unit 280 . It should be noted that the video encoder 200 may include more, less or different functional components.
可选的,在本申请中,当前块(current block)可以称为当前编码单元(CU)或当前 预测单元(PU)等。预测块也可称为预测图像块或图像预测块,重建图像块也可称为重建块或图像重建图像块。Optionally, in this application, a current block (current block) may be referred to as a current coding unit (CU) or a current prediction unit (PU), or the like. A prediction block may also be referred to as a predicted image block or an image prediction block, and a reconstructed image block may also be referred to as a reconstructed block or an image reconstructed image block.
在一些实施例中,预测单元210包括帧间预测单元211和帧内预测单元212。由于视频的一个帧中的相邻像素之间存在很强的相关性,在视频编解码技术中使用帧内预测的方法消除相邻像素之间的空间冗余。由于视频中的相邻帧之间存在着很强的相似性,在视频编解码技术中使用帧间预测方法消除相邻帧之间的时间冗余,从而提高编码效率。In some embodiments, prediction unit 210 includes an inter prediction unit 211 and an intra prediction unit 212 . Since there is a strong correlation between adjacent pixels in a frame of a video, the method of intra-frame prediction is used in video coding and decoding technology to eliminate the spatial redundancy between adjacent pixels. Due to the strong similarity between adjacent frames in the video, the inter-frame prediction method is used in the video coding and decoding technology to eliminate the temporal redundancy between adjacent frames, thereby improving the coding efficiency.
帧间预测单元211可用于帧间预测,帧间预测可以参考不同帧的图像信息,帧间预测使用运动信息从参考帧中找到参考块,根据参考块生成预测块,用于消除时间冗余;帧间预测所使用的帧可以为P帧和/或B帧,P帧指的是向前预测帧,B帧指的是双向预测帧。运动信息包括参考帧所在的参考帧列表,参考帧索引,以及运动矢量。运动矢量可以是整像素的或者是分像素的,如果运动矢量是分像素的,那么需要再参考帧中使用插值滤波做出所需的分像素的块,这里把根据运动矢量找到的参考帧中的整像素或者分像素的块叫参考块。有的技术会直接把参考块作为预测块,有的技术会在参考块的基础上再处理生成预测块。在参考块的基础上再处理生成预测块也可以理解为把参考块作为预测块然后再在预测块的基础上处理生成新的预测块。The inter-frame prediction unit 211 can be used for inter-frame prediction, and the inter-frame prediction can refer to image information of different frames, and the inter-frame prediction uses motion information to find a reference block from the reference frame, and generates a prediction block according to the reference block for eliminating temporal redundancy; Frames used for inter-frame prediction may be P frames and/or B frames, where P frames refer to forward predicted frames, and B frames refer to bidirectional predicted frames. The motion information includes the reference frame list where the reference frame is located, the reference frame index, and the motion vector. The motion vector can be of whole pixel or sub-pixel. If the motion vector is sub-pixel, then it is necessary to use interpolation filtering in the reference frame to make the required sub-pixel block. Here, the reference frame found according to the motion vector is used. The whole pixel or sub-pixel block is called the reference block. In some technologies, the reference block is directly used as the prediction block, and some technologies are processed on the basis of the reference block to generate the prediction block. Reprocessing to generate a prediction block on the basis of the reference block can also be understood as taking the reference block as a prediction block and then processing it on the basis of the prediction block to generate a new prediction block.
目前最常用的帧间预测方法包括:VVC视频编解码标准中的几何划分模式(geometric partitioning mode,GPM),以及AVS3视频编解码标准中的角度加权预测(angular weighted prediction,AWP)。这两种帧内预测模式在原理上有共通之处。Currently, the most commonly used inter-frame prediction methods include: geometric partitioning mode (GPM) in the VVC video codec standard, and angular weighted prediction (AWP) in the AVS3 video codec standard. These two intra prediction modes have something in common in principle.
帧内预测单元212只参考同一帧图像的信息,预测当前码图像块内的像素信息,用于消除空间冗余。帧内预测所使用的帧可以为I帧。例如图5所示,白色的4×4块是当前块,当前块左边一行和上面一列的灰色的像素为当前块的参考像素,帧内预测使用这些参考像素对当前块进行预测。这些参考像素可能已经全部可得,即全部已经编解码。也可能有部分不可得,比如当前块是整帧的最左侧,那么当前块的左边的参考像素不可得。或者编解码当前块时,当前块左下方的部分还没有编解码,那么左下方的参考像素也不可得。对于参考像素不可得的情况,可以使用可得的参考像素或某些值或某些方法进行填充,或者不进行填充。The intra-frame prediction unit 212 only refers to the information of the same frame image, and predicts the pixel information in the current code image block, so as to eliminate the spatial redundancy. Frames used for intra prediction may be I-frames. For example, as shown in FIG. 5 , the white 4×4 block is the current block, and the gray pixels in the left row and upper column of the current block are the reference pixels of the current block, and the intra prediction uses these reference pixels to predict the current block. These reference pixels may already be all available, ie all already coded and decoded. Some parts may not be available. For example, if the current block is the leftmost part of the whole frame, the reference pixels to the left of the current block are not available. Or when the current block is encoded and decoded, the lower left part of the current block has not been encoded or decoded, so the reference pixels at the lower left are also unavailable. In the case where the reference pixel is not available, the available reference pixel or some value or some method can be used for padding, or no padding is performed.
在一些实施例中,帧内预测方法还包括多参考行帧内预测方法(multiple reference line,MRL),MRL可以使用更多的参考像素从而提高编码效率。In some embodiments, the intra prediction method further includes a multiple reference line intra prediction method (multiple reference line, MRL), which can use more reference pixels to improve coding efficiency.
帧内预测有多种预测模式,H.264中对4×4的块进行帧内预测的9种模式。其中模式0是将当前块上面的像素按竖直方向复制到当前块作为预测值;模式1是将左边的参考像素按水平方向复制到当前块作为预测值;模式2(DC)是将A~D和I~L这8个点的平均值作为所有点的预测值,模式3至模式8是分别按某一个角度将参考像素复制到当前块的对应位置。因为当前块某些位置不能正好对应到参考像素,可能需要使用参考像素的加权平均值,或者说是插值的参考像素的分像素。There are multiple prediction modes for intra-frame prediction. In H.264, there are 9 modes for intra-frame prediction for 4×4 blocks. Among them, mode 0 is to copy the pixels above the current block to the current block in the vertical direction as the predicted value; mode 1 is to copy the reference pixel on the left to the current block in the horizontal direction as the predicted value; mode 2 (DC) is to copy A ~ The average value of the 8 points D and I to L is used as the predicted value of all points. Modes 3 to 8 copy the reference pixels to the corresponding position of the current block according to a certain angle respectively. Because some positions of the current block cannot exactly correspond to the reference pixels, it may be necessary to use a weighted average of the reference pixels, or sub-pixels of the interpolated reference pixels.
HEVC使用的帧内预测模式有平面模式(Planar)、DC和33种角度模式,共35种预测模式。VVC使用的帧内模式有Planar、DC和65种角度模式,共67种预测模式。AVS3使用的帧内模式有DC、Plane、Bilinear和63种角度模式,共66种预测模式。The intra-frame prediction modes used by HEVC include Planar mode, DC and 33 angle modes, for a total of 35 prediction modes. The intra-frame modes used by VVC are Planar, DC, and 65 angular modes, for a total of 67 prediction modes. The intra-frame modes used by AVS3 are DC, Plane, Bilinear and 63 angle modes, a total of 66 prediction modes.
需要说明的是,随着角度模式的增加,帧内预测将会更加精确,也更加符合对高清以及超高清数字视频发展的需求。It should be noted that with the increase of the angle mode, the intra-frame prediction will be more accurate and more in line with the demand for the development of high-definition and ultra-high-definition digital video.
残差单元220可基于CU的像素块及CU的PU的预测块来产生CU的残差块。举例来说,残差单元220可产生CU的残差块,使得残差块中的每一采样具有等于以下两者之间的差的值:CU的像素块中的采样,及CU的PU的预测块中的对应采样。 Residual unit 220 may generate a residual block of the CU based on the pixel blocks of the CU and the prediction blocks of the PUs of the CU. For example, residual unit 220 may generate a residual block of the CU such that each sample in the residual block has a value equal to the difference between the samples in the CU's pixel block, and the CU's PU's Corresponding samples in the prediction block.
变换/量化单元230可量化变换系数。变换/量化单元230可基于与CU相关联的量化参数(QP)值来量化与CU的TU相关联的变换系数。视频编码器200可通过调整与CU相关联的QP值来调整应用于与CU相关联的变换系数的量化程度。Transform/quantization unit 230 may quantize transform coefficients. Transform/quantization unit 230 may quantize transform coefficients associated with TUs of the CU based on quantization parameter (QP) values associated with the CU. Video encoder 200 may adjust the degree of quantization applied to transform coefficients associated with the CU by adjusting the QP value associated with the CU.
反变换/量化单元240可分别将逆量化及逆变换应用于量化后的变换系数,以从量化后的变换系数重建残差块。Inverse transform/quantization unit 240 may apply inverse quantization and inverse transform, respectively, to the quantized transform coefficients to reconstruct a residual block from the quantized transform coefficients.
重建单元250可将重建后的残差块的采样加到预测单元210产生的一个或多个预测块的对应采样,以产生与TU相关联的重建图像块。通过此方式重建CU的每一个TU的采样块,视频编码器200可重建CU的像素块。 Reconstruction unit 250 may add the samples of the reconstructed residual block to corresponding samples of the one or more prediction blocks generated by prediction unit 210 to generate a reconstructed image block associated with the TU. By reconstructing the block of samples for each TU of the CU in this manner, video encoder 200 may reconstruct the block of pixels of the CU.
环路滤波单元260可执行消块滤波操作以减少与CU相关联的像素块的块效应。In-loop filtering unit 260 may perform deblocking filtering operations to reduce blocking artifacts for pixel blocks associated with the CU.
在一些实施例中,环路滤波单元260包括去块滤波单元、样点自适应补偿SAO单元、自适应环路滤波ALF单元。In some embodiments, loop filtering unit 260 includes a deblocking filtering unit, a sample adaptive compensation SAO unit, an adaptive loop filtering ALF unit.
解码图像缓存270可存储重建后的像素块。帧间预测单元211可使用含有重建后的像素块的参考图像来对其它图像的PU执行帧间预测。另外,帧内预测单元212可使用解码图像缓存270中的重建后的像素块来对在与CU相同的图像中的其它PU执行帧内预测。The decoded image buffer 270 may store the reconstructed pixel blocks. Inter-prediction unit 211 may use the reference picture containing the reconstructed pixel block to perform inter-prediction on PUs of other pictures. In addition, intra-prediction unit 212 may use the reconstructed pixel blocks in decoded picture buffer 270 to perform intra-prediction on other PUs in the same picture as the CU.
熵编码单元280可接收来自变换/量化单元230的量化后的变换系数。熵编码单元280可对量化后的变换系数执行一个或多个熵编码操作以产生熵编码后的数据。 Entropy encoding unit 280 may receive the quantized transform coefficients from transform/quantization unit 230 . Entropy encoding unit 280 may perform one or more entropy encoding operations on the quantized transform coefficients to generate entropy encoded data.
本申请涉及的视频编码的基本流程如下:在编码端,将当前图像划分成块,针对当前块,预测单元210使用帧内预测或帧间预测产生当前块的预测块。残差单元220可基于预测块与当前块的原始块计算残差块,即预测块和当前块的原始块的差值,该残差块也可称为残差信息。该残差块经由变换/量化单元230变换与量化等过程,可以去除人眼不敏感的信息,以消除视觉冗余。可选的,经过变换/量化单元230变换与量化之前的残差块可称为时域残差块,经过变换/量化单元230变换与量化之后的时域残差块可称为频率残差块或频域残差块。熵编码单元280接收到变化量化单元230输出的量化后的变化系数,可对该量化后的变化系数进行熵编码,输出码流。例如,熵编码单元280可根据目标上下文模型以及二进制码流的概率信息消除字符冗余。The basic flow of video coding involved in the present application is as follows: at the coding end, the current image is divided into blocks, and for the current block, the prediction unit 210 uses intra-frame prediction or inter-frame prediction to generate a prediction block of the current block. The residual unit 220 may calculate a residual block based on the predicted block and the original block of the current block, that is, the difference between the predicted block and the original block of the current block, and the residual block may also be referred to as residual information. The residual block can be transformed and quantized by the transform/quantization unit 230 to remove information insensitive to human eyes, so as to eliminate visual redundancy. Optionally, the residual block before being transformed and quantized by the transform/quantization unit 230 may be referred to as a time-domain residual block, and the time-domain residual block after being transformed and quantized by the transform/quantization unit 230 may be referred to as a frequency residual block. or a frequency domain residual block. The entropy coding unit 280 receives the quantized variation coefficient output by the variation quantization unit 230, and can perform entropy coding on the quantized variation coefficient to output a code stream. For example, the entropy encoding unit 280 may eliminate character redundancy according to the target context model and the probability information of the binary code stream.
另外,视频编码器对变化量化单元230输出的量化后的变化系数进行反量化和反变化,得到当前块的残差块,再将当前块的残差块与当前块的预测块进行相加,得到当前块的重建块。随着编码的进行,可以得到当前图像中其他图像块对应的重建块,这些重建块进行拼接,得到当前图像的重建图像。由于编码过程中引入误差,为了降低误差,对重建图像进行滤波,例如,使用ALF对重建图像进行滤波,以减小重建图像中像素点的像素值与当前图像中像素点的原始像素值之间差异。将滤波后的重建图像存放在解码图像缓存270中,可以为后续的帧作为帧间预测的参考帧。In addition, the video encoder performs inverse quantization and inverse variation on the quantized variation coefficient output by the variation quantization unit 230 to obtain the residual block of the current block, and then adds the residual block of the current block to the prediction block of the current block, Get the reconstructed block of the current block. As the encoding proceeds, reconstructed blocks corresponding to other image blocks in the current image can be obtained, and these reconstructed blocks are spliced to obtain a reconstructed image of the current image. Due to the error introduced in the encoding process, in order to reduce the error, the reconstructed image is filtered, for example, ALF is used to filter the reconstructed image to reduce the difference between the pixel value of the pixel in the reconstructed image and the original pixel value of the pixel in the current image. difference. The filtered reconstructed image is stored in the decoded image buffer 270, and can be used as a reference frame for inter-frame prediction for subsequent frames.
需要说明的是,编码端确定的块划分信息,以及预测、变换、量化、熵编码、环路滤波等模式信息或者参数信息等在必要时携带在码流中。解码端通过解析码流及根据已有信息进行分析确定与编码端相同的块划分信息,预测、变换、量化、熵编码、环路滤 波等模式信息或者参数信息,从而保证编码端获得的解码图像和解码端获得的解码图像相同。It should be noted that the block division information determined by the coding end, and mode information or parameter information such as prediction, transformation, quantization, entropy coding, and loop filtering, etc., are carried in the code stream when necessary. The decoding end determines the same block division information, prediction, transformation, quantization, entropy coding, loop filtering and other mode information or parameter information as the encoding end by analyzing the code stream and analyzing the existing information, so as to ensure the decoded image obtained by the encoding end. It is the same as the decoded image obtained by the decoder.
图3是本申请实施例提供的解码框架300的示意性框图。FIG. 3 is a schematic block diagram of a decoding framework 300 provided by an embodiment of the present application.
如图3所示,视频解码器300包含:熵解码单元310、预测单元320、反量化/变换单元330、重建单元340、环路滤波单元350及解码图像缓存360。需要说明的是,视频解码器300可包含更多、更少或不同的功能组件。As shown in FIG. 3 , the video decoder 300 includes an entropy decoding unit 310 , a prediction unit 320 , an inverse quantization/transformation unit 330 , a reconstruction unit 340 , a loop filtering unit 350 , and a decoded image buffer 360 . It should be noted that the video decoder 300 may include more, less or different functional components.
视频解码器300可接收码流。熵解码单元310可解析码流以从码流提取语法元素。作为解析码流的一部分,熵解码单元310可解析码流中的经熵编码后的语法元素。预测单元320、反量化/变换单元330、重建单元340及环路滤波单元350可根据从码流中提取的语法元素来解码视频数据,即产生解码后的视频数据。The video decoder 300 may receive the code stream. Entropy decoding unit 310 may parse the codestream to extract syntax elements from the codestream. As part of parsing the codestream, entropy decoding unit 310 may parse the entropy-encoded syntax elements in the codestream. The prediction unit 320, the inverse quantization/transform unit 330, the reconstruction unit 340, and the in-loop filtering unit 350 may decode the video data according to the syntax elements extracted from the code stream, ie, generate decoded video data.
在一些实施例中,预测单元320包括帧内预测单元321和帧间预测单元322。In some embodiments, prediction unit 320 includes intra prediction unit 321 and inter prediction unit 322 .
帧内预测单元321可执行帧内预测以产生PU的预测块。帧内预测单元321可使用帧内预测模式以基于空间相邻PU的像素块来产生PU的预测块。帧内预测单元321还可根据从码流解析的一个或多个语法元素来确定PU的帧内预测模式。Intra-prediction unit 321 may perform intra-prediction to generate prediction blocks for the PU. Intra-prediction unit 321 may use an intra-prediction mode to generate prediction blocks for a PU based on pixel blocks of spatially neighboring PUs. Intra-prediction unit 321 may also determine an intra-prediction mode for the PU from one or more syntax elements parsed from the codestream.
帧间预测单元322可根据从码流解析的语法元素来构造第一参考图像列表(列表0)及第二参考图像列表(列表1)。此外,如果PU使用帧间预测编码,则熵解码单元310可解析PU的运动信息。帧间预测单元322可根据PU的运动信息来确定PU的一个或多个参考块。帧间预测单元322可根据PU的一个或多个参考块来产生PU的预测块。Inter-prediction unit 322 may construct a first reference picture list (List 0) and a second reference picture list (List 1) from the syntax elements parsed from the codestream. Furthermore, if the PU is encoded using inter-prediction, entropy decoding unit 310 may parse the motion information for the PU. Inter-prediction unit 322 may determine one or more reference blocks for the PU according to the motion information of the PU. Inter-prediction unit 322 may generate a prediction block for the PU from one or more reference blocks of the PU.
反量化/变换单元330可逆量化(即,解量化)与TU相关联的变换系数。反量化/变换单元330可使用与TU的CU相关联的QP值来确定量化程度。The inverse quantization/transform unit 330 inversely quantizes (ie, dequantizes) the transform coefficients associated with the TUs. Inverse quantization/transform unit 330 may use the QP value associated with the CU of the TU to determine the degree of quantization.
在逆量化变换系数之后,反量化/变换单元330可将一个或多个逆变换应用于逆量化变换系数,以便产生与TU相关联的残差块。After inverse quantizing the transform coefficients, inverse quantization/transform unit 330 may apply one or more inverse transforms to the inverse quantized transform coefficients to generate a residual block associated with the TU.
重建单元340使用与CU的TU相关联的残差块及CU的PU的预测块以重建CU的像素块。例如,重建单元340可将残差块的采样加到预测块的对应采样以重建CU的像素块,得到重建图像块。 Reconstruction unit 340 uses the residual blocks associated with the TUs of the CU and the prediction blocks of the PUs of the CU to reconstruct the pixel blocks of the CU. For example, reconstruction unit 340 may add samples of the residual block to corresponding samples of the prediction block to reconstruct the pixel block of the CU, resulting in a reconstructed image block.
环路滤波单元350可执行消块滤波操作以减少与CU相关联的像素块的块效应。In-loop filtering unit 350 may perform deblocking filtering operations to reduce blocking artifacts for pixel blocks associated with the CU.
在一些实施例中,环路滤波单元350包括去块滤波单元、样点自适应补偿SAO单元、自适应环路滤波ALF单元。In some embodiments, the loop filtering unit 350 includes a deblocking filtering unit, a sample adaptive compensation SAO unit, an adaptive loop filtering ALF unit.
视频解码器300可将CU的重建图像存储于解码图像缓存360中。视频解码器300可将解码图像缓存360中的重建图像作为参考图像用于后续预测,或者,将重建图像传输给显示装置呈现。Video decoder 300 may store the reconstructed images of the CU in decoded image buffer 360 . The video decoder 300 may use the reconstructed image in the decoded image buffer 360 as a reference image for subsequent prediction, or transmit the reconstructed image to a display device for presentation.
本申请涉及的视频解码的基本流程如下:熵解码单元310可解析码流得到当前块的预测信息、量化系数矩阵等,预测单元320基于预测信息对当前块使用帧内预测或帧间预测产生当前块的预测块。反量化/变换单元330使用从码流得到的量化系数矩阵,对量化系数矩阵进行反量化、反变换得到残差块。重建单元340将预测块和残差块相加得到重建块。重建块组成重建图像,环路滤波单元350基于图像或基于块对重建图像进行环路滤波,得到解码图像。该解码图像也可以称为重建图像,该重建图像一方面可以被显示设备进行显示,另一方面可以存放在解码图像缓存360中,为后续的帧作为帧间预测 的参考帧。The basic process of video decoding involved in this application is as follows: the entropy decoding unit 310 can parse the code stream to obtain the prediction information, quantization coefficient matrix, etc. of the current block, and the prediction unit 320 uses intra prediction or inter prediction for the current block to generate the current block based on the prediction information. The predicted block for the block. The inverse quantization/transform unit 330 performs inverse quantization and inverse transformation on the quantized coefficient matrix using the quantized coefficient matrix obtained from the code stream to obtain a residual block. The reconstruction unit 340 adds the prediction block and the residual block to obtain a reconstructed block. The reconstructed blocks form a reconstructed image, and the loop filtering unit 350 performs loop filtering on the reconstructed image based on the image or based on the block to obtain a decoded image. The decoded image may also be referred to as a reconstructed image. On the one hand, the reconstructed image may be displayed by a display device, and on the other hand, the reconstructed image may be stored in the decoded image buffer 360 to serve as a reference frame for inter-frame prediction for subsequent frames.
上述是基于块的混合编码框架下的视频编解码器的基本流程,随着技术的发展,该框架或流程的一些模块或步骤可能会被优化,本申请适用于该基于块的混合编码框架下的视频编解码器的基本流程,但不限于该框架及流程。The above is the basic process of the video codec under the block-based hybrid coding framework. With the development of technology, some modules or steps of the framework or process may be optimized. This application is applicable to the block-based hybrid coding framework. The basic process of the video codec, but not limited to the framework and process.
上文对本申请实施例涉及的视频编码系统、视频编码器、视频解码以及帧内预测模式进行介绍。在此基础上,下面结合具体的实施例对本申请实施例提供的技术方案进行详细描述。The video encoding system, video encoder, video decoding, and intra-frame prediction mode involved in the embodiments of the present application are described above. On this basis, the technical solutions provided by the embodiments of the present application are described in detail below with reference to specific embodiments.
下面结合图4对编码端进行介绍。The encoding end will be introduced below with reference to FIG. 4 .
图4为本申请实施例提供的视频编码方法400的一种流程示意图,本申请实施例应用于图1和图2所示视频编码器。如图4所示,本申请实施例的方法包括:FIG. 4 is a schematic flowchart of a video encoding method 400 provided by an embodiment of the present application, and the embodiment of the present application is applied to the video encoder shown in FIG. 1 and FIG. 2 . As shown in FIG. 4 , the method of the embodiment of the present application includes:
S401、获得当前图像的重建图像,该重建图像包括第一分量,第一分量可以为亮度分量或色度分量。S401. Obtain a reconstructed image of the current image, where the reconstructed image includes a first component, and the first component may be a luminance component or a chrominance component.
在视频编码过程中,视频编码器接收视频流,该视频流由一系列图像帧组成,针对视频流中的每一帧图像进行视频编码,为了便于描述,本申请将当前待编码的一帧图像记为当前图像。In the video encoding process, the video encoder receives a video stream, which consists of a series of image frames, and performs video encoding for each frame of image in the video stream. For convenience of description, this application uses a frame of image currently to be encoded Record as the current image.
具体的,参照图2所示,视频编码器将当前图像划分成一个或多个待编码图像块,针对每个待编码图像块,视频编码器中的预测单元210经由帧间预测、帧内预测产生待编码图像块的预测块之后,将预测块发送给残差单元220,该残差单元220可以理解为求和器,包括执行减法运算的一个或多个组建。残差单元220从待编码图像块中减去预测块形成残差块,并将残差块发送给变换量化单元230。变换量化单元230使用例如离散余弦变换(DCT)或者类似的变换将残差块进行变换处理,得到变换系数。变换量化单元230进一步对变换系数进行量化,得到量化后的变换系数。Specifically, as shown in FIG. 2 , the video encoder divides the current image into one or more image blocks to be encoded, and for each image block to be encoded, the prediction unit 210 in the video encoder uses inter-frame prediction, intra-frame prediction After the prediction block of the image block to be encoded is generated, the prediction block is sent to the residual unit 220, which can be understood as a summer, including one or more components that perform a subtraction operation. The residual unit 220 subtracts the prediction block from the image block to be encoded to form a residual block, and sends the residual block to the transform and quantization unit 230 . The transform and quantization unit 230 transforms the residual block using, for example, discrete cosine transform (DCT) or the like, to obtain transform coefficients. The transform and quantization unit 230 further quantizes the transform coefficients to obtain quantized transform coefficients.
由图2可知,一方面,变换量化单元230将量化后的变换系数转发给熵编码单元280。熵编码单元280对量化后的变换系数进行熵编码。举例来说,熵编码单元280可执行上下文自适应可变长度编码(CAVLC)、上下文自适应二进制算术编码(CABAC)、基于语法的上下文自适应二进制算术编码(SBAC)、概率区间分割熵(PIPE)编码等编码方法,对量化后的变换系数进行熵编码,得到码流。It can be seen from FIG. 2 that, on the one hand, the transform and quantization unit 230 forwards the quantized transform coefficients to the entropy encoding unit 280 . The entropy encoding unit 280 entropy encodes the quantized transform coefficients. For example, entropy encoding unit 280 may perform context adaptive variable length coding (CAVLC), context adaptive binary arithmetic coding (CABAC), syntax-based context adaptive binary arithmetic coding (SBAC), probability interval partitioning entropy (PIPE) ) coding and other coding methods, entropy coding is performed on the quantized transform coefficients to obtain a code stream.
另一方面,变换量化单元230将量化后的变换系数转发给反变换量化单元240。反变换量化单元240对量化后的变换系数进行逆量化和逆变换以在像素域中重构残差块。重建单元250理解为求和器,包括执行减法运算的一个或多个组件。重建单元250将重构后的残差块添加到预测单元210产生的预测块中,以产生当前图像的部分或完整的重建图像,该部分或完整的重建图像包括一个或多个重建图像块。On the other hand, the transform and quantization unit 230 forwards the quantized transform coefficients to the inverse transform and quantization unit 240 . The inverse transform and quantization unit 240 inversely quantizes and inversely transforms the quantized transform coefficients to reconstruct the residual block in the pixel domain. Reconstruction unit 250 is understood to be a summer, including one or more components that perform subtraction operations. The reconstruction unit 250 adds the reconstructed residual block to the prediction block generated by the prediction unit 210 to generate a partial or complete reconstructed image of the current image, the partial or complete reconstructed image including one or more reconstructed image blocks.
该重建图像包括第一分量,该第一分量可以为亮度分量,也可以为色度分量。The reconstructed image includes a first component, and the first component may be a luminance component or a chrominance component.
S402、确定对第一分量下的重建图像中的目标区域使用第一ALF进行滤波时,第一ALF的浮点数类型的ALF系数。S402. Determine the ALF coefficients of the floating point type of the first ALF when the target area in the reconstructed image under the first component is filtered using the first ALF.
本申请实施例的视频编码器可以用于不同格式的图像,例如YUV格式或YCbCr格式等。The video encoder in this embodiment of the present application can be used for images in different formats, such as YUV format or YCbCr format.
在AVS3中对于YUV或YCbCr格式中的每个通道都有独立的自适应修正滤波器(以 下简称ALF),例如在色度分量下,一帧图像的第一色度分量(例如U分量或Cb分量)对应一个ALF,一帧图像的第二色度分量(例如V分量或Cr分量)对应一个ALF。在亮度分量下,将一帧图像划分为多个区域,例如划分为16个区域或64个区域,每个区域对应一个ALF。基于此,当第一分量为色度分量时,本申请将第一分量下的整张重建图像作为待滤波的目标区域。当第一分量为亮度分量,本申请对第一分量下的重建图像进行区域划分,例如划分为16个区域或64个区域,将其中一个待滤波的区域作为目标区域。将对目标区域进行自适应修正滤波的ALF记为第一ALF。In AVS3, there is an independent adaptive correction filter (ALF for short) for each channel in the YUV or YCbCr format. For example, under the chrominance component, the first chrominance component of a frame image (such as U component or Cb component) corresponds to an ALF, and the second chrominance component (eg, V component or Cr component) of a frame of image corresponds to an ALF. Under the luminance component, a frame of image is divided into multiple regions, for example, into 16 regions or 64 regions, and each region corresponds to an ALF. Based on this, when the first component is a chrominance component, the present application uses the entire reconstructed image under the first component as the target area to be filtered. When the first component is the luminance component, the present application divides the reconstructed image under the first component into regions, for example, into 16 regions or 64 regions, and takes one of the regions to be filtered as the target region. The ALF that performs adaptive correction filtering on the target area is denoted as the first ALF.
在使用第一ALF对第一分量下的重建图像中的目标区域进行滤波时,首先需求确定该第一ALF的一组ALF系数。When using the first ALF to filter the target area in the reconstructed image under the first component, it is first necessary to determine a set of ALF coefficients of the first ALF.
在一些实施例中,第一ALF的形式可以如图5A所示,该第一ALF的形式为7×7十字形加3×3方形,该第一ALF的一组ALF系数包括9个ALF系数,分别为C0、C1、C2、C3、C4、C5、C6、C7和C8,其中C8为第一ALF的中心点对应的ALF系数,其中该第一ALF中的其他ALF系数关于第一ALF的中心点对称。In some embodiments, the form of the first ALF may be as shown in FIG. 5A , the form of the first ALF is a 7×7 cross plus a 3×3 square, and a set of ALF coefficients of the first ALF includes 9 ALF coefficients , C0, C1, C2, C3, C4, C5, C6, C7, and C8, respectively, where C8 is the ALF coefficient corresponding to the center point of the first ALF, and other ALF coefficients in the first ALF are related to the first ALF Center point symmetry.
在一些实施例中,第一ALF的形式可以如图5B所示,该第一ALF的形式为7×7十字形加5×5方形,该第一ALF的一组ALF系数包括15个ALF系数,分别为C0、C1、C2.....C13和C14,其中C14为第一ALF的中心点对应的ALF系数,其中该第一ALF中的其他ALF系数关于第一ALF的中心点对称。In some embodiments, the form of the first ALF may be as shown in FIG. 5B , the form of the first ALF is a 7×7 cross plus a 5×5 square, and a set of ALF coefficients of the first ALF includes 15 ALF coefficients , respectively C0, C1, C2...C13 and C14, wherein C14 is the ALF coefficient corresponding to the center point of the first ALF, wherein other ALF coefficients in the first ALF are symmetrical with respect to the center point of the first ALF.
本申请中使用维纳霍夫方法导出第一ALF的浮点数类型的ALF系数。In this application, the Wienerhoff method is used to derive the ALF coefficients of the floating point type of the first ALF.
例如,根据如下公式(1),导出第一ALF的浮点数类型的ALF系数:For example, according to the following formula (1), the ALF coefficient of the floating point type of the first ALF is derived:
Figure PCTCN2021073409-appb-000001
Figure PCTCN2021073409-appb-000001
其中,r=(x,y)为目标区域R内的像素点,||R||表示目标区域R内像素点的数量,s[r]表示像素点r的原始像素值,t[r]表示像素点r的重建像素值,即像素点r在重建图像中的像素值。s[r]表示像素点r的原始像素值。C0、C1.....CN-1为第一ALF的浮点数类型的ALF系数。{P 0,P 1,P 2,…,P N-1}为相对于r的位置偏移量。 Among them, r=(x, y) is the pixel in the target area R, ||R|| represents the number of pixels in the target area R, s[r] represents the original pixel value of the pixel r, t[r] Represents the reconstructed pixel value of the pixel point r, that is, the pixel value of the pixel point r in the reconstructed image. s[r] represents the original pixel value of pixel r. C0, C1...CN-1 are the ALF coefficients of the floating point type of the first ALF. {P 0 , P 1 , P 2 ,...,P N-1 } is a position offset relative to r.
若第一ALF的形状如图5A所示,则上述N为8,若第一ALF的形状如图5B所示,则上述N为14。If the shape of the first ALF is shown in FIG. 5A , the above N is 8, and if the shape of the first ALF is shown in FIG. 5B , the above N is 14.
根据上述公式(1),可以推到出第一ALF的浮点数类型的ALF系数C0、C1.....CN-1。According to the above formula (1), the floating point type ALF coefficients C0, C1...CN-1 of the first ALF can be derived.
浮点数类型的ALF系数的取值范围几乎不受限制,在标准的语法元素和编码中,很难使用一个变量去代表一个范围不受限制的浮点数。因此,需要将浮点数类型的ALT系数量化为整数类型的ALT系数,具体的,执行S403至S406的步骤。The value range of ALF coefficients of floating-point type is almost unlimited. In standard syntax elements and encodings, it is difficult to use a variable to represent a floating-point number with unlimited range. Therefore, it is necessary to quantize the ALT coefficients of the floating point type into the ALT coefficients of the integer type. Specifically, the steps of S403 to S406 are performed.
S403、根据第一ALF的浮点数类型的ALF系数,确定第一ALF的浮点数类型的ALF系数的最大量化尺度。S403. Determine the maximum quantization scale of the ALF coefficients of the floating-point number type of the first ALF according to the ALF coefficients of the floating-point number type of the first ALF.
在AVS3中,当第一ALF为图5A所示的9系数滤波器时,第一ALF的前8个ALF系数(即C0、C1、C2、C3、C4、C5、C6和C7)量化后的整数类型的系数被限制在-64~63 的范围内,第9个ALF系数(即C8)量化后的整数类型的系数被限制在0~127的范围内。In AVS3, when the first ALF is the 9-coefficient filter shown in FIG. 5A, the first 8 ALF coefficients (ie C0, C1, C2, C3, C4, C5, C6 and C7) of the first ALF after quantization The coefficients of integer type are limited in the range of -64 to 63, and the coefficients of integer type after the quantization of the ninth ALF coefficient (ie, C8) are limited in the range of 0 to 127.
当第一ALF为图5B所示的15系数滤波器时,第一ALF的前14个ALF系数(即C0、C1……C12和C13)量化后的整数类型的系数被限制在-64~63的范围内,第15个ALF系数(即C14)量化后的整数类型的系数被限制在0~127的范围内。When the first ALF is a 15-coefficient filter as shown in FIG. 5B , the quantized integer-type coefficients of the first 14 ALF coefficients of the first ALF (ie, C0, C1, ... C12, and C13) are limited to -64 to 63 Within the range of , the quantized integer type coefficient of the 15th ALF coefficient (ie, C14) is limited to the range of 0-127.
这样可以根据第一ALF的浮点数类型的ALF系数和浮点数类型的ALF系数量化为整数类型时所对应的整数系数阈值,确定第一ALF的浮点数类型的ALF系数的最大量化尺度。In this way, the maximum quantization scale of the floating-point ALF coefficient of the first ALF can be determined according to the floating-point ALF coefficient of the first ALF and the integer coefficient threshold corresponding to the quantization of the floating-point ALF coefficient to the integer type.
在一些实施例中,上述S403包括如下S403-A1和S403-A2:In some embodiments, the above S403 includes the following S403-A1 and S403-A2:
S403-A1、根据第一ALF的浮点数类型的ALF系数中的第一系数和第一系数对应的最大整数系数阈值,确定将浮点数类型的ALF系数量化为整数类型时所允许的最大移位值;S403-A1. According to the first coefficient in the ALF coefficients of the floating point type of the first ALF and the maximum integer coefficient threshold corresponding to the first coefficient, determine the maximum shift allowed when the ALF coefficient of the floating point type is quantized into an integer type value;
S403-A2、根据最大移位值,确定第一ALF的浮点数类型的ALF系数的最大量化尺度。S403-A2: Determine the maximum quantization scale of the floating-point type ALF coefficient of the first ALF according to the maximum shift value.
第一ALF的各ALF系数中,第一ALF的中心位置对应的ALF系数,例如C8或C14最大,第一ALF的非中心位置对应的ALF系数较小。上述第一系数可以为第一ALF的中心位置对应的浮点类型的ALF系数,也可以是第一ALF的非中心位置对应的浮点类型的ALF系数。Among the ALF coefficients of the first ALF, the ALF coefficient corresponding to the center position of the first ALF, for example, C8 or C14 is the largest, and the ALF coefficient corresponding to the non-center position of the first ALF is smaller. The above-mentioned first coefficient may be a floating-point type ALF coefficient corresponding to the center position of the first ALF, or may be a floating-point type ALF coefficient corresponding to a non-center position of the first ALF.
在一种示例中,若上述第一系数为第一ALF中非中心位置对应的各浮点类型的ALF系数中最小的一个浮点类型的ALF系数,即为ALF系数W min(x,y),该ALF系数W min(x,y)对应的最大整数系数阈值为b1。这样,可以根据ALF系数W min(x,y)和b1,确定出将浮点类型的ALF系数W min(x,y)量化为整数类型时所允许的最大移位值。 In an example, if the above-mentioned first coefficient is the smallest floating-point type ALF coefficient among the floating-point type ALF coefficients corresponding to the non-center position in the first ALF, it is the ALF coefficient W min(x, y) , the maximum integer coefficient threshold corresponding to the ALF coefficient W min(x, y) is b1. In this way, according to the ALF coefficients W min(x, y) and b1, the maximum shift value allowed when the floating-point type ALF coefficient W min(x, y) is quantized into an integer type can be determined.
例如,根据如下公式(2),确定出将浮点数类型的ALF系数量化为整数类型时所允许的最大移位值bitshift:For example, according to the following formula (2), the maximum shift value bitshift allowed when quantizing the ALF coefficient of the floating-point type into an integer type is determined:
Figure PCTCN2021073409-appb-000002
Figure PCTCN2021073409-appb-000002
其中,floor为向下取整,W max(x,y)为第一ALF的非中心位置对应的浮点类型的ALF系数中最大的ALF系数,x与y均不等于0。d1为W max(x,y)对应的最大整数系数阈值,例如d1为63。 Wherein, floor is rounded down, W max(x, y) is the largest ALF coefficient among the floating-point type ALF coefficients corresponding to the non-center position of the first ALF, and neither x nor y is equal to 0. d1 is the maximum integer coefficient threshold corresponding to W max(x, y) , for example, d1 is 63.
在另一种示例中,若第一系数为第一ALF的中心位置对应的浮点类型的系数,此时可以根据如下公式(3),确定出将浮点数类型的ALF系数量化为整数类型时所允许的最大移位值bitshift:In another example, if the first coefficient is a coefficient of floating point type corresponding to the center position of the first ALF, it can be determined according to the following formula (3) when the ALF coefficient of floating point type is quantized into an integer type Maximum allowed shift value bitshift:
Figure PCTCN2021073409-appb-000003
Figure PCTCN2021073409-appb-000003
其中,W f(0,0)为第一ALF的中心位置对应的浮点类型的系数,d为W f(0,0)对应的最大整数系数阈值,例如d为127。 Wherein, W f(0,0) is the floating-point type coefficient corresponding to the center position of the first ALF, and d is the maximum integer coefficient threshold corresponding to W f(0,0) , for example, d is 127.
根据上述方法,可以确定出将浮点数类型的ALF系数量化为整数类型时所允许的最 大移位值bitshift,接着,根据最大移位值bitshift,确定出第一ALF的浮点数类型的ALF系数的最大量化尺度。According to the above method, it is possible to determine the maximum shift value bitshift allowed when the ALF coefficient of the floating point type is quantized into an integer type, and then, according to the maximum shift value bitshift, determine the ALF coefficient of the floating point type of the first ALF. Maximum quantization scale.
例如,根据如下公式(4),确定第一ALF的浮点数类型的ALF系数的最大量化尺度:For example, according to the following formula (4), the maximum quantization scale of the ALF coefficients of the floating point type of the first ALF is determined:
Scale max=2 bitshift           (4) Scale max = 2 bitshift (4)
其中,Scale max为最大量化尺度。 Among them, Scale max is the maximum quantization scale.
在确定出第一ALF的浮点数类型的ALF系数的最大量化尺度后,执行如下S404,确定第一ALF的浮点数类型的ALF系数的目标量化尺度。After the maximum quantization scale of the ALF coefficients of the floating point type of the first ALF is determined, the following S404 is performed to determine the target quantization scale of the ALF coefficients of the floating point type of the first ALF.
S404、根据最大量化尺度,确定第一ALF的浮点数类型的ALF系数的目标量化尺度。S404. Determine, according to the maximum quantization scale, the target quantization scale of the ALF coefficients of the floating point type of the first ALF.
其中,目标量化尺度小于或等于最大量化尺度。例如,最大量化尺度为2 8,这样,可以确定目标量化尺度为2 7或2 6或2 5等小于或等于2 8,且大于1的2的幂次方。 Among them, the target quantization scale is less than or equal to the maximum quantization scale. For example, the maximum quantization scale is 2 8 , in this way, it can be determined that the target quantization scale is 2 7 or 2 6 or 2 5 smaller than or equal to 2 8 and greater than 1 to the power of 2.
上述S404中根据最大量化尺度,确定第一ALF的浮点数类型的ALF系数的目标量化尺度的方式包括但不限于如下几种:In the above-mentioned S404, according to the maximum quantization scale, the methods for determining the target quantization scale of the ALF coefficients of the floating point type of the first ALF include but are not limited to the following:
方式一,若第一分量为亮度分量,则将第二量化尺度确定为第二ALF的浮点数类型的ALF系数的目标量化尺度,第二量化尺度小于或等于最大量化尺度。Manner 1, if the first component is a luminance component, the second quantization scale is determined as the target quantization scale of the floating-point type ALF coefficient of the second ALF, and the second quantization scale is less than or equal to the maximum quantization scale.
此时,在一些实施例中,若该重建图像包括色度分量时,将第三量化尺度确定为第三ALF的浮点数类型的ALF系数的目标量化尺度,第三ALF为对色度分量下的重建图像进行ALS滤波时使用的滤波器,其中第三量化尺度小于第二量化尺度。At this time, in some embodiments, if the reconstructed image includes chrominance components, the third quantization scale is determined as the target quantization scale of the floating-point type ALF coefficients of the third ALF, and the third ALF is the target quantization scale for the chrominance components. The filter used when ALS filtering the reconstructed image, where the third quantization scale is smaller than the second quantization scale.
这是因为眼睛对亮度更敏感,因此对亮度分量下的重建图像使用更高量化精度,以提高重建图像的亮度信息。眼睛对色度的敏感度较低,因此对色度分量下的重建图像使用较低量化精度,以提高编码效率。This is because the eye is more sensitive to luminance, so higher quantization precision is used for the reconstructed image under the luminance component to improve the luminance information of the reconstructed image. The eye is less sensitive to chrominance, so a lower quantization precision is used for the reconstructed image under the chrominance component to improve coding efficiency.
基于此,当第一分量为亮度分量时,将较大的第二量化尺度确定为第二ALF的浮点数类型的ALF系数的目标量化尺度。这样使用第二量化尺度量化后的第二ALF具有更高的量化精度,使用该第二ALF对亮度分量下的重建图像进行滤波时,可以提高滤波的精度。例如,最大量化尺度为2 8,则确定第二量化尺度为2 8、2 7或2 6等。 Based on this, when the first component is a luminance component, the larger second quantization scale is determined as the target quantization scale of the floating-point type ALF coefficient of the second ALF. In this way, the second ALF quantized by using the second quantization scale has higher quantization accuracy, and when the reconstructed image under the luminance component is filtered by using the second ALF, the filtering accuracy can be improved. For example, if the maximum quantization scale is 2 8 , the second quantization scale is determined to be 2 8 , 2 7 or 2 6 and so on.
在该方式中,确定出亮度分量对应的目标量化尺度后,直接将比第二量化尺度小的第三量化尺度确定为色度分量对应的目标量化尺度,即使用第三ALF对色度分量下的重建图像进行滤波时,可以将第三量化尺度确定为第三ALF的浮点数类型的ALF系数的目标量化尺度,不需要额外计算色度分量对应的目标量化尺度,减少计算量,提高编码效率。例如,最大量化尺度为2 8,第二量化尺度为2 8、2 7或2 6,第三量化尺度为2 5或2 4等。 In this method, after the target quantization scale corresponding to the luminance component is determined, the third quantization scale smaller than the second quantization scale is directly determined as the target quantization scale corresponding to the chrominance component, that is, the third ALF is used to quantify the chrominance component. When filtering the reconstructed image, the third quantization scale can be determined as the target quantization scale of the floating-point type ALF coefficient of the third ALF, and there is no need to additionally calculate the target quantization scale corresponding to the chrominance component, reducing the amount of calculation and improving the coding efficiency. . For example, the largest quantization scale is 2 8 , the second quantization scale is 2 8 , 2 7 or 2 6 , the third quantization scale is 2 5 or 2 4 and so on.
方式二,若第一分量为色度分量,将第四量化尺度确定为第二ALF的浮点数类型的ALF系数的的目标量化尺度,第四量化尺度小于最大量化尺度。In the second method, if the first component is a chrominance component, the fourth quantization scale is determined as the target quantization scale of the floating-point type ALF coefficient of the second ALF, and the fourth quantization scale is smaller than the maximum quantization scale.
此时,在一些实施例中,将第五量化尺度确定为第四ALF的浮点数类型的ALF系数的目标量化尺度,第四ALF为对亮度分量下的重建图像进行ALS滤波时使用的滤波器,第五量化尺度大于第四量化尺度。At this time, in some embodiments, the fifth quantization scale is determined as the target quantization scale of the floating-point type ALF coefficient of the fourth ALF, and the fourth ALF is a filter used when performing ALS filtering on the reconstructed image under the luminance component , the fifth quantization scale is larger than the fourth quantization scale.
该方式中,当第一分量为色度分量时,将较小的第四量化尺度确定为第二ALF的浮点数类型的ALF系数的目标量化尺度。这样使用第四量化尺度量化后的第二ALF的ALF 系数编码尺度较短,便于编码。例如,最大量化尺度为2 8,则确定第四量化尺度为2 5、或2 4等。 In this manner, when the first component is a chrominance component, a smaller fourth quantization scale is determined as the target quantization scale of the ALF coefficients of the floating point type of the second ALF. In this way, the coding scale of the ALF coefficients of the second ALF quantized by using the fourth quantization scale is shorter, which is convenient for coding. For example, if the maximum quantization scale is 2 8 , the fourth quantization scale is determined to be 2 5 , or 2 4 and so on.
在该方式中,确定出色度分量对应的目标量化尺度后,直接将比第四量化尺度大的第五量化尺度确定为亮度分量对应的目标量化尺度,不需要额外计算亮度分量对应的目标量化尺度,减少计算量,提高编码效率。例如,最大量化尺度为2 8,第三量化尺度为2 5或2 4等,第五量化尺度为2 8、2 7或2 6等。 In this method, after the target quantization scale corresponding to the chrominance component is determined, the fifth quantization scale larger than the fourth quantization scale is directly determined as the target quantization scale corresponding to the luminance component, and there is no need to additionally calculate the target quantization scale corresponding to the luminance component , reduce the amount of calculation and improve the coding efficiency. For example, the largest quantization scale is 28 , the third quantization scale is 25 or 24 , etc., and the fifth quantization scale is 28 , 27 , 26 , etc.
方式三,上述S404包括如下S404-A1和S404-A2:Mode 3, the above S404 includes the following S404-A1 and S404-A2:
S404-A1、针对最大量化尺度与预设的最小量化尺度构成的量化区间内的每一个第一量化尺度,确定第一量化尺度的量化代价,其中,第一量化尺度为2的幂次方的正整数;S404-A1. For each first quantization scale in the quantization interval formed by the maximum quantization scale and the preset minimum quantization scale, determine the quantization cost of the first quantization scale, wherein the first quantization scale is a power of 2 positive integer;
S404-A2、根据每一个第一量化尺度的量化代价,确定第一ALF的浮点数类型的ALF系数的目标量化代价。S404-A2. Determine, according to the quantization cost of each first quantization scale, the target quantization cost of the floating-point type ALF coefficient of the first ALF.
该实现方式中,最大量化尺度和预设的最小量化尺度构成量化区间,为了便于描述,将该量化区间内的每一个量化尺度即为第一量化尺度。确定该量化区间内每一个第一量化尺度的量化代价,并根据每一个第一量化尺度的量化代价,确定第一ALF的浮点数类型的ALF系数的目标量化代价。例如,将量化代价最小的第一量化尺度确定为第一ALF的浮点数类型的ALF系数的目标量化代价。或者,将各第一量化尺度的量化代价的平均值确定为第一ALF的浮点数类型的ALF系数的目标量化代价,其中平均值可以为算数平均值,也可以为加权平均值。In this implementation manner, the maximum quantization scale and the preset minimum quantization scale constitute a quantization interval. For convenience of description, each quantization scale in the quantization interval is the first quantization scale. The quantization cost of each first quantization scale in the quantization interval is determined, and according to the quantization cost of each first quantization scale, the target quantization cost of the ALF coefficient of the floating point type of the first ALF is determined. For example, the first quantization scale with the smallest quantization cost is determined as the target quantization cost of the floating point type ALF coefficients of the first ALF. Alternatively, the average value of the quantization costs of the first quantization scales is determined as the target quantization cost of the floating-point type ALF coefficients of the first ALF, where the average value may be an arithmetic average value or a weighted average value.
可选的,上述预设的最小量化尺度为2 0,即1。 Optionally, the above preset minimum quantization scale is 2 0 , that is, 1.
可选的,上述预设的最小量化尺度为2 1或2 2等。 Optionally, the above preset minimum quantization scale is 2 1 or 2 2 or the like.
下面对上述S404-A1中确定第一量化尺度的量化代价的过程进行详细介绍。The process of determining the quantization cost of the first quantization scale in the above S404-A1 will be described in detail below.
需要说明的是,对应量化区间内的每一个第一量化尺度,确定量化代价的方式相同,为了便于阐述,本申请以一个第一量化尺度为例进行说明。It should be noted that, corresponding to each first quantization scale in the quantization interval, the quantization cost is determined in the same manner. For ease of description, the present application takes a first quantization scale as an example for description.
在一些实施例中,将第一量化尺度的编码代价,确定第一量化尺度的量化代价,例如,使用第一量化尺度量化第一ALF的浮点类型的ALF系数量化为整数类型的第一ALF系数,编码整数类型的第一ALF系数所占用的比特数,确定为该第一量化尺度的量化代价。In some embodiments, the encoding cost of the first quantization scale is determined as the quantization cost of the first quantization scale, for example, the floating-point type ALF coefficients of the first ALF are quantized using the first quantization scale to the integer type first ALF The coefficient, the number of bits occupied by the first ALF coefficient of the encoding integer type, is determined as the quantization cost of the first quantization scale.
在一些实施例中,上述S404-A1中确定第一量化尺度的量化代价包括如下步骤S404-A11至S404-A13:In some embodiments, determining the quantization cost of the first quantization scale in the above S404-A1 includes the following steps S404-A11 to S404-A13:
S404-A11、使用第一量化尺度,将第一ALF的浮点类型的ALF系数量化为整数类型的第一ALF系数;S404-A11, using the first quantization scale, quantize the ALF coefficients of the floating point type of the first ALF into the first ALF coefficients of the integer type;
S404-A12、确定使用第一ALF系数对重建图像的目标区域进行编码时,第一ALF系数对应的量化失真结果;S404-A12, determining the quantization distortion result corresponding to the first ALF coefficient when the target area of the reconstructed image is encoded using the first ALF coefficient;
S404-A13、根据第一ALF系数对应的量化失真结果,以及编码第一ALF系数所消耗的比特数,确定第一量化尺度的量化代价。S404-A13: Determine the quantization cost of the first quantization scale according to the quantization distortion result corresponding to the first ALF coefficient and the number of bits consumed by encoding the first ALF coefficient.
在该实现方式中,首先使用该第一量化尺度将第一ALF的浮点类型的ALF系数量化为整数类型的第一ALF系数,例如,根据如下公式(5),将第一ALF的浮点类型的ALF系数量化为整数类型的第一ALF系数:In this implementation manner, the first quantization scale is used to quantize the ALF coefficients of the floating point type of the first ALF into the first ALF coefficients of the integer type. For example, according to the following formula (5), the floating point coefficients of the first ALF are quantized An ALF coefficient of type is quantized to the first ALF coefficient of an integer type:
AlfCoeff integer=round(AlfCoeff float×2 p)       (5) AlfCoeff integer = round(AlfCoeff float ×2 p ) (5)
其中,AlfCoeff integer为整数类型的第一ALF系数,AlfCoeff float为第一ALF的浮点类型的ALF系数,round为四舍五入运算,2 P为第一量化尺度。 Wherein, AlfCoeff integer is the first ALF coefficient of the integer type, AlfCoeff float is the ALF coefficient of the floating point type of the first ALF, round is the rounding operation, and 2 P is the first quantization scale.
将第一ALF的浮点类型的ALF系数量化为整数类型的第一ALF系数后,执行S404-A12确定使用该整数类型的第一ALF系数对第一分量下的重建图像的目标区域进行编码时,第一ALF系数对应的量化失真结果。After quantizing the ALF coefficients of the floating point type of the first ALF into the first ALF coefficients of the integer type, perform S404-A12 to determine when the first ALF coefficient of the integer type is used to encode the target area of the reconstructed image under the first component , the quantization distortion result corresponding to the first ALF coefficient.
在一些实施例中,上述S404-A12中确定使用第一ALF系数对重建图像的目标区域进行编码时,第一ALF系数对应的量化失真结果的方式包括但不限于如下几种:In some embodiments, when it is determined in S404-A12 that the first ALF coefficient is used to encode the target area of the reconstructed image, the manner of the quantization distortion result corresponding to the first ALF coefficient includes but is not limited to the following:
方式一,根据目标区域中像素点的重建像素值,确定目标区域中像素点的自相关系数;根据目标区域中像素点的原始像素值,确定目标区域中像素点的互相关系数;根据目标区域中像素点的自相关系数与第一ALF系数乘积,以及目标区域中像素点的互相关系数,确定第一ALF系数对应的量化失真结果。Method 1: Determine the autocorrelation coefficient of the pixels in the target area according to the reconstructed pixel values of the pixels in the target area; determine the cross-correlation coefficient of the pixels in the target area according to the original pixel values of the pixels in the target area; According to the target area The product of the autocorrelation coefficient of the middle pixel and the first ALF coefficient, and the cross-correlation coefficient of the pixel in the target area, determine the quantization distortion result corresponding to the first ALF coefficient.
假设目标区域中像素点的自相关系数为矩阵E,根据如下公式(6),可以确定目标区域中像素点的自相关系数E:Assuming that the autocorrelation coefficient of the pixels in the target area is the matrix E, according to the following formula (6), the autocorrelation coefficient E of the pixels in the target area can be determined:
Figure PCTCN2021073409-appb-000004
Figure PCTCN2021073409-appb-000004
其中,r=(x,y)为目标区域R内的像素点,||R||表示目标区域R内像素点的数量,s[r]表示像素点r的原始像素值,t[r]表示像素点r的重建像素值,即像素点r在重建图像中的像素值。{P 0,P 1,P 2,…,P N-1}为相对于r的位置偏移量。 Among them, r=(x, y) is the pixel in the target area R, ||R|| represents the number of pixels in the target area R, s[r] represents the original pixel value of the pixel r, t[r] Represents the reconstructed pixel value of the pixel point r, that is, the pixel value of the pixel point r in the reconstructed image. {P 0 , P 1 , P 2 ,...,P N-1 } is a position offset relative to r.
假设目标区域中像素点的互相关系数为矩阵Y,根据如下公式(7),可以确定目标区域中像素点的互相关系数Y:Assuming that the cross-correlation coefficient of pixels in the target area is matrix Y, according to the following formula (7), the cross-correlation coefficient Y of pixels in the target area can be determined:
Figure PCTCN2021073409-appb-000005
Figure PCTCN2021073409-appb-000005
其中,s[r]表示像素点r的原始像素值。Among them, s[r] represents the original pixel value of the pixel point r.
根据上述方式,确定出目标区域内像素点的自相关系数E和互相关系数Y后,根据目标区域中像素点的自相关系数E与第一ALF系数乘积,以及目标区域中像素点的互相关系数Y,确定第一ALF系数对应的量化失真结果。According to the above method, after determining the autocorrelation coefficient E and the cross-correlation coefficient Y of the pixels in the target area, according to the product of the autocorrelation coefficient E and the first ALF coefficient of the pixels in the target area, and the mutual relationship of the pixels in the target area Calculate Y to determine the quantization distortion result corresponding to the first ALF coefficient.
例如,根据如下公式(8),确定第一ALF系数对应的量化失真结果:For example, according to the following formula (8), determine the quantization distortion result corresponding to the first ALF coefficient:
D=A*C-Y             (8)D=A*C-Y (8)
其中,D为第一ALF系数对应的量化失真结果,C为第一ALF系数。Wherein, D is the quantization distortion result corresponding to the first ALF coefficient, and C is the first ALF coefficient.
在一些实施例中,假设目标区域的自相关系数和互相关系数分别记作E[15][15]和y[15],15为第一ALF的ALF系数个数,coeff[i]为第一ALF系数,执行如下程序,得到第一ALF系数对应的量化失真结果D:In some embodiments, it is assumed that the autocorrelation coefficient and cross-correlation coefficient of the target area are respectively denoted as E[15][15] and y[15], where 15 is the number of ALF coefficients of the first ALF, and coeff[i] is the first ALF coefficient. For an ALF coefficient, execute the following procedure to obtain the quantization distortion result D corresponding to the first ALF coefficient:
Figure PCTCN2021073409-appb-000006
Figure PCTCN2021073409-appb-000006
其中,dist的值即为D。Among them, the value of dist is D.
方式二,使用第一ALF系数对重建图像的目标区域进行滤波;根据目标区域中像素点的滤波后像素值和原始像素值的差值,确定第一ALF系数对应的量化失真结果。Method 2: Use the first ALF coefficient to filter the target area of the reconstructed image; determine the quantization distortion result corresponding to the first ALF coefficient according to the difference between the filtered pixel value and the original pixel value of the pixel in the target area.
具体的,根据第一ALF系数,使用第一ALF对第一分量下的重建图像的目标区域进行滤波,得到滤波后的目标区域。将滤波后目标区域中像素点的滤波后的像素值与原始像素值进行比较,得到像素值的插值,根据像素值的差值,确定第一ALF系数对应的量化失真结果。例如差值越大,则第一ALF系数对应的量化失真越大,差值越小,则第一ALF系数对应的量化失真越小。Specifically, according to the first ALF coefficient, the first ALF is used to filter the target area of the reconstructed image under the first component to obtain the filtered target area. The filtered pixel values of the pixel points in the filtered target area are compared with the original pixel values to obtain the interpolation of the pixel values, and the quantization distortion result corresponding to the first ALF coefficient is determined according to the difference of the pixel values. For example, the larger the difference value, the larger the quantization distortion corresponding to the first ALF coefficient, and the smaller the difference value, the smaller the quantization distortion corresponding to the first ALF coefficient.
根据上述方式一和方式二,确定出第一ALF系数对应的量化失真结果。According to the above manners 1 and 2, the quantization distortion result corresponding to the first ALF coefficient is determined.
接着,根据第一ALF系数对应的量化失真结果,以及编码第一ALF系数所消耗的比特数,确定第一量化尺度的量化代价。Next, the quantization cost of the first quantization scale is determined according to the quantization distortion result corresponding to the first ALF coefficient and the number of bits consumed for encoding the first ALF coefficient.
例如,根据如下公式(9),确定第一量化尺度的量化代价:For example, according to the following formula (9), determine the quantization cost of the first quantization scale:
J=D+λR           (9)J=D+λR (9)
其中,J为第一量化尺度的量化代价,D为第一ALF系数对应的量化失真结果,R为编码第一ALF系数所消耗的比特数,λ为可变值。Among them, J is the quantization cost of the first quantization scale, D is the quantization distortion result corresponding to the first ALF coefficient, R is the number of bits consumed for encoding the first ALF coefficient, and λ is a variable value.
在一些实施例中,R为对编码第一ALF系数所消耗的比特数的估算。In some embodiments, R is an estimate of the number of bits consumed to encode the first ALF coefficient.
具体的,此处以15系数的ALF为例,需要去估算15个滤波系数消耗的比特数的总和。针对每一个滤波系数,用带符号的变长码(有符号的指数哥伦布)的码字长度代表,具体如表1所示:Specifically, taking an ALF with 15 coefficients as an example, it is necessary to estimate the sum of the number of bits consumed by the 15 filter coefficients. For each filter coefficient, it is represented by the codeword length of a signed variable-length code (signed exponential Golomb), as shown in Table 1:
表1Table 1
系数值Coefficient value 码字numbers 消耗比特数consume bits
00 11 11
11 010010 33
-1-1 011011 33
22 0010000100 55
-2-2 0010100101 55
33 0011000110 55
-3-3 0011100111 55
44 00010000001000 77
-4-4 00010010001001 77
55 00010100001010 77
-5-5 00010110001011 77
66 00011000001100 77
-6-6 00011010001101 77
77 00011100001110 77
-7-7 00011110001111 77
例如滤波系数为0则消耗比特数为1比特,滤波系数为3则消耗比特数为5比特,查表1可以得到编码第一ALF系数中每一个ALF系数所消耗的比特数,将每一个ALF系数所消耗的比特数之和,作为R的值,带入上述公式(9)得到第一量化尺度的量化代价。For example, if the filter coefficient is 0, the number of bits consumed is 1 bit, and if the filter coefficient is 3, the number of bits consumed is 5 bits. Look up Table 1 to obtain the number of bits consumed by each ALF coefficient in the encoding of the first ALF coefficients. The sum of the bits consumed by the coefficients, as the value of R, is brought into the above formula (9) to obtain the quantization cost of the first quantization scale.
参照上述方式,可以确定出最大量化尺度与预设的最小量化尺度构成的量化区间内的每一个第一量化尺度对应的量化代价。根据每一个第一量化尺度的量化代价,确定第一ALF的浮点数类型的ALF系数的目标量化代价。例如,将量化代价最小的第一量化尺度确定为第一ALF的浮点数类型的ALF系数的目标量化代价。接着,执行如下步骤S405。Referring to the above manner, the quantization cost corresponding to each first quantization scale in the quantization interval formed by the maximum quantization scale and the preset minimum quantization scale can be determined. According to the quantization cost of each first quantization scale, the target quantization cost of the floating-point type ALF coefficient of the first ALF is determined. For example, the first quantization scale with the smallest quantization cost is determined as the target quantization cost of the floating point type ALF coefficients of the first ALF. Next, the following step S405 is performed.
S405、使用目标量化尺度,将第一ALF的浮点数类型的ALF系数量化为整数类型的ALF系数。S405. Using the target quantization scale, quantize the floating-point ALF coefficients of the first ALF into integer-type ALF coefficients.
例如,根据如下公式(10),将第一ALF的浮点类型的ALF系数量化为整数类型的ALF系数:For example, according to the following formula (10), the ALF coefficients of the floating point type of the first ALF are quantized into the ALF coefficients of the integer type:
AlfCoeff integer=round(AlfCoeff float×2 Alfshift)        (10) AlfCoeff integer = round(AlfCoeff float ×2 Alfshift ) (10)
其中,AlfCoeff integer为整数类型的ALF系数,AlfCoeff float为第一ALF的浮点类型的ALF系数,round为四舍五入运算,2 Alfshift为目标量化尺度。 Among them, AlfCoeff integer is an ALF coefficient of integer type, AlfCoeff float is an ALF coefficient of floating point type of the first ALF, round is a rounding operation, and 2 Alfshift is a target quantization scale.
S406、对第一ALF的整数类型的ALF系数进行编码,得到码流。S406: Encode the integer-type ALF coefficients of the first ALF to obtain a code stream.
根据上述方法,确定出第一ALF的整数类型的ALF系数后,对第一ALF的整数类型的ALF系数进行编码,携带在码流中发送给解码端。这样,解码端从码流中解码出当前图像的残差值,根据残差值确定出当前图像的重建图像,并从码流中解码出第一ALF的整数类型的ALF系数,根据第一ALF的整数类型的ALF系数,使用第一ALF对第一分量下的重建图像中的目标区域进行滤波,以提高重建图像的精度。According to the above method, after the ALF coefficients of the integer type of the first ALF are determined, the ALF coefficients of the integer type of the first ALF are encoded, carried in the code stream, and sent to the decoding end. In this way, the decoding end decodes the residual value of the current image from the code stream, determines the reconstructed image of the current image according to the residual value, and decodes the integer type ALF coefficient of the first ALF from the code stream. The integer-type ALF coefficients are used to filter the target area in the reconstructed image under the first component using the first ALF to improve the accuracy of the reconstructed image.
在一些实施例中,码流中包括第一ALF的所有整数类型的ALF系数。这样,解码端直接可以从码流中解码出第一ALF的所有整数类型的ALF系数,用于后期的滤波,而不需进行额度的ALF系数计算,进而提高解码端的滤波效率。In some embodiments, all integer-type ALF coefficients of the first ALF are included in the codestream. In this way, the decoding end can directly decode all integer-type ALF coefficients of the first ALF from the code stream, which are used for later filtering without the need to calculate the amount of ALF coefficients, thereby improving the filtering efficiency of the decoding end.
在一些实施例中,码流中包括第一ALF的整数类型的第二ALF系数和第一信息,第二ALF系数为第一ALF中非中心点对应的整数类型的ALF系数,第一信息用于指示目标量化尺度。这样,解码端从码流中解码出第一ALF的整数类型的第二ALF系数和 第一信息后,需要根据第二ALF系数和第一信息,确定第一ALF的第一ALF系数,进而根据第一ALF系数和第二ALF系数,使用第一ALF对第一分量下的重建图像中的目标区域进行滤波,其中根据第二ALF系数和第一信息,确定第一ALF的第一ALF系数参照上面解码端的具体描述,在此不再赘述。In some embodiments, the code stream includes integer-type second ALF coefficients of the first ALF and first information, the second ALF coefficients are integer-type ALF coefficients corresponding to non-central points in the first ALF, and the first information is an integer-type ALF coefficient. to indicate the target quantization scale. In this way, after decoding the second ALF coefficient and the first information of the integer type of the first ALF from the code stream, the decoding end needs to determine the first ALF coefficient of the first ALF according to the second ALF coefficient and the first information, and then according to The first ALF coefficient and the second ALF coefficient are used to filter the target area in the reconstructed image under the first component by using the first ALF, wherein the first ALF coefficient reference of the first ALF is determined according to the second ALF coefficient and the first information The specific description of the decoding end above will not be repeated here.
在一种示例中,第一信息包括目标量化尺度对应的目标移位值。例如,目标量化尺度为2 Alfshift,则目标移位值为Alfshift。 In one example, the first information includes a target shift value corresponding to the target quantization scale. For example, if the target quantization scale is 2 Alfshift , the target shift value is Alfshift.
在一种示例中,第一信息包括目标量化尺度对应的目标移位值与第一数值的差值的绝对值。例如,目标量化尺度对应的目标移位值为Alfshift,第一数值为a,则第一信息包括|Alfshift-a|,这样可以减少第一信息的数据量,节约编码资源。In one example, the first information includes the absolute value of the difference between the target shift value corresponding to the target quantization scale and the first numerical value. For example, if the target shift value corresponding to the target quantization scale is Alfshift and the first value is a, the first information includes |Alfshift-a|, which can reduce the data amount of the first information and save coding resources.
可选的,第一数值为6、5或4等。Optionally, the first value is 6, 5, or 4, etc.
本申请在语法语义层面的改动,如下表2所示:The changes of the present application at the grammatical and semantic level are shown in Table 2 below:
表2Table 2
Figure PCTCN2021073409-appb-000007
Figure PCTCN2021073409-appb-000007
adaptive_filter_shift_enable_flag为自适应修正滤波器形状量化尺度标志,为二值变量。值为‘1’表示自适应修正滤波可使用7×7十字形加5×5方形滤波器形状;值为‘0’表示自适应修正滤波使用7×7十字形加3×3方形滤波器形状。adaptive_filter_shift_enable_flag is the adaptive modification filter shape quantization scale flag, which is a binary variable. A value of '1' indicates that the adaptive correction filtering can use a 7×7 cross plus a 5×5 square filter shape; a value of '0' indicates that the adaptive correction filtering uses a 7×7 cross plus a 3×3 square filter shape .
adaptive_filter_shift_enable_flag为自适应修正滤波器移位使能标志,为二值变量。值为‘1’表示采用本申请的方案,自适应修正滤波器移位值发生变化;值为‘0’表示未采用本申请的方案,自适应修正滤波器移位值未变化变化,例如依然为6。adaptive_filter_shift_enable_flag is the adaptive modification filter shift enable flag, which is a binary variable. A value of '1' indicates that the solution of the present application is adopted, and the shift value of the adaptive correction filter changes; a value of '0' indicates that the solution of the present application is not adopted, and the shift value of the adaptive correction filter does not change, for example, still is 6.
AlfShiftEnableFlag的值等于adaptive_filter_shift_enable_flag的值。The value of AlfShiftEnableFlag is equal to the value of adaptive_filter_shift_enable_flag.
在当前图像的重建图像的亮度分量和色度分量均采用本申请的技术方案时,码流中的第一信息包括亮度分量对应的移位信息和色度分量对应的移位信息,具体如下表3所示:When both the luminance component and the chrominance component of the reconstructed image of the current image adopt the technical solution of the present application, the first information in the code stream includes the shift information corresponding to the luminance component and the shift information corresponding to the chrominance component, as shown in the following table. 3 shows:
表3table 3
Figure PCTCN2021073409-appb-000008
Figure PCTCN2021073409-appb-000008
Figure PCTCN2021073409-appb-000009
Figure PCTCN2021073409-appb-000009
其中,alf_luma_shift_num_minus6[i]为图像亮度分量样本对应的自适应修正滤波器的系数偏移。Among them, alf_luma_shift_num_minus6[i] is the coefficient shift of the adaptive correction filter corresponding to the image luminance component sample.
由上述描述可知,亮度分量可以对应多个自适应修正滤波器,例如16或64个。It can be known from the above description that the luminance component may correspond to multiple adaptive correction filters, for example, 16 or 64.
alf_coeff_luma[i][j]表示亮度分量对应的第i个自适应修正滤波器的第j个ALF系数,该第j个ALF系数可以理解为上述的第二ALF系数。alf_coeff_luma[i][j] represents the j-th ALF coefficient of the i-th adaptive correction filter corresponding to the luminance component, and the j-th ALF coefficient can be understood as the above-mentioned second ALF coefficient.
alf_luma_shift_num_minus6[i]表示亮度分量对应的第i个自适应修正滤波器的量化尺度移位值减6,其中6可以理解为上述的第一数值。此时,AlfLumaShift[i]=alf_luma_shift_num_minus6[i]+6。alf_luma_shift_num_minus6[i] represents the quantization scale shift value of the i-th adaptive correction filter corresponding to the luminance component minus 6, where 6 can be understood as the above-mentioned first value. At this time, AlfLumaShift[i]=alf_luma_shift_num_minus6[i]+6.
alf_chroma_shift_num_minus6[i]表示图像色度分量样本对应的自适应修正滤波器的系数偏移,其中i=0,1。alf_chroma_shift_num_minus6[i] represents the coefficient shift of the adaptive correction filter corresponding to the image chroma component samples, where i=0,1.
当i=0时,alf_coeff_chroma[0][j]表示Cb分量对应的自适应修正滤波器的第j个ALF参数。该第j个ALF系数可以理解为上述的第二ALF系数。When i=0, alf_coeff_chroma[0][j] represents the jth ALF parameter of the adaptive correction filter corresponding to the Cb component. The jth ALF coefficient can be understood as the above-mentioned second ALF coefficient.
alf_chroma_shift_num_minus6[0]表示Cb分量对应的自适应修正滤波器的量化尺度移位值减6。此时,AlfChromaShift[0]=alf_chroma_shift_num_minus6[0]+6。alf_chroma_shift_num_minus6[0] represents the quantization scale shift value of the adaptive correction filter corresponding to the Cb component minus 6. At this time, AlfChromaShift[0]=alf_chroma_shift_num_minus6[0]+6.
当i=1时,alf_coeff_chroma[1][j]表示Cr分量对应的自适应修正滤波器的第j个ALF参数。该第j个ALF系数可以理解为上述的第二ALF系数。When i=1, alf_coeff_chroma[1][j] represents the jth ALF parameter of the adaptive correction filter corresponding to the Cr component. The jth ALF coefficient can be understood as the above-mentioned second ALF coefficient.
alf_chroma_shift_num_minus6[1]表示Cr分量对应的自适应修正滤波滤波器的量化尺度移位值减6。此时,AlfChromaShift[1]=alf_chroma_shift_num_minus6[1]+6。alf_chroma_shift_num_minus6[1] represents the quantization scale shift value of the adaptive correction filter corresponding to the Cr component minus 6. At this time, AlfChromaShift[1]=alf_chroma_shift_num_minus6[1]+6.
在一些实施例中,本申请还包括:使用第一AFL的整数类型的ALF系数,对第一分量下的所述重建图像的目标区域进行滤波。In some embodiments, the present application further includes: filtering the target region of the reconstructed image under the first component using integer-type ALF coefficients of the first AFL.
例如,根据如下公式(11),对所述第一分量下的所述重建图像的目标区域进行滤波:For example, filter the target area of the reconstructed image under the first component according to the following formula (11):
Figure PCTCN2021073409-appb-000010
Figure PCTCN2021073409-appb-000010
其中,I rec(0,0)'为目标区域中当前点(0,0)滤波后的重建像素值,(x,y)为相对于当前点的位置,W j为第一ALF的第j个整数类型的ALF系数,W n-1为第一ALF的中心点对应的整数类型的ALF系数,I rec(0,0)为当前点的重建像素值,Alfshif为目标量化尺度对应的目标移位值,n为第一ALF所包括的ALF系数的个数。 Among them, I rec(0,0) ' is the reconstructed pixel value filtered by the current point (0,0) in the target area, (x, y) is the position relative to the current point, and W j is the jth of the first ALF ALF coefficients of integer type, W n-1 is the ALF coefficient of integer type corresponding to the center point of the first ALF, I rec(0,0) is the reconstructed pixel value of the current point, and Alfshif is the target shift corresponding to the target quantization scale Bit value, n is the number of ALF coefficients included in the first ALF.
在一些实施例中,当第一ALF的形状为图5A所示的7×7十字形加3×3方形时,该第一ALF包括9个ALF系数,其中(x,y)取值与Wj的对应关系如下表4所示:In some embodiments, when the shape of the first ALF is a 7×7 cross plus a 3×3 square as shown in FIG. 5A , the first ALF includes 9 ALF coefficients, where (x, y) takes the same value as Wj The corresponding relationship is shown in Table 4 below:
表4Table 4
j的值the value of j x的值the value of x y的值the value of y
00 00 33
11 00 22
22 11 11
33 00 11
44 11 -1-1
55 33 00
66 22 00
77 11 00
在一些实施例中,当第一ALF的形状为图5B所示的7×7十字形加5×5方形时,该第一ALF包括15个ALF系数,其中(x,y)取值与Wj的对应关系如下表5所示:In some embodiments, when the shape of the first ALF is a 7×7 cross plus a 5×5 square as shown in FIG. 5B , the first ALF includes 15 ALF coefficients, where (x, y) takes the same value as Wj The corresponding relationship is shown in Table 5 below:
表5table 5
j的值the value of j x的值the value of x y的值the value of y
00 00 33
11 22 22
22 11 22
33 00 22
44 11 -2-2
55 22 -2-2
66 22 11
77 11 11
88 00 11
99 11 -1-1
1010 22 -1-1
1111 33 00
1212 22 00
1313 11 00
需要说明的是,使用第一AFL的整数类型的ALF系数,对第一分量下的重建图像的目标区域进行滤波与对第一ALF的整数类型的ALF系数进行编码,得到码流在执行时,没有先后顺序。也就是说,编码器可以先对第一ALF的整数类型的ALF系数进行编码后,再使用第一AFL的整数类型的ALF系数,对第一分量下的重建图像的目标区域进行滤波,也可以先使用第一AFL的整数类型的ALF系数,对第一分量下的重建图像的目标区域进行滤波后,再对第一ALF的整数类型的ALF系数进行编码,也可以使用第一AFL的整数类型的ALF系数,对第一分量下的重建图像的目标区域进行滤波的同时,对第一ALF的整数类型的ALF系数进行编码。It should be noted that, by using the ALF coefficients of the integer type of the first AFL, filtering the target area of the reconstructed image under the first component and encoding the ALF coefficients of the integer type of the first ALF, it is obtained that when the code stream is executed, There is no precedence. That is to say, the encoder can firstly encode the integer-type ALF coefficients of the first ALF, and then use the integer-type ALF coefficients of the first AFL to filter the target area of the reconstructed image under the first component, or First use the ALF coefficients of the integer type of the first AFL to filter the target area of the reconstructed image under the first component, and then encode the ALF coefficients of the integer type of the first AFL, or use the integer type of the first AFL. The ALF coefficients of the first ALF are encoded with the integer type ALF coefficients of the first ALF while filtering the target area of the reconstructed image under the first component.
本申请实施例,通过确定对第一分量下的重建图像中的目标区域使用第一ALF进行滤波时,第一ALF的浮点数类型的ALF系数,并根据第一ALF的浮点数类型的ALF系数,确定第一ALF的浮点数类型的ALF系数的最大量化尺度。接着,根据最大量化尺度,确定第一ALF的浮点数类型的ALF系数的目标量化尺度。使用目标量化尺度,将第一ALF的浮点数类型的ALF系数量化为整数类型的ALF系数,相比于目前采用固定的量化尺度来量化第一ALF的浮点数类型的ALF系数,本申请考虑了不同的区域或不同的帧导出的浮点数类型的ALF系数的范围可能不同,导致滤波增益可能也不同的问题,采用可变动的量化尺度对不同的目标区域对应的ALF系数进行量化,使得量化后的ALF系数能够达到编码滤波系数开销和滤波增益之间更好的平衡。In this embodiment of the present application, when the target area in the reconstructed image under the first component is filtered using the first ALF, the floating-point ALF coefficient of the first ALF is determined, and the floating-point ALF coefficient of the first ALF is determined according to the floating-point ALF coefficient of the first ALF. , which determines the maximum quantization scale of the floating-point type ALF coefficients of the first ALF. Next, according to the maximum quantization scale, the target quantization scale of the floating-point type ALF coefficients of the first ALF is determined. Using the target quantization scale, the ALF coefficients of the floating point type of the first ALF are quantized into ALF coefficients of the integer type. Compared with the current use of a fixed quantization scale to quantize the ALF coefficients of the floating point type of the first ALF, the present application considers The range of floating-point type ALF coefficients derived from different regions or different frames may be different, resulting in the problem that the filter gain may also be different. The variable quantization scale is used to quantize the ALF coefficients corresponding to different target regions, so that after quantization, the ALF coefficients corresponding to different target regions are quantized. The ALF coefficients can achieve a better balance between coding filter coefficient overhead and filter gain.
为了进一步说明本申请的技术效果,将本申请的技术方案在AVS3参考软件HPM-9.1上实现后,在全是帧内帧(All intra)的配置条件下对AVS3要求的测试序列进行测试,测试结果如表6所示:In order to further illustrate the technical effect of the present application, after the technical solution of the present application is implemented on the AVS3 reference software HPM-9.1, the test sequence required by AVS3 is tested under the configuration condition of all intra frames (All intra), and the test The results are shown in Table 6:
表6Table 6
Figure PCTCN2021073409-appb-000011
Figure PCTCN2021073409-appb-000011
其中,通甲4K表示4K分辨率的测试视频,其分辨率为3840x2160,通乙1080p表示1080p分辨率的测试视频,其分辨率为1920x1080。,通丙720p表示720p分辨率的测试视频,其分辨率为1280x720。EncT为本申请的编码时间与原有算法的编码时间的比值,DecT为本申请的解码时间与原有算法的解码时间的比值。Among them, Tongjia 4K represents the test video with 4K resolution, and its resolution is 3840x2160, and Tongyi 1080p represents the test video with 1080p resolution, and its resolution is 1920x1080. , Tong Bing 720p means the test video of 720p resolution, its resolution is 1280x720. EncT is the ratio of the encoding time of the application to the encoding time of the original algorithm, and DecT is the ratio of the decoding time of the application to the decoding time of the original algorithm.
BD-Rate是评价视频编码算法性能的主要参数之一,表示新算法(即本申请技术方案)编码的视频相对于原来的算法在码率和PSNR(Peak Signal to Noise Ratio,峰值信噪比)上的变化情况,即新算法与原有算法在相同信噪比情况下码率的变化情况。“-”表示性能提升,例如码率和PSNR性能提升。如表6所示,在All intra配置条件下,在Y,Cb,Cr分量上BD-rate平均变化分别为-0.14%,0.01%,-0.00%。BD-Rate is one of the main parameters for evaluating the performance of a video coding algorithm, which indicates that the video encoded by the new algorithm (that is, the technical solution of the present application) has a higher bit rate and PSNR (Peak Signal to Noise Ratio, peak signal-to-noise ratio) than the original algorithm. The change in the above, that is, the change in the code rate of the new algorithm and the original algorithm under the same signal-to-noise ratio. "-" indicates performance improvement, such as bit rate and PSNR performance improvement. As shown in Table 6, under the condition of All intra configuration, the average changes of BD-rate on Y, Cb, and Cr components are -0.14%, 0.01%, and -0.00%, respectively.
在既有帧内帧又有帧间帧(Random Access)的配置条件下对AVS3要求的测试序列进行测试,测试结果如表7所示:The test sequence required by AVS3 is tested under the configuration conditions of both intra-frame and inter-frame (Random Access), and the test results are shown in Table 7:
表7Table 7
Figure PCTCN2021073409-appb-000012
Figure PCTCN2021073409-appb-000012
如表7所示,在Random Access配置条件下,在Y,Cb,Cr分量上BD-rate平均变化分别为-0.14%,-0.01%,-0.00%,说明使用本申请的技术提升了编码性能。As shown in Table 7, under the condition of Random Access configuration, the average changes of BD-rate on Y, Cb and Cr components are -0.14%, -0.01% and -0.00% respectively, indicating that the coding performance is improved by using the technology of this application .
本申请编码端增加极少计算复杂度和解码端复杂度不变的情况下,给ALF设计带来额外的性能增益。In the present application, the coding end increases with very little computational complexity and the decoding end complexity remains unchanged, which brings additional performance gains to the ALF design.
图6为本申请实施例提供的视频编码方式600的另一流程示意图,以第一分量为亮度分量为例,如图6所示,包括:FIG. 6 is another schematic flowchart of a video encoding method 600 provided by an embodiment of the present application. Taking the first component as a luminance component as an example, as shown in FIG. 6 , it includes:
S601、获得当前图像的重建图像,该重建图像包括亮度分量。S601. Obtain a reconstructed image of the current image, where the reconstructed image includes a luminance component.
S602、根据预设的区域划分规则,对亮度分量下的重建图像进行区域划分,得到待滤波的目标区域。例如,预设的区域划分规则为将亮度分量下的重建图像划分为16个区域,这样,根据预设的划分方式(例如均匀划分),将将亮度分量下的重建图像划分为16个区域。例如,预设的区域划分规则为将亮度分量下的重建图像划分为64个区域,这样,根据预设的划分方式(例如均匀划分),将将亮度分量下的重建图像划分为64个区域。S602. According to a preset area division rule, perform area division on the reconstructed image under the luminance component to obtain a target area to be filtered. For example, the preset area division rule is to divide the reconstructed image under the luminance component into 16 areas, so that the reconstructed image under the luminance component is divided into 16 areas according to a preset division method (eg, uniform division). For example, the preset area division rule is to divide the reconstructed image under the luminance component into 64 areas, so that the reconstructed image under the luminance component is divided into 64 areas according to a preset division method (eg, uniform division).
S603、确定对亮度分量下的目标区域使用第一ALF进行滤波时,第一ALF的浮点数类型的ALF系数。S603. Determine the ALF coefficient of the floating point type of the first ALF when the target area under the luminance component is filtered using the first ALF.
S604、根据第一ALF的浮点数类型的ALF系数,确定第一ALF的浮点数类型的ALF系数的最大量化尺度。S604: Determine the maximum quantization scale of the ALF coefficients of the floating-point number type of the first ALF according to the ALF coefficients of the floating-point number type of the first ALF.
S605、根据最大量化尺度,确定第一ALF的浮点数类型的ALF系数的目标量化尺度。S605. Determine, according to the maximum quantization scale, the target quantization scale of the ALF coefficients of the floating point type of the first ALF.
S606、使用目标量化尺度,将第一ALF的浮点数类型的ALF系数量化为整数类型的ALF系数。S606. Using the target quantization scale, quantize the floating-point ALF coefficients of the first ALF into integer-type ALF coefficients.
S607、对第一ALF的整数类型的ALF系数进行编码,得到码流。S607: Encode the integer-type ALF coefficients of the first ALF to obtain a code stream.
其中,上述S603至S607的具体实现过程参照上述S402至S406的描述,在此不再赘述。The specific implementation process of the above S603 to S607 refers to the description of the above S402 to S406, and details are not repeated here.
S608、使用第一AFL的整数类型的ALF系数,对亮度分量下的目标区域进行滤波。S608. Use the integer-type ALF coefficients of the first AFL to filter the target area under the luminance component.
需要说明的,上述S608和S607在执行过程中没有先后顺序,S608可以在S607之前执行,也可以在S607之后执行,还可以与S607同时执行。It should be noted that the above S608 and S607 have no sequence in the execution process, and S608 may be executed before S607, may be executed after S607, or may be executed simultaneously with S607.
在一些实施例中,本申请可以只对重建图像的亮度分量采用本申请的可变动的量化尺度进行ALF系数量化,而重建图像的色度分量依然采用目前固定的量化尺度,例如为 2 6。在这种情况下,编码器将亮度分量对应的可变动的量化尺度信息携带在码流中发送给解码端,而在码流中不携带色度分量对应的量化尺度。此时,自适应修正滤波参数定义,如表8所示, In some embodiments, the present application may only use the variable quantization scale of the present application to perform ALF coefficient quantization on the luminance component of the reconstructed image, while the chrominance component of the reconstructed image still uses the current fixed quantization scale, such as 2 6 . In this case, the encoder carries the variable quantization scale information corresponding to the luminance component in the code stream and sends it to the decoder, but does not carry the quantization scale corresponding to the chrominance component in the code stream. At this time, the definition of adaptive correction filtering parameters is shown in Table 8.
表8Table 8
Figure PCTCN2021073409-appb-000013
Figure PCTCN2021073409-appb-000013
解码端获得表8后,从表8中解析出亮度分量对应的可变动的量化尺度信息,该可变动的量化尺度信息可以为目标量化尺度对应的目标移位值与第一数值的差值的绝对值,这样,解码端可以根据亮度分量对应的第二ALF系数(即alf_coeff_luma[i][j]),以及目标量化尺度对应的目标移位值与第一数值的差值的绝对值,确定出第一ALF的第一ALF系数,进而根据第一ALF的第一ALF系数和第二ALF系数,使用第一ALF对亮度分量下的重建图像中的目标区域进行滤波,提高滤波精度。After the decoding end obtains Table 8, the variable quantization scale information corresponding to the luminance component is parsed from Table 8, and the variable quantization scale information can be the difference between the target shift value corresponding to the target quantization scale and the first numerical value. Absolute value, in this way, the decoding end can determine the absolute value of the difference between the target shift value corresponding to the target quantization scale and the first value according to the second ALF coefficient corresponding to the luminance component (ie alf_coeff_luma[i][j]) The first ALF coefficient of the first ALF is obtained, and then the first ALF is used to filter the target area in the reconstructed image under the luminance component according to the first ALF coefficient and the second ALF coefficient of the first ALF, so as to improve the filtering accuracy.
另外,解码端在表8中未解析出色度分量对应的可变动的量化尺度信息,则解码端使用固定的量化尺度信息,例如固定的移位值6,对色度分量下的重建图像进行滤波。具体的,解码端可以根据表6中色度分量对应的第二ALF系数(即alf_coeff_chroma[0][j]或alf_coeff_chroma[1][j])和固定的移位值6,确定出第一ALF的第一ALF系数,进而 根据第一ALF的第一ALF系数和第二ALF系数,使用第一ALF对亮度分量下的重建图像中的目标区域进行滤波,提高滤波精度。In addition, if the variable quantization scale information corresponding to the chrominance component is not resolved at the decoding end in Table 8, the decoding end uses the fixed quantization scale information, such as a fixed shift value of 6, to filter the reconstructed image under the chrominance component. . Specifically, the decoding end can determine the first ALF according to the second ALF coefficient corresponding to the chrominance component in Table 6 (ie alf_coeff_chroma[0][j] or alf_coeff_chroma[1][j]) and the fixed shift value 6 Then, according to the first ALF coefficient and the second ALF coefficient of the first ALF, the first ALF is used to filter the target area in the reconstructed image under the luminance component, so as to improve the filtering accuracy.
图7为本申请实施例提供的视频编码方式700的另一流程示意图,以第一分量为亮度分量为例,如图7所示,包括:FIG. 7 is another schematic flowchart of a video encoding method 700 provided by an embodiment of the present application. Taking the first component as a luminance component as an example, as shown in FIG. 7 , the method includes:
S701、获得当前图像的重建图像,该重建图像包括色度分量,其中色度分量包括第一色度分量和/或包括第二色度分量,其中,第一色度分量例如U或Cb,第二色度分量例如V或Cr。S701. Obtain a reconstructed image of the current image, where the reconstructed image includes chrominance components, wherein the chrominance components include a first chrominance component and/or include a second chrominance component, wherein the first chrominance component is, for example, U or Cb, and the first chrominance component is U or Cb. Two chrominance components such as V or Cr.
S702、将色度分量下的整张重建图像作为目标区域。在对色度分量下的重建图像进行滤波时,使用一个自适应修正滤波器对Cb分量下的整张重建图像进行滤波,使用一个自适应修正滤波器对Cr分量下的整张重建图像进行滤波,因此,本申请实施例将整张重建图像作为目标区域进行ALF滤波。S702. Use the entire reconstructed image under the chrominance component as the target area. When filtering the reconstructed image under the chrominance component, an adaptive correction filter is used to filter the entire reconstructed image under the Cb component, and an adaptive correction filter is used to filter the entire reconstructed image under the Cr component , therefore, in this embodiment of the present application, the entire reconstructed image is used as the target area to perform ALF filtering.
S703、确定对色度分量下的目标区域使用第一ALF进行滤波时,第一ALF的浮点数类型的ALF系数。S703: Determine the ALF coefficient of the floating point type of the first ALF when the target area under the chrominance component is filtered using the first ALF.
S704、根据第一ALF的浮点数类型的ALF系数,确定第一ALF的浮点数类型的ALF系数的最大量化尺度。S704. Determine the maximum quantization scale of the ALF coefficients of the floating-point number type of the first ALF according to the ALF coefficients of the floating-point number type of the first ALF.
S705、根据最大量化尺度,确定第一ALF的浮点数类型的ALF系数的目标量化尺度。S705. Determine, according to the maximum quantization scale, the target quantization scale of the ALF coefficients of the floating point type of the first ALF.
S706、使用目标量化尺度,将第一ALF的浮点数类型的ALF系数量化为整数类型的ALF系数。S706. Using the target quantization scale, quantize the floating-point ALF coefficients of the first ALF into integer-type ALF coefficients.
S707、对第一ALF的整数类型的ALF系数进行编码,得到码流。S707: Encode the integer-type ALF coefficients of the first ALF to obtain a code stream.
其中,上述S703至S707的具体实现过程参照上述S402至S406的描述,在此不再赘述。The specific implementation process of the above S703 to S707 refers to the description of the above S402 to S406, and details are not repeated here.
S708、使用第一AFL的整数类型的ALF系数,对色度分量下的目标区域进行滤波。S708. Use the integer-type ALF coefficients of the first AFL to filter the target area under the chrominance component.
需要说明的,上述S708和S707在执行过程中没有先后顺序,S708可以在S707之前执行,也可以在S707之后执行,还可以与S707同时执行。It should be noted that the above-mentioned S708 and S707 have no sequence in the execution process, and S708 may be executed before S707, or after S707, and may also be executed simultaneously with S707.
在一些实施例中,本申请可以只对重建图像的第一色度分量采用本申请的可变动的量化尺度进行ALF系数量化,而重建图像的第二色度分量和亮度分量依然采用目前固定的量化尺度,例如为2 6。在这种情况下,编码器将第一色度分量对应的可变动的量化尺度信息携带在码流中发送给解码端,而在码流中不携带第二色度分量和亮度分量对应的量化尺度。此时,自适应修正滤波参数定义,如表9所示: In some embodiments, the present application may only use the variable quantization scale of the present application to perform ALF coefficient quantization on the first chrominance component of the reconstructed image, while the second chrominance component and luminance component of the reconstructed image still use the currently fixed quantization scale. Quantization scale, eg 2 6 . In this case, the encoder carries the variable quantization scale information corresponding to the first chrominance component in the code stream and sends it to the decoder, but does not carry the quantization corresponding to the second chrominance component and the luminance component in the code stream scale. At this time, the definition of adaptive correction filtering parameters is shown in Table 9:
表9Table 9
Figure PCTCN2021073409-appb-000014
Figure PCTCN2021073409-appb-000014
Figure PCTCN2021073409-appb-000015
Figure PCTCN2021073409-appb-000015
解码端获得表9后,从表9中解析出第一色度分量对应的可变动的量化尺度信息,根据第一色度分量对应的可变动的量化尺度信息,确定第一ALF的ALF系数,并根据确定第一ALF的ALF系数,使用第一ALF对第一色度分量下的重建图像进行滤波,提高滤波精度。After the decoding end obtains Table 9, the variable quantization scale information corresponding to the first chrominance component is parsed from Table 9, and the ALF coefficient of the first ALF is determined according to the variable quantization scale information corresponding to the first chrominance component, And according to the determined ALF coefficient of the first ALF, the first ALF is used to filter the reconstructed image under the first chrominance component, so as to improve the filtering precision.
解码端使用已有的方法确定第二色度分量和/或亮度分量对应的ALF系数,并使用确定的ALF系数对第二色度分量和/或亮度分量下的重建图像进行滤波。The decoding end uses an existing method to determine the ALF coefficient corresponding to the second chrominance component and/or the luminance component, and uses the determined ALF coefficient to filter the reconstructed image under the second chrominance component and/or the luminance component.
在一些实施例中,本申请可以只对重建图像的第二色度分量采用本申请的可变动的量化尺度进行ALF系数量化,而重建图像的第一色度分量和亮度分量依然采用目前固定的量化尺度,例如为2 6。在这种情况下,编码器将第二色度分量对应的可变动的量化尺度信息携带在码流中发送给解码端,而在码流中不携带第一色度分量和亮度分量对应的量化尺度。此时,自适应修正滤波参数定义,如表10所示: In some embodiments, the present application may only use the variable quantization scale of the present application to perform ALF coefficient quantization on the second chrominance component of the reconstructed image, while the first chrominance component and luminance component of the reconstructed image still use the currently fixed Quantization scale, eg 2 6 . In this case, the encoder carries the variable quantization scale information corresponding to the second chrominance component in the code stream and sends it to the decoder, but does not carry the quantization corresponding to the first chrominance component and the luminance component in the code stream scale. At this time, the definition of adaptive correction filtering parameters is shown in Table 10:
表10Table 10
Figure PCTCN2021073409-appb-000016
Figure PCTCN2021073409-appb-000016
Figure PCTCN2021073409-appb-000017
Figure PCTCN2021073409-appb-000017
解码端获得表10后,从表10中解析出第二色度分量对应的可变动的量化尺度信息,根据第二色度分量对应的可变动的量化尺度信息,确定第一ALF的ALF系数,并根据确定第一ALF的ALF系数,使用第一ALF对第二色度分量下的重建图像进行滤波,提高滤波精度。After the decoding end obtains Table 10, the variable quantization scale information corresponding to the second chrominance component is parsed from Table 10, and the ALF coefficient of the first ALF is determined according to the variable quantization scale information corresponding to the second chrominance component, And according to the determined ALF coefficient of the first ALF, the first ALF is used to filter the reconstructed image under the second chrominance component, so as to improve the filtering precision.
解码端使用已有的方法确定第一色度分量和/或亮度分量对应的ALF系数,并使用确定的ALF系数对第一色度分量和/或亮度分量下的重建图像进行滤波。The decoding end uses an existing method to determine the ALF coefficient corresponding to the first chrominance component and/or the luminance component, and uses the determined ALF coefficient to filter the reconstructed image under the first chrominance component and/or the luminance component.
在一些实施例中,本申请可以只对重建图像的色度分量(包括第一色度分量和第二色度分量)采用本申请的可变动的量化尺度进行ALF系数量化,而重建图像的亮度分量依然采用目前固定的量化尺度,例如为2 6。在这种情况下,编码器将色度分量对应的可变动的量化尺度信息携带在码流中发送给解码端,而在码流中不携带亮度分量对应的量化尺度。此时,自适应修正滤波参数定义,如表11所示, In some embodiments, the present application may only perform ALF coefficient quantization on the chrominance components of the reconstructed image (including the first chrominance component and the second chrominance component) using the variable quantization scale of the present application, while the luminance of the reconstructed image The components still use the current fixed quantization scale, for example, 2 6 . In this case, the encoder carries the variable quantization scale information corresponding to the chrominance component in the code stream and sends it to the decoder, but does not carry the quantization scale corresponding to the luminance component in the code stream. At this time, the definition of adaptive correction filtering parameters is shown in Table 11.
表11Table 11
Figure PCTCN2021073409-appb-000018
Figure PCTCN2021073409-appb-000018
Figure PCTCN2021073409-appb-000019
Figure PCTCN2021073409-appb-000019
解码端获得表11后,从表11中解析出第一色度分量和第二色度分量对应的可变动的量化尺度信息。根据第一色度分量对应的可变动的量化尺度信息,确定第一色度分量对应的ALF系数,并根据确定的ALF系数,对第一色度分量下的重建图像进行滤波。根据第二色度分量对应的可变动的量化尺度信息,确定第二色度分量对应的ALF系数,并根据确定的ALF系数,对第二色度分量下的重建图像进行滤波。After obtaining Table 11, the decoding end parses out the variable quantization scale information corresponding to the first chrominance component and the second chrominance component from Table 11. The ALF coefficient corresponding to the first chrominance component is determined according to the variable quantization scale information corresponding to the first chrominance component, and the reconstructed image under the first chrominance component is filtered according to the determined ALF coefficient. The ALF coefficient corresponding to the second chrominance component is determined according to the variable quantization scale information corresponding to the second chrominance component, and the reconstructed image under the second chrominance component is filtered according to the determined ALF coefficient.
解码端使用已有的方法确定亮度分量对应的ALF系数,并使用确定的ALF系数对亮度分量下的重建图像进行滤波。The decoding end uses the existing method to determine the ALF coefficient corresponding to the luminance component, and uses the determined ALF coefficient to filter the reconstructed image under the luminance component.
需要说明的是,解码端具体确定的ALF系数的方法,参照解码端的具体描述。It should be noted that, for the specific method of the ALF coefficient determined by the decoding end, refer to the specific description of the decoding end.
上文对本申请实施例涉及的视频编码方法进行了描述,在此基础上,下面针对解码端,对本申请涉及的视频解码方法进行描述。The video encoding method involved in the embodiments of the present application is described above. Based on this, the following describes the video decoding method involved in the present application for the decoding end.
图8为本申请实施例提供的视频解码方法800的一种流程示意图,如图8所示,本申请实施例的方法包括:FIG. 8 is a schematic flowchart of a video decoding method 800 provided by an embodiment of the present application. As shown in FIG. 8 , the method of the embodiment of the present application includes:
S801、解码码流,得到当前图像的残差值。S801. Decode the code stream to obtain the residual value of the current image.
S802、根据当前图像的残差值,确定当前图像的重建图像,重建图像包括第一分量,第一分量为亮度分量或色度分量。S802. Determine a reconstructed image of the current image according to the residual value of the current image, where the reconstructed image includes a first component, and the first component is a luminance component or a chrominance component.
具体的,参照图3所示,解码器中的熵解码单元310可解析码流得到当前图像中当前块的预测信息、量化系数矩阵等,预测单元320基于预测信息对当前块使用帧内预测或帧间预测产生当前块的预测块。反量化/变换单元330使用从码流得到的量化系数矩阵,对量化系数矩阵进行反量化、反变换得到残差块。重建单元340将预测块和残差块相加得到重建块。依次类推,可以得到当前图像中其他图像块的重建块,各重建块组成重建图像。Specifically, as shown in FIG. 3 , the entropy decoding unit 310 in the decoder can parse the code stream to obtain prediction information, quantization coefficient matrix, etc. of the current block in the current image, and the prediction unit 320 uses intra prediction or Inter prediction produces a predicted block for the current block. The inverse quantization/transform unit 330 performs inverse quantization and inverse transformation on the quantized coefficient matrix using the quantized coefficient matrix obtained from the code stream to obtain a residual block. The reconstruction unit 340 adds the prediction block and the residual block to obtain a reconstructed block. By analogy, the reconstructed blocks of other image blocks in the current image can be obtained, and each reconstructed block constitutes a reconstructed image.
该重建图像包括第一分量,第一分量为亮度分量或色度分量。The reconstructed image includes a first component, which is a luminance component or a chrominance component.
S803、解码码流,得到第一分量下重建图像中的目标区域对应的第一自适应修正滤 波器ALF的ALF系数信息。S803, decode the code stream to obtain the ALF coefficient information of the first adaptive correction filter ALF corresponding to the target area in the reconstructed image under the first component.
S804、根据第一ALF的ALF系数信息,使用第一ALF对第一分量下的重建图像中的目标区域进行滤波。S804. According to the ALF coefficient information of the first ALF, use the first ALF to filter the target area in the reconstructed image under the first component.
本申请中对第一分量下的重建图像是否进行自适应修正滤波,以及对重建图像中的哪一个区域进行自适应修正滤波进行了设定。例如,设定有自适应修正滤波开关,当第一分量下的重建区域的目标区域对应的自适应修正滤波开关为开,例如开关的控制信号为1,则表示对第一分量下的重建区域的目标区域使用第一ALF进行滤波。若第一分量下的重建区域的目标区域对应的自适应修正滤波开关为关,例如开关的控制信号为0,则表示对第一分量下的重建区域的目标区域不进行自适应修正滤波。In this application, it is set whether to perform adaptive correction filtering on the reconstructed image under the first component, and which region in the reconstructed image is to perform adaptive correction filtering. For example, if an adaptive correction filter switch is set, when the adaptive correction filter switch corresponding to the target area of the reconstruction area under the first component is on, for example, the control signal of the switch is 1, it means that the reconstruction area under the first component is The target region is filtered using the first ALF. If the adaptive correction filter switch corresponding to the target area of the reconstruction area under the first component is off, for example, the control signal of the switch is 0, it means that the target area of the reconstruction area under the first component is not subjected to adaptive correction filtering.
本申请,在确定使用第一ALF对第一分量下的重建区域的目标区域进行自适应修正滤波时,解码码流,得到码流中携带的第一ALF的ALF系数信息。根据第一ALF的ALF系数信息,使用第一ALF对第一分量下的重建图像中的目标区域进行滤波。In the present application, when it is determined to use the first ALF to perform adaptive correction filtering on the target area of the reconstruction area under the first component, the code stream is decoded to obtain the ALF coefficient information of the first ALF carried in the code stream. The target region in the reconstructed image under the first component is filtered using the first ALF according to the ALF coefficient information of the first ALF.
在一些实施例中,第一ALF的ALF系数信息包括第一ALF的所有整数类型的ALF系数。这样,解码端直接根据解码出的第一ALF的所有整数类型的ALF系数,使用第一ALF对第一分量下的重建图像中的目标区域进行滤波,其滤波过程简单。In some embodiments, the ALF coefficient information of the first ALF includes all integer-type ALF coefficients of the first ALF. In this way, the decoding end directly uses the first ALF to filter the target region in the reconstructed image under the first component according to all integer-type ALF coefficients of the first ALF decoded, and the filtering process is simple.
在一些实施例中,第一ALF的ALF系数信息包括第一ALF的整数类型的第二ALF系数和第一信息,其中,第二ALF系数为第一ALF中非中心点对应的整数类型的ALF系数,第一信息用于指示目标量化尺度。In some embodiments, the ALF coefficient information of the first ALF includes an integer-type second ALF coefficient of the first ALF and the first information, wherein the second ALF coefficient is an integer-type ALF corresponding to a non-center point in the first ALF coefficient, the first information is used to indicate the target quantization scale.
在一种示例中,第一信息包括目标量化尺度对应的目标移位值。In one example, the first information includes a target shift value corresponding to the target quantization scale.
在另一种示例中,第一信息包括目标量化尺度对应的目标移位值与第一数值的差值的绝对值。In another example, the first information includes the absolute value of the difference between the target shift value corresponding to the target quantization scale and the first numerical value.
在该实施例中,上述S804包括如下步骤S804-A1和S804-A2:In this embodiment, the above S804 includes the following steps S804-A1 and S804-A2:
S804-A1、根据第一ALF的第二ALF系数和目标量化尺度,确定第一ALF的第一ALF系数,第一ALF系数为第一ALF的中心点对应的整数类型的ALF系数;S804-A1, according to the second ALF coefficient of the first ALF and the target quantization scale, determine the first ALF coefficient of the first ALF, and the first ALF coefficient is an integer type ALF coefficient corresponding to the center point of the first ALF;
S804-A2、根据第一ALF的第二ALF系数和第一ALF系数,使用第一ALF对第一分量下的重建图像中的目标区域进行滤波。S804-A2. Use the first ALF to filter the target area in the reconstructed image under the first component according to the second ALF coefficient and the first ALF coefficient of the first ALF.
由上述表8可知,码流中包括第一ALF的第二ALF系数和目标量化尺度信息,这样可以根据第一ALF的第二ALF系数和目标量化尺度信息,确定出第一ALF的中心位置对应的第一ALF系数。As can be seen from Table 8 above, the code stream includes the second ALF coefficient of the first ALF and the target quantization scale information, so that the center position of the first ALF can be determined according to the second ALF coefficient of the first ALF and the target quantization scale information. The first ALF coefficient of .
在一些实施例中,可以根据如下公式(12)确定出第一ALF的第一ALF系数:In some embodiments, the first ALF coefficient of the first ALF can be determined according to the following formula (12):
Figure PCTCN2021073409-appb-000020
Figure PCTCN2021073409-appb-000020
其中,AlfCoeffLuma[i][k]为第一ALF的第一ALF系数,k为第一ALF所包括的ALF系数的数量减一,例如,第一ALF如图5A所示,包括9个ALF系数时,则k=8,若第一ALF如图5B所示,包括15个ALF系数时,则k=14。2 AlfLumaShift[i]为第一ALF对应的目标量化尺度,AlfCoeffLuma[i][j]为第一ALF中的第j个第二ALF系数。 Wherein, AlfCoeffLuma[i][k] is the first ALF coefficient of the first ALF, and k is the number of ALF coefficients included in the first ALF minus one. For example, the first ALF is shown in FIG. 5A and includes 9 ALF coefficients , then k=8, if the first ALF includes 15 ALF coefficients as shown in FIG. 5B , then k= 14. 2 AlfLumaShift[i] is the target quantization scale corresponding to the first ALF, AlfCoeffLuma[i][j ] is the jth second ALF coefficient in the first ALF.
解码器从码流中解码出第一ALF的第二ALF系数,并根据上述公式(12)确定出第一ALF系数,这样,解码器可以根据第一ALF的第一ALF系数和各第二ALF系数, 使用第一ALF对第一分量下的重建图像中的目标区域进行滤波,进而提高重建图像的精度。The decoder decodes the second ALF coefficient of the first ALF from the code stream, and determines the first ALF coefficient according to the above formula (12). coefficient, and the first ALF is used to filter the target area in the reconstructed image under the first component, thereby improving the accuracy of the reconstructed image.
在一些实施例中,解码器根据如下公式(13),对所述第一分量下的所述重建图像中的目标区域进行滤波:In some embodiments, the decoder filters the target region in the reconstructed image under the first component according to the following formula (13):
Figure PCTCN2021073409-appb-000021
Figure PCTCN2021073409-appb-000021
其中,I rec(0,0)′为目标区域中当前点(0,0)滤波后的重建像素值,(x,y)为相对于当前点的位置,W j为第一ALF的第j个整数类型的ALF系数,W n-1为第一ALF的中心点对应的整数类型的ALF系数,I rec(0,0)为当前点的重建像素值,Alfshif为目标量化尺度对应的目标移位值,n为第一ALF所包括的ALF系数的个数。 Among them, I rec(0,0) ′ is the reconstructed pixel value of the current point (0,0) in the target area after filtering, (x, y) is the position relative to the current point, and W j is the jth of the first ALF ALF coefficients of integer type, W n-1 is the ALF coefficient of integer type corresponding to the center point of the first ALF, I rec(0,0) is the reconstructed pixel value of the current point, and Alfshif is the target shift corresponding to the target quantization scale Bit value, n is the number of ALF coefficients included in the first ALF.
解码器得到滤波后的重建图像后,一方面可以将滤波后的重建图像发送给显示设备进行显示,另一方面将滤波后的重建图像存放在解码图像缓存中,为后续的帧作为帧间预测的参考帧。After the decoder obtains the filtered reconstructed image, on the one hand, the filtered reconstructed image can be sent to the display device for display, and on the other hand, the filtered reconstructed image can be stored in the decoded image buffer for subsequent frames as inter-frame prediction. frame of reference.
图9为本申请实施例提供的视频解码方法900的一种流程示意图,当第一分量为亮度分量时,如图9所示,本申请实施例的方法包括:FIG. 9 is a schematic flowchart of a video decoding method 900 provided by an embodiment of the present application. When the first component is a luminance component, as shown in FIG. 9 , the method of the embodiment of the present application includes:
S901、解码码流,得到当前图像的残差值。S901. Decode the code stream to obtain the residual value of the current image.
S902、根据当前图像的残差值,确定当前图像的重建图像,重建图像包括亮度分量。S902. Determine a reconstructed image of the current image according to the residual value of the current image, where the reconstructed image includes a luminance component.
S903、对亮度分量下的重建图像进行区域划分,得亮度分量下重建图像的目标区域,该目标区域为使用自适应修正滤波的区域。S903: Divide the reconstructed image under the luminance component into regions to obtain a target area of the reconstructed image under the luminance component, where the target area is an area using adaptive correction filtering.
S904、解码码流,得到亮度分量下重建图像中的目标区域对应的第一ALF的ALF系数信息。其中,第一ALF的ALF系数信息包括第一ALF的整数类型的第二ALF系数和第一信息,其中,第二ALF系数为所述第一ALF中非中心点对应的整数类型的ALF系数,第一信息用于指示目标量化尺度。S904. Decode the code stream to obtain ALF coefficient information of the first ALF corresponding to the target area in the reconstructed image under the luminance component. The ALF coefficient information of the first ALF includes an integer-type second ALF coefficient of the first ALF and the first information, wherein the second ALF coefficient is an integer-type ALF coefficient corresponding to a non-center point in the first ALF, The first information is used to indicate the target quantization scale.
S905、从码流中解析得到第一ALF的形状信息,并根据第一ALF的形状信息,确定第一ALF的类型。若所述第一ALF的形状为7×7十字形加3×3方形滤波器形状,则所述第一ALF包括9个ALF系数;若所述第一ALF的形状为7×7十字形加5×5方形滤波器形状,则所述第一ALF包括15个ALF系数。S905. Obtain the shape information of the first ALF by parsing the code stream, and determine the type of the first ALF according to the shape information of the first ALF. If the shape of the first ALF is the shape of a 7×7 cross plus a 3×3 square filter, the first ALF includes 9 ALF coefficients; if the shape of the first ALF is a 7×7 cross plus 5×5 square filter shape, the first ALF includes 15 ALF coefficients.
S906、根据第一ALF的第二ALF系数和目标量化尺度,确定第一ALF的第一ALF系数,第一ALF系数为第一ALF的中心点对应的整数类型的ALF系数。S906: Determine the first ALF coefficient of the first ALF according to the second ALF coefficient of the first ALF and the target quantization scale, where the first ALF coefficient is an integer type ALF coefficient corresponding to the center point of the first ALF.
在一种示例中,如上述表8所示,如果码流中的AlfShapeEnableFlag等于0,表示第一ALF如图5A所示,包括9个系数,此时,根据如下公式(14),确定第一ALF的第一ALF系数:In an example, as shown in Table 8 above, if the AlfShapeEnableFlag in the code stream is equal to 0, it means that the first ALF, as shown in FIG. 5A , includes 9 coefficients. At this time, according to the following formula (14), determine the first ALF The first ALF coefficient of ALF:
Figure PCTCN2021073409-appb-000022
Figure PCTCN2021073409-appb-000022
其中,AlfCoeffLuma[i][8]为第一ALF的第一ALF系数,i为亮度分量对应的ALF的个数,例如为16或64,AlfCoeffLuma[i][j]为第i个第一ALF的第j个ALF系数,i=0~ alf_filter_num_minus1,j=0~7,其中alf_filter_num_minus1为亮度分量对应的ALF的个数减一,alf_filter_num_minus1可以理解为p。Among them, AlfCoeffLuma[i][8] is the first ALF coefficient of the first ALF, i is the number of ALFs corresponding to the luminance component, such as 16 or 64, and AlfCoeffLuma[i][j] is the i-th first ALF The jth ALF coefficient of , i=0~alf_filter_num_minus1, j=0~7, where alf_filter_num_minus1 is the number of ALFs corresponding to the luminance component minus one, alf_filter_num_minus1 can be understood as p.
其中,AlfCoeffLuma[i][j]的位宽是7位,取值范围是-64~63,AlfCoeffLuma[i][8]的取值范围是0~127。The bit width of AlfCoeffLuma[i][j] is 7 bits, the value range is -64 to 63, and the value range of AlfCoeffLuma[i][8] is 0 to 127.
在一种示例中,如上述表8所示,如果码流中的AlfShapeEnableFlag等于1,表示第一ALF如图5B所示,包括15个系数,此时,根据如下公式(15),确定第一ALF的第一ALF系数:In an example, as shown in Table 8 above, if the AlfShapeEnableFlag in the code stream is equal to 1, it means that the first ALF, as shown in FIG. 5B , includes 15 coefficients. At this time, according to the following formula (15), determine the first ALF The first ALF coefficient of ALF:
Figure PCTCN2021073409-appb-000023
Figure PCTCN2021073409-appb-000023
其中,AlfCoeffLuma[i][14]为第一ALF的第一ALF系数,取值范围是0~127,j=0~14。Wherein, AlfCoeffLuma[i][14] is the first ALF coefficient of the first ALF, and the value ranges from 0 to 127, and j=0 to 14.
S907、根据第一ALF的第二ALF系数和第一ALF系数,使用第一ALF对亮度分量下的重建图像中的目标区域进行滤波。S907. According to the second ALF coefficient and the first ALF coefficient of the first ALF, use the first ALF to filter the target area in the reconstructed image under the luminance component.
例如,解码器根据如下公式(16),对所述第一分量下的所述重建图像中的目标区域进行滤波:For example, the decoder filters the target area in the reconstructed image under the first component according to the following formula (16):
Figure PCTCN2021073409-appb-000024
Figure PCTCN2021073409-appb-000024
其中,I rec(0,0)′为目标区域中当前点(0,0)滤波后的重建像素值,(x,y)为相对于当前点的位置,W j为第一ALF的第j个第二ALF系数,W n-1为第一ALF系数,I rec(0,0)为当前点的重建像素值,Alfshif为目标量化尺度对应的目标移位值,n为第一ALF所包括的ALF系数的个数。 Among them, I rec(0,0) ′ is the reconstructed pixel value of the current point (0,0) in the target area after filtering, (x, y) is the position relative to the current point, and W j is the jth of the first ALF a second ALF coefficient, W n-1 is the first ALF coefficient, I rec(0,0) is the reconstructed pixel value of the current point, Alfshif is the target shift value corresponding to the target quantization scale, and n is the first ALF included The number of ALF coefficients.
图10为本申请实施例提供的视频解码方法1000的一种流程示意图,当第一分量为亮度分量时,如图10所示,本申请实施例的方法包括:FIG. 10 is a schematic flowchart of a video decoding method 1000 provided by an embodiment of the present application. When the first component is a luminance component, as shown in FIG. 10 , the method of the embodiment of the present application includes:
S110、解码码流,得到当前图像的残差值。S110. Decode the code stream to obtain the residual value of the current image.
S120、根据当前图像的残差值,确定当前图像的重建图像,重建图像包括色度分量。S120. Determine a reconstructed image of the current image according to the residual value of the current image, where the reconstructed image includes chrominance components.
S130、将色度分量下整张重建图像作为目标区域,该目标区域为使用自适应修正滤波的区域。S130. Use the entire reconstructed image under the chrominance component as a target area, where the target area is an area using adaptive correction filtering.
S140、解码码流,得到色度分量下重建图像中的目标区域对应的第一ALF的ALF系数信息。其中,第一ALF的ALF系数信息包括第一ALF的整数类型的第二ALF系数和第一信息,其中,第二ALF系数为所述第一ALF中非中心点对应的整数类型的ALF系数,第一信息用于指示目标量化尺度。S140. Decode the code stream to obtain ALF coefficient information of the first ALF corresponding to the target area in the reconstructed image under the chrominance component. The ALF coefficient information of the first ALF includes an integer-type second ALF coefficient of the first ALF and the first information, wherein the second ALF coefficient is an integer-type ALF coefficient corresponding to a non-center point in the first ALF, The first information is used to indicate the target quantization scale.
S150、从码流中解析得到第一ALF的形状信息,并根据第一ALF的形状信息,确定第一ALF的类型。若所述第一ALF的形状为7×7十字形加3×3方形滤波器形状,则所述第一ALF包括9个ALF系数;若所述第一ALF的形状为7×7十字形加5×5方形滤波器形状,则所述第一ALF包括15个ALF系数。S150. Obtain shape information of the first ALF by parsing from the code stream, and determine the type of the first ALF according to the shape information of the first ALF. If the shape of the first ALF is the shape of a 7×7 cross plus a 3×3 square filter, the first ALF includes 9 ALF coefficients; if the shape of the first ALF is a 7×7 cross plus 5×5 square filter shape, the first ALF includes 15 ALF coefficients.
S160、根据第一ALF的第二ALF系数和目标量化尺度,确定第一ALF的第一ALF系数,第一ALF系数为第一ALF的中心点对应的整数类型的ALF系数。S160: Determine the first ALF coefficient of the first ALF according to the second ALF coefficient of the first ALF and the target quantization scale, where the first ALF coefficient is an integer type ALF coefficient corresponding to the center point of the first ALF.
当色度分量为第一色度分量,例如Cb,此时,根据如下方式确定第一ALF的第一ALF系数。When the chrominance component is the first chrominance component, such as Cb, at this time, the first ALF coefficient of the first ALF is determined according to the following method.
在一种示例中,如上述表8所示,如果码流中的AlfShapeEnableFlag等于0,表示第一ALF如图5A所示,包括9个系数,此时,根据如下公式(17),确定第一ALF的第一ALF系数:In an example, as shown in Table 8 above, if the AlfShapeEnableFlag in the code stream is equal to 0, it means that the first ALF, as shown in FIG. 5A , includes 9 coefficients. At this time, according to the following formula (17), determine the first ALF The first ALF coefficient of ALF:
Figure PCTCN2021073409-appb-000025
Figure PCTCN2021073409-appb-000025
其中,AlfCoeffLuma[0][8]为第一ALF的第一ALF系数,AlfCoeffLuma[0][j]为第一ALF的第j个ALF系数,j=0~7。Wherein, AlfCoeffLuma[0][8] is the first ALF coefficient of the first ALF, AlfCoeffLuma[0][j] is the jth ALF coefficient of the first ALF, and j=0˜7.
其中,AlfCoeffLuma[0][j]的位宽是7位,取值范围是-64~63,AlfCoeffLuma[0][8]的取值范围是0~127。The bit width of AlfCoeffLuma[0][j] is 7 bits, the value range is -64 to 63, and the value range of AlfCoeffLuma[0][8] is 0 to 127.
在一种示例中,如上述表8所示,如果码流中的AlfShapeEnableFlag等于1,表示第一ALF如图5B所示,包括15个系数,此时,根据如下公式(18),确定第一ALF的第一ALF系数:In an example, as shown in Table 8 above, if the AlfShapeEnableFlag in the code stream is equal to 1, it means that the first ALF is shown in FIG. 5B and includes 15 coefficients. At this time, according to the following formula (18), determine the first ALF The first ALF coefficient of ALF:
Figure PCTCN2021073409-appb-000026
Figure PCTCN2021073409-appb-000026
其中,AlfCoeffLuma[0][14]为第一ALF的第一ALF系数,取值范围是0~127,j=0~14。Wherein, AlfCoeffLuma[0][14] is the first ALF coefficient of the first ALF, the value range is 0-127, and j=0-14.
当色度分量为第二色度分量,例如Cr,此时,根据如下方式确定第一ALF的第一ALF系数。When the chrominance component is the second chrominance component, such as Cr, at this time, the first ALF coefficient of the first ALF is determined according to the following method.
在一种示例中,如上述表8所示,如果码流中的AlfShapeEnableFlag等于0,表示第一ALF如图5A所示,包括9个系数,此时,根据如下公式(19),确定第一ALF的第一ALF系数:In an example, as shown in Table 8 above, if the AlfShapeEnableFlag in the code stream is equal to 0, it means that the first ALF, as shown in FIG. 5A , includes 9 coefficients. At this time, according to the following formula (19), determine the first ALF The first ALF coefficient of ALF:
Figure PCTCN2021073409-appb-000027
Figure PCTCN2021073409-appb-000027
其中,AlfCoeffLuma[1][8]为第一ALF的第一ALF系数,AlfCoeffLuma[1][j]为第一ALF的第j个ALF系数,j=0~7。Wherein, AlfCoeffLuma[1][8] is the first ALF coefficient of the first ALF, AlfCoeffLuma[1][j] is the jth ALF coefficient of the first ALF, and j=0˜7.
其中,AlfCoeffLuma[1][j]的位宽是7位,取值范围是-64~63,AlfCoeffLuma[1][8]的取值范围是0~127。The bit width of AlfCoeffLuma[1][j] is 7 bits, the value range is -64 to 63, and the value range of AlfCoeffLuma[1][8] is 0 to 127.
在一种示例中,如上述表8所示,如果码流中的AlfShapeEnableFlag等于1,表示第一ALF如图5B所示,包括15个系数,此时,根据如下公式(20),确定第一ALF的第一ALF系数:In an example, as shown in Table 8 above, if the AlfShapeEnableFlag in the code stream is equal to 1, it means that the first ALF, as shown in FIG. 5B , includes 15 coefficients. At this time, according to the following formula (20), determine the first ALF The first ALF coefficient of ALF:
Figure PCTCN2021073409-appb-000028
Figure PCTCN2021073409-appb-000028
其中,AlfCoeffLuma[1][14]为第一ALF的第一ALF系数,取值范围是0~127,j=0~14。Wherein, AlfCoeffLuma[1][14] is the first ALF coefficient of the first ALF, and the value ranges from 0 to 127, and j=0 to 14.
S170、根据第一ALF的第二ALF系数和第一ALF系数,使用第一ALF对色度分量 下的重建图像中的目标区域进行滤波。S170. Use the first ALF to filter the target area in the reconstructed image under the chrominance component according to the second ALF coefficient and the first ALF coefficient of the first ALF.
解码器得到滤波后的重建图像后,一方面可以将滤波后的重建图像发送给显示设备进行显示,另一方面将滤波后的重建图像存放在解码图像缓存中,为后续的帧作为帧间预测的参考帧。After the decoder obtains the filtered reconstructed image, on the one hand, the filtered reconstructed image can be sent to the display device for display, and on the other hand, the filtered reconstructed image can be stored in the decoded image buffer for subsequent frames as inter-frame prediction. frame of reference.
应理解,图4至图10仅为本申请的示例,不应理解为对本申请的限制。It should be understood that FIG. 4 to FIG. 10 are only examples of the present application, and should not be construed as limiting the present application.
在一些实施例中,本申请确定亮度分量对应的量化尺度大于色度分量对应的量化尺度,例如,亮度分量对应的量化尺度固定为2 7,色度分量对应的量化尺度固定为2 6,这样调整固定的量化尺度也能够提高滤波性能,并且不需要比特开销去编码变动的量化尺度。 In some embodiments, the present application determines that the quantization scale corresponding to the luminance component is larger than the quantization scale corresponding to the chrominance component. For example, the quantization scale corresponding to the luminance component is fixed to 2 7 , and the quantization scale corresponding to the chrominance component is fixed to 2 6 , so that Adjusting the fixed quantization scale can also improve filtering performance, and no bit overhead is required to encode the variable quantization scale.
以上结合附图详细描述了本申请的优选实施方式,但是,本申请并不限于上述实施方式中的具体细节,在本申请的技术构思范围内,可以对本申请的技术方案进行多种简单变型,这些简单变型均属于本申请的保护范围。例如,在上述具体实施方式中所描述的各个具体技术特征,在不矛盾的情况下,可以通过任何合适的方式进行组合,为了避免不必要的重复,本申请对各种可能的组合方式不再另行说明。又例如,本申请的各种不同的实施方式之间也可以进行任意组合,只要其不违背本申请的思想,其同样应当视为本申请所公开的内容。The preferred embodiments of the present application have been described in detail above with reference to the accompanying drawings. However, the present application is not limited to the specific details of the above-mentioned embodiments. Within the scope of the technical concept of the present application, various simple modifications can be made to the technical solutions of the present application. These simple modifications all belong to the protection scope of the present application. For example, the specific technical features described in the above-mentioned specific embodiments can be combined in any suitable manner unless they are inconsistent. In order to avoid unnecessary repetition, this application does not describe any possible combination. State otherwise. For another example, the various embodiments of the present application can also be combined arbitrarily, as long as they do not violate the idea of the present application, they should also be regarded as the content disclosed in the present application.
还应理解,在本申请的各种方法实施例中,上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。另外,本申请实施例中,术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系。具体地,A和/或B可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中字符“/”,一般表示前后关联对象是一种“或”的关系。It should also be understood that, in the various method embodiments of the present application, the size of the sequence numbers of the above-mentioned processes does not mean the sequence of execution, and the execution sequence of each process should be determined by its functions and internal logic, and should not be dealt with in the present application. The implementation of the embodiments constitutes no limitation. In addition, in this embodiment of the present application, the term "and/or" is only an association relationship for describing associated objects, indicating that there may be three kinds of relationships. Specifically, A and/or B can represent three situations: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character "/" in this document generally indicates that the related objects are an "or" relationship.
上文结合图4至图10,详细描述了本申请的方法实施例,下文结合图11至图14,详细描述本申请的装置实施例。The method embodiments of the present application are described in detail above with reference to FIGS. 4 to 10 , and the apparatus embodiments of the present application are described in detail below with reference to FIGS. 11 to 14 .
图11是本申请实施例提供的视频编码器10的示意性框图。FIG. 11 is a schematic block diagram of a video encoder 10 provided by an embodiment of the present application.
如图11所示,视频编码器10包括:As shown in Figure 11, the video encoder 10 includes:
获取单元110,用于获得当前图像的重建图像,所述重建图像包括第一分量,所述第一分量为亮度分量或色度分量;an obtaining unit 110, configured to obtain a reconstructed image of the current image, where the reconstructed image includes a first component, and the first component is a luminance component or a chrominance component;
第一确定单元120,用于确定对所述第一分量下的所述重建图像中的目标区域使用第一自适应修正滤波器ALF进行滤波时,所述第一ALF的浮点数类型的ALF系数;A first determining unit 120, configured to determine, when filtering the target region in the reconstructed image under the first component using the first adaptive correction filter ALF, an ALF coefficient of the floating point type of the first ALF ;
第二确定单元130,用于根据所述第一ALF的浮点数类型的ALF系数,确定所述第一ALF的浮点数类型的ALF系数的最大量化尺度;A second determining unit 130, configured to determine the maximum quantization scale of the ALF coefficients of the floating point type of the first ALF according to the ALF coefficients of the floating point type of the first ALF;
第三确定单元140,用于根据所述最大量化尺度,确定所述第一ALF的浮点数类型的ALF系数的目标量化尺度,所述目标量化尺度小于或等于所述最大量化尺度;A third determining unit 140, configured to determine, according to the maximum quantization scale, a target quantization scale of the floating-point type ALF coefficient of the first ALF, where the target quantization scale is less than or equal to the maximum quantization scale;
量化单元150,用于使用所述目标量化尺度,将所述第一ALF的浮点数类型的ALF系数量化为整数类型的ALF系数;a quantization unit 150, configured to use the target quantization scale to quantize the floating-point ALF coefficients of the first ALF into integer-type ALF coefficients;
编码单元160,用于对所述第一ALF的整数类型的ALF系数进行编码,得到码流。The encoding unit 160 is configured to encode the integer-type ALF coefficients of the first ALF to obtain a code stream.
在一些实施例中,第二确定单元130,具体用于根据所述第一ALF的浮点数类型的ALF系数中的第一系数和所述第一系数对应的最大整数系数阈值,确定将所述浮点数类型的ALF系数量化为整数类型时所允许的最大移位值;根据所述最大移位值,确定所述第一ALF的浮点数类型的ALF系数的最大量化尺度。In some embodiments, the second determining unit 130 is specifically configured to determine, according to a first coefficient in the floating-point type ALF coefficients of the first ALF and a maximum integer coefficient threshold corresponding to the first coefficient The maximum shift value allowed when the ALF coefficient of the floating point type is quantized into an integer type; according to the maximum shift value, the maximum quantization scale of the ALF coefficient of the floating point type of the first ALF is determined.
在一种示例中,所述第一系数为所述第一ALF的中心位置对应的浮点类型的系数。In an example, the first coefficient is a floating-point type coefficient corresponding to the center position of the first ALF.
在一些实施例中,第二确定单元130,具体用于根据如下公式,确定所述最大移位值:In some embodiments, the second determining unit 130 is specifically configured to determine the maximum shift value according to the following formula:
Figure PCTCN2021073409-appb-000029
Figure PCTCN2021073409-appb-000029
其中,所述bitshift所述最大移位值,所述floor为向下取整,所述W f(0,0)为所述第一ALF的中心位置对应的浮点类型的系数,所述d为所述W f(0,0)对应的最大整数系数阈值。 The maximum shift value of the bitshift, the floor is rounded down, the W f(0,0) is the coefficient of floating point type corresponding to the center position of the first ALF, the d is the maximum integer coefficient threshold corresponding to the W f(0,0) .
可选的,所述d为127。Optionally, the d is 127.
在一些实施例中,第二确定单元130,具体用于根据如下公式,确定所述第一ALF的浮点数类型的ALF系数的最大量化尺度:In some embodiments, the second determining unit 130 is specifically configured to determine the maximum quantization scale of the ALF coefficients of the floating point type of the first ALF according to the following formula:
Scale max=2 bitshiftScale max = 2 bitshift ,
其中,所述Scale max为所述最大量化尺度。 Wherein, the Scale max is the maximum quantization scale.
在一些实施例中,若所述第一分量为亮度分量,第三确定单元140,具体用于将所述第一量化尺度确定为所述第一ALF的浮点数类型的ALF系数的目标量化尺度,所述第一量化尺度小于或等于所述最大量化尺度。In some embodiments, if the first component is a luminance component, the third determining unit 140 is specifically configured to determine the first quantization scale as the target quantization scale of the floating-point ALF coefficient of the first ALF , the first quantization scale is smaller than or equal to the maximum quantization scale.
在一些实施例中,第三确定单元140,还用于将第二量化尺度确定为第二ALF的浮点数类型的ALF系数的目标量化尺度,所述第二ALF为对色度分量下的所述重建图像进行ALS滤波时使用的滤波器,所述第二量化尺度小于所述第一量化尺度。In some embodiments, the third determining unit 140 is further configured to determine the second quantization scale as the target quantization scale of the ALF coefficients of the floating point type of the second ALF, where the second ALF is a pair of all the chrominance components. A filter used when performing ALS filtering on the reconstructed image, and the second quantization scale is smaller than the first quantization scale.
在一些实施例中,若所述第一分量为色度分量,第三确定单元140,具体用于将所述第三量化尺度确定为所述第一ALF的浮点数类型的ALF系数的的目标量化尺度,所述第三量化尺度小于所述最大量化尺度。In some embodiments, if the first component is a chrominance component, the third determining unit 140 is specifically configured to determine the third quantization scale as the target of the floating-point type ALF coefficient of the first ALF a quantization scale, the third quantization scale is smaller than the maximum quantization scale.
在一些实施例中,第三确定单元140,还用于将第四量化尺度确定为第三ALF的浮点数类型的ALF系数的目标量化尺度,所述第三ALF为对亮度分量下的所述重建图像进行ALS滤波时使用的滤波器,所述第四量化尺度大于所述第三量化尺度。In some embodiments, the third determining unit 140 is further configured to determine the fourth quantization scale as the target quantization scale of the floating-point type ALF coefficient of the third ALF, where the third ALF is the A filter used when performing ALS filtering on the reconstructed image, where the fourth quantization scale is larger than the third quantization scale.
在一些实施例中,第三确定单元140,具体用于针对所述最大量化尺度与预设的最小量化尺度构成的量化区间内的每一个第一量化尺度,确定所述第一量化尺度的量化代价,所述第一量化尺度为2的幂次方的正整数;根据每一个所述第一量化尺度的量化代价,确定所述第一ALF的浮点数类型的ALF系数的目标量化代价。In some embodiments, the third determining unit 140 is specifically configured to, for each first quantization scale in the quantization interval formed by the maximum quantization scale and the preset minimum quantization scale, determine the quantization of the first quantization scale cost, the first quantization scale is a positive integer of the power of 2; according to the quantization cost of each first quantization scale, the target quantization cost of the ALF coefficient of the floating point type of the first ALF is determined.
在一些实施例中,第三确定单元140,具体用于将量化代价最小的第一量化尺度确定为所述第一ALF的浮点数类型的ALF系数的目标量化代价。In some embodiments, the third determining unit 140 is specifically configured to determine the first quantization scale with the smallest quantization cost as the target quantization cost of the floating-point type ALF coefficient of the first ALF.
在一些实施例中,第三确定单元140,具体用于使用所述第一量化尺度,将所述第一ALF的浮点类型的所述ALF系数量化为整数类型的第一ALF系数;确定使用所述第一 ALF系数对所述重建图像的目标区域进行编码时,所述第一ALF系数对应的量化失真结果;根据所述第一ALF系数对应的量化失真结果,以及编码所述第一ALF系数所消耗的比特数,确定所述第一量化尺度的量化代价。In some embodiments, the third determining unit 140 is specifically configured to use the first quantization scale to quantize the ALF coefficients of the floating point type of the first ALF into the first ALF coefficients of the integer type; determine to use When the first ALF coefficient encodes the target area of the reconstructed image, the quantization distortion result corresponding to the first ALF coefficient; and encoding the first ALF according to the quantization distortion result corresponding to the first ALF coefficient The number of bits consumed by the coefficient determines the quantization cost of the first quantization scale.
在一些实施例中,第三确定单元140,具体用于根据所述目标区域中像素点的重建像素值,确定所述目标区域中像素点的自相关系数;根据所述目标区域中像素点的原始像素值,确定所述目标区域中像素点的互相关系数;根据所述目标区域中像素点的自相关系数与所述第一ALF系数乘积,以及所述目标区域中像素点的互相关系数,确定所述第一ALF系数对应的量化失真结果。In some embodiments, the third determining unit 140 is specifically configured to determine the autocorrelation coefficient of the pixels in the target area according to the reconstructed pixel values of the pixels in the target area; The original pixel value, determine the cross-correlation coefficient of the pixels in the target area; according to the product of the autocorrelation coefficient of the pixels in the target area and the first ALF coefficient, and the cross-correlation coefficient of the pixels in the target area , and determine the quantization distortion result corresponding to the first ALF coefficient.
在一些实施例中,第三确定单元140,具体用于使用所述第一ALF系数对所述重建图像的目标区域进行滤波;根据所述目标区域中像素点的滤波后像素值和原始像素值的差值,确定所述第一ALF系数对应的量化失真结果。In some embodiments, the third determining unit 140 is specifically configured to use the first ALF coefficient to filter the target area of the reconstructed image; according to the filtered pixel value and the original pixel value of the pixel in the target area The difference value of , determines the quantization distortion result corresponding to the first ALF coefficient.
在一些实施例中,第三确定单元140,具体用于根据如下公式,确定所述第一量化尺度的量化代价:In some embodiments, the third determining unit 140 is specifically configured to determine the quantization cost of the first quantization scale according to the following formula:
J=D+λRJ=D+λR
其中,所述J为所述第一量化尺度的量化代价,所述D为所述第一ALF系数对应的量化失真结果,所述R为编码所述第一ALF系数所消耗的比特数,所述λ为可变值。Wherein, the J is the quantization cost of the first quantization scale, the D is the quantization distortion result corresponding to the first ALF coefficient, the R is the number of bits consumed by encoding the first ALF coefficient, and the The λ is a variable value.
在一些实施例中,所述码流中包括所述第一ALF的所有整数类型的ALF系数。In some embodiments, the codestream includes all integer-type ALF coefficients of the first ALF.
在一种示例中,所述码流中包括所述第一ALF的整数类型的第二ALF系数和第一信息,所述第二ALF系数为所述第一ALF中非中心点对应的整数类型的ALF系数,所述第一信息用于指示所述目标量化尺度。In an example, the code stream includes a second ALF coefficient of an integer type of the first ALF and first information, and the second ALF coefficient is an integer type corresponding to a non-central point in the first ALF The ALF coefficient, the first information is used to indicate the target quantization scale.
在一种示例中,所述第一信息包括所述目标量化尺度对应的目标移位值。In an example, the first information includes a target shift value corresponding to the target quantization scale.
在一种示例中,所述第一信息包括所述目标量化尺度对应的目标移位值与第一数值的差值的绝对值。In an example, the first information includes the absolute value of the difference between the target shift value corresponding to the target quantization scale and the first numerical value.
例如,所述第一数值为6、5或4。For example, the first numerical value is 6, 5 or 4.
在一些实施例中,编码单元160,还用于使用所述第一AFL的整数类型的ALF系数,对所述第一分量下的所述重建图像的目标区域进行滤波。In some embodiments, the encoding unit 160 is further configured to use the integer-type ALF coefficients of the first AFL to filter the target area of the reconstructed image under the first component.
在一些实施例中,编码单元160,具体用于根据如下公式,对所述第一分量下的所述重建图像的目标区域进行滤波:In some embodiments, the encoding unit 160 is specifically configured to filter the target area of the reconstructed image under the first component according to the following formula:
Figure PCTCN2021073409-appb-000030
Figure PCTCN2021073409-appb-000030
其中,所述I rec(0,0)'为所述目标区域中当前点(0,0)滤波后的重建像素值,所述(x,y)为相对于所述当前点的位置,所述W j为所述第一ALF的第j个整数类型的ALF系数,所述W n-1为所述第一ALF的中心点对应的整数类型的ALF系数,所述I rec(0,0)为所述当前点的重建像素值,所述Alfshif为所述目标量化尺度对应的目标移位值,所述n为所述第一ALF所包括的ALF系数的个数。 Wherein, the I rec(0,0) ' is the reconstructed pixel value after filtering by the current point (0,0) in the target area, and the (x, y) is the position relative to the current point, so The W j is the ALF coefficient of the jth integer type of the first ALF, the W n-1 is the ALF coefficient of the integer type corresponding to the center point of the first ALF, and the I rec(0,0 ) is the reconstructed pixel value of the current point, the Alfshif is the target shift value corresponding to the target quantization scale, and the n is the number of ALF coefficients included in the first ALF.
应理解,装置实施例与方法实施例可以相互对应,类似的描述可以参照方法实施例。为避免重复,此处不再赘述。具体地,图11所示的视频编码器10可以执行本申请实施例的方法,并且视频编码器10中的各个单元的前述和其它操作和/或功能分别为了实现方法400、600和700等各个方法中的相应流程,为了简洁,在此不再赘述。It should be understood that the apparatus embodiments and the method embodiments may correspond to each other, and similar descriptions may refer to the method embodiments. To avoid repetition, details are not repeated here. Specifically, the video encoder 10 shown in FIG. 11 can perform the methods of the embodiments of the present application, and the aforementioned and other operations and/or functions of the various units in the video encoder 10 are for implementing the methods 400, 600, and 700, respectively. For the sake of brevity, the corresponding processes in the method will not be repeated here.
图12是本申请实施例提供的视频解码器20的示意性框图。FIG. 12 is a schematic block diagram of a video decoder 20 provided by an embodiment of the present application.
如图12所示,该视频解码器20可包括:As shown in Figure 12, the video decoder 20 may include:
第一解码单元210,用于解码码流,得到当前图像的残差值;The first decoding unit 210 is used for decoding the code stream to obtain the residual value of the current image;
确定单元220,用于根据所述当前图像的残差值,确定所述当前图像的重建图像,所述重建图像包括第一分量,所述第一分量为亮度分量或色度分量;a determining unit 220, configured to determine a reconstructed image of the current image according to the residual value of the current image, where the reconstructed image includes a first component, and the first component is a luminance component or a chrominance component;
第二解码单元230,用于解码码流,得到所述第一分量下所述重建图像中的目标区域对应的第一自适应修正滤波器ALF的ALF系数信息;The second decoding unit 230 is configured to decode the code stream to obtain the ALF coefficient information of the first adaptive correction filter ALF corresponding to the target area in the reconstructed image under the first component;
滤波单元240,用于根据所述第一ALF的ALF系数信息,使用所述第一ALF对所述第一分量下的所述重建图像中的目标区域进行滤波。The filtering unit 240 is configured to use the first ALF to filter the target area in the reconstructed image under the first component according to the ALF coefficient information of the first ALF.
在一些实施例,所述第一ALF的ALF系数信息包括所述第一ALF的所有整数类型的ALF系数。In some embodiments, the ALF coefficient information of the first ALF includes all integer-type ALF coefficients of the first ALF.
在一些实施例中,所述第一ALF的ALF系数信息包括所述第一ALF的整数类型的第二ALF系数和第一信息,所述第二ALF系数为所述第一ALF中非中心点对应的整数类型的ALF系数,所述第一信息用于指示所述目标量化尺度。In some embodiments, the ALF coefficient information of the first ALF includes an integer-type second ALF coefficient of the first ALF and first information, and the second ALF coefficient is a non-center point in the first ALF Corresponding integer type ALF coefficients, the first information is used to indicate the target quantization scale.
在一种示例中,所述第一信息包括所述目标量化尺度对应的目标移位值。In an example, the first information includes a target shift value corresponding to the target quantization scale.
在一种示例中,所述第一信息包括所述目标量化尺度对应的目标移位值与第一数值的差值的绝对值。In an example, the first information includes the absolute value of the difference between the target shift value corresponding to the target quantization scale and the first numerical value.
例如,所述第一数值为6、5或4。For example, the first numerical value is 6, 5 or 4.
在一些实施例中,滤波单元240,具体用于根据所述第一ALF的第二ALF系数和所述目标量化尺度,确定所述第一ALF的第一ALF系数,所述第一ALF系数为所述第一ALF的中心点对应的整数类型的ALF系数;根据所述第一ALF的所述第二ALF系数和所述第一ALF系数,使用所述第一ALF对所述第一分量下的所述重建图像中的目标区域进行滤波。In some embodiments, the filtering unit 240 is specifically configured to determine the first ALF coefficient of the first ALF according to the second ALF coefficient of the first ALF and the target quantization scale, where the first ALF coefficient is The integer-type ALF coefficient corresponding to the center point of the first ALF; according to the second ALF coefficient and the first ALF coefficient of the first ALF, use the first ALF to perform a downlink on the first component. The target region in the reconstructed image is filtered.
在一些实施例中,滤波单元240,具体用于根据如下公式,确定所述第一ALF的第一ALF系数:In some embodiments, the filtering unit 240 is specifically configured to determine the first ALF coefficient of the first ALF according to the following formula:
Figure PCTCN2021073409-appb-000031
Figure PCTCN2021073409-appb-000031
其中,所述AlfCoeffLuma[i][k]为第i个第一ALF的所述第一ALF系数,所述k为所述第一ALF所包括的ALF系数的数量减一,所述第一ALF所述AlfLumaShift[i]为所述第一ALF对应的目标量化尺度,所述AlfCoeffLuma[i][j]为所述第一ALF中的第j个第二ALF系数。Wherein, the AlfCoeffLuma[i][k] is the first ALF coefficient of the i-th first ALF, the k is the number of ALF coefficients included in the first ALF minus one, and the first ALF The AlfLumaShift[i] is the target quantization scale corresponding to the first ALF, and the AlfCoeffLuma[i][j] is the jth second ALF coefficient in the first ALF.
在一种示例中,若所述第一分量为亮度分量,则所述i的取值为0至p,所述p为所述亮度分量对应的ALF的个数减一。In an example, if the first component is a luminance component, the i value ranges from 0 to p, and the p is the number of ALFs corresponding to the luminance component minus one.
例如,所述p为15或63。For example, the p is 15 or 63.
在一种示例中,若所述第一分量为Cb分量,则所述i等于第一值,若所述第一分量为Cr分量,则所述i等于第二值。In an example, if the first component is the Cb component, the i is equal to the first value, and if the first component is the Cr component, the i is equal to the second value.
例如,所述第一值为0,所述第二值为1。For example, the first value is 0 and the second value is 1.
在一些实施例中,第二解码单元230,具体用于从所述码流中解析得到所述第一ALF的形状信息;根据所述第一ALF的形状信息,确定所述第一ALF的类型。In some embodiments, the second decoding unit 230 is specifically configured to parse and obtain the shape information of the first ALF from the code stream; and determine the type of the first ALF according to the shape information of the first ALF .
在一些实施例中,若所述第一ALF的形状为7×7十字形加3×3方形滤波器形状,则所述第一ALF包括9个ALF系数;若所述第一ALF的形状为7×7十字形加5×5方形滤波器形状,则所述第一ALF包括15个ALF系数。In some embodiments, if the shape of the first ALF is a 7×7 cross plus a 3×3 square filter shape, the first ALF includes 9 ALF coefficients; if the shape of the first ALF is A 7x7 cross plus a 5x5 square filter shape, the first ALF includes 15 ALF coefficients.
在一些实施例中,滤波单元240,具体用于根据如下公式,对所述第一分量下的所述重建图像中的目标区域进行滤波:In some embodiments, the filtering unit 240 is specifically configured to filter the target area in the reconstructed image under the first component according to the following formula:
Figure PCTCN2021073409-appb-000032
Figure PCTCN2021073409-appb-000032
其中,所述I rec(0,0)′为所述目标区域中当前点(0,0)滤波后的重建像素值,所述(x,y)为相对于所述当前点的位置,所述W j为所述第一ALF的第j个整数类型的ALF系数,所述W n-1为所述第一ALF的中心点对应的整数类型的ALF系数,所述I rec(0,0)为所述当前点的重建像素值,所述Alfshi为所述目标量化尺度对应的目标移位值,所述n为所述第一ALF所包括的ALF系数的个数。 Wherein, the I rec(0,0) ′ is the reconstructed pixel value filtered by the current point (0,0) in the target area, and the (x, y) is the position relative to the current point, so The W j is the ALF coefficient of the jth integer type of the first ALF, the W n-1 is the ALF coefficient of the integer type corresponding to the center point of the first ALF, and the I rec(0,0 ) is the reconstructed pixel value of the current point, the Alfshi is the target shift value corresponding to the target quantization scale, and the n is the number of ALF coefficients included in the first ALF.
应理解,装置实施例与方法实施例可以相互对应,类似的描述可以参照方法实施例。为避免重复,此处不再赘述。具体地,图20所示的视频解码器20可以对应于执行本申请实施例的方法800或900或1000中的相应主体,并且视频解码器20中的各个单元的前述和其它操作和/或功能分别为了实现方法800或900或1000等各个方法中的相应流程,为了简洁,在此不再赘述。It should be understood that the apparatus embodiments and the method embodiments may correspond to each other, and similar descriptions may refer to the method embodiments. To avoid repetition, details are not repeated here. Specifically, the video decoder 20 shown in FIG. 20 may correspond to the corresponding subject in performing the method 800 or 900 or 1000 of the embodiments of the present application, and the aforementioned and other operations and/or functions of the respective units in the video decoder 20 In order to implement the corresponding processes in each method such as method 800 or 900 or 1000, for the sake of brevity, details are not repeated here.
上文中结合附图从功能单元的角度描述了本申请实施例的装置和系统。应理解,该功能单元可以通过硬件形式实现,也可以通过软件形式的指令实现,还可以通过硬件和软件单元组合实现。具体地,本申请实施例中的方法实施例的各步骤可以通过处理器中的硬件的集成逻辑电路和/或软件形式的指令完成,结合本申请实施例公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件单元组合执行完成。可选地,软件单元可以位于随机存储器,闪存、只读存储器、可编程只读存储器、电可擦写可编程存储器、寄存器等本领域的成熟的存储介质中。该存储介质位于存储器,处理器读取存储器中的信息,结合其硬件完成上述方法实施例中的步骤。The apparatus and system of the embodiments of the present application are described above from the perspective of functional units with reference to the accompanying drawings. It should be understood that the functional unit may be implemented in the form of hardware, may also be implemented by an instruction in the form of software, or may be implemented by a combination of hardware and software units. Specifically, the steps of the method embodiments in the embodiments of the present application may be completed by hardware integrated logic circuits in the processor and/or instructions in the form of software, and the steps of the methods disclosed in conjunction with the embodiments of the present application may be directly embodied as hardware The execution of the decoding processor is completed, or the execution is completed by a combination of hardware and software units in the decoding processor. Optionally, the software unit may be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, and other storage media mature in the art. The storage medium is located in the memory, and the processor reads the information in the memory, and completes the steps in the above method embodiments in combination with its hardware.
图13是本申请实施例提供的电子设备30的示意性框图。FIG. 13 is a schematic block diagram of an electronic device 30 provided by an embodiment of the present application.
如图13所示,该电子设备30可以为本申请实施例所述的视频编码器,或者视频解码器,该电子设备30可包括:As shown in FIG. 13 , the electronic device 30 may be the video encoder or the video decoder described in this embodiment of the application, and the electronic device 30 may include:
存储器33和处理器32,该存储器33用于存储计算机程序34,并将该程序代码34传输给该处理器32。换言之,该处理器32可以从存储器33中调用并运行计算机程序34, 以实现本申请实施例中的方法。A memory 33 and a processor 32 for storing a computer program 34 and transmitting the program code 34 to the processor 32 . In other words, the processor 32 can call and run the computer program 34 from the memory 33 to implement the method in the embodiment of the present application.
例如,该处理器32可用于根据该计算机程序34中的指令执行上述方法200中的步骤。For example, the processor 32 may be configured to perform the steps of the method 200 described above according to instructions in the computer program 34 .
在本申请的一些实施例中,该处理器32可以包括但不限于:In some embodiments of the present application, the processor 32 may include, but is not limited to:
通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等等。General-purpose processor, Digital Signal Processor (DSP), Application Specific Integrated Circuit (ASIC), Field Programmable Gate Array (FPGA) or other programmable logic devices, discrete gates Or transistor logic devices, discrete hardware components, and so on.
在本申请的一些实施例中,该存储器33包括但不限于:In some embodiments of the present application, the memory 33 includes but is not limited to:
易失性存储器和/或非易失性存储器。其中,非易失性存储器可以是只读存储器(Read-Only Memory,ROM)、可编程只读存储器(Programmable ROM,PROM)、可擦除可编程只读存储器(Erasable PROM,EPROM)、电可擦除可编程只读存储器(Electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(Random Access Memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(Static RAM,SRAM)、动态随机存取存储器(Dynamic RAM,DRAM)、同步动态随机存取存储器(Synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(Double Data Rate SDRAM,DDR SDRAM)、增强型同步动态随机存取存储器(Enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(synch link DRAM,SLDRAM)和直接内存总线随机存取存储器(Direct Rambus RAM,DR RAM)。Volatile memory and/or non-volatile memory. Wherein, the non-volatile memory may be a read-only memory (Read-Only Memory, ROM), a programmable read-only memory (Programmable ROM, PROM), an erasable programmable read-only memory (Erasable PROM, EPROM), an electrically programmable read-only memory (Erasable PROM, EPROM). Erase programmable read-only memory (Electrically EPROM, EEPROM) or flash memory. Volatile memory may be Random Access Memory (RAM), which acts as an external cache. By way of example and not limitation, many forms of RAM are available, such as Static RAM (SRAM), Dynamic RAM (DRAM), 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 (synch link DRAM, SLDRAM) and direct memory bus random access memory (Direct Rambus RAM, DR RAM).
在本申请的一些实施例中,该计算机程序34可以被分割成一个或多个单元,该一个或者多个单元被存储在该存储器33中,并由该处理器32执行,以完成本申请提供的方法。该一个或多个单元可以是能够完成特定功能的一系列计算机程序指令段,该指令段用于描述该计算机程序34在该电子设备30中的执行过程。In some embodiments of the present application, the computer program 34 may be divided into one or more units, and the one or more units are stored in the memory 33 and executed by the processor 32 to complete the procedures provided by the present application. Methods. The one or more units may be a series of computer program instruction segments capable of performing specific functions, and the instruction segments are used to describe the execution process of the computer program 34 in the electronic device 30 .
如图13所示,该电子设备30还可包括:As shown in FIG. 13 , the electronic device 30 may further include:
收发器33,该收发器33可连接至该处理器32或存储器33。A transceiver 33 which can be connected to the processor 32 or the memory 33 .
其中,处理器32可以控制该收发器33与其他设备进行通信,具体地,可以向其他设备发送信息或数据,或接收其他设备发送的信息或数据。收发器33可以包括发射机和接收机。收发器33还可以进一步包括天线,天线的数量可以为一个或多个。The processor 32 can control the transceiver 33 to communicate with other devices, specifically, can send information or data to other devices, or receive information or data sent by other devices. The transceiver 33 may include a transmitter and a receiver. The transceiver 33 may further include antennas, and the number of the antennas may be one or more.
应当理解,该电子设备30中的各个组件通过总线系统相连,其中,总线系统除包括数据总线之外,还包括电源总线、控制总线和状态信号总线。It should be understood that each component in the electronic device 30 is connected through a bus system, wherein the bus system includes a power bus, a control bus and a status signal bus in addition to a data bus.
图14是本申请实施例提供的视频编解码系统40的示意性框图。FIG. 14 is a schematic block diagram of a video encoding and decoding system 40 provided by an embodiment of the present application.
如图14所示,该视频编解码系统40可包括:视频编码器41和视频解码器42,其中视频编码器41用于执行本申请实施例涉及的视频编码方法,视频解码器42用于执行本申请实施例涉及的视频解码方法。As shown in FIG. 14 , the video encoding and decoding system 40 may include: a video encoder 41 and a video decoder 42 , wherein the video encoder 41 is used for executing the video encoding method involved in the embodiments of the present application, and the video decoder 42 is used for executing The video decoding method involved in the embodiments of the present application.
本申请还提供了一种计算机存储介质,其上存储有计算机程序,该计算机程序被计算机执行时使得该计算机能够执行上述方法实施例的方法。或者说,本申请实施例还提供一种包含指令的计算机程序产品,该指令被计算机执行时使得计算机执行上述方法实施例的方法。The present application also provides a computer storage medium on which a computer program is stored, and when the computer program is executed by a computer, enables the computer to execute the methods of the above method embodiments. In other words, the embodiments of the present application further provide a computer program product including instructions, when the instructions are executed by a computer, the instructions cause the computer to execute the methods of the above method embodiments.
当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。该计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行该计算机程序指令时,全部或部分地产生按照本申请实施例该的流程或功能。该计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。该计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,该计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(digital subscriber line,DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。该计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。该可用介质可以是磁性介质(例如,软盘、硬盘、磁带)、光介质(例如数字视频光盘(digital video disc,DVD))、或者半导体介质(例如固态硬盘(solid state disk,SSD))等。When implemented in software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions according to the embodiments of the present application are generated. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable device. The computer instructions may be stored on or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions may be transmitted over a wire from a website site, computer, server or data center (eg coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (eg infrared, wireless, microwave, etc.) means to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that includes one or more available media integrated. The available media may be magnetic media (eg, floppy disk, hard disk, magnetic tape), optical media (eg, digital video disc (DVD)), or semiconductor media (eg, solid state disk (SSD)), and the like.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each particular application, but such implementations should not be considered beyond the scope of this application.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,该单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the device embodiments described above are only illustrative. For example, the division of the unit is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or may be Integration into another system, or some features can be ignored, or not implemented. On the other hand, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。例如,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。Units described as separate components may or may not be physically separated, and components shown as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment. For example, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
以上该,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以该权利要求的保护范围为准。The above are only specific embodiments of the present application, but the protection scope of the present application is not limited to this. Any person skilled in the art who is familiar with the technical scope disclosed in the present application can easily think of changes or substitutions. Covered within the scope of protection of this application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (42)

  1. 一种视频编码方法,其特征在于,包括:A video coding method, comprising:
    获得当前图像的重建图像,所述重建图像包括第一分量,所述第一分量为亮度分量或色度分量;obtaining a reconstructed image of the current image, where the reconstructed image includes a first component, and the first component is a luminance component or a chrominance component;
    确定对所述第一分量下的所述重建图像中的目标区域使用第一自适应修正滤波器ALF进行滤波时,所述第一ALF的浮点数类型的ALF系数;determining the ALF coefficient of the floating point type of the first ALF when the target area in the reconstructed image under the first component is filtered using the first adaptive correction filter ALF;
    根据所述第一ALF的浮点数类型的ALF系数,确定所述第一ALF的浮点数类型的ALF系数的最大量化尺度;determining the maximum quantization scale of the ALF coefficients of the floating point type of the first ALF according to the ALF coefficients of the floating point type of the first ALF;
    根据所述最大量化尺度,确定所述第一ALF的浮点数类型的ALF系数的目标量化尺度,所述目标量化尺度小于或等于所述最大量化尺度;According to the maximum quantization scale, determine the target quantization scale of the floating-point type ALF coefficient of the first ALF, where the target quantization scale is less than or equal to the maximum quantization scale;
    使用所述目标量化尺度,将所述第一ALF的浮点数类型的ALF系数量化为整数类型的ALF系数;Using the target quantization scale, quantizing the floating-point type ALF coefficients of the first ALF into integer-type ALF coefficients;
    对所述第一ALF的整数类型的ALF系数进行编码,得到码流。Encoding the integer-type ALF coefficients of the first ALF to obtain a code stream.
  2. 根据权利要求1所述的方法,其特征在于,所述根据所述第一ALF的浮点数类型的ALF系数,确定所述第一ALF的浮点数类型的ALF系数的最大量化尺度,包括:The method according to claim 1, wherein the determining, according to the ALF coefficients of the floating point type of the first ALF, the maximum quantization scale of the ALF coefficients of the floating point type of the first ALF comprises:
    根据所述第一ALF的浮点数类型的ALF系数中的第一系数和所述第一系数对应的最大整数系数阈值,确定将所述浮点数类型的ALF系数量化为整数类型时所允许的最大移位值;According to the first coefficient in the ALF coefficients of the floating point type of the first ALF and the maximum integer coefficient threshold corresponding to the first coefficient, determine the maximum allowable maximum value when the ALF coefficient of the floating point type is quantized into the integer type shift value;
    根据所述最大移位值,确定所述第一ALF的浮点数类型的ALF系数的最大量化尺度。According to the maximum shift value, the maximum quantization scale of the floating-point type ALF coefficient of the first ALF is determined.
  3. 根据权利要求2所述的方法,其特征在于,所述第一系数为所述第一ALF的中心位置对应的浮点类型的系数。The method according to claim 2, wherein the first coefficient is a floating-point type coefficient corresponding to a center position of the first ALF.
  4. 根据权利要求3所述的方法,其特征在于,所述根据所述浮点数类型的ALF系数中的第一系数和所述第一系数对应的最大整数系数阈值,确定将所述浮点数类型的ALF系数量化为整数类型时所允许的最大移位值,包括:The method according to claim 3, wherein, according to the first coefficient in the ALF coefficients of the floating-point number type and a maximum integer coefficient threshold corresponding to the first coefficient, determining the floating-point number type The maximum shift value allowed when ALF coefficients are quantized to integer types, including:
    根据如下公式,确定所述最大移位值:The maximum shift value is determined according to the following formula:
    Figure PCTCN2021073409-appb-100001
    Figure PCTCN2021073409-appb-100001
    其中,所述bitshift所述最大移位值,所述floor为向下取整,所述W f(0,0)为所述第一ALF的中心位置对应的浮点类型的系数,所述d为所述W f(0,0)对应的最大整数系数阈值。 The maximum shift value of the bitshift, the floor is rounded down, the W f(0,0) is the coefficient of floating point type corresponding to the center position of the first ALF, the d is the maximum integer coefficient threshold corresponding to the W f(0,0) .
  5. 根据权利要求4所述的方法,其特征在于,所述d为127。The method according to claim 4, wherein the d is 127.
  6. 根据权利要求4所述的方法,其特征在于,所述根据所述最大移位值,确定所述第一ALF的浮点数类型的ALF系数的最大量化尺度,包括:The method according to claim 4, wherein the determining, according to the maximum shift value, the maximum quantization scale of the ALF coefficients of the floating point type of the first ALF comprises:
    根据如下公式,确定所述第一ALF的浮点数类型的ALF系数的最大量化尺度:According to the following formula, the maximum quantization scale of the ALF coefficients of the floating point type of the first ALF is determined:
    Scale max=2 bitshiftScale max = 2 bitshift ,
    其中,所述Scale max为所述最大量化尺度。 Wherein, the Scale max is the maximum quantization scale.
  7. 根据权利要求2-6任一项所述的方法,其特征在于,若所述第一分量为亮度分量,则所述根据所述最大量化尺度,确定所述第一ALF的浮点数类型的ALF系数的目标量化尺度,包括:The method according to any one of claims 2-6, wherein, if the first component is a luminance component, determining the floating-point type ALF of the first ALF according to the maximum quantization scale The target quantization scale of the coefficients, including:
    将第一量化尺度确定为所述第一ALF的浮点数类型的ALF系数的目标量化尺度,所述第一量化尺度小于或等于所述最大量化尺度。A first quantization scale is determined as the target quantization scale of the floating-point type ALF coefficients of the first ALF, the first quantization scale being less than or equal to the maximum quantization scale.
  8. 根据权利要求7所述的方法,其特征在于,所述方法还包括:The method according to claim 7, wherein the method further comprises:
    将第二量化尺度确定为第二ALF的浮点数类型的ALF系数的目标量化尺度,所述第二ALF为对色度分量下的所述重建图像进行ALS滤波时使用的滤波器,所述第二量化尺度小于所述第一量化尺度。The second quantization scale is determined as the target quantization scale of the floating-point ALF coefficient of the second ALF, the second ALF is a filter used when performing ALS filtering on the reconstructed image under the chrominance component, and the second ALF is The binary quantization scale is smaller than the first quantization scale.
  9. 根据权利要求2-6任一项所述的方法,其特征在于,若所述第一分量为色度分量,则所述根据所述最大量化尺度,确定所述第一ALF的浮点数类型的ALF系数的目标量化尺度,包括:The method according to any one of claims 2-6, wherein, if the first component is a chrominance component, determining the floating point type of the first ALF according to the maximum quantization scale Target quantization scale for ALF coefficients, including:
    将第三量化尺度确定为所述第一ALF的浮点数类型的ALF系数的的目标量化尺度,所述第三量化尺度小于所述最大量化尺度。A third quantization scale is determined as the target quantization scale of the floating-point type ALF coefficients of the first ALF, and the third quantization scale is smaller than the maximum quantization scale.
  10. 根据权利要求9所述的方法,其特征在于,所述方法还包括:The method according to claim 9, wherein the method further comprises:
    将第四量化尺度确定为第三ALF的浮点数类型的ALF系数的目标量化尺度,所述第三ALF为对亮度分量下的所述重建图像进行ALS滤波时使用的滤波器,所述第四量化尺度大于所述第三量化尺度。The fourth quantization scale is determined as the target quantization scale of the floating-point ALF coefficient of the third ALF, the third ALF is a filter used when performing ALS filtering on the reconstructed image under the luminance component, and the fourth ALF is The quantization scale is larger than the third quantization scale.
  11. 根据权利要求2-6任一项所述的方法,其特征在于,所述所述根据所述最大量化尺度,确定所述第一ALF的浮点数类型的ALF系数的目标量化尺度,包括:The method according to any one of claims 2-6, wherein the determining, according to the maximum quantization scale, the target quantization scale of the floating-point type ALF coefficient of the first ALF comprises:
    针对所述最大量化尺度与预设的最小量化尺度构成的量化区间内的每一个第一量化尺度,确定所述第一量化尺度的量化代价,所述第一量化尺度为2的幂次方的正整数;For each first quantization scale in the quantization interval formed by the maximum quantization scale and the preset minimum quantization scale, determine the quantization cost of the first quantization scale, where the first quantization scale is a power of 2 positive integer;
    根据每一个所述第一量化尺度的量化代价,确定所述第一ALF的浮点数类型的ALF系数的目标量化代价。According to the quantization cost of each of the first quantization scales, the target quantization cost of the floating-point type ALF coefficient of the first ALF is determined.
  12. 根据权利要求11所述的方法,其特征在于,所述根据每一个所述第一量化尺度的量化代价,确定所述第一ALF的浮点数类型的ALF系数的目标量化代价,包括:The method according to claim 11, wherein the determining the target quantization cost of the floating-point type ALF coefficient of the first ALF according to the quantization cost of each of the first quantization scales comprises:
    将量化代价最小的第一量化尺度确定为所述第一ALF的浮点数类型的ALF系数的目标量化代价。The first quantization scale with the smallest quantization cost is determined as the target quantization cost of the floating-point type ALF coefficient of the first ALF.
  13. 根据权利要求11所述的方法,其特征在于,所述确定所述第一量化尺度的量化代价,包括:The method according to claim 11, wherein the determining the quantization cost of the first quantization scale comprises:
    使用所述第一量化尺度,将所述第一ALF的浮点类型的所述ALF系数量化为整数类型的第一ALF系数;using the first quantization scale, quantizing the ALF coefficients of the floating point type of the first ALF to the first ALF coefficients of the integer type;
    确定使用所述第一ALF系数对所述重建图像的目标区域进行编码时,所述第一ALF系数对应的量化失真结果;determining the quantization distortion result corresponding to the first ALF coefficient when the target region of the reconstructed image is encoded by using the first ALF coefficient;
    根据所述第一ALF系数对应的量化失真结果,以及编码所述第一ALF系数所消耗的比特数,确定所述第一量化尺度的量化代价。The quantization cost of the first quantization scale is determined according to the quantization distortion result corresponding to the first ALF coefficient and the number of bits consumed for encoding the first ALF coefficient.
  14. 根据权利要求13所述的方法,其特征在于,所述确定使用所述第一ALF系数对所述重建图像的目标区域进行编码时,所述第一ALF系数对应的量化失真结果,包括:The method according to claim 13, wherein when the determining to use the first ALF coefficient to encode the target area of the reconstructed image, the quantization distortion result corresponding to the first ALF coefficient comprises:
    根据所述目标区域中像素点的重建像素值,确定所述目标区域中像素点的自相关系数;According to the reconstructed pixel value of the pixel point in the target area, determine the autocorrelation coefficient of the pixel point in the target area;
    根据所述目标区域中像素点的原始像素值,确定所述目标区域中像素点的互相关系数;According to the original pixel value of the pixel in the target area, determine the cross-correlation coefficient of the pixel in the target area;
    根据所述目标区域中像素点的自相关系数与所述第一ALF系数乘积,以及所述目标区域中像素点的互相关系数,确定所述第一ALF系数对应的量化失真结果。The quantization distortion result corresponding to the first ALF coefficient is determined according to the product of the autocorrelation coefficient of the pixels in the target area and the first ALF coefficient, and the cross-correlation coefficient of the pixels in the target area.
  15. 根据权利要求13所述的方法,其特征在于,所述确定使用所述第一ALF系数对所述重建图像的目标区域进行编码时,所述第一ALF系数对应的量化失真,包括:The method according to claim 13, wherein the determining the quantization distortion corresponding to the first ALF coefficient when the target region of the reconstructed image is encoded by using the first ALF coefficient, comprises:
    使用所述第一ALF系数对所述重建图像的目标区域进行滤波;filtering the target region of the reconstructed image using the first ALF coefficients;
    根据所述目标区域中像素点的滤波后像素值和原始像素值的差值,确定所述第一ALF系数对应的量化失真结果。The quantization distortion result corresponding to the first ALF coefficient is determined according to the difference between the filtered pixel value and the original pixel value of the pixel in the target area.
  16. 根据权利要求13-15任一项所述的方法,其特征在于,所述根据所述第一ALF系数对应的量化失真结果,以及编码所述第一ALF系数所消耗的比特数,确定所述第一量化尺度的量化代价,包括:The method according to any one of claims 13-15, wherein the determining the The quantization cost of the first quantization scale, including:
    根据如下公式,确定所述第一量化尺度的量化代价:The quantization cost of the first quantization scale is determined according to the following formula:
    J=D+λRJ=D+λR
    其中,所述J为所述第一量化尺度的量化代价,所述D为所述第一ALF系数对应的量化失真结果,所述R为编码所述第一ALF系数所消耗的比特数,所述λ为可变值。Wherein, the J is the quantization cost of the first quantization scale, the D is the quantization distortion result corresponding to the first ALF coefficient, the R is the number of bits consumed by encoding the first ALF coefficient, and the The λ is a variable value.
  17. 根据权利要求1所述的方法,其特征在于,所述码流中包括所述第一ALF的所有整数类型的ALF系数。The method according to claim 1, wherein the code stream includes ALF coefficients of all integer types of the first ALF.
  18. 根据权利要求1所述的方法,其特征在于,所述码流中包括所述第一ALF的整数类型的第二ALF系数和第一信息,所述第二ALF系数为所述第一ALF中非中心点对应的整数类型的ALF系数,所述第一信息用于指示所述目标量化尺度。The method according to claim 1, wherein the code stream includes second ALF coefficients and first information of an integer type of the first ALF, and the second ALF coefficients are in the first ALF. An integer type ALF coefficient corresponding to a non-center point, where the first information is used to indicate the target quantization scale.
  19. 根据权利要求18所述的方法,其特征在于,所述第一信息包括所述目标量化尺度对应的目标移位值。The method according to claim 18, wherein the first information comprises a target shift value corresponding to the target quantization scale.
  20. 根据权利要求18所述的方法,其特征在于,所述第一信息包括所述目标量化尺度对应的目标移位值与第一数值的差值的绝对值。The method according to claim 18, wherein the first information comprises the absolute value of the difference between the target shift value corresponding to the target quantization scale and the first value.
  21. 根据权利要求20所述的方法,其特征在于,所述第一数值为6、5或4。The method of claim 20, wherein the first value is 6, 5 or 4.
  22. 根据权利要求1所述的方法,其特征在于,所述方法还包括:The method according to claim 1, wherein the method further comprises:
    使用所述第一AFL的整数类型的ALF系数,对所述第一分量下的所述重建图像的目标区域进行滤波。The target region of the reconstructed image under the first component is filtered using integer-type ALF coefficients of the first AFL.
  23. 根据权利要求22所述的方法,其特征在于,所述使用所述第一AFL的整数类型的ALF系数,对所述第一分量下的所述重建图像的目标区域进行滤波,包括:The method according to claim 22, wherein the filtering the target area of the reconstructed image under the first component by using the integer-type ALF coefficients of the first AFL comprises:
    根据如下公式,对所述第一分量下的所述重建图像的目标区域进行滤波:The target area of the reconstructed image under the first component is filtered according to the following formula:
    Figure PCTCN2021073409-appb-100002
    Figure PCTCN2021073409-appb-100002
    其中,所述I rec(0,0)'为所述目标区域中当前点(0,0)滤波后的重建像素值,所述(x,y)为相对于所述当前点的位置,所述W j为所述第一ALF的第j个整数类型的ALF系数,所述W n-1为所述第一ALF的中心点对应的整数类型的ALF系数,所述I rec(0,0)为所述当前点的重建像素值,所述Alfshif为所述目标量化尺度对应的目标移位值,所述n为所述第一ALF所包括的ALF系数的个数。 Wherein, the I rec(0,0) ' is the reconstructed pixel value after filtering by the current point (0,0) in the target area, and the (x, y) is the position relative to the current point, so The W j is the ALF coefficient of the jth integer type of the first ALF, the W n-1 is the ALF coefficient of the integer type corresponding to the center point of the first ALF, and the I rec(0,0 ) is the reconstructed pixel value of the current point, the Alfshif is the target shift value corresponding to the target quantization scale, and the n is the number of ALF coefficients included in the first ALF.
  24. 一种视频解码方法,其特征在于,包括:A video decoding method, comprising:
    解码码流,得到当前图像的残差值;Decode the code stream to obtain the residual value of the current image;
    根据所述当前图像的残差值,确定所述当前图像的重建图像,所述重建图像包括第一分量,所述第一分量为亮度分量或色度分量;determining a reconstructed image of the current image according to the residual value of the current image, where the reconstructed image includes a first component, and the first component is a luminance component or a chrominance component;
    解码码流,得到所述第一分量下所述重建图像中的目标区域对应的第一自适应修正滤波器ALF的ALF系数信息;Decoding the code stream to obtain the ALF coefficient information of the first adaptive correction filter ALF corresponding to the target region in the reconstructed image under the first component;
    根据所述第一ALF的ALF系数信息,使用所述第一ALF对所述第一分量下的所述重建图像中的目标区域进行滤波。According to the ALF coefficient information of the first ALF, the target area in the reconstructed image under the first component is filtered using the first ALF.
  25. 根据权利要求24所述的方法,其特征在于,所述第一ALF的ALF系数信息包括所述第一ALF的所有整数类型的ALF系数。The method according to claim 24, wherein the ALF coefficient information of the first ALF includes ALF coefficients of all integer types of the first ALF.
  26. 根据权利要求24所述的方法,其特征在于,所述第一ALF的ALF系数信息包括所述第一ALF的整数类型的第二ALF系数和第一信息,所述第二ALF系数为所述第一ALF中非中心点对应的整数类型的ALF系数,所述第一信息用于指示所述目标量化尺度。The method according to claim 24, wherein the ALF coefficient information of the first ALF comprises an integer type second ALF coefficient and first information of the first ALF, and the second ALF coefficient is the The integer-type ALF coefficient corresponding to the non-central point in the first ALF, where the first information is used to indicate the target quantization scale.
  27. 根据权利要求26所述的方法,其特征在于,所述第一信息包括所述目标量化尺度对应的目标移位值。The method according to claim 26, wherein the first information comprises a target shift value corresponding to the target quantization scale.
  28. 根据权利要求26所述的方法,其特征在于,所述第一信息包括所述目标量化尺度对应的目标移位值与第一数值的差值的绝对值。The method according to claim 26, wherein the first information comprises the absolute value of the difference between the target shift value corresponding to the target quantization scale and the first value.
  29. 根据权利要求28所述的方法,其特征在于,所述第一数值为6、5或4。The method of claim 28, wherein the first value is 6, 5 or 4.
  30. 根据权利要求26所述的方法,其特征在于,所述根据所述第一ALF的ALF系数信息,使用所述第一ALF对所述第一分量下的所述重建图像中的目标区域进行滤波,包括:The method according to claim 26, wherein the first ALF is used to filter the target area in the reconstructed image under the first component according to the ALF coefficient information of the first ALF ,include:
    根据所述第一ALF的第二ALF系数和所述目标量化尺度,确定所述第一ALF的第一ALF系数,所述第一ALF系数为所述第一ALF的中心点对应的整数类型的ALF系数;Determine the first ALF coefficient of the first ALF according to the second ALF coefficient of the first ALF and the target quantization scale, where the first ALF coefficient is an integer type corresponding to the center point of the first ALF ALF coefficient;
    根据所述第一ALF的所述第二ALF系数和所述第一ALF系数,使用所述第一ALF对所述第一分量下的所述重建图像中的目标区域进行滤波。The target area in the reconstructed image under the first component is filtered using the first ALF according to the second ALF coefficient and the first ALF coefficient of the first ALF.
  31. 根据权利要求30所述的方法,其特征在于,所述根据所述第一ALF的第二ALF系数和所述目标量化尺度,确定所述第一ALF的第一ALF系数,包括:The method according to claim 30, wherein the determining the first ALF coefficient of the first ALF according to the second ALF coefficient of the first ALF and the target quantization scale comprises:
    根据如下公式,确定所述第一ALF的第一ALF系数:The first ALF coefficient of the first ALF is determined according to the following formula:
    Figure PCTCN2021073409-appb-100003
    Figure PCTCN2021073409-appb-100003
    其中,所述AlfCoeffLuma[i][k]为第i个第一ALF的所述第一ALF系数,所述k为所述第一ALF所包括的ALF系数的数量减一,所述第一ALF所述AlfLumaShift[i]为所述第一ALF对应的目标量化尺度,所述AlfCoeffLuma[i][j]为所述第一ALF中的第j个第二ALF系数。Wherein, the AlfCoeffLuma[i][k] is the first ALF coefficient of the i-th first ALF, the k is the number of ALF coefficients included in the first ALF minus one, and the first ALF The AlfLumaShift[i] is the target quantization scale corresponding to the first ALF, and the AlfCoeffLuma[i][j] is the jth second ALF coefficient in the first ALF.
  32. 根据权利要求31所述的方法,其特征在于,若所述第一分量为亮度分量,则所述i的取值为0至p,所述p为所述亮度分量对应的ALF的个数减一。The method according to claim 31, wherein if the first component is a luminance component, the value of i ranges from 0 to p, and p is the number of ALFs corresponding to the luminance component minus the number of one.
  33. 根据权利要求32所述的方法,其特征在于,所述p为15或63。The method of claim 32, wherein the p is 15 or 63.
  34. 根据权利要求31所述的方法,其特征在于,若所述第一分量为Cb分量,则所述i等于第一值,若所述第一分量为Cr分量,则所述i等于第二值。The method according to claim 31, wherein if the first component is a Cb component, the i is equal to a first value, and if the first component is a Cr component, the i is equal to a second value .
  35. 根据权利要求34所述的方法,其特征在于,所述第一值为0,所述第二值为1。The method of claim 34, wherein the first value is 0 and the second value is 1.
  36. 根据权利要求31所述的方法,其特征在于,所述方法还包括:The method of claim 31, wherein the method further comprises:
    从所述码流中解析得到所述第一ALF的形状信息;The shape information of the first ALF is obtained by parsing from the code stream;
    根据所述第一ALF的形状信息,确定所述第一ALF的类型。The type of the first ALF is determined according to the shape information of the first ALF.
  37. 根据权利要求36所述的方法,其特征在于,若所述第一ALF的形状为7×7十字形加3×3方形滤波器形状,则所述第一ALF包括9个ALF系数;若所述第一ALF的形状为7×7十字形加5×5方形滤波器形状,则所述第一ALF包括15个ALF系数。The method according to claim 36, wherein if the shape of the first ALF is a 7×7 cross plus a 3×3 square filter shape, the first ALF includes 9 ALF coefficients; If the shape of the first ALF is a 7×7 cross shape plus a 5×5 square filter shape, the first ALF includes 15 ALF coefficients.
  38. 根据权利要求30所述的方法,其特征在于,所述根据所述第一ALF的所述第二ALF系数和所述第一ALF系数,使用所述第一ALF对所述第一分量下的所述重建图像中的目标区域进行滤波,包括:The method according to claim 30, wherein, according to the second ALF coefficient and the first ALF coefficient of the first ALF, using the first ALF to compare the The target area in the reconstructed image is filtered, including:
    根据如下公式,对所述第一分量下的所述重建图像中的目标区域进行滤波:The target area in the reconstructed image under the first component is filtered according to the following formula:
    Figure PCTCN2021073409-appb-100004
    Figure PCTCN2021073409-appb-100004
    其中,所述I rec(0,0)′为所述目标区域中当前点(0,0)滤波后的重建像素值,所述(x,y)为相对于所述当前点的位置,所述W j为所述第一ALF的第j个整数类型的ALF系数,所述W n-1为所述第一ALF的中心点对应的整数类型的ALF系数,所述I rec(0,0)为所述当前点的重建像素值,所述Alfshif为所述目标量化尺度对应的目标移位值,所述n为所述第一ALF所包括的ALF系数的个数。 Wherein, the I rec(0,0) ′ is the reconstructed pixel value filtered by the current point (0,0) in the target area, and the (x, y) is the position relative to the current point, so The W j is the ALF coefficient of the jth integer type of the first ALF, the W n-1 is the ALF coefficient of the integer type corresponding to the center point of the first ALF, and the I rec(0,0 ) is the reconstructed pixel value of the current point, the Alfshif is the target shift value corresponding to the target quantization scale, and the n is the number of ALF coefficients included in the first ALF.
  39. 一种视频编码器,其特征在于,包括:A video encoder, comprising:
    获取单元,用于获得当前图像的重建图像,所述重建图像包括第一分量,所述第一分量为亮度分量或色度分量;an obtaining unit, configured to obtain a reconstructed image of the current image, where the reconstructed image includes a first component, and the first component is a luminance component or a chrominance component;
    第一确定单元,用于确定对所述第一分量下的所述重建图像中的目标区域使用第一自适应修正滤波器ALF进行滤波时,所述第一ALF的浮点数类型的ALF系数;a first determining unit, configured to determine an ALF coefficient of the floating point type of the first ALF when the target area in the reconstructed image under the first component is filtered using the first adaptive correction filter ALF;
    第二确定单元,用于根据所述第一ALF的浮点数类型的ALF系数,确定所述第一ALF的浮点数类型的ALF系数的最大量化尺度;a second determination unit, configured to determine the maximum quantization scale of the ALF coefficients of the floating point type of the first ALF according to the ALF coefficients of the floating point type of the first ALF;
    第三确定单元,用于根据所述最大量化尺度,确定所述第一ALF的浮点数类型的ALF系数的目标量化尺度,所述目标量化尺度小于或等于所述最大量化尺度;a third determining unit, configured to determine, according to the maximum quantization scale, a target quantization scale of the floating-point ALF coefficient of the first ALF, where the target quantization scale is less than or equal to the maximum quantization scale;
    量化单元,用于使用所述目标量化尺度,将所述第一ALF的浮点数类型的ALF系数量化为整数类型的ALF系数;a quantization unit, configured to use the target quantization scale to quantize the floating-point type ALF coefficients of the first ALF into integer-type ALF coefficients;
    编码单元,用于对所述第一ALF的整数类型的ALF系数进行编码,得到码流。an encoding unit, configured to encode the integer-type ALF coefficients of the first ALF to obtain a code stream.
  40. 一种视频解码器,其特征在于,包括:A video decoder, comprising:
    第一解码单元,用于解码码流,得到当前图像的残差值;The first decoding unit is used for decoding the code stream to obtain the residual value of the current image;
    确定单元,用于根据所述当前图像的残差值,确定所述当前图像的重建图像,所述重建图像包括第一分量,所述第一分量为亮度分量或色度分量;a determining unit, configured to determine a reconstructed image of the current image according to the residual value of the current image, where the reconstructed image includes a first component, and the first component is a luminance component or a chrominance component;
    第二解码单元,用于解码码流,得到所述第一分量下所述重建图像中的目标区域对应的第一自适应修正滤波器ALF的ALF系数信息;a second decoding unit, configured to decode the code stream to obtain the ALF coefficient information of the first adaptive correction filter ALF corresponding to the target region in the reconstructed image under the first component;
    滤波单元,用于根据所述第一ALF的ALF系数信息,使用所述第一ALF对所述第一分量下的所述重建图像中的目标区域进行滤波。A filtering unit, configured to use the first ALF to filter the target area in the reconstructed image under the first component according to the ALF coefficient information of the first ALF.
  41. 一种视频编解码系统,其特征在于,包括:A video encoding and decoding system, comprising:
    根据权利要求39所述的视频编码器;The video encoder of claim 39;
    以及根据权利要求40所述的视频解码器。and the video decoder of claim 40.
  42. 一种计算机可读存储介质,其特征在于,用于存储计算机程序,所述计算机程序使得计算机执行如权利要求1至23或如权利要求24至38任一项所述的方法。A computer-readable storage medium, characterized by being used for storing a computer program, the computer program causing a computer to execute the method according to any one of claims 1 to 23 or claims 24 to 38.
PCT/CN2021/073409 2021-01-22 2021-01-22 Video coding method and system, video decoding method and system, video coder and video decoder WO2022155922A1 (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
PCT/CN2021/073409 WO2022155922A1 (en) 2021-01-22 2021-01-22 Video coding method and system, video decoding method and system, video coder and video decoder
CN202311245327.0A CN117082239A (en) 2021-01-22 2021-01-22 Video encoding and decoding method and system, video encoder and video decoder
CN202180090973.7A CN116746152A (en) 2021-01-22 2021-01-22 Video encoding and decoding method and system, video encoder and video decoder

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2021/073409 WO2022155922A1 (en) 2021-01-22 2021-01-22 Video coding method and system, video decoding method and system, video coder and video decoder

Publications (1)

Publication Number Publication Date
WO2022155922A1 true WO2022155922A1 (en) 2022-07-28

Family

ID=82548401

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/073409 WO2022155922A1 (en) 2021-01-22 2021-01-22 Video coding method and system, video decoding method and system, video coder and video decoder

Country Status (2)

Country Link
CN (2) CN116746152A (en)
WO (1) WO2022155922A1 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107211154A (en) * 2015-02-11 2017-09-26 高通股份有限公司 Decoding tree cell level auto-adaptive loop filter
WO2020094154A1 (en) * 2018-11-09 2020-05-14 Beijing Bytedance Network Technology Co., Ltd. Improvements for region based adaptive loop filter
WO2020126411A1 (en) * 2018-12-21 2020-06-25 Canon Kabushiki Kaisha Adaptive loop filtering (alf) with non-linear clipping
CN111742552A (en) * 2019-06-25 2020-10-02 北京大学 Method and device for loop filtering
CN111801941A (en) * 2018-03-09 2020-10-20 华为技术有限公司 Method and apparatus for image filtering using adaptive multiplier coefficients

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107211154A (en) * 2015-02-11 2017-09-26 高通股份有限公司 Decoding tree cell level auto-adaptive loop filter
CN111801941A (en) * 2018-03-09 2020-10-20 华为技术有限公司 Method and apparatus for image filtering using adaptive multiplier coefficients
WO2020094154A1 (en) * 2018-11-09 2020-05-14 Beijing Bytedance Network Technology Co., Ltd. Improvements for region based adaptive loop filter
WO2020126411A1 (en) * 2018-12-21 2020-06-25 Canon Kabushiki Kaisha Adaptive loop filtering (alf) with non-linear clipping
CN111742552A (en) * 2019-06-25 2020-10-02 北京大学 Method and device for loop filtering

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
L.-H. XU (FUJITSU), J. YAO (FUJITSU), J.-Q. ZHU, K. KAZUI (FUJITSU): "Non-CE5: Adaptive precision for CCALF coefficients", 17. JVET MEETING; 20200107 - 20200117; BRUSSELS; (THE JOINT VIDEO EXPLORATION TEAM OF ISO/IEC JTC1/SC29/WG11 AND ITU-T SG.16 ), 31 December 2019 (2019-12-31), XP030223092 *

Also Published As

Publication number Publication date
CN117082239A (en) 2023-11-17
CN116746152A (en) 2023-09-12

Similar Documents

Publication Publication Date Title
CN110720218B (en) Intra-frame filtering applied with transform processing in video coding
CN110393010B (en) Intra-filtering flags in video coding
CN113411577B (en) Coding method and device
JP7401542B2 (en) How to intra-predict blocks of pictures
CN111327904B (en) Image reconstruction method and device
EP4060990A1 (en) Video encoding method, video decoding method, and corresponding apparatuses
JP7277586B2 (en) Method and apparatus for mode and size dependent block level limiting
WO2023039859A1 (en) Video encoding method, video decoding method, and device, system and storage medium
WO2019010305A1 (en) Color remapping for non-4:4:4 format video content
KR20210107131A (en) Image prediction method, apparatus and system, device and storage medium
CN114424567B (en) Method and apparatus for combined inter-intra prediction using matrix-based intra prediction
EP3890322A1 (en) Video coder-decoder and corresponding method
WO2023044868A1 (en) Video encoding method, video decoding method, device, system, and storage medium
EP3993420A1 (en) Video coder and qp setting method
WO2022155922A1 (en) Video coding method and system, video decoding method and system, video coder and video decoder
WO2022116105A1 (en) Video encoding method and system, video decoding method and apparatus, video encoder and video decoder
WO2022174475A1 (en) Video encoding method and system, video decoding method and system, video encoder, and video decoder
WO2023184250A1 (en) Video coding/decoding method, apparatus and system, device and storage medium
WO2023122968A1 (en) Intra-frame prediction method, device and system, and storage medium
WO2023236113A1 (en) Video encoding and decoding methods, apparatuses and devices, system, and storage medium
WO2024050723A1 (en) Image prediction method and apparatus, and computer readable storage medium
CN111277840A (en) Transform method, inverse transform method, video encoder and video decoder
WO2022217447A1 (en) Video encoding and decoding method and system, and video codec
WO2023122969A1 (en) Intra-frame prediction method, device, system, and storage medium
WO2022116054A1 (en) Image processing method and system, video encoder, and video decoder

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

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 202180090973.7

Country of ref document: CN

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21920320

Country of ref document: EP

Kind code of ref document: A1