CN110636288A - Video decoding method, video encoding method, video decoding device, video encoding device and electronic equipment - Google Patents

Video decoding method, video encoding method, video decoding device, video encoding device and electronic equipment Download PDF

Info

Publication number
CN110636288A
CN110636288A CN201910927096.9A CN201910927096A CN110636288A CN 110636288 A CN110636288 A CN 110636288A CN 201910927096 A CN201910927096 A CN 201910927096A CN 110636288 A CN110636288 A CN 110636288A
Authority
CN
China
Prior art keywords
resolution
block
predetermined threshold
decoded
video frame
Prior art date
Legal status (The legal status 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 status listed.)
Granted
Application number
CN201910927096.9A
Other languages
Chinese (zh)
Other versions
CN110636288B (en
Inventor
高欣玮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201910927096.9A priority Critical patent/CN110636288B/en
Publication of CN110636288A publication Critical patent/CN110636288A/en
Application granted granted Critical
Publication of CN110636288B publication Critical patent/CN110636288B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/124Quantisation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/136Incoming video signal characteristics or properties
    • H04N19/137Motion inside a coding unit, e.g. average field, frame or block difference
    • H04N19/139Analysis of motion vectors, e.g. their magnitude, direction, variance or reliability
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • H04N19/51Motion estimation or motion compensation
    • H04N19/513Processing of motion vectors
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/59Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving spatial sub-sampling or interpolation, e.g. alteration of picture size or resolution

Abstract

The invention discloses a video decoding method, a video encoding method, a video decoding device, a video encoding device and electronic equipment. Wherein, the method comprises the following steps: acquiring coding parameters of a decoded video frame before a video frame to be decoded and coding parameters of one or more reference blocks in the decoded video frame, wherein the position of the reference block in the decoded video frame is the same as the position of the block to be decoded in the video frame to be decoded, and the coding parameters comprise at least one of the following: directional prediction mode, quantization parameter, length of motion vector; determining a target resolution for decoding a block to be decoded according to the encoding parameters of the decoded video frame and the encoding parameters of the reference block; and decoding the block to be decoded by adopting the target resolution. The invention solves the technical problem of poor flexibility of encoding and decoding video frames in the related technology.

Description

Video decoding method, video encoding method, video decoding device, video encoding device and electronic equipment
Technical Field
The invention relates to the field of computers, in particular to a video decoding and encoding method, a video decoding and encoding device and electronic equipment.
Background
In the conventional video encoding process, the same resolution is usually used for encoding and decoding each frame in the video. As shown in fig. 1, if high resolution is used for encoding and decoding each frame in a video, when a transmission bandwidth bits is relatively small (for example, smaller than a bandwidth threshold intersection point D shown in fig. 1), a peak signal-to-noise ratio PSNR corresponding to encoding and decoding with high resolution is lower than a peak signal-to-noise ratio PSNR corresponding to encoding and decoding with low resolution, that is, when the transmission bandwidth is small, the peak signal-to-noise ratio PSNR corresponding to encoding and decoding with high resolution is relatively small, and distortion is relatively large.
However, if each frame in the video is encoded and decoded with low resolution, when the transmission bandwidth bits is relatively large (for example, larger than the bandwidth threshold intersection point D shown in fig. 1), the peak signal-to-noise ratio PSNR corresponding to the encoding and decoding with low resolution is lower than the peak signal-to-noise ratio PSNR corresponding to the encoding and decoding with high resolution, that is, when the transmission bandwidth is relatively large, the peak signal-to-noise ratio PSNR corresponding to the encoding and decoding with low resolution is relatively small, and the distortion is relatively large.
In view of the above problems, no effective solution has been proposed.
Disclosure of Invention
The embodiment of the invention provides a video decoding and encoding method, a video decoding and encoding device and electronic equipment, and aims to at least solve the technical problem of poor flexibility in encoding and decoding video frames in the related art.
According to an aspect of an embodiment of the present invention, there is provided a video decoding method including: acquiring coding parameters of a decoded video frame before a video frame to be decoded and coding parameters of one or more reference blocks in the decoded video frame, wherein the positions of the reference blocks in the decoded video frame are the same as the positions of the blocks to be decoded in the video frame to be decoded, and the coding parameters comprise at least one of the following: directional prediction mode, quantization parameter, length of motion vector; determining a target resolution for decoding the block to be decoded according to the encoding parameters of the decoded video frame and the encoding parameters of the reference block; and decoding the block to be decoded by adopting the target resolution.
According to an aspect of the embodiments of the present invention, there is also provided a video encoding method, including: acquiring coding parameters of a coded video frame before a video frame to be coded and coding parameters of one or more reference blocks in the coded video frame, wherein the position of the reference block in the coded video frame is the same as the position of a block to be coded in the video frame to be coded, and the coding parameters comprise at least one of the following: directional prediction mode, quantization parameter, length of motion vector; determining a target resolution for coding the block to be coded according to the coding parameters of the coded video frame and the coding parameters of the reference block; and encoding the to-be-encoded block by adopting the target resolution.
According to an aspect of the embodiments of the present invention, there is also provided a video decoding apparatus, including: a first obtaining unit, configured to obtain coding parameters of a decoded video frame that precedes a video frame to be decoded and coding parameters of one or more reference blocks in the decoded video frame, where a position of the reference block in the decoded video frame is the same as a position of a block to be decoded in the video frame to be decoded, and the coding parameters include at least one of: directional prediction mode, quantization parameter, length of motion vector; a determining unit, configured to determine a target resolution for decoding the block to be decoded according to the encoding parameter of the decoded video frame and the encoding parameter of the reference block; and the decoding unit is used for decoding the block to be decoded by adopting the target resolution.
As an optional example, the determining unit includes: a first calculation module, configured to perform weighted summation on a directional prediction mode of a decoded video frame and a directional prediction mode of a reference block to obtain a total directional prediction mode; a first determining module, configured to determine that the target resolution is a first resolution if the total directional prediction mode is greater than a first predetermined threshold; a second determining module, configured to determine the target resolution as a second resolution when the total directional prediction mode is less than or equal to a first predetermined threshold and greater than a second predetermined threshold, where the first resolution is less than the second resolution, and the second predetermined threshold is less than the first predetermined threshold; and a third determining module, configured to determine the target resolution as a third resolution when the total directional prediction mode is less than or equal to a second predetermined threshold and greater than a third predetermined threshold, where the second resolution is less than the third resolution, and the third predetermined threshold is less than the second predetermined threshold.
As an optional example, the determining unit includes: the second calculation module is used for carrying out weighted summation on the quantization parameters of the decoded video frame and the quantization parameters of the reference block to obtain total quantization parameters; a fourth determining module, configured to determine that the target resolution is the first resolution when the totalization parameter is greater than a fourth predetermined threshold; a fifth determining module, configured to determine the target resolution as a second resolution when the totalization parameter is less than or equal to a fourth predetermined threshold and greater than a fifth predetermined threshold, where the first resolution is less than the second resolution, and the fifth predetermined threshold is less than the fourth predetermined threshold; and the sixth determining module is used for determining the target resolution as a third resolution under the condition that the totalization parameter is less than or equal to a fifth preset threshold and greater than a sixth preset threshold, wherein the second resolution is less than the third resolution, and the sixth preset threshold is less than the fifth preset threshold.
As an optional example, the determining unit includes: the third calculation module is used for carrying out weighted summation on the length of the motion vector of the decoded video frame and the length of the motion vector of the reference block to obtain the length of the total motion vector; a seventh determining module, configured to determine that the target resolution is the first resolution if the length of the total motion vector is greater than a seventh predetermined threshold; an eighth determining module, configured to determine the target resolution as a second resolution when the length of the total motion vector is smaller than or equal to a seventh predetermined threshold and larger than an eighth predetermined threshold, where the first resolution is smaller than the second resolution, and the eighth predetermined threshold is smaller than the seventh predetermined threshold; and a ninth determining module, configured to determine the target resolution as a third resolution if the length of the total motion vector is smaller than or equal to an eighth predetermined threshold and larger than a ninth predetermined threshold, where the second resolution is smaller than the third resolution, and the ninth predetermined threshold is smaller than the eighth predetermined threshold.
As an optional example, the obtaining unit includes: a first obtaining module, configured to obtain, in a case where a reference block covers a plurality of decoded blocks in a decoded video frame, an encoding parameter of each of the covered plurality of decoded blocks; and the fourth calculation module is used for taking the ratio of the area of each decoded block covered in the reference block to the total area of the reference block as a weight, and performing weighted summation calculation on the coding parameters of each decoded block to obtain the coding parameters of the reference block.
As an alternative example, the decoding unit includes: and the second obtaining module is used for obtaining the flag bits carried in the block to be decoded under the condition that the number of the reference blocks is different, wherein the flag bits are used for indicating the number relation between the block to be decoded and the reference blocks.
According to an aspect of the embodiments of the present invention, there is also provided a video encoding apparatus, including: an obtaining unit, configured to obtain coding parameters of a coded video frame that precedes a video frame to be coded and coding parameters of one or more reference blocks in the coded video frame, where a position of the reference block in the coded video frame is the same as a position of a block to be coded in the video frame to be coded, and the coding parameters include at least one of: directional prediction mode, quantization parameter, length of motion vector; a determining unit, configured to determine a target resolution for encoding the block to be encoded according to the encoding parameter of the encoded video frame and the encoding parameter of the reference block; and the coding unit is used for coding the block to be coded by adopting the target resolution.
As an optional example, the determining unit includes: a first calculation module for performing a weighted summation of the directional prediction mode of the encoded video frame and the directional prediction mode of the reference block to obtain a total directional prediction mode; a first determining module, configured to determine that the target resolution is a first resolution if the total directional prediction mode is greater than a first predetermined threshold; a second determining module, configured to determine the target resolution as a second resolution when the total directional prediction mode is less than or equal to a first predetermined threshold and greater than a second predetermined threshold, where the first resolution is less than the second resolution, and the second predetermined threshold is less than the first predetermined threshold; and a third determining module, configured to determine the target resolution as a third resolution when the total directional prediction mode is less than or equal to a second predetermined threshold and greater than a third predetermined threshold, where the second resolution is less than the third resolution, and the third predetermined threshold is less than the second predetermined threshold.
As an optional example, the determining unit includes: the second calculation module is used for carrying out weighted summation on the quantization parameters of the coded video frame and the quantization parameters of the reference block to obtain total quantization parameters; a fourth determining module, configured to determine that the target resolution is the first resolution when the totalization parameter is greater than a fourth predetermined threshold; a fifth determining module, configured to determine the target resolution as a second resolution when the totalization parameter is less than or equal to a fourth predetermined threshold and greater than a fifth predetermined threshold, where the first resolution is less than the second resolution, and the fifth predetermined threshold is less than the fourth predetermined threshold; and the sixth determining module is used for determining the target resolution as a third resolution under the condition that the totalization parameter is less than or equal to a fifth preset threshold and greater than a sixth preset threshold, wherein the second resolution is less than the third resolution, and the sixth preset threshold is less than the fifth preset threshold.
As an optional example, the determining unit includes: the third calculation module is used for carrying out weighted summation on the length of the motion vector of the coded video frame and the length of the motion vector of the reference block to obtain the length of the total motion vector; a seventh determining module, configured to determine that the target resolution is the first resolution if the length of the total motion vector is greater than a seventh predetermined threshold; an eighth determining module, configured to determine the target resolution as a second resolution when the length of the total motion vector is smaller than or equal to a seventh predetermined threshold and larger than an eighth predetermined threshold, where the first resolution is smaller than the second resolution, and the eighth predetermined threshold is smaller than the seventh predetermined threshold; and a ninth determining module, configured to determine the target resolution as a third resolution if the length of the total motion vector is smaller than or equal to an eighth predetermined threshold and larger than a ninth predetermined threshold, where the second resolution is smaller than the third resolution, and the ninth predetermined threshold is smaller than the eighth predetermined threshold.
As an optional example, the obtaining unit includes: the device comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring the coding parameters of each block of coded blocks in a plurality of covered coded blocks under the condition that a reference block covers the plurality of coded blocks in a coded video frame; and the fourth calculation module is used for taking the ratio of the area of each coded block covered in the reference block to the total area of the reference block as weight, and carrying out weighted summation calculation on the coding parameters of each coded block to obtain the coding parameters of the reference block.
As an alternative example, the encoding unit includes: and the setting module is used for setting a flag bit in the coded data obtained by coding the block to be coded under the condition that the number of the reference blocks is different, wherein the flag bit is used for indicating the number relation between the block to be coded and the reference blocks.
According to an aspect of the embodiments of the present invention, there is also provided a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned video decoding method when running.
According to an aspect of the embodiments of the present invention, there is also provided an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the video decoding method or the video encoding method through the computer program.
In the embodiment of the present invention, a method for obtaining an encoding parameter of a decoded video frame before a video frame to be decoded and an encoding parameter of a reference block in the decoded video frame is adopted, determining a target resolution for decoding the block to be decoded according to the encoding parameter of the decoded video frame and the encoding parameter of the reference block, and decoding the block to be decoded by adopting the target resolution. In the method, when the block to be decoded is decoded, the decoded reference block and the decoded video frame can be used for determining the target resolution used when the block to be decoded is decoded, so that the target resolution of different blocks to be decoded can be different when the block to be decoded is decoded, the effect of coding and decoding different blocks in the video frame by adopting different target resolutions is realized, the flexibility of coding and decoding the video frame is improved, and the technical problem that the flexibility of coding and decoding the video frame is poor in the related technology is solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
FIG. 1 is a prior art schematic according to the prior art;
fig. 2 is a schematic diagram of an application scenario of an alternative video decoding method according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of an application scenario of another alternative video decoding method according to an embodiment of the present invention
FIG. 4 is a flow chart illustrating an alternative video decoding method according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of an alternative video decoding method according to an embodiment of the present invention;
fig. 6 is a schematic diagram of an alternative video encoding method according to an embodiment of the present invention;
FIG. 7 is a schematic diagram of an alternative video decoding method according to an embodiment of the present invention;
fig. 8 is a schematic diagram of another alternative video encoding method according to an embodiment of the present invention;
fig. 9 is a flow chart illustrating an alternative video encoding method according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of an alternative video decoding apparatus according to an embodiment of the present invention;
fig. 11 is a schematic structural diagram of an alternative video encoding apparatus according to an embodiment of the present invention;
fig. 12 is a schematic structural diagram of another alternative video encoding apparatus according to an embodiment of the present invention;
FIG. 13 is a schematic diagram of an alternative electronic device according to an embodiment of the invention;
FIG. 14 is a schematic diagram of an alternative electronic device according to an embodiment of the invention;
FIG. 15 is a schematic diagram of an alternative electronic device according to an embodiment of the invention;
fig. 16 is a schematic structural diagram of yet another alternative electronic device according to an embodiment of the invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
According to an aspect of the embodiments of the present invention, there is provided a video decoding method, which may be applied, but not limited, to the environment shown in fig. 2 as an optional implementation manner.
Fig. 2 is a simplified block diagram of a communication system (200) according to an embodiment disclosed herein. The communication system (200) includes a plurality of terminal devices that can communicate with each other through, for example, a network (250). For example, a communication system (200) includes a first terminal device (210) and a second terminal device (220) interconnected by a network (250). In the embodiment of fig. 2, the first terminal device (210) and the second terminal device (220) perform unidirectional data transmission. For example, a first end device (210) may encode video data, such as a stream of video pictures captured by the end device (210), for transmission over a network (250) to a second end device (220). The encoded video data is transmitted in the form of one or more encoded video streams. The second terminal device (220) may receive the encoded video data from the network (250), decode the encoded video data to recover the video data, and display a video picture according to the recovered video data. Unidirectional data transmission is common in applications such as media services.
In another embodiment, the communication system (200) comprises a third terminal device (230) and a fourth terminal device (240) performing a bi-directional transmission of encoded video data, which may occur, for example, during a video conference. For bi-directional data transmission, each of the third terminal device (230) and the fourth terminal device (240) may encode video data (e.g., a stream of video pictures captured by the terminal device) for transmission over the network (250) to the other of the third terminal device (230) and the fourth terminal device (240). Each of the third terminal device (230) and the fourth terminal device (240) may also receive encoded video data transmitted by the other of the third terminal device (230) and the fourth terminal device (240), and may decode the encoded video data to recover the video data, and may display video pictures on an accessible display device according to the recovered video data.
In the embodiment of fig. 2, the first terminal device (210), the second terminal device (220), the third terminal device (230), and the fourth terminal device (240) may be a server, a personal computer, and a smart phone, but the principles disclosed herein may not be limited thereto. Embodiments disclosed herein are applicable to laptop computers, tablet computers, media players, and/or dedicated video conferencing equipment. Network (250) represents any number of networks that communicate encoded video data between first terminal device (210), second terminal device (220), third terminal device (230), and fourth terminal device (240), including, for example, wired (wired) and/or wireless communication networks. The communication network (250) may exchange data in circuit-switched and/or packet-switched channels. The network may include a telecommunications network, a local area network, a wide area network, and/or the internet. For purposes of this application, the architecture and topology of the network (250) may be immaterial to the operation disclosed herein, unless explained below.
By way of example, fig. 3 illustrates the placement of a video encoder and a video decoder in a streaming environment. The subject matter disclosed herein is equally applicable to other video-enabled applications including, for example, video conferencing, digital TV, storing compressed video on digital media including CDs, DVDs, memory sticks, and the like.
The streaming system may include an acquisition subsystem (313), which may include a video source (301), such as a digital camera, that creates an uncompressed video picture stream (302). In an embodiment, the video picture stream (302) includes samples taken by a digital camera. The video picture stream (302) is depicted as a thick line to emphasize a high data amount video picture stream compared to the encoded video data (304) (or the encoded video bitstream), the video picture stream (302) being processable by the electronic device (320), the electronic device (320) comprising a video encoder (303) coupled to the video source (301). The video encoder (303) may comprise hardware, software, or a combination of hardware and software to implement or embody aspects of the disclosed subject matter as described in more detail below. The encoded video data (304) (or encoded video codestream (304)) is depicted as a thin line to emphasize the lower data amount of the encoded video data (304) (or encoded video codestream (304)) as compared to the video picture stream (302), which may be stored on a streaming server (305) for future use. One or more streaming client subsystems, such as client subsystem (306) and client subsystem (308) in fig. 3, may access streaming server (305) to retrieve copies (307) and copies (309) of encoded video data (304). The client subsystem (306) may include, for example, a video decoder (310) in an electronic device (330). The video decoder (310) decodes incoming copies (307) of the encoded video data and generates an output video picture stream (311) that may be presented on a display (312), such as a display screen, or another presentation device (not depicted). In some streaming systems, encoded video data (304), video data (307), and video data (309) (e.g., video streams) may be encoded according to certain video encoding/compression standards. Examples of such standards include ITU-T H.265. In an embodiment, the Video Coding standard under development is informally referred to as next generation Video Coding (VVC), and the present application may be used in the context of the VVC standard.
It should be noted that electronic device (320) and electronic device (330) may include other components (not shown). For example, the electronic device (320) may include a video decoder (not shown), and the electronic device (330) may also include a video encoder (not shown).
Optionally, as an optional implementation manner, as shown in fig. 4, the video decoding method includes:
s402, acquiring the encoding parameters of the decoded video frame before the video frame to be decoded and the encoding parameters of one or more reference blocks in the decoded video frame, wherein the position of the reference block in the decoded video frame is the same as the position of the block to be decoded in the video frame to be decoded, and the encoding parameters include at least one of the following: directional prediction mode, quantization parameter, length of motion vector;
s404, determining a target resolution for decoding a block to be decoded according to the coding parameters of the decoded video frame and the coding parameters of the reference block;
s406, decoding the block to be decoded by adopting the target resolution.
Alternatively, the above video decoding method can be applied, but not limited to, in the process of encoding and decoding video frames.
For example, in the process of encoding and decoding a video frame, during encoding, for an encoded video frame before a video frame and a reference block in the encoded video frame, the target resolution for encoding the block to be encoded is determined by using the encoding parameters of the encoded video frame and the reference block in the encoded video frame, and the block to be encoded is encoded by using the target resolution. When decoding, the same method is used for determining a decoded video frame of a block to be decoded and a reference block in the decoded video frame, the target resolution for decoding the block to be decoded is determined by using the encoding parameters of the reference block in the decoded video frame and the decoded video frame, and the block to be decoded is decoded by using the target resolution.
Alternatively, the target resolution in the present scheme may be what is commonly referred to as the resolution by convention. For example, the target resolution may be 1920 × 1080 or the like available resolution. Or, a resolution dictated by the relevant standard.
Alternatively, the encoding parameters in this scheme may include, but are not limited to, a directional prediction Mode (DM), a Quantization Parameter (QP), a Motion Vector (MV), and a motion vector (length of MV) indicating the relative displacement between the current encoding block and the best matching block in its reference picture.
Alternatively, the present scheme is explained from encoding to decoding. The video frame to be encoded in the present scheme may be preceded by one or more encoded video frames. For the case where the video frame to be encoded includes a plurality of encoded video frames prior. The coded video frames of the multiple frames all include reference blocks, that is, a block to be coded in the video frame to be coded includes multiple corresponding reference blocks.
Alternatively, the encoded video frames may be consecutive video frames or non-consecutive video frames. For example, for a 10-frame video, where the 8 th frame is a video frame to be encoded, when a block to be encoded in the video frame to be encoded is encoded, the block to be encoded may be encoded according to the encoding parameters of the 1 st frame, the 3 rd frame, and the 5 th frame and the encoding parameters of the reference block in the frame.
Optionally, the video frame to be encoded and the encoded video frame in the present scheme may be split into a plurality of blocks. Each block to be encoded in a video frame to be encoded may correspond to a reference block in an encoded video frame. The reference block may coincide with a coded block in the coded video frame or the reference block may cover a portion of a plurality of blocks in the coded video frame. For example, as shown in fig. 5, fig. 5 is a case where a reference block of a block to be encoded in a video frame to be encoded covers a portion of a plurality of encoded blocks in an encoded video frame. A reference block 504 of the block to be encoded 502 covers a plurality of encoded blocks 506.
Or, optionally, the reference block of the video frame to be coded/decoded may also coincide with one coded/decoded block in the coded/decoded video frame.
After determining an encoded video frame and an encoded block for determining a target resolution for encoding a block to be encoded, it is necessary to obtain encoding parameters of reference blocks in the encoded video frame and the encoded block.
Optionally, the coding parameters in the present scheme include at least one of: directional prediction mode, quantization parameter, length of motion vector.
Alternatively, the above-mentioned encoding parameters may be used alone or in combination.
For example, for the case of stand-alone use, the directional prediction mode of a reference block in an encoded video frame is obtained. Alternatively, the directional prediction Mode in the present solution may be a Directional Mode (DM), or may also be referred to as an intra prediction Mode. The directional prediction modes are a series of numbers in the video coding standard. Each directional pattern corresponds to a numerical value. For a reference block, one or more pixels may be included. And acquiring the directional prediction mode of each pixel point. For example, the directional prediction mode of a pixel is 1, and when a reference block includes a pixel, the directional prediction mode of the pixel is determined as the directional prediction mode of the reference block. And under the condition that the reference block has a plurality of pixel points, calculating the variance of the directional prediction modes of the pixel points. For example, if the directional prediction modes of the reference block including four pixels are 1, 3, 4, and 8, the variances of 1, 3, 4, and 8 are calculated, and the calculated variance is used as the directional prediction mode of the reference block.
After the directional prediction mode of the reference block is obtained, the directional prediction mode of each of the other blocks in the encoded video frame may also be obtained. The directional prediction modes for each block are then weighted and summed to obtain the directional prediction mode for the encoded video frame. Further, the directional prediction mode of the reference block and the directional prediction mode of the encoded block may be weighted and summed to obtain a total directional prediction mode. And determining the target resolution for coding the block to be coded according to the total directional prediction mode.
Alternatively, if there are multiple encoded video frames, the total directional prediction mode of each encoded video frame may be obtained, and then weighted and summed, and the weighted and summed result is used as the total directional prediction mode.
Optionally, in a case that the total directional prediction mode is greater than a first predetermined threshold, determining the target resolution as a first resolution; determining the target resolution as a second resolution under the condition that the total directional prediction mode is less than or equal to a first preset threshold and greater than a second preset threshold, wherein the first resolution is less than the second resolution, and the second preset threshold is less than the first preset threshold; and determining the target resolution as a third resolution when the total directional prediction mode is less than or equal to a second predetermined threshold and greater than a third predetermined threshold, wherein the second resolution is less than the third resolution, and the third predetermined threshold is less than the second predetermined threshold.
For the case of separate use, the quantization parameters of the reference block are obtained, then the quantization parameters of each block except the reference block are obtained, and the quantization parameters of each block including the reference block are subjected to weighted summation to obtain the quantization parameters of the coded video frame. The quantization parameter of the reference block and the quantization parameter of the encoded video frame are weighted and summed to obtain a total quantization parameter. And determining the target resolution for coding the block to be coded according to the totalization parameters. If the number of the coded video frames is multiple, the total quantization parameters of each coded video frame can be subjected to weighted summation to obtain new total quantization parameters, and the target resolution is determined by using the new total quantization parameters.
Optionally, in a case that the totalization parameter is greater than a fourth predetermined threshold, determining the target resolution as the first resolution; determining the target resolution as a second resolution under the condition that the totalization parameter is less than or equal to a fourth preset threshold and greater than a fifth preset threshold, wherein the first resolution is less than the second resolution, and the fifth preset threshold is less than the fourth preset threshold; and under the condition that the totalization parameter is less than or equal to a fifth preset threshold and greater than a sixth preset threshold, determining the target resolution as a third resolution, wherein the second resolution is less than the third resolution, and the sixth preset threshold is less than the fifth preset threshold.
For the case of separate use, the length of the motion vector of the reference block is obtained, then the length of the motion vector of each block other than the reference block is obtained, and the lengths of the motion vectors of each block including the reference block are subjected to weighted summation to obtain the length of the motion vector of the encoded video frame. The length of the total motion vector can be obtained by weighted summation of the length of the motion vector of the reference block and the length of the motion vector of the encoded video frame. And determining the target resolution for coding the block to be coded according to the length of the total motion vector. If the number of the coded video frames is multiple, the length of the total motion vector of each coded video frame can be subjected to weighted summation to obtain the length of a new total motion vector, and the target resolution is determined by using the length of the new total motion vector.
Optionally, in a case where the length of the total motion vector is greater than a seventh predetermined threshold, determining the target resolution as the first resolution; determining the target resolution as a second resolution in the case that the length of the total motion vector is less than or equal to a seventh predetermined threshold and greater than an eighth predetermined threshold, wherein the first resolution is less than the second resolution, and the eighth predetermined threshold is less than the seventh predetermined threshold; and determining the target resolution as a third resolution in the case that the length of the total motion vector is less than or equal to an eighth predetermined threshold and greater than a ninth predetermined threshold, wherein the second resolution is less than the third resolution, and the ninth predetermined threshold is less than the eighth predetermined threshold.
For the case of mixed use of the encoding parameters, the obtained total encoding parameters may be subjected to weighted summation to obtain a final reference value, and the target resolution may be determined according to the final reference value.
For example, if the encoding parameters include a directional prediction mode and a quantization parameter, the total directional prediction mode and the total quantization parameter of the encoded video frame may be obtained by the above method, and then the total directional prediction mode and the total quantization parameter are weighted and summed to obtain a final reference value.
Optionally, in a case where the reference value is greater than a tenth predetermined threshold, determining the target resolution as the first resolution; determining the target resolution as a second resolution in the case that the reference value is less than or equal to a tenth predetermined threshold and greater than an eleventh predetermined threshold, wherein the first resolution is less than the second resolution, and the eleventh predetermined threshold is less than the tenth predetermined threshold; and determining the target resolution to be the third resolution if the reference value is less than or equal to an eleventh predetermined threshold and greater than a twelfth predetermined threshold, wherein the twelfth predetermined threshold is less than the eleventh predetermined threshold, and the second resolution is less than the third resolution value.
Optionally, after determining the target resolution, the target resolution may be used to encode a block to be encoded in the video frame to be encoded. For each block to be encoded in a video frame to be encoded, a target resolution for encoding needs to be determined.
Optionally, in the present solution, after all blocks to be encoded in a video frame are encoded, the encoded video frame is obtained, and resolutions of respective blocks of the video frame may be the same or different. And sending the encoded video frame or the video consisting of all the encoded video frames to a decoding side, and decoding by the decoding side.
The video frame to be decoded in the present scheme may be preceded by one or more decoded video frames. For the case where the video frame to be decoded includes a plurality of decoded video frames before it. The reference blocks are included in the decoded video frames of the multiple frames, that is, the blocks to be decoded in the video frames to be decoded include a plurality of corresponding reference blocks.
Alternatively, the decoded video frames may be consecutive video frames or non-consecutive video frames. For example, for a 10-frame video, where the 8 th frame is a video frame to be decoded, when a block to be decoded in the video frame to be decoded is decoded, the block to be decoded may be decoded according to the coding parameters of the 1 st frame, the 3 rd frame, and the 5 th frame and the coding parameters of the reference block in the frame.
Optionally, the video frame to be decoded and the decoded video frame in the present scheme may be split into a plurality of blocks. Each block to be decoded in a video frame to be decoded may correspond to a reference block in a decoded video frame. The reference block may coincide with a decoded block in the decoded video frame or the reference block may cover a portion of a plurality of blocks in the decoded video frame. For example, as shown in fig. 6, fig. 6 is a case where a reference block of a block to be decoded in a video frame to be decoded covers a part of a plurality of blocks in a decoded video frame. The reference block 604 of the block to be decoded 602 covers a plurality of decoded blocks 606.
After the decoded video frame and the decoded block for determining the target resolution at the time of decoding of the block to be decoded are determined, it is necessary to acquire the encoding parameters of the decoded video frame and the decoded block.
Optionally, the coding parameters in the present scheme include at least one of: directional prediction mode, quantization parameter, length of motion vector.
Alternatively, the above-mentioned encoding parameters may be used alone or in combination.
For example, for the case of stand-alone use, the directional prediction mode of the reference block in the decoded video frame is obtained. After the directional prediction mode of the reference block is obtained, the directional prediction mode of each of the other blocks in the decoded video frame may also be obtained. The directional prediction modes for each block are then weighted and summed to obtain the directional prediction mode for the decoded video frame. Further, the directional prediction mode of the reference block and the directional prediction mode of the decoded block may be weighted and summed to obtain a total directional prediction mode. And determining the target resolution for decoding the block to be decoded according to the total directional prediction mode.
Alternatively, if there are multiple decoded video frames, the total directional prediction mode of each decoded video frame may be obtained, and then weighted and summed, and the weighted and summed result is used as the total directional prediction mode.
Optionally, in a case that the total directional prediction mode is greater than a first predetermined threshold, determining the target resolution as a first resolution; determining the target resolution as a second resolution under the condition that the total directional prediction mode is less than or equal to a first preset threshold and greater than a second preset threshold, wherein the first resolution is less than the second resolution, and the second preset threshold is less than the first preset threshold; and determining the target resolution as a third resolution when the total directional prediction mode is less than or equal to a second predetermined threshold and greater than a third predetermined threshold, wherein the second resolution is less than the third resolution, and the third predetermined threshold is less than the second predetermined threshold.
For the case of separate use, the quantization parameters of the reference block are obtained, then the quantization parameters of each block except the reference block are obtained, and the quantization parameters of each block including the reference block are subjected to weighted summation to obtain the quantization parameters of the decoded video frame. The quantization parameter of the reference block and the quantization parameter of the decoded video frame are subjected to weighted summation to obtain a total quantization parameter. And determining the target resolution for decoding the block to be decoded according to the totalization parameter. If the decoded video frames contain a plurality of frames, the total quantization parameters of each decoded video frame can be subjected to weighted summation to obtain new total quantization parameters, and the target resolution is determined by using the new total quantization parameters.
Optionally, in a case that the totalization parameter is greater than a fourth predetermined threshold, determining the target resolution as the first resolution; determining the target resolution as a second resolution under the condition that the totalization parameter is less than or equal to a fourth preset threshold and greater than a fifth preset threshold, wherein the first resolution is less than the second resolution, and the fifth preset threshold is less than the fourth preset threshold; and under the condition that the totalization parameter is less than or equal to a fifth preset threshold and greater than a sixth preset threshold, determining the target resolution as a third resolution, wherein the second resolution is less than the third resolution, and the sixth preset threshold is less than the fifth preset threshold.
For the case of separate use, the length of the motion vector of the reference block is obtained, then the length of the motion vector of each block other than the reference block is obtained, and the lengths of the motion vectors of each block including the reference block are subjected to weighted summation to obtain the length of the motion vector of the decoded video frame. The length of the total motion vector can be obtained by weighted summation of the length of the motion vector of the reference block and the length of the motion vector of the decoded video frame. And determining the target resolution for decoding the block to be decoded according to the length of the total motion vector. If the decoded video frames contain a plurality of frames, the lengths of the total motion vectors of each decoded video frame can be subjected to weighted summation to obtain the length of a new total motion vector, and the target resolution is determined by using the length of the new total motion vector.
Optionally, in a case where the length of the total motion vector is greater than a seventh predetermined threshold, determining the target resolution as the first resolution; determining the target resolution as a second resolution in the case that the length of the total motion vector is less than or equal to a seventh predetermined threshold and greater than an eighth predetermined threshold, wherein the first resolution is less than the second resolution, and the eighth predetermined threshold is less than the seventh predetermined threshold; and determining the target resolution as a third resolution in the case that the length of the total motion vector is less than or equal to an eighth predetermined threshold and greater than a ninth predetermined threshold, wherein the second resolution is less than the third resolution, and the ninth predetermined threshold is less than the eighth predetermined threshold.
For the case of mixed use of the encoding parameters, the obtained total encoding parameters may be subjected to weighted summation to obtain a final reference value, and the target resolution may be determined according to the final reference value.
For example, if the encoding parameters include a directional prediction mode and a quantization parameter, the total directional prediction mode and the total quantization parameter of the decoded video frame may be obtained by the above method, and then the total directional prediction mode and the total quantization parameter are weighted and summed to obtain a final reference value.
Optionally, in a case where the reference value is greater than a tenth predetermined threshold, determining the target resolution as the first resolution; determining the target resolution as a second resolution in the case that the reference value is less than or equal to a tenth predetermined threshold and greater than an eleventh predetermined threshold, wherein the first resolution is less than the second resolution, and the eleventh predetermined threshold is less than the tenth predetermined threshold; and determining the target resolution to be the third resolution if the reference value is less than or equal to an eleventh predetermined threshold and greater than a twelfth predetermined threshold, wherein the twelfth predetermined threshold is less than the eleventh predetermined threshold, and the second resolution is less than the third resolution value.
Optionally, after determining the target resolution, the target resolution may be used to decode a block to be decoded in the video frame to be decoded. For each block to be decoded in a video frame to be decoded, a target resolution for decoding needs to be determined.
Optionally, in the present solution, during the process of decoding the video frame to be decoded, a plurality of blocks to be decoded in the video frame to be decoded may have different decoding resolutions. In this process, edge filtering processing may also be performed on pixels in two adjacent blocks to be decoded of different resolutions. For example, at least one pair of blocks to be decoded is determined for a plurality of blocks to be decoded, and each block to be decoded at least comprises two blocks to be decoded with different resolutions. Two blocks to be decoded of different resolutions are adjacent. At this time, it is necessary to perform edge filtering processing on two blocks to be decoded. Before processing, the resolution of the two blocks to be decoded needs to be adjusted to the same resolution. For example, the resolution of the first block to be decoded is adjusted to the resolution of the second block to be decoded (a group of blocks to be decoded includes the case of two blocks to be decoded), or the resolution of the second block to be decoded is adjusted to the resolution of the first block to be decoded, or the resolutions of the two blocks to be decoded are adjusted to other one resolution different from the resolutions of the two blocks to be decoded. After the adjustment, an edge filtering operation may be performed. When the edge filtering operation is executed, a first edge pixel point set is determined from a first block to be decoded, a second edge pixel point set is determined from a second block to be decoded, the positions of the first edge pixel point set and the second edge pixel point set are adjacent, namely, pixel points in the first edge pixel point set and the second edge pixel point set are adjacent pixel points of two blocks to be decoded. When the filtering processing is executed, the first edge pixel point set is subjected to filtering processing to obtain a filtered first edge pixel point set, and the second edge pixel point set is subjected to filtering processing to obtain a filtered second edge pixel point set, wherein a first difference value between a pixel value of an ith pixel point in the filtered first edge pixel point set and a pixel value of a jth pixel point in the filtered second edge pixel point set corresponding to the ith pixel point is smaller than a second difference value between a pixel value of the ith pixel point in the filtered first edge pixel point set and a pixel value of a jth pixel point in the filtered second edge pixel point set, i is a positive integer and is smaller than or equal to the total number of pixel points in the first edge pixel point set, j is a positive integer and is smaller than or equal to the total number of pixel points in the second edge pixel point set. The filtering processing aims to avoid obvious seams in the video in the reconstruction process, so that the content in the video is accurately restored, and the technical problem of video distortion caused by inconsistent resolution is solved.
Optionally, in the present scheme, during the process of encoding the video frame and decoding the video frame, the video frame may be split into the same or different blocks.
Alternatively, the encoding side and the decoding side may agree on a splitting method for the video frame in advance. Such as splitting into 4 blocks on average, etc. For the first block to be encoded/decoded, since there is no reference block, an encoding/decoding strategy may be agreed in advance to ensure that the video frame decoded by the decoding side is the same as the video frame before encoding by the encoding side.
Optionally, in the scheme, the video frame to be encoded and the video frame to be decoded may also be set to different splitting methods, and split into different target blocks. Alternatively, in the case that the splitting method is the same, the to-be-coded blocks/to-be-decoded blocks at the same positions in the to-be-coded video frame and the to-be-decoded video frame may use different numbers of already-coded/decoded video frames and reference blocks. In this case, at the time of encoding, the number of encoded video frames and reference blocks used by the block to be encoded needs to be transmitted to the decoding side so that the decoding side performs decoding according to the number. For example, when encoding, the encoded data carries flag bits indicating the number relationship between the blocks to be encoded and the encoded video frames and the reference blocks, and when decoding, decoding can be performed according to the number relationship carried in the flag bits.
Alternatively, a specific example is explained. For example, one video frame to be encoded includes 1 encoded video frame in front of it. As shown in fig. 7, when encoding a block to be encoded 702 in fig. 7, an encoded block 706 in an encoded video frame 704 may be determined as a reference block, and encoding parameters of the reference block may be determined. When the coding parameters of the reference block are determined, the coding parameters of each pixel point in one reference block are obtained, the variance of the coding parameters of each pixel point is calculated, the variance is determined as the coding parameters of the reference block, and the coding parameters of the reference block and the coding parameters of the coded video frame are subjected to weighted summation to obtain the total coding parameters. E.g. 8, the first predetermined threshold and the second predetermined threshold and the third predetermined threshold are obtained, e.g. 12, 7, 1, then the encoding parameters of the block to be encoded are between the first predetermined threshold and the second predetermined threshold. Then the block to be encoded 702 is encoded using the second resolution. And after the coding resolutions of all the blocks to be coded in the video frame to be coded are determined, coding each block to be coded by using the corresponding resolution. And transmits the encoded video frame to the decoding side. After receiving the video frame to be decoded, the decoding side may split the video frame to be decoded according to a manner agreed with the encoding side, and decode the block to be decoded by using a decoding manner agreed with the encoding side, as shown in fig. 8, the decoding side may determine a target resolution of the block to be decoded 802 by using the reference block 806 and the encoding parameter of the decoded video frame 804 according to the same means as the encoding side, and decode the block to be decoded by using the target resolution, so as to obtain a decoding result.
According to the embodiment, the target resolution for decoding the block to be decoded is determined according to the encoding parameter of the decoded video frame and the encoding parameter of the reference block by acquiring the encoding parameter of the decoded video frame before the video frame to be decoded and the encoding parameter of the reference block in the decoded video frame, and the block to be decoded is decoded by adopting the target resolution. In the method, when the block to be decoded is decoded, the decoded reference block and the decoded video frame can be used for determining the target resolution used when the block to be decoded is decoded, so that the target resolution of different blocks to be decoded can be different during decoding, the effect of coding and decoding different blocks in the video frame by adopting different target resolutions is realized, and the flexibility of coding and decoding the video frame is improved.
As an alternative implementation, determining a target resolution for decoding a block to be decoded according to an encoding parameter of a decoded video frame and an encoding parameter of a reference block includes:
s1, carrying out weighted summation on the directional prediction mode of the decoded video frame and the directional prediction mode of the reference block to obtain a total directional prediction mode;
s2, determining the target resolution as a first resolution under the condition that the total directional prediction mode is larger than a first preset threshold value;
s3, determining the target resolution as a second resolution when the total directional prediction mode is less than or equal to a first predetermined threshold and greater than a second predetermined threshold, wherein the first resolution is less than the second resolution, and the second predetermined threshold is less than the first predetermined threshold;
s4, in case the total directional prediction mode is less than or equal to a second predetermined threshold and greater than a third predetermined threshold, determining the target resolution as a third resolution, wherein the second resolution is less than the third resolution, and the third predetermined threshold is less than the second predetermined threshold.
By the method, the target resolution for decoding the block to be decoded is determined, and the flexibility of decoding the video frame is improved.
As an alternative implementation, determining a target resolution for decoding a block to be decoded according to an encoding parameter of a decoded video frame and an encoding parameter of a reference block includes:
s1, carrying out weighted summation on the quantization parameter of the decoded video frame and the quantization parameter of the reference block to obtain a total quantization parameter;
s2, determining the target resolution as the first resolution under the condition that the totalization parameter is greater than a fourth preset threshold;
s3, determining the target resolution as a second resolution under the condition that the totalization parameter is less than or equal to a fourth preset threshold and greater than a fifth preset threshold, wherein the first resolution is less than the second resolution, and the fifth preset threshold is less than the fourth preset threshold;
s4, determining the target resolution as a third resolution when the totalization parameter is less than or equal to a fifth predetermined threshold and greater than a sixth predetermined threshold, wherein the second resolution is less than the third resolution, and the sixth predetermined threshold is less than the fifth predetermined threshold.
By the method, the target resolution for decoding the block to be decoded is determined, and the flexibility of decoding the video frame is improved.
As an alternative implementation, determining a target resolution for decoding a block to be decoded according to an encoding parameter of a decoded video frame and an encoding parameter of a reference block includes:
s1, carrying out weighted summation on the length of the motion vector of the decoded video frame and the length of the motion vector of the reference block to obtain the length of the total motion vector;
s2, determining the target resolution as the first resolution in case that the length of the total motion vector is greater than a seventh predetermined threshold;
s3, determining the target resolution as a second resolution when the length of the total motion vector is less than or equal to a seventh predetermined threshold and greater than an eighth predetermined threshold, wherein the first resolution is less than the second resolution, and the eighth predetermined threshold is less than the seventh predetermined threshold;
s4, in case the length of the total motion vector is less than or equal to an eighth predetermined threshold and greater than a ninth predetermined threshold, determining the target resolution as a third resolution, wherein the second resolution is less than the third resolution, and the ninth predetermined threshold is less than the eighth predetermined threshold.
By the method, the target resolution for decoding the block to be decoded is determined, and the flexibility of decoding the video frame is improved.
As an alternative implementation, acquiring the encoding parameters of the reference block in the decoded video frame before the video frame to be decoded includes:
s1, under the condition that the reference block covers a plurality of blocks of decoded blocks in the decoded video frame, acquiring the coding parameters of each block of the covered plurality of blocks of decoded blocks;
and S2, taking the ratio of the area of each decoded block covered in the reference block to the total area of the reference block as a weight, and carrying out weighted summation calculation on the coding parameters of each decoded block to obtain the coding parameters of the reference block.
According to the embodiment, the encoding parameters of the reference block are determined by the method, so that the accuracy of determining the encoding parameters of the reference block is improved.
As an optional implementation, for different blocks to be decoded, the number of reference blocks corresponding to the blocks to be decoded is the same or different, wherein, in the case that the number of reference blocks is different, decoding the blocks to be decoded with the target resolution further includes:
s1, acquiring a flag bit carried in the block to be decoded, wherein the flag bit is used for indicating the number relation between the block to be decoded and the reference block.
According to the embodiment, the number relation between the block to be decoded and the reference block is obtained by using the method of the zone bit, so that the consistency of the encoding and decoding processes is ensured.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the invention. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required by the invention.
According to an aspect of the embodiment of the present invention, there is also provided a video encoding method. Optionally, as shown in fig. 9, the video encoding method includes:
s902, acquiring coding parameters of a coded video frame before a video frame to be coded and coding parameters of one or more reference blocks in the coded video frame, wherein the positions of the reference blocks in the coded video frame are the same as the positions of blocks to be coded in the video frame to be coded, and the coding parameters include at least one of the following: directional prediction mode, quantization parameter, length of motion vector;
s904, determining a target resolution for coding a to-be-coded block according to the coding parameters of the coded video frame and the coding parameters of the reference block;
and S906, encoding the to-be-encoded block by adopting the target resolution.
Alternatively, the above video encoding method can be applied, but not limited to, in the process of encoding and decoding video frames.
For example, in the process of encoding and decoding a video frame, during encoding, for an encoded video frame before a video frame and a reference block in the encoded video frame, the target resolution for encoding the block to be encoded is determined by using the encoding parameters of the encoded video frame and the reference block in the encoded video frame, and the block to be encoded is encoded by using the target resolution. When decoding, the same method is used for determining a decoded video frame of a block to be decoded and a reference block in the decoded video frame, the target resolution for decoding the block to be decoded is determined by using the encoding parameters of the reference block in the decoded video frame and the decoded video frame, and the block to be decoded is decoded by using the target resolution.
Optionally, please refer to various situations in the above embodiments for specific encoding examples in the present solution, which is not described herein again.
As an alternative implementation, determining a target resolution for encoding a block to be encoded according to encoding parameters of an encoded video frame and encoding parameters of a reference block includes:
s1, carrying out weighted summation on the directional prediction mode of the coded video frame and the directional prediction mode of the reference block to obtain a total directional prediction mode;
s2, determining the target resolution as a first resolution under the condition that the total directional prediction mode is larger than a first preset threshold value;
s3, determining the target resolution as a second resolution when the total directional prediction mode is less than or equal to a first predetermined threshold and greater than a second predetermined threshold, wherein the first resolution is less than the second resolution, and the second predetermined threshold is less than the first predetermined threshold;
s4, in case the total directional prediction mode is less than or equal to a second predetermined threshold and greater than a third predetermined threshold, determining the target resolution as a third resolution, wherein the second resolution is less than the third resolution, and the third predetermined threshold is less than the second predetermined threshold.
According to the embodiment, the target resolution for coding the block to be coded is determined by the method, so that the coding flexibility for coding the video frame is improved.
As an alternative implementation, determining a target resolution for encoding a block to be encoded according to encoding parameters of an encoded video frame and encoding parameters of a reference block includes:
s1, weighting and summing the quantization parameter of the coded video frame and the quantization parameter of the reference block to obtain a total quantization parameter;
s2, determining the target resolution as the first resolution under the condition that the totalization parameter is greater than a fourth preset threshold;
s3, determining the target resolution as a second resolution under the condition that the totalization parameter is less than or equal to a fourth preset threshold and greater than a fifth preset threshold, wherein the first resolution is less than the second resolution, and the fifth preset threshold is less than the fourth preset threshold;
s4, determining the target resolution as a third resolution when the totalization parameter is less than or equal to a fifth predetermined threshold and greater than a sixth predetermined threshold, wherein the second resolution is less than the third resolution, and the sixth predetermined threshold is less than the fifth predetermined threshold.
According to the embodiment, the target resolution for coding the block to be coded is determined by the method, so that the coding flexibility for coding the video frame is improved.
As an alternative implementation, determining a target resolution for encoding a block to be encoded according to encoding parameters of an encoded video frame and encoding parameters of a reference block includes:
s1, carrying out weighted summation on the length of the motion vector of the coded video frame and the length of the motion vector of the reference block to obtain the length of the total motion vector;
s2, determining the target resolution as the first resolution in case that the length of the total motion vector is greater than a seventh predetermined threshold;
s3, determining the target resolution as a second resolution when the length of the total motion vector is less than or equal to a seventh predetermined threshold and greater than an eighth predetermined threshold, wherein the first resolution is less than the second resolution, and the eighth predetermined threshold is less than the seventh predetermined threshold;
s4, in case the length of the total motion vector is less than or equal to an eighth predetermined threshold and greater than a ninth predetermined threshold, determining the target resolution as a third resolution, wherein the second resolution is less than the third resolution, and the ninth predetermined threshold is less than the eighth predetermined threshold.
According to the embodiment, the target resolution for coding the block to be coded is determined by the method, so that the coding flexibility for coding the video frame is improved.
As an alternative implementation, acquiring the encoding parameters of the reference block in the encoded video frame before the video frame to be encoded includes:
s1, under the condition that a reference block covers a plurality of coded blocks in a coded video frame, acquiring the coding parameter of each coded block in the covered coded blocks;
and S2, taking the ratio of the area of each coded block covered in the reference block to the total area of the reference block as weight, and carrying out weighted summation calculation on the coding parameters of each coded block to obtain the coding parameters of the reference block.
According to the embodiment, the encoding parameters of the reference block are determined by the method, so that the accuracy of determining the encoding parameters of the reference block is improved.
As an optional implementation, for different blocks to be encoded, the number of reference blocks corresponding to the blocks to be encoded is the same or different, where, in the case that the number of reference blocks is different, encoding the blocks to be encoded with the target resolution further includes:
and S1, setting a flag bit in the coded data obtained by coding the block to be coded, wherein the flag bit is used for indicating the number relation between the block to be coded and the reference block.
By the embodiment, the number relation between the block to be coded and the reference block is transmitted by using the flag bit method, so that the consistency of the coding and decoding processes is ensured.
According to an aspect of the embodiments of the present invention, there is also provided a video decoding apparatus for implementing the above video decoding method. As shown in fig. 10, the apparatus includes:
(1) an obtaining unit 1002, configured to obtain coding parameters of a decoded video frame before a video frame to be decoded and coding parameters of one or more reference blocks in the decoded video frame, where a position of a reference block in the decoded video frame is the same as a position of a block to be decoded in the video frame to be decoded, and the coding parameters include at least one of: directional prediction mode, quantization parameter, length of motion vector;
(2) a determining unit 1004, configured to determine a target resolution for decoding a block to be decoded according to an encoding parameter of a decoded video frame and an encoding parameter of a reference block;
(3) a decoding unit 1006, configured to decode the block to be decoded with the target resolution.
Alternatively, the video decoding apparatus can be applied to, but not limited to, encoding and decoding of video frames.
For example, in the process of encoding and decoding a video frame, during encoding, for an encoded video frame before a video frame and a reference block in the encoded video frame, the target resolution for encoding the block to be encoded is determined by using the encoding parameters of the encoded video frame and the reference block in the encoded video frame, and the block to be encoded is encoded by using the target resolution. When decoding, the same method is used for determining the reference blocks in the coded video frame and the coded video frame of one block to be decoded, the coding parameters of the reference blocks in the coded video frame and the coded video frame are used for determining the target resolution for decoding the block to be decoded, and the target resolution is used for decoding the block to be decoded.
Optionally, please refer to various situations in the above embodiments for specific encoding examples in the present solution, which is not described herein again.
As an alternative embodiment, the determining unit includes:
(1) a first calculation module, configured to perform weighted summation on a directional prediction mode of a decoded video frame and a directional prediction mode of a reference block to obtain a total directional prediction mode;
(2) a first determining module, configured to determine that the target resolution is a first resolution if the total directional prediction mode is greater than a first predetermined threshold;
(3) a second determining module, configured to determine the target resolution as a second resolution when the total directional prediction mode is less than or equal to a first predetermined threshold and greater than a second predetermined threshold, where the first resolution is less than the second resolution, and the second predetermined threshold is less than the first predetermined threshold;
(4) and a third determining module, configured to determine the target resolution as a third resolution when the total directional prediction mode is less than or equal to a second predetermined threshold and greater than a third predetermined threshold, where the second resolution is less than the third resolution, and the third predetermined threshold is less than the second predetermined threshold.
By the method, the target resolution for decoding the block to be decoded is determined, and the flexibility of decoding the video frame is improved.
As an alternative embodiment, the determining unit comprises:
(1) the second calculation module is used for carrying out weighted summation on the quantization parameters of the decoded video frame and the quantization parameters of the reference block to obtain total quantization parameters;
(2) a fourth determining module, configured to determine that the target resolution is the first resolution when the totalization parameter is greater than a fourth predetermined threshold;
(3) a fifth determining module, configured to determine the target resolution as a second resolution when the totalization parameter is less than or equal to a fourth predetermined threshold and greater than a fifth predetermined threshold, where the first resolution is less than the second resolution, and the fifth predetermined threshold is less than the fourth predetermined threshold;
(4) and the sixth determining module is used for determining the target resolution as a third resolution under the condition that the totalization parameter is less than or equal to a fifth preset threshold and greater than a sixth preset threshold, wherein the second resolution is less than the third resolution, and the sixth preset threshold is less than the fifth preset threshold.
By the method, the target resolution for decoding the block to be decoded is determined, and the flexibility of decoding the video frame is improved.
As an alternative embodiment, the determining unit comprises:
(1) the third calculation module is used for carrying out weighted summation on the length of the motion vector of the decoded video frame and the length of the motion vector of the reference block to obtain the length of the total motion vector;
(2) a seventh determining module, configured to determine that the target resolution is the first resolution if the length of the total motion vector is greater than a seventh predetermined threshold;
(3) an eighth determining module, configured to determine the target resolution as a second resolution when the length of the total motion vector is smaller than or equal to a seventh predetermined threshold and larger than an eighth predetermined threshold, where the first resolution is smaller than the second resolution, and the eighth predetermined threshold is smaller than the seventh predetermined threshold;
(4) and a ninth determining module, configured to determine the target resolution as a third resolution if the length of the total motion vector is smaller than or equal to an eighth predetermined threshold and larger than a ninth predetermined threshold, where the second resolution is smaller than the third resolution, and the ninth predetermined threshold is smaller than the eighth predetermined threshold.
By the method, the target resolution for decoding the block to be decoded is determined, and the flexibility of decoding the video frame is improved.
As an alternative embodiment, the obtaining unit comprises:
(1) a first obtaining module, configured to obtain, in a case where a reference block covers a plurality of decoded blocks in a decoded video frame, an encoding parameter of each of the covered plurality of decoded blocks;
(2) and the fourth calculation module is used for taking the ratio of the area of each decoded block covered in the reference block to the total area of the reference block as a weight, and performing weighted summation calculation on the coding parameters of each decoded block to obtain the coding parameters of the reference block.
According to the embodiment, the encoding parameters of the reference block are determined by the method, so that the accuracy of determining the encoding parameters of the reference block is improved.
As an optional implementation, the number of reference blocks corresponding to the block to be decoded is the same or different, and the decoding unit includes:
(1) and the second obtaining module is used for obtaining the flag bits carried in the block to be decoded under the condition that the number of the reference blocks is different, wherein the flag bits are used for indicating the number relation between the block to be decoded and the reference blocks.
According to the embodiment, the number relation between the block to be decoded and the reference block is obtained by using the method of the zone bit, so that the consistency of the encoding and decoding processes is ensured.
According to an aspect of the embodiments of the present invention, there is also provided a video encoding apparatus for implementing the above-described video encoding method. As shown in fig. 11, the apparatus includes:
(1) an obtaining unit 1102, configured to obtain coding parameters of a coded video frame that precedes a video frame to be coded and coding parameters of one or more reference blocks in the coded video frame, where a position of a reference block in the coded video frame is the same as a position of a block to be coded in the video frame to be coded, and the coding parameters include at least one of: directional prediction mode, quantization parameter, length of motion vector;
(2) a determining unit 1104, configured to determine, according to the encoding parameters of the encoded video frame and the encoding parameters of the reference block, a target resolution for encoding a block to be encoded;
(3) an encoding unit 1106 is configured to encode the block to be encoded with the target resolution.
Alternatively, the video encoding apparatus can be applied to, but not limited to, encoding and decoding of video frames.
For example, in the process of encoding and decoding a video frame, during encoding, for an encoded video frame before a video frame and a reference block in the encoded video frame, the target resolution for encoding the block to be encoded is determined by using the encoding parameters of the encoded video frame and the reference block in the encoded video frame, and the block to be encoded is encoded by using the target resolution. When decoding, the same method is used for determining the reference blocks in the coded video frame and the coded video frame of one block to be decoded, the coding parameters of the reference blocks in the coded video frame and the coded video frame are used for determining the target resolution for decoding the block to be decoded, and the target resolution is used for decoding the block to be decoded.
Optionally, please refer to various situations in the above embodiments for specific encoding examples in the present solution, which is not described herein again.
As an alternative embodiment, the determining unit comprises:
(1) a first calculation module for performing a weighted summation of the directional prediction mode of the encoded video frame and the directional prediction mode of the reference block to obtain a total directional prediction mode;
(2) a first determining module, configured to determine that the target resolution is a first resolution if the total directional prediction mode is greater than a first predetermined threshold;
(3) a second determining module, configured to determine the target resolution as a second resolution when the total directional prediction mode is less than or equal to a first predetermined threshold and greater than a second predetermined threshold, where the first resolution is less than the second resolution, and the second predetermined threshold is less than the first predetermined threshold;
(4) and a third determining module, configured to determine the target resolution as a third resolution when the total directional prediction mode is less than or equal to a second predetermined threshold and greater than a third predetermined threshold, where the second resolution is less than the third resolution, and the third predetermined threshold is less than the second predetermined threshold.
According to the embodiment, the target resolution for coding the block to be coded is determined by the method, so that the coding flexibility for coding the video frame is improved.
As an alternative embodiment, the determining unit comprises:
(1) the second calculation module is used for carrying out weighted summation on the quantization parameters of the coded video frame and the quantization parameters of the reference block to obtain total quantization parameters;
(2) a fourth determining module, configured to determine that the target resolution is the first resolution when the totalization parameter is greater than a fourth predetermined threshold;
(3) a fifth determining module, configured to determine the target resolution as a second resolution when the totalization parameter is less than or equal to a fourth predetermined threshold and greater than a fifth predetermined threshold, where the first resolution is less than the second resolution, and the fifth predetermined threshold is less than the fourth predetermined threshold;
(4) and the sixth determining module is used for determining the target resolution as a third resolution under the condition that the totalization parameter is less than or equal to a fifth preset threshold and greater than a sixth preset threshold, wherein the second resolution is less than the third resolution, and the sixth preset threshold is less than the fifth preset threshold.
According to the embodiment, the target resolution for coding the block to be coded is determined by the method, so that the coding flexibility for coding the video frame is improved.
As an alternative embodiment, the determining unit comprises:
(1) the third calculation module is used for carrying out weighted summation on the length of the motion vector of the coded video frame and the length of the motion vector of the reference block to obtain the length of the total motion vector;
(2) a seventh determining module, configured to determine that the target resolution is the first resolution if the length of the total motion vector is greater than a seventh predetermined threshold;
(3) an eighth determining module, configured to determine the target resolution as a second resolution when the length of the total motion vector is smaller than or equal to a seventh predetermined threshold and larger than an eighth predetermined threshold, where the first resolution is smaller than the second resolution, and the eighth predetermined threshold is smaller than the seventh predetermined threshold;
(4) and a ninth determining module, configured to determine the target resolution as a third resolution if the length of the total motion vector is smaller than or equal to an eighth predetermined threshold and larger than a ninth predetermined threshold, where the second resolution is smaller than the third resolution, and the ninth predetermined threshold is smaller than the eighth predetermined threshold.
According to the embodiment, the target resolution for coding the block to be coded is determined by the method, so that the coding flexibility for coding the video frame is improved.
As an alternative embodiment, as shown in fig. 12, the obtaining unit includes:
(1) an obtaining module 1202, configured to obtain, when a reference block covers multiple covered coded blocks in a coded video frame, a coding parameter of each covered coded block in the multiple covered coded blocks;
(2) a fourth calculating module 1204, configured to take a ratio of an area of each coded block covered in the reference block to a total area of the reference block as a weight, and perform weighted summation calculation on the coding parameters of each coded block to obtain the coding parameters of the reference block.
According to the embodiment, the encoding parameters of the reference block are determined by the method, so that the accuracy of determining the encoding parameters of the reference block is improved.
As an optional implementation, for different blocks to be coded, the number of reference blocks corresponding to the blocks to be coded is the same or different, and the coding unit includes:
(1) and the setting module is used for setting a flag bit in the coded data obtained by coding the block to be coded under the condition that the number of the reference blocks is different, wherein the flag bit is used for indicating the number relation between the block to be coded and the reference blocks.
By the embodiment, the number relation between the block to be coded and the reference block is transmitted by using the flag bit method, so that the consistency of the coding and decoding processes is ensured.
According to a further aspect of the embodiments of the present invention, there is also provided an electronic device for implementing the above-mentioned video decoding method, optionally, the electronic device in this scheme may include a memory and a processor, the memory may store a computer program, and the processor is configured to execute the steps in any of the above-mentioned decoding method embodiments through the computer program.
Optionally, in this embodiment, the electronic device may be located in at least one network device of a plurality of network devices of a computer network.
Optionally, in this embodiment, the processor may be configured to execute the following steps by a computer program:
s1, acquiring the encoding parameters of the decoded video frame before the video frame to be decoded and the encoding parameters of one or more reference blocks in the decoded video frame, wherein the position of the reference block in the decoded video frame is the same as the position of the block to be decoded in the video frame to be decoded, and the encoding parameters include at least one of the following: directional prediction mode, quantization parameter, length of motion vector;
s2, determining the target resolution for decoding the block to be decoded according to the coding parameters of the decoded video frame and the coding parameters of the reference block;
and S3, decoding the block to be decoded by adopting the target resolution.
Alternatively, as an alternative implementation, as shown in fig. 13, the electronic device in the present embodiment may be an electronic apparatus (1330). The electronic device (1330) may include a receiver (1331), such as a receive circuit. The receiver (1331) may receive one or more encoded video sequences to be decoded by the video decoder (1310); in the same or another embodiment, the encoded video sequences are received one at a time, wherein each encoded video sequence is decoded independently of the other encoded video sequences. The encoded video sequence may be received from a channel (1301), which may be a hardware/software link to a storage device that stores encoded video data. The receiver (1331) may receive encoded video data as well as other data, e.g., encoded audio data and/or auxiliary data streams, which may be forwarded to their respective usage entities (not labeled). The receiver (1331) may separate the encoded video sequence from other data. To prevent network jitter, a buffer memory (1315) may be coupled between the receiver (1331) and an entropy decoder/parser (1320) (hereinafter "parser (1320)"). In some applications, the buffer memory (1315) is part of the video decoder (1310). In other cases, the buffer memory (1315) may be located external (not labeled) to the video decoder (1310). While in other cases a buffer memory (not labeled) is provided external to the video decoder (1310), e.g., to prevent network jitter, and another buffer memory (1315) may be configured internal to the video decoder (1310), e.g., to handle playout timing. The buffer memory (1315) may not be required to be configured or may be made smaller when the receiver (1331) receives data from a store/forward device with sufficient bandwidth and controllability or from an isochronous network. Of course, for use over a traffic packet network such as the internet, a buffer memory (1315) may also be required, which may be relatively large and may be of adaptive size, and may be implemented at least partially in an operating system or similar element (not labeled) external to the video decoder (1310).
The video decoder (1310) may include a parser (1320) to reconstruct symbols (1321) from the encoded video sequence. The categories of these symbols include information for managing the operation of the video decoder (1310), as well as potential information to control a display device, such as a display screen (1312), which is not an integral part of the electronic device (1330), but may be coupled to the electronic device (1330), as shown in fig. 13. The control Information for the display device may be a parameter set fragment (not shown) of Supplemental Enhancement Information (SEI message) or Video Usability Information (VUI). The parser (1320) may parse/entropy decode the received encoded video sequence. Encoding of the encoded video sequence may be performed in accordance with video coding techniques or standards and may follow various principles, including variable length coding, Huffman coding, arithmetic coding with or without contextual sensitivity, and so forth. The parser (1320) may extract a subgroup parameter set for at least one of the subgroups of pixels in the video decoder from the encoded video sequence based on the at least one parameter corresponding to the group. A subgroup may include a Group of Pictures (GOP), a picture, a tile, a slice, a macroblock, a Coding Unit (CU), a block, a Transform Unit (TU), a Prediction Unit (PU), and so on. The parser (1320) may also extract information from the encoded video sequence, such as transform coefficients, quantizer parameter values, motion vectors, and so on.
The parser (1320) may perform entropy decoding/parsing operations on the video sequence received from the buffer memory (1315), thereby creating a symbol (1321).
The reconstruction of the symbol (1321) may involve a number of different units depending on the type of the encoded video picture or a portion of the encoded video picture (e.g., inter and intra pictures, inter and intra blocks), among other factors. Which units are involved and the way they are involved can be controlled by subgroup control information parsed from the coded video sequence by a parser (1320). For the sake of brevity, such a subgroup control information flow between parser (1320) and the following units is not described.
In addition to the functional blocks already mentioned, the video decoder (1310) may be conceptually subdivided into several functional units as described below. In a practical embodiment operating under business constraints, many of these units interact closely with each other and may be integrated with each other. However, for the purposes of describing the disclosed subject matter, a conceptual subdivision into the following functional units is appropriate.
The first unit is a sealer/inverse transform unit (1351). The sealer/inverse transform unit (1351) receives the quantized transform coefficients as symbols (1321) from the parser (1320) along with control information including which transform scheme to use, block size, quantization factor, quantization scaling matrix, etc. The sealer/inverse transform unit (1351) may output a block including sample values, which may be input into the aggregator (1355).
In some cases, the output samples of sealer/inverse transform unit (1351) may belong to an intra-coded block; namely: predictive information from previously reconstructed pictures is not used, but blocks of predictive information from previously reconstructed portions of the current picture may be used. Such predictive information may be provided by intra picture prediction unit (1352). In some cases, the intra picture prediction unit (1352) generates a surrounding block of the same size and shape as the block being reconstructed using the reconstructed information extracted from the current picture buffer (1358). For example, current picture buffer (1358) buffers a partially reconstructed current picture and/or a fully reconstructed current picture. In some cases, the aggregator (1355) adds, on a per sample basis, the prediction information generated by the intra prediction unit (1352) to the output sample information provided by the scaler/inverse transform unit (1351).
In other cases, the output samples of sealer/inverse transform unit (1351) may belong to an inter-coded and potential motion compensated block. In this case, motion compensated prediction unit (1353) may access reference picture memory (1357) to fetch samples for prediction. After motion compensating the extracted samples according to the sign (1321), the samples may be added to the output of the scaler/inverse transform unit (1351), in this case referred to as residual samples or residual signals, by an aggregator (1355), thereby generating output sample information. The fetching of prediction samples by motion compensated prediction unit (1353) from addresses within reference picture memory (1357) may be controlled by motion vectors, and the motion vectors are used by motion compensated prediction unit (1353) in the form of symbols (1321), the symbols (1321) comprising X, Y and reference picture components, for example. Motion compensation may also include interpolation of sample values fetched from the reference picture store (1357), motion vector prediction mechanisms, etc., when using sub-sample exact motion vectors.
The output samples of the aggregator (1355) may be employed in a loop filter unit (1356) by various loop filtering techniques. The video compression techniques may include in-loop filter techniques that are controlled by parameters included in the encoded video sequence (also referred to as an encoded video bitstream), and the parameters are available to the loop filter unit (1356) as symbols (1321) from the parser (1320). However, in other embodiments, the video compression techniques may also be responsive to meta-information obtained during decoding of previous (in decoding order) portions of the encoded picture or encoded video sequence, as well as to sample values previously reconstructed and loop filtered.
The output of the loop filter unit (1356) may be a sample stream, which may be output to a display device (1312) and stored in a reference picture memory (1357) for subsequent inter picture prediction.
Once fully reconstructed, some of the coded pictures may be used as reference pictures for future prediction. For example, once an encoded picture corresponding to a current picture is fully reconstructed and the encoded picture is identified (by, e.g., parser (1320)) as a reference picture, current picture buffer (1358) may become part of reference picture memory (1357) and a new current picture buffer may be reallocated before reconstruction of a subsequent encoded picture is begun.
The video decoder (1310) may perform decoding operations according to a predetermined video compression technique, such as in the ITU-T h.265 standard. The encoded video sequence may conform to the syntax specified by the video compression technique or standard used, in the sense that the encoded video sequence conforms to the syntax of the video compression technique or standard and the configuration files recorded in the video compression technique or standard. In particular, the configuration file may select certain tools from all tools available in the video compression technology or standard as the only tools available under the configuration file. For compliance, the complexity of the encoded video sequence is also required to be within the limits defined by the level of the video compression technique or standard. In some cases, the hierarchy limits the maximum picture size, the maximum frame rate, the maximum reconstruction sampling rate (measured in units of, e.g., mega samples per second), the maximum reference picture size, and so on. In some cases, the limits set by the hierarchy may be further defined by a Hypothetical Reference Decoder (HRD) specification and metadata signaled HRD buffer management in the encoded video sequence.
In an embodiment, the receiver (1331) may receive additional (redundant) data along with the encoded video. The additional data may be part of an encoded video sequence. The additional data may be used by the video decoder (1310) to properly decode the data and/or more accurately reconstruct the original video data. The additional data may be in the form of, for example, a temporal, spatial, or signal-to-noise ratio (SNR) enhancement layer, a redundant slice, a redundant picture, a forward error correction code, etc.
Or, as another alternative, the video decoder is configured to receive an encoded image that is part of an encoded video sequence and decode the encoded image to generate a reconstructed picture. As shown in fig. 14, the video decoder (1410) includes an entropy decoder (1471), an inter-frame decoder (1480), a residual decoder (1473), a reconstruction module (1474), and an intra-frame decoder (1472) coupled together as shown in fig. 14.
The entropy decoder (1471) may be used to reconstruct from the encoded picture certain symbols that represent syntax elements that make up the encoded picture. Such symbols may include, for example, a mode used to encode the block (e.g., intra mode, inter mode, bi-prediction mode, a merge sub-mode of the latter two, or another sub-mode), prediction information (e.g., intra prediction information or inter prediction information) that may identify certain samples or metadata for use by an intra decoder (1472) or an inter decoder (1480), respectively, residual information in the form of, for example, quantized transform coefficients, and so forth. In an embodiment, when the prediction mode is inter or bi-directional prediction mode, inter prediction information is provided to an inter decoder (1480); and providing the intra prediction information to an intra decoder (1472) when the prediction type is an intra prediction type. The residual information may be inverse quantized and provided to a residual decoder (1473).
An inter-frame decoder (1480) is configured to receive the inter-frame prediction information and generate an inter-frame prediction result based on the inter-frame prediction information.
An intra decoder (1472) is configured to receive intra prediction information and generate a prediction result based on the intra prediction information.
A residual decoder (1473) is used to perform inverse quantization to extract dequantized transform coefficients, and to process the dequantized transform coefficients to convert the residual from the frequency domain to the spatial domain. The residual decoder 1473 may also need some control information (to obtain the quantizer parameter QP) and the information may be provided by the entropy decoder 1471 (data path not indicated, as this is only low-level control information).
A reconstruction module (1474) is used to combine the residuals output by the residual decoder (1473) and the prediction results (which may be output by an inter prediction module or an intra prediction module) in the spatial domain to form a reconstructed block, which may be part of a reconstructed picture, which in turn may be part of a reconstructed video. It should be noted that other suitable operations, such as deblocking operations, may be performed to improve visual quality.
According to still another aspect of the embodiments of the present invention, there is also provided an electronic device for implementing the above-described video encoding method. Optionally, the electronic device may include a memory and a processor, the memory stores a computer program, and the processor is configured to execute the steps in any of the encoding method embodiments through the computer program.
Optionally, in this embodiment, the electronic device may be located in at least one network device of a plurality of network devices of a computer network.
Optionally, in this embodiment, the processor may be configured to execute the following steps by a computer program:
s1, acquiring the coding parameters of a coded video frame before the video frame to be coded and the coding parameters of one or more reference blocks in the coded video frame, wherein the position of the reference block in the coded video frame is the same as the position of the block to be coded in the video frame to be coded, and the coding parameters include at least one of the following: directional prediction mode, quantization parameter, length of motion vector;
s2, determining the target resolution for coding the block to be coded according to the coding parameters of the coded video frame and the coding parameters of the reference block;
and S3, encoding the block to be encoded by adopting the target resolution.
Alternatively, as an alternative example, as shown in fig. 15, the electronic apparatus may be an electronic device (1520). The electronic device (1520) includes a transmitter (1540) (e.g., transmission circuitry).
A video encoder (1503) in the electronic device 1520 may receive video samples from a video source (1501) (not part of the electronic device (1520) in the embodiment of fig. 15), which may capture video images to be encoded by the video encoder (1503). In another embodiment, the video source (1501) is part of an electronic device (1520).
The video source (1501) may provide a source video sequence in the form of a stream of digital video samples to be encoded by the video encoder (1503), which may have any suitable bit depth (e.g., 8-bit, 10-bit, 12-bit … …), any color space (e.g., bt.601y CrCB, RGB … …), and any suitable sampling structure (e.g., Y CrCB 4:2:0, Y CrCB 4:4: 4). In the media service system, the video source (1501) may be a storage device that stores previously prepared video. In a video conferencing system, the video source (1501) may be a camera that captures local image information as a video sequence. Video data may be provided as a plurality of individual pictures that are given motion when viewed in sequence. The picture itself may be constructed as an array of spatial pixels, where each pixel may comprise one or more samples, depending on the sampling structure, color space, etc. used. The relationship between pixels and samples can be readily understood by those skilled in the art. The following text focuses on describing the samples.
According to an embodiment, the video encoder (1503) may encode and compress pictures of the source video sequence into an encoded video sequence (1543) in real-time or under any other temporal constraint required by the application. It is a function of the controller (1550) to perform the appropriate encoding speed. In some embodiments, the controller (1550) controls and is functionally coupled to other functional units as described below. For simplicity, the couplings are not labeled in the figures. The parameters set by the controller (1550) may include rate control related parameters (picture skip, quantizer, lambda value of rate distortion optimization technique, etc.), picture size, group of pictures (GOP) layout, maximum motion vector search range, etc. The controller (1550) may be adapted to have other suitable functions relating to the video encoder (1503) optimized for a certain system design.
In some embodiments, the video encoder (1503) operates in an encoding loop. As a brief description, in an embodiment, the encoding loop may include a source encoder (1530) (e.g., responsible for creating symbols, such as a stream of symbols, based on the input picture and reference pictures to be encoded) and a (local) decoder (1533) embedded in the video encoder (1503). The decoder (1533) reconstructs the symbols to create sample data in a manner similar to the way a (remote) decoder creates sample data (since any compression between symbols and encoded video streams is lossless in the video compression techniques considered herein). The reconstructed sample stream (sample data) is input to a reference picture memory (1534). Since the decoding of the symbol stream produces bit-accurate results independent of decoder location (local or remote), the content in the reference picture memory (1534) also corresponds bit-accurately between the local encoder and the remote encoder. In other words, the reference picture samples that the prediction portion of the encoder "sees" are identical to the sample values that the decoder would "see" when using prediction during decoding. This reference picture synchronization philosophy (and the drift that occurs if synchronization cannot be maintained due to, for example, channel errors) is also used in some related techniques.
The operation of the "local" decoder (1533) may be the same as a "remote" decoder, such as a video decoder that has been described in detail above in connection with fig. 13 and 14.
During operation, in some embodiments, the source encoder (1530) may perform motion compensated predictive coding. Motion compensated predictive coding predictively codes an input picture with reference to one or more previously coded pictures from the video sequence that are designated as "reference pictures". In this way, the encoding engine (1532) encodes differences between pixel blocks of the input picture and pixel blocks of the reference picture, which may be selected as a prediction reference for the input picture.
The local video decoder (1533) may decode encoded video data for a picture that may be designated as a reference picture based on symbols created by the source encoder (1530). The operation of the encoding engine (1532) may be a lossy process. When the encoded video data can be decoded at a video decoder (not shown in fig. 15), the reconstructed video sequence may typically be a copy of the source video sequence with some errors. The local video decoder (1533) replicates a decoding process that may be performed on reference pictures by the video decoder and may cause reconstructed reference pictures to be stored in the reference picture cache (1534). In this way, the video encoder (1503) may locally store a copy of the reconstructed reference picture, the copy having common content (no transmission errors) with the reconstructed reference picture to be obtained by the remote video decoder.
The predictor (1535) may perform a prediction search for the coding engine (1532). That is, for a new picture to be encoded, the predictor (1535) may search the reference picture memory (1534) for sample data (as candidate reference pixel blocks) or some metadata, such as reference picture motion vectors, block shapes, etc., that may be referenced as appropriate predictions for the new picture. The predictor (1535) may operate on a block-by-block basis of samples to find a suitable prediction reference. In some cases, from search results obtained by the predictor (1535), it may be determined that the input picture may have prediction references taken from multiple reference pictures stored in the reference picture memory (1534).
The controller (1550) may manage the encoding operations of the source encoder (1530), including, for example, setting parameters and subgroup parameters for encoding the video data.
The outputs of all of the above functional units may be entropy encoded in an entropy encoder (1545). The entropy encoder (1545) losslessly compresses the symbols generated by the various functional units according to techniques such as huffman coding, variable length coding, arithmetic coding, etc., to convert the symbols into an encoded video sequence.
The transmitter (1540) may buffer the encoded video sequence created by the entropy encoder (1545) in preparation for transmission over a communication channel (1560), which may be a hardware/software link to a storage device that will store the encoded video data. The transmitter (1540) may merge the encoded video data from the video encoder (1503) with other data to be transmitted, such as encoded audio data and/or an auxiliary data stream (sources not shown).
The controller (1550) may manage the operation of the video encoder (1503). During encoding, the controller (1550) may assign a certain encoded picture type to each encoded picture, but this may affect the encoding techniques applicable to the respective picture. For example, pictures may be generally assigned to any of the following picture types:
intra pictures (I pictures), which may be pictures that can be encoded and decoded without using any other picture in the sequence as a prediction source. Some video codecs tolerate different types of intra pictures, including, for example, Independent Decoder Refresh ("IDR") pictures. Those skilled in the art are aware of variants of picture I and their corresponding applications and features.
Predictive pictures (P pictures), which may be pictures that may be encoded and decoded using intra prediction or inter prediction, which uses at most one motion vector and reference index to predict the sample values of each block.
Bi-predictive pictures (B-pictures), which may be pictures that can be encoded and decoded using intra prediction or inter prediction that uses at most two motion vectors and reference indices to predict the sample values of each block. Similarly, multiple predictive pictures may use more than two reference pictures and associated metadata for reconstructing a single block.
A source picture may typically be spatially subdivided into blocks of samples (e.g., blocks of 4 x 4, 8 x 8, 4 x 8, or 16 x 16 samples) and encoded block-wise. These blocks may be predictively encoded with reference to other (encoded) blocks, which are determined according to the encoding allocation applied to their respective pictures. For example, a block of an I picture may be non-predictive encoded, or a block may be predictive encoded (spatial prediction or intra prediction) with reference to an already encoded block of the same picture. The pixel block of the P picture can be prediction-coded by spatial prediction or by temporal prediction with reference to one previously coded reference picture. A block of a B picture may be prediction coded by spatial prediction or by temporal prediction with reference to one or two previously coded reference pictures.
The video encoder (1503) may perform encoding operations according to a predetermined video encoding technique or standard, such as the ITU-T h.265 recommendation. In operation, the video encoder (1503) may perform various compression operations, including predictive encoding operations that exploit temporal and spatial redundancies in the input video sequence. Thus, the encoded video data may conform to syntax specified by the video coding technique or standard used.
In an embodiment, the transmitter (1540) may transmit the additional data while transmitting the encoded video. The source encoder 1530 may use such data as part of an encoded video sequence. The additional data may include temporal/spatial/SNR enhancement layers, redundant pictures and slices, among other forms of redundant data, SEI messages, VUI parameter set segments, and the like.
The captured video may be provided as a plurality of source pictures (video pictures) in a time sequence. Intra-picture prediction, often abbreviated as intra-prediction, exploits spatial correlation in a given picture, while inter-picture prediction exploits (temporal or other) correlation between pictures. In an embodiment, the particular picture being encoded/decoded, referred to as the current picture, is partitioned into blocks. When a block in a current picture is similar to a reference block in a reference picture that has been previously encoded in video and is still buffered, the block in the current picture may be encoded by a vector called a motion vector. The motion vector points to a reference block in a reference picture, and in the case where multiple reference pictures are used, the motion vector may have a third dimension that identifies the reference picture.
In some embodiments, bi-directional prediction techniques may be used in inter-picture prediction. According to bi-prediction techniques, two reference pictures are used, e.g., a first reference picture and a second reference picture that are both prior to the current picture in video in decoding order (but may be past and future, respectively, in display order). A block in a current picture may be encoded by a first motion vector pointing to a first reference block in a first reference picture and a second motion vector pointing to a second reference block in a second reference picture. In particular, a block may be predicted by a combination of a first reference block and a second reference block.
Furthermore, merge mode techniques may be used in inter picture prediction to improve coding efficiency.
According to some embodiments disclosed herein, prediction such as inter-picture prediction and intra-picture prediction is performed in units of blocks. For example, according to the HEVC standard, pictures in a sequence of video pictures are partitioned into Coding Tree Units (CTUs) for compression, the CTUs in the pictures having the same size, e.g., 64 × 64 pixels, 32 × 32 pixels, or 16 × 16 pixels. In general, a CTU includes three Coding Tree Blocks (CTBs), which are one luminance CTB and two chrominance CTBs. Further, each CTU may be further split into one or more Coding Units (CUs) in a quadtree. For example, a 64 × 64-pixel CTU may be split into one 64 × 64-pixel CU, or 4 32 × 32-pixel CUs, or 16 × 16-pixel CUs. In an embodiment, each CU is analyzed to determine a prediction type for the CU, such as an inter prediction type or an intra prediction type. Furthermore, depending on temporal and/or spatial predictability, a CU is split into one or more Prediction Units (PUs). In general, each PU includes a luma Prediction Block (PB) and two chroma PBs. In an embodiment, a prediction operation in encoding (encoding/decoding) is performed in units of prediction blocks. Taking a luma prediction block as an example of a prediction block, the prediction block includes a matrix of pixel values (e.g., luma values), such as 8 × 8 pixels, 16 × 16 pixels, 8 × 16 pixels, 16 × 8 pixels, and so on.
Alternatively, as an alternative implementation, a video encoder is used to receive a processing block (e.g., a prediction block) of sample values within a current video picture in a sequence of video pictures and encode the processing block into an encoded picture that is part of an encoded video sequence. For example, as shown in fig. 16, in an HEVC embodiment, a video encoder (1603) receives a matrix of sample values for a processing block, e.g., a prediction block of 8 × 8 samples, etc. The video encoder (1603) uses, for example, rate-distortion (RD) optimization to determine whether to encode a processing block using intra mode, inter mode, or bi-directional prediction mode. When encoding a processing block in intra mode, video encoder (1603) may use intra prediction techniques to encode the processing block into an encoded picture; and when encoding the processing block in inter mode or bi-directional prediction mode, the video encoder (1603) may encode the processing block into the encoded picture using inter prediction or bi-directional prediction techniques, respectively. In some video coding techniques, the merge mode may be an inter-picture prediction sub-mode, in which motion vectors are derived from one or more motion vector predictors without resorting to coded motion vector components outside of the predictors. In some other video coding techniques, there may be motion vector components that are applicable to the subject block. In an embodiment, the video encoder (1603) includes other components, such as a mode decision module (not shown) for determining a processing block mode.
In the embodiment of fig. 16, the video encoder (1603) includes an inter-frame encoder (1630), an intra-frame encoder (1622), a residual calculator (1623), a switch (16216), a residual encoder (1624), a general purpose controller (1621), and an entropy encoder (1625) coupled together as shown in fig. 16.
The inter encoder (1630) is configured to receive samples of a current block (e.g., a processed block), compare the block to one or more reference blocks in a reference picture (e.g., blocks in previous and subsequent pictures), generate inter prediction information (e.g., redundant information descriptions, motion vectors, merge mode information according to inter coding techniques), and calculate an inter prediction result (e.g., a predicted block) using any suitable technique based on the inter prediction information. In some embodiments, the reference picture is a decoded reference picture that is decoded based on encoded video information.
The intra encoder (1622) is used to receive samples of the current block (e.g., process the block), in some cases compare the block to a block already encoded in the same picture, generate quantized coefficients after transformation, and in some cases also generate intra prediction information (e.g., intra prediction direction information according to one or more intra coding techniques). In an embodiment, the intra encoder (1622) also calculates an intra prediction result (e.g., a predicted block) based on the intra prediction information and a reference block in the same picture.
The general controller (1621) is used to determine general control data and control other components of the video encoder (1603) based on the general control data. In an embodiment, a general purpose controller (1621) determines a mode of the block and provides a control signal to the switch (16216) based on the mode. For example, when the mode is intra, the general controller (1621) controls the switch (16216) to select an intra mode result for use by the residual calculator (1623), and controls the entropy encoder (1625) to select and add intra prediction information in the code stream; and when the mode is an inter mode, the general controller (1621) controls the switch (16216) to select an inter prediction result for use by the residual calculator (1623), and controls the entropy encoder (1625) to select and add inter prediction information in the code stream.
A residual calculator (1623) is used to calculate the difference (residual data) between the received block and the prediction result selected from the intra encoder (1622) or the inter encoder (1630). A residual encoder (1624) is operable to operate on the residual data to encode the residual data to generate transform coefficients. In an embodiment, a residual encoder (1624) is used to convert residual data from the time domain to the frequency domain and generate transform coefficients. The transform coefficients are then subjected to a quantization process to obtain quantized transform coefficients. In various embodiments, the video encoder (1603) further comprises a residual decoder (1628). A residual decoder (1628) is used to perform the inverse transform and generate decoded residual data. The decoded residual data may be used as appropriate by the intra encoder (1622) and the inter encoder (1630). For example, the inter encoder (1630) may generate a decoded block based on the decoded residual data and the inter prediction information, and the intra encoder (1622) may generate a decoded block based on the decoded residual data and the intra prediction information. The decoded blocks are processed appropriately to generate a decoded picture, and in some embodiments, the decoded picture may be buffered in a memory circuit (not shown) and used as a reference picture.
An entropy coder (1625) is used to format the codestream to produce coded blocks. The entropy encoder (1625) generates various information according to a suitable standard such as the HEVC standard. In an embodiment, the entropy encoder (1625) is configured to obtain general control data, selected prediction information (e.g., intra prediction information or inter prediction information), residual information, and other suitable information in the code stream. It should be noted that, according to the disclosed subject matter, there is no residual information when a block is encoded in the merge sub-mode of the inter mode or bi-prediction mode.
Embodiments of the present invention also provide a computer-readable storage medium having a computer program stored thereon, wherein the computer program is arranged to perform the steps of any of the above-mentioned method embodiments when executed.
Alternatively, in the present embodiment, the storage medium may be configured to store a computer program for executing the steps of:
s1, obtaining an encoding parameter of a decoded video frame before a video frame to be decoded and an encoding parameter of a reference block in the decoded video frame, where the reference block is one of a plurality of decoded blocks in the decoded video frame, a position of the reference block in the decoded video frame is the same as a position of a block to be decoded in the video frame to be decoded, and the encoding parameter includes at least one of: directional prediction mode, quantization parameter, length of motion vector;
s2, determining the target resolution for decoding the block to be decoded according to the encoding parameters of the decoded video frame and the encoding parameters of the reference block;
s3, decoding the block to be decoded by adopting the target resolution.
Or, optionally, the storage medium is further arranged to store a computer program for performing the steps of:
s1, acquiring coding parameters of a coded video frame before a video frame to be coded and coding parameters of a reference block in the coded video frame, wherein the reference block is one of a plurality of coded blocks in the coded video frame, the position of the reference block in the coded video frame is the same as the position of a block to be coded in the video frame to be coded, and the coding parameters include at least one of: directional prediction mode, quantization parameter, length of motion vector;
s2, determining the target resolution for coding the block to be coded according to the coding parameters of the coded video frame and the coding parameters of the reference block;
and S3, encoding the block to be encoded by adopting the target resolution.
Optionally, the storage medium is further configured to store a computer program for executing the steps included in the method in the foregoing embodiment, which is not described in detail in this embodiment.
Alternatively, in this embodiment, a person skilled in the art may understand that all or part of the steps in the methods of the foregoing embodiments may be implemented by a program instructing hardware associated with the terminal device, where the program may be stored in a computer-readable storage medium, and the storage medium may include: flash disks, Read-Only memories (ROMs), Random Access Memories (RAMs), magnetic or optical disks, and the like.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
The integrated unit in the above embodiments, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in the above computer-readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing one or more computer devices (which may be personal computers, servers, network devices, etc.) to execute all or part of the steps of the method according to the embodiments of the present invention.
In the above embodiments of the present invention, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed client may be implemented in other manners. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one type of division of logical functions, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (15)

1. A video decoding method, comprising:
acquiring coding parameters of a decoded video frame before a video frame to be decoded and coding parameters of one or more reference blocks in the decoded video frame, wherein the positions of the reference blocks in the decoded video frame are the same as the positions of the blocks to be decoded in the video frame to be decoded, and the coding parameters comprise at least one of the following: directional prediction mode, quantization parameter, length of motion vector;
determining a target resolution for decoding the block to be decoded according to the encoding parameters of the decoded video frame and the encoding parameters of the reference block;
and decoding the block to be decoded by adopting the target resolution.
2. The method of claim 1, wherein determining the target resolution for decoding the block to be decoded according to the encoding parameters of the decoded video frame and the encoding parameters of the reference block comprises:
performing weighted summation on the directional prediction mode of the decoded video frame and the directional prediction mode of the reference block to obtain a total directional prediction mode;
determining the target resolution as a first resolution if the total directional prediction mode is greater than a first predetermined threshold;
determining the target resolution to be a second resolution if the total directional prediction mode is less than or equal to the first predetermined threshold and greater than a second predetermined threshold, wherein the first resolution is less than the second resolution, the second predetermined threshold is less than the first predetermined threshold;
determining the target resolution to be a third resolution if the total directional prediction mode is less than or equal to the second predetermined threshold and greater than a third predetermined threshold, wherein the second resolution is less than the third resolution, and the third predetermined threshold is less than the second predetermined threshold.
3. The method of claim 1, wherein determining the target resolution for decoding the block to be decoded according to the encoding parameters of the decoded video frame and the encoding parameters of the reference block comprises:
carrying out weighted summation on the quantization parameter of the decoded video frame and the quantization parameter of the reference block to obtain a total quantization parameter;
determining the target resolution to be a first resolution if the total quantization parameter is greater than a fourth predetermined threshold;
determining the target resolution to be a second resolution if the total quantization parameter is less than or equal to the fourth predetermined threshold and greater than a fifth predetermined threshold, wherein the first resolution is less than the second resolution and the fifth predetermined threshold is less than the fourth predetermined threshold;
determining the target resolution to be a third resolution if the total quantization parameter is less than or equal to the fifth predetermined threshold and greater than a sixth predetermined threshold, wherein the second resolution is less than the third resolution and the sixth predetermined threshold is less than the fifth predetermined threshold.
4. The method of claim 1, wherein determining the target resolution for decoding the block to be decoded according to the encoding parameters of the decoded video frame and the encoding parameters of the reference block comprises:
carrying out weighted summation on the length of the motion vector of the decoded video frame and the length of the motion vector of the reference block to obtain the length of a total motion vector;
determining the target resolution as a first resolution in case the length of the total motion vector is greater than a seventh predetermined threshold;
determining the target resolution to be a second resolution if the length of the total motion vector is less than or equal to the seventh predetermined threshold and greater than an eighth predetermined threshold, wherein the first resolution is less than the second resolution and the eighth predetermined threshold is less than the seventh predetermined threshold;
determining the target resolution to be a third resolution in a case where the length of the total motion vector is less than or equal to the eighth predetermined threshold and greater than a ninth predetermined threshold, wherein the second resolution is less than the third resolution, and the ninth predetermined threshold is less than the eighth predetermined threshold.
5. The method of claim 1, wherein obtaining the coding parameters of the reference block in the decoded video frame before the video frame to be decoded comprises:
in the event that the reference block covers a plurality of decoded blocks in the decoded video frame, obtaining encoding parameters for each of the covered plurality of decoded blocks;
and taking the ratio of the area of each decoded block covered in the reference block to the total area of the reference block as a weight, and performing weighted summation calculation on the coding parameters of each decoded block to obtain the coding parameters of the reference block.
6. The method according to any of claims 1 to 5, wherein the number of the reference blocks corresponding to the block to be decoded is the same or different for different blocks to be decoded, wherein, in case of different number of the reference blocks, the decoding the block to be decoded with the target resolution further comprises:
and acquiring a flag bit carried in the block to be decoded, wherein the flag bit is used for indicating the quantity relation between the block to be decoded and the reference block.
7. A video encoding method, comprising:
acquiring coding parameters of a coded video frame before a video frame to be coded and coding parameters of one or more reference blocks in the coded video frame, wherein the position of the reference block in the coded video frame is the same as the position of a block to be coded in the video frame to be coded, and the coding parameters comprise at least one of the following: directional prediction mode, quantization parameter, length of motion vector;
determining a target resolution for encoding the block to be encoded according to the encoding parameters of the encoded video frame and the encoding parameters of the reference block;
and encoding the to-be-encoded block by adopting the target resolution.
8. The method of claim 7, wherein determining the target resolution for encoding the block to be encoded according to the encoding parameters of the encoded video frame and the encoding parameters of the reference block comprises:
performing weighted summation on the directional prediction mode of the coded video frame and the directional prediction mode of the reference block to obtain a total directional prediction mode;
determining the target resolution as a first resolution if the total directional prediction mode is greater than a first predetermined threshold;
determining the target resolution to be a second resolution if the total directional prediction mode is less than or equal to the first predetermined threshold and greater than a second predetermined threshold, wherein the first resolution is less than the second resolution, the second predetermined threshold is less than the first predetermined threshold;
determining the target resolution to be a third resolution if the total directional prediction mode is less than or equal to the second predetermined threshold and greater than a third predetermined threshold, wherein the second resolution is less than the third resolution, and the third predetermined threshold is less than the second predetermined threshold.
9. The method of claim 7, wherein determining the target resolution for encoding the block to be encoded according to the encoding parameters of the encoded video frame and the encoding parameters of the reference block comprises:
carrying out weighted summation on the quantization parameters of the coded video frame and the quantization parameters of the reference block to obtain total quantization parameters;
determining the target resolution to be a first resolution if the total quantization parameter is greater than a fourth predetermined threshold;
determining the target resolution to be a second resolution if the total quantization parameter is less than or equal to the fourth predetermined threshold and greater than a fifth predetermined threshold, wherein the first resolution is less than the second resolution and the fifth predetermined threshold is less than the fourth predetermined threshold;
determining the target resolution to be a third resolution if the total quantization parameter is less than or equal to the fifth predetermined threshold and greater than a sixth predetermined threshold, wherein the second resolution is less than the third resolution and the sixth predetermined threshold is less than the fifth predetermined threshold.
10. The method of claim 7, wherein determining the target resolution for encoding the block to be encoded according to the encoding parameters of the encoded video frame and the encoding parameters of the reference block comprises:
carrying out weighted summation on the length of the motion vector of the coded video frame and the length of the motion vector of the reference block to obtain the length of a total motion vector;
determining the target resolution as a first resolution in case the length of the total motion vector is greater than a seventh predetermined threshold;
determining the target resolution to be a second resolution if the length of the total motion vector is less than or equal to the seventh predetermined threshold and greater than an eighth predetermined threshold, wherein the first resolution is less than the second resolution and the eighth predetermined threshold is less than the seventh predetermined threshold;
determining the target resolution to be a third resolution in a case where the length of the total motion vector is less than or equal to the eighth predetermined threshold and greater than a ninth predetermined threshold, wherein the second resolution is less than the third resolution, and the ninth predetermined threshold is less than the eighth predetermined threshold.
11. The method of claim 7, wherein obtaining the coding parameters of the reference block in the coded video frame before the video frame to be coded comprises:
under the condition that the reference block covers a plurality of blocks of coded blocks in the coded video frame, acquiring the coding parameters of each block of the plurality of covered coded blocks;
and taking the ratio of the area of each coded block covered in the reference block to the total area of the reference block as a weight, and performing weighted summation calculation on the coding parameters of each coded block to obtain the coding parameters of the reference block.
12. The method according to any of claims 7 to 11, wherein the number of the reference blocks corresponding to the block to be encoded is the same or different for different blocks to be encoded, wherein in case that the number of the reference blocks is different, the encoding the block to be encoded with the target resolution further comprises:
and setting a flag bit in the coded data obtained by coding the to-be-coded block, wherein the flag bit is used for indicating the quantity relation between the to-be-coded block and the reference block.
13. A video decoding apparatus, comprising:
an obtaining unit, configured to obtain coding parameters of a decoded video frame that precedes a video frame to be decoded and coding parameters of one or more reference blocks in the decoded video frame, where a position of the reference block in the decoded video frame is the same as a position of a block to be decoded in the video frame to be decoded, and the coding parameters include at least one of: directional prediction mode, quantization parameter, length of motion vector;
a determining unit, configured to determine a target resolution for decoding the block to be decoded according to the encoding parameters of the decoded video frame and the encoding parameters of the reference block;
and the decoding unit is used for decoding the block to be decoded by adopting the target resolution.
14. A video encoding apparatus, comprising:
an obtaining unit, configured to obtain coding parameters of a coded video frame that precedes a video frame to be coded and coding parameters of one or more reference blocks in the coded video frame, where a position of the reference block in the coded video frame is the same as a position of a block to be coded in the video frame to be coded, and the coding parameters include at least one of: directional prediction mode, quantization parameter, length of motion vector;
a determining unit, configured to determine a target resolution for encoding the block to be encoded according to the encoding parameters of the encoded video frame and the encoding parameters of the reference block;
and the coding unit is used for coding the block to be coded by adopting the target resolution.
15. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to execute the method of any of claims 1 to 6 or 7 to 12 by means of the computer program.
CN201910927096.9A 2019-09-27 2019-09-27 Video decoding and encoding method and device and electronic equipment Active CN110636288B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910927096.9A CN110636288B (en) 2019-09-27 2019-09-27 Video decoding and encoding method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910927096.9A CN110636288B (en) 2019-09-27 2019-09-27 Video decoding and encoding method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN110636288A true CN110636288A (en) 2019-12-31
CN110636288B CN110636288B (en) 2023-11-14

Family

ID=68974662

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910927096.9A Active CN110636288B (en) 2019-09-27 2019-09-27 Video decoding and encoding method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN110636288B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112235576A (en) * 2020-11-16 2021-01-15 北京世纪好未来教育科技有限公司 Encoding method, encoding device, electronic device and storage medium
CN113727108A (en) * 2020-05-26 2021-11-30 腾讯科技(深圳)有限公司 Video decoding method, video encoding method and related equipment
CN112235576B (en) * 2020-11-16 2024-04-30 北京世纪好未来教育科技有限公司 Encoding method, encoding device, electronic equipment and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110170595A1 (en) * 2010-01-08 2011-07-14 Xun Shi Method and device for motion vector prediction in video transcoding using full resolution residuals
WO2011125942A1 (en) * 2010-04-08 2011-10-13 株式会社エヌ・ティ・ティ・ドコモ Moving image prediction encoder apparatus, moving image prediction decoder apparatus, moving image prediction encoding method, moving image prediction decoding method, moving image prediction encoding program, and moving image prediction decoding program
EP2410746A1 (en) * 2010-07-20 2012-01-25 Siemens Aktiengesellschaft Video coding with reference frames of high resolution
US20130294516A1 (en) * 2012-05-07 2013-11-07 Cellco Partnership D/B/A Verizon Wireless Method and apparatus for finding a motion vector
US8681866B1 (en) * 2011-04-28 2014-03-25 Google Inc. Method and apparatus for encoding video by downsampling frame resolution
KR20180022747A (en) * 2009-12-16 2018-03-06 한국전자통신연구원 Apparatus and method for video coding and decoding
CN108848380A (en) * 2018-06-20 2018-11-20 腾讯科技(深圳)有限公司 Video coding and decoding method, apparatus, computer equipment and storage medium
CN109618168A (en) * 2018-11-06 2019-04-12 建湖云飞数据科技有限公司 It is a kind of based on divide pixel value difference handle video encoding/decoding method

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20180022747A (en) * 2009-12-16 2018-03-06 한국전자통신연구원 Apparatus and method for video coding and decoding
US20110170595A1 (en) * 2010-01-08 2011-07-14 Xun Shi Method and device for motion vector prediction in video transcoding using full resolution residuals
WO2011125942A1 (en) * 2010-04-08 2011-10-13 株式会社エヌ・ティ・ティ・ドコモ Moving image prediction encoder apparatus, moving image prediction decoder apparatus, moving image prediction encoding method, moving image prediction decoding method, moving image prediction encoding program, and moving image prediction decoding program
EP2410746A1 (en) * 2010-07-20 2012-01-25 Siemens Aktiengesellschaft Video coding with reference frames of high resolution
US8681866B1 (en) * 2011-04-28 2014-03-25 Google Inc. Method and apparatus for encoding video by downsampling frame resolution
US20130294516A1 (en) * 2012-05-07 2013-11-07 Cellco Partnership D/B/A Verizon Wireless Method and apparatus for finding a motion vector
CN108848380A (en) * 2018-06-20 2018-11-20 腾讯科技(深圳)有限公司 Video coding and decoding method, apparatus, computer equipment and storage medium
CN109618168A (en) * 2018-11-06 2019-04-12 建湖云飞数据科技有限公司 It is a kind of based on divide pixel value difference handle video encoding/decoding method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
YONG HE: "AHG8: On adaptive resolution change constraint", JOINT VIDEO EXPERTS TEAM (JVET) OF ITU-T SG 16 WP 3 AND ISO/IEC JTC 1/SC 29/WG 11 15TH MEETING: GOTHENBURG, SE, 3–12 JULY 2019, JVET-O0184 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113727108A (en) * 2020-05-26 2021-11-30 腾讯科技(深圳)有限公司 Video decoding method, video encoding method and related equipment
CN113727108B (en) * 2020-05-26 2024-03-01 腾讯科技(深圳)有限公司 Video decoding method, video encoding method and related equipment
CN112235576A (en) * 2020-11-16 2021-01-15 北京世纪好未来教育科技有限公司 Encoding method, encoding device, electronic device and storage medium
CN112235576B (en) * 2020-11-16 2024-04-30 北京世纪好未来教育科技有限公司 Encoding method, encoding device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN110636288B (en) 2023-11-14

Similar Documents

Publication Publication Date Title
CN111869212B (en) Video decoding method, device and readable medium
CN111903131B (en) Method, apparatus and computer readable medium for video decoding in a decoder
CN113614736A (en) Video coding and decoding method and device
CN111989918A (en) Method and apparatus for multi-line intra prediction in video compression
CN110944185B (en) Video decoding method and device, computer equipment and storage medium
CN111937326B (en) Video decoding method, device and readable storage medium
CN111492659A (en) Method and apparatus for video encoding
CN112806002A (en) Method and apparatus for signaling multiple hypotheses for skip and merge modes, and method and apparatus for signaling distance offset table in merge with motion vector difference
CN113875242A (en) Signaling of video codec tools supporting various chroma formats
CN112235581B (en) Video decoding method, video decoding device, storage medium and electronic equipment
CN113382259B (en) Video decoding method and device and computer equipment
CN110784711A (en) Method and device for generating merging candidate list for encoding or decoding video sequence
CN113196745B (en) Video encoding and decoding method and device
CN113557527A (en) Method and device for color transformation in universal video coding and decoding
CN112005549B (en) Intra-frame and inter-frame prediction control method, device, equipment and storage medium
CN110636302B (en) Video decoding and encoding methods and devices, storage medium, decoder and encoder
CN115550644A (en) Method and apparatus for video encoding, computer device and storage medium
CN112514385B (en) Video decoding method and device, computer equipment and computer readable medium
CN113228631B (en) Video encoding and decoding method and device
CN112771869A (en) Reduced merge list construction for small code blocks
CN112073720B (en) Method and apparatus for video decoding, computer device and storage medium
CN114375570A (en) Method and apparatus for video encoding
CN111726622A (en) Method and device for video decoding
CN110636288B (en) Video decoding and encoding method and device and electronic equipment
CN110572675B (en) Video decoding and encoding methods and devices, storage medium, decoder and encoder

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40018639

Country of ref document: HK

SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant