WO2023083263A1 - Video encoding and decoding method and apparatus - Google Patents

Video encoding and decoding method and apparatus Download PDF

Info

Publication number
WO2023083263A1
WO2023083263A1 PCT/CN2022/131167 CN2022131167W WO2023083263A1 WO 2023083263 A1 WO2023083263 A1 WO 2023083263A1 CN 2022131167 W CN2022131167 W CN 2022131167W WO 2023083263 A1 WO2023083263 A1 WO 2023083263A1
Authority
WO
WIPO (PCT)
Prior art keywords
inverse
transformation
unit
inverse transform
transform
Prior art date
Application number
PCT/CN2022/131167
Other languages
French (fr)
Chinese (zh)
Inventor
曹小强
孙煜程
陈方栋
王莉
Original Assignee
杭州海康威视数字技术股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 杭州海康威视数字技术股份有限公司 filed Critical 杭州海康威视数字技术股份有限公司
Publication of WO2023083263A1 publication Critical patent/WO2023083263A1/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/44Decoders specially adapted therefor, e.g. video decoders which are asymmetric with respect to the encoder
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/60Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
    • H04N19/63Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding using sub-band based transform, e.g. wavelets
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/90Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using coding techniques not provided for in groups H04N19/10-H04N19/85, e.g. fractals
    • H04N19/91Entropy coding, e.g. variable length coding [VLC] or arithmetic coding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/90Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using coding techniques not provided for in groups H04N19/10-H04N19/85, e.g. fractals
    • H04N19/94Vector quantisation

Definitions

  • the present application relates to the technical field of video coding and decoding, and in particular to a video coding and decoding method and device.
  • Video is an important way for users to obtain information. In the process of video storage and transmission, considering the quality of information and the occupied space, it is necessary to compress the video to balance the relationship between information integrity and occupied space.
  • Video coding Video Coding
  • Video Coding technology is a way to achieve compression. Video coding mainly obtains code streams through the steps of prediction, transformation, quantization and entropy coding.
  • the current transformation method mainly adopts a preset transformation method for the transformation unit in the horizontal direction and vertical direction, wherein the preset transformation method is discrete cosine transform (Discrete Cosine Transform, DCT) or a conceptually similar transformation (for example, Discrete Sine Transform (Discrete Sine Transform, DST)), and the flexibility of the above-mentioned method is low, and the calculation complexity of the above two transformation methods is high, and it is not convenient to realize video encoding and decoding.
  • DCT discrete cosine Transform
  • DST Discrete Sine Transform
  • Embodiments of the present application provide a video encoding and decoding method and device, which improve the flexibility of a transformation method, reduce computational complexity, and improve compression performance.
  • the embodiment of the present application provides a video decoding method, which is applied to a video decoding device or a video decoding device, and the method includes: performing Entropy decoding and inverse quantization are used to obtain an inverse transform unit; discrete wavelet inverse transform is performed on the inverse transform unit to obtain inversely transformed coefficients.
  • the discrete wavelet inverse transform can remove the correlation between the internal pixels of each sub-image, and concentrate the information on as few inverse transform coefficients as possible, so that the next quantization step may quantize the coefficients carrying less information to 0, Reduce the impact on the reconstructed image quality.
  • the discrete wavelet inverse transform is used to greatly reduce the computational complexity, correspondingly, the burden of computational storage is reduced, and the complexity of hardware implementation is reduced.
  • performing discrete wavelet inverse transform on the inverse transform unit to obtain the coefficients after inverse transform includes: performing discrete wavelet inverse transform on the inverse transform unit in the horizontal direction, and performing discrete wavelet inverse transform in the vertical direction transformation, DCT2 inverse transformation, DST7 inverse transformation and no inverse transformation; or, perform any one of DCT2 inverse transformation, DST7 inverse transformation and no inverse transformation on the inverse transformation unit in the horizontal direction, Inverse discrete wavelet transform is performed in the vertical direction.
  • This possible implementation provides three ways of performing inverse discrete wavelet transform in the horizontal direction and/or vertical direction, and performing inverse discrete wavelet transform in only one direction helps to reduce computational complexity.
  • the same or different inverse transformation methods can be used for the two directions, which improves the flexibility of the inverse transformation process and is compatible with existing algorithms.
  • the discrete wavelet inverse transform includes Haar wavelet inverse transform and 5/3 wavelet inverse transform
  • the inverse discrete wavelet transform is performed on the inverse transform unit to obtain the coefficients after the inverse transform, including:
  • the transformation unit performs inverse Haar wavelet transform in the horizontal direction, and performs any one of inverse Haar wavelet transform, 5/3 wavelet inverse transform, DCT2 inverse transform, DST7 inverse transform and no inverse transform in the vertical direction; or, for
  • the inverse transformation unit performs 5/3 wavelet inverse transformation in the horizontal direction, and performs any one of Haar wavelet inverse transformation, 5/3 wavelet inverse transformation, DCT2 inverse transformation, DST7 inverse transformation and no inverse transformation in the vertical direction
  • to the described inverse transformation unit in Perform any one of DCT2 inverse transform in
  • This possible implementation method provides two inverse transform methods including the discrete wavelet inverse transform, combining the horizontal direction and the vertical direction to provide multiple combination methods. According to the translation and stretching of the Haar wavelet inverse transform and the 5/3 wavelet inverse transform, the calculation of multiplication is avoided, which helps to reduce the computational burden when processing large-scale data, and at the same time reduce the computational resources occupied during the calculation process .
  • the size of the inverse transformation unit is the same as the size of the coding unit; or, the width of the inverse transformation unit is half of the width of the coding unit, and the height of the inverse transformation unit is the same as the height of the coding unit ; or, the height of the inverse transformation unit is half of the height of the coding unit, and the width of the inverse transformation unit is the same as the width of the coding unit.
  • This possible implementation method provides a way to determine the size of the inverse transformation unit, and gives the relationship between the size of the inverse transformation unit and the size of the coding unit, and further dividing the coding unit during the transformation helps to reduce the computational complexity. .
  • a possible implementation manner is to perform discrete wavelet inverse transform on the inverse transform unit to obtain the coefficients after the inverse transform, including: based on the size of the inverse transform unit, determine to perform the first inverse transform on the inverse transform unit in the horizontal direction, and then The second inverse transformation is performed in the vertical direction; wherein, at least one of the first inverse transformation and the second inverse transformation is discrete wavelet inverse transformation.
  • This possible implementation method provides inverse discrete wavelet transform based on the horizontal direction and/or vertical direction.
  • the inverse transformation is performed based on one dimension, it helps to greatly reduce the computational burden and improve the compression performance.
  • the size of the inverse transformation unit includes a first size and a second size, and based on the size of the inverse transformation unit, it is determined to perform the first inverse transformation on the inverse transformation unit in the horizontal direction, and perform the second inverse transformation in the vertical direction.
  • the inverse transform includes: based on the first size, determining to perform discrete wavelet inverse transform on the inverse transform unit in the horizontal direction, and performing discrete wavelet inverse transform on the vertical direction; based on the second size, determining to perform the inverse transform unit on the horizontal direction Inverse discrete wavelet transform is performed, and no inverse transform is performed in the vertical direction.
  • This possible implementation provides a specific implementation of the corresponding transformation method based on the size of the inverse transformation unit, wherein the discrete wavelet transformation can be selected not to be performed in the vertical direction, thereby reducing the calculation burden.
  • the inverse discrete wavelet transform is performed on the inverse transform unit, and before the inversely transformed coefficients are obtained, the method further includes: acquiring a transformation method identification bit in the code stream, and the transformation method identification bit is used for Indicates the inverse transform method of the inverse transform unit, the inverse transform method includes performing discrete wavelet inverse transform in the horizontal direction and/or vertical direction.
  • This possible implementation provides a specific implementation of determining the inverse transformation method based on the transformation method identification bit in the code stream.
  • the way of direct indication helps to improve the efficiency of decoding, and at the same time establishes the corresponding relationship between the encoding side and the decoding side.
  • the method before performing discrete wavelet inverse transform on the inverse transform unit to obtain the inversely transformed coefficients, the method further includes: acquiring a prediction mode identification bit in the code stream, where the prediction mode identification bit is used to indicate the Before the inverse transformation unit performs inverse transformation, the prediction mode for the prediction unit to perform prediction, the prediction mode includes a first prediction mode and a second prediction mode; based on the first prediction mode, it is determined that the inverse transformation unit is discretely performed in the horizontal direction Inverse wavelet transform, performing any one of discrete wavelet inverse transform, DCT2 inverse transform, DST7 inverse transform and no inverse transform in the vertical direction; based on the second prediction mode, it is determined to perform DCT2 inverse transform on the inverse transform unit in the horizontal direction Transform, DST7 inverse transform and no inverse transform, perform discrete wavelet inverse transform in the vertical direction.
  • This possible implementation provides a specific implementation of determining the inverse transformation method based on the prediction mode identification bit in the code stream.
  • the inverse transformation method is determined according to the effect of different prediction modes, the flexibility of the inverse transformation is enhanced, and the compression effect is improved. According to the predefined relationship, it helps to improve the efficiency of decoding.
  • the prediction mode includes any one of DC prediction mode, angle prediction mode, Planar prediction mode and block copy mode, and the angle prediction mode includes any of horizontal prediction mode, vertical prediction mode and diagonal prediction mode A sort of.
  • This possible implementation method provides a type of prediction mode, which is used to establish a corresponding relationship with a transformation method and improve decoding efficiency.
  • a possible implementation method is to perform discrete wavelet inverse transform on the inverse transform unit to obtain inversely transformed coefficients, including: performing discrete wavelet inverse transform on the brightness of the inverse transform unit, and performing discrete wavelet inverse transform on the chroma of the inverse transform unit , any one of DCT2 inverse transform and DST7 inverse transform; or, perform any one of DCT2 inverse transform and DST7 inverse transform on the brightness of the inverse transform unit, and perform discrete wavelet inverse transform on the chrominance of the inverse transform unit.
  • This possible implementation method provides inverse discrete wavelet transform based on brightness and chroma, where the inverse transform based on brightness and chroma can be performed in combination with the size of brightness and chroma, which helps to reduce computational complexity and improve compression performance.
  • the embodiment of the present application provides a video decoding method, which is applied to a video decoding device or a video decoding device, and the method includes: performing entropy decoding and inverse quantization on a code stream to obtain an inverse transformation unit; Perform the third inverse transformation to obtain the coefficients after the inverse transformation; wherein, the third inverse transformation includes inverse transformation in the horizontal direction and/or inverse transformation in the vertical direction, and the inverse transformation methods in the horizontal direction and the vertical direction include DCT2 inverse transformation or DST7 inverse transform.
  • the size of the inverse transformation unit is the same as the size of the coding unit; or, the width of the inverse transformation unit is half of the width of the coding unit, and the height of the inverse transformation unit is the same as that of the coding unit or, the height of the inverse transformation unit is half of the height of the coding unit, and the width of the inverse transformation unit is the same as the width of the coding unit.
  • This possible implementation method provides a way to determine the size of the inverse transformation unit, and gives the relationship between the size of the inverse transformation unit and the size of the coding unit, and further dividing the coding unit during inverse transformation helps to reduce computational complexity Spend.
  • the size of the inverse transformation unit includes a third size, a fourth size, a fifth size, and a sixth size
  • the third inverse transformation is performed on the inverse transformation unit to obtain the coefficient after the inverse transformation, including: based on the inverse
  • DCT2 inverse transformation or DST7 inverse transformation is performed on the inverse transformation unit in the horizontal direction, and inverse transformation is not performed in the vertical direction
  • based on the fourth size of the inverse transformation unit inverse transformation is not performed on the inverse transformation unit in the horizontal direction Transformation, perform DCT2 inverse transformation or DST7 inverse transformation in the vertical direction
  • based on the fifth size of the inverse transformation unit perform DCT2 inverse transformation in the horizontal direction on the inverse transformation unit, and perform DST7 inverse transformation in the vertical direction
  • based on the sixth size of the inverse transformation unit Size perform DST7 inverse transformation on the inverse transformation unit in the horizontal direction, and perform DCT2 inverse transformation in the vertical direction.
  • This possible implementation provides a correspondence between the size of the inverse transformation unit and the inverse transformation method.
  • inverse transformation is performed based on one dimension, it helps to greatly reduce the computational burden and improve compression performance.
  • the third inverse transform is performed on the inverse transform unit, and before the inversely transformed coefficients are obtained, the method further includes: acquiring a transform method identification bit in the code stream, where the transform method identification bit is used to indicate the inverse transform An inverse transform method of the transform unit; determining a third inverse transform according to the inverse transform method of the inverse transform unit.
  • This possible implementation provides a specific implementation of determining the inverse transformation method based on the transformation method identification bit in the code stream.
  • the way of direct indication helps to improve the efficiency of decoding, and at the same time establishes the corresponding relationship between the encoding side and the decoding side.
  • the inverse discrete wavelet transform is performed on the inverse transform unit to obtain the inversely transformed coefficients.
  • the prediction mode for the prediction unit to perform prediction the prediction mode includes the third prediction mode, the fourth prediction mode, the fifth prediction mode, and the sixth prediction mode; based on the third prediction mode, determine the inverse transformation
  • the unit performs DCT2 inverse transformation or DST7 inverse transformation in the horizontal direction, and does not perform transformation in the vertical direction; based on the fourth prediction mode, it is determined that the inverse transformation unit does not perform inverse transformation in the horizontal direction, and performs DCT2 inverse transformation or DST7 in the vertical direction Inverse transformation; based on the fifth prediction mode, perform DCT2 inverse transformation on the inverse transformation unit in the horizontal direction, and perform DST7 inverse transformation on the vertical direction; based on the sixth prediction mode, perform DST7 inverse transformation on the inverse transformation unit in the horizontal direction , perform DCT2 inverse transformation in the vertical direction.
  • This possible implementation provides a specific implementation of determining the inverse transformation method based on the prediction mode identification bit in the code stream.
  • the inverse transformation method is determined according to the effect of different prediction modes, the flexibility of the inverse transformation is enhanced, and the compression effect is improved. According to the predefined relationship, it helps to improve the efficiency of decoding.
  • the prediction mode includes any one of DC mode, angle mode, Planar mode, and block copy mode
  • the angle mode is any one of horizontal mode, vertical mode, and diagonal mode.
  • This possible implementation provides a type of prediction mode, which is used to establish a corresponding relationship with the inverse transform method and improve decoding efficiency.
  • a possible implementation method is to perform a third inverse transformation on the inverse transformation unit to obtain the coefficients after the inverse transformation, including: performing DCT2 inverse transformation or DST7 inverse transformation on the brightness of the inverse transformation unit; performing DCT2 on the chroma of the inverse transformation unit Inverse transformation or DST7 inverse transformation to obtain the coefficients after inverse transformation.
  • This possible implementation method provides inverse transformation based on luminance and chrominance respectively.
  • the inverse transformation based on luminance and chrominance can be performed in combination with the size of luminance and chrominance, which helps to reduce computational complexity and improve compression performance. .
  • the embodiment of the present application provides a video coding method, which is applied to a video coding device or a video coding device, and the method includes: performing discrete wavelet transform on a transform unit to obtain a transform coefficient; performing quantization on the transform coefficient and Entropy coding to obtain code stream.
  • an embodiment of the present application provides a video coding method, which is applied to a video coding device or a video coding device, and the method includes: performing a third transformation on a transformation unit to obtain a transformation coefficient; wherein, the third transformation includes Performing transformation in the horizontal direction and/or performing transformation in the vertical direction, the transformation methods in the horizontal direction and the vertical direction include DCT2 transformation or DST7 transformation; performing quantization and entropy coding on the transformation coefficients to obtain a code stream.
  • an embodiment of the present application provides a video decoding device, which has a function of implementing the video decoding method in any one of the foregoing first aspects.
  • This function may be implemented by hardware, or may be implemented by executing corresponding software on the hardware.
  • the hardware or software includes one or more modules corresponding to the above functions.
  • an embodiment of the present application provides a video decoding device, which has a function of implementing the video decoding method in any one of the above-mentioned second aspects.
  • This function may be implemented by hardware, or may be implemented by executing corresponding software on the hardware.
  • the hardware or software includes one or more modules corresponding to the above functions.
  • an embodiment of the present application provides a video encoding device, which has a function of implementing the video encoding method in any one of the above third aspects.
  • This function may be implemented by hardware, or may be implemented by executing corresponding software on the hardware.
  • the hardware or software includes one or more modules corresponding to the above functions.
  • an embodiment of the present application provides a video encoding device, which has a function of implementing the video encoding method in any one of the foregoing fourth aspects.
  • This function may be implemented by hardware, or may be implemented by executing corresponding software on the hardware.
  • the hardware or software includes one or more modules corresponding to the above functions.
  • a video decoding device including: a processor and a memory; the memory is used to store computer-executable instructions, and when the video decoding device is running, the processor executes the computer-executable instructions stored in the memory, so that The video decoding device executes the video decoding method according to any one of the first aspect above.
  • a video decoding device including: a processor and a memory; the memory is used to store computer-executable instructions, and when the video decoding device is running, the processor executes the computer-executable instructions stored in the memory, so that The video decoding device executes the video decoding method according to any one of the second aspect above.
  • a video encoding device including: a processor and a memory; the memory is used to store computer-executable instructions, and when the video encoding device is running, the processor executes the computer-executable instructions stored in the memory to Make the video coding device execute the video coding method according to any one of the third aspect above.
  • a video encoding device including: a processor and a memory; the memory is used to store computer-executable instructions, and when the video encoding device is running, the processor executes the computer-executable instructions stored in the memory to Make the video coding device execute the video coding method according to any one of the fourth aspect above.
  • a computer-readable storage medium In a thirteenth aspect, a computer-readable storage medium is provided. Instructions are stored in the computer-readable storage medium, and when it is run on a computer, the computer can execute any one of the above-mentioned first to fourth aspects. Video codec method.
  • a fourteenth aspect there is provided a computer program product including instructions, which, when run on a computer, enable the computer to execute the video encoding and decoding method in any one of the first aspect to the fourth aspect.
  • an electronic device in a fifteenth aspect, includes a video decoding apparatus, and the processing circuit is configured to execute the video decoding method according to any one of the first aspect and the second aspect above.
  • an electronic device in a sixteenth aspect, includes a video encoding device, and the processing circuit is configured to execute the video encoding method according to any one of the third aspect and the fourth aspect above.
  • an electronic device in a seventeenth aspect, includes a video decoding device and a video encoding device, and the processing circuit is configured to execute the video decoding method according to any one of the first aspect above and any one of the third aspect Video encoding method.
  • an electronic device in an eighteenth aspect, includes a video decoding device and a video encoding device, and the processing circuit is configured to execute the video decoding method according to any one of the above-mentioned second aspect and any one of the fourth aspect Video encoding method.
  • a communication system in a nineteenth aspect, includes the video decoding device in the fifth aspect and the sixth aspect and the video encoding device in the seventh aspect and the eighth aspect in the above aspects.
  • Figure 1a is a schematic diagram of a DC prediction mode
  • Figure 1b is a schematic diagram of a vertical prediction mode
  • Figure 1c is a schematic diagram of the Planar prediction model
  • Figure 1d is a schematic diagram of a block copy mode
  • FIG. 2 is a system architecture diagram of a codec system provided in an embodiment of the present application
  • FIG. 3 is a schematic structural diagram of a video encoder provided in an embodiment of the present application.
  • FIG. 4 is a schematic structural diagram of a video decoder provided in an embodiment of the present application.
  • FIG. 5 is a schematic flow diagram of a video encoding/decoding provided by an embodiment of the present application.
  • FIG. 6 is a schematic structural diagram of a video decoder or video encoder provided in an embodiment of the present application.
  • FIG. 7 is a flowchart of a video decoding method provided in an embodiment of the present application.
  • Fig. 8 is a schematic diagram of the 5/3 wavelet transform method provided by the embodiment of the present application.
  • FIG. 9 is a flowchart of a video decoding method provided in an embodiment of the present application.
  • FIG. 10 is a flowchart of a video encoding method provided in an embodiment of the present application.
  • FIG. 11 is a flow chart of a video encoding method provided in an embodiment of the present application.
  • FIG. 12 is a schematic structural diagram of a decoding device provided by an embodiment of the present application.
  • FIG. 13 is a schematic structural diagram of a decoding device provided by an embodiment of the present application.
  • FIG. 14 is a schematic structural diagram of an encoding device provided by an embodiment of the present application.
  • FIG. 15 is a schematic structural diagram of an encoding device provided by an embodiment of the present application.
  • Video sequences have a series of redundant information such as spatial redundancy, temporal redundancy, visual redundancy, information entropy redundancy, structural redundancy, knowledge redundancy, and importance redundancy.
  • video coding technology is proposed to achieve the effect of reducing storage space and saving transmission bandwidth.
  • Video coding technology is also called video compression technology.
  • video compression coding standards such as: Advanced Video Coding (Advanced Video Coding, AVC), H.263, H.264 and H.265 (also known as High Efficiency Video Coding standard) developed by the International Telecommunication Union-Telecommunication Standardization Sector (ITU-T). , HEVC)).
  • AVC Advanced Video Coding
  • H.263, H.264 and H.265 also known as High Efficiency Video Coding standard
  • ITU-T International Telecommunication Union-Telecommunication Standardization Sector
  • HEVC High Efficiency Video Coding standard
  • the basic processing unit in the process of video compression encoding is an image block, which is obtained by dividing a frame/image at the encoding end.
  • HEVC defines Coding Tree Unit (CTU), Coding Unit (CU), Prediction Unit (PU) and Transform Unit (TU).
  • Coding tree units, coding units, prediction units, and transformation units can all be used as image blocks obtained after division. Both the transformation unit and the transformation unit are divided based on the coding unit.
  • a pixel is the smallest complete sample of a video or image, so the data processing of an image block is performed in units of pixels.
  • each pixel records color information, one represents color through RGB, R represents red (red), G represents green (green), B represents blue (blue); the other represents color through YUV, and Y represents brightness ( luminance), U represents the first chromaticity Cb, and V represents the second chromaticity Cr. Since people are more sensitive to luminance than chroma, the storage space can be reduced by storing more luminance and less chroma.
  • video sampling is generally performed in YUV format, and the YUV format includes 420 sampling format, 444 sampling format, and the like.
  • the sampling format determines the number of samples for two chroma based on the number of samples of luma. For example, assuming that a coding unit has 4 ⁇ 2 pixels, the format is as follows:
  • the 420 sampling format means that YUV is sampled in a 4:2:0 format, that is, the brightness and the first chroma or the second chroma are selected in a ratio of 4:2, where the first chroma and the second chroma are interlaced select.
  • the coding unit sampling selects the luminance Y0-Y3 of the first line, and the first chroma U0 and U2, and selects the luminance Y4-Y7 of the second line, and the second chroma V4 and V6.
  • the coding unit is composed of a luma coding unit and a chrominance coding unit after sampling, wherein,
  • the luma coding unit is:
  • the chroma coding units are:
  • the 444 sampling format means that YUV is sampled in a 4:4:4 format, that is, the brightness and the first chroma and the second chroma are selected in a ratio of 4:4:4.
  • the chroma coding units are:
  • the above-mentioned luma coding unit and chroma coding unit obtained through sampling are used as data units for subsequent coding processing.
  • the image block is predicted based on redundant characteristics such as temporal redundancy and spatial redundancy in the video sequence. For example, since there is a correlation between adjacent image blocks in the same image frame, the value of the current image block can be estimated (predicted) based on the adjacent image blocks. As another example, in different frames of images, for an image block at a certain coordinate position, the value of the image block at the previous moment has a correlation with the value of the image block at the next moment, so the value of the image block at the previous moment can be The value of predicts the value of the image block at the next moment.
  • the image block to be predicted is a prediction unit (PU).
  • the manner in which the forecast is made is called the forecast mode.
  • the prediction mode that performs prediction based on the correlation between adjacent image blocks in the same image frame is an intra-frame prediction mode.
  • the intra-frame prediction mode includes mean value (DC) prediction mode, angle prediction mode and planar (Planar) prediction mode.
  • the average value of reference pixels is calculated as the predicted pixel.
  • the mean value of the reference pixels on the left and the upper side is calculated as the predicted pixel.
  • it is determined that reference pixels on the left side and/or upper side are used for calculation.
  • Angle prediction mode can also be called directional prediction mode, which predicts pixels in different directions based on reference pixels.
  • the angle prediction mode includes a horizontal prediction mode, a vertical prediction mode, a diagonal prediction mode and the like.
  • the vertical prediction mode shown in FIG. 1 b the pixels in the column where the reference pixel is located are predicted based on the vertical downward direction of the reference pixel.
  • prediction modes in other directions are used for prediction, projections in different directions are calculated and combined with reference pixels to obtain predicted pixels.
  • the Planar prediction mode calculates the weight of the reference pixels in the horizontal row and vertical column to obtain the predicted pixel of the intersection point. As shown in Figure 1c, the predicted pixels on the right side of the horizontal row and the lower side of the vertical column are obtained according to the reference pixels on the left and upper sides, and then the predicted pixels are obtained according to the pixels at both ends of the horizontal row and vertical column.
  • the prediction mode also includes a block copy mode.
  • the block copy mode is also called the block copy mode, which refers to finding the optimal reconstruction block from the decoded area of the current frame as the matching block, and using the reconstruction pixels of the matching block as the prediction pixels of the current block, as shown in Figure 1d.
  • the codec method provided in this application is applicable to a video codec system.
  • Figure 2 shows the structure of the video codec system.
  • the video codec system includes a source device 20 and a destination device 21 .
  • the source device 20 generates encoded video data.
  • the source device 20 can also be called a video encoding device or video encoding device.
  • the destination device 21 can decode the encoded video data generated by the source device 20.
  • the destination device 21 also It may be called a video decoding device or a video decoding device.
  • Source device 20 and/or destination device 21 may include at least one processor and a memory coupled to the at least one processor.
  • the memory may include but not limited to Read-Only Memory (ROM), Random Access Memory (Random Access Memory, RAM), Electrically Erasable Programmable Read-Only Memory (Electrically Erasable Programmable Read-Only Memory, EEPROM) ), flash memory, or any other medium that can be used to store desired program code in the form of instructions or data structures that can be accessed by a computer, which is not specifically limited by the present application.
  • ROM Read-Only Memory
  • RAM Random Access Memory
  • EEPROM Electrically Erasable Programmable Read-Only Memory
  • flash memory or any other medium that can be used to store desired program code in the form of instructions or data structures that can be accessed by a computer, which is not specifically limited by the present application.
  • Source device 20 and destination device 21 may include a variety of devices, including desktop computers, mobile computing devices, notebook (e.g., laptop) computers, tablet computers, set-top boxes, telephone handsets such as so-called “smart" phones, Electronic equipment such as televisions, cameras, display devices, digital media players, video game consoles, in-vehicle computers, or the like.
  • desktop computers mobile computing devices
  • notebook (e.g., laptop) computers tablet computers
  • set-top boxes set-top boxes
  • telephone handsets such as so-called “smart” phones
  • Electronic equipment such as televisions, cameras, display devices, digital media players, video game consoles, in-vehicle computers, or the like.
  • Link 22 may include one or more media and/or devices capable of moving encoded video data from source device 20 to destination device 21 .
  • link 22 may include one or more communication media that enable source device 20 to transmit encoded video data directly to destination device 21 in real-time.
  • the source device 20 may modulate the encoded video data according to a communication standard (eg, a wireless communication protocol), and may transmit the modulated video data to the destination device 21 .
  • the aforementioned one or more communication media may include wireless and/or wired communication media, for example: radio frequency (Radio Frequency, RF) spectrum, one or more physical transmission lines.
  • radio frequency Radio Frequency
  • the one or more communication media described above may form part of a packet-based network such as a local area network, a wide area network, or a global network (eg, the Internet), among others.
  • the one or more communication media described above may include routers, switches, base stations, or other devices that enable communication from source device 20 to destination device 21 .
  • the encoded video data may be output from the output interface 203 to the storage device 23 .
  • encoded video data may be accessed from storage device 23 through input interface 213 .
  • the storage device 23 may include a variety of local access data storage media, such as Blu-ray discs, high-density digital video discs (Digital Video Disc, DVD), read-only discs (Compact Disc Read-Only Memory, CD-ROM), flash Memory, or other suitable digital storage media for storing encoded video data.
  • storage device 23 may correspond to a file server or another intermediate storage device that stores encoded video data generated by source device 20 .
  • destination device 21 may obtain its stored video data from storage device 23 via streaming or downloading.
  • the file server may be any type of server capable of storing encoded video data and transmitting the encoded video data to destination device 21 .
  • a file server may include a World Wide Web (Web) server (e.g., for a website), a File Transfer Protocol (FTP) server, a Network Attached Storage (NAS) device, and a local disk driver.
  • Web World Wide Web
  • FTP File Transfer Protocol
  • NAS Network Attached Storage
  • Destination device 21 may access the encoded video data through any standard data connection, such as an Internet connection.
  • Example types of data connections include wireless channels suitable for accessing encoded video data stored on a file server, wired connections (eg, cable modem, etc.), or a combination of both.
  • the encoded video data can be transmitted from the file server by streaming, download transmission or a combination of both.
  • the decoding method of the present application is not limited to wireless application scenarios.
  • the coding and decoding method of the present application can be applied to video coding and decoding supporting the following multiple multimedia applications: air TV broadcasting, cable TV transmission, satellite TV transmission, streaming transmission Video transmission (eg, via the Internet), encoding of video data stored on a data storage medium, decoding of video data stored on a data storage medium, or other applications.
  • a video codec system can be configured to support one-way or two-way video transmission to support applications such as video streaming, video playback, video broadcasting, and/or video telephony.
  • the video codec system shown in FIG. 2 is only an example of a video codec system, and is not a limitation of the video codec system in this application.
  • the codec method provided in this application is also applicable to a scenario where there is no data communication between the encoding device and the decoding device.
  • the video data to be encoded or the encoded video data may be retrieved from local storage, streamed over a network, or the like.
  • the video encoding device can encode the video data to be encoded and store the encoded video data in the memory, and the video decoding device can also obtain the encoded video data from the memory and decode the encoded video data.
  • a source device 20 includes a video source 201 , a video encoder 202 and an output interface 203 .
  • output interface 203 may include a modulator/demodulator (modem) and/or a transmitter.
  • Video source 201 may include a video capture device (e.g., a video camera), a video archive containing previously captured video data, a video input interface to receive video data from a video content provider, and/or a computer graphics system, or a combination of such sources of video data.
  • Video encoder 202 may encode video data from video source 201 .
  • source device 20 transmits the encoded video data directly to destination device 21 via output interface 203 .
  • the encoded video data may also be stored on the storage device 23 for later access by the destination device 21 for decoding and/or playback.
  • the destination device 21 includes a display device 211 , a video decoder 212 and an input interface 213 .
  • input interface 213 includes a receiver and/or a modem.
  • Input interface 213 may receive encoded video data via link 22 and/or from storage device 23 .
  • the display device 211 may be integrated with the destination device 21 or may be external to the destination device 21 . In general, the display device 211 displays the decoded video data.
  • the display device 211 may include various display devices, for example, a liquid crystal display, a plasma display, an organic light emitting diode display, or other types of display devices.
  • video encoder 202 and video decoder 212 may each be integrated with an audio encoder and decoder, and may include appropriate multiplexer-demultiplexer units or other hardware and software to process Encoding of both audio and video in a common data stream or in separate data streams.
  • Video encoder 202 and video decoder 212 may include at least one microprocessor, digital signal processor (Digital Signal Processor, DSP), application-specific integrated circuit (Application-Specific Integrated Circuit, ASIC), field programmable gate array (Field Programmable Gate Array, FPGA), discrete logic, hardware, or any combination thereof. If the codec method provided in this application is implemented by software, the instructions for the software can be stored in a suitable non-volatile computer-readable storage medium, and at least one processor can be used to execute the instructions to implement the application. .
  • DSP Digital Signal Processor
  • ASIC Application-Specific Integrated Circuit
  • FPGA Field Programmable Gate Array
  • the video encoder 202 and the video decoder 212 in this application may operate according to a video compression standard (such as HEVC), or may also operate according to other industry standards, which is not specifically limited in this application.
  • a video compression standard such as HEVC
  • Fig. 3 is a schematic block diagram of the video encoder 202 in the embodiment of the present application.
  • the video encoder 202 can respectively perform prediction, transformation, quantization and entropy coding processes in the prediction module 31 , the transformation module 32 , the quantization module 33 and the entropy coding module 34 .
  • the video encoder 202 also includes a segmentation module 30 and a summer 302 .
  • the video encoder 202 also includes an inverse quantization module 35 , an inverse transformation module 36 , a summer 301 and a reference image memory 37 .
  • video encoder 202 receives video data, and partition module 30 partitions the video data into raw blocks.
  • This partitioning may also include partitioning into slices, blocks or other larger units, and video block partitioning, for example, according to Largest Coding Units (LCUs) and quadtree structures of coding units.
  • LCUs Largest Coding Units
  • the video encoder 202 encodes in components of video blocks within the video slice to be encoded.
  • a slice may be divided into a number of original blocks (and possibly into a collection of original blocks called tiles).
  • the sizes of the coding units CU, transform units PU and transform units TU are typically determined in the partitioning module 30 .
  • the prediction module 31 may provide the resulting intra-mode predicted or block copy mode predicted predicted block to the summer 302 to generate a residual block, and provide the predicted block to the summer 301 to be reconstructed to obtain a reconstructed block, which The reconstructed block is used as reference pixels for subsequent prediction.
  • the video encoder 202 forms a pixel difference value by subtracting the pixel value of the predicted block from the pixel value of the original block, and the pixel difference value is the residual block, and the data in the residual block may include brightness difference and chrominance difference .
  • Summer 301 represents one or more components that perform this subtraction operation.
  • the prediction module 31 can also send related syntax elements to the entropy coding module 34 for merging into the code stream.
  • the transform module 32 may divide the residual block into one or more transform units TU for transform.
  • the transform module 32 transforms the residual block using DCT or DST to obtain transform coefficients.
  • Transform module 32 may convert the residual block from the pixel domain to a transform domain (eg, the frequency domain).
  • a transform domain eg, the frequency domain.
  • Currently commonly used transformation methods are DCT2 and DST7.
  • Transform module 32 may send the resulting transform coefficients to quantization module 33 .
  • the quantization module 33 quantizes the transform coefficients to further reduce the code rate.
  • the quantization process may reduce the bit depth associated with some or all of the coefficients.
  • the degree of quantization can be modified by adjusting quantization parameters.
  • quantization module 33 may then perform a scan of the matrix comprising quantized transform coefficients.
  • entropy encoding module 34 may perform a scan.
  • entropy encoding module 34 may entropy encode the quantized transform coefficients.
  • the entropy coding module 34 can perform context-adaptive variable-length coding (Context-Adaptive Varialbe-Length Coding, CAVLC), context-based adaptive binary arithmetic coding (Context-based Adaptive Binary Arithmetic Coding, CABAC), syntax-based Context Adaptive Binary Arithmetic Coding (SBAC), Probability Interval Partitioning Entropy (PIPE) decoding or another entropy coding method or technique.
  • the encoded codestream may be transmitted to video decoder 212 or archived for later transmission or retrieval by video decoder 212 .
  • the inverse quantization module 35 and the inverse transformation module 36 respectively apply inverse quantization and inverse transformation, and the summer 301 adds the inversely transformed residual block and the prediction block predicted by the prediction module 31 to generate a reconstruction block, which is used for subsequent original Reference pixels for block prediction.
  • This reconstructed block is stored in the reference image memory 37 .
  • FIG. 4 is a schematic structural diagram of the video decoder 212 in the embodiment of the present application.
  • the video decoder 212 includes an entropy decoding module 40 , a prediction module 41 , an inverse quantization module 42 , an inverse transformation module 43 , a summer 401 and a reference image memory 44 .
  • video decoder 212 may perform an exemplary reciprocal decoding process to the encoding process described with respect to video encoder 202 from FIG. 3 .
  • video decoder 212 receives a codestream of encoded video from video encoder 202 .
  • the entropy decoding module 40 of the video decoder 212 entropy decodes the codestream to generate quantized coefficients and syntax elements.
  • the entropy decoding module 40 forwards the syntax elements to the prediction module 41 .
  • Video decoder 212 may receive the syntax elements at the video slice level and/or the video block level.
  • Inverse quantization module 42 inverse quantizes (eg, dequantizes) the quantized transform coefficients provided in the codestream and decoded by entropy decoding module 40 .
  • the inverse quantization process may include determining the degree of quantization using quantization parameters calculated by video encoder 202 for each video block in the video slice, and likewise determining the degree of inverse quantization applied.
  • the inverse transform module 43 applies inverse transform (for example, transform methods such as DCT and DST) to the inversely quantized transform coefficients, generates an inversely transformed residual block in the pixel domain according to the inversely transformed transform coefficients, In other words, the inversely quantized transform coefficients are then inversely transformed to generate residual coefficients.
  • inverse transform for example, transform methods such as DCT and DST
  • the size of the inverse transformation unit is the same as that of the transformation unit, and the inverse transformation method and the transformation method adopt the corresponding forward transformation and inverse transformation in the same transformation method.
  • the inverse transformation of DCT and DST is inverse DCT, inverse DST or concept A similar inverse transformation process.
  • video decoder 212 forms a decoded video block by summing the inverse transformed residual block from inverse transformation module 43 with the prediction block.
  • Summer 401 represents one or more components that perform this summation operation.
  • a deblocking filter may also be applied to filter the decoded video blocks in order to remove blocking artifacts, if desired.
  • the decoded video blocks in a given frame or picture are stored in reference picture memory 44 as reference pixels for subsequent predictions.
  • FIG. 5 is a schematic flow diagram of a video encoding/decoding provided by this application.
  • the implementation of video encoding/decoding includes process 1 to process 5 , Process 1 to Process 5 may be performed by any one or more of the above source device 20 , video encoder 202 , destination device 21 or video decoder 212 .
  • Process 1 Divide a frame of image into one or more non-overlapping parallel coding units. There is no dependency between the one or more parallel encoding units, and they can be completely parallel/independently encoded and decoded, as shown in FIG. 5 , the parallel encoding unit 1 and the parallel encoding unit 2 .
  • each parallel coding unit it can be divided into one or more independent coding units that do not overlap with each other.
  • Each independent coding unit can be independent of each other, but can share some parallel coding unit header information.
  • an independent coding unit has a width of w_lcu and a height of h_lcu. If the parallel coding unit is divided into an independent coding unit, the size of the independent coding unit is exactly the same as that of the parallel coding unit; otherwise, the width of the independent coding unit should be larger than the height (except for the edge area).
  • the independent coding unit can be fixed w_lcu ⁇ h_lcu, both w_lcu and h_lcu are 2 to the Nth power (N ⁇ 0), for example, the size of the independent coding unit is: 128 ⁇ 4, 64 ⁇ 4, 32 ⁇ 4, 16 ⁇ 4, 8 ⁇ 4, 32 ⁇ 2, 16 ⁇ 2 or 8 ⁇ 2 etc.
  • the independent coding unit may be a fixed 128 ⁇ 4. If the size of the parallel coding unit is 256 ⁇ 8, the parallel coding unit can be divided into 4 independent coding units; if the size of the parallel coding unit is 288 ⁇ 10, the parallel coding unit can be divided into: the first/second row It includes two 128 ⁇ 4 independent coding units and one 32 ⁇ 4 independent coding unit; the third row includes two 128 ⁇ 2 independent coding units and one 32 ⁇ 2 independent coding unit.
  • the independent coding unit may include three components of luma Y, first chroma Cb, and second chroma Cr, or three components of RGB, or only one of them. If the independent coding unit includes three components, the sizes of the three components may be exactly the same or different, which is specifically related to the input format of the image.
  • each independent coding unit it can be divided into one or more non-overlapping coding units.
  • Each coding unit in an independent coding unit can depend on each other. For example, multiple coding units can perform mutual reference precoding and decoding .
  • the size of the coding unit is the same as that of the independent coding unit (that is, the independent coding unit is only divided into one coding unit), then its size can be all the sizes described in process 2.
  • the feasible division examples are: horizontal equal division (the height of the coding unit is the same as that of the independent coding unit, but the width is different, and the width of the coding unit can be the width of the independent coding unit 1/2, 1/4, 1/8, 1/16, etc.), vertical equal division (the width of the coding unit is the same as that of the independent coding unit, but the height is different, and the height of the coding unit can be 1/ of the height of the independent coding unit 2, 1/4, 1/8, 1/16, etc.), horizontal and vertical equal division (quadtree division), etc., preferably horizontal equal division.
  • the width of the coding unit is W and the height is H, so its width should be greater than its height (unless it is an edge area).
  • the coding unit may be a fixed W ⁇ H, and both W and H are two Nth powers (N is greater than or equal to 0), such as 16x4, 8x4, 16x2, 8x2, 8x1, 4x1 and so on.
  • the coding unit may be fixed 16x4. If the size of the independent coding unit is 64x4, the independent coding unit can be equally divided into 4 coding units; if the size of the independent coding unit is 72x4, the coding unit can be divided into four 16x4 and one 8x4.
  • the coding unit may include three components of luma Y, first chroma Cb, and second chroma Cr (or RGB three components), or may only include one of them. If it contains three components, the sizes of several components can be exactly the same or different, depending on the image input format.
  • process 3 is an optional step in the video encoding and decoding method, and the video encoder/decoder can encode/decode the residual coefficient (or residual value) of the independent coding unit obtained in the process 2.
  • Process 4 For the coding unit, it can be divided into one or more non-overlapping prediction groups (Prediction Group, PG), PG can also be referred to as Group, and each prediction group is encoded and decoded according to the selected prediction mode , to obtain the prediction value of the prediction group to form the prediction value of the entire coding unit, and obtain the residual value of the coding unit based on the prediction value and the original value of the coding unit.
  • Prediction Group PG
  • PG non-overlapping prediction groups
  • each prediction group is encoded and decoded according to the selected prediction mode , to obtain the prediction value of the prediction group to form the prediction value of the entire coding unit, and obtain the residual value of the coding unit based on the prediction value and the original value of the coding unit.
  • Process 5 Based on the residual value of the coding unit, the coding unit is grouped to obtain one or more non-overlapping residual blocks (residual block, RB), and the residual coefficients of each residual block are selected according to the selected mode Perform encoding and decoding to form a residual coefficient stream. In some embodiments, it can be divided into two categories: transforming and not transforming the residual coefficients.
  • the selected mode of the residual coefficient encoding and decoding method in the process 5 may include, but not limited to any of the following: semi-fixed length encoding method, exponential Golomb (Golomb) encoding method, Golomb-Rice encoding method, truncated unary code Encoding methods, run-length encoding methods, direct encoding of raw residual values, etc.
  • a video encoder may directly encode coefficients within a residual tile.
  • the video encoder may also perform transformation on the residual block, such as DCT, DST, Hadamard transformation, etc., and then encode the transformed coefficients.
  • transformation such as DCT, DST, Hadamard transformation, etc.
  • the video encoder may directly uniformly quantize the coefficients in the small residual block, and then perform binarization coding. If the residual small block is large, it can be further divided into multiple coefficient groups (coefficient group, CG), and then each coefficient group is uniformly quantized, and then binary coded. In some embodiments of the present application, the coefficient group (CG) and the quantization group (QG) may be the same.
  • the maximum value of the absolute value of the residual within a small residual block is defined as the modified maximum (MM).
  • the number of coding bits of the residual coefficients in the small residual block is determined (the number of coding bits of the residual coefficients in the same small residual block is the same). For example, if the critical limit (CL) of the current residual small block is 2 and the current residual coefficient is 1, then 2 bits are required to encode the residual coefficient 1, which is expressed as 01. If the key limit value of the current residual small block is 7, it means encoding 8-bit residual coefficient and 1-bit sign bit.
  • the determination of the key limit is to find the minimum M value that satisfies all the residuals of the current sub-block within the range of [-2 ⁇ (M-1), 2 ⁇ (M-1)]. If there are two boundary values -2 ⁇ (M-1) and 2 ⁇ (M-1) at the same time, M should be increased by 1, that is, M+1 bits are required to encode all residuals of the current residual block; if only If there is one of the two boundary values -2 ⁇ (M-1) and 2 ⁇ (M-1), a Trailing bit needs to be encoded to determine whether the boundary value is -2 ⁇ (M-1) or 2 ⁇ (M -1); if none of -2 ⁇ (M-1) and 2 ⁇ (M-1) exists in all residuals, the Trailing bit does not need to be encoded.
  • the video encoder can also directly encode the original value of the image instead of the residual value.
  • the above video encoder 202 and video decoder 212 can also be implemented in another form of implementation, for example, by using a general-purpose digital processor system, such as the codec device 50 shown in Figure 6, the codec device 50 can be Some of the devices in the above video encoder 202 may also be some of the devices in the above video decoder 212 .
  • the codec device 50 can be applied to the encoding side or the decoding side.
  • the codec device 50 includes a processor 501 and a memory 502 .
  • the processor 501 is connected to the memory 502 (for example, connected to each other through a bus 504 ).
  • the codec device 50 may further include a communication interface 503 connected to the processor 501 and the memory 502 for receiving/sending data.
  • Memory 502 can be random access memory (Random Access Memory, RAM), read-only memory (Read-Only Memory, ROM), erasable programmable read-only memory (Erasable Programmable Read Only Memory, EPROM) or portable read-only memory (Compact Disc Read-Only Memory, CD-ROM).
  • RAM Random Access Memory
  • ROM read-only memory
  • EPROM erasable programmable read-only memory
  • CD-ROM Compact Disc Read-Only Memory
  • the processor 501 may be one or more central processing units (Central Processing Unit, CPU), such as CPU 0 and CPU 1 shown in FIG. 6 .
  • CPU Central Processing Unit
  • the CPU may be a single-core CPU or a multi-core CPU.
  • the processor 501 is configured to read the program codes stored in the memory 502, so as to execute the operations of any one of the implementations corresponding to FIG. 7 to FIG. 11 and various feasible implementations thereof.
  • FIG. 7 it is a flow chart of a video decoding method provided by this application.
  • the method includes step S601 to step S602.
  • the video decoder performs entropy decoding and inverse quantization on the code stream to obtain an inverse transform unit.
  • the video decoder performs discrete wavelet inverse transform on the inverse transform unit to obtain inversely transformed coefficients.
  • Discrete wavelet transform the basic idea of discrete wavelet transform is translation and stretching. After high-pass filtering and low-pass filtering, the signal is decomposed in scale and space without losing the original information.
  • the purpose of wavelet transform is to remove the correlation between pixels in each sub-image, and concentrate information on as few transform coefficients as possible, so that the next quantization step may quantize the coefficients carrying less information to 0, reducing the impact on the quality of the reconstructed image.
  • discrete wavelet transform includes discrete wavelet forward transform and discrete wavelet inverse transform.
  • the video decoder determines the corresponding inverse transform method according to the transform method adopted by the video encoder.
  • the image block is a two-dimensional data array.
  • the two-dimensional discrete wavelet transform usually adopts the row and column separation processing method, that is, the horizontal direction and the vertical direction are respectively subjected to one-dimensional discrete wavelet transform. Wherein, the order of the horizontal direction and the vertical direction has no influence on the result.
  • the video decoder performs inverse transformation in the horizontal direction and/or vertical direction, including seven inverse discrete wavelet transform combinations shown in Table 1 below. In some other embodiments, the video encoder performs transformation in the horizontal direction and/or vertical direction, to be combined similarly to 7 shown in Table 1 below, that is, to replace inverse discrete wavelet transform with discrete wavelet transform.
  • Two discrete wavelet transforms are introduced below, namely Haar wavelet transform and 5/3 wavelet transform.
  • the Haar wavelet transform is a discrete wavelet transform with a low-pass filter of [1,1] and a high-pass filter of [-1,1].
  • the transformation steps are as follows: divide the data to be transformed into continuous pixel pairs, then calculate the average value of adjacent pixel pairs and half of the difference between adjacent pixel pairs, and place the calculated average value in the first half of the transformation coefficient, representing low-frequency DC Part, half of the difference between adjacent pixel pairs is placed in the second half of the transform coefficient, indicating the high-frequency detail part.
  • the Haar wavelet transform is: That is to take two numbers from the array in turn, calculate their sum and difference, and save half of the sum and half of the difference in the first half and second half of the array in turn.
  • the wavelet transform is performed on the low-frequency coefficient part, and the second-level wavelet decomposition is performed to obtain: c 2 , b 3 , and b 4 are called detail (high frequency) coefficients, and c 1 is called a direct current (low frequency) coefficient. It is understandable that the higher the level of wavelet transform, the elements with little change in the data will approach zero, and the compression can be achieved with quantization.
  • the wavelet transform matrix is where H except the 0th row in, There are N 1s in total, the second p + q line is h p, q and satisfies:
  • p and q are integers greater than or equal to zero;
  • the high-pass filter coefficient of the 5/3 wavelet transform is Y(2n+1), and the low-pass filter coefficient is Y(2n).
  • Y(2n+1) -X(2n)/2+X(2n+1)-X(2n+2)/2;
  • Y(2n) -X(2n-2)/8+X(2n-1)/4+3*X(2n)/4+X(2n+1)/4-X(2n+2)/8 +1/2;
  • Y(2n) can be calculated in the following way:
  • Y(2n) X(2n)+(Y(2n-1)+Y(2n+1)+2)/4;
  • the low-pass filter coefficients are calculated according to the high-pass filter coefficients and corresponding source data.
  • X is a symmetrically expanded sample sequence.
  • two data are symmetrically expanded at the left end of the data, and one data is symmetrically expanded at the right end of the data sequence.
  • the transform is completed through addition and shift calculations, reducing the computational complexity of video coding.
  • the burden of calculation and storage is reduced, and the complexity of hardware implementation is reduced.
  • the inverse discrete wavelet transform in combinations 1-7 in Table 1 above can be replaced by any one of inverse Haar wavelet transform and inverse 5/3 wavelet transform, as shown in Table 2 below.
  • the video encoder performs transformation in the horizontal direction and/or vertical direction similar to the inverse transformation in Table 2, that is, the video encoder performs discrete wavelet transform in the horizontal direction and/or vertical direction, which can use H Any one of Err wavelet transform, 5/3 wavelet transform, DCT2 transform, DST7 transform or no transform.
  • the combinations 1-6 in Table 2 all include two ways, therefore, the above Table 2 contains a total of 16 combinations of transformation methods.
  • this embodiment of the present application provides an encoding method, which is applied in an encoding device, for example, in a device having a video encoding function.
  • the encoding method includes steps S801 to S802.
  • the video encoder performs discrete wavelet transform on the transform unit to obtain transform coefficients.
  • the video encoder performs discrete wavelet transform in the horizontal direction and/or vertical direction, including seven discrete wavelet transform combinations similar to those shown in Table 1 above.
  • discrete wavelet transform includes Haar wavelet transform and 5/3 wavelet transform.
  • the video encoder performs discrete wavelet transform in the horizontal direction and/or vertical direction, including 16 discrete wavelet transform combinations similar to those shown in Table 2 above.
  • the video encoder performs quantization and entropy encoding on the transform coefficients to obtain a code stream.
  • FIG. 10 it is a flowchart of another video decoding method provided by this application.
  • the method includes steps S901 to S902.
  • the video decoder performs entropy decoding and inverse quantization on the code stream to obtain an inverse transform unit.
  • the video decoder performs a third inverse transform on the inverse transform unit to obtain the inversely transformed coefficients; wherein, the third inverse transform includes inverse transform in the horizontal direction and/or inverse transform in the vertical direction, the horizontal direction and the vertical direction
  • the inverse transformation methods include DCT2 inverse transformation or DST7 inverse transformation, and the inverse transformation methods in the horizontal direction and vertical direction are different.
  • the video decoder performs the third inverse transformation of inverse transformation in the horizontal direction and/or vertical direction, including 8 kinds of inverse transformation combinations shown in Table 3 below:
  • steps S901-S902 different types of inverse transformation methods are implemented in the horizontal direction and vertical direction, and the flexibility of video decoding is improved. Among them, when only one direction of transformation is performed, it helps to reduce computational complexity and improve compression performance.
  • this embodiment of the present application provides an encoding method, which is applied in an encoding device, for example, in a device having a video encoding function.
  • the encoding method includes steps S1001 to S1002.
  • the video encoder performs a third transformation on the transformation unit to obtain transformation coefficients; wherein, the third transformation includes transformation in the horizontal direction and/or transformation in the vertical direction, and the transformation methods in the horizontal direction and the vertical direction include DCT2 transformation or DST7 transform.
  • the third transformation performed by the video decoder in the horizontal direction and/or vertical direction includes 8 transformation combinations similar to those shown in Table 3 above.
  • the video encoder performs quantization and entropy encoding on the transform coefficients to obtain a code stream.
  • steps S1001-S1007 different types of transformation methods are implemented in the horizontal direction and vertical direction, and the flexibility of video coding is improved. Among them, when only one direction of transformation is performed, it helps to reduce computational complexity and improve compression performance.
  • Embodiment 1 The video decoder determines the inverse transformation method based on the size of the inverse transformation unit.
  • the size of the inverse transformation unit may be preset in the video decoder. Assume that the size of the inverse transform unit is M ⁇ N, where M represents the width and N represents the height. M ⁇ N can include 4 ⁇ 1, 8 ⁇ 1, 16 ⁇ 1, 4 ⁇ 2, 8 ⁇ 2, 16 ⁇ 2, 4 ⁇ 4, 8 ⁇ 4, 16 ⁇ 4, 8 ⁇ 8, 16 ⁇ 8, and 16 At least one of ⁇ 16, which is not limited in this application.
  • the size of the inverse transform unit is determined according to the size of the coding unit CU.
  • the size of the inverse transformation unit is the same as the size of the coding unit; or, the width of the inverse transformation unit is half of the width of the coding unit, and the height of the inverse transformation unit is the same as the height of the coding unit; or, the height of the inverse transformation unit is the coding unit half the height of the unit, and the width of the inverse transform unit is the same as the width of the coding unit.
  • the size of the coding unit is W ⁇ H, where W is the width of the coding unit, and H is the height of the coding unit
  • the size of the inverse transformation unit is w ⁇ h, where w is the width of the inverse transformation unit, and h is the height of the inverse transform unit.
  • w ⁇ h can be W ⁇ H, or w ⁇ h can be W/2 ⁇ H, or w ⁇ h can be W ⁇ H/2, or w ⁇ h can be W/2 ⁇ H/2.
  • W ⁇ H can be 4 ⁇ 1, 8 ⁇ 1, 16 ⁇ 1, 4 ⁇ 2, 8 ⁇ 2, 16 ⁇ 2, 4 ⁇ 4, 8 ⁇ 4, 16 ⁇ 4, 8 ⁇ 8, 16 ⁇ 8 and any one of 16 ⁇ 16.
  • the size of the coding unit is 16x4, and the size of the inverse transformation unit is 16x4; or, the size of the coding unit is 16x4, and the size of the inverse transformation unit is 8x4; or, the size of the coding unit is 16x2, and the size of the inverse transformation unit is 16x2;
  • the size of the coding unit is 16x2, and the size of the inverse transform unit is 8x2.
  • the inverse transformation unit is the smallest data unit for transformation, combined with the process 5 in Figure 5 above, the inverse transformation unit can be obtained by further dividing the residual block.
  • the size of the inverse transform unit is the same as the size of the prediction unit PU, and the size of the prediction unit is 4 ⁇ 1, 8 ⁇ 1, 16 ⁇ 1, 4 ⁇ 2, 8 ⁇ 2, 16 ⁇ 2, 4 ⁇ Any one of 4, 8 ⁇ 4, 16 ⁇ 4, 8 ⁇ 8, 16 ⁇ 8 and 16 ⁇ 16.
  • the video decoder determines the inverse transform method according to the size of the inverse transform unit.
  • the size of the inverse transform unit includes a first size and a second size, and based on the first size, it is determined to perform discrete wavelet inverse transform in the horizontal direction, and to perform discrete wavelet transform in the vertical direction.
  • Inverse wavelet transform based on the second dimension, discrete wavelet inverse transform is performed in the horizontal direction, and no transformation is performed in the vertical direction.
  • the first size and the second size may be any one of the above optional ways, and the inverse discrete wavelet transform includes any one of the inverse Haar wavelet transform or the inverse 5/3 wavelet transform.
  • the above correspondence between the first size, the second size and the inverse transformation method is only an example, and the discrete wavelet inverse transformation can also be performed in the vertical direction, and the inverse transformation is not performed in the horizontal direction.
  • the size of the inverse transform unit includes the third size, the fourth size, the fifth size size and sixth size.
  • the inverse transform method can also include different combinations of discrete wavelet inverse transform, DCT2 inverse transform and DST7 inverse transform, for example, discrete wavelet inverse transform in the horizontal direction, DCT2 inverse transform or DST7 inverse transform in the vertical direction etc.
  • the video decoder determines the size of the inverse transformation unit, and determines the inverse transformation method based on the size of the inverse transformation unit, wherein the width and height of the size of the inverse transformation unit can correspond to different inverse transformation methods, which helps to reduce computational complexity to improve compression performance.
  • the manner of determining the transformation method according to the size of the transformation unit is the same as the manner of determining the inverse transformation method according to the size of the inverse transformation unit, which will not be repeated here.
  • the size of the transformation unit is related to the size of the coding unit and the prediction unit
  • the size of the coding unit and the prediction unit is 4 ⁇ 1, 8 ⁇ 1, 16 ⁇ 1, 4 ⁇ 2, 8 ⁇ 2, 16 Any one of ⁇ 2, 4 ⁇ 4, 8 ⁇ 4, 16 ⁇ 4, 8 ⁇ 8, 16 ⁇ 8 and 16 ⁇ 16.
  • the above-mentioned limitation on the size of the coding unit and the prediction unit that is, the limitation on the height required by the hardware when line buffering is performed in the video coding and decoding technology, helps to reduce the complexity of hardware implementation.
  • the video decoder determines the inverse transformation method based on the transformation method identification bit in the code stream.
  • the transformation method identification bit is used to indicate the transformation method of the transformation unit.
  • the transformation method is the method used by the video decoder to perform inverse transformation on the inverse transformation unit.
  • the transformation method identification bits shown in Table 4 can represent several exemplary implementation methods of discrete wavelet transform in the horizontal direction and/or vertical direction, and also include discrete wavelet transform in the horizontal direction or vertical direction.
  • DCT2 transform or DST7 transform is performed in another direction, and the identification bits of the multiple transformation methods can be increased or decreased by referring to the manner in Table 4, thereby expanding or reducing the number of transformation methods indicated by the identification bits. This application is not limited to this.
  • identification bits of the conversion method shown in Table 5 are only examples, and the identification bits can be increased or decreased, and the conversion methods corresponding to different identification bits are not limited in this application.
  • two transformation methods are preset in the video decoder, and the transformation method identification bits are used to identify the two transformation methods.
  • Table 6 it is another exemplary definition of the transformation method identification bit:
  • transform method flag 0(0) 1(1) horizontal direction 5/3 wavelet transform Haar wavelet transform vertical direction 5/3 wavelet transform Haar wavelet transform
  • the transformation method identified by the transformation method identification bit may be determined by a video encoder based on a Rate-Distortion Optimized (RDO) cost in the video coding stage.
  • the reconstructed block can reflect the influence of the inversely transformed transformation method.
  • the greater the rate-distortion cost the worse the performance of the transformation method used in the encoding mode, and the video encoder can select a transformation method with better performance to determine the corresponding transformation method identification bit.
  • the two methods shown in Table 6 above perform transformation on transformation units of the same size, and it is determined through calculation that the rate-distortion cost of the 5/3 wavelet transformation method is relatively small, and the transformation method identification bit is 0.
  • the transformation method with better performance is represented by implicit derivation.
  • the identification bit used to indicate the transform method with a lower rate-distortion cost is derived from the parity of the number of transform coefficients.
  • the transformation method identification bit is derived, and the transformation method identification bit includes 0 and 1, respectively used to indicate the combination of the two transformation methods shown in Table 6.
  • the video decoder determines the transformation method based on the transformation method identification bit, wherein the transformation method identification bit includes a combination of any preset methods, or only identifies a transformation method with better performance.
  • This identification method can It saves the identification bits occupied in the code stream and improves the compression performance at the same time.
  • the video encoder indicates the transformation method in the code stream with the transformation method identification bit, where the transformation method indicated by the transformation method identification bit is the same as the above-mentioned definite inverse transformation method on the decoding side, which is not mentioned here. Let me repeat.
  • the video decoder determines the inverse transformation method based on the prediction mode identification bit in the code stream.
  • the prediction mode identification bit is used to indicate the prediction mode of the prediction unit for prediction before the inverse transformation unit performs transformation, wherein, the prediction mode includes DC prediction mode, angle prediction mode, Planar prediction mode and block copy mode, and the angle prediction mode includes horizontal prediction mode, vertical prediction mode and diagonal prediction mode.
  • prediction mode identification bit may also include more or less prediction modes, which is not limited in the present application.
  • the video decoder determines the prediction mode according to the above-mentioned prediction mode identification bit, and at the same time determines the inverse transformation method corresponding to the prediction mode. As shown in Table 8 below, an exemplary correspondence between the prediction mode and the inverse transformation method:
  • the predicted residual block is not subjected to inverse transformation, and the residual block is directly dequantized.
  • the correspondence between prediction modes and inverse transformation methods shown in Table 8 is only an example, and more or less correspondences may be included.
  • the corresponding relationship between the prediction mode and the inverse transformation method may be preset in the video decoder, or may be acquired through communication with the video encoder, which is not limited in the present application.
  • the prediction mode when it has a corresponding relationship with the inverse transform method, it may also establish a corresponding relationship with the quantization method.
  • the inverse transformation method corresponding to the vertical prediction mode in Table 8 above is to perform inverse Haar wavelet transformation in the horizontal direction, and to perform 5/3 wavelet transformation inversion in the vertical direction, then the method used for quantization is scalar quantization.
  • the video decoder obtains the prediction mode identification bit, it can also determine the dequantization method.
  • the video decoder determines the inverse transformation method based on the prediction mode identification bit, wherein the prediction mode identification bit is used to identify one or more prediction modes, and the inverse transformation method is determined according to the prediction mode.
  • This identification method helps to save code
  • the video encoder represents the prediction mode in the code stream with the prediction mode identification bit, where the prediction mode indicated by the prediction mode identification bit and its corresponding transformation method are the same as the above-mentioned determination method on the decoding side The same or similar, will not be repeated here.
  • the video decoder performs inverse transformation on the inverse transformation unit based on luma and chrominance.
  • the inverse transformation unit when the inverse transformation unit performs inverse transformation, calculations are performed based on the luma transformation unit and the chrominance transformation unit respectively.
  • the luma transformation unit and the chroma transformation unit refer to the coding unit based on brightness and chroma obtained according to the sampling format, and the size of the inverse transformation unit is determined according to the size of the coding unit, wherein the inverse transformation unit includes a luma transformation unit and a chroma transformation unit .
  • the luminance coding unit is:
  • the chroma coding units are:
  • the luma TU is the same as the luma CU
  • the chroma TU is the same as the chroma CU.
  • the video decoder performs inverse transformation on the inverse transformation unit based on the luma transformation unit and the chroma transformation unit, including that the video decoder performs inverse transformation on the luma transformation unit in the horizontal direction and/or vertical direction, and performs inverse transformation on the chroma transformation unit in the horizontal direction and/or Or reverse transformation in the vertical direction.
  • the combination of inverse transformation methods in the horizontal direction and/or vertical direction may be any one in Table 2 and Table 3 above.
  • the video decoder determines the transformation method based on the sampling format. As shown in Table 9 below, an exemplary correspondence between the sampling format and the inverse transformation method:
  • sampling format 444 420 Brightness transformation unit horizontal direction inverse transformation inverse transformation Brightness Transformation Unit Vertical Direction inverse transformation inverse transformation Chroma Transformation Unit Horizontal Direction inverse transformation inverse transformation Chroma Transformation Unit Vertical Direction inverse transformation no inverse transformation
  • the inverse transformation is performed on both the luminance transformation unit and the chroma transformation unit in the horizontal and vertical directions; Inverse transformation is performed, and the chroma transformation unit is only inversely transformed in the horizontal direction.
  • the above-mentioned transformation method adopted for the luma transformation unit and the chroma transformation unit may be any combination in Table 2 and Table 3 above.
  • the video decoder determines the transform method based on the size of the luma transform unit and the chroma transform unit. As shown in Table 10 below, an exemplary correspondence between the size of the luma transformation unit and the chroma transformation unit and the transformation method:
  • the size of the luma transform unit 16 ⁇ 2 16 ⁇ 2 The size of the chroma transform unit 16 ⁇ 2 8 ⁇ 1 Brightness transformation unit horizontal direction inverse transformation inverse transformation Brightness Transformation Unit Vertical Direction inverse transformation inverse transformation Chroma Transformation Unit Horizontal Direction inverse transformation inverse transformation Chroma Transformation Unit Vertical Direction inverse transformation no inverse transformation
  • the size of the luma transform unit is the same as that of the chroma transform unit, and inverse transformation is performed on both the luma transform unit and the chroma transform unit in the horizontal direction and the vertical direction; or, the luma transform unit is transformed in the horizontal direction and The inverse transformation is performed in the vertical direction.
  • the height of the chroma transformation unit is 1, the inverse transformation is only performed on the chroma transformation unit in the horizontal direction.
  • the above-mentioned transformation method adopted for the luma transformation unit and the chroma transformation unit may be any combination in Table 2 and Table 3 above.
  • Table 9 and Table 10 are only examples. Different sampling formats can correspond to different inverse transformation methods or reciprocal transformation methods. Different sizes of luma transformation units and chroma transformation units correspond to different inverse transformation methods. The transformation method or the reciprocal transformation method is not limited in this application.
  • the video encoder transforms the transform unit based on luma and chroma, where the luma transform unit and the chroma transform unit are determined during sampling, and the horizontal and/or vertical directions are respectively
  • the method of performing transformation by the luma transformation unit and the chrominance transformation unit is the same as or similar to the above-mentioned method on the decoding side, and will not be repeated here.
  • the video decoder decomposes the number of layers based on the discrete wavelet transform in the code stream.
  • the code stream including image data obtained by the video decoder includes a sequence parameter set (Sequence Parameter Set, SPS), a picture parameter set (Picture Parameter Set, PPS) and a slice header (slice header) or a slice segment Header (slice segment header) and other syntax elements.
  • the sequence parameter set includes discrete wavelet transform decomposition layers.
  • the video decoder performs discrete wavelet transform according to discrete wavelet transform decomposition layers. For example, if the number of discrete wavelet transform decomposition layers in the vertical direction is L, then the inverse transform unit performs vertical wavelet decomposition of L layers in the vertical direction. Wherein, the height of the inverse transformation unit is N, and 2L ⁇ N.
  • the number of discrete wavelet transform decomposition layers is suitable for Haar wavelet transform and 5/3 wavelet transform.
  • the video encoder transforms according to the preset discrete wavelet transform decomposition layers, writes the decomposition layers into the sequence parameter set, and sends them to the video decoder for decoding.
  • the discrete wavelet transform decomposition layers For related descriptions, please refer to the above, and will not repeat them here.
  • An embodiment of the present application provides a decoding device, and the decoding device may be a video decoder.
  • the decoding device is used to perform the steps performed by the video decoder in the above decoding method.
  • the decoding device provided in the embodiment of the present application may include modules corresponding to corresponding steps.
  • the functional modules of the decoding device may be divided according to the above method examples.
  • each functional module may be divided corresponding to each function, or two or more functions may be integrated into one processing module.
  • the above-mentioned integrated modules can be implemented in the form of hardware or in the form of software function modules.
  • the division of modules in the embodiment of the present application is schematic, and is only a logical function division, and there may be other division methods in actual implementation.
  • FIG. 12 shows a possible structural diagram of the decoding device involved in the above embodiment.
  • the decoding device 110 includes a decoding module 1101 , an inverse transformation module 1102 and a storage module 1103 .
  • the decoding module 1101 is configured to perform entropy decoding and inverse quantization on the code stream to obtain an inverse transformation unit, such as the above step S601.
  • the inverse transform module 1102 is configured to perform discrete wavelet inverse transform on the inverse transform unit to obtain inversely transformed coefficients, such as the above step S602.
  • the inverse transform module 1102 is configured to perform discrete wavelet inverse transform on the inverse transform unit in the horizontal direction, and perform discrete wavelet inverse transform, DCT2 inverse transform, DST7 inverse transform and no inverse transform in the vertical direction or, perform any one of DCT2 inverse transform, DST7 inverse transform, and no inverse transform on the inverse transform unit in the horizontal direction, and perform discrete wavelet inverse transform in the vertical direction.
  • the inverse discrete wavelet transform includes inverse Haar wavelet transform and inverse 5/3 wavelet transform
  • the inverse transform module 1102 is used to perform inverse Haar wavelet transform on the inverse transform unit in the horizontal direction, and in the vertical direction Perform any one of Haar wavelet inverse transformation, 5/3 wavelet inverse transformation, DCT2 inverse transformation, DST7 inverse transformation and no inverse transformation; or, perform 5/3 wavelet inverse transformation on the inverse transformation unit in the horizontal direction , performing any one of Haar wavelet inverse transformation, 5/3 wavelet inverse transformation, DCT2 inverse transformation, DST7 inverse transformation and no inverse transformation in the vertical direction; or, performing DCT2 inverse transformation on the inverse transformation unit in the horizontal direction transformation, DST7 inverse transformation and no inverse transformation, carry out Haar wavelet inverse transformation in the vertical direction; or, perform DCT2 inverse transformation, DST7 inverse transformation and no inverse transformation on the inverse transformation unit in the horizontal direction In any one of them, the 5/3 wavelet inverse transform
  • the size of the inverse transformation unit is the same as the size of the coding unit; or, the width of the inverse transformation unit is half of the width of the coding unit, and the height of the inverse transformation unit is the same as the height of the coding unit ; or, the height of the inverse transformation unit is half of the height of the coding unit, and the width of the inverse transformation unit is the same as the width of the coding unit.
  • the inverse transformation module 1102 is configured to determine, based on the size of the inverse transformation unit, to perform the first inverse transformation on the inverse transformation unit in the horizontal direction, and to perform the second inverse transformation in the vertical direction; wherein, the first transformation and at least one of the second transform is an inverse discrete wavelet transform.
  • the size of the inverse transform unit includes a first size and a second size
  • the inverse transform module 1102 is configured to determine to perform discrete wavelet inverse transform on the inverse transform unit in the horizontal direction and vertically Inverse discrete wavelet transform is performed in the direction; based on the second size, it is determined that the inverse transform unit performs inverse discrete wavelet transform in the horizontal direction, and does not perform inverse transform in the vertical direction.
  • the decoding module 1101 is configured to obtain the transformation method identification bit in the code stream, the transformation method identification bit is used to indicate the inverse transformation method of the inverse transformation unit, and the inverse transformation method includes and/or inverse discrete wavelet transform in the vertical direction.
  • the decoding module 1101 is configured to obtain a prediction mode identification bit in the code stream, and the prediction mode identification bit is used to indicate the prediction mode of the prediction unit for prediction before the inverse transformation unit performs inverse transformation , the prediction mode includes a first prediction mode and a second prediction mode; based on the first prediction mode, it is determined to perform discrete wavelet inverse transform on the inverse transform unit in the horizontal direction, and perform discrete wavelet inverse transform, DCT2 inverse transform, DST7 in the vertical direction Any one of inverse transformation and no inverse transformation; based on the second prediction mode, it is determined to perform any one of DCT2 inverse transformation, DST7 inverse transformation and no inverse transformation on the inverse transformation unit in the horizontal direction. Inverse discrete wavelet transform for direction.
  • the prediction mode includes any one of DC prediction mode, angle prediction mode, Planar prediction mode and block copy mode, and the angle prediction mode is any one of horizontal prediction mode, vertical prediction mode and diagonal prediction mode kind.
  • the inverse transform module 1102 is configured to perform discrete wavelet inverse transform on the luminance of the inverse transform unit, and perform discrete wavelet inverse transform, DCT2 inverse transform and DST7 inverse transform on the chroma of the inverse transform unit or, perform any one of DCT2 inverse transform and DST7 inverse transform on the luminance of the inverse transform unit, and perform discrete wavelet inverse transform on the chrominance of the inverse transform unit.
  • the decoding device provided in the embodiment of the present application includes but is not limited to the above-mentioned modules, for example, the decoding device 110 may further include a storage module 1103 .
  • the storage module 1103 can be used to store program codes and data of the decoding device.
  • Fig. 13 shows a possible structural diagram of the decoding device involved in the above embodiment.
  • the decoding device 120 includes a decoding module 1201 , an inverse transformation module 1202 and a storage module 1203 .
  • the decoding module 1201 is configured to perform entropy decoding and inverse quantization on the code stream to obtain an inverse transformation unit. For example, step S901 above.
  • the inverse transformation module 1202 is configured to perform a third inverse transformation on the inverse transformation unit to obtain inversely transformed coefficients; wherein, the third inverse transformation includes inverse transformation in the horizontal direction and/or inverse transformation in the vertical direction, horizontal direction and
  • the inverse transformation method in the vertical direction includes DCT2 inverse transformation or DST7 inverse transformation. For example, step S902 above.
  • the size of the inverse transformation unit is the same as the size of the coding unit; or, the width of the inverse transformation unit is half of the width of the coding unit, and the height of the inverse transformation unit is the same as the height of the coding unit ; or, the height of the inverse transformation unit is half of the height of the coding unit, and the width of the inverse transformation unit is the same as the width of the coding unit.
  • the size of the inverse transformation unit includes a third size, a fourth size, a fifth size, and a sixth size
  • the inverse transformation module 1202 is configured to, based on the third size of the inverse transformation unit,
  • the transformation unit performs DCT2 inverse transformation or DST7 inverse transformation in the horizontal direction, and does not perform inverse transformation in the vertical direction;
  • the fourth size of the inverse transformation unit the inverse transformation unit does not perform inverse transformation in the horizontal direction, and performs DCT2 inverse transformation in the vertical direction Or DST7 inverse transformation;
  • DCT2 inverse transformation is performed on the inverse transformation unit in the horizontal direction, and DST7 inverse transformation is performed on the vertical direction;
  • the sixth size of the inverse transformation unit the inverse transformation unit is horizontally transformed Perform DST7 inverse transformation, and perform DCT2 inverse transformation in the vertical direction.
  • the decoding module 1201 is configured to obtain the transformation method identification bit in the code stream, and the transformation method identification bit is used to indicate the inverse transformation method of the inverse transformation unit; determine according to the inverse transformation method of the inverse transformation unit The third inverse transformation.
  • the decoding module 1201 is configured to obtain the prediction mode identification bit in the code stream, and the prediction mode identification bit is used to indicate the prediction mode for the prediction unit to perform prediction before the inverse transformation unit performs inverse transformation, and the prediction mode includes the third Prediction mode, fourth prediction mode, fifth prediction mode, and sixth prediction mode; based on the third prediction mode, it is determined to perform DCT2 inverse transformation or DST7 inverse transformation on the inverse transformation unit in the horizontal direction, and not perform inverse transformation in the vertical direction ;Based on the fourth prediction mode, it is determined that the inverse transformation unit is not inversely transformed in the horizontal direction, and DCT2 inverse transformation or DST7 inverse transformation is performed in the vertical direction; based on the fifth prediction mode, DCT2 inverse transformation is performed on the inverse transformation unit in the horizontal direction For transformation, DST7 inverse transformation is performed in the vertical direction; based on the sixth prediction mode, DST7 inverse transformation is performed on the inverse transformation unit in the horizontal direction, and DCT2 inverse transformation is performed
  • the prediction mode includes any one of DC mode, angle mode, Planar mode and block copy mode, and the angle mode is any one of horizontal mode, vertical mode and diagonal mode.
  • the inverse transform module 1202 is configured to perform DCT2 inverse transform or DST7 inverse transform on the luminance of the inverse transform unit; perform DCT2 inverse transform or DST7 inverse transform on the chroma of the inverse transform unit to obtain inversely transformed coefficients .
  • the decoding device provided in the embodiment of the present application includes but is not limited to the above-mentioned modules, for example, the decoding device may further include a storage module 1203 .
  • the storage module 1203 can be used to store program codes and data of the decoding device.
  • some or all of the functions implemented in the decoding module, the inverse transformation module, and the storage module in the decoding device 110 and the decoding device 120 can be executed by the processor 501 in FIG. 6 in the memory 502 in FIG. 6 . program code implementation.
  • FIG. 14 shows a possible structural schematic diagram of the encoding device involved in the above embodiment.
  • the encoding device 130 includes a transformation module 1301 , an encoding module 1302 and a storage module 1303 .
  • the transformation module 1301 is configured to perform discrete wavelet transformation on the transformation unit to obtain transformation coefficients. For example, step S801 above.
  • the encoding module 1302 is configured to perform quantization and entropy encoding on the transform coefficients to obtain a code stream. For example, step S802 above.
  • the encoding device provided in the embodiment of the present application includes but is not limited to the above-mentioned modules, for example, the encoding device may further include a storage module 1303 .
  • the storage module 1303 can be used to store program codes and data of the encoding device.
  • some or all of the functions implemented in the transformation module 1301, the encoding module 1302, and the storage module 1303 in the encoding device 130 can be executed by the processor 501 in FIG. 6.
  • FIG. 15 shows a possible structural diagram of the encoding device involved in the above embodiment.
  • the encoding device 140 includes a transformation module 1401 , an encoding module 1402 and a storage module 1403 .
  • the transformation module 1401 is configured to perform a third transformation on the transformation unit to obtain transformation coefficients; wherein, the third transformation includes performing transformation in the horizontal direction and/or performing transformation in the vertical direction, and the transformation methods in the horizontal direction and vertical direction include DCT2 transformation or DST7 transformation. For example, the above step S1001.
  • the encoding module 1402 is configured to perform quantization and entropy encoding on the transform coefficients to obtain a code stream. For example, the above step S1002.
  • the encoding device provided in the embodiment of the present application includes but is not limited to the above-mentioned modules, for example, the encoding device may further include a storage module 1403 .
  • the storage module 1403 can be used to store program codes and data of the encoding device.
  • some or all of the functions implemented in the transformation module 1401, the encoding module 1402, and the storage module 1403 in the encoding device 140 can be executed by the processor 501 in FIG. 6 in the program in the memory 502 in FIG. 6 Code.
  • the embodiment of the present application also provides an electronic device, the electronic device includes the decoding device 110 and the decoding device 120 described above, and the decoding device 110 and the decoding device 120 execute any method performed by the video decoder provided above.
  • the embodiment of the present application also provides an electronic device, the electronic device includes the encoding device 130 and the encoding device 140 described above, and the encoding device 130 and the encoding device 140 execute any method performed by the video encoder provided above.
  • the embodiment of the present application also provides an electronic device, which includes the above-mentioned decoding device 110 and encoding device 130, and the decoding device 110 and encoding device 130 execute any video decoder and video encoder provided above. Methods.
  • the embodiment of the present application also provides an electronic device, which includes the above-mentioned decoding device 120 and encoding device 140, and the decoding device 120 and encoding device 140 execute any video decoder and video encoder provided above. Methods.
  • the embodiment of the present application also provides a communication system, which includes electronic equipment composed of the decoding device 110, the decoding device 120, the encoding device 130 and the encoding device 140, the decoding device 110, the decoding device 120, and the encoding device 130 And the encoding device 140 implements any one of the methods performed by the video decoder and video encoder provided above.
  • the embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is run on a computer, the computer is made to execute any video decoding method provided above. The method executed by the device.
  • the embodiment of the present application also provides a processor.
  • the processor integrates a control circuit and one or more ports for realizing the functions of the above-mentioned decoding device 110 , decoding device 120 , encoding device 130 and encoding device 140 .
  • the functions supported by the processor can be referred to above, and will not be repeated here.
  • the program can be stored in a computer-readable storage medium.
  • the storage medium mentioned above may be a read-only memory, a random access memory, and the like.
  • the above-mentioned processing unit or processor can be a central processing unit, a general-purpose processor, a specific integrated circuit (application specific integrated circuit, ASIC), a microprocessor (digital signal processor, DSP), a field programmable gate array (field programmable gate array, FPGA) or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof.
  • ASIC application specific integrated circuit
  • DSP digital signal processor
  • FPGA field programmable gate array
  • FPGA field programmable gate array
  • the embodiments of the present application also provide a computer program product containing instructions, which, when the instructions are run on a computer, cause the computer to execute any one of the methods in the foregoing embodiments.
  • the computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, the processes or functions according to the embodiments of the present application will be generated in whole or in part.
  • a computer can be a general purpose computer, special purpose computer, computer network, or other programmable device.
  • Computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, e.g.
  • the computer-readable storage medium may be any available medium that can be accessed by a computer, or may contain one or more data storage devices such as servers and data centers that can be integrated with the medium.
  • the available media may be magnetic media (eg, floppy disk, hard disk, magnetic tape), optical media (eg, DVD), or semiconductor media (eg, SSD), etc.
  • all or part of them may be implemented by software, hardware, firmware or any combination thereof.
  • a software program When implemented using a software program, it may 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 the computer, the processes or functions according to the embodiments of the present application will be generated in whole or in part.
  • a computer can be a general purpose computer, special purpose computer, computer network, or other programmable device.
  • Computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, e.g.
  • the computer-readable storage medium can be any available medium that can be accessed by a computer or can contain one or more data storage devices such as servers and data centers that can be integrated with the medium.
  • the usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, or a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid state disk (solid state disk, SSD)), etc.

Landscapes

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

Abstract

The present application relates to the technical field of video encoding and decoding, and discloses a video encoding and decoding method and apparatus, which are used for providing a new transformation method for current encoding and decoding technologies. The transformation method can improve the transformation flexibility. The use of the transformation method based on different dimensions can reduce the calculation complexity, reduce the calculation burden of a hardware device, reduce the hardware implementation complexity, and improve the compression performance. The decoding method comprises: performing entropy decoding and inverse quantization on a code stream to obtain an inverse transform unit; and performing discrete wavelet inverse transform on the inverse transform unit to obtain an inverse transform coefficient.

Description

视频编解码方法及装置Video encoding and decoding method and device
相关申请交叉引用Related Application Cross Reference
本专利申请要求于2021年11月11日提交的、申请号为202111335612.2的中国专利申请的优先权,该申请的全文以引用的方式并入本文中。This patent application claims priority to Chinese patent application No. 202111335612.2 filed on November 11, 2021, which is incorporated herein by reference in its entirety.
技术领域technical field
本申请涉及视频编解码技术领域,尤其涉及一种视频编解码方法及装置。The present application relates to the technical field of video coding and decoding, and in particular to a video coding and decoding method and device.
背景技术Background technique
视频是用户获取信息的重要途径。在视频存储与传输过程中,考虑到信息的质量与所占用的空间,需要对视频进行压缩,平衡信息完整性与所占用的空间之间的关系。视频编码(Video Coding)技术是实现压缩的一种方式,视频编码主要通过预测、变换、量化和熵编码的步骤得到码流。当前变换主要采用的方法是对变换单元在水平方向与垂直方向进行预设的变换方法,其中该预设的变换方法为离散余弦变换(Discrete Cosine Transform,DCT)或概念上类似的变换(例如,离散正弦变换(Discrete Sine Transform,DST)),而上述方式的灵活性较低,采用上述两种变换方法计算复杂度高,不便于实现视频编解码。Video is an important way for users to obtain information. In the process of video storage and transmission, considering the quality of information and the occupied space, it is necessary to compress the video to balance the relationship between information integrity and occupied space. Video coding (Video Coding) technology is a way to achieve compression. Video coding mainly obtains code streams through the steps of prediction, transformation, quantization and entropy coding. The current transformation method mainly adopts a preset transformation method for the transformation unit in the horizontal direction and vertical direction, wherein the preset transformation method is discrete cosine transform (Discrete Cosine Transform, DCT) or a conceptually similar transformation (for example, Discrete Sine Transform (Discrete Sine Transform, DST)), and the flexibility of the above-mentioned method is low, and the calculation complexity of the above two transformation methods is high, and it is not convenient to realize video encoding and decoding.
发明内容Contents of the invention
本申请实施例提供一种视频编解码方法及装置,提升变换方法的灵活性,降低计算复杂度,提高压缩性能。Embodiments of the present application provide a video encoding and decoding method and device, which improve the flexibility of a transformation method, reduce computational complexity, and improve compression performance.
为达到上述目的,本申请实施例采用如下技术方案:第一方面,本申请实施例提供一种视频解码方法,该方法应用于视频解码设备或视频解码设备中,该方法包括:对码流进行熵解码和反量化得到反变换单元;对反变换单元进行离散小波反变换,得到反变换后的系数。In order to achieve the above purpose, the embodiment of the present application adopts the following technical solutions: In the first aspect, the embodiment of the present application provides a video decoding method, which is applied to a video decoding device or a video decoding device, and the method includes: performing Entropy decoding and inverse quantization are used to obtain an inverse transform unit; discrete wavelet inverse transform is performed on the inverse transform unit to obtain inversely transformed coefficients.
由于当前的变换方法计算复杂度较高,基于当前较大尺寸的反变换单元在计算过程中需要更多的资源,增加硬件实现上的复杂度。本申请提出采用离散小波反变换方法进行视频解码。离散小波反变换能够去除每个子图像内部像素之间的相关性,尽可能地将信息集中到少的反变换系数上去,以便接下来的量化步骤有可能将携带信息较少的系数量化成0,降低对重建图像质量的影响。采用离散小波反变换大幅度降低计算复杂度,相应地,减小计算存储负担,降低硬件实现复杂度。Due to the high computational complexity of the current transformation method, the inverse transformation unit based on the current large size needs more resources in the calculation process, which increases the complexity of hardware implementation. This application proposes to use discrete wavelet inverse transform method for video decoding. The discrete wavelet inverse transform can remove the correlation between the internal pixels of each sub-image, and concentrate the information on as few inverse transform coefficients as possible, so that the next quantization step may quantize the coefficients carrying less information to 0, Reduce the impact on the reconstructed image quality. The discrete wavelet inverse transform is used to greatly reduce the computational complexity, correspondingly, the burden of computational storage is reduced, and the complexity of hardware implementation is reduced.
在一种可能的实现方式中,对反变换单元进行离散小波反变换,得到反变换后的系数,包括:对所述反变换单元在水平方向进行离散小波反变换,在垂直方向进行离散小波反变换、DCT2反变换、DST7反变换以及不进行反变换中的任意一种;或者,对所述反变换单元在水平方向进行DCT2反变换、DST7反变换以及不进行反变换中的任意一种,在垂直方向进行离散小波反变换。In a possible implementation manner, performing discrete wavelet inverse transform on the inverse transform unit to obtain the coefficients after inverse transform includes: performing discrete wavelet inverse transform on the inverse transform unit in the horizontal direction, and performing discrete wavelet inverse transform in the vertical direction transformation, DCT2 inverse transformation, DST7 inverse transformation and no inverse transformation; or, perform any one of DCT2 inverse transformation, DST7 inverse transformation and no inverse transformation on the inverse transformation unit in the horizontal direction, Inverse discrete wavelet transform is performed in the vertical direction.
该种可能的实现方式,提供了在水平方向和/或垂直方向进行离散小波反变换的三种方式,其中,只对一个方向进行离散小波反变换时,有助于降低计算复杂度。对两个方向可以采用相同或不同的反变换方法,提高反变换过程的灵活性,与现有算法实现兼容。This possible implementation provides three ways of performing inverse discrete wavelet transform in the horizontal direction and/or vertical direction, and performing inverse discrete wavelet transform in only one direction helps to reduce computational complexity. The same or different inverse transformation methods can be used for the two directions, which improves the flexibility of the inverse transformation process and is compatible with existing algorithms.
在一种可能的实现方式中,离散小波反变换包括哈尔小波反变换和5/3小波反变换,对反变换单元进行离散小波反变换,得到反变换后的系数,包括:对所述反变换单元在水平方向进行哈尔小波反变换,在垂直方向进行哈尔小波反变换、5/3小波反变换、DCT2反变换、DST7反变换以及不进行反变换中的任意一种;或者,对所述反变换单元在水平方向进行5/3小波反变换,在垂直方向进行哈尔小波反变换、5/3小波反变换、DCT2反变换、DST7反变换以及不进行反变换中的任意一种;或者,对所述反变换单元在水平方向进行DCT2反变换、DST7反变换以及不进行反变换中的任意一种,在垂直方向进行哈尔小波反变换;或者,对所述反变换单元在水平方向进行DCT2反变换、DST7反变换以及不进行反变换中的任意一种,在垂直方向进行5/3小波反变换。In a possible implementation, the discrete wavelet inverse transform includes Haar wavelet inverse transform and 5/3 wavelet inverse transform, and the inverse discrete wavelet transform is performed on the inverse transform unit to obtain the coefficients after the inverse transform, including: The transformation unit performs inverse Haar wavelet transform in the horizontal direction, and performs any one of inverse Haar wavelet transform, 5/3 wavelet inverse transform, DCT2 inverse transform, DST7 inverse transform and no inverse transform in the vertical direction; or, for The inverse transformation unit performs 5/3 wavelet inverse transformation in the horizontal direction, and performs any one of Haar wavelet inverse transformation, 5/3 wavelet inverse transformation, DCT2 inverse transformation, DST7 inverse transformation and no inverse transformation in the vertical direction Or, carry out any one of DCT2 inverse transformation, DST7 inverse transformation and no inverse transformation to the described inverse transformation unit in the horizontal direction, and carry out Haar wavelet inverse transformation in the vertical direction; Or, to the described inverse transformation unit in Perform any one of DCT2 inverse transformation, DST7 inverse transformation and no inverse transformation in the horizontal direction, and perform 5/3 wavelet inverse transformation in the vertical direction.
该种可能的实现方式,提供了离散小波反变换包括的两种反变换方法,结合水平方向和垂直方向,提供多种组合方法。根据哈尔小波反变换和5/3小波反变换的平移和伸缩,避免乘法的计算,有助于在处理较大尺寸数据时,能够减小计算负担,同时缩减计算过程中所占用的计算资源。This possible implementation method provides two inverse transform methods including the discrete wavelet inverse transform, combining the horizontal direction and the vertical direction to provide multiple combination methods. According to the translation and stretching of the Haar wavelet inverse transform and the 5/3 wavelet inverse transform, the calculation of multiplication is avoided, which helps to reduce the computational burden when processing large-scale data, and at the same time reduce the computational resources occupied during the calculation process .
一种可能的实现方式中,反变换单元的尺寸与编码单元的尺寸相同;或者,反变换单元的宽度为编码单元的宽度的一半,所述反变换单元的高度与所述编码单元的高度相同;或者,所述反变换单元的高度为编码单元的高度的一半,所述反变换单元的宽度与所述编码单元的宽度相同。In a possible implementation manner, the size of the inverse transformation unit is the same as the size of the coding unit; or, the width of the inverse transformation unit is half of the width of the coding unit, and the height of the inverse transformation unit is the same as the height of the coding unit ; or, the height of the inverse transformation unit is half of the height of the coding unit, and the width of the inverse transformation unit is the same as the width of the coding unit.
该种可能的实现方式,提供了反变换单元的尺寸确定方式,并给出反变换单元的尺寸与编码单元的尺寸之间的关系,进行变换时对编码单元进一步划分有助于降低计算复杂度。This possible implementation method provides a way to determine the size of the inverse transformation unit, and gives the relationship between the size of the inverse transformation unit and the size of the coding unit, and further dividing the coding unit during the transformation helps to reduce the computational complexity. .
一种可能的实现方式,对反变换单元进行离散小波反变换,得到反变换后的系数,包括:基于反变换单元的尺寸,确定对所述反变换单元在水平方向进行第一反变换,在垂直方向进行第二反变换;其中,第一反变换和第二反变换中的至少一种为离散小波反变换。A possible implementation manner is to perform discrete wavelet inverse transform on the inverse transform unit to obtain the coefficients after the inverse transform, including: based on the size of the inverse transform unit, determine to perform the first inverse transform on the inverse transform unit in the horizontal direction, and then The second inverse transformation is performed in the vertical direction; wherein, at least one of the first inverse transformation and the second inverse transformation is discrete wavelet inverse transformation.
该种可能的实现方式,提供了基于水平方向和/或垂直方向进行离散小波反变换。当基于一个维 度进行反变换时,有助于大幅度降低计算负担,提升压缩性能。This possible implementation method provides inverse discrete wavelet transform based on the horizontal direction and/or vertical direction. When the inverse transformation is performed based on one dimension, it helps to greatly reduce the computational burden and improve the compression performance.
一种可能的实现方式,反变换单元的尺寸包括第一尺寸和第二尺寸,基于反变换单元的尺寸,确定对所述反变换单元在水平方向进行第一反变换,在垂直方向进行第二反变换,包括:基于第一尺寸,确定对所述反变换单元在水平方向进行离散小波反变换,在垂直方向进行离散小波反变换;基于第二尺寸,确定对所述反变换单元在水平方向进行离散小波反变换,在垂直方向不进行反变换。In a possible implementation, the size of the inverse transformation unit includes a first size and a second size, and based on the size of the inverse transformation unit, it is determined to perform the first inverse transformation on the inverse transformation unit in the horizontal direction, and perform the second inverse transformation in the vertical direction. The inverse transform includes: based on the first size, determining to perform discrete wavelet inverse transform on the inverse transform unit in the horizontal direction, and performing discrete wavelet inverse transform on the vertical direction; based on the second size, determining to perform the inverse transform unit on the horizontal direction Inverse discrete wavelet transform is performed, and no inverse transform is performed in the vertical direction.
该种可能的实现方式,提供了基于反变换单元的尺寸进行相应的变换方法的具体实现方式,其中,在垂直方向上可以选择不进行离散小波变换,从而降低计算负担。This possible implementation provides a specific implementation of the corresponding transformation method based on the size of the inverse transformation unit, wherein the discrete wavelet transformation can be selected not to be performed in the vertical direction, thereby reducing the calculation burden.
一种可能的实现方式,对反变换单元进行离散小波反变换,得到反变换后的系数之前,该方法还包括:获取所述码流中的变换方法标识位,所述变换方法标识位用于指示所述反变换单元的反变换方法,所述反变换方法包括在水平方向和/或垂直方向进行离散小波反变换。In a possible implementation, the inverse discrete wavelet transform is performed on the inverse transform unit, and before the inversely transformed coefficients are obtained, the method further includes: acquiring a transformation method identification bit in the code stream, and the transformation method identification bit is used for Indicates the inverse transform method of the inverse transform unit, the inverse transform method includes performing discrete wavelet inverse transform in the horizontal direction and/or vertical direction.
该种可能的实现方式,提供了基于码流中的变换方法标识位确定反变换方法的具体实现方式。通过直接指示的方式有助于提升解码的效率,同时建立编码侧与解码侧之间的对应关系。This possible implementation provides a specific implementation of determining the inverse transformation method based on the transformation method identification bit in the code stream. The way of direct indication helps to improve the efficiency of decoding, and at the same time establishes the corresponding relationship between the encoding side and the decoding side.
一种可能的实现方式,对反变换单元进行离散小波反变换,得到反变换后的系数之前,该方法还包括:获取所述码流中的预测模式标识位,预测模式标识位用于指示所述反变换单元进行反变换前,预测单元进行预测的预测模式,所述预测模式包括第一预测模式和第二预测模式;基于第一预测模式,确定对所述反变换单元在水平方向进行离散小波反变换,在垂直方向进行离散小波反变换、DCT2反变换、DST7反变换以及不进行反变换中的任意一种;基于第二预测模式,确定对所述反变换单元在水平方向进行DCT2反变换、DST7反变换以及不进行反变换中的任意一种,在垂直方向进行离散小波反变换。In a possible implementation manner, before performing discrete wavelet inverse transform on the inverse transform unit to obtain the inversely transformed coefficients, the method further includes: acquiring a prediction mode identification bit in the code stream, where the prediction mode identification bit is used to indicate the Before the inverse transformation unit performs inverse transformation, the prediction mode for the prediction unit to perform prediction, the prediction mode includes a first prediction mode and a second prediction mode; based on the first prediction mode, it is determined that the inverse transformation unit is discretely performed in the horizontal direction Inverse wavelet transform, performing any one of discrete wavelet inverse transform, DCT2 inverse transform, DST7 inverse transform and no inverse transform in the vertical direction; based on the second prediction mode, it is determined to perform DCT2 inverse transform on the inverse transform unit in the horizontal direction Transform, DST7 inverse transform and no inverse transform, perform discrete wavelet inverse transform in the vertical direction.
该种可能的实现方式,提供了基于码流中的预测模式标识位确定反变换方法的具体实现方式。通过建立预测模式与反变换方法之间的对应关系,根据不同预测模式的效果确定反变换方法,增强反变换的灵活性,提升压缩效果。根据预定义的关系有助于提升解码的效率。This possible implementation provides a specific implementation of determining the inverse transformation method based on the prediction mode identification bit in the code stream. By establishing the corresponding relationship between the prediction mode and the inverse transformation method, the inverse transformation method is determined according to the effect of different prediction modes, the flexibility of the inverse transformation is enhanced, and the compression effect is improved. According to the predefined relationship, it helps to improve the efficiency of decoding.
一种可能的实现方式,预测模式包括DC预测模式、角度预测模式、Planar预测模式和块拷贝模式中的任意一种,角度预测模式包括水平预测模式、垂直预测模式和对角预测模式中的任意一种。A possible implementation, the prediction mode includes any one of DC prediction mode, angle prediction mode, Planar prediction mode and block copy mode, and the angle prediction mode includes any of horizontal prediction mode, vertical prediction mode and diagonal prediction mode A sort of.
该种可能的实现方式,提供了预测模式的类型,用于与变换方法建立对应关系,提升解码的效率。This possible implementation method provides a type of prediction mode, which is used to establish a corresponding relationship with a transformation method and improve decoding efficiency.
一种可能的实现方式,对反变换单元进行离散小波反变换,得到反变换后的系数,包括:对反变换单元的亮度进行离散小波反变换,对反变换单元的色度进行离散小波反变换、DCT2反变换以及DST7反变换中的任意一种;或者,对反变换单元的亮度进行DCT2反变换以及DST7反变换中的任意一种,对反变换单元的色度进行离散小波反变换。A possible implementation method is to perform discrete wavelet inverse transform on the inverse transform unit to obtain inversely transformed coefficients, including: performing discrete wavelet inverse transform on the brightness of the inverse transform unit, and performing discrete wavelet inverse transform on the chroma of the inverse transform unit , any one of DCT2 inverse transform and DST7 inverse transform; or, perform any one of DCT2 inverse transform and DST7 inverse transform on the brightness of the inverse transform unit, and perform discrete wavelet inverse transform on the chrominance of the inverse transform unit.
该种可能的实现方式,提供了基于亮度和色度进行离散小波反变换,其中,基于亮度和色度进行反变换可以结合亮度与色度的尺寸进行,有助于降低计算复杂度,提升压缩性能。This possible implementation method provides inverse discrete wavelet transform based on brightness and chroma, where the inverse transform based on brightness and chroma can be performed in combination with the size of brightness and chroma, which helps to reduce computational complexity and improve compression performance.
第二方面,本申请实施例提供一种视频解码方法,该方法应用于视频解码设备或视频解码设备中,该方法包括:对码流进行熵解码和反量化得到反变换单元;对反变换单元进行第三反变换,得到反变换后的系数;其中,第三反变换包括在水平方向进行反变换和/或在垂直方向进行反变换,水平方向和垂直方向的反变换方法包括DCT2反变换或DST7反变换。In the second aspect, the embodiment of the present application provides a video decoding method, which is applied to a video decoding device or a video decoding device, and the method includes: performing entropy decoding and inverse quantization on a code stream to obtain an inverse transformation unit; Perform the third inverse transformation to obtain the coefficients after the inverse transformation; wherein, the third inverse transformation includes inverse transformation in the horizontal direction and/or inverse transformation in the vertical direction, and the inverse transformation methods in the horizontal direction and the vertical direction include DCT2 inverse transformation or DST7 inverse transform.
由于当前的反变换方法计算复杂度较高,基于不同维度采用不同的反变换方法有助于降低计算复杂度,提升压缩性能。Due to the high computational complexity of the current inverse transformation method, using different inverse transformation methods based on different dimensions can help reduce computational complexity and improve compression performance.
一种可能的实现方式,所述反变换单元的尺寸与编码单元的尺寸相同;或者,所述反变换单元的宽度为编码单元的宽度的一半,所述反变换单元的高度与所述编码单元的高度相同;或者,所述反变换单元的高度为编码单元的高度的一半,所述反变换单元的宽度与所述编码单元的宽度相同。In a possible implementation manner, the size of the inverse transformation unit is the same as the size of the coding unit; or, the width of the inverse transformation unit is half of the width of the coding unit, and the height of the inverse transformation unit is the same as that of the coding unit or, the height of the inverse transformation unit is half of the height of the coding unit, and the width of the inverse transformation unit is the same as the width of the coding unit.
该种可能的实现方式,提供了反变换单元的尺寸确定方式,并给出反变换单元的尺寸与编码单元的尺寸之间的关系,进行反变换时对编码单元进一步划分有助于降低计算复杂度。This possible implementation method provides a way to determine the size of the inverse transformation unit, and gives the relationship between the size of the inverse transformation unit and the size of the coding unit, and further dividing the coding unit during inverse transformation helps to reduce computational complexity Spend.
一种可能的实现方式,反变换单元的尺寸包括第三尺寸、第四尺寸、第五尺寸和第六尺寸,对反变换单元进行第三反变换,得到反变换后的系数,包括:基于反变换单元的第三尺寸,对反变换单元在水平方向进行DCT2反变换或DST7反变换,在垂直方向不进行反变换;基于反变换单元的第四尺寸,对反变换单元在水平方向不进行反变换,在垂直方向进行DCT2反变换或DST7反变换;基于反变换单元的第五尺寸,对反变换单元在水平方向进行DCT2反变换,在垂直方向进行DST7反变换;基于反变换单元的第六尺寸,对反变换单元在水平方向进行DST7反变换,在垂直方向进行DCT2反变换。In a possible implementation, the size of the inverse transformation unit includes a third size, a fourth size, a fifth size, and a sixth size, and the third inverse transformation is performed on the inverse transformation unit to obtain the coefficient after the inverse transformation, including: based on the inverse For the third size of the transformation unit, DCT2 inverse transformation or DST7 inverse transformation is performed on the inverse transformation unit in the horizontal direction, and inverse transformation is not performed in the vertical direction; based on the fourth size of the inverse transformation unit, inverse transformation is not performed on the inverse transformation unit in the horizontal direction Transformation, perform DCT2 inverse transformation or DST7 inverse transformation in the vertical direction; based on the fifth size of the inverse transformation unit, perform DCT2 inverse transformation in the horizontal direction on the inverse transformation unit, and perform DST7 inverse transformation in the vertical direction; based on the sixth size of the inverse transformation unit Size, perform DST7 inverse transformation on the inverse transformation unit in the horizontal direction, and perform DCT2 inverse transformation in the vertical direction.
该种可能的实现方式,提供了反变换单元的尺寸与反变换方法的对应关系。当基于一个维度进行反变换时,有助于大幅度降低计算负担,提升压缩性能。This possible implementation provides a correspondence between the size of the inverse transformation unit and the inverse transformation method. When inverse transformation is performed based on one dimension, it helps to greatly reduce the computational burden and improve compression performance.
一种可能的实现方式,对反变换单元进行第三反变换,得到反变换后的系数之前,该方法还包括:获取码流中的变换方法标识位,变换方法标识位用于指示所述反变换单元的反变换方法;根据所述 反变换单元的反变换方法确定第三反变换。In a possible implementation, the third inverse transform is performed on the inverse transform unit, and before the inversely transformed coefficients are obtained, the method further includes: acquiring a transform method identification bit in the code stream, where the transform method identification bit is used to indicate the inverse transform An inverse transform method of the transform unit; determining a third inverse transform according to the inverse transform method of the inverse transform unit.
该种可能的实现方式,提供了基于码流中的变换方法标识位确定反变换方法的具体实现方式。通过直接指示的方式有助于提升解码的效率,同时建立编码侧与解码侧之间的对应关系。This possible implementation provides a specific implementation of determining the inverse transformation method based on the transformation method identification bit in the code stream. The way of direct indication helps to improve the efficiency of decoding, and at the same time establishes the corresponding relationship between the encoding side and the decoding side.
一种可能的实现方式,对反变换单元进行离散小波反变换,得到反变换后的系数之前,该方法还包括:获取码流中的预测模式标识位,预测模式标识位用于指示所述反变换单元进行反变换前,预测单元进行预测的预测模式,预测模式包括第三预测模式、第四预测模式、第五预测模式和第六预测模式;基于第三预测模式,确定对所述反变换单元在水平方向进行DCT2反变换或DST7反变换,在垂直方向不进行变换;基于第四预测模式,确定对所述反变换单元在水平方向不进行反变换,在垂直方向进行DCT2反变换或DST7反变换;基于第五预测模式,对所述反变换单元在水平方向进行DCT2反变换,在垂直方向进行DST7反变换;基于第六预测模式,对所述反变换单元在水平方向进行DST7反变换,在垂直方向进行DCT2反变换。In a possible implementation, the inverse discrete wavelet transform is performed on the inverse transform unit to obtain the inversely transformed coefficients. Before the transformation unit performs inverse transformation, the prediction mode for the prediction unit to perform prediction, the prediction mode includes the third prediction mode, the fourth prediction mode, the fifth prediction mode, and the sixth prediction mode; based on the third prediction mode, determine the inverse transformation The unit performs DCT2 inverse transformation or DST7 inverse transformation in the horizontal direction, and does not perform transformation in the vertical direction; based on the fourth prediction mode, it is determined that the inverse transformation unit does not perform inverse transformation in the horizontal direction, and performs DCT2 inverse transformation or DST7 in the vertical direction Inverse transformation; based on the fifth prediction mode, perform DCT2 inverse transformation on the inverse transformation unit in the horizontal direction, and perform DST7 inverse transformation on the vertical direction; based on the sixth prediction mode, perform DST7 inverse transformation on the inverse transformation unit in the horizontal direction , perform DCT2 inverse transformation in the vertical direction.
该种可能的实现方式,提供了基于码流中的预测模式标识位确定反变换方法的具体实现方式。通过建立预测模式与反变换方法之间的对应关系,根据不同预测模式的效果确定反变换方法,增强反变换的灵活性,提升压缩效果。根据预定义的关系有助于提升解码的效率。This possible implementation provides a specific implementation of determining the inverse transformation method based on the prediction mode identification bit in the code stream. By establishing the corresponding relationship between the prediction mode and the inverse transformation method, the inverse transformation method is determined according to the effect of different prediction modes, the flexibility of the inverse transformation is enhanced, and the compression effect is improved. According to the predefined relationship, it helps to improve the efficiency of decoding.
一种可能的实现方式,预测模式包括DC模式、角度模式、Planar模式和块拷贝模式中的任意一种,角度模式为水平模式、垂直模式和对角模式中的任意一种。In a possible implementation manner, the prediction mode includes any one of DC mode, angle mode, Planar mode, and block copy mode, and the angle mode is any one of horizontal mode, vertical mode, and diagonal mode.
该种可能的实现方式,提供了预测模式的类型,用于与反变换方法建立对应关系,提升解码的效率。This possible implementation provides a type of prediction mode, which is used to establish a corresponding relationship with the inverse transform method and improve decoding efficiency.
一种可能的实现方式,对反变换单元进行第三反变换,得到反变换后的系数,包括:对反变换单元的亮度进行DCT2反变换或DST7反变换;对反变换单元的色度进行DCT2反变换或DST7反变换,得到反变换后的系数。A possible implementation method is to perform a third inverse transformation on the inverse transformation unit to obtain the coefficients after the inverse transformation, including: performing DCT2 inverse transformation or DST7 inverse transformation on the brightness of the inverse transformation unit; performing DCT2 on the chroma of the inverse transformation unit Inverse transformation or DST7 inverse transformation to obtain the coefficients after inverse transformation.
该种可能的实现方式,提供了基于亮度和色度分别进行反变换,其中,基于亮度和色度进行反变换可以结合亮度与色度的尺寸进行,有助于降低计算复杂度,提升压缩性能。This possible implementation method provides inverse transformation based on luminance and chrominance respectively. The inverse transformation based on luminance and chrominance can be performed in combination with the size of luminance and chrominance, which helps to reduce computational complexity and improve compression performance. .
第三方面,本申请实施例提供一种视频编码方法,该方法应用于视频编码设备或视频编码设备中,该方法包括:对变换单元进行离散小波变换,得到变换系数;对变换系数进行量化和熵编码,得到码流。In a third aspect, the embodiment of the present application provides a video coding method, which is applied to a video coding device or a video coding device, and the method includes: performing discrete wavelet transform on a transform unit to obtain a transform coefficient; performing quantization on the transform coefficient and Entropy coding to obtain code stream.
第四方面,本申请实施例提供一种视频编码方法,该方法应用于视频编码设备或视频编码设备中,该方法包括:对变换单元进行第三变换,得到变换系数;其中,第三变换包括在水平方向进行变换和/或在垂直方向进行变换,水平方向和垂直方向的变换方法包括DCT2变换或DST7变换;对所述变换系数进行量化和熵编码,得到码流。In a fourth aspect, an embodiment of the present application provides a video coding method, which is applied to a video coding device or a video coding device, and the method includes: performing a third transformation on a transformation unit to obtain a transformation coefficient; wherein, the third transformation includes Performing transformation in the horizontal direction and/or performing transformation in the vertical direction, the transformation methods in the horizontal direction and the vertical direction include DCT2 transformation or DST7 transformation; performing quantization and entropy coding on the transformation coefficients to obtain a code stream.
第五方面,本申请实施例提供一种视频解码装置,该装置具有实现上述第一方面中任一项的视频解码方法的功能。该功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。该硬件或软件包括一个或多个与上述功能相对应的模块。In a fifth aspect, an embodiment of the present application provides a video decoding device, which has a function of implementing the video decoding method in any one of the foregoing first aspects. This function may be implemented by hardware, or may be implemented by executing corresponding software on the hardware. The hardware or software includes one or more modules corresponding to the above functions.
第六方面,本申请实施例提供一种视频解码装置,该装置具有实现上述第二方面中任一项的视频解码方法的功能。该功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。该硬件或软件包括一个或多个与上述功能相对应的模块。In a sixth aspect, an embodiment of the present application provides a video decoding device, which has a function of implementing the video decoding method in any one of the above-mentioned second aspects. This function may be implemented by hardware, or may be implemented by executing corresponding software on the hardware. The hardware or software includes one or more modules corresponding to the above functions.
第七方面,本申请实施例提供一种视频编码装置,该装置具有实现上述第三方面中任一项的视频编码方法的功能。该功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。该硬件或软件包括一个或多个与上述功能相对应的模块。In a seventh aspect, an embodiment of the present application provides a video encoding device, which has a function of implementing the video encoding method in any one of the above third aspects. This function may be implemented by hardware, or may be implemented by executing corresponding software on the hardware. The hardware or software includes one or more modules corresponding to the above functions.
第八方面,本申请实施例提供一种视频编码装置,该装置具有实现上述第四方面中任一项的视频编码方法的功能。该功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。该硬件或软件包括一个或多个与上述功能相对应的模块。In an eighth aspect, an embodiment of the present application provides a video encoding device, which has a function of implementing the video encoding method in any one of the foregoing fourth aspects. This function may be implemented by hardware, or may be implemented by executing corresponding software on the hardware. The hardware or software includes one or more modules corresponding to the above functions.
第九方面,提供一种视频解码装置,包括:处理器和存储器;该存储器用于存储计算机执行指令,当该视频解码装置运行时,该处理器执行该存储器存储的该计算机执行指令,以使该视频解码装置执行如上述第一方面中任一项的视频解码方法。In a ninth aspect, there is provided a video decoding device, including: a processor and a memory; the memory is used to store computer-executable instructions, and when the video decoding device is running, the processor executes the computer-executable instructions stored in the memory, so that The video decoding device executes the video decoding method according to any one of the first aspect above.
第十方面,提供一种视频解码装置,包括:处理器和存储器;该存储器用于存储计算机执行指令,当该视频解码装置运行时,该处理器执行该存储器存储的该计算机执行指令,以使该视频解码装置执行如上述第二方面中任一项的视频解码方法。In a tenth aspect, a video decoding device is provided, including: a processor and a memory; the memory is used to store computer-executable instructions, and when the video decoding device is running, the processor executes the computer-executable instructions stored in the memory, so that The video decoding device executes the video decoding method according to any one of the second aspect above.
第十一方面,提供一种视频编码装置,包括:处理器和存储器;该存储器用于存储计算机执行指令,当该视频编码装置运行时,该处理器执行该存储器存储的该计算机执行指令,以使该视频编码装置执行如上述第三方面中任一项的视频编码方法。In an eleventh aspect, a video encoding device is provided, including: a processor and a memory; the memory is used to store computer-executable instructions, and when the video encoding device is running, the processor executes the computer-executable instructions stored in the memory to Make the video coding device execute the video coding method according to any one of the third aspect above.
第十二方面,提供一种视频编码装置,包括:处理器和存储器;该存储器用于存储计算机执行指令,当该视频编码装置运行时,该处理器执行该存储器存储的该计算机执行指令,以使该视频编码 装置执行如上述第四方面中任一项的视频编码方法。In a twelfth aspect, a video encoding device is provided, including: a processor and a memory; the memory is used to store computer-executable instructions, and when the video encoding device is running, the processor executes the computer-executable instructions stored in the memory to Make the video coding device execute the video coding method according to any one of the fourth aspect above.
第十三方面,提供一种计算机可读存储介质,该计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机可以执行上述第一方面至第四方面中任一项的视频编解码方法。In a thirteenth aspect, a computer-readable storage medium is provided. Instructions are stored in the computer-readable storage medium, and when it is run on a computer, the computer can execute any one of the above-mentioned first to fourth aspects. Video codec method.
第十四方面,提供一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机可以执行上述第一方面至第四方面中任一项的视频编解码方法。In a fourteenth aspect, there is provided a computer program product including instructions, which, when run on a computer, enable the computer to execute the video encoding and decoding method in any one of the first aspect to the fourth aspect.
第十五方面,提供一种电子设备,电子设备包括视频解码装置,处理电路被配置为执行如上述第一方面和第二方面中任一项的视频解码方法。In a fifteenth aspect, an electronic device is provided, the electronic device includes a video decoding apparatus, and the processing circuit is configured to execute the video decoding method according to any one of the first aspect and the second aspect above.
第十六方面,提供一种电子设备,电子设备包括视频编码装置,处理电路被配置为执行如上述第三方面和第四方面中任一项的视频编码方法。In a sixteenth aspect, an electronic device is provided, the electronic device includes a video encoding device, and the processing circuit is configured to execute the video encoding method according to any one of the third aspect and the fourth aspect above.
第十七方面,提供一种电子设备,电子设备包括视频解码装置和视频编码装置,处理电路被配置为执行如上述第一方面中任一项的视频解码方法和第三方面中任一项的视频编码方法。In a seventeenth aspect, an electronic device is provided, the electronic device includes a video decoding device and a video encoding device, and the processing circuit is configured to execute the video decoding method according to any one of the first aspect above and any one of the third aspect Video encoding method.
第十八方面,提供一种电子设备,电子设备包括视频解码装置和视频编码装置,处理电路被配置为执行如上述第二方面中任一项的视频解码方法和第四方面中任一项的视频编码方法。In an eighteenth aspect, an electronic device is provided, the electronic device includes a video decoding device and a video encoding device, and the processing circuit is configured to execute the video decoding method according to any one of the above-mentioned second aspect and any one of the fourth aspect Video encoding method.
第十九方面,提供一种通信系统,通信系统包括上述各个方面中第五方面和第六方面中的视频解码装置以及第七方面和第八方面中的视频编码装置。In a nineteenth aspect, a communication system is provided, and the communication system includes the video decoding device in the fifth aspect and the sixth aspect and the video encoding device in the seventh aspect and the eighth aspect in the above aspects.
第三方面至第十九方面中的任一种实现方式所带来的技术效果可参见第一方面和第二方面中对应实现方式所带来的技术效果,此处不再赘述。For the technical effects brought about by any one of the implementation manners from the third aspect to the nineteenth aspect, refer to the technical effects brought about by the corresponding implementation manners in the first aspect and the second aspect, and details are not repeated here.
附图说明Description of drawings
图1a为DC预测模式的示意图;Figure 1a is a schematic diagram of a DC prediction mode;
图1b为垂直预测模式的示意图;Figure 1b is a schematic diagram of a vertical prediction mode;
图1c为Planar预测模式的示意图;Figure 1c is a schematic diagram of the Planar prediction model;
图1d为块拷贝模式的示意图;Figure 1d is a schematic diagram of a block copy mode;
图2为本申请实施例提供的编解码系统的系统架构图;FIG. 2 is a system architecture diagram of a codec system provided in an embodiment of the present application;
图3为本申请实施例提供的视频编码器的结构示意图;FIG. 3 is a schematic structural diagram of a video encoder provided in an embodiment of the present application;
图4为本申请实施例提供的视频解码器的结构示意图;FIG. 4 is a schematic structural diagram of a video decoder provided in an embodiment of the present application;
图5为本申请实施例提供的一种视频编/解码的流程示意图;FIG. 5 is a schematic flow diagram of a video encoding/decoding provided by an embodiment of the present application;
图6为本申请实施例提供的视频解码器或视频编码器的结构示意图;FIG. 6 is a schematic structural diagram of a video decoder or video encoder provided in an embodiment of the present application;
图7为本申请实施例提供的视频解码方法的流程图;FIG. 7 is a flowchart of a video decoding method provided in an embodiment of the present application;
图8为本申请实施例提供的5/3小波变换方法的示意图;Fig. 8 is a schematic diagram of the 5/3 wavelet transform method provided by the embodiment of the present application;
图9为本申请实施例提供的视频解码方法的流程图;FIG. 9 is a flowchart of a video decoding method provided in an embodiment of the present application;
图10为本申请实施例提供的视频编码方法的流程图;FIG. 10 is a flowchart of a video encoding method provided in an embodiment of the present application;
图11为本申请实施例提供的视频编码方法的流程图;FIG. 11 is a flow chart of a video encoding method provided in an embodiment of the present application;
图12为本申请实施例提供的解码装置的结构示意图;FIG. 12 is a schematic structural diagram of a decoding device provided by an embodiment of the present application;
图13为本申请实施例提供的解码装置的结构示意图;FIG. 13 is a schematic structural diagram of a decoding device provided by an embodiment of the present application;
图14为本申请实施例提供的编码装置的结构示意图;FIG. 14 is a schematic structural diagram of an encoding device provided by an embodiment of the present application;
图15为本申请实施例提供的编码装置的结构示意图。FIG. 15 is a schematic structural diagram of an encoding device provided by an embodiment of the present application.
具体实施方式Detailed ways
在本申请的描述中,除非另有说明,“/”表示“或”的意思,例如,A/B可以表示A或B。本文中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。此外,“至少一个”是指一个或多个,“多个”是指两个或两个以上。“第一”、“第二”等字样并不对数量和执行次序进行限定,并且“第一”、“第二”等字样也并不限定一定不同。In the description of the present application, unless otherwise specified, "/" means "or", for example, A/B may mean A or B. The "and/or" in this article is just an association relationship describing associated objects, which means that there can be three relationships, for example, A and/or B, which can mean: A exists alone, A and B exist at the same time, and B exists alone These three situations. In addition, "at least one" means one or more, and "plurality" means two or more. Words such as "first" and "second" do not limit the number and order of execution, and words such as "first" and "second" do not necessarily limit the difference.
需要说明的是,本申请中,“示例性的”或者“例如”等词用于表示作例子、例证或说明。本申请中被描述为“示例性的”或者“例如”的任何实施例或设计方案不应被解释为比其他实施例或设计方案更优选或更具优势。确切而言,使用“示例性的”或者“例如”等词旨在以具体方式呈现相关概念。It should be noted that, in this application, words such as "exemplary" or "for example" are used as examples, illustrations or illustrations. Any embodiment or design described herein as "exemplary" or "for example" is not to be construed as preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "such as" is intended to present related concepts in a concrete manner.
首先,对本申请实施例涉及的技术术语进行介绍:First, introduce the technical terms involved in the embodiment of this application:
1、视频编码技术1. Video coding technology
视频序列存在空间冗余、时间冗余、视觉冗余、信息熵冗余、结构冗余、知识冗余、重要性冗余等一系列的冗余信息。为了尽可能的去除视频序列中的冗余信息,减少表征视频的数据量,提出了视频编码技术,以达到减小存储空间和节省传输带宽的效果。视频编码技术也称为视频压缩技术。Video sequences have a series of redundant information such as spatial redundancy, temporal redundancy, visual redundancy, information entropy redundancy, structural redundancy, knowledge redundancy, and importance redundancy. In order to remove the redundant information in the video sequence as much as possible and reduce the amount of data representing the video, video coding technology is proposed to achieve the effect of reducing storage space and saving transmission bandwidth. Video coding technology is also called video compression technology.
在国际通用范围内,视频压缩编码标准,例如:由运动图像专家组(Motion Picture Experts Group,MPEG)制定的MPEG-2和MPEG-4标准中第10部分的高级视频编解码(Advanced Video Coding,AVC),由国际电信联盟电信标准化部门(International Telecommunication Uion-Telecommunication  Standardization Sector,ITU-T)制定的H.263、H.264和H.265(又称高效率视频编解码(High Efficiency Video Coding standard,HEVC))。In the international general scope, video compression coding standards, such as: Advanced Video Coding (Advanced Video Coding, AVC), H.263, H.264 and H.265 (also known as High Efficiency Video Coding standard) developed by the International Telecommunication Union-Telecommunication Standardization Sector (ITU-T). , HEVC)).
需要说明的是,在基于混合编码架构的编码算法中,上述压缩编码方式可以被混合使用。It should be noted that, in the coding algorithm based on the hybrid coding architecture, the above-mentioned compression coding methods may be used in combination.
视频压缩编码过程中的基本处理单位是图像块,该图像块是编码端将一帧/幅图像进行划分得到的。以HEVC为例,HEVC定义了编码树单元(Coding Tree Unit,CTU)、编码单元(Coding Unit,CU)、预测单元(Prediction Unit,PU)和变换单元(Transform Unit,TU)。编码树单元、编码单元、预测单元和变换单元均可作为划分后得到的图像块。其中变换单元和变换单元均基于编码单元进行划分。The basic processing unit in the process of video compression encoding is an image block, which is obtained by dividing a frame/image at the encoding end. Taking HEVC as an example, HEVC defines Coding Tree Unit (CTU), Coding Unit (CU), Prediction Unit (PU) and Transform Unit (TU). Coding tree units, coding units, prediction units, and transformation units can all be used as image blocks obtained after division. Both the transformation unit and the transformation unit are divided based on the coding unit.
2、视频采样2. Video sampling
像素为视频或图像最小的完整采样,因此,对图像块进行数据处理是以像素为单位。其中,每个像素记录颜色信息,一种通过RGB表示颜色,R表示红色(red),G表示绿色(green),B表示蓝色(blue);另一种通过YUV表示颜色,Y表示亮度(luminance),U表示第一色度Cb,V表示第二色度Cr。由于人们对亮度的敏感程度强于对色度的敏感程度,因此,可以通过多存储亮度,少存储色度实现减少存储空间。在一些实施例中,在视频编解码中,通常采用YUV格式进行视频采样,YUV格式包括420采样格式、444采样格式等。该采样格式基于亮度的取样数量,确定两个色度的取样数量,例如,假设一个编码单元有4×2个像素,格式如下:A pixel is the smallest complete sample of a video or image, so the data processing of an image block is performed in units of pixels. Among them, each pixel records color information, one represents color through RGB, R represents red (red), G represents green (green), B represents blue (blue); the other represents color through YUV, and Y represents brightness ( luminance), U represents the first chromaticity Cb, and V represents the second chromaticity Cr. Since people are more sensitive to luminance than chroma, the storage space can be reduced by storing more luminance and less chroma. In some embodiments, in video coding and decoding, video sampling is generally performed in YUV format, and the YUV format includes 420 sampling format, 444 sampling format, and the like. The sampling format determines the number of samples for two chroma based on the number of samples of luma. For example, assuming that a coding unit has 4×2 pixels, the format is as follows:
[Y0,U0,V0][Y1,U1,V1][Y2,U2,V2][Y3,U3,V3];[Y0,U0,V0][Y1,U1,V1][Y2,U2,V2][Y3,U3,V3];
[Y4,U4,V4][Y5,U5,V5][Y6,U6,V6][Y7,U7,V7];[Y4,U4,V4][Y5,U5,V5][Y6,U6,V6][Y7,U7,V7];
其中,420采样格式表示YUV以4:2:0的格式进行采样,即亮度与第一色度或第二色度以4:2的比例进行选取,其中第一色度与第二色度隔行选取。则上述编码单元采样选取第一行的亮度Y0-Y3,以及第一色度U0和U2,选取第二行的亮度Y4-Y7,以及第二色度V4和V6。该编码单元经采样由亮度编码单元及色度编码单元构成,其中,Among them, the 420 sampling format means that YUV is sampled in a 4:2:0 format, that is, the brightness and the first chroma or the second chroma are selected in a ratio of 4:2, where the first chroma and the second chroma are interlaced select. Then, the coding unit sampling selects the luminance Y0-Y3 of the first line, and the first chroma U0 and U2, and selects the luminance Y4-Y7 of the second line, and the second chroma V4 and V6. The coding unit is composed of a luma coding unit and a chrominance coding unit after sampling, wherein,
亮度编码单元为:The luma coding unit is:
[Y0][Y1][Y2][Y3];[Y0][Y1][Y2][Y3];
[Y4][Y5][Y6][Y7];[Y4][Y5][Y6][Y7];
色度编码单元为:The chroma coding units are:
[U0][U2];[U0][U2];
[V4][V6];[V4][V6];
类似地,444采样格式表示YUV以4:4:4的格式进行采样,即亮度与第一色度和第二色度以4:4:4的比例进行选取。Similarly, the 444 sampling format means that YUV is sampled in a 4:4:4 format, that is, the brightness and the first chroma and the second chroma are selected in a ratio of 4:4:4.
则上述编码单元经采样的亮度编码单元为:Then the brightness coding unit sampled by the above coding unit is:
[Y0][Y1][Y2][Y3];[Y0][Y1][Y2][Y3];
[Y4][Y5][Y6][Y7];[Y4][Y5][Y6][Y7];
色度编码单元为:The chroma coding units are:
[U0,V0][U1,V1][U2,V2][U3,V3];[U0,V0][U1,V1][U2,V2][U3,V3];
[U4,V4][U5,V5][U6,V6][U7,V7];[U4,V4][U5,V5][U6,V6][U7,V7];
上述经采样得到的亮度编码单元与色度编码单元作为后续进行编码处理的数据单元。The above-mentioned luma coding unit and chroma coding unit obtained through sampling are used as data units for subsequent coding processing.
3、预测3. Forecast
基于视频序列中时域冗余、空域冗余等冗余特性,对图像块进行预测。比如,在同一帧图像中由于相邻图像块之间存在相关性,故而可根据相邻图像块推测(预测)当前图像块的值。又如,在不同帧图像中,对于某一坐标位置的图像块来说,前一时刻该图像块的值与后一时刻该图像块的值具有相关性,故而可根据前一时刻该图像块的值预测后一时刻该图像块的值。其中,进行预测的图像块为预测单元(PU)。预测所采用的方式称为预测模式。基于同一帧图像中相邻图像块之间的相关性进行预测的预测模式为帧内预测模式。其中,帧内预测模式包括均值(DC)预测模式、角度预测模式和平面(Planar)预测模式。The image block is predicted based on redundant characteristics such as temporal redundancy and spatial redundancy in the video sequence. For example, since there is a correlation between adjacent image blocks in the same image frame, the value of the current image block can be estimated (predicted) based on the adjacent image blocks. As another example, in different frames of images, for an image block at a certain coordinate position, the value of the image block at the previous moment has a correlation with the value of the image block at the next moment, so the value of the image block at the previous moment can be The value of predicts the value of the image block at the next moment. Wherein, the image block to be predicted is a prediction unit (PU). The manner in which the forecast is made is called the forecast mode. The prediction mode that performs prediction based on the correlation between adjacent image blocks in the same image frame is an intra-frame prediction mode. Wherein, the intra-frame prediction mode includes mean value (DC) prediction mode, angle prediction mode and planar (Planar) prediction mode.
DC预测模式是通过计算参考像素的平均值作为预测像素。如图1a所示,计算左侧与上侧的参考像素的均值作为预测像素。其中,根据整个块的宽度与高度确定采用左侧和/或上侧的参考像素进行计算。In DC prediction mode, the average value of reference pixels is calculated as the predicted pixel. As shown in Figure 1a, the mean value of the reference pixels on the left and the upper side is calculated as the predicted pixel. Wherein, according to the width and height of the entire block, it is determined that reference pixels on the left side and/or upper side are used for calculation.
角度预测模式也可以称为方向性预测模式,基于参考像素预测不同方向的像素。其中,角度预测模式包括水平预测模式、垂直预测模式、对角预测模式等等。如图1b所示的垂直预测模式中,基于参考像素垂直向下的方向预测参考像素所在列的像素。当采用其他方向的预测模式进行预测时,则计算不同方向的投影结合参考像素得到预测像素。Angle prediction mode can also be called directional prediction mode, which predicts pixels in different directions based on reference pixels. Wherein, the angle prediction mode includes a horizontal prediction mode, a vertical prediction mode, a diagonal prediction mode and the like. In the vertical prediction mode shown in FIG. 1 b , the pixels in the column where the reference pixel is located are predicted based on the vertical downward direction of the reference pixel. When prediction modes in other directions are used for prediction, projections in different directions are calculated and combined with reference pixels to obtain predicted pixels.
Planar预测模式是通过计算水平行和竖直列的参考像素的加权,得到交叉点的预测像素。如图 1c所示,根据左侧和上侧的参考像素预测得到水平行右侧以及垂直列下侧的预测像素,再根据水平行和垂直列两端的像素得到预测像素。The Planar prediction mode calculates the weight of the reference pixels in the horizontal row and vertical column to obtain the predicted pixel of the intersection point. As shown in Figure 1c, the predicted pixels on the right side of the horizontal row and the lower side of the vertical column are obtained according to the reference pixels on the left and upper sides, and then the predicted pixels are obtained according to the pixels at both ends of the horizontal row and vertical column.
另外,预测模式还包括块拷贝模式。块拷贝模式也称为块复制模式,是指从当前帧已解码区域寻找最优的重建块作为匹配块,并将匹配块的重建像素作为当前块的预测像素,如图1d所示。In addition, the prediction mode also includes a block copy mode. The block copy mode is also called the block copy mode, which refers to finding the optimal reconstruction block from the decoded area of the current frame as the matching block, and using the reconstruction pixels of the matching block as the prediction pixels of the current block, as shown in Figure 1d.
本申请提供的编解码方法适用于视频编解码系统。图2示出了视频编解码系统的结构。The codec method provided in this application is applicable to a video codec system. Figure 2 shows the structure of the video codec system.
如图2所示,视频编解码系统包括源装置20和目的装置21。源装置20产生经过编码后的视频数据,源装置20也可以被称为视频编码装置或视频编码设备,目的装置21可以对源装置20产生的经过编码后的视频数据进行解码,目的装置21也可以被称为视频解码装置或视频解码设备。源装置20和/或目的装置21可包括至少一个处理器以及耦合到所述至少一个处理器的存储器。所述存储器可包括但不限于只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、带电可擦可编程只读存储器(Electrically Erasable Programmable Read-Only Memory,EEPROM)、快闪存储器或可用于以可由计算机存取的指令或数据结构的形式存储所要的程序代码的任何其它媒体,本申请对此不作具体限定。As shown in FIG. 2 , the video codec system includes a source device 20 and a destination device 21 . The source device 20 generates encoded video data. The source device 20 can also be called a video encoding device or video encoding device. The destination device 21 can decode the encoded video data generated by the source device 20. The destination device 21 also It may be called a video decoding device or a video decoding device. Source device 20 and/or destination device 21 may include at least one processor and a memory coupled to the at least one processor. The memory may include but not limited to Read-Only Memory (ROM), Random Access Memory (Random Access Memory, RAM), Electrically Erasable Programmable Read-Only Memory (Electrically Erasable Programmable Read-Only Memory, EEPROM) ), flash memory, or any other medium that can be used to store desired program code in the form of instructions or data structures that can be accessed by a computer, which is not specifically limited by the present application.
源装置20和目的装置21可以包括各种装置,包括桌上型计算机、移动计算装置、笔记本(例如,膝上型)计算机、平板计算机、机顶盒、例如所谓的“智能”电话等电话手持机、电视机、相机、显示装置、数字媒体播放器、视频游戏控制台、车载计算机或其类似者等电子设备。 Source device 20 and destination device 21 may include a variety of devices, including desktop computers, mobile computing devices, notebook (e.g., laptop) computers, tablet computers, set-top boxes, telephone handsets such as so-called "smart" phones, Electronic equipment such as televisions, cameras, display devices, digital media players, video game consoles, in-vehicle computers, or the like.
目的装置21可经由链路22从源装置20接收经编码视频数据。链路22可包括能够将经编码视频数据从源装置20移动到目的装置21的一个或多个媒体和/或装置。在一个实例中,链路22可包括使得源装置20能够实时地将编码后的视频数据直接发射到目的装置21的一个或多个通信媒体。在此实例中,源装置20可根据通信标准(例如:无线通信协议)来调制编码后的视频数据,并且可以将调制后的视频数据发射到目的装置21。上述一个或多个通信媒体可包括无线和/或有线通信媒体,例如:射频(Radio Frequency,RF)频谱、一个或多个物理传输线。上述一个或多个通信媒体可形成基于分组的网络的一部分,基于分组的网络例如为局域网、广域网或全球网络(例如,因特网)等。上述一个或多个通信媒体可以包含路由器、交换器、基站,或者实现从源装置20到目的装置21的通信的其它设备。 Destination device 21 may receive encoded video data from source device 20 via link 22 . Link 22 may include one or more media and/or devices capable of moving encoded video data from source device 20 to destination device 21 . In one example, link 22 may include one or more communication media that enable source device 20 to transmit encoded video data directly to destination device 21 in real-time. In this example, the source device 20 may modulate the encoded video data according to a communication standard (eg, a wireless communication protocol), and may transmit the modulated video data to the destination device 21 . The aforementioned one or more communication media may include wireless and/or wired communication media, for example: radio frequency (Radio Frequency, RF) spectrum, one or more physical transmission lines. The one or more communication media described above may form part of a packet-based network such as a local area network, a wide area network, or a global network (eg, the Internet), among others. The one or more communication media described above may include routers, switches, base stations, or other devices that enable communication from source device 20 to destination device 21 .
在另一实例中,可将编码后的视频数据从输出接口203输出到存储装置23。类似地,可通过输入接口213从存储装置23存取编码后的视频数据。存储装置23可包括多种本地存取式数据存储媒体,例如蓝光光盘、高密度数字视频光盘(Digital Video Disc,DVD)、只读光盘(Compact Disc Read-Only Memory,CD-ROM)、快闪存储器,或用于存储经编码视频数据的其它合适数字存储媒体。In another example, the encoded video data may be output from the output interface 203 to the storage device 23 . Similarly, encoded video data may be accessed from storage device 23 through input interface 213 . The storage device 23 may include a variety of local access data storage media, such as Blu-ray discs, high-density digital video discs (Digital Video Disc, DVD), read-only discs (Compact Disc Read-Only Memory, CD-ROM), flash Memory, or other suitable digital storage media for storing encoded video data.
在另一实例中,存储装置23可对应于文件服务器或存储由源装置20产生的编码后的视频数据的另一中间存储装置。在此实例中,目的装置21可经由流式传输或下载从存储装置23获取其存储的视频数据。文件服务器可以为任何类型的能够存储经编码的视频数据并且将经编码的视频数据发射到目的装置21的服务器。例如,文件服务器可以包括全球广域网(World Wide Web,Web)服务器(例如,用于网站)、文件传送协议(File Transfer Protocol,FTP)服务器、网络附加存储(Network Attached Storage,NAS)装置以及本地磁盘驱动器。In another example, storage device 23 may correspond to a file server or another intermediate storage device that stores encoded video data generated by source device 20 . In this example, destination device 21 may obtain its stored video data from storage device 23 via streaming or downloading. The file server may be any type of server capable of storing encoded video data and transmitting the encoded video data to destination device 21 . For example, a file server may include a World Wide Web (Web) server (e.g., for a website), a File Transfer Protocol (FTP) server, a Network Attached Storage (NAS) device, and a local disk driver.
目的装置21可通过任何标准数据连接(例如,因特网连接)存取编码后的视频数据。数据连接的实例类型包含适合于存取存储于文件服务器上的编码后的视频数据的无线信道、有线连接(例如,缆线调制解调器等),或两者的组合。编码后的视频数据从文件服务器发射的方式可为流式传输、下载传输或两者的组合。 Destination device 21 may access the encoded video data through any standard data connection, such as an Internet connection. Example types of data connections include wireless channels suitable for accessing encoded video data stored on a file server, wired connections (eg, cable modem, etc.), or a combination of both. The encoded video data can be transmitted from the file server by streaming, download transmission or a combination of both.
本申请的解码方法不限于无线应用场景,示例性的,本申请的编解码方法可以应用于支持以下多种多媒体应用的视频编解码:空中电视广播、有线电视发射、卫星电视发射、流式传输视频发射(例如,经由因特网)、存储于数据存储媒体上的视频数据的编码、存储于数据存储媒体上的视频数据的解码,或其它应用。在一些实例中,视频编解码系统可经配置,以支持单向或双向视频发射,以支持例如视频流式传输、视频播放、视频广播及/或视频电话等应用。The decoding method of the present application is not limited to wireless application scenarios. Exemplarily, the coding and decoding method of the present application can be applied to video coding and decoding supporting the following multiple multimedia applications: air TV broadcasting, cable TV transmission, satellite TV transmission, streaming transmission Video transmission (eg, via the Internet), encoding of video data stored on a data storage medium, decoding of video data stored on a data storage medium, or other applications. In some examples, a video codec system can be configured to support one-way or two-way video transmission to support applications such as video streaming, video playback, video broadcasting, and/or video telephony.
需要说明的是,图2示出的视频编解码系统仅仅是视频编解码系统的示例,并不是对本申请中视频编解码系统的限定。本申请提供的编解码方法还可适用于编码装置与解码装置之间无数据通信的场景。在其它实例中,待编码视频数据或编码后的视频数据可以从本地存储器检索,也可以在网络上流式传输等。视频编码装置可对待编码视频数据进行编码并且将编码后的视频数据存储到存储器,视频解码装置也可从存储器中获取编码后的视频数据并且对该编码后的视频数据进行解码。It should be noted that the video codec system shown in FIG. 2 is only an example of a video codec system, and is not a limitation of the video codec system in this application. The codec method provided in this application is also applicable to a scenario where there is no data communication between the encoding device and the decoding device. In other examples, the video data to be encoded or the encoded video data may be retrieved from local storage, streamed over a network, or the like. The video encoding device can encode the video data to be encoded and store the encoded video data in the memory, and the video decoding device can also obtain the encoded video data from the memory and decode the encoded video data.
在图2中,源装置20包括视频源201、视频编码器202和输出接口203。在一些实例中,输出接口203可包括调制器/解调器(调制解调器)和/或发射器。视频源201可包括视频捕获装置(例如,摄像机)、含有先前捕获的视频数据的视频存档、用以从视频内容提供者接收视频数据的视频输入 接口,和/或用于产生视频数据的计算机图形系统,或视频数据的此些来源的组合。In FIG. 2 , a source device 20 includes a video source 201 , a video encoder 202 and an output interface 203 . In some examples, output interface 203 may include a modulator/demodulator (modem) and/or a transmitter. Video source 201 may include a video capture device (e.g., a video camera), a video archive containing previously captured video data, a video input interface to receive video data from a video content provider, and/or a computer graphics system, or a combination of such sources of video data.
视频编码器202可对来自视频源201的视频数据进行编码。在一些实例中,源装置20经由输出接口203将编码后的视频数据直接发射到目的装置21。在其它实例中,编码后的视频数据还可存储到存储装置23上,供目的装置21稍后存取来用于解码和/或播放。 Video encoder 202 may encode video data from video source 201 . In some examples, source device 20 transmits the encoded video data directly to destination device 21 via output interface 203 . In other examples, the encoded video data may also be stored on the storage device 23 for later access by the destination device 21 for decoding and/or playback.
在图2的实例中,目的装置21包括显示装置211、视频解码器212以及输入接口213。在一些实例中,输入接口213包括接收器和/或调制解调器。输入接口213可经由链路22和/或从存储装置23接收编码后的视频数据。显示装置211可与目的装置21集成或可在目的装置21外部。一般来说,显示装置211显示解码后的视频数据。显示装置211可包括多种显示装置,例如,液晶显示器、等离子显示器、有机发光二极管显示器或其它类型的显示装置。In the example of FIG. 2 , the destination device 21 includes a display device 211 , a video decoder 212 and an input interface 213 . In some examples, input interface 213 includes a receiver and/or a modem. Input interface 213 may receive encoded video data via link 22 and/or from storage device 23 . The display device 211 may be integrated with the destination device 21 or may be external to the destination device 21 . In general, the display device 211 displays the decoded video data. The display device 211 may include various display devices, for example, a liquid crystal display, a plasma display, an organic light emitting diode display, or other types of display devices.
在一些示例中,视频编码器202和视频解码器212可各自与音频编码器和解码器集成,且可包括适当的多路复用器-多路分用器单元或其它硬件和软件,以处理共同数据流或单独数据流中的音频和视频两者的编码。In some examples, video encoder 202 and video decoder 212 may each be integrated with an audio encoder and decoder, and may include appropriate multiplexer-demultiplexer units or other hardware and software to process Encoding of both audio and video in a common data stream or in separate data streams.
视频编码器202和视频解码器212可以包括至少一个微处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application-Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field Programmable Gate Array,FPGA)、离散逻辑、硬件或其任何组合。若本申请提供的编解码方法采用软件实现,则可将用于软件的指令存储在合适的非易失性计算机可读存储媒体中,且可使用至少一个处理器执行所述指令从而实施本申请。 Video encoder 202 and video decoder 212 may include at least one microprocessor, digital signal processor (Digital Signal Processor, DSP), application-specific integrated circuit (Application-Specific Integrated Circuit, ASIC), field programmable gate array (Field Programmable Gate Array, FPGA), discrete logic, hardware, or any combination thereof. If the codec method provided in this application is implemented by software, the instructions for the software can be stored in a suitable non-volatile computer-readable storage medium, and at least one processor can be used to execute the instructions to implement the application. .
本申请中的视频编码器202和视频解码器212可以根据视频压缩标准(例如HEVC)操作,也可根据其它业界标准操作,本申请对此不作具体限定。The video encoder 202 and the video decoder 212 in this application may operate according to a video compression standard (such as HEVC), or may also operate according to other industry standards, which is not specifically limited in this application.
图3是本申请实施例中视频编码器202的一种示意性框图。视频编码器202可以在预测模块31、变换模块32、量化模块33以及熵编码模块34分别进行预测、变换、量化以及熵编码的过程。视频编码器202中还包括分割模块30、求和器302。对于视频块重构建,视频编码器202也包括反量化模块35、反变换模块36、求和器301和参考图像存储器37。Fig. 3 is a schematic block diagram of the video encoder 202 in the embodiment of the present application. The video encoder 202 can respectively perform prediction, transformation, quantization and entropy coding processes in the prediction module 31 , the transformation module 32 , the quantization module 33 and the entropy coding module 34 . The video encoder 202 also includes a segmentation module 30 and a summer 302 . For video block reconstruction, the video encoder 202 also includes an inverse quantization module 35 , an inverse transformation module 36 , a summer 301 and a reference image memory 37 .
如图3中所展示,视频编码器202接收视频数据,分割模块30将视频数据分割成原始块。此分割也可包括分割成条带(slice)、图像块或其它较大单元,以及(例如)根据最大编码单元(Largest Coding Unit,LCU)及编码单元的四叉树结构进行视频块分割。示例性的,视频编码器202编码在待编码的视频条带内的视频块的组件中。一般的,条带可划分成多个原始块(且可能划分成称作图像块的原始块的集合)。通常在分割模块30中确定编码单元CU、变换单元PU以及变换单元TU的尺寸。As shown in FIG. 3 , video encoder 202 receives video data, and partition module 30 partitions the video data into raw blocks. This partitioning may also include partitioning into slices, blocks or other larger units, and video block partitioning, for example, according to Largest Coding Units (LCUs) and quadtree structures of coding units. Exemplarily, the video encoder 202 encodes in components of video blocks within the video slice to be encoded. In general, a slice may be divided into a number of original blocks (and possibly into a collection of original blocks called tiles). The sizes of the coding units CU, transform units PU and transform units TU are typically determined in the partitioning module 30 .
预测模块31可将所得经帧内模式预测或块拷贝模式预测的预测块提供到求和器302以产生残差块,且将该预测块提供到求和器301经重构得到重建块,该重建块用于后续进行预测的参考像素。其中,视频编码器202通过原始块的像素值减去预测块的像素值来形成像素差值,该像素差值即为残差块,该残差块中的数据可包括亮度差及色度差。求和器301表示执行此减法运算的一个或多个组件。预测模块31还可将相关的语法元素发送至熵编码模块34用于合并至码流。The prediction module 31 may provide the resulting intra-mode predicted or block copy mode predicted predicted block to the summer 302 to generate a residual block, and provide the predicted block to the summer 301 to be reconstructed to obtain a reconstructed block, which The reconstructed block is used as reference pixels for subsequent prediction. Wherein, the video encoder 202 forms a pixel difference value by subtracting the pixel value of the predicted block from the pixel value of the original block, and the pixel difference value is the residual block, and the data in the residual block may include brightness difference and chrominance difference . Summer 301 represents one or more components that perform this subtraction operation. The prediction module 31 can also send related syntax elements to the entropy coding module 34 for merging into the code stream.
变换模块32可将残差块划分为一个或多个变换单元TU进行变换。变换模块32使用DCT或DST将残差块经变换得到变换系数。变换模块32可将残差块从像素域转换到变换域(例如,频域)。当前常用的变换方法有DCT2和DST7。The transform module 32 may divide the residual block into one or more transform units TU for transform. The transform module 32 transforms the residual block using DCT or DST to obtain transform coefficients. Transform module 32 may convert the residual block from the pixel domain to a transform domain (eg, the frequency domain). Currently commonly used transformation methods are DCT2 and DST7.
变换模块32可将所得变换系数发送到量化模块33。量化模块33对变换系数进行量化以进一步减小码率。量化过程可减少与系数中的一些或全部相关联的比特深度。可通过调整量化参数来修改量化的程度。在一些可行的实施方式中,量化模块33可接着执行包含经量化变换系数的矩阵的扫描。替代的,熵编码模块34可执行扫描。 Transform module 32 may send the resulting transform coefficients to quantization module 33 . The quantization module 33 quantizes the transform coefficients to further reduce the code rate. The quantization process may reduce the bit depth associated with some or all of the coefficients. The degree of quantization can be modified by adjusting quantization parameters. In some possible implementations, quantization module 33 may then perform a scan of the matrix comprising quantized transform coefficients. Alternatively, entropy encoding module 34 may perform a scan.
在量化之后,熵编码模块34可熵编码量化后的变换系数。例如,熵编码模块34可执行上下文自适应性可变长度编码(Context-Adaptive Varialbe-Length Coding,CAVLC)、上下文自适应性二进制算术编码(Context-based Adaptive Binary Arithmetic Coding,CABAC)、基于语法的上下文自适应性二进制算术解码(SBAC)、概率区间分割熵(PIPE)解码或另一熵编码方法或技术。在通过熵编码模块34进行熵编码之后,可将经编码码流传输到视频解码器212或存档以供稍后传输或由视频解码器212检索。After quantization, entropy encoding module 34 may entropy encode the quantized transform coefficients. For example, the entropy coding module 34 can perform context-adaptive variable-length coding (Context-Adaptive Varialbe-Length Coding, CAVLC), context-based adaptive binary arithmetic coding (Context-based Adaptive Binary Arithmetic Coding, CABAC), syntax-based Context Adaptive Binary Arithmetic Coding (SBAC), Probability Interval Partitioning Entropy (PIPE) decoding or another entropy coding method or technique. Following entropy encoding by entropy encoding module 34 , the encoded codestream may be transmitted to video decoder 212 or archived for later transmission or retrieval by video decoder 212 .
反量化模块35及反变换模块36分别应用反量化与反变换,求和器301将反变换后的残差块和预测模块31预测的预测块相加以产生重建块,该重建块用作对后续原始块进行预测的参考像素。该重建块存储于参考图像存储器37中。The inverse quantization module 35 and the inverse transformation module 36 respectively apply inverse quantization and inverse transformation, and the summer 301 adds the inversely transformed residual block and the prediction block predicted by the prediction module 31 to generate a reconstruction block, which is used for subsequent original Reference pixels for block prediction. This reconstructed block is stored in the reference image memory 37 .
图4是本申请实施例中视频解码器212的结构示意图。如图4所示,视频解码器212包括熵解码模块40、预测模块41、反量化模块42、反变换模块43、求和器401和参考图像存储器44。在一些可行的实施方式中,视频解码器212可执行与关于来自图3的视频编码器202描述的编码流程的 示例性地互逆的解码流程。FIG. 4 is a schematic structural diagram of the video decoder 212 in the embodiment of the present application. As shown in FIG. 4 , the video decoder 212 includes an entropy decoding module 40 , a prediction module 41 , an inverse quantization module 42 , an inverse transformation module 43 , a summer 401 and a reference image memory 44 . In some possible implementations, video decoder 212 may perform an exemplary reciprocal decoding process to the encoding process described with respect to video encoder 202 from FIG. 3 .
在解码过程期间,视频解码器212从视频编码器202接收经编码的视频的码流。视频解码器212的熵解码模块40熵解码该码流以产生量化系数和语法元素。熵解码模块40将语法元素转递到预测模块41。视频解码器212可在视频条带层级和/或视频块层级处接收语法元素。During the decoding process, video decoder 212 receives a codestream of encoded video from video encoder 202 . The entropy decoding module 40 of the video decoder 212 entropy decodes the codestream to generate quantized coefficients and syntax elements. The entropy decoding module 40 forwards the syntax elements to the prediction module 41 . Video decoder 212 may receive the syntax elements at the video slice level and/or the video block level.
反量化模块42对码流中所提供且通过熵解码模块40所解码的经量化变换系数进行反量化(例如,解量化)。反量化过程可包括使用通过视频编码器202针对视频条带中的每一视频块所计算的量化参数确定量化的程度,且同样地确定应用的反量化的程度。反变换模块43将反变换(例如,DCT、DST等变换方法)应用于反量化后的变换系数,将反量化后的变换系数按照反变换单元在像素域中产生反变换后的残差块,换言之,反量化后的变换系数再进行反变换生成残差系数。其中,反变换单元的尺寸与变换单元的尺寸相同,反变换方法与变换方法采用同样的变换方法中相应的正变换与反变换,例如,DCT、DST的反变换为反DCT、反DST或概念上类似的反变换过程。 Inverse quantization module 42 inverse quantizes (eg, dequantizes) the quantized transform coefficients provided in the codestream and decoded by entropy decoding module 40 . The inverse quantization process may include determining the degree of quantization using quantization parameters calculated by video encoder 202 for each video block in the video slice, and likewise determining the degree of inverse quantization applied. The inverse transform module 43 applies inverse transform (for example, transform methods such as DCT and DST) to the inversely quantized transform coefficients, generates an inversely transformed residual block in the pixel domain according to the inversely transformed transform coefficients, In other words, the inversely quantized transform coefficients are then inversely transformed to generate residual coefficients. Wherein, the size of the inverse transformation unit is the same as that of the transformation unit, and the inverse transformation method and the transformation method adopt the corresponding forward transformation and inverse transformation in the same transformation method. For example, the inverse transformation of DCT and DST is inverse DCT, inverse DST or concept A similar inverse transformation process.
预测模块41生成预测块后,视频解码器212通过将来自反变换模块43的反变换后的残差块与预测块求和来形成经解码视频块。求和器401表示执行此求和运算的一个或多个组件。在需要时,也可应用解块滤波器来对经解码的视频块进行滤波以便去除块效应伪影。给定帧或图像中的经解码的视频块存储于参考图像存储器44中,作为后续进行预测的参考像素。After prediction module 41 generates the prediction block, video decoder 212 forms a decoded video block by summing the inverse transformed residual block from inverse transformation module 43 with the prediction block. Summer 401 represents one or more components that perform this summation operation. A deblocking filter may also be applied to filter the decoded video blocks in order to remove blocking artifacts, if desired. The decoded video blocks in a given frame or picture are stored in reference picture memory 44 as reference pixels for subsequent predictions.
本申请提供一种可能的视频编/解码实现方式,如图5所示,图5为本申请提供的一种视频编/解码的流程示意图,该视频编/解码实现方式包括过程①至过程⑤,过程①至过程⑤可以由上述的源装置20、视频编码器202、目的装置21或视频解码器212中的任意一个或多个执行。This application provides a possible implementation of video encoding/decoding, as shown in Figure 5. Figure 5 is a schematic flow diagram of a video encoding/decoding provided by this application. The implementation of video encoding/decoding includes process ① to process ⑤ , Process ① to Process ⑤ may be performed by any one or more of the above source device 20 , video encoder 202 , destination device 21 or video decoder 212 .
过程①:将一帧图像分成一个或多个互相不重叠的并行编码单元。该一个或多个并行编码单元间无依赖关系,可完全并行/独立编码和解码,如图5所示出的并行编码单元1和并行编码单元2。Process ①: Divide a frame of image into one or more non-overlapping parallel coding units. There is no dependency between the one or more parallel encoding units, and they can be completely parallel/independently encoded and decoded, as shown in FIG. 5 , the parallel encoding unit 1 and the parallel encoding unit 2 .
过程②:对于每个并行编码单元,可再将其分成一个或多个互相不重叠的独立编码单元,各个独立编码单元间可相互不依赖,但可以共用一些并行编码单元头信息。Process ②: For each parallel coding unit, it can be divided into one or more independent coding units that do not overlap with each other. Each independent coding unit can be independent of each other, but can share some parallel coding unit header information.
例如,独立编码单元的宽为w_lcu,高为h_lcu。若并行编码单元划分成一个独立编码单元,则独立编码单元的尺寸与并行编码单元完全相同;否则,则独立编码单元的宽应大于高(除非是边缘区域)。For example, an independent coding unit has a width of w_lcu and a height of h_lcu. If the parallel coding unit is divided into an independent coding unit, the size of the independent coding unit is exactly the same as that of the parallel coding unit; otherwise, the width of the independent coding unit should be larger than the height (except for the edge area).
通常的,独立编码单元可为固定的w_lcu×h_lcu,w_lcu和h_lcu均为2的N次方(N≥0),如独立编码单元的尺寸为:128×4,64×4,32×4,16×4,8×4,32×2,16×2或8×2等。Usually, the independent coding unit can be fixed w_lcu×h_lcu, both w_lcu and h_lcu are 2 to the Nth power (N≥0), for example, the size of the independent coding unit is: 128×4, 64×4, 32×4, 16×4, 8×4, 32×2, 16×2 or 8×2 etc.
作为一种可能的示例,独立编码单元可为固定的128×4。若并行编码单元的尺寸为256×8,则可将并行编码单元等分为4个独立编码单元;若并行编码单元的尺寸为288×10,则并行编码单元可以划分为:第一/二行包括2个128×4的独立编码单元和1个32×4的独立编码单元;第三行包括2个128×2的独立编码单元和1个32×2的独立编码单元。As a possible example, the independent coding unit may be a fixed 128×4. If the size of the parallel coding unit is 256×8, the parallel coding unit can be divided into 4 independent coding units; if the size of the parallel coding unit is 288×10, the parallel coding unit can be divided into: the first/second row It includes two 128×4 independent coding units and one 32×4 independent coding unit; the third row includes two 128×2 independent coding units and one 32×2 independent coding unit.
值得注意的是,独立编码单元既可以是包括亮度Y、第一色度Cb、第二色度Cr三个分量,或RGB三个分量,也可以仅包含其中的某一个分量。若独立编码单元包含三个分量,则这三个分量的尺寸可以完全一样,也可以不一样,具体与图像的输入格式相关。It is worth noting that the independent coding unit may include three components of luma Y, first chroma Cb, and second chroma Cr, or three components of RGB, or only one of them. If the independent coding unit includes three components, the sizes of the three components may be exactly the same or different, which is specifically related to the input format of the image.
过程③:对于每个独立编码单元,可再将其分成一个或多个互相不重叠的编码单元,独立编码单元内的各个编码单元可相互依赖,如多个编码单元可以进行相互参考预编解码。Process ③: For each independent coding unit, it can be divided into one or more non-overlapping coding units. Each coding unit in an independent coding unit can depend on each other. For example, multiple coding units can perform mutual reference precoding and decoding .
若编码单元与独立编码单元尺寸相同(即独立编码单元仅分成一个编码单元),则其尺寸可为过程②所述的所有尺寸。If the size of the coding unit is the same as that of the independent coding unit (that is, the independent coding unit is only divided into one coding unit), then its size can be all the sizes described in process ②.
若独立编码单元分成多个互相不重叠的编码单元,则其可行划分例子有:水平等分(编码单元的高与独立编码单元相同,但宽不同,编码单元的宽可为独立编码单元的宽的1/2、1/4、1/8、1/16等),垂直等分(编码单元的宽与独立编码单元相同,高不同,编码单元的高可为独立编码单元的高的1/2、1/4、1/8、1/16等),水平和垂直等分(四叉树划分)等,优选为水平等分。If the independent coding unit is divided into multiple non-overlapping coding units, the feasible division examples are: horizontal equal division (the height of the coding unit is the same as that of the independent coding unit, but the width is different, and the width of the coding unit can be the width of the independent coding unit 1/2, 1/4, 1/8, 1/16, etc.), vertical equal division (the width of the coding unit is the same as that of the independent coding unit, but the height is different, and the height of the coding unit can be 1/ of the height of the independent coding unit 2, 1/4, 1/8, 1/16, etc.), horizontal and vertical equal division (quadtree division), etc., preferably horizontal equal division.
编码单元的宽为W,高为H,则其宽应大于高(除非是边缘区域)。通常的,编码单元可为固定的W×H,W和H均为2个N次方(N大于等于0),如16x4、8x4、16x2、8x2、8x1、4x1等。The width of the coding unit is W and the height is H, so its width should be greater than its height (unless it is an edge area). Generally, the coding unit may be a fixed W×H, and both W and H are two Nth powers (N is greater than or equal to 0), such as 16x4, 8x4, 16x2, 8x2, 8x1, 4x1 and so on.
作为一种可能的示例,编码单元可为固定的16x4。若独立编码单元的尺寸为64x4,则可将独立编码单元等分为4个编码单元;若独立编码单元的尺寸为72x4,则编码单元划分为:4个16x4和1个8x4。As a possible example, the coding unit may be fixed 16x4. If the size of the independent coding unit is 64x4, the independent coding unit can be equally divided into 4 coding units; if the size of the independent coding unit is 72x4, the coding unit can be divided into four 16x4 and one 8x4.
值得注意的是,编码单元既可以是包括亮度Y、第一色度Cb、第二色度Cr三个分量(或RGB三分量),也可以仅包含其中的某一个分量。若包含三个分量,几个分量的尺寸可以完全一样,也可以不一样,具体与图像输入格式相关。It should be noted that the coding unit may include three components of luma Y, first chroma Cb, and second chroma Cr (or RGB three components), or may only include one of them. If it contains three components, the sizes of several components can be exactly the same or different, depending on the image input format.
值得注意的是,过程③是视频编解码方法中一个可选的步骤,视频编/解码器可以对过程②获得的独立编码单元进行残差系数(或残差值)进行编/解码。It is worth noting that the process ③ is an optional step in the video encoding and decoding method, and the video encoder/decoder can encode/decode the residual coefficient (or residual value) of the independent coding unit obtained in the process ②.
过程④:对于编码单元,可以将其可再将其分成一个或多个互相不重叠的预测组(Prediction  Group,PG),PG也可简称为Group,各个预测组按照选定预测模式进行编解码,得到预测组的预测值,组成整个编码单元的预测值,基于预测值和编码单元的原始值,获得编码单元的残差值。Process ④: For the coding unit, it can be divided into one or more non-overlapping prediction groups (Prediction Group, PG), PG can also be referred to as Group, and each prediction group is encoded and decoded according to the selected prediction mode , to obtain the prediction value of the prediction group to form the prediction value of the entire coding unit, and obtain the residual value of the coding unit based on the prediction value and the original value of the coding unit.
过程⑤:基于编码单元的残差值,对编码单元进行分组,获得一个或多个相不重叠的残差小块(residual block,RB),各个残差小块的残差系数按照选定模式进行编解码,形成残差系数流。在一些实施例中,可分为对残差系数进行变换和不进行变换两类。Process ⑤: Based on the residual value of the coding unit, the coding unit is grouped to obtain one or more non-overlapping residual blocks (residual block, RB), and the residual coefficients of each residual block are selected according to the selected mode Perform encoding and decoding to form a residual coefficient stream. In some embodiments, it can be divided into two categories: transforming and not transforming the residual coefficients.
其中,过程⑤中残差系数编解码方法的选定模式可以包括,但不限于下述任一种:半定长编码方式、指数哥伦布(Golomb)编码方法、Golomb-Rice编码方法、截断一元码编码方法、游程编码方法、直接编码原始残差值等。Wherein, the selected mode of the residual coefficient encoding and decoding method in the process ⑤ may include, but not limited to any of the following: semi-fixed length encoding method, exponential Golomb (Golomb) encoding method, Golomb-Rice encoding method, truncated unary code Encoding methods, run-length encoding methods, direct encoding of raw residual values, etc.
例如,视频编码器可直接对残差小块内的系数进行编码。For example, a video encoder may directly encode coefficients within a residual tile.
又如,视频编码器也可对残差块进行变换,如DCT、DST、Hadamard变换等,再对变换后的系数进行编码。As another example, the video encoder may also perform transformation on the residual block, such as DCT, DST, Hadamard transformation, etc., and then encode the transformed coefficients.
作为一种可能的示例,当残差小块较小时,视频编码器可直接对残差小块内的各个系数进行统一量化,再进行二值化编码。若残差小块较大,可进一步划分为多个系数组(coefficient group,CG),再对各个系数组进行统一量化,再进行二值化编码。在本申请的一些实施例中,系数组(CG)和量化组(QG)可以相同。As a possible example, when the small residual block is small, the video encoder may directly uniformly quantize the coefficients in the small residual block, and then perform binarization coding. If the residual small block is large, it can be further divided into multiple coefficient groups (coefficient group, CG), and then each coefficient group is uniformly quantized, and then binary coded. In some embodiments of the present application, the coefficient group (CG) and the quantization group (QG) may be the same.
下面以半定长编码方式对残差系数编码的部分进行示例性说明。首先,将一个残差小块块内残差绝对值的最大值定义为修整最大值(modified maximum,MM)。其次,确定该残差小块块内残差系数的编码比特数(同一个残差小块块内残差系数的编码比特数一致)。例如,若当前残差小块的关键限值(critica llimit,CL)为2,当前残差系数为1,则编码残差系数1需要2个比特,表示为01。若当前残差小块的关键限值为7,则表示编码8-bit的残差系数和1-bit的符号位。关键限值的确定是去找满足当前子块所有残差都在[-2^(M-1),2^(M-1)]范围之内的最小M值。若同时存在-2^(M-1)和2^(M-1)两个边界值,则M应增加1,即需要M+1个比特编码当前残差小块的所有残差;若仅存在-2^(M-1)和2^(M-1)两个边界值中的一个,则需要编码一个Trailing位来确定该边界值是-2^(M-1)还是2^(M-1);若所有残差均不存在-2^(M-1)和2^(M-1)中的任何一个,则无需编码该Trailing位。The part of encoding the residual coefficients in a semi-fixed-length encoding manner will be exemplarily described below. First, the maximum value of the absolute value of the residual within a small residual block is defined as the modified maximum (MM). Secondly, the number of coding bits of the residual coefficients in the small residual block is determined (the number of coding bits of the residual coefficients in the same small residual block is the same). For example, if the critical limit (CL) of the current residual small block is 2 and the current residual coefficient is 1, then 2 bits are required to encode the residual coefficient 1, which is expressed as 01. If the key limit value of the current residual small block is 7, it means encoding 8-bit residual coefficient and 1-bit sign bit. The determination of the key limit is to find the minimum M value that satisfies all the residuals of the current sub-block within the range of [-2^(M-1), 2^(M-1)]. If there are two boundary values -2^(M-1) and 2^(M-1) at the same time, M should be increased by 1, that is, M+1 bits are required to encode all residuals of the current residual block; if only If there is one of the two boundary values -2^(M-1) and 2^(M-1), a Trailing bit needs to be encoded to determine whether the boundary value is -2^(M-1) or 2^(M -1); if none of -2^(M-1) and 2^(M-1) exists in all residuals, the Trailing bit does not need to be encoded.
另外,对于某些特殊的情况,视频编码器也可以直接编码图像的原始值,而不是残差值。In addition, for some special cases, the video encoder can also directly encode the original value of the image instead of the residual value.
上述视频编码器202以及视频解码器212也可以通过另外一种实现形态来实现,例如,采用通用的数字处理器系统实现,如图6所示的编解码装置50,该编解码装置50可以为上述视频编码器202中的部分装置,也可以为上述视频解码器212中的部分装置。The above video encoder 202 and video decoder 212 can also be implemented in another form of implementation, for example, by using a general-purpose digital processor system, such as the codec device 50 shown in Figure 6, the codec device 50 can be Some of the devices in the above video encoder 202 may also be some of the devices in the above video decoder 212 .
该编解码装置50可以应用于编码侧,也可以应用于解码侧。编解码装置50包括处理器501以及存储器502。所述处理器501与存储器502相连接(如通过总线504相互连接)。在一些示例中,编解码装置50还可包括通信接口503,通信接口503连接处理器501和存储器502,用于接收/发送数据。The codec device 50 can be applied to the encoding side or the decoding side. The codec device 50 includes a processor 501 and a memory 502 . The processor 501 is connected to the memory 502 (for example, connected to each other through a bus 504 ). In some examples, the codec device 50 may further include a communication interface 503 connected to the processor 501 and the memory 502 for receiving/sending data.
存储器502可以为随机存储记忆体(Random Access Memory,RAM)、只读存储器(Read-Only Memory,ROM)、可擦除可编程只读存储器(Erasable Programmable Read Only Memory,EPROM)或便携式只读存储器(Compact Disc Read-Only Memory,CD-ROM)。该存储器502用于存储相关程序代码及视频数据。 Memory 502 can be random access memory (Random Access Memory, RAM), read-only memory (Read-Only Memory, ROM), erasable programmable read-only memory (Erasable Programmable Read Only Memory, EPROM) or portable read-only memory (Compact Disc Read-Only Memory, CD-ROM). The memory 502 is used to store related program codes and video data.
处理器501可以是一个或多个中央处理器(Central Processing Unit,CPU),例如图6中所示的CPU 0和CPU 1。在处理器501是一个CPU的情况下,该CPU可以是单核CPU,也可以是多核CPU。The processor 501 may be one or more central processing units (Central Processing Unit, CPU), such as CPU 0 and CPU 1 shown in FIG. 6 . In the case that the processor 501 is a CPU, the CPU may be a single-core CPU or a multi-core CPU.
该处理器501用于读取存储器502中存储的程序代码,以执行图7至图11所对应的任意一个实施方案及其各种可行的实施方式的操作。The processor 501 is configured to read the program codes stored in the memory 502, so as to execute the operations of any one of the implementations corresponding to FIG. 7 to FIG. 11 and various feasible implementations thereof.
以下,结合上述图2示出的视频编解码系统、图3示出的视频编码器202以及图4示出的视频解码器212对本申请提供的编解码方法进行详细描述。Hereinafter, the codec method provided by the present application will be described in detail with reference to the video codec system shown in FIG. 2 , the video encoder 202 shown in FIG. 3 , and the video decoder 212 shown in FIG. 4 .
如图7所示,为本申请提供的一种视频解码方法的流程图。该方法包括步骤S601至步骤S602。As shown in FIG. 7 , it is a flow chart of a video decoding method provided by this application. The method includes step S601 to step S602.
S601、视频解码器对码流进行熵解码和反量化得到反变换单元。S601. The video decoder performs entropy decoding and inverse quantization on the code stream to obtain an inverse transform unit.
S602、视频解码器对反变换单元进行离散小波反变换,得到反变换后的系数。S602. The video decoder performs discrete wavelet inverse transform on the inverse transform unit to obtain inversely transformed coefficients.
离散小波变换,离散小波变换的基本思想是平移和伸缩,经过高通滤波和低通滤波后,将信号在不失原有信息的前提下在尺度和空间上进行分解。小波变换的目的是去除每个子图像内部像素之间的相关性,尽可能地将信息集中到少的变换系数上去,以便接下来的量化步骤有可能将携带信息较少的系数量化成0,降低对重建图像质量的影响。Discrete wavelet transform, the basic idea of discrete wavelet transform is translation and stretching. After high-pass filtering and low-pass filtering, the signal is decomposed in scale and space without losing the original information. The purpose of wavelet transform is to remove the correlation between pixels in each sub-image, and concentrate information on as few transform coefficients as possible, so that the next quantization step may quantize the coefficients carrying less information to 0, reducing the impact on the quality of the reconstructed image.
其中,离散小波变换包括离散小波正变换和离散小波反变换。视频解码器根据视频编码器所采用的变换方法,确定相应的反变换方法。Among them, discrete wavelet transform includes discrete wavelet forward transform and discrete wavelet inverse transform. The video decoder determines the corresponding inverse transform method according to the transform method adopted by the video encoder.
图像块为二维数据阵列,目前二维离散小波变换通常采用行、列分离处理方式,即水平方向与 垂直方向分别进行一维离散小波变换。其中,水平方向和垂直方向的先后次序对结果不影响。The image block is a two-dimensional data array. At present, the two-dimensional discrete wavelet transform usually adopts the row and column separation processing method, that is, the horizontal direction and the vertical direction are respectively subjected to one-dimensional discrete wavelet transform. Wherein, the order of the horizontal direction and the vertical direction has no influence on the result.
在一些实施例中,视频解码器在水平方向和/或垂直方向进行反变换,包括下表1所示的7种离散小波反变换组合。在另一些实施例中,视频编码器在水平方向和/或垂直方向进行变换,以类似与下表1所示的7中组合,即以离散小波变换替换离散小波反变换。In some embodiments, the video decoder performs inverse transformation in the horizontal direction and/or vertical direction, including seven inverse discrete wavelet transform combinations shown in Table 1 below. In some other embodiments, the video encoder performs transformation in the horizontal direction and/or vertical direction, to be combined similarly to 7 shown in Table 1 below, that is, to replace inverse discrete wavelet transform with discrete wavelet transform.
表1Table 1
组合combination 水平方向horizontal direction 垂直方向 vertical direction
11 离散小波反变换Inverse Discrete Wavelet Transform 不进行反变换no inverse transformation
22 不进行反变换no inverse transformation 离散小波反变换Inverse Discrete Wavelet Transform
33 离散小波反变换Inverse Discrete Wavelet Transform DCT2反变换DCT2 inverse transform
44 DCT2反变换DCT2 inverse transform 离散小波反变换Inverse Discrete Wavelet Transform
55 离散小波反变换Inverse Discrete Wavelet Transform DST7反变换DST7 inverse transform
66 DST7反变换DST7 inverse transform 离散小波反变换Inverse Discrete Wavelet Transform
77 离散小波反变换Inverse Discrete Wavelet Transform 离散小波反变换Inverse Discrete Wavelet Transform
以下介绍两种离散小波变换,分别为哈尔(Haar)小波变换和5/3小波变换。Two discrete wavelet transforms are introduced below, namely Haar wavelet transform and 5/3 wavelet transform.
1、Haar小波变换1. Haar wavelet transform
Haar小波变换是低通滤波为[1,1],高通滤波为[-1,1]的离散小波变换。变换步骤为:将待变换数据分成连续的像素对,然后计算相邻像素对的平均值和相邻像素对的差值的一半,将计算的平均值放在变换系数的前半部分,表示低频直流部分,将相邻像素对的差值的一半放在变换系数的后半部分,表示高频细节部分。The Haar wavelet transform is a discrete wavelet transform with a low-pass filter of [1,1] and a high-pass filter of [-1,1]. The transformation steps are as follows: divide the data to be transformed into continuous pixel pairs, then calculate the average value of adjacent pixel pairs and half of the difference between adjacent pixel pairs, and place the calculated average value in the first half of the transformation coefficient, representing low-frequency DC Part, half of the difference between adjacent pixel pairs is placed in the second half of the transform coefficient, indicating the high-frequency detail part.
设原始一维数据a=[a 1,a 2,a 3,a 4],Haar低通滤波[1,1],Haar高通滤波[-1,1],则经Haar小波变换为:
Figure PCTCN2022131167-appb-000001
即依次从数组中取两个数字,计算它们的和以及差,并将和的一半和差的一半依次保存在数组的前半部分和后半部分。
Suppose the original one-dimensional data a=[a 1 ,a 2 ,a 3 ,a 4 ], Haar low-pass filter [1,1], Haar high-pass filter [-1,1], then the Haar wavelet transform is:
Figure PCTCN2022131167-appb-000001
That is to take two numbers from the array in turn, calculate their sum and difference, and save half of the sum and half of the difference in the first half and second half of the array in turn.
在一些示例中,对低频系数部分进行小波变换,进行二级小波分解,得到:
Figure PCTCN2022131167-appb-000002
将c 2,b 3,b 4称为细节(高频)系数,将c 1称为直流(低频)系数。可以理解的是,小波变换层级越高,数据中变化量不大的元素会趋近于零,配合量化能够实现压缩。
In some examples, the wavelet transform is performed on the low-frequency coefficient part, and the second-level wavelet decomposition is performed to obtain:
Figure PCTCN2022131167-appb-000002
c 2 , b 3 , and b 4 are called detail (high frequency) coefficients, and c 1 is called a direct current (low frequency) coefficient. It is understandable that the higher the level of wavelet transform, the elements with little change in the data will approach zero, and the compression can be achieved with quantization.
对一矩阵X做哈尔小波变换的公式为Y=B·X·A T,其中X为一个MxN的块且A和B分别为M点和N点的哈尔小波变换矩阵,而哈尔小波反变换为X=B T·Y·A。 The formula for doing Haar wavelet transform on a matrix X is Y=B·X· AT , where X is an MxN block and A and B are the Haar wavelet transform matrices of M points and N points respectively, and the Haar wavelet Inverse transformation is X=B T · Y · A.
以下为M或N取值为2、4及8的哈尔小波变换矩阵:The following is the Haar wavelet transformation matrix with M or N values of 2, 4 and 8:
Figure PCTCN2022131167-appb-000003
Figure PCTCN2022131167-appb-000003
Figure PCTCN2022131167-appb-000004
Figure PCTCN2022131167-appb-000004
Figure PCTCN2022131167-appb-000005
Figure PCTCN2022131167-appb-000005
此外,当M或N=2 k时的小波变换矩阵为
Figure PCTCN2022131167-appb-000006
其中H除了第0行为
Figure PCTCN2022131167-appb-000007
其中,
Figure PCTCN2022131167-appb-000008
共N个1,第2 p+q行为h p,q且满足:
In addition, when M or N= 2k , the wavelet transform matrix is
Figure PCTCN2022131167-appb-000006
where H except the 0th row
Figure PCTCN2022131167-appb-000007
in,
Figure PCTCN2022131167-appb-000008
There are N 1s in total, the second p + q line is h p, q and satisfies:
Figure PCTCN2022131167-appb-000009
p和q为大于等于零的整数;
Figure PCTCN2022131167-appb-000009
p and q are integers greater than or equal to zero;
Figure PCTCN2022131167-appb-000010
Figure PCTCN2022131167-appb-000010
2、5/3小波变换2. 5/3 wavelet transform
5/3小波变换的高通滤波系数为Y(2n+1),低通滤波系数为Y(2n)。The high-pass filter coefficient of the 5/3 wavelet transform is Y(2n+1), and the low-pass filter coefficient is Y(2n).
Y(2n+1)=-X(2n)/2+X(2n+1)-X(2n+2)/2;Y(2n+1)=-X(2n)/2+X(2n+1)-X(2n+2)/2;
Y(2n)=-X(2n-2)/8+X(2n-1)/4+3*X(2n)/4+X(2n+1)/4-X(2n+2)/8+1/2;Y(2n)=-X(2n-2)/8+X(2n-1)/4+3*X(2n)/4+X(2n+1)/4-X(2n+2)/8 +1/2;
为了避免直接采用上述系数进行变换,所产生的重复计算的过程,Y(2n)可以采用以下方式计算:In order to avoid the process of repeated calculation by directly using the above coefficients for transformation, Y(2n) can be calculated in the following way:
Y(2n)=X(2n)+(Y(2n-1)+Y(2n+1)+2)/4;Y(2n)=X(2n)+(Y(2n-1)+Y(2n+1)+2)/4;
在一些实施例中,通过先计算高通滤波系数,根据高通滤波系数和相应源数据计算低通滤波系数。In some embodiments, by first calculating the high-pass filter coefficients, the low-pass filter coefficients are calculated according to the high-pass filter coefficients and corresponding source data.
如图8所示,假设原始序列为x[0],x[1],……,x[7],序列包含数据的个数为8,其中,当n为0时,计算第一个低通滤波系数时需要用到Y(2n-1),而为了获取Y(2n-1),需要在高通滤波系数的左侧扩展一个数据,为了得到左侧扩展的高通滤波系数,则需要在原始序列的左侧扩展两个 数据。因此,在x[0]左侧扩展两个数据,其中,x[-1]=x[1],x[-2]=x[2]。类似地,当n为3时,计算低通滤波系数,需要用到Y(2n+1),而为了获取Y(2n+1),则需要在原始序列的右侧扩展一个数据。因此,在x[7]右侧扩展一个数据,x[8]=x[6]。根据扩展后的x序列计算高通滤波系数以及低通滤波系数。As shown in Figure 8, assuming that the original sequence is x[0], x[1], ..., x[7], the number of data contained in the sequence is 8, and when n is 0, calculate the first low Y(2n-1) is needed when passing the filter coefficient, and in order to obtain Y(2n-1), it is necessary to expand a data on the left side of the high-pass filter coefficient, in order to obtain the high-pass filter coefficient expanded on the left side, it is necessary to expand in the original The left side of the sequence is extended by two data. Therefore, two data are extended on the left side of x[0], where x[-1]=x[1], x[-2]=x[2]. Similarly, when n is 3, Y(2n+1) needs to be used to calculate the low-pass filter coefficient, and in order to obtain Y(2n+1), it is necessary to extend a data on the right side of the original sequence. Therefore, one data is extended on the right side of x[7], x[8]=x[6]. Calculate the high-pass filter coefficient and the low-pass filter coefficient according to the extended x sequence.
如上述示例,X为经过对称扩展的样本序列。当原始数据的个数是偶数时,根据算法的需要,在数据的左端对称扩展两个数据,在数据序列的右端对称扩展一个数据。当原始数据的个数是奇数时,则应在序列左右各对称扩展两个数据,其中,向左扩展时,x[n]=x[n+2k],向右扩展时,x[n]=x[n-2k],k为大于零的整数,表示扩展的个数。As in the above example, X is a symmetrically expanded sample sequence. When the number of original data is even, according to the needs of the algorithm, two data are symmetrically expanded at the left end of the data, and one data is symmetrically expanded at the right end of the data sequence. When the number of original data is odd, two data should be expanded symmetrically on the left and right sides of the sequence, where, when expanding to the left, x[n]=x[n+2k], and when expanding to the right, x[n] =x[n-2k], k is an integer greater than zero, indicating the number of extensions.
需要说明的是,上述介绍两种离散小波变换方法在一维数据的应用,在二维数据中,可以分别在水平方向和垂直方向进行变换,即基于行、列分别进行计算。其中,行与列的变换顺序不影响变换系数。It should be noted that the two discrete wavelet transform methods introduced above are applied to one-dimensional data. In two-dimensional data, transformations can be performed in the horizontal and vertical directions respectively, that is, calculations are performed based on rows and columns. Wherein, the transformation sequence of rows and columns does not affect the transformation coefficients.
通过应用上述两种离散小波变换方法,通过加法和移位的计算完成变换,降低视频编码的计算复杂度。相应地,减小计算存储负担,降低硬件实现复杂度。By applying the above two discrete wavelet transform methods, the transform is completed through addition and shift calculations, reducing the computational complexity of video coding. Correspondingly, the burden of calculation and storage is reduced, and the complexity of hardware implementation is reduced.
上述表1中的组合1-7中的离散小波反变换可以以哈尔小波反变换和5/3小波反变换中的任意一种替换,如下表2所示。在另一些实施例中,视频编码器在水平方向和/或垂直方向进行变换与表2中的反变换类似,即视频编码器在水平方向和/或垂直方向进行离散小波变换,其可以采用哈尔小波变换、5/3小波变换、DCT2变换、DST7变换或不进行变换中的任意一种。The inverse discrete wavelet transform in combinations 1-7 in Table 1 above can be replaced by any one of inverse Haar wavelet transform and inverse 5/3 wavelet transform, as shown in Table 2 below. In some other embodiments, the video encoder performs transformation in the horizontal direction and/or vertical direction similar to the inverse transformation in Table 2, that is, the video encoder performs discrete wavelet transform in the horizontal direction and/or vertical direction, which can use H Any one of Err wavelet transform, 5/3 wavelet transform, DCT2 transform, DST7 transform or no transform.
表2Table 2
组合combination 水平方向horizontal direction 垂直方向 vertical direction
11 哈尔小波反变换或5/3小波反变换Haar wavelet inverse transform or 5/3 wavelet inverse transform 不进行反变换no inverse transformation
22 不进行反变换no inverse transformation 哈尔小波反变换或5/3小波反变换Haar wavelet inverse transform or 5/3 wavelet inverse transform
33 哈尔小波反变换或5/3小波反变换Haar wavelet inverse transform or 5/3 wavelet inverse transform DCT2反变换DCT2 inverse transform
44 DCT2反变换DCT2 inverse transform 哈尔小波反变换或5/3小波反变换Haar wavelet inverse transform or 5/3 wavelet inverse transform
55 哈尔小波反变换或5/3小波反变换Haar wavelet inverse transform or 5/3 wavelet inverse transform DST7反变换DST7 inverse transform
66 DST7反变换DST7 inverse transform 哈尔小波反变换或5/3小波反变换Haar wavelet inverse transform or 5/3 wavelet inverse transform
77 哈尔小波反变换Inverse Haar wavelet transform 哈尔小波反变换Inverse Haar wavelet transform
88 5/3小波反变换5/3 wavelet inverse transform 5/3小波反变换5/3 wavelet inverse transform
99 哈尔小波反变换Inverse Haar wavelet transform 5/3小波反变换5/3 wavelet inverse transform
1010 5/3小波反变换5/3 wavelet inverse transform 哈尔小波反变换Inverse Haar wavelet transform
其中,表2中的组合1-6均包含两种方式,因此,上表2共包含16种变换方法的组合。Among them, the combinations 1-6 in Table 2 all include two ways, therefore, the above Table 2 contains a total of 16 combinations of transformation methods.
在上述步骤S601-S602中,通过采用离散小波反变换,缩减计算过程中所占用的计算资源,通过根据哈尔小波反变换和5/3小波反变换的平移和伸缩,避免了乘法的计算,有助于在处理较大尺寸数据时,能够减小计算负担。在使用离散小波反变换的基础上,本申请还提出了在水平方向和垂直方向中选择一种进行反变换,通过在一个维度上进行计算,从根本上减少计算复杂度。In the above steps S601-S602, by adopting the discrete wavelet inverse transform, the computing resources occupied in the calculation process are reduced, and the calculation of multiplication is avoided through the translation and stretching according to the Haar wavelet inverse transform and the 5/3 wavelet inverse transform, It helps to reduce the computational burden when dealing with larger size data. On the basis of using discrete wavelet inverse transform, this application also proposes to choose one of horizontal direction and vertical direction for inverse transform, and by performing calculation in one dimension, the computational complexity is fundamentally reduced.
与图7所示的解码侧对应,本申请实施例提供一种编码方法,应用在编码装置中,例如,应用在具有视频编码功能的设备中。如图9所示,该编码方法包括步骤S801至步骤S802。Corresponding to the decoding side shown in FIG. 7 , this embodiment of the present application provides an encoding method, which is applied in an encoding device, for example, in a device having a video encoding function. As shown in FIG. 9, the encoding method includes steps S801 to S802.
S801、视频编码器对变换单元进行离散小波变换,得到变换系数。S801. The video encoder performs discrete wavelet transform on the transform unit to obtain transform coefficients.
其中,视频编码器在水平方向和/或垂直方向进行离散小波变换,包括类似上述表1所示的7种离散小波变换组合。Wherein, the video encoder performs discrete wavelet transform in the horizontal direction and/or vertical direction, including seven discrete wavelet transform combinations similar to those shown in Table 1 above.
在一种示例中,离散小波变换包括哈尔小波变换和5/3小波变换。视频编码器在水平方向和/或垂直方向进行离散小波变换,包括类似上述表2所示的16种离散小波变换组合。In one example, discrete wavelet transform includes Haar wavelet transform and 5/3 wavelet transform. The video encoder performs discrete wavelet transform in the horizontal direction and/or vertical direction, including 16 discrete wavelet transform combinations similar to those shown in Table 2 above.
S802、视频编码器对变换系数进行量化和熵编码,得到码流。S802. The video encoder performs quantization and entropy encoding on the transform coefficients to obtain a code stream.
在上述步骤S801-S802中,通过采用离散小波变换,缩减计算过程中所占用的计算资源,通过根据哈尔小波变换和5/3小波变换的平移和伸缩,避免了乘法的计算,有助于在处理较大尺寸数据时,能够减小计算负担。在使用离散小波变换的基础上,本申请还提出了在水平方向和垂直方向中选择一种进行变换,通过在一个维度上进行计算,从根本上减少计算复杂度。In the above steps S801-S802, by adopting the discrete wavelet transform, the computing resources occupied in the calculation process are reduced, and the calculation of multiplication is avoided through the translation and stretching according to the Haar wavelet transform and the 5/3 wavelet transform, which contributes to When dealing with larger size data, the computational burden can be reduced. On the basis of using discrete wavelet transform, this application also proposes to choose one of the horizontal direction and the vertical direction for transformation, and to fundamentally reduce the computational complexity by performing calculations in one dimension.
如图10所示,为本申请提供的另一种视频解码方法的流程图。该方法包括步骤S901至步骤S902。As shown in FIG. 10 , it is a flowchart of another video decoding method provided by this application. The method includes steps S901 to S902.
S901、视频解码器对码流进行熵解码和反量化得到反变换单元。S901. The video decoder performs entropy decoding and inverse quantization on the code stream to obtain an inverse transform unit.
S902、视频解码器对反变换单元进行第三反变换,得到反变换后的系数;其中,第三反变换包括在水平方向进行反变换和/或在垂直方向进行反变换,水平方向和垂直方向的反变换方法包括DCT2反变换或DST7反变换,水平方向和垂直方向的反变换方法不同。S902. The video decoder performs a third inverse transform on the inverse transform unit to obtain the inversely transformed coefficients; wherein, the third inverse transform includes inverse transform in the horizontal direction and/or inverse transform in the vertical direction, the horizontal direction and the vertical direction The inverse transformation methods include DCT2 inverse transformation or DST7 inverse transformation, and the inverse transformation methods in the horizontal direction and vertical direction are different.
在一些实施例中,视频解码器在水平方向和/或垂直方向进行反变换的第三反变换,包括下表3所示的8种反变换组合:In some embodiments, the video decoder performs the third inverse transformation of inverse transformation in the horizontal direction and/or vertical direction, including 8 kinds of inverse transformation combinations shown in Table 3 below:
表3table 3
组合combination 水平方向horizontal direction 垂直方向 vertical direction
11 DCT2反变换DCT2 inverse transform 不进行反变换no inverse transformation
22 不进行反变换no inverse transformation DCT2反变换DCT2 inverse transform
33 DST7反变换DST7 inverse transform 不进行反变换no inverse transformation
44 不进行反变换no inverse transformation DST7反变换DST7 inverse transform
55 DCT2反变换DCT2 inverse transform DST7反变换DST7 inverse transform
66 DST7反变换DST7 inverse transform DCT2反变换DCT2 inverse transform
77 DCT2反变换DCT2 inverse transform DCT2反变换DCT2 inverse transform
88 DST7反变换DST7 inverse transform DST7反变换DST7 inverse transform
通过上述步骤S901-S902,实现在水平方向和垂直方向进行不同类型的反变换方法,提升视频解码的灵活性。其中,只进行一个方向的变换时,有助于降低计算复杂度,提高压缩性能。Through the above steps S901-S902, different types of inverse transformation methods are implemented in the horizontal direction and vertical direction, and the flexibility of video decoding is improved. Among them, when only one direction of transformation is performed, it helps to reduce computational complexity and improve compression performance.
与图10所示的解码侧对应,本申请实施例提供一种编码方法,应用在编码装置中,例如,应用在具有视频编码功能的设备中。如图11所示,该编码方法包括步骤S1001至步骤S1002。Corresponding to the decoding side shown in FIG. 10 , this embodiment of the present application provides an encoding method, which is applied in an encoding device, for example, in a device having a video encoding function. As shown in FIG. 11 , the encoding method includes steps S1001 to S1002.
S1001、视频编码器对变换单元进行第三变换,得到变换系数;其中,第三变换包括在水平方向进行变换和/或在垂直方向进行变换,水平方向和垂直方向的变换方法包括DCT2变换或DST7变换。S1001. The video encoder performs a third transformation on the transformation unit to obtain transformation coefficients; wherein, the third transformation includes transformation in the horizontal direction and/or transformation in the vertical direction, and the transformation methods in the horizontal direction and the vertical direction include DCT2 transformation or DST7 transform.
在一些实施例中,视频解码器在水平方向和/或垂直方向进行变换的第三变换,包括类似上述表3所示的8种变换组合。In some embodiments, the third transformation performed by the video decoder in the horizontal direction and/or vertical direction includes 8 transformation combinations similar to those shown in Table 3 above.
S1002、视频编码器对变换系数进行量化和熵编码,得到码流。S1002. The video encoder performs quantization and entropy encoding on the transform coefficients to obtain a code stream.
通过上述步骤S1001-S1007,实现在水平方向和垂直方向进行不同类型的变换方法,提升视频编码的灵活性。其中,只进行一个方向的变换时,有助于降低计算复杂度,提高压缩性能。Through the above steps S1001-S1007, different types of transformation methods are implemented in the horizontal direction and vertical direction, and the flexibility of video coding is improved. Among them, when only one direction of transformation is performed, it helps to reduce computational complexity and improve compression performance.
基于上述图7、图9、图10和图11所述的编解码方法,本申请提供以下可能的实施例。Based on the codec methods described above in FIG. 7 , FIG. 9 , FIG. 10 and FIG. 11 , the present application provides the following possible embodiments.
实施例1、视频解码器基于反变换单元的尺寸确定反变换方法。 Embodiment 1. The video decoder determines the inverse transformation method based on the size of the inverse transformation unit.
其中,反变换单元的尺寸可以预设在视频解码器中。假设反变换单元的尺寸为M×N,其中,M表示宽度,N表示高度。M×N可以包括4×1、8×1、16×1、4×2、8×2、16×2、4×4、8×4、16×4、8×8、16×8和16×16中的至少一种,本申请对此不作限制。Wherein, the size of the inverse transformation unit may be preset in the video decoder. Assume that the size of the inverse transform unit is M×N, where M represents the width and N represents the height. M×N can include 4×1, 8×1, 16×1, 4×2, 8×2, 16×2, 4×4, 8×4, 16×4, 8×8, 16×8, and 16 At least one of ×16, which is not limited in this application.
在一种示例中,反变换单元的尺寸根据编码单元CU的尺寸确定。其中,反变换单元的尺寸与编码单元的尺寸相同;或者,反变换单元的宽度为编码单元的宽度的一半,反变换单元的高度与编码单元的高度相同;或者,反变换单元的高度为编码单元的高度的一半,反变换单元的宽度与编码单元的宽度相同。示例性的,若编码单元的尺寸为W×H,其中,W为编码单元的宽度,H为编码单元的高度,则反变换单元的尺寸为w×h,w为反变换单元的宽度,h为反变换单元的高度。其中,w×h可以为W×H,或者w×h为W/2×H,或者w×h为W×H/2,或者w×h为W/2×H/2。其中,W×H可以为4×1、8×1、16×1、4×2、8×2、16×2、4×4、8×4、16×4、8×8、16×8和16×16中的任意一种。In an example, the size of the inverse transform unit is determined according to the size of the coding unit CU. Wherein, the size of the inverse transformation unit is the same as the size of the coding unit; or, the width of the inverse transformation unit is half of the width of the coding unit, and the height of the inverse transformation unit is the same as the height of the coding unit; or, the height of the inverse transformation unit is the coding unit half the height of the unit, and the width of the inverse transform unit is the same as the width of the coding unit. Exemplarily, if the size of the coding unit is W×H, where W is the width of the coding unit, and H is the height of the coding unit, then the size of the inverse transformation unit is w×h, where w is the width of the inverse transformation unit, and h is the height of the inverse transform unit. Wherein, w×h can be W×H, or w×h can be W/2×H, or w×h can be W×H/2, or w×h can be W/2×H/2. Among them, W×H can be 4×1, 8×1, 16×1, 4×2, 8×2, 16×2, 4×4, 8×4, 16×4, 8×8, 16×8 and any one of 16×16.
例如,编码单元的尺寸为16x4,反变换单元尺寸为16x4;或者,编码单元的尺寸为16x4,反变换单元的尺寸为8x4;或者,编码单元的尺寸为16x2,反变换单元的尺寸为16x2;或者,编码单元的尺寸为16x2,反变换单元的尺寸为8x2。For example, the size of the coding unit is 16x4, and the size of the inverse transformation unit is 16x4; or, the size of the coding unit is 16x4, and the size of the inverse transformation unit is 8x4; or, the size of the coding unit is 16x2, and the size of the inverse transformation unit is 16x2; Alternatively, the size of the coding unit is 16x2, and the size of the inverse transform unit is 8x2.
需要说明的是,上述编码单元的尺寸的确定方式可以参考上文图5中过程②。可以理解的是,反变换单元是进行变换的最小数据单元,结合上文图5中过程⑤,反变换单元可以通过将残差块进一步划分得到。It should be noted that, for the determination method of the size of the above coding unit, reference may be made to the process ② in FIG. 5 above. It can be understood that the inverse transformation unit is the smallest data unit for transformation, combined with the process ⑤ in Figure 5 above, the inverse transformation unit can be obtained by further dividing the residual block.
在一种示例中,反变换单元的尺寸与预测单元PU的尺寸相同,预测单元的尺寸为4×1、8×1、16×1、4×2、8×2、16×2、4×4、8×4、16×4、8×8、16×8和16×16中的任意一种。In an example, the size of the inverse transform unit is the same as the size of the prediction unit PU, and the size of the prediction unit is 4×1, 8×1, 16×1, 4×2, 8×2, 16×2, 4× Any one of 4, 8×4, 16×4, 8×8, 16×8 and 16×16.
视频解码器根据反变换单元的尺寸确定反变换方法。当反变换方法包括离散小波反变换时,在一些实施例中,反变换单元的尺寸包括第一尺寸和第二尺寸,基于第一尺寸确定在水平方向进行离散小波反变换,在垂直方向进行离散小波反变换;基于第二尺寸确定在水平方向进行离散小波反变换,在垂直方向进行不进行变换。其中,第一尺寸与第二尺寸可以为上述可选方式中的任意一种,离散小波反变换包括哈尔小波反变换或5/3小波反变换中的任意一种。The video decoder determines the inverse transform method according to the size of the inverse transform unit. When the inverse transform method includes discrete wavelet inverse transform, in some embodiments, the size of the inverse transform unit includes a first size and a second size, and based on the first size, it is determined to perform discrete wavelet inverse transform in the horizontal direction, and to perform discrete wavelet transform in the vertical direction. Inverse wavelet transform: based on the second dimension, discrete wavelet inverse transform is performed in the horizontal direction, and no transformation is performed in the vertical direction. Wherein, the first size and the second size may be any one of the above optional ways, and the inverse discrete wavelet transform includes any one of the inverse Haar wavelet transform or the inverse 5/3 wavelet transform.
需要说明的是,上述第一尺寸、第二尺寸与反变换方法的对应关系仅作为一种示例,离散小波反变换也可以在垂直方向进行,水平方向不进行反变换。It should be noted that the above correspondence between the first size, the second size and the inverse transformation method is only an example, and the discrete wavelet inverse transformation can also be performed in the vertical direction, and the inverse transformation is not performed in the horizontal direction.
当变换方法包括DCT2变换和DST7变换时,类似地,当反变换方法包括DCT2反变换和DST7 反变换时,在一些实施例中,反变换单元的尺寸包括第三尺寸、第四尺寸、第五尺寸和第六尺寸。基于第三尺寸确定反变换单元在水平方向进行DCT2反变换或DST7反变换,在垂直方向不进行反变换;基于第四尺寸确定反变换单元在水平方向不进行反变换,在垂直方向进行DCT2反变换或DST7反变换;基于第五尺寸确定反变换单元在水平方向进行DCT2反变换,在垂直方向进行DST7反变换;基于第六尺寸确定反变换单元在水平方向进行DST7反变换,在垂直方向进行DCT2反变换。When the transform method includes DCT2 transform and DST7 transform, similarly, when the inverse transform method includes DCT2 inverse transform and DST7 inverse transform, in some embodiments, the size of the inverse transform unit includes the third size, the fourth size, the fifth size size and sixth size. Determine the inverse transformation unit based on the third size to perform DCT2 inverse transformation or DST7 inverse transformation in the horizontal direction, and not perform inverse transformation in the vertical direction; determine the inverse transformation unit based on the fourth size without performing inverse transformation in the horizontal direction, and perform DCT2 inverse transformation in the vertical direction Transformation or DST7 inverse transformation; determine the inverse transformation unit based on the fifth size to perform DCT2 inverse transformation in the horizontal direction, and perform DST7 inverse transformation in the vertical direction; determine the inverse transformation unit based on the sixth size to perform DST7 inverse transformation in the horizontal direction, and perform DST7 inverse transformation in the vertical direction DCT2 inverse transform.
需要说明的是,反变换方法还可以包括离散小波反变换、DCT2反变换和DST7反变换的不同组合方式,例如,在水平方向进行离散小波反变换,在垂直方向进行DCT2反变换或DST7反变换等等。It should be noted that the inverse transform method can also include different combinations of discrete wavelet inverse transform, DCT2 inverse transform and DST7 inverse transform, for example, discrete wavelet inverse transform in the horizontal direction, DCT2 inverse transform or DST7 inverse transform in the vertical direction etc.
通过上述示例,视频解码器确定反变换单元的尺寸,基于反变换单元的尺寸确定反变换方法,其中针对反变换单元的尺寸的宽度和高度可以对应不同的反变换方法,有助于降低计算复杂度,提高压缩性能。Through the above example, the video decoder determines the size of the inverse transformation unit, and determines the inverse transformation method based on the size of the inverse transformation unit, wherein the width and height of the size of the inverse transformation unit can correspond to different inverse transformation methods, which helps to reduce computational complexity to improve compression performance.
需要说明的是,在编码侧,根据变换单元的尺寸确定变换方法的方式与根据反变换单元的尺寸确定反变换方法的方式相同,此处不再赘述。It should be noted that, on the encoding side, the manner of determining the transformation method according to the size of the transformation unit is the same as the manner of determining the inverse transformation method according to the size of the inverse transformation unit, which will not be repeated here.
需要说明的是,当变换单元的尺寸与编码单元和预测单元的尺寸相关时,编码单元和预测单元的尺寸为4×1、8×1、16×1、4×2、8×2、16×2、4×4、8×4、16×4、8×8、16×8和16×16中的任意一种。通过上述针对编码单元和预测单元尺寸的限定,即针对视频编解码技术中进行行缓存时硬件所需的高度进行限定,有助于降低硬件实现复杂度。It should be noted that when the size of the transformation unit is related to the size of the coding unit and the prediction unit, the size of the coding unit and the prediction unit is 4×1, 8×1, 16×1, 4×2, 8×2, 16 Any one of ×2, 4×4, 8×4, 16×4, 8×8, 16×8 and 16×16. The above-mentioned limitation on the size of the coding unit and the prediction unit, that is, the limitation on the height required by the hardware when line buffering is performed in the video coding and decoding technology, helps to reduce the complexity of hardware implementation.
实施例2、视频解码器基于码流中的变换方法标识位确定反变换方法。 Embodiment 2, the video decoder determines the inverse transformation method based on the transformation method identification bit in the code stream.
其中,变换方法标识位用于指示变换单元的变换方法,对于视频解码器而言,该变换方法为视频解码器对反变换单元进行反变换所采用的方法。Wherein, the transformation method identification bit is used to indicate the transformation method of the transformation unit. For the video decoder, the transformation method is the method used by the video decoder to perform inverse transformation on the inverse transformation unit.
如下表4所示,为变换方法标识位的一种示例性的定义方式:As shown in Table 4 below, it is an exemplary definition of the transformation method identification bit:
表4Table 4
Figure PCTCN2022131167-appb-000011
Figure PCTCN2022131167-appb-000011
需要说明的是,表4所示的变换方法标识位能够表示在水平方向和/或垂直方向进行离散小波变换的几种示例性实现方法,除此之外还包括在水平方向或垂直方向进行离散小波变换,在另一个方向进行DCT2变换或DST7变换,该多个变换方法标识位可以参照表4的方式增加或减少标识位,从而扩大或减少标识位指示变换方法的数量。本申请对此不作限制。It should be noted that the transformation method identification bits shown in Table 4 can represent several exemplary implementation methods of discrete wavelet transform in the horizontal direction and/or vertical direction, and also include discrete wavelet transform in the horizontal direction or vertical direction. For wavelet transform, DCT2 transform or DST7 transform is performed in another direction, and the identification bits of the multiple transformation methods can be increased or decreased by referring to the manner in Table 4, thereby expanding or reducing the number of transformation methods indicated by the identification bits. This application is not limited to this.
如下表5所示,为变换方法标识位的另一种示例性的定义方式:As shown in Table 5 below, it is another exemplary definition of the transformation method identification bit:
表5table 5
变换方法标识位transform method flag 0(00)0(00) 1(01)1(01) 2(10)2(10) 3(11)3(11)
水平方向horizontal direction DCT2变换DCT2 transform DST7变换DST7 transformation \\ \\
垂直方向vertical direction \\ \\ DCT2变换DCT2 transform DST7变换DST7 transformation
需要说明的是,表5所示的变换方法标识位仅作为示例,可以增加或减少标识位,以及不同标识位对应的变换方法,本申请对此不作限制。It should be noted that the identification bits of the conversion method shown in Table 5 are only examples, and the identification bits can be increased or decreased, and the conversion methods corresponding to different identification bits are not limited in this application.
在一种示例中,视频解码器中预设两种变换方法,变换方法标识位用于标识两种变换方法。如下表6所示,为变换方法标识位的另一种示例性的定义方式:In an example, two transformation methods are preset in the video decoder, and the transformation method identification bits are used to identify the two transformation methods. As shown in Table 6 below, it is another exemplary definition of the transformation method identification bit:
表6Table 6
变换方法标识位transform method flag 0(0)0(0) 1(1)1(1)
水平方向 horizontal direction 5/3小波变换5/3 wavelet transform 哈尔小波变换Haar wavelet transform
垂直方向 vertical direction 5/3小波变换5/3 wavelet transform 哈尔小波变换Haar wavelet transform
其中,变换方法标识位所标识的变换方法,可以在视频编码阶段,由视频编码器基于率失真(Rate-Distortion Optimized,RDO)代价确定。率失真代价可以用来衡量变换方法的性能,例如可通过以下公式进行计算:J(mode)=D+λ×R;其中,J(mode)表示不同模式的率失真代价,D为量化失真,由重构建的视频与原图像差值均方和表示,λ为拉格朗日乘子,R为当前模式编码所需的实际比特数。如图3所示,重建块一部分来自于经反量化与反变换的残差块,因此,重建块能够体现反变换的变换方法所带来的影响。率失真代价越大,表示该编码模式中采用的变换方法性能越差,则视频编码器可以选择性能较好的变换方法,以确定对应的变换方法标识位。例如,上述表6 示出的两种方法针对同一尺寸的变换单元进行变换,经计算确定采用5/3小波变换方法的率失真代价较小,则变换方法标识位为0。Wherein, the transformation method identified by the transformation method identification bit may be determined by a video encoder based on a Rate-Distortion Optimized (RDO) cost in the video coding stage. The rate-distortion cost can be used to measure the performance of the transformation method, for example, it can be calculated by the following formula: J(mode)=D+λ×R; wherein, J(mode) represents the rate-distortion cost of different modes, D is the quantization distortion, It is represented by the mean square sum of the difference between the reconstructed video and the original image, λ is the Lagrangian multiplier, and R is the actual number of bits required for encoding in the current mode. As shown in FIG. 3 , part of the reconstructed block comes from the inversely quantized and inversely transformed residual block. Therefore, the reconstructed block can reflect the influence of the inversely transformed transformation method. The greater the rate-distortion cost, the worse the performance of the transformation method used in the encoding mode, and the video encoder can select a transformation method with better performance to determine the corresponding transformation method identification bit. For example, the two methods shown in Table 6 above perform transformation on transformation units of the same size, and it is determined through calculation that the rate-distortion cost of the 5/3 wavelet transformation method is relatively small, and the transformation method identification bit is 0.
在一种示例中,经过上述率失真代价的计算,性能较好的变换方法通过隐式导出的方式来表示。仍以上述示例为例,用于表示率失真代价较低的变换方法标识位通过变换系数的个数的奇偶性导出。示例性的,变换系数个数为偶数时,导出变换方法标识位,该变换方法标识位包括0和1,分别用于指示表6所示的两种变换方法的组合。In an example, after the calculation of the above-mentioned rate-distortion cost, the transformation method with better performance is represented by implicit derivation. Still taking the above-mentioned example as an example, the identification bit used to indicate the transform method with a lower rate-distortion cost is derived from the parity of the number of transform coefficients. Exemplarily, when the number of transformation coefficients is an even number, the transformation method identification bit is derived, and the transformation method identification bit includes 0 and 1, respectively used to indicate the combination of the two transformation methods shown in Table 6.
需要说明的是,表6所示的方法也可以为上述表2和表3中的任意两种组合,本申请对此不作限制。It should be noted that the method shown in Table 6 may also be any combination of any two of the above-mentioned Table 2 and Table 3, which is not limited in the present application.
通过上述示例,视频解码器基于变换方法标识位确定变换方法,其中变换方法标识位包括标识预设的任意一种方法的组合,或仅标识性能较好的一种变换方法,该种标识方式能够节约码流中占用的标识位,同时提升压缩性能。Through the above example, the video decoder determines the transformation method based on the transformation method identification bit, wherein the transformation method identification bit includes a combination of any preset methods, or only identifies a transformation method with better performance. This identification method can It saves the identification bits occupied in the code stream and improves the compression performance at the same time.
需要说明的是,在编码侧,视频编码器将变换方法以变换方法标识位在码流中表示,其中变换方法标识位所指示的变换方法与上述解码侧的确定反变换方法相同,此处不再赘述。It should be noted that, on the encoding side, the video encoder indicates the transformation method in the code stream with the transformation method identification bit, where the transformation method indicated by the transformation method identification bit is the same as the above-mentioned definite inverse transformation method on the decoding side, which is not mentioned here. Let me repeat.
实施例3、视频解码器基于码流中的预测模式标识位确定反变换方法。 Embodiment 3, the video decoder determines the inverse transformation method based on the prediction mode identification bit in the code stream.
其中,预测模式标识位用于指示反变换单元进行变换前,预测单元进行预测的预测模式,其中,预测模式包括DC预测模式、角度预测模式、Planar预测模式和块拷贝模式,角度预测模式包括水平预测模式、垂直预测模式和对角预测模式。Wherein, the prediction mode identification bit is used to indicate the prediction mode of the prediction unit for prediction before the inverse transformation unit performs transformation, wherein, the prediction mode includes DC prediction mode, angle prediction mode, Planar prediction mode and block copy mode, and the angle prediction mode includes horizontal prediction mode, vertical prediction mode and diagonal prediction mode.
如下表7所示,为预测模式标识位的一种示例性的定义方式:As shown in Table 7 below, it is an exemplary definition of the prediction mode identification bit:
表7Table 7
预测模式标识位prediction mode flag 0(00)0(00) 1(01)1(01) 2(10)2(10) 3(11)3(11)
预测模式predictive model 垂直预测模式vertical prediction mode DC预测模式DC prediction mode Planar预测模式Planar prediction model 块拷贝模式block copy mode
需要说明的是,预测模式包括多种,以上作为示例仅示出4种,其中包括角度预测模式中的垂直预测模式、DC预测模式、Planar预测模式和块拷贝模式。预测模式标识位还可以包括更多或更少的预测模式,本申请对此不作限制。It should be noted that there are multiple prediction modes, and only four are shown above as examples, including vertical prediction mode, DC prediction mode, Planar prediction mode and block copy mode in angle prediction modes. The prediction mode identification bit may also include more or less prediction modes, which is not limited in the present application.
在一些实施例中,视频解码器根据上述预测模式标识位确定预测模式的同时,确定该预测模式对应的反变换方法。如下表8所示,预测模式与反变换方法的一种示例性的对应关系:In some embodiments, the video decoder determines the prediction mode according to the above-mentioned prediction mode identification bit, and at the same time determines the inverse transformation method corresponding to the prediction mode. As shown in Table 8 below, an exemplary correspondence between the prediction mode and the inverse transformation method:
表8Table 8
预测模式predictive model 垂直预测模式vertical prediction mode DC预测模式DC prediction mode Planar预测模式Planar prediction mode 块拷贝模式block copy mode
水平方向horizontal direction 哈尔小波反变换Inverse Haar wavelet transform 5/3小波反变换5/3 wavelet inverse transform DCT2反变换DCT2 inverse transform DST7反变换DST7 inverse transform
垂直方向 vertical direction 5/3小波反变换5/3 wavelet inverse transform 哈尔小波反变换Inverse Haar wavelet transform \\ \\
在一种示例中,当预测模式为块拷贝模式时,经过预测得到的残差块不进行反变换,将残差块直接进行反量化。In an example, when the prediction mode is the block copy mode, the predicted residual block is not subjected to inverse transformation, and the residual block is directly dequantized.
需要说明的是,表8中所示的预测模式与反变换方法的对应关系仅作为示例,还可以包含更多或更少的对应关系。其中,预测模式与反变换方法的对应关系可以预设在视频解码器中,或者,与视频编码器进行通信获取,本申请对此不作限制。It should be noted that the correspondence between prediction modes and inverse transformation methods shown in Table 8 is only an example, and more or less correspondences may be included. Wherein, the corresponding relationship between the prediction mode and the inverse transformation method may be preset in the video decoder, or may be acquired through communication with the video encoder, which is not limited in the present application.
在一种示例中,预测模式与反变换方法具有对应关系时,还可以与量化方法建立对应关系。例如,上述表8中垂直预测模式对应的反变换方法为在水平方向进行哈尔小波反变换,在垂直方向进行5/3小波变反换,则量化采用的方法为标量量化。视频解码器获取预测模式标识位时,还可以确定反量化的方法。In an example, when the prediction mode has a corresponding relationship with the inverse transform method, it may also establish a corresponding relationship with the quantization method. For example, the inverse transformation method corresponding to the vertical prediction mode in Table 8 above is to perform inverse Haar wavelet transformation in the horizontal direction, and to perform 5/3 wavelet transformation inversion in the vertical direction, then the method used for quantization is scalar quantization. When the video decoder obtains the prediction mode identification bit, it can also determine the dequantization method.
通过上述示例,视频解码器基于预测模式标识位确定反变换方法,其中预测模式标识位用于标识一种或多种预测模式,根据预测模式确定反变换方法,该种标识方式有助于节约码流中占用的标识位,同时根据不同预测模式的残差,基于不同变换方法对残差处理的性能,建立最优的对应关系,有助于提升压缩性能。Through the above example, the video decoder determines the inverse transformation method based on the prediction mode identification bit, wherein the prediction mode identification bit is used to identify one or more prediction modes, and the inverse transformation method is determined according to the prediction mode. This identification method helps to save code The identification bits occupied in the stream, and based on the residuals of different prediction modes, based on the performance of different transformation methods for residual processing, establish the optimal corresponding relationship, which helps to improve compression performance.
需要说明的是,在编码侧,视频编码器将预测模式以预测模式标识位在码流中表示,其中预测模式标识位所指示的预测模式,以及其对应的变换方法与上述解码侧的确定方式相同或类似,此处不再赘述。It should be noted that on the encoding side, the video encoder represents the prediction mode in the code stream with the prediction mode identification bit, where the prediction mode indicated by the prediction mode identification bit and its corresponding transformation method are the same as the above-mentioned determination method on the decoding side The same or similar, will not be repeated here.
实施例4、视频解码器基于亮度和色度对反变换单元进行反变换。 Embodiment 4, the video decoder performs inverse transformation on the inverse transformation unit based on luma and chrominance.
在一些实施例中,反变换单元进行反变换时基于亮度变换单元和色度变换单元分别进行计算。亮度变换单元和色度变换单元是指根据采样格式得到基于亮度和色度的编码单元,根据编码单元的尺寸确定反变换单元的尺寸,其中,该反变换单元包括亮度变换单元和色度变换单元。示例性的,如前文所述视频采样中的示例,在420采样格式下,亮度编码单元为:In some embodiments, when the inverse transformation unit performs inverse transformation, calculations are performed based on the luma transformation unit and the chrominance transformation unit respectively. The luma transformation unit and the chroma transformation unit refer to the coding unit based on brightness and chroma obtained according to the sampling format, and the size of the inverse transformation unit is determined according to the size of the coding unit, wherein the inverse transformation unit includes a luma transformation unit and a chroma transformation unit . Exemplarily, as the example in the video sampling mentioned above, in the 420 sampling format, the luminance coding unit is:
[Y0][Y1][Y2][Y3];[Y0][Y1][Y2][Y3];
[Y4][Y5][Y6][Y7];[Y4][Y5][Y6][Y7];
色度编码单元为:The chroma coding units are:
[U0][U2];[U0][U2];
[V4][V6];[V4][V6];
当编码单元的尺寸与反变换单元的尺寸相同时,亮度变换单元与亮度编码单元相同,色度变换单元与色度编码单元相同。When the size of the CU is the same as that of the inverse TU, the luma TU is the same as the luma CU, and the chroma TU is the same as the chroma CU.
视频解码器基于亮度变换单元和色度变换单元对反变换单元进行反变换,包括视频解码器对亮度变换单元在水平方向和/或垂直方向进行反变换,对色度变换单元在水平方向和/或垂直方向进行反变换。其中,在水平方向和/或垂直方向的反变换方法的组合可以为上述表2和表3中的任意一种。The video decoder performs inverse transformation on the inverse transformation unit based on the luma transformation unit and the chroma transformation unit, including that the video decoder performs inverse transformation on the luma transformation unit in the horizontal direction and/or vertical direction, and performs inverse transformation on the chroma transformation unit in the horizontal direction and/or Or reverse transformation in the vertical direction. Wherein, the combination of inverse transformation methods in the horizontal direction and/or vertical direction may be any one in Table 2 and Table 3 above.
在一种示例中,视频解码器基于采样格式确定变换方法。如下表9所示,采样格式与反变换方法的一种示例性的对应关系:In one example, the video decoder determines the transformation method based on the sampling format. As shown in Table 9 below, an exemplary correspondence between the sampling format and the inverse transformation method:
表9Table 9
采样格式sampling format 444444 420420
亮度变换单元水平方向Brightness transformation unit horizontal direction 进行反变换inverse transformation 进行反变换inverse transformation
亮度变换单元垂直方向Brightness Transformation Unit Vertical Direction 进行反变换inverse transformation 进行反变换inverse transformation
色度变换单元水平方向Chroma Transformation Unit Horizontal Direction 进行反变换inverse transformation 进行反变换inverse transformation
色度变换单元垂直方向Chroma Transformation Unit Vertical Direction 进行反变换inverse transformation 不进行反变换no inverse transformation
如表9所示,当采用444采样格式时,对亮度变换单元和色度变换单元在水平方向和垂直方向均进行反变换;当采用420采样格式时,对亮度变换单元在水平方向和垂直方向进行反变换,对色度变换单元仅在水平方向进行反变换。其中,上述对亮度变换单元和色度变换单元采用的变换方法可以为上述表2和表3中的任意一种组合。As shown in Table 9, when the 444 sampling format is used, the inverse transformation is performed on both the luminance transformation unit and the chroma transformation unit in the horizontal and vertical directions; Inverse transformation is performed, and the chroma transformation unit is only inversely transformed in the horizontal direction. Wherein, the above-mentioned transformation method adopted for the luma transformation unit and the chroma transformation unit may be any combination in Table 2 and Table 3 above.
在一种示例中,视频解码器基于亮度变换单元和色度变换单元的尺寸确定变换方法。如下表10所示,亮度变换单元和色度变换单元的尺寸与变换方法的一种示例性的对应关系:In one example, the video decoder determines the transform method based on the size of the luma transform unit and the chroma transform unit. As shown in Table 10 below, an exemplary correspondence between the size of the luma transformation unit and the chroma transformation unit and the transformation method:
表10Table 10
亮度变换单元的尺寸The size of the luma transform unit 16×216×2 16×216×2
色度变换单元的尺寸The size of the chroma transform unit 16×216×2 8×18×1
亮度变换单元水平方向Brightness transformation unit horizontal direction 进行反变换inverse transformation 进行反变换inverse transformation
亮度变换单元垂直方向Brightness Transformation Unit Vertical Direction 进行反变换inverse transformation 进行反变换inverse transformation
色度变换单元水平方向Chroma Transformation Unit Horizontal Direction 进行反变换inverse transformation 进行反变换inverse transformation
色度变换单元垂直方向Chroma Transformation Unit Vertical Direction 进行反变换inverse transformation 不进行反变换no inverse transformation
如表10所示,亮度变换单元的尺寸与色度变换单元的尺寸相同,对亮度变换单元和色度变换单元在水平方向和垂直方向均进行反变换;或者,对亮度变换单元在水平方向和垂直方向进行反变换,当色度变换单元的高度为1时,对色度变换单元仅在水平方向进行反变换。其中,上述对亮度变换单元和色度变换单元采用的变换方法可以为上述表2和表3中的任意一种组合。As shown in Table 10, the size of the luma transform unit is the same as that of the chroma transform unit, and inverse transformation is performed on both the luma transform unit and the chroma transform unit in the horizontal direction and the vertical direction; or, the luma transform unit is transformed in the horizontal direction and The inverse transformation is performed in the vertical direction. When the height of the chroma transformation unit is 1, the inverse transformation is only performed on the chroma transformation unit in the horizontal direction. Wherein, the above-mentioned transformation method adopted for the luma transformation unit and the chroma transformation unit may be any combination in Table 2 and Table 3 above.
需要说明的是,上述表9和表10仅作为一种示例,不同采样格式可以对应不同的反变换方法或互逆的变换方法,不同的亮度变换单元与色度变换单元的尺寸对应不同的反变换方法或互逆的变换方法,本申请对此不作限制。It should be noted that the above Table 9 and Table 10 are only examples. Different sampling formats can correspond to different inverse transformation methods or reciprocal transformation methods. Different sizes of luma transformation units and chroma transformation units correspond to different inverse transformation methods. The transformation method or the reciprocal transformation method is not limited in this application.
需要说明的是,在编码侧,视频编码器基于亮度和色度对变换单元进行变换,其中亮度变换单元和色度变换单元的确定方式在采样时确定,在水平方向和/或垂直方向分别对亮度变换单元和色度变换单元进行变换的方法与上述解码侧的方法相同或类似,此处不再赘述。It should be noted that on the encoding side, the video encoder transforms the transform unit based on luma and chroma, where the luma transform unit and the chroma transform unit are determined during sampling, and the horizontal and/or vertical directions are respectively The method of performing transformation by the luma transformation unit and the chrominance transformation unit is the same as or similar to the above-mentioned method on the decoding side, and will not be repeated here.
实施例5、视频解码器基于码流中的离散小波变换分解层数。 Embodiment 5, the video decoder decomposes the number of layers based on the discrete wavelet transform in the code stream.
在一些实施例中,视频解码器得到的包括图像数据的码流包括序列参数集(Sequence Parameter Set,SPS)、图像参数集(Picture Parameter Set,PPS)以及条带头(slice header)或条带片段头(slice segment header)等语法元素。其中,序列参数集中包括离散小波变换分解层数。视频解码器根据离散小波变换分解层数进行离散小波变换。例如,垂直方向离散小波变换分解层数为L,则将反变换单元在垂直方向进行L层小波垂直分解。其中,反变换单元的高度为N,2L≤N。该离散小波变换分解层数适用于哈尔小波变换和5/3小波变换。In some embodiments, the code stream including image data obtained by the video decoder includes a sequence parameter set (Sequence Parameter Set, SPS), a picture parameter set (Picture Parameter Set, PPS) and a slice header (slice header) or a slice segment Header (slice segment header) and other syntax elements. Wherein, the sequence parameter set includes discrete wavelet transform decomposition layers. The video decoder performs discrete wavelet transform according to discrete wavelet transform decomposition layers. For example, if the number of discrete wavelet transform decomposition layers in the vertical direction is L, then the inverse transform unit performs vertical wavelet decomposition of L layers in the vertical direction. Wherein, the height of the inverse transformation unit is N, and 2L≤N. The number of discrete wavelet transform decomposition layers is suitable for Haar wavelet transform and 5/3 wavelet transform.
需要说明的是,在编码侧,视频编码器按照预设的离散小波变换分解层数进行变换,将该分解层数写入序列参数集中,发送至视频解码器用于解码,离散小波变换分解层数的相关描述请参考上文,此处不再赘述。It should be noted that on the encoding side, the video encoder transforms according to the preset discrete wavelet transform decomposition layers, writes the decomposition layers into the sequence parameter set, and sends them to the video decoder for decoding. The discrete wavelet transform decomposition layers For related descriptions, please refer to the above, and will not repeat them here.
需要说明的是,上述实施例可应用在步骤S601-S602、S801-S802、S901-S902以及S1001-S1002中。视频编码器基于变换单元进行变换的具体实现方式与上述解码侧的实施例为互逆的编码流程,不再重复描述。It should be noted that the above embodiment can be applied in steps S601-S602, S801-S802, S901-S902 and S1001-S1002. The specific implementation manner for the video encoder to perform transformation based on the transformation unit is a reciprocal coding process with the above-mentioned embodiment on the decoding side, and the description will not be repeated.
本申请实施例提供一种解码装置,该解码装置可以为视频解码器。解码装置用于执行以上解码 方法中的视频解码器所执行的步骤。本申请实施例提供的解码装置可以包括相应步骤所对应的模块。An embodiment of the present application provides a decoding device, and the decoding device may be a video decoder. The decoding device is used to perform the steps performed by the video decoder in the above decoding method. The decoding device provided in the embodiment of the present application may include modules corresponding to corresponding steps.
本申请实施例可以根据上述方法示例对解码装置进行功能模块的划分,例如,可以对应各个功能划分各个功能模块,也可以将两个或两个以上的功能集成在一个处理模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。本申请实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。In the embodiment of the present application, the functional modules of the decoding device may be divided according to the above method examples. For example, each functional module may be divided corresponding to each function, or two or more functions may be integrated into one processing module. The above-mentioned integrated modules can be implemented in the form of hardware or in the form of software function modules. The division of modules in the embodiment of the present application is schematic, and is only a logical function division, and there may be other division methods in actual implementation.
在采用对应各个功能划分各个功能模块的情况下,图12示出上述实施例中所涉及的解码装置的一种可能的结构示意图。如图12所示,解码装置110包括解码模块1101、反变换模块1102和存储模块1103。In the case of dividing each functional module corresponding to each function, FIG. 12 shows a possible structural diagram of the decoding device involved in the above embodiment. As shown in FIG. 12 , the decoding device 110 includes a decoding module 1101 , an inverse transformation module 1102 and a storage module 1103 .
解码模块1101,用于对码流进行熵解码和反量化得到反变换单元,例如上述步骤S601。The decoding module 1101 is configured to perform entropy decoding and inverse quantization on the code stream to obtain an inverse transformation unit, such as the above step S601.
反变换模块1102,用于对反变换单元进行离散小波反变换,得到反变换后的系数,例如上述步骤S602。The inverse transform module 1102 is configured to perform discrete wavelet inverse transform on the inverse transform unit to obtain inversely transformed coefficients, such as the above step S602.
在一种示例中,反变换模块1102,用于对所述反变换单元在水平方向进行离散小波反变换,在垂直方向进行离散小波反变换、DCT2反变换、DST7反变换以及不进行反变换中的任意一种;或者,对所述反变换单元在水平方向进行DCT2反变换、DST7反变换以及不进行反变换中的任意一种,在垂直方向进行离散小波反变换。In one example, the inverse transform module 1102 is configured to perform discrete wavelet inverse transform on the inverse transform unit in the horizontal direction, and perform discrete wavelet inverse transform, DCT2 inverse transform, DST7 inverse transform and no inverse transform in the vertical direction or, perform any one of DCT2 inverse transform, DST7 inverse transform, and no inverse transform on the inverse transform unit in the horizontal direction, and perform discrete wavelet inverse transform in the vertical direction.
在一种示例中,离散小波反变换包括哈尔小波反变换和5/3小波反变换,反变换模块1102,用于对所述反变换单元在水平方向进行哈尔小波反变换,在垂直方向进行哈尔小波反变换、5/3小波反变换、DCT2反变换、DST7反变换以及不进行反变换中的任意一种;或者,对所述反变换单元在水平方向进行5/3小波反变换,在垂直方向进行哈尔小波反变换、5/3小波反变换、DCT2反变换、DST7反变换以及不进行反变换中的任意一种;或者,对所述反变换单元在水平方向进行DCT2反变换、DST7反变换以及不进行反变换中的任意一种,在垂直方向进行哈尔小波反变换;或者,对所述反变换单元在水平方向进行DCT2反变换、DST7反变换以及不进行反变换中的任意一种,在垂直方向进行5/3小波反变换。In one example, the inverse discrete wavelet transform includes inverse Haar wavelet transform and inverse 5/3 wavelet transform, and the inverse transform module 1102 is used to perform inverse Haar wavelet transform on the inverse transform unit in the horizontal direction, and in the vertical direction Perform any one of Haar wavelet inverse transformation, 5/3 wavelet inverse transformation, DCT2 inverse transformation, DST7 inverse transformation and no inverse transformation; or, perform 5/3 wavelet inverse transformation on the inverse transformation unit in the horizontal direction , performing any one of Haar wavelet inverse transformation, 5/3 wavelet inverse transformation, DCT2 inverse transformation, DST7 inverse transformation and no inverse transformation in the vertical direction; or, performing DCT2 inverse transformation on the inverse transformation unit in the horizontal direction transformation, DST7 inverse transformation and no inverse transformation, carry out Haar wavelet inverse transformation in the vertical direction; or, perform DCT2 inverse transformation, DST7 inverse transformation and no inverse transformation on the inverse transformation unit in the horizontal direction In any one of them, the 5/3 wavelet inverse transform is performed in the vertical direction.
在一种示例中,反变换单元的尺寸与编码单元的尺寸相同;或者,所述反变换单元的宽度为编码单元的宽度的一半,所述反变换单元的高度与所述编码单元的高度相同;或者,所述反变换单元的高度为编码单元的高度的一半,所述反变换单元的宽度与所述编码单元的宽度相同。In an example, the size of the inverse transformation unit is the same as the size of the coding unit; or, the width of the inverse transformation unit is half of the width of the coding unit, and the height of the inverse transformation unit is the same as the height of the coding unit ; or, the height of the inverse transformation unit is half of the height of the coding unit, and the width of the inverse transformation unit is the same as the width of the coding unit.
在一种示例中,反变换模块1102,用于基于反变换单元的尺寸,确定对所述反变换单元在水平方向进行第一反变换,在垂直方向进行第二反变换;其中,第一变换和第二变换中的至少一种为离散小波反变换。In an example, the inverse transformation module 1102 is configured to determine, based on the size of the inverse transformation unit, to perform the first inverse transformation on the inverse transformation unit in the horizontal direction, and to perform the second inverse transformation in the vertical direction; wherein, the first transformation and at least one of the second transform is an inverse discrete wavelet transform.
在一种示例中,反变换单元的尺寸包括第一尺寸和第二尺寸,反变换模块1102,用于基于第一尺寸,确定对所述反变换单元在水平方向进行离散小波反变换,在垂直方向进行离散小波反变换;基于第二尺寸,确定对所述反变换单元在水平方向进行离散小波反变换,在垂直方向不进行反变换。In one example, the size of the inverse transform unit includes a first size and a second size, and the inverse transform module 1102 is configured to determine to perform discrete wavelet inverse transform on the inverse transform unit in the horizontal direction and vertically Inverse discrete wavelet transform is performed in the direction; based on the second size, it is determined that the inverse transform unit performs inverse discrete wavelet transform in the horizontal direction, and does not perform inverse transform in the vertical direction.
在一种示例中,解码模块1101,用于获取所述码流中的变换方法标识位,所述变换方法标识位用于指示反变换单元的反变换方法,所述反变换方法包括在水平方向和/或垂直方向进行离散小波反变换。In one example, the decoding module 1101 is configured to obtain the transformation method identification bit in the code stream, the transformation method identification bit is used to indicate the inverse transformation method of the inverse transformation unit, and the inverse transformation method includes and/or inverse discrete wavelet transform in the vertical direction.
在一种示例中,解码模块1101,用于获取所述码流中的预测模式标识位,所述预测模式标识位用于指示所述反变换单元进行反变换前,预测单元进行预测的预测模式,预测模式包括第一预测模式和第二预测模式;基于第一预测模式,确定对所述反变换单元在水平方向进行离散小波反变换,在垂直方向进行离散小波反变换、DCT2反变换、DST7反变换以及不进行反变换中的任意一种;基于第二预测模式,确定对所述反变换单元在水平方向进行DCT2反变换、DST7反变换以及不进行反变换中的任意一种,在垂直方向进行离散小波反变换。In an example, the decoding module 1101 is configured to obtain a prediction mode identification bit in the code stream, and the prediction mode identification bit is used to indicate the prediction mode of the prediction unit for prediction before the inverse transformation unit performs inverse transformation , the prediction mode includes a first prediction mode and a second prediction mode; based on the first prediction mode, it is determined to perform discrete wavelet inverse transform on the inverse transform unit in the horizontal direction, and perform discrete wavelet inverse transform, DCT2 inverse transform, DST7 in the vertical direction Any one of inverse transformation and no inverse transformation; based on the second prediction mode, it is determined to perform any one of DCT2 inverse transformation, DST7 inverse transformation and no inverse transformation on the inverse transformation unit in the horizontal direction. Inverse discrete wavelet transform for direction.
在一种示例中,预测模式包括DC预测模式、角度预测模式、Planar预测模式和块拷贝模式中的任意一种,角度预测模式为水平预测模式、垂直预测模式和对角预测模式中的任意一种。In one example, the prediction mode includes any one of DC prediction mode, angle prediction mode, Planar prediction mode and block copy mode, and the angle prediction mode is any one of horizontal prediction mode, vertical prediction mode and diagonal prediction mode kind.
在一种示例中,反变换模块1102,用于对所述反变换单元的亮度进行离散小波反变换,对所述反变换单元的色度进行离散小波反变换、DCT2反变换以及DST7反变换中的任意一种;或者,对所述反变换单元的亮度进行DCT2反变换以及DST7反变换中的任意一种,对反变换单元的色度进行离散小波反变换。In one example, the inverse transform module 1102 is configured to perform discrete wavelet inverse transform on the luminance of the inverse transform unit, and perform discrete wavelet inverse transform, DCT2 inverse transform and DST7 inverse transform on the chroma of the inverse transform unit or, perform any one of DCT2 inverse transform and DST7 inverse transform on the luminance of the inverse transform unit, and perform discrete wavelet inverse transform on the chrominance of the inverse transform unit.
其中,上述方法实施例涉及的各步骤的所有相关内容均可以援引到对应功能模块的功能描述,在此不再赘述。Wherein, all relevant content of each step involved in the above-mentioned method embodiment can be referred to the function description of the corresponding function module, and will not be repeated here.
当然,本申请实施例提供的解码装置包括但不限于上述模块,例如:解码装置110还可以包括存储模块1103。Of course, the decoding device provided in the embodiment of the present application includes but is not limited to the above-mentioned modules, for example, the decoding device 110 may further include a storage module 1103 .
存储模块1103可以用于存储该解码装置的程序代码和数据。The storage module 1103 can be used to store program codes and data of the decoding device.
在采用对应各个功能划分各个功能模块的情况下,图13示出上述实施例中所涉及的解码装置的 一种可能的结构示意图。如图13所示,解码装置120包括解码模块1201、反变换模块1202和存储模块1203。In the case of dividing each functional module corresponding to each function, Fig. 13 shows a possible structural diagram of the decoding device involved in the above embodiment. As shown in FIG. 13 , the decoding device 120 includes a decoding module 1201 , an inverse transformation module 1202 and a storage module 1203 .
解码模块1201,用于对码流进行熵解码和反量化得到反变换单元。例如上述步骤S901。The decoding module 1201 is configured to perform entropy decoding and inverse quantization on the code stream to obtain an inverse transformation unit. For example, step S901 above.
反变换模块1202,用于对反变换单元进行第三反变换,得到反变换后的系数;其中,第三反变换包括在水平方向进行反变换和/或在垂直方向进行反变换,水平方向和垂直方向的反变换方法包括DCT2反变换或DST7反变换。例如上述步骤S902。The inverse transformation module 1202 is configured to perform a third inverse transformation on the inverse transformation unit to obtain inversely transformed coefficients; wherein, the third inverse transformation includes inverse transformation in the horizontal direction and/or inverse transformation in the vertical direction, horizontal direction and The inverse transformation method in the vertical direction includes DCT2 inverse transformation or DST7 inverse transformation. For example, step S902 above.
在一种示例中,反变换单元的尺寸与编码单元的尺寸相同;或者,所述反变换单元的宽度为编码单元的宽度的一半,所述反变换单元的高度与所述编码单元的高度相同;或者,所述反变换单元的高度为所述编码单元的高度的一半,所述反变换单元的宽度与所述编码单元的宽度相同。In an example, the size of the inverse transformation unit is the same as the size of the coding unit; or, the width of the inverse transformation unit is half of the width of the coding unit, and the height of the inverse transformation unit is the same as the height of the coding unit ; or, the height of the inverse transformation unit is half of the height of the coding unit, and the width of the inverse transformation unit is the same as the width of the coding unit.
在一种示例中,反变换单元的尺寸包括第三尺寸、第四尺寸、第五尺寸和第六尺寸,反变换模块1202,用于基于所述反变换单元的第三尺寸,对所述反变换单元在水平方向进行DCT2反变换或DST7反变换,在垂直方向不进行反变换;基于反变换单元的第四尺寸,对反变换单元在水平方向不进行反变换,在垂直方向进行DCT2反变换或DST7反变换;基于反变换单元的第五尺寸,对反变换单元在水平方向进行DCT2反变换,在垂直方向进行DST7反变换;基于反变换单元的第六尺寸,对反变换单元在水平方向进行DST7反变换,在垂直方向进行DCT2反变换。In an example, the size of the inverse transformation unit includes a third size, a fourth size, a fifth size, and a sixth size, and the inverse transformation module 1202 is configured to, based on the third size of the inverse transformation unit, The transformation unit performs DCT2 inverse transformation or DST7 inverse transformation in the horizontal direction, and does not perform inverse transformation in the vertical direction; based on the fourth size of the inverse transformation unit, the inverse transformation unit does not perform inverse transformation in the horizontal direction, and performs DCT2 inverse transformation in the vertical direction Or DST7 inverse transformation; based on the fifth size of the inverse transformation unit, DCT2 inverse transformation is performed on the inverse transformation unit in the horizontal direction, and DST7 inverse transformation is performed on the vertical direction; based on the sixth size of the inverse transformation unit, the inverse transformation unit is horizontally transformed Perform DST7 inverse transformation, and perform DCT2 inverse transformation in the vertical direction.
在一种示例中,解码模块1201,用于获取码流中的变换方法标识位,所述变换方法标识位用于指示反变换单元的反变换方法;根据所述反变换单元的反变换方法确定第三反变换。In an example, the decoding module 1201 is configured to obtain the transformation method identification bit in the code stream, and the transformation method identification bit is used to indicate the inverse transformation method of the inverse transformation unit; determine according to the inverse transformation method of the inverse transformation unit The third inverse transformation.
在一种示例中,解码模块1201,用于获取码流中的预测模式标识位,预测模式标识位用于指示反变换单元进行反变换前,预测单元进行预测的预测模式,预测模式包括第三预测模式、第四预测模式、第五预测模式和第六预测模式;基于第三预测模式,确定对所述反变换单元在水平方向进行DCT2反变换或DST7反变换,在垂直方向不进行反变换;基于第四预测模式,确定对所述反变换单元在水平方向不进行反变换,在垂直方向进行DCT2反变换或DST7反变换;基于第五预测模式,对反变换单元在水平方向进行DCT2反变换,在垂直方向进行DST7反变换;基于第六预测模式,对反变换单元在水平方向进行DST7反变换,在垂直方向进行DCT2反变换。In one example, the decoding module 1201 is configured to obtain the prediction mode identification bit in the code stream, and the prediction mode identification bit is used to indicate the prediction mode for the prediction unit to perform prediction before the inverse transformation unit performs inverse transformation, and the prediction mode includes the third Prediction mode, fourth prediction mode, fifth prediction mode, and sixth prediction mode; based on the third prediction mode, it is determined to perform DCT2 inverse transformation or DST7 inverse transformation on the inverse transformation unit in the horizontal direction, and not perform inverse transformation in the vertical direction ;Based on the fourth prediction mode, it is determined that the inverse transformation unit is not inversely transformed in the horizontal direction, and DCT2 inverse transformation or DST7 inverse transformation is performed in the vertical direction; based on the fifth prediction mode, DCT2 inverse transformation is performed on the inverse transformation unit in the horizontal direction For transformation, DST7 inverse transformation is performed in the vertical direction; based on the sixth prediction mode, DST7 inverse transformation is performed on the inverse transformation unit in the horizontal direction, and DCT2 inverse transformation is performed in the vertical direction.
在一种示例中,预测模式包括DC模式、角度模式、Planar模式和块拷贝模式中的任意一种,角度模式为水平模式、垂直模式和对角模式中的任意一种。In an example, the prediction mode includes any one of DC mode, angle mode, Planar mode and block copy mode, and the angle mode is any one of horizontal mode, vertical mode and diagonal mode.
在一种示例中,反变换模块1202,用于对反变换单元的亮度进行DCT2反变换或DST7反变换;对反变换单元的色度进行DCT2反变换或DST7反变换,得到反变换后的系数。In one example, the inverse transform module 1202 is configured to perform DCT2 inverse transform or DST7 inverse transform on the luminance of the inverse transform unit; perform DCT2 inverse transform or DST7 inverse transform on the chroma of the inverse transform unit to obtain inversely transformed coefficients .
其中,上述方法实施例涉及的各步骤的所有相关内容均可以援引到对应功能模块的功能描述,在此不再赘述。Wherein, all relevant content of each step involved in the above-mentioned method embodiment can be referred to the function description of the corresponding function module, and will not be repeated here.
当然,本申请实施例提供的解码装置包括但不限于上述模块,例如:解码装置还可以包括存储模块1203。Of course, the decoding device provided in the embodiment of the present application includes but is not limited to the above-mentioned modules, for example, the decoding device may further include a storage module 1203 .
存储模块1203可以用于存储该解码装置的程序代码和数据。The storage module 1203 can be used to store program codes and data of the decoding device.
作为示例,结合图6,解码装置110和解码装置120中的解码模块、反变换模块和存储模块中的部分或全部实现的功能可以通过图6中的处理器501执行图6中的存储器502中的程序代码实现。As an example, with reference to FIG. 6 , some or all of the functions implemented in the decoding module, the inverse transformation module, and the storage module in the decoding device 110 and the decoding device 120 can be executed by the processor 501 in FIG. 6 in the memory 502 in FIG. 6 . program code implementation.
在采用对应各个功能划分各个功能模块的情况下,图14示出上述实施例中所涉及的编码装置的一种可能的结构示意图。如图14所示,编码装置130包括变换模块1301、编码模块1302和存储模块1303。In the case of dividing each functional module corresponding to each function, FIG. 14 shows a possible structural schematic diagram of the encoding device involved in the above embodiment. As shown in FIG. 14 , the encoding device 130 includes a transformation module 1301 , an encoding module 1302 and a storage module 1303 .
变换模块1301,用于对变换单元进行离散小波变换,得到变换系数。例如上述步骤S801。The transformation module 1301 is configured to perform discrete wavelet transformation on the transformation unit to obtain transformation coefficients. For example, step S801 above.
编码模块1302,用于对变换系数进行量化和熵编码,得到码流。例如上述步骤S802。The encoding module 1302 is configured to perform quantization and entropy encoding on the transform coefficients to obtain a code stream. For example, step S802 above.
其中,上述方法实施例涉及的各步骤的所有相关内容均可以援引到对应功能模块的功能描述,在此不再赘述。Wherein, all relevant content of each step involved in the above-mentioned method embodiment can be referred to the function description of the corresponding function module, and will not be repeated here.
当然,本申请实施例提供的编码装置包括但不限于上述模块,例如:编码装置还可以包括存储模块1303。Of course, the encoding device provided in the embodiment of the present application includes but is not limited to the above-mentioned modules, for example, the encoding device may further include a storage module 1303 .
存储模块1303可以用于存储该编码装置的程序代码和数据。The storage module 1303 can be used to store program codes and data of the encoding device.
作为示例,结合图6,编码装置130中的变换模块1301、编码模块1302和存储模块1303中的部分或全部实现的功能可以通过图6中的处理器501执行图6中的存储器502中的程序代码实现。As an example, with reference to FIG. 6, some or all of the functions implemented in the transformation module 1301, the encoding module 1302, and the storage module 1303 in the encoding device 130 can be executed by the processor 501 in FIG. 6. The program in the memory 502 in FIG. 6 Code.
在采用对应各个功能划分各个功能模块的情况下,图15示出上述实施例中所涉及的编码装置的一种可能的结构示意图。如图15所示,编码装置140包括变换模块1401、编码模块1402和存储模块1403。In the case of dividing each functional module corresponding to each function, FIG. 15 shows a possible structural diagram of the encoding device involved in the above embodiment. As shown in FIG. 15 , the encoding device 140 includes a transformation module 1401 , an encoding module 1402 and a storage module 1403 .
变换模块1401,用于对变换单元进行第三变换,得到变换系数;其中,第三变换包括在水平方向进行变换和/或在垂直方向进行变换,水平方向和垂直方向的变换方法包括DCT2变换或DST7变换。例如上述步骤S1001。The transformation module 1401 is configured to perform a third transformation on the transformation unit to obtain transformation coefficients; wherein, the third transformation includes performing transformation in the horizontal direction and/or performing transformation in the vertical direction, and the transformation methods in the horizontal direction and vertical direction include DCT2 transformation or DST7 transformation. For example, the above step S1001.
编码模块1402,用于对变换系数进行量化和熵编码,得到码流。例如上述步骤S1002。The encoding module 1402 is configured to perform quantization and entropy encoding on the transform coefficients to obtain a code stream. For example, the above step S1002.
其中,上述方法实施例涉及的各步骤的所有相关内容均可以援引到对应功能模块的功能描述,在此不再赘述。Wherein, all relevant content of each step involved in the above-mentioned method embodiment can be referred to the function description of the corresponding function module, and will not be repeated here.
当然,本申请实施例提供的编码装置包括但不限于上述模块,例如:编码装置还可以包括存储模块1403。Of course, the encoding device provided in the embodiment of the present application includes but is not limited to the above-mentioned modules, for example, the encoding device may further include a storage module 1403 .
存储模块1403可以用于存储该编码装置的程序代码和数据。The storage module 1403 can be used to store program codes and data of the encoding device.
作为示例,结合图6,编码装置140中的变换模块1401、编码模块1402和存储模块1403中的部分或全部实现的功能可以通过图6中的处理器501执行图6中的存储器502中的程序代码实现。As an example, with reference to FIG. 6 , some or all of the functions implemented in the transformation module 1401, the encoding module 1402, and the storage module 1403 in the encoding device 140 can be executed by the processor 501 in FIG. 6 in the program in the memory 502 in FIG. 6 Code.
本申请实施例还提供了一种电子设备,该电子设备包括上述解码装置110和解码装置120,该解码装置110和解码装置120执行上文提供的任意一种视频解码器所执行的方法。The embodiment of the present application also provides an electronic device, the electronic device includes the decoding device 110 and the decoding device 120 described above, and the decoding device 110 and the decoding device 120 execute any method performed by the video decoder provided above.
本申请实施例还提供了一种电子设备,该电子设备包括上述编码装置130和编码装置140,该编码装置130和编码装置140执行上文提供的任意一种视频编码器所执行的方法。The embodiment of the present application also provides an electronic device, the electronic device includes the encoding device 130 and the encoding device 140 described above, and the encoding device 130 and the encoding device 140 execute any method performed by the video encoder provided above.
本申请实施例还提供了一种电子设备,该电子设备包括上述解码装置110和编码装置130,该解码装置110和编码装置130执行上文提供的任意一种视频解码器和视频编码器所执行的方法。The embodiment of the present application also provides an electronic device, which includes the above-mentioned decoding device 110 and encoding device 130, and the decoding device 110 and encoding device 130 execute any video decoder and video encoder provided above. Methods.
本申请实施例还提供了一种电子设备,该电子设备包括上述解码装置120和编码装置140,该解码装置120和编码装置140执行上文提供的任意一种视频解码器和视频编码器所执行的方法。The embodiment of the present application also provides an electronic device, which includes the above-mentioned decoding device 120 and encoding device 140, and the decoding device 120 and encoding device 140 execute any video decoder and video encoder provided above. Methods.
本申请实施例还提供了一种通信系统,该通信系统包括由上述解码装置110、解码装置120、编码装置130和编码装置140构成的电子设备、该解码装置110、解码装置120、编码装置130和编码装置140执行上文提供的任意一种视频解码器和视频编码器所执行的方法。The embodiment of the present application also provides a communication system, which includes electronic equipment composed of the decoding device 110, the decoding device 120, the encoding device 130 and the encoding device 140, the decoding device 110, the decoding device 120, and the encoding device 130 And the encoding device 140 implements any one of the methods performed by the video decoder and video encoder provided above.
本申请实施例还提供了一种计算机可读存储介质,该计算机可读存储介质上存储有计算机程序,当该计算机程序在计算机上运行时,使得该计算机执行上文提供的任意一种视频解码器所执行的方法。The embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is run on a computer, the computer is made to execute any video decoding method provided above. The method executed by the device.
关于上述提供的任一种计算机可读存储介质中相关内容的解释及有益效果的描述,均可以参考上述对应的实施例,此处不再赘述。Regarding the explanation of relevant content and the description of beneficial effects in any computer-readable storage medium provided above, reference may be made to the above-mentioned corresponding embodiments, and details are not repeated here.
本申请实施例还提供了一种处理器。该处理器中集成了用于实现上述解码装置110、解码装置120、编码装置130和编码装置140的功能的控制电路和一个或者多个端口。可选的,该处理器支持的功能可以参考上文,此处不再赘述。本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可通过程序来指令相关的硬件完成。所述的程序可以存储于一种计算机可读存储介质中。上述提到的存储介质可以是只读存储器,随机接入存储器等。上述处理单元或处理器可以是中央处理器,通用处理器、特定集成电路(application specific integrated circuit,ASIC)、微处理器(digital signal processor,DSP),现场可编程门阵列(field programmable gate array,FPGA)或者其他可编程逻辑器件、晶体管逻辑器件、硬件部件或者其任意组合。The embodiment of the present application also provides a processor. The processor integrates a control circuit and one or more ports for realizing the functions of the above-mentioned decoding device 110 , decoding device 120 , encoding device 130 and encoding device 140 . Optionally, the functions supported by the processor can be referred to above, and will not be repeated here. Those of ordinary skill in the art can understand that all or part of the steps for implementing the above-mentioned embodiments can be completed by instructing related hardware through a program. The program can be stored in a computer-readable storage medium. The storage medium mentioned above may be a read-only memory, a random access memory, and the like. The above-mentioned processing unit or processor can be a central processing unit, a general-purpose processor, a specific integrated circuit (application specific integrated circuit, ASIC), a microprocessor (digital signal processor, DSP), a field programmable gate array (field programmable gate array, FPGA) or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof.
本申请实施例还提供了一种包含指令的计算机程序产品,当该指令在计算机上运行时,使得计算机执行上述实施例中的任意一种方法。该计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行计算机程序指令时,全部或部分地产生按照本申请实施例的流程或功能。计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,计算机指令可以从一个网站站点、计算机、服务器或者数据中心通过有线(例如同轴电缆、光纤、数字用户线(digital subscriber line,DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可以用介质集成的服务器、数据中心等数据存储设备。可用介质可以是磁性介质(例如,软盘、硬盘、磁带),光介质(例如,DVD)、或者半导体介质(例如SSD)等。The embodiments of the present application also provide a computer program product containing instructions, which, when the instructions are run on a computer, cause the computer to execute any one of the methods in the foregoing embodiments. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, the processes or functions according to the embodiments of the present application will be generated in whole or in part. A computer can be a general purpose computer, special purpose computer, computer network, or other programmable device. Computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, e.g. Coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (such as infrared, wireless, microwave, etc.) transmission to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that can be accessed by a computer, or may contain one or more data storage devices such as servers and data centers that can be integrated with the medium. The available media may be magnetic media (eg, floppy disk, hard disk, magnetic tape), optical media (eg, DVD), or semiconductor media (eg, SSD), etc.
应注意,本申请实施例提供的上述用于存储计算机指令或者计算机程序的器件,例如但不限于,上述存储器、计算机可读存储介质和通信设备等,均具有非易失性(non-transitory)。It should be noted that the above-mentioned devices for storing computer instructions or computer programs provided by the embodiments of the present application, such as but not limited to, the above-mentioned memory, computer-readable storage medium, and communication equipment, etc., all have non-transitory .
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件程序实现时,可以全部或部分地以计算机程序产品的形式来实现。该计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行计算机程序指令时,全部或部分地产生按照本申请实施例的流程或功能。计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,计算机指令可以从一个网站站点、计算机、服务器或者数据中心通过有线(例如同轴电缆、光纤、数字用户线(digital subscriber line,DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可以用介质集成的服务器、数据中心等数据存储设 备。可用介质可以是磁性介质(例如,软盘、硬盘、磁带),光介质(例如,DVD)、或者半导体介质(例如固态硬盘(solid state disk,SSD))等。In the above embodiments, all or part of them may be implemented by software, hardware, firmware or any combination thereof. When implemented using a software program, it may 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 the computer, the processes or functions according to the embodiments of the present application will be generated in whole or in part. A computer can be a general purpose computer, special purpose computer, computer network, or other programmable device. Computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, e.g. Coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (such as infrared, wireless, microwave, etc.) transmission 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 can contain one or more data storage devices such as servers and data centers that can be integrated with the medium. The usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, or a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid state disk (solid state disk, SSD)), etc.
尽管在此结合各实施例对本申请进行了描述,然而,在实施所要求保护的本申请过程中,本领域技术人员通过查看附图、公开内容、以及所附权利要求书,可理解并实现公开实施例的其他变化。在权利要求中,“包括”(comprising)一词不排除其他组成部分或步骤,“一”或“一个”不排除多个的情况。单个处理器或其他单元可以实现权利要求中列举的若干项功能。相互不同的从属权利要求中记载了某些措施,但这并不表示这些措施不能组合起来产生良好的效果。Although the present application has been described in conjunction with various embodiments herein, those skilled in the art can understand and realize the disclosure by viewing the drawings, the disclosure, and the appended claims during the implementation of the claimed application. Other Variations of Embodiments. In the claims, the word "comprising" does not exclude other components or steps, and "a" or "an" does not exclude a plurality. A single processor or other unit may fulfill the functions of several items recited in the claims. The mere fact that certain measures are recited in mutually different dependent claims does not indicate that these measures cannot be combined to advantage.
尽管结合具体特征及其实施例对本申请进行了描述,显而易见的,在不脱离本申请的精神和范围的情况下,可对其进行各种修改和组合。相应地,本说明书和附图仅仅是所附权利要求所界定的本申请的示例性说明,且视为已覆盖本申请范围内的任意和所有修改、变化、组合或等同物。显然,本领域的技术人员可以对本申请进行各种改动和变型而不脱离本申请的精神和范围。这样,倘若本申请的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。Although the application has been described in conjunction with specific features and embodiments thereof, it will be apparent that various modifications and combinations can be made thereto without departing from the spirit and scope of the application. Accordingly, the specification and drawings are merely illustrative of the application as defined by the appended claims and are deemed to cover any and all modifications, variations, combinations or equivalents within the scope of this application. Obviously, those skilled in the art can make various changes and modifications to the application without departing from the spirit and scope of the application. In this way, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalent technologies, the present application is also intended to include these modifications and variations.

Claims (28)

  1. 一种视频解码方法,包括:A video decoding method, comprising:
    对码流进行熵解码和反量化得到反变换单元;Perform entropy decoding and inverse quantization on the code stream to obtain an inverse transformation unit;
    对所述反变换单元进行离散小波反变换,得到反变换后的系数。Inverse discrete wavelet transform is performed on the inverse transform unit to obtain coefficients after inverse transform.
  2. 根据权利要求1所述的方法,其中,对所述反变换单元进行离散小波反变换,得到反变换后的系数,包括:The method according to claim 1, wherein, performing discrete wavelet inverse transform on the inverse transform unit to obtain coefficients after inverse transform, comprising:
    对所述反变换单元在水平方向进行离散小波反变换,在垂直方向进行离散小波反变换、DCT2反变换、DST7反变换以及不进行反变换中的任意一种;或者,Perform discrete wavelet inverse transform on the inverse transform unit in the horizontal direction, and perform any one of discrete wavelet inverse transform, DCT2 inverse transform, DST7 inverse transform and no inverse transform in the vertical direction; or,
    对所述反变换单元在所述水平方向进行DCT2反变换、DST7反变换以及不进行反变换中的任意一种,在所述垂直方向进行离散小波反变换。The inverse transformation unit performs any one of DCT2 inverse transformation, DST7 inverse transformation and no inverse transformation in the horizontal direction, and performs discrete wavelet inverse transformation in the vertical direction.
  3. 根据权利要求2所述的方法,其中,所述离散小波反变换包括哈尔小波反变换和5/3小波反变换,The method according to claim 2, wherein said discrete wavelet inverse transform comprises Haar wavelet inverse transform and 5/3 wavelet inverse transform,
    对所述反变换单元进行离散小波反变换,得到反变换后的系数,包括:Carrying out discrete wavelet inverse transform to described inverse transform unit, obtains the coefficient after inverse transform, comprises:
    对所述反变换单元在所述水平方向进行反哈尔小波变换,在所述垂直方向进行哈尔小波反变换、5/3小波反变换、DCT2反变换、DST7反变换以及不进行反变换中的任意一种;或者,Perform inverse Haar wavelet transform on the inverse transform unit in the horizontal direction, inverse Haar wavelet transform, 5/3 wavelet inverse transform, DCT2 inverse transform, DST7 inverse transform and no inverse transform in the vertical direction any of the following; or,
    对所述反变换单元在所述水平方向进行5/3小波反变换,在所述垂直方向进行哈尔小波反变换、5/3小波反变换、DCT2反变换、DST7反变换以及不进行反变换中的任意一种;或者,Carry out 5/3 wavelet inverse transform to described inverse transform unit in described horizontal direction, carry out Haar wavelet inverse transform, 5/3 wavelet inverse transform, DCT2 inverse transform, DST7 inverse transform and do not carry out inverse transform in described vertical direction any of the following; or,
    对所述反变换单元在所述水平方向进行DCT2反变换、DST7反变换以及不进行反变换中的任意一种,在所述垂直方向进行哈尔小波反变换;或者,Perform any one of DCT2 inverse transformation, DST7 inverse transformation and no inverse transformation on the inverse transformation unit in the horizontal direction, and perform Haar wavelet inverse transformation in the vertical direction; or,
    对所述反变换单元在所述水平方向进行DCT2反变换、DST7反变换以及不进行反变换中的任意一种,在所述垂直方向进行5/3小波反变换。Perform any one of DCT2 inverse transform, DST7 inverse transform and no inverse transform in the horizontal direction on the inverse transform unit, and perform 5/3 wavelet inverse transform in the vertical direction.
  4. 根据权利要求1所述的方法,其中,The method according to claim 1, wherein,
    所述反变换单元的尺寸与编码单元的尺寸相同;或者,The size of the inverse transform unit is the same as the size of the coding unit; or,
    所述反变换单元的宽度为编码单元的宽度的一半,所述反变换单元的高度与所述编码单元的高度相同;或者,The width of the inverse transformation unit is half the width of the coding unit, and the height of the inverse transformation unit is the same as the height of the coding unit; or,
    所述反变换单元的高度为编码单元的高度的一半,所述反变换单元的宽度与所述编码单元的宽度相同。The height of the inverse transform unit is half the height of the coding unit, and the width of the inverse transform unit is the same as the width of the coding unit.
  5. 根据权利要求1所述的方法,其中,对所述反变换单元进行离散小波反变换,得到反变换后的系数,包括:The method according to claim 1, wherein, performing discrete wavelet inverse transform on the inverse transform unit to obtain coefficients after inverse transform, comprising:
    基于所述反变换单元的尺寸,确定对所述反变换单元在水平方向进行第一反变换,在垂直方向进行第二反变换;其中,所述第一反变换和所述第二反变换中的至少一种为离散小波反变换。Based on the size of the inverse transformation unit, it is determined to perform the first inverse transformation on the inverse transformation unit in the horizontal direction, and perform the second inverse transformation in the vertical direction; wherein, in the first inverse transformation and the second inverse transformation At least one of is discrete wavelet inverse transform.
  6. 根据权利要求5所述的方法,其中,所述反变换单元的尺寸包括第一尺寸和第二尺寸,The method according to claim 5, wherein the size of the inverse transform unit comprises a first size and a second size,
    基于所述反变换单元的尺寸,确定对所述反变换单元在水平方向进行第一反变换,在垂直方向进行第二反变换,包括:Based on the size of the inverse transformation unit, it is determined to perform the first inverse transformation on the inverse transformation unit in the horizontal direction, and perform the second inverse transformation in the vertical direction, including:
    基于所述第一尺寸,确定对所述反变换单元在所述水平方向进行离散小波反变换,在所述垂直方向进行离散小波反变换;Based on the first size, determine to perform discrete wavelet inverse transform on the inverse transform unit in the horizontal direction, and perform discrete wavelet inverse transform in the vertical direction;
    基于所述第二尺寸,确定对所述反变换单元在所述水平方向进行离散小波反变换,在所述垂直方向不进行反变换。Based on the second size, it is determined to perform inverse discrete wavelet transform on the inverse transform unit in the horizontal direction, and not to perform inverse transform in the vertical direction.
  7. 根据权利要求1所述的方法,其中,对所述码流进行熵解码和反量化得到反变换单元,包括:The method according to claim 1, wherein performing entropy decoding and inverse quantization on the code stream to obtain an inverse transformation unit comprises:
    获取所述码流中的变换方法标识位,所述变换方法标识位用于指示所述反变换单元的反变换方法,所述反变换方法包括对所述反变换单元在水平方向和/或垂直方向进行离散小波反变换。Obtain the transformation method identification bit in the code stream, the transformation method identification bit is used to indicate the inverse transformation method of the inverse transformation unit, and the inverse transformation method includes performing the horizontal and/or vertical transformation of the inverse transformation unit Inverse discrete wavelet transform for direction.
  8. 根据权利要求1所述的方法,其中,对所述码流进行熵解码和反量化得到反变换单元,包括:The method according to claim 1, wherein performing entropy decoding and inverse quantization on the code stream to obtain an inverse transformation unit comprises:
    获取所述码流中的预测模式标识位,所述预测模式标识位用于指示所述反变换单元进行反变换前,预测单元进行预测的预测模式,所述预测模式包括第一预测模式和第二预测模式;Obtain the prediction mode identification bit in the code stream, the prediction mode identification bit is used to indicate the prediction mode in which the prediction unit performs prediction before the inverse transformation unit performs inverse transformation, and the prediction mode includes the first prediction mode and the second prediction mode Two prediction models;
    基于所述第一预测模式,确定对所述反变换单元在水平方向进行离散小波反变换,在垂直方向进行离散小波反变换、DCT2反变换、DST7反变换以及不进行反变换中的任意一种;Based on the first prediction mode, it is determined to perform discrete wavelet inverse transform on the inverse transform unit in the horizontal direction, and perform any one of discrete wavelet inverse transform, DCT2 inverse transform, DST7 inverse transform and no inverse transform in the vertical direction ;
    基于所述第二预测模式,确定对所述反变换单元在所述水平方向进行DCT2反变换、DST7反变换以及不进行反变换中的任意一种,在所述垂直方向进行离散小波反变换。Based on the second prediction mode, it is determined to perform any one of DCT2 inverse transform, DST7 inverse transform, and no inverse transform in the horizontal direction on the inverse transform unit, and perform discrete wavelet inverse transform in the vertical direction.
  9. 根据权利要求8所述的方法,其中,所述预测模式包括DC预测模式、角度预测模式、Planar预测模式和块拷贝模式中的任意一种,所述角度预测模式包括水平预测模式、垂直预测模式和对角预测模式中的任意一种。The method according to claim 8, wherein the prediction mode includes any one of DC prediction mode, angle prediction mode, Planar prediction mode and block copy mode, and the angle prediction mode includes horizontal prediction mode, vertical prediction mode and any of the diagonal prediction modes.
  10. 根据权利要求1所述的方法,其中,对所述反变换单元进行离散小波反变换,得到反变换后的系数,包括:The method according to claim 1, wherein, performing discrete wavelet inverse transform on the inverse transform unit to obtain coefficients after inverse transform, comprising:
    对所述反变换单元的亮度进行离散小波反变换,对所述反变换单元的色度进行离散小波反变换、DCT2反变换以及DST7反变换中的任意一种;或者,Perform discrete wavelet inverse transform on the brightness of the inverse transform unit, and perform any one of discrete wavelet inverse transform, DCT2 inverse transform and DST7 inverse transform on the chroma of the inverse transform unit; or,
    对所述反变换单元的亮度进行DCT2反变换以及DST7反变换中的任意一种,对所述反变换单元的色度进行离散小波反变换。Perform any one of DCT2 inverse transform and DST7 inverse transform on the luminance of the inverse transform unit, and perform discrete wavelet inverse transform on the chroma of the inverse transform unit.
  11. 一种视频解码方法,包括:A video decoding method, comprising:
    对码流进行熵解码和反量化得到反变换单元;Perform entropy decoding and inverse quantization on the code stream to obtain an inverse transformation unit;
    对所述反变换单元进行第三反变换,得到反变换后的系数;其中,所述第三反变换包括对所述反变换单元在水平方向进行反变换和/或在垂直方向进行反变换,所述水平方向和所述垂直方向的反变换方法包括DCT2反变换或DST7反变换。Performing a third inverse transform on the inverse transform unit to obtain inversely transformed coefficients; wherein the third inverse transform includes performing inverse transform on the inverse transform unit in the horizontal direction and/or performing inverse transform in the vertical direction, The inverse transformation method of the horizontal direction and the vertical direction includes DCT2 inverse transformation or DST7 inverse transformation.
  12. 根据权利要求11所述的方法,其中,The method of claim 11, wherein,
    所述反变换单元的尺寸与编码单元的尺寸相同;或者,The size of the inverse transform unit is the same as the size of the coding unit; or,
    所述反变换单元的宽度为编码单元的宽度的一半,所述反变换单元的高度与所述编码单元的高度相同;或者,The width of the inverse transformation unit is half the width of the coding unit, and the height of the inverse transformation unit is the same as the height of the coding unit; or,
    所述反变换单元的高度为编码单元的高度的一半,所述反变换单元的宽度与所述编码单元的宽度相同。The height of the inverse transform unit is half the height of the coding unit, and the width of the inverse transform unit is the same as the width of the coding unit.
  13. 根据权利要求12所述的方法,其中,所述反变换单元的尺寸包括第三尺寸、第四尺寸、第五尺寸和第六尺寸,The method according to claim 12, wherein the size of the inverse transform unit comprises a third size, a fourth size, a fifth size and a sixth size,
    对所述反变换单元进行第三反变换,得到反变换后的系数,包括:Performing a third inverse transform on the inverse transform unit to obtain inversely transformed coefficients, including:
    基于所述反变换单元的第三尺寸,对所述反变换单元在水平方向进行DCT2反变换或DST7反变换,在垂直方向不进行反变换;Based on the third size of the inverse transformation unit, perform DCT2 inverse transformation or DST7 inverse transformation on the inverse transformation unit in the horizontal direction, and do not perform inverse transformation in the vertical direction;
    基于所述反变换单元的第四尺寸,对所述反变换单元在水平方向不进行反变换,在垂直方向进行DCT2反变换或DST7反变换;Based on the fourth size of the inverse transformation unit, the inverse transformation unit is not subjected to inverse transformation in the horizontal direction, and DCT2 inverse transformation or DST7 inverse transformation is performed in the vertical direction;
    基于所述反变换单元的第五尺寸,对所述反变换单元在水平方向进行DCT2反变换,在垂直方向进行DST7反变换;Based on the fifth size of the inverse transformation unit, perform DCT2 inverse transformation on the inverse transformation unit in the horizontal direction, and perform DST7 inverse transformation in the vertical direction;
    基于所述反变换单元的第六尺寸,对所述反变换单元在水平方向进行DST7反变换,在垂直方向进行DCT2反变换。Based on the sixth size of the inverse transform unit, perform DST7 inverse transform in the horizontal direction and perform DCT2 inverse transform in the vertical direction on the inverse transform unit.
  14. 根据权利要求11所述的方法,其中,对所述码流进行熵解码和反量化得到反变换单元,包括:The method according to claim 11, wherein performing entropy decoding and inverse quantization on the code stream to obtain an inverse transformation unit comprises:
    获取所述码流中的变换方法标识位,所述变换方法标识位用于指示所述反变换单元的反变换方法;Acquiring a transformation method identification bit in the code stream, where the transformation method identification bit is used to indicate the inverse transformation method of the inverse transformation unit;
    根据所述反变换单元的反变换方法确定所述第三反变换。The third inverse transform is determined according to an inverse transform method of the inverse transform unit.
  15. 根据权利要求11所述的方法,其中,对所述码流进行熵解码和反量化得到反变换单元,包括:The method according to claim 11, wherein performing entropy decoding and inverse quantization on the code stream to obtain an inverse transformation unit comprises:
    获取所述码流中的预测模式标识位,所述预测模式标识位用于指示反变换单元进行反变换前,预测单元进行预测的预测模式,所述预测模式包括第三预测模式、第四预测模式、第五预测模式和第六预测模式;Obtain the prediction mode identification bit in the code stream, the prediction mode identification bit is used to indicate the prediction mode of the prediction unit for prediction before the inverse transformation unit performs inverse transformation, and the prediction mode includes the third prediction mode, the fourth prediction mode mode, a fifth predictive mode and a sixth predictive mode;
    基于所述第三预测模式,确定对所述反变换单元在水平方向进行DCT2反变换或DST7反变换,在垂直方向不进行反变换;Based on the third prediction mode, determine to perform DCT2 inverse transformation or DST7 inverse transformation on the inverse transformation unit in the horizontal direction, and not perform inverse transformation in the vertical direction;
    基于所述第四预测模式,确定对所述反变换单元在水平方向不进行反变换,在垂直方向进行DCT2反变换或DST7反变换;Based on the fourth prediction mode, it is determined not to perform inverse transformation on the inverse transformation unit in the horizontal direction, and to perform DCT2 inverse transformation or DST7 inverse transformation in the vertical direction;
    基于所述第五预测模式,对所述反变换单元在水平方向进行DCT2反变换,在垂直方向进行DST7反变换;Based on the fifth prediction mode, perform DCT2 inverse transformation on the inverse transformation unit in the horizontal direction, and perform DST7 inverse transformation in the vertical direction;
    基于所述第六预测模式,对所述反变换单元在水平方向进行DST7反变换,在垂直方向进行DCT2反变换。Based on the sixth prediction mode, DST7 inverse transform is performed on the inverse transform unit in the horizontal direction, and DCT2 inverse transform is performed in the vertical direction.
  16. 根据权利要求15所述的方法,其中,所述预测模式包括DC模式、角度模式、Planar模式和块拷贝模式中的任意一种,所述角度模式为水平模式、垂直模式和对角模式中的任意一种。The method according to claim 15, wherein the prediction mode comprises any one of DC mode, angle mode, Planar mode and block copy mode, and the angle mode is one of horizontal mode, vertical mode and diagonal mode any kind.
  17. 根据权利要求11所述的方法,其中,所述对所述反变换单元进行第三反变换,得到反变换后的系数,包括:The method according to claim 11, wherein performing the third inverse transformation on the inverse transformation unit to obtain the coefficients after inverse transformation comprises:
    对所述反变换单元的亮度进行DCT2反变换或DST7反变换;Perform DCT2 inverse transformation or DST7 inverse transformation on the brightness of the inverse transformation unit;
    对所述反变换单元的色度进行DCT2反变换或DST7反变换,得到反变换后的系数。Perform DCT2 inverse transform or DST7 inverse transform on the chroma of the inverse transform unit to obtain inversely transformed coefficients.
  18. 一种视频编码方法,包括:A video coding method, comprising:
    对变换单元进行离散小波变换,得到变换系数;Perform discrete wavelet transform on the transform unit to obtain transform coefficients;
    对所述变换系数进行量化和熵编码,得到码流。Perform quantization and entropy coding on the transform coefficients to obtain a code stream.
  19. 一种视频编码方法,包括:A video coding method, comprising:
    对变换单元进行第三变换,得到变换系数;其中,所述第三变换包括在水平方向进行变换和/或在垂直方向进行变换,所述水平方向和所述垂直方向的变换方法包括DCT2变换或DST7变换;performing a third transformation on the transformation unit to obtain transformation coefficients; wherein, the third transformation includes transformation in the horizontal direction and/or transformation in the vertical direction, and the transformation methods in the horizontal direction and the vertical direction include DCT2 transformation or dst7 transform;
    对所述变换系数进行量化和熵编码,得到码流。Perform quantization and entropy coding on the transform coefficients to obtain a code stream.
  20. 一种视频解码装置,包括:A video decoding device, comprising:
    解码模块,用于对码流进行熵编码和反量化得到反变换单元;The decoding module is used to perform entropy encoding and inverse quantization on the code stream to obtain an inverse transformation unit;
    反变换模块,用于对所述反变换单元进行离散小波反变换,得到反变换后的系数。The inverse transform module is configured to perform discrete wavelet inverse transform on the inverse transform unit to obtain inversely transformed coefficients.
  21. 一种视频解码装置,包括:A video decoding device, comprising:
    解码模块,用于对码流进行熵编码和反量化得到反变换单元;The decoding module is used to perform entropy encoding and inverse quantization on the code stream to obtain an inverse transformation unit;
    反变换模块,对所述反变换单元进行第三反变换,得到反变换后的系数;其中,所述第三反变换包括在水平方向进行变换和/或在垂直方向进行反变换,所述水平方向和所述垂直方向的变换方法包括DCT2反变换或DST7反变换。An inverse transform module, performing a third inverse transform on the inverse transform unit to obtain inversely transformed coefficients; wherein, the third inverse transform includes transforming in the horizontal direction and/or performing inverse transform in the vertical direction, and the horizontal The transformation methods of the direction and the vertical direction include DCT2 inverse transformation or DST7 inverse transformation.
  22. 一种视频编码装置,包括:A video encoding device, comprising:
    变换模块,用于对变换单元进行离散小波变换,得到变换系数;Transformation module, is used for carrying out discrete wavelet transformation to transformation unit, obtains transformation coefficient;
    编码模块,用于对所述变换系数进行量化和熵编码,得到码流。The coding module is used to perform quantization and entropy coding on the transformation coefficients to obtain code streams.
  23. 一种视频编码装置,包括:A video encoding device, comprising:
    变换模块,用于对变换单元进行第三变换,得到变换系数;其中,所述第三变换包括在水平方向进行变换和/或在垂直方向进行变换,所述水平方向和所述垂直方向的变换方法包括DCT2变换或DST7变换;A transformation module, configured to perform a third transformation on the transformation unit to obtain transformation coefficients; wherein, the third transformation includes transformation in the horizontal direction and/or transformation in the vertical direction, and the transformation in the horizontal direction and the vertical direction The method includes DCT2 transformation or DST7 transformation;
    编码模块,用于对所述变换系数进行量化和熵编码,得到码流。The coding module is used to perform quantization and entropy coding on the transformation coefficients to obtain code streams.
  24. 一种视频解码器,所述视频解码器用于执行如权利要求1-17任一项所述的方法。A video decoder, configured to execute the method according to any one of claims 1-17.
  25. 一种视频编码器,所述视频编码器用于执行如权利要求18或19所述的方法。A video encoder for performing the method as claimed in claim 18 or 19.
  26. 一种电子设备,包括如权利要求24所述的视频解码器,存储器以及通信接口,所述视频解码器执行上述权利要求1-10中任一项所述的方法,和/或上述权利要求11-17中任一项所述的方法。An electronic device, comprising a video decoder according to claim 24, a memory and a communication interface, the video decoder performing the method according to any one of the above claims 1-10, and/or the above claim 11 - The method described in any one of 17.
  27. 一种电子设备,包括如权利要求25所述的视频编码器,存储器以及通信接口,所述视频编码器执行上述权利要求18或权利要求19所述的方法。An electronic device, comprising the video encoder as claimed in claim 25, a memory and a communication interface, the video encoder executing the method as claimed in claim 18 or claim 19 above.
  28. 一种计算机可读存储介质,所述计算机可读存储介质中存储有程序,当所述程序在所述计算机上运行时,使得所述计算机执行如权利要求1-19中任一项所述的方法。A computer-readable storage medium, wherein a program is stored in the computer-readable storage medium, and when the program is run on the computer, the computer executes the method according to any one of claims 1-19 method.
PCT/CN2022/131167 2021-11-11 2022-11-10 Video encoding and decoding method and apparatus WO2023083263A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111335612.2 2021-11-11
CN202111335612.2A CN116112689A (en) 2021-11-11 2021-11-11 Video encoding and decoding method and device

Publications (1)

Publication Number Publication Date
WO2023083263A1 true WO2023083263A1 (en) 2023-05-19

Family

ID=86253309

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/131167 WO2023083263A1 (en) 2021-11-11 2022-11-10 Video encoding and decoding method and apparatus

Country Status (3)

Country Link
CN (1) CN116112689A (en)
TW (1) TWI821013B (en)
WO (1) WO2023083263A1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000244742A (en) * 1999-02-19 2000-09-08 Canon Inc Image processor and its method
CN103905831A (en) * 2014-04-18 2014-07-02 西安电子科技大学 Strip wave transform image compression method based on graphics processor
US20200021852A1 (en) * 2018-07-16 2020-01-16 Qualcomm Incorporated Transform variations of multiple separable transform selection
US20200260078A1 (en) * 2019-02-08 2020-08-13 Tencent America LLC Method and apparatus for harmonization between transform skip mode and multiple transform selection

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000244742A (en) * 1999-02-19 2000-09-08 Canon Inc Image processor and its method
CN103905831A (en) * 2014-04-18 2014-07-02 西安电子科技大学 Strip wave transform image compression method based on graphics processor
US20200021852A1 (en) * 2018-07-16 2020-01-16 Qualcomm Incorporated Transform variations of multiple separable transform selection
US20200260078A1 (en) * 2019-02-08 2020-08-13 Tencent America LLC Method and apparatus for harmonization between transform skip mode and multiple transform selection

Also Published As

Publication number Publication date
TWI821013B (en) 2023-11-01
TW202327364A (en) 2023-07-01
CN116112689A (en) 2023-05-12

Similar Documents

Publication Publication Date Title
TWI728220B (en) Multi-type-tree framework for video coding
CN103190147B (en) For combined decoding method and the equipment of the syntactic element of video coding
RU2565365C2 (en) Encoding transform coefficients for video coding
JP6710755B2 (en) Entropy coding technique for non-4:4:4 chroma subsampling display stream compression (DSC)
WO2019135930A1 (en) Sign prediction in video coding
TWI827606B (en) Trellis coded quantization coefficient coding
WO2020220884A1 (en) Intra-frame prediction method and apparatus for video sequence
US11985309B2 (en) Picture coding method, picture decoding method, and related apparatuses
TW202133621A (en) Residual coding to support both lossy and lossless coding
TW202127884A (en) Bit shifting for cross-component adaptive loop filtering for video coding
JP2023554264A (en) Using low complexity history for RICE parameter derivation for high bit depth video coding
WO2024022039A1 (en) Video image decoding method and coding method, apparatus, and storage medium
WO2024022367A1 (en) Image decoding method and apparatus, and image coding method and apparatus
WO2024022359A1 (en) Image encoding method and device, and image decoding method and device
TW202133619A (en) History-based motion vector predictor constraint for merge estimation region
WO2023083263A1 (en) Video encoding and decoding method and apparatus
CN116156167A (en) Residual error skip coding and decoding method and device
TW202143712A (en) Low-frequency non-separable transform processing in video coding
WO2023138562A1 (en) Image decoding method, image coding method, and corresponding devices
TWI829424B (en) Decoding method, encoding method and apparatus
US11736727B2 (en) Low complexity history usage for rice parameter derivation for high bit-depth video coding
WO2023138532A1 (en) Video decoding method and apparatus, video decoder and storage medium
WO2022193389A1 (en) Video coding method and system, video decoding method and system, and video coder and decoder
RU2801327C2 (en) Intra prediction method and device for a video sequence
WO2022217447A1 (en) Video encoding and decoding method and system, and video codec

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

Country of ref document: EP

Kind code of ref document: A1

WD Withdrawal of designations after international publication