CN110572654B - Video encoding and decoding methods and devices, storage medium and electronic device - Google Patents

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

Info

Publication number
CN110572654B
CN110572654B CN201910927984.0A CN201910927984A CN110572654B CN 110572654 B CN110572654 B CN 110572654B CN 201910927984 A CN201910927984 A CN 201910927984A CN 110572654 B CN110572654 B CN 110572654B
Authority
CN
China
Prior art keywords
resolution
block
preset threshold
decoded
determining
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.)
Active
Application number
CN201910927984.0A
Other languages
Chinese (zh)
Other versions
CN110572654A (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 CN201910927984.0A priority Critical patent/CN110572654B/en
Publication of CN110572654A publication Critical patent/CN110572654A/en
Application granted granted Critical
Publication of CN110572654B publication Critical patent/CN110572654B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/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
    • 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/14Coding unit complexity, e.g. amount of activity or edge presence estimation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/44Decoders specially adapted therefor, e.g. video decoders which are asymmetric with respect to the encoder
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/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
    • 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/593Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving spatial prediction techniques

Abstract

The invention discloses a video encoding and decoding method and device, a storage medium and an electronic device. Wherein the method comprises the following steps: obtaining a motion vector MV of a reference block of a block to be coded in a video frame to be coded, wherein the reference block is a coded block referred to by the block to be coded in the video frame to be coded; determining a target resolution for encoding the block to be encoded according to the motion vector MV; and encoding the block to be encoded according to the target resolution. The invention solves the technical problem of poor video quality caused by relatively large coding distortion by adopting the same resolution for different blocks in one frame of video in the existing video coding process.

Description

Video encoding and decoding methods and devices, storage medium and electronic device
Technical Field
The present invention relates to the field of computers, and in particular, to a video encoding method and apparatus, a video decoding method and apparatus, a storage medium, and an electronic apparatus.
Background
With the development of digital media technology and computer technology, video is applied to various fields such as mobile communication, network monitoring, network television, etc. With the improvement of hardware performance and screen resolution, the demand of users for high-definition video is increasing.
If the high resolution is used for encoding the different blocks in the frame of the video, the peak signal-to-noise ratio PSNR1 corresponding to encoding the different blocks in the frame of the video with the high resolution is lower than the peak signal-to-noise ratio PSNR2 corresponding to encoding the different blocks in the frame of the video with the low resolution, that is, the peak signal-to-noise ratio PSNR1 corresponding to encoding with the high resolution is relatively smaller when the transmission bandwidth is smaller, and the distortion is relatively larger.
Similarly, if low resolution coding is used for all the different blocks in one frame of the video, the peak signal-to-noise ratio PSNR3 corresponding to the low resolution coding is lower for the different blocks in one frame of the video than the peak signal-to-noise ratio PSNR4 corresponding to the high resolution coding for the different blocks in one frame of the video when the transmission bandwidth is relatively large, that is, the peak signal-to-noise ratio PSNR3 when the low resolution coding is used for the different blocks in one frame of the video is relatively small and the distortion is relatively large.
Under the condition of limited moving bandwidth, the existing method for encoding different blocks in a video frame by adopting the same resolution ratio can have the problem that certain scene distortions are relatively large, so that the video quality is poor.
In view of the above problems, no effective solution has been proposed at present.
Disclosure of Invention
The embodiment of the invention provides a video coding and decoding method and device, a storage medium and an electronic device, which at least solve the technical problem that in the existing video coding process, different blocks in a frame of video adopt the same resolution to carry out coding distortion relatively more, so that the video quality is poor.
According to an aspect of the embodiment of the present invention, there is also provided a video decoding method, including:
obtaining a motion vector MV of a reference block of a block to be decoded in a video frame to be decoded, wherein the reference block is a decoded block referred to by the block to be decoded in the video frame to be decoded;
determining a target resolution for decoding the block to be decoded according to the motion vector MV, wherein the target resolution is a first resolution in the case that the motion vector MV represents that the motion intensity of a reference block of the block to be decoded is less than a predetermined threshold; in the case that the motion vector MV indicates that the motion intensity of the reference block of the block to be decoded is greater than or equal to the predetermined threshold, the target resolution is a second resolution, wherein the first resolution is greater than the second resolution;
And decoding the block to be decoded according to the target resolution.
According to another aspect of the embodiment of the present invention, there is also provided a video encoding method, including:
obtaining a motion vector MV of a reference block of a block to be coded in a video frame to be coded, wherein the reference block is a coded block referred to by the block to be coded in the video frame to be coded;
determining a target resolution for encoding the block to be encoded according to the motion vector MV, wherein the target resolution is a first resolution in the case that the motion vector MV represents that the motion intensity of a reference block of the block to be decoded is less than a predetermined threshold; in the case that the motion vector MV indicates that the motion intensity of the reference block of the block to be decoded is greater than or equal to the predetermined threshold, the target resolution is a second resolution, wherein the first resolution is greater than the second resolution;
and encoding the block to be encoded according to the target resolution.
According to another aspect of the embodiment of the present invention, there is also provided a video decoding apparatus including:
the first acquisition module is used for acquiring a motion vector MV of a reference block of a block to be decoded in a video frame to be decoded, wherein the reference block is a decoded block referred to by the block to be decoded in the video frame to be decoded;
A first determining module, configured to determine a target resolution for decoding the block to be decoded according to the motion vector MV, where the target resolution is a first resolution when the motion vector MV indicates that a motion intensity of a reference block of the block to be decoded is less than a predetermined threshold; in the case that the motion vector MV indicates that the motion intensity of the reference block of the block to be decoded is greater than or equal to the predetermined threshold, the target resolution is a second resolution, wherein the first resolution is greater than the second resolution;
and the decoding module is used for decoding the block to be decoded according to the target resolution.
According to another aspect of the embodiment of the present invention, there is also provided a video encoding apparatus including:
the second acquisition module is used for acquiring a motion vector MV of a reference block of a block to be coded in a video frame to be coded, wherein the reference block is a coded block referred to by the block to be coded in the video frame to be coded;
a second determining module, configured to determine a target resolution for encoding the block to be encoded according to the motion vector MV, where the target resolution is the first resolution when the motion vector MV indicates that the motion intensity of the reference block of the block to be decoded is less than a predetermined threshold; in the case that the motion vector MV indicates that the motion intensity of the reference block of the block to be decoded is greater than or equal to the predetermined threshold, the target resolution is a second resolution, wherein the first resolution is greater than the second resolution;
And the encoding module is used for encoding the block to be encoded according to the target resolution.
According to a further aspect of embodiments of the present invention, there is also provided a computer-readable storage medium having stored therein a computer program, wherein the computer program is arranged to perform the above video encoding method or the above video decoding method when run.
According to still another 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 on the memory and executable on the processor, wherein the processor executes the video encoding method or the video decoding method through the computer program.
In the embodiment of the invention, the target resolution of the current block to be coded is decided by the motion vector MV of the reference block of the block to be coded in the video frame to be coded, the block to be coded is coded according to the target resolution, and different coding blocks are coded by adopting different resolutions, so that the coding distortion is relatively smaller, the video quality is improved, and the technical problem of poor video quality caused by the fact that the same resolution is adopted for coding distortion for different blocks in one frame of video in the existing video coding process 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 embodiments of the invention and together with the description serve to explain the invention and do not constitute a limitation on the invention. In the drawings:
FIG. 1 is a diagram of an application environment for a video encoding method and a video decoding method in one embodiment;
FIG. 2 is an internal block diagram of the terminal of FIG. 1 in one embodiment;
FIG. 3 is an internal block diagram of the server of FIG. 1 in one embodiment;
fig. 4 is a flowchart of a video encoding method according to an embodiment of the present invention;
FIG. 5 is a schematic diagram I of video encoding according to an embodiment of the present invention;
FIG. 6 is a schematic diagram II of video encoding according to an embodiment of the present invention;
fig. 7 is a flowchart of a video decoding method according to an embodiment of the present invention;
fig. 8 is a block diagram of a video decoding apparatus according to an embodiment of the present invention;
fig. 9 is a block diagram of a video encoding apparatus according to an embodiment of the present invention;
fig. 10 is a block diagram of a video encoding apparatus according to a preferred embodiment of the present invention;
FIG. 11 is a schematic diagram of an alternative electronic device according to an embodiment of the invention;
fig. 12 is a schematic diagram of an alternative electronic device according to an embodiment of the invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise 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.
Fig. 1 is an application environment diagram of the video encoding method and the video decoding method in one embodiment. As shown in fig. 1, the application environment includes a terminal 110 and a server 120, wherein the terminal 110 and the server 120 communicate through a network.
The terminal 110 may be, but is not limited to, a smart phone, a tablet computer, a notebook computer, a desktop computer, and the like. The video encoding method and the video decoding method may be completed in the terminal 110 or the server 120, where the terminal 110 may perform adaptive resolution encoding on the video frame to be encoded by using the video encoding method and then send the encoded video frame to the server 120, or may receive encoded data with adaptive resolution from the server 120 and perform decoding by using the video decoding method and then generate a decoded video frame. The server 120 may transcode the code stream when it is stored, where the video encoding method is completed at the server, and if the server 120 needs to decode the code stream, the video decoding method is completed at the server.
In one embodiment, the internal structure of the terminal 110 in fig. 1 is as shown in fig. 2, and the terminal 110 includes a processor, a graphic processing unit, a storage medium, a memory, a network interface, a display screen, and an input device connected through a system bus. The storage medium of the terminal 110 stores an operating system, and further includes a video encoding device and/or a video decoding device for implementing a video encoding method and/or a video decoding method suitable for the terminal. The processor is operative to provide computing and control capabilities supporting the operation of the entire terminal 110. The graphics processing unit in the terminal 110 is configured to provide at least rendering capabilities of a display interface, and the memory provides an environment for operation of the video encoding device and/or the video decoding device in the storage medium, and the network interface is configured to communicate with the server 120 over a network. The display screen is used to display an application interface or the like, such as decoding video, and the input device is used to receive commands or data or the like entered by the user. For a terminal 110 with a touch screen, the display screen and the input device may be a touch screen. The architecture shown in fig. 2 is merely a block diagram of a portion of the architecture in connection with the present application and is not intended to limit the terminals to which the present application is applied, and a particular terminal or server may include more or fewer components than shown, or may combine certain components, or may have a different arrangement of components.
In one embodiment, the internal architecture of the server 120 of FIG. 1 is as shown in FIG. 3, the server 120 comprising a processor, storage medium, memory, and network interface connected by a system bus. The storage medium of the server 120 stores an operating system, a database, a video encoding device and/or a video decoding device, where the database is used to store data, and the video encoding device and/or the video decoding device is used to implement a video encoding method and/or a video decoding method suitable for the server 120. The processor of the server 120 is configured to provide computing and control capabilities to support the operation of the entire server 120. The memory of the server 120 provides an environment for the operation of the video encoding device and/or the video decoding device in the storage medium. The network interface of the server 120 is used for communication with the external terminal 110 through a network connection. The structures shown in fig. 2 and 3 are merely block diagrams of partial structures related to the present application and do not constitute limitations of terminals to which the present application is applied, and a specific terminal or server may include more or less components than those shown in the drawings, or may combine some components, or have different arrangements of components.
An embodiment of the present invention provides a video encoding method, which is illustrated by a terminal or a server applied in the above application environment, and fig. 4 is a flowchart of the video encoding method according to an embodiment of the present invention, as shown in fig. 4, and includes the following steps:
step S402, obtaining a motion vector MV of a reference block of a block to be coded in a video frame to be coded, wherein the reference block is a coded block referred to by the block to be coded in the video frame to be coded;
motion Vectors (MVs) are large and represent that the image scene is a large Motion scene.
Specifically, the video frame to be encoded may be a video frame acquired in real time, which is used for instant messaging, or may be a video frame corresponding to a stored video. The MV in the embodiment of the present invention refers to the sum (or mean square error) of absolute values of differences between the encoded reconstructed pixel and the original pixel value.
The reference block in the embodiment of the invention can be an encoded block adjacent to the block to be encoded, or can be a non-adjacent encoded block, the interval between the block to be encoded and the reference block is not more than n pixels, and the reference block is positioned in front of the encoding time sequence of the current block to be encoded or in front of the decoding time sequence of the current block to be decoded, namely the encoded block or the decoded block of the preamble.
Step S404, determining a target resolution for encoding the block to be encoded according to the motion vector MV, wherein the target resolution is a first resolution when the motion vector MV indicates that the motion intensity of the reference block of the block to be decoded is less than a predetermined threshold; in the case that the motion vector MV indicates that the motion intensity of the reference block of the block to be decoded is greater than or equal to the predetermined threshold, the target resolution is a second resolution, wherein the first resolution is greater than the second resolution;
specifically, when the length of the motion vector MV of one decoded block is smaller than a first preset threshold, or the variance or the mean of the lengths of the motion vectors MV of a plurality of decoded blocks is smaller than a fifth preset threshold, the motion intensity of the reference block is smaller than a predetermined threshold, that is, the motion is not intense, and conversely, the motion is intense, wherein the fifth preset threshold is the same as or different from the first preset threshold.
Step S406, the block to be encoded is encoded according to the target resolution.
In an alternative embodiment, the step S404 may specifically include:
under the condition that the motion vector MV indicates that the reference block of the block to be coded does not move severely (namely, is a non-large motion scene), determining the target resolution as a first resolution;
And determining the target resolution as a second resolution under the condition that the motion vector MV indicates that the reference block of the block to be coded moves severely (namely, is a large motion scene), wherein the first resolution is larger than the second resolution.
In the embodiment of the present invention, the reference block may be one encoded block or may be a plurality of encoded blocks, and the step S404 may specifically include:
s4041, in the case where the reference block is one encoded block, determining the target resolution according to the length of the motion vector MV of the one encoded block; wherein the length of the motion vector MV is also called the modulus of the motion vector MV. The block to be coded is the t-th block in the video frame to be coded, the reference block is the coded t-k-th block, the MVs of the t-k-th block are calculated, and the target resolution can be determined according to the MVs of the t-k-th block.
S4042, in the case that the reference block is a plurality of encoded blocks, determining the target resolution according to the variance or mean of the lengths of the motion vectors MV of the plurality of encoded blocks, specifically, calculating the MV of each encoded block in the reference block, and determining the variance or mean of the MVs of all encoded blocks in the reference block, thereby determining the target resolution.
In the embodiment of the present invention, the step S4041 may specifically include:
determining the target resolution as a first resolution in case that the length of the motion vector MV of the one encoded block is smaller than a first preset threshold;
in case that the length of the motion vector MV of the one encoded block is greater than or equal to the first preset threshold, the target resolution is determined to be the second resolution, wherein the first resolution is greater than the second resolution, wherein the first preset threshold may be preset according to specific situations, e.g., the first preset threshold may be set to any number of 5-7, e.g., the first preset threshold may be set to 6.
Further, the second resolution may be further divided into a plurality of levels of resolution, for example, the second resolution includes: third, fourth, fifth, sixth, etc., for example, the third resolution is 3/4 of the width and height of the first resolution, the fourth resolution is 2/3 of the width and height of the first resolution, the fifth resolution is 1/2 of the width and height of the first resolution, the sixth resolution is 1/3 of the width and height of the first resolution, and correspondingly, in case that the length of the motion vector MV of the one encoded block is greater than or equal to the first preset threshold, determining the target resolution as the second resolution includes:
Determining the target resolution as the third resolution in the case that the length of the motion vector MV of the one encoded block is greater than or equal to the first preset threshold and less than the second preset threshold, wherein the second preset threshold may be preset, for example, the second preset threshold may be set to 9, and when the MV of the one encoded block is greater than or equal to 6 and less than 9, the target resolution may be determined to be 3/4 of the width and height of the first resolution;
determining the target resolution as a fourth resolution in case that the length of the motion vector MV of the one encoded block is greater than or equal to the second preset threshold and less than a third preset threshold; the third preset threshold may be preset, for example, the second preset threshold may be set to 12, and when the MV of one encoded block is greater than or equal to 9 and less than 12, the target resolution may be determined to be 2/3 of the width and height of the first resolution.
Determining the target resolution as a fifth resolution in case that the length of the motion vector MV of the one encoded block is greater than or equal to the third preset threshold and less than the fourth preset threshold; the fourth preset threshold may be preset, for example, the second preset threshold may be set to 15, and when the MV of one encoded block is greater than or equal to 12 and less than 15, it may be determined that the target resolution is 1/2 of the width and height of the first resolution.
In the case that the length of the motion vector MV of the one encoded block is greater than or equal to the fourth preset threshold, the target resolution is determined to be the sixth resolution, and in the case that the MV of the one encoded block is greater than or equal to 15, the target resolution may be determined to be 1/3 of the width and height of the first resolution, it can be seen that the above-mentioned first resolution > the third resolution > the fourth resolution > the fifth resolution > the sixth resolution.
For a current block to be coded in video, if a motion vector MV of a coded block is smaller than a first preset threshold value, the inter-frame motion of the current coded block is complex, and the current coded block is coded by adopting high resolution, namely, the first resolution. If the second preset threshold value is greater than the motion vector MV > =first preset threshold value of one coded block, the intra-frame texture of the current coded block is complex, and the current coded block is coded by using 3/4 samples with high resolution width and height, i.e. the third resolution can be 3/4 of the width and height of the first resolution; if the third preset threshold value is greater than the motion vector MV > =second preset threshold value of one encoded block, the intra-frame texture of the current encoded block is complex, and the current encoded block is encoded by using 2/3 samples with high resolution width and height, i.e. the fourth resolution may be 2/3 of the width and height of the first resolution; if the fourth preset threshold value is greater than the motion vector MV > =third preset threshold value of one encoded block, the intra-frame texture of the current encoded block is complex, and the current encoded block is encoded by using 1/2 of the high-resolution width and height samples, i.e. the fifth resolution may be 1/2 of the high-width and height of the first resolution; the motion vector MV > =fourth preset threshold of one encoded block indicates that the intra texture of the current encoded block is complex, and the current encoded block is encoded by using 1/3 of the high-resolution width and height samples, i.e. the sixth resolution may be 1/3 of the first-resolution width and height samples, and so on.
In the embodiment of the present invention, the first preset threshold, the second preset threshold, and the third preset threshold are positively correlated, and the fourth preset threshold is positively correlated with the maximum resolution in the predetermined resolution set, for example, the first preset threshold may be set to 6, the second preset threshold is set to 9, the third preset threshold is set to 12, and the fourth preset threshold is set to 15, where the resolution set includes the first resolution, the third resolution, the fourth resolution, the fifth resolution, and the sixth resolution.
In the embodiment of the present invention, the target resolution may be directly carried by the flag bit, where the first resolution, the second resolution, the third resolution, the fourth resolution, the fifth resolution, and the sixth resolution may be represented by 3 bits, for example, 000 represents the first resolution, 001 represents the second resolution, 010 represents the third resolution, 011 represents the fourth resolution, 100 represents the fifth resolution, and 101 represents the sixth resolution, and the flag bit may be an adaptive resolution flag bit, and the name may be Adaptive Resolution.
In the embodiment of the present invention, the step S4042 may specifically include:
determining the target resolution as the first resolution in case that the variance or mean of the lengths of the motion vectors MV of the plurality of encoded blocks is smaller than a fifth preset threshold;
In the case where the variance or mean value of the lengths of the motion vectors MV of the plurality of encoded blocks is greater than or equal to the fifth preset threshold, the target resolution is determined to be the second resolution, wherein the first resolution is greater than the second resolution, wherein the fifth preset threshold may be the same as or different from the first preset threshold, and may be preset according to specific situations, for example, the fifth preset threshold may be set to any number of 5 to 7, for example, the first preset threshold may be set to 7.
Wherein the variance or mean of the lengths of the motion vectors MV of the plurality of encoded blocks is the square of the lengths of the difference vectors of the motion vector MV of each encoded block of the plurality of encoded blocks and the average vector (average vector is the mean of the vectors in each dimension).
Further, the second resolution may be further divided into a plurality of levels of resolution, for example, the second resolution includes: third, fourth, fifth, sixth, etc., for example, the third resolution is 3/4 of the width-height of the first resolution, the fourth resolution is 2/3 of the width-height of the first resolution, the fifth resolution is 1/2 of the width-height of the first resolution, the sixth resolution is 1/3 of the width-height of the first resolution, and the determining the target resolution as the second resolution in a case where the variance or mean value of the lengths of the motion vectors MV of the plurality of encoded blocks is greater than or equal to the fifth preset threshold value, correspondingly, includes:
Determining the target resolution as a third resolution in case that the variance or mean of the lengths of the motion vectors MV of the plurality of encoded blocks is greater than or equal to the fifth preset threshold and less than the sixth preset threshold; the sixth preset threshold may be preset, for example, the sixth preset threshold may be set to 10, and when the weighted sum of MVs of the plurality of encoded blocks is greater than or equal to 7 and less than 10, it may be determined that the target resolution is 3/4 of the width and height of the first resolution.
Determining the target resolution as a fourth resolution in case that a variance or mean of lengths of motion vectors MV of the plurality of encoded blocks is greater than or equal to the sixth preset threshold and less than a seventh preset threshold; the seventh preset threshold may be set in advance, for example, the seventh preset threshold may be set to 13, and when the weighted sum of MVs of the plurality of encoded blocks is greater than or equal to 10 and less than 13, it may be determined that the target resolution is 2/3 of the width and height of the first resolution.
Determining the target resolution as a fifth resolution in case that a variance or mean of lengths of motion vectors MV of the plurality of encoded blocks is greater than or equal to the seventh preset threshold and less than an eighth preset threshold; the eighth preset threshold may be preset, for example, the eighth preset threshold may be set to 16, and when the weighted sum of MVs of the plurality of encoded blocks is greater than or equal to 13 and less than 16, it may be determined that the target resolution is 1/2 of the width and height of the first resolution.
In the case where the variance or mean of the lengths of the motion vectors MV of the plurality of encoded blocks is greater than or equal to the eighth preset threshold, the target resolution is determined to be the sixth resolution, and in the case where the weighted sum of MVs of the plurality of encoded blocks is greater than or equal to 16, the target resolution may be determined to be 1/3 of the width and height of the sixth resolution, the first resolution > third resolution > fourth resolution > fifth resolution > sixth resolution.
For a current block to be coded in video, if the variance of motion vectors MV of a plurality of coded blocks is smaller than a first preset threshold value, the inter-frame motion of the current coded block is complex, and the current coded block is coded by adopting high resolution, namely, the first resolution. If the second preset threshold value > the variance of the motion vectors MV of the plurality of encoded blocks > = the first preset threshold value, the intra-frame texture of the current encoded block is complex, and the current encoded block is encoded by using 3/4 samples with high resolution width and height, i.e. the third resolution may be 3/4 of the width and height of the first resolution; if the third preset threshold value > the variance of the motion vectors MV of the plurality of encoded blocks > = the second preset threshold value, the intra-frame texture of the current encoded block is complex, and the current encoded block is encoded by using 2/3 samples with high resolution width and height, i.e. the fourth resolution may be 2/3 of the width and height of the first resolution; if the fourth preset threshold value > the variance of the motion vectors MV of the plurality of encoded blocks > = the third preset threshold value, the intra-frame texture of the current encoded block is complex, and the current encoded block is encoded by using 1/2 of the high-resolution width and height samples, i.e. the fifth resolution may be 1/2 of the high-width and height of the first resolution; the variance > =fourth preset threshold of the motion vectors MV of the plurality of encoded blocks indicates that the intra texture of the current encoded block is complex, and the current encoded block is encoded by using 1/3 of the samples with high resolution width and height, i.e. the sixth resolution may be 1/3 of the width and height of the first resolution, etc.
In the embodiment of the present invention, the fifth preset threshold, the sixth preset threshold, and the seventh preset threshold are respectively in positive correlation with the maximum resolution in the predetermined resolution set, for example, the fifth preset threshold is set to 7, the sixth preset threshold is set to 10, the seventh preset threshold is set to 13, the eighth preset threshold is set to 16, and the above resolution set includes the first resolution, the third resolution, the fourth resolution, the fifth resolution, and the sixth resolution.
In an embodiment of the present invention, in the case that the reference block includes a plurality of encoded blocks, the plurality of encoded blocks are consecutive ones or are discontinuous ones.
In the video coding process of the embodiment of the invention, the corresponding resolution is adopted for the self-adaption of different blocks in one frame in the video to code, and the resolution adopted by the current block is decided to be high resolution or low resolution by utilizing the information (MV) of the neighborhood coded block, so that the decoding resolution of the current block can be determined according to the same decision rule at a decoding end, and the decoding can be completed rapidly.
The decision process of the coding resolution used by the coding block of the present invention will be described in detail below.
For a current coding block t to be coded in video, referring to the relation between variances of MVs of a plurality of coding blocks (continuous or discontinuous) which are adjacent to the current coding block t and finish coding and a threshold value, selecting a corresponding resolution for a t-th coding block for coding.
In the first mode, when coding the t-th coding block in the video, the variance of the MVs of the t-k-th coding blocks in the neighborhood that have completed coding is obtained (a large variance indicates that the motion directions are not uniform). If the variance is larger than a preset threshold, the coding consistency is poor, the coding is complex, and therefore the t coding block is selected to be coded with low resolution; if the variance is smaller than the preset threshold, the coding consistency is better, the coding complexity is lower, and the t coding block is selected to be coded with high resolution.
In the second mode, when coding the t-th coding block in the video, the variances of MVs of the coding blocks in the neighborhood that have been coded are obtained (large variances indicate inconsistent motion directions). If the variance is larger than a preset threshold, the coding consistency is poor, the coding is complex, and therefore the t coding block is selected to be coded with low resolution; if the variance is smaller than the preset threshold, the coding consistency is better, the coding complexity is lower, and the t coding block is selected to be coded with high resolution.
As an alternative example, the predetermined threshold may be positively correlated with the maximum of the selectable resolutions.
As an alternative example, the above-mentioned multiframes may be consecutive multiframes or discontinuous multiframes.
Fig. 5 is a schematic diagram of video coding according to an embodiment of the present invention, as shown in fig. 5, in the video coding process according to an embodiment of the present invention, the coding resolution adopted by the information of the current coding block is self-analyzed for different blocks in a frame of the video, so that the purposes of relatively large peak signal-to-noise ratio and relatively small distortion can be achieved, both in the case that the bandwidth of transmission is relatively small (for example, smaller than the bandwidth threshold Th shown in fig. 5) and in the case that the bandwidth of transmission is relatively large (for example, larger than the bandwidth threshold Th shown in fig. 5).
In addition, since the coding resolution is adopted for the adaptive decision of different blocks in one frame in the video, the corresponding resolution does not need to be selected according to the different types of video or the different frames of the same video or the intersection points corresponding to the different blocks in the same frame when the frames in the video are coded (fig. 6 is a schematic diagram II of video coding according to an embodiment of the invention, as shown by the intersection points in fig. 6), and the coding complexity is reduced.
In the video coding process, the coding resolution adopted by the gradient information self-adaptive decision of the neighborhood coded blocks is utilized for different blocks in one frame in the video, so that the video coding method has relatively high peak signal-to-noise ratio and small distortion under the whole bandwidth. In addition, when different blocks in one frame in the video are coded, the corresponding resolution is not required to be selected according to different types of videos or different frames of the same video or the intersection points corresponding to different blocks in the same frame, so that the coding complexity is reduced.
An embodiment of the present invention provides a video decoding method, which is illustrated by a terminal or a server applied in the above application environment, and fig. 7 is a flowchart of the video decoding method according to the embodiment of the present invention, as shown in fig. 7, and includes the following steps:
step S702, obtaining motion vector MV of a reference block of a block to be decoded in a video frame to be decoded, wherein the reference block is a decoded block referred to by the block to be decoded in the video frame to be decoded;
in the embodiment of the present invention, in the case that the reference block includes a plurality of decoded blocks, the plurality of decoded blocks are consecutive ones or discontinuous ones.
Step S704, determining a target resolution for decoding the block to be decoded according to the motion vector MV, wherein the target resolution is a first resolution when the motion vector MV indicates that the motion intensity of the reference block of the block to be decoded is less than a predetermined threshold; in the case that the motion vector MV indicates that the motion intensity of the reference block of the block to be decoded is greater than or equal to the predetermined threshold, the target resolution is a second resolution, wherein the first resolution is greater than the second resolution;
specifically, when the length of the motion vector MV of one decoded block is smaller than a first preset threshold, or the variance or the mean of the lengths of the motion vectors MV of a plurality of decoded blocks is smaller than a fifth preset threshold, the motion intensity of the reference block is greater than or equal to a predetermined threshold, that is, the motion is not intense, and conversely, the motion is intense, wherein the fifth preset threshold is the same as or different from the first preset threshold.
Step S706, decoding the block to be decoded according to the target resolution.
Through steps S702 to S706, the decoding side obtains the motion vector MV of the reference block of the block to be decoded in the video frame to be decoded, where the reference block is the decoded block referred to by the block to be decoded in the video frame to be decoded, determines the target resolution for decoding the block to be decoded according to the motion vector MV, and decodes the block to be decoded according to the target resolution, thereby solving the technical problem that different blocks in a frame of video are encoded with the same resolution in the existing video encoding process, and decoding with the same resolution in the decoding process, so that distortion is relatively large in the video transmission process, and the video quality is poor.
In the embodiment of the invention, at least one to-be-reconstructed block is determined from a current video frame, wherein each to-be-decoded block in the at least one to-be-decoded block comprises a first to-be-decoded block with a first resolution and a second to-be-decoded block with a second resolution, and the first to-be-decoded block and the second to-be-decoded block are adjacent to each other in position;
adjusting the first resolution of the first block to be decoded to be the target resolution, and adjusting the second resolution of the second block to be decoded to be the target resolution;
determining a first edge pixel point set from a first block to be decoded, and determining a second edge pixel point set from a second block to be decoded, wherein the position of the first edge pixel point set is adjacent to the position of the second edge pixel point set;
filtering the first edge pixel point set to obtain a filtered first edge pixel point set, and filtering the second edge pixel point set to obtain a filtered second edge pixel point set, wherein the filtered first edge pixel point set is matched with the filtered second edge pixel point set.
The first difference value between the pixel value of the ith pixel point in the filtered first edge pixel point set and the pixel value of the jth pixel point corresponding to the ith pixel point in the filtered second edge pixel point set is smaller than the second difference value between the pixel value of the ith pixel point in the first edge pixel point set and the pixel value of the jth pixel point in the second edge pixel point set, i is a positive integer and is smaller than or equal to the total number of the 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 the pixel points in the second edge pixel point set.
Wherein adjusting to the target resolution comprises:
1) Adjusting the second resolution to the first resolution in the case where the target resolution is equal to the first resolution;
2) Adjusting the first resolution to the second resolution in the case where the target resolution is equal to the second resolution;
3) In the case where the target resolution is equal to the third resolution, the first resolution is adjusted to the third resolution, and the second resolution is adjusted to the third resolution, wherein the third resolution is different from the first resolution and different from the second resolution.
The resolution of the block to be decoded is adjusted, and the edge pixel point set determined in the block to be decoded is subjected to edge filtering treatment, so that obvious joints in a video can be avoided in the reconstruction process, the content in the video is ensured to be accurately restored, and the technical problem of video distortion caused by inconsistent resolution is solved.
In an alternative embodiment, the step S704 may specifically include:
under the condition that the motion vector MV indicates that the reference block of the block to be decoded does not move severely (namely, is a non-large motion scene), determining the target resolution as a first resolution;
And determining the target resolution as a second resolution under the condition that the motion vector MV indicates that the reference block of the block to be decoded moves severely (namely, is a large motion scene), wherein the first resolution is larger than the second resolution.
In another alternative embodiment, the step S704 may specifically include:
s7041, in the case where the reference block is a decoded block, determining the target resolution according to the motion vector MV of the one decoded block; the to-be-decoded block is the t-th block in the to-be-decoded video frame, the reference block is the decoded t-k-th block, the MVs of the t-k-th block are calculated, and the target resolution can be determined according to the MVs of the t-k-th block.
S7042, in the case that the reference block is a plurality of decoded blocks, determining the target resolution according to the variances of the motion vectors MVs of the plurality of decoded blocks, specifically, calculating MVs of each decoded block in the reference block, and determining variances or mean values of MVs of all decoded blocks in the reference block, so as to determine the target resolution.
In the embodiment of the present invention, the step S7041 may specifically include:
determining the target resolution as a first resolution in case that the motion vector MV of the one decoded block is smaller than a first preset threshold;
In case that the motion vector MV of the one decoded block is greater than or equal to the first preset threshold, the target resolution is determined to be the second resolution, wherein the first resolution is greater than the second resolution, wherein the first preset threshold may be preset according to specific situations, e.g., the first preset threshold may be set to any number of 5-7, e.g., the first preset threshold may be set to 6.
Further, the second resolution may be further divided into a plurality of levels of resolution, for example, the second resolution includes: third, fourth, fifth, sixth, etc., for example, the third resolution is 3/4 of the width and height of the first resolution, the fourth resolution is 2/3 of the width and height of the first resolution, the fifth resolution is 1/2 of the width and height of the first resolution, the sixth resolution is 1/3 of the width and height of the first resolution, and correspondingly, in case that the motion vector MV of the one decoded block is greater than or equal to the first preset threshold, determining the target resolution as the second resolution includes:
determining the target resolution as a third resolution in case that the motion vector MV of the one decoded block is greater than or equal to the first preset threshold and less than a second preset threshold;
Determining the target resolution as a fourth resolution in case that the motion vector MV of the one decoded block is greater than or equal to the second preset threshold and less than a third preset threshold;
determining the target resolution as a fifth resolution in case that the motion vector MV of the one decoded block is greater than or equal to the third preset threshold and less than a fourth preset threshold;
in case that the motion vector MV of the one decoded block is greater than or equal to the fourth preset threshold, determining the target resolution as a sixth resolution, wherein the first resolution > the third resolution > the fourth resolution > the fifth resolution > the sixth resolution.
In the embodiment of the present invention, the first preset threshold, the second preset threshold, and the third preset threshold are respectively positive correlation with a maximum resolution in a predetermined resolution set, where the resolution set includes the first resolution, the third resolution, the fourth resolution, the fifth resolution, and the sixth resolution.
In the embodiment of the present invention, the step S7042 may specifically include:
determining the target resolution as the first resolution in case that the variance of the motion vectors MV of the plurality of decoded blocks is smaller than a fifth preset threshold;
And determining the target resolution as a second resolution in the case that the variance of the motion vectors MV of the plurality of decoded blocks is greater than or equal to the fifth preset threshold, wherein the first resolution is greater than the second resolution. Wherein the fifth preset threshold may be the same as or different from the first preset threshold, and may be preset according to specific situations, for example, the fifth preset threshold may be set to any number from 5 to 7, for example, the first preset threshold may be set to 7
Further, the second resolution may be further divided into a plurality of levels of resolution, for example, the second resolution includes: third, fourth, fifth, sixth, etc., for example, the third resolution is 3/4 of the width-height of the first resolution, the fourth resolution is 2/3 of the width-height of the first resolution, the fifth resolution is 1/2 of the width-height of the first resolution, the sixth resolution is 1/3 of the width-height of the first resolution, and determining the target resolution as the second resolution in case that the variance of the motion vector MV of the plurality of decoded blocks is greater than or equal to the fifth preset threshold comprises:
determining the target resolution as a third resolution in case that the variance of the motion vectors MV of the plurality of decoded blocks is greater than or equal to the fifth preset threshold and less than the sixth preset threshold; the sixth preset threshold may be preset, for example, the sixth preset threshold may be set to 10, and when the weighted sum of MADs of the plurality of decoded blocks is greater than or equal to 7 and less than 10, it may be determined that the target resolution is 3/4 of the width and height of the first resolution.
Determining the target resolution as a fourth resolution in case that the variance of the motion vectors MV of the plurality of decoded blocks is greater than or equal to the sixth preset threshold and less than the seventh preset threshold; the seventh preset threshold may be set in advance, for example, the seventh preset threshold may be set to 13, and when the weighted sum of MADs of the plurality of decoded blocks is greater than or equal to 10 and less than 13, it may be determined that the target resolution is 2/3 of the width and height of the first resolution.
Determining the target resolution as a fifth resolution in the case that the variance of the motion vectors MV of the plurality of decoded blocks is greater than or equal to the seventh preset threshold and less than the eighth preset threshold; the eighth preset threshold may be preset, for example, the eighth preset threshold may be set to 16, and when the weighted sum of MADs of the plurality of decoded blocks is greater than or equal to 13 and less than 16, it may be determined that the target resolution is 1/2 of the width and height of the first resolution.
In the case where the variance of the motion vectors MV of the plurality of decoded blocks is greater than or equal to the eighth preset threshold, the target resolution is determined to be the sixth resolution, and in the case where the weighted sum of MVs of the plurality of decoded blocks is greater than or equal to 16, the target resolution may be determined to be 1/3 of the width and height of the sixth resolution, the first resolution > the third resolution > the fourth resolution > the fifth resolution > the sixth resolution.
In the embodiment of the present invention, the fifth preset threshold, the sixth preset threshold, the seventh preset threshold, and the eighth preset threshold are respectively in positive correlation with the maximum resolution in the predetermined resolution set, for example, the fifth preset threshold is set to 7, the sixth preset threshold is set to 10, the seventh preset threshold is set to 13, and the eighth preset threshold is set to 16, where the resolution set includes the first resolution, the third resolution, the fourth resolution, the fifth resolution, and the sixth resolution.
An embodiment of the present invention further provides a video decoding apparatus, and fig. 8 is a block diagram of a video decoding apparatus according to an embodiment of the present invention, as shown in fig. 8, including:
a first obtaining module 82, configured to obtain a motion vector MV of a reference block of a block to be decoded in a video frame to be decoded, where the reference block is a decoded block referred to by the block to be decoded in the video frame to be decoded;
a first determining module 84, configured to determine a target resolution for decoding the block to be decoded according to the motion vector MV, where the target resolution is the first resolution when the motion vector MV indicates that the motion intensity of the reference block of the block to be decoded is greater than or equal to a predetermined threshold; in the case that the motion vector MV indicates that the motion intensity of the reference block of the block to be decoded is less than the predetermined threshold, the target resolution is a second resolution, wherein the first resolution is greater than the second resolution;
A decoding module 86, configured to decode the block to be decoded according to the target resolution.
Fig. 9 is a block diagram of a video decoding apparatus according to a preferred embodiment of the present invention, and as shown in fig. 9, the first determining module 84 includes:
a first determining sub-module 92 for determining the target resolution according to the length of the motion vector MV of one decoded block in case that the reference block is one decoded block;
a second determining sub-module 94, configured to determine the target resolution according to a variance or a mean of lengths of motion vectors MV of a plurality of decoded blocks in case that the reference block is the plurality of decoded blocks.
Optionally, the first determining submodule 92 includes:
a first determining unit configured to determine the target resolution as a first resolution in a case where a length of a motion vector MV of the one decoded block is less than a first preset threshold;
and a second determining unit configured to determine the target resolution as a second resolution in a case where a length of the motion vector MV of the one decoded block is greater than or equal to the first preset threshold, wherein the first resolution is greater than the second resolution.
Optionally, the second determining unit is further configured to
Determining the target resolution as a third resolution in case that the length of the motion vector MV of the one decoded block is greater than or equal to the first preset threshold and less than the second preset threshold;
determining the target resolution as a fourth resolution in case that the length of the motion vector MV of the one decoded block is greater than or equal to the second preset threshold and less than a third preset threshold;
determining the target resolution as a fifth resolution in case that the length of the motion vector MV of the one decoded block is greater than or equal to the third preset threshold and less than the fourth preset threshold;
in case that the length of the motion vector MV of the one decoded block is greater than or equal to the fourth preset threshold, determining the target resolution as a sixth resolution, wherein the first resolution > the third resolution > the fourth resolution > the fifth resolution > the sixth resolution.
Optionally, the first preset threshold, the second preset threshold, the third preset threshold, and the fourth preset threshold are positively correlated to a maximum resolution in a predetermined resolution set, where the resolution set includes the first resolution, the third resolution, the fourth resolution, the fifth resolution, and the sixth resolution.
Optionally, the apparatus further comprises:
and the second acquisition module is used for acquiring a t-th zone bit corresponding to the t-th block in the process of decoding the block to be decoded according to the target resolution under the condition that the corresponding different t and k are not identical, wherein the t-th zone bit is used for representing k corresponding to t.
Optionally, the second determining submodule 94 includes:
a third determining unit for determining the target resolution as the first resolution in case that a variance or a mean value of lengths of motion vectors MV of the plurality of decoded blocks is smaller than a fifth preset threshold;
and a fourth determining unit configured to determine the target resolution as a second resolution in a case where a variance or a mean value of lengths of the motion vectors MV of the plurality of decoded blocks is greater than or equal to the fifth preset threshold, wherein the first resolution is greater than the second resolution.
Optionally, the fourth determining unit is further configured to
Determining the target resolution as a third resolution in case that a variance or mean of lengths of motion vectors MV of the plurality of decoded blocks is greater than or equal to the fifth preset threshold and less than a sixth preset threshold;
Determining the target resolution as a fourth resolution in case that a variance or mean of lengths of motion vectors MV of the plurality of decoded blocks is greater than or equal to the sixth preset threshold and less than a seventh preset threshold;
determining the target resolution as a fifth resolution in case that a variance or mean of lengths of motion vectors MV of the plurality of decoded blocks is greater than or equal to the seventh preset threshold and less than an eighth preset threshold;
and determining the target resolution as a sixth resolution in the case that the variance or mean of the lengths of the motion vectors MV of the plurality of decoded blocks is greater than or equal to the eighth preset threshold, wherein the first resolution > the third resolution > the fourth resolution > the fifth resolution > the sixth resolution.
Optionally, the fifth preset threshold, the sixth preset threshold, the seventh preset threshold, and the eighth preset threshold are respectively in positive correlation with a maximum resolution in a predetermined resolution set, where the resolution set includes the first resolution, the third resolution, the fourth resolution, the fifth resolution, and the sixth resolution.
Optionally, in the case that the reference block includes a plurality of decoded blocks, the plurality of decoded blocks are consecutive ones or are discontinuous ones.
An embodiment of the present invention further provides a video encoding apparatus, and fig. 10 is a block diagram of a video encoding apparatus according to an embodiment of the present invention, as shown in fig. 10, including:
a second obtaining module 102, configured to obtain a motion vector MV of a reference block of a block to be encoded in a video frame to be encoded, where the reference block is an encoded block referred to by the block to be encoded in the video frame to be encoded;
a second determining module 104, configured to determine a target resolution for encoding the block to be encoded according to the motion vector MV, where the target resolution is the first resolution when the motion vector MV indicates that the motion intensity of the reference block of the block to be decoded is greater than or equal to a predetermined threshold; in the case that the motion vector MV indicates that the motion intensity of the reference block of the block to be decoded is less than the predetermined threshold, the target resolution is a second resolution, wherein the first resolution is greater than the second resolution;
and the encoding module 106 is configured to encode the block to be encoded according to the target resolution.
Optionally, the second determining module 104 includes:
a third determination sub-module for determining the target resolution according to the length of the motion vector MV of one encoded block in case that the reference block is the one encoded block;
And a fourth determination sub-module for determining the target resolution according to a variance or mean of lengths of motion vectors MV of the plurality of encoded blocks in case that the reference block is the plurality of encoded blocks.
Optionally, the third determining submodule includes:
a fifth determining unit for determining the target resolution as the first resolution in case that the length of the motion vector MV of the one encoded block is smaller than a first preset threshold;
a sixth determining unit, configured to determine the target resolution as a second resolution when the length of the motion vector MV of the one encoded block is greater than or equal to the first preset threshold, where the first resolution is greater than the second resolution.
Optionally, the sixth determining unit is further configured to
Determining the target resolution as a third resolution in case that the length of the motion vector MV of the one encoded block is greater than or equal to the first preset threshold and less than the second preset threshold;
determining the target resolution as a fourth resolution in case that the length of the motion vector MV of the one encoded block is greater than or equal to the second preset threshold and less than a third preset threshold;
determining the target resolution as a fifth resolution in case that the length of the motion vector MV of the one encoded block is greater than or equal to the third preset threshold and less than the fourth preset threshold;
In case that the length of the motion vector MV of the one encoded block is greater than or equal to the fourth preset threshold, determining the target resolution as a sixth resolution, wherein the first resolution > the third resolution > the fourth resolution > the fifth resolution > the sixth resolution.
Optionally, the first preset threshold, the second preset threshold, and the third preset threshold are respectively in positive correlation with a maximum resolution in a predetermined resolution set, where the resolution set includes the first resolution, the third resolution, the fourth resolution, the fifth resolution, and the sixth resolution.
Optionally, the fourth determining submodule includes:
a seventh determining unit for determining the target resolution as the first resolution in case that a variance or a mean value of lengths of motion vectors MV of the plurality of encoded blocks is smaller than a fifth preset threshold;
an eighth determining unit configured to determine the target resolution as a second resolution in a case where a variance or a mean of lengths of motion vectors MV of the plurality of encoded blocks is greater than or equal to the fifth preset threshold, wherein the first resolution is greater than the second resolution.
Optionally, the eighth determining unit is further configured to
Determining the target resolution as a third resolution in case that the variance or mean of the lengths of the motion vectors MV of the plurality of encoded blocks is greater than or equal to the fifth preset threshold and less than the sixth preset threshold;
determining the target resolution as a fourth resolution in case that a variance or mean of lengths of motion vectors MV of the plurality of encoded blocks is greater than or equal to the sixth preset threshold and less than a seventh preset threshold;
determining the target resolution as a fifth resolution in case that a variance or mean of lengths of motion vectors MV of the plurality of encoded blocks is greater than or equal to the seventh preset threshold and less than an eighth preset threshold;
and determining the target resolution as a sixth resolution in the case that the variance or mean of the lengths of the motion vectors MV of the plurality of encoded blocks is greater than or equal to the eighth preset threshold, wherein the first resolution > the third resolution > the fourth resolution > the fifth resolution > the sixth resolution.
Optionally, the fifth preset threshold, the sixth preset threshold, and the seventh preset threshold are respectively in positive correlation with a maximum resolution in a predetermined resolution set, where the resolution set includes the first resolution, the third resolution, the fourth resolution, the fifth resolution, and the sixth resolution.
Optionally, in the case that the reference block includes a plurality of encoded blocks, the plurality of encoded blocks are consecutive ones or are discontinuous ones.
An embodiment of the present invention further provides an electronic device for implementing the video decoding method described above, as shown in fig. 11, the electronic device including a memory 1102 and a processor 1104, the memory 1102 storing a computer program, the processor 1104 being configured to execute the steps of any of the method embodiments described above by means of the computer program.
Alternatively, in this embodiment, the electronic apparatus may be located in at least one network device of a plurality of network devices of the computer network.
Alternatively, in the present embodiment, the above-described processor may be configured to execute the following steps by a computer program:
s11, obtaining a motion vector MV of a reference block of a block to be decoded in a video frame to be decoded, wherein the reference block is a decoded block referred to by the block to be decoded in the video frame to be decoded;
s12, determining a target resolution for decoding the block to be decoded according to the motion vector MV, wherein the target resolution is a first resolution under the condition that the motion vector MV represents that the motion intensity of a reference block of the block to be decoded is greater than or equal to a preset threshold value; in the case that the motion vector MV indicates that the motion intensity of the reference block of the block to be decoded is less than the predetermined threshold, the target resolution is a second resolution, wherein the first resolution is greater than the second resolution;
S13, decoding the block to be decoded according to the target resolution.
Alternatively, it will be understood by those skilled in the art that the structure shown in fig. 11 is only schematic, and the electronic device may also be a smart phone (such as android mobile phone, iOS mobile phone, etc.), a tablet computer, a palmtop computer, a mobile internet device (Mobile Internet Devices, M identifier), a PAD, etc. Fig. 11 is not limited to the structure of the electronic device. For example, the electronic device may also include more or fewer components (e.g., network interfaces, etc.) than shown in FIG. 11, or have a different configuration than shown in FIG. 11.
The memory 1102 may be used to store software programs and modules, such as program instructions/modules corresponding to the method and apparatus for obtaining media resources in the embodiment of the present invention, and the processor 1104 executes the software programs and modules stored in the memory 1102 to perform various functional applications and data processing, that is, implement the method for obtaining media resources described above. Memory 1102 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, memory 1102 may further include memory located remotely from processor 1104, which may be connected to the terminal via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof. The memory 1102 may specifically, but not limited to, information such as an encryption key (including a first encryption key, a second encryption key, etc.) and a decryption key (including a first decryption key, a second decryption key, etc.). As an example, as shown in fig. 11, the memory 1102 may include, but is not limited to, the first obtaining module 82, the first determining module 84, and the decoding module 86 in the video decoding apparatus. In addition, other module units in the video decoding apparatus one may be included, but are not limited to, and are not described in detail in this example.
Optionally, the transmission device 1106 is used to receive or transmit data via a network. Specific examples of the network described above may include wired networks and wireless networks. In one example, the transmission device 1106 includes a network adapter (Network Interface Controller, NIC) that may be connected to other network devices and routers via a network cable to communicate with the internet or a local area network. In one example, the transmission device 1106 is a Radio Frequency (RF) module for communicating wirelessly with the internet.
In addition, the electronic device further includes: a display 1108 for displaying the media assets; and a connection bus 1110 for connecting the respective module parts in the above-described electronic apparatus.
According to a further aspect of embodiments of the present invention there is also provided an electronic device for implementing the video encoding method described above, as shown in fig. 10, the electronic device comprising a memory 1102 and a processor 1104, the memory 1102 having stored therein a computer program, the processor 1104 being arranged to perform the steps of any of the method embodiments described above by means of the computer program.
Alternatively, in this embodiment, the electronic apparatus may be located in at least one network device of a plurality of network devices of the computer network.
Alternatively, in the present embodiment, the above-described processor may be configured to execute the following steps by a computer program:
s21, obtaining a motion vector MV of a reference block of a block to be coded in a video frame to be coded, wherein the reference block is a coded block referred to by the block to be coded in the video frame to be coded;
s22, determining a target resolution for encoding the block to be encoded according to the motion vector MV, wherein the target resolution is a first resolution under the condition that the motion vector MV represents that the motion intensity of a reference block of the block to be decoded is greater than or equal to a preset threshold value; in the case that the motion vector MV indicates that the motion intensity of the reference block of the block to be decoded is less than the predetermined threshold, the target resolution is a second resolution, wherein the first resolution is greater than the second resolution;
s23, encoding the block to be encoded according to the target resolution.
Alternatively, it will be understood by those skilled in the art that the structure shown in fig. 12 is only schematic, and the electronic device may also be a smart phone (such as android mobile phone, iOS mobile phone, etc.), a tablet computer, a palmtop computer, a mobile internet device (Mobile Internet Devices, M identifier), a PAD, etc. Fig. 12 is not limited to the structure of the electronic device. For example, the electronic device may also include more or fewer components (e.g., network interfaces, etc.) than shown in FIG. 12, or have a different configuration than shown in FIG. 12.
The memory 1102 may be used to store software programs and modules, such as program instructions/modules corresponding to the method and apparatus for obtaining media resources in the embodiment of the present invention, and the processor 1104 executes the software programs and modules stored in the memory 1102 to perform various functional applications and data processing, that is, implement the method for obtaining media resources described above. Memory 1102 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, memory 1102 may further include memory located remotely from processor 1104, which may be connected to the terminal via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof. The memory 1102 may specifically, but not limited to, information such as an encryption key (including a first encryption key, a second encryption key, etc.) and a decryption key (including a first decryption key, a second decryption key, etc.). As an example, as shown in fig. 12, the memory 1102 may include, but is not limited to, the second obtaining module 102, the second determining module 104, and the encoding module 106 in the video encoding apparatus. In addition, other module units in the video encoding apparatus one may be included, but are not limited to, and are not described in detail in this example.
Optionally, the transmission device 1106 is used to receive or transmit data via a network. Specific examples of the network described above may include wired networks and wireless networks. In one example, the transmission device 1106 includes a network adapter (Network Interface Controller, NIC) that may be connected to other network devices and routers via a network cable to communicate with the internet or a local area network. In one example, the transmission device 1106 is a Radio Frequency (RF) module for communicating wirelessly with the internet.
In addition, the electronic device further includes: a display 1108 for displaying the media assets; and a connection bus 1110 for connecting the respective module parts in the above-described electronic apparatus.
According to a further aspect of embodiments of the present invention, there is also provided a computer readable storage medium having stored therein a computer program, wherein the computer program is arranged to perform the steps of any of the method embodiments described above when run.
Alternatively, in the present embodiment, the above-described storage medium may be configured to store a computer program for performing the steps of:
S11, obtaining a motion vector MV of a reference block of a block to be decoded in a video frame to be decoded, wherein the reference block is a decoded block referred to by the block to be decoded in the video frame to be decoded;
s12, determining a target resolution for decoding the block to be decoded according to the motion vector MV, wherein the target resolution is a first resolution under the condition that the motion vector MV represents that the motion intensity of a reference block of the block to be decoded is greater than or equal to a preset threshold value; in the case that the motion vector MV indicates that the motion intensity of the reference block of the block to be decoded is less than the predetermined threshold, the target resolution is a second resolution, wherein the first resolution is greater than the second resolution;
s13, decoding the block to be decoded according to the target resolution.
Alternatively, in this embodiment, it will be understood by those skilled in the art that all or part of the steps in the methods of the above embodiments may be performed by a program for instructing a terminal device to execute the steps, where the program may be stored in a computer readable storage medium, and the storage medium may include: flash disk, read-Only Memory (ROM), random-access Memory (Random Access Memory, RAM), magnetic or optical disk, and the like.
According to a further aspect of embodiments of the present invention, there is also provided a computer readable storage medium having stored therein a computer program, wherein the computer program is arranged to perform the steps of any of the method embodiments described above when run.
Alternatively, in the present embodiment, the above-described storage medium may be configured to store a computer program for performing the steps of:
s21, obtaining a motion vector MV of a reference block of a block to be coded in a video frame to be coded, wherein the reference block is a coded block referred to by the block to be coded in the video frame to be coded;
s22, determining a target resolution for encoding the block to be encoded according to the motion vector MV, wherein the target resolution is a first resolution under the condition that the motion vector MV represents that the motion intensity of a reference block of the block to be decoded is greater than or equal to a preset threshold value; in the case that the motion vector MV indicates that the motion intensity of the reference block of the block to be decoded is less than the predetermined threshold, the target resolution is a second resolution, wherein the first resolution is greater than the second resolution;
s23, encoding the block to be encoded according to the target resolution.
Alternatively, in this embodiment, it will be understood by those skilled in the art that all or part of the steps in the methods of the above embodiments may be performed by a program for instructing a terminal device to execute the steps, where the program may be stored in a computer readable storage medium, and the storage medium may include: flash disk, read-Only Memory (ROM), random-access Memory (Random Access Memory, RAM), magnetic or optical disk, and the like.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
The integrated units in the above embodiments may be stored in the above-described computer-readable storage medium if implemented in the form of software functional units and sold or used as separate products. Based on such understanding, the technical solution of the present invention may be embodied in essence or a part contributing to the prior art or all or part of the technical solution in the form of a software product stored in a storage medium, comprising several instructions for causing one or more computer devices (which may be personal computers, servers or network devices, etc.) to perform all or part of the steps of the method described in the embodiments of the present invention.
In the foregoing embodiments of the present invention, the descriptions of the embodiments are emphasized, and for a portion of this disclosure that is not described in detail in this embodiment, reference is made to the related descriptions of other embodiments.
In 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 exemplary, and the division of the units, such as the division of the units, is merely a logical function division, and may be implemented in another manner, for example, multiple units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some interfaces, units or modules, or may be in electrical or other forms.
The units described as separate units may or may not be physically separate, and units shown 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 may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The foregoing is merely a preferred embodiment of the present invention and it should be noted that modifications and adaptations to those skilled in the art may be made without departing from the principles of the present invention, which are intended to be comprehended within the scope of the present invention.

Claims (24)

1. A video decoding method, comprising:
obtaining a motion vector MV of a reference block of a block to be decoded in a video frame to be decoded, wherein the reference block is a decoded block referred to by the block to be decoded in the video frame to be decoded;
in the case that the reference block is one decoded block, determining a target resolution for decoding the block to be decoded according to a length of a motion vector MV of the one decoded block; determining a target resolution for decoding the block to be decoded according to a variance or a mean value of lengths of motion vectors MV of a plurality of decoded blocks in the case that the reference block is the plurality of decoded blocks, wherein the target resolution is a first resolution in the case that the motion vector MV represents that the motion intensity of the reference block of the block to be decoded is greater than or equal to a predetermined threshold; in the case that the motion vector MV indicates that the motion intensity of the reference block of the block to be decoded is less than the predetermined threshold, the target resolution is a second resolution, wherein the first resolution is greater than the second resolution;
And decoding the block to be decoded according to the target resolution.
2. The method of claim 1, wherein determining a target resolution for decoding the block to be decoded based on a length of a motion vector MV of the one decoded block comprises:
determining the target resolution as a first resolution in case that the length of the motion vector MV of the one decoded block is less than a first preset threshold;
and determining the target resolution as a second resolution in the case that the length of the motion vector MV of the one decoded block is greater than or equal to the first preset threshold, wherein the first resolution is greater than the second resolution.
3. The method according to claim 2, wherein determining the target resolution as the second resolution in case the motion vector MV of the one decoded block is greater than or equal to the first preset threshold comprises:
determining the target resolution as a third resolution in the case that the length of the motion vector MV of the one decoded block is greater than or equal to the first preset threshold and less than a second preset threshold;
determining the target resolution as a fourth resolution in case that the length of the motion vector MV of the one decoded block is greater than or equal to the second preset threshold and less than a third preset threshold;
Determining the target resolution as a fifth resolution in the case that the length of the motion vector MV of the one decoded block is greater than or equal to the third preset threshold and less than a fourth preset threshold;
and determining the target resolution as a sixth resolution in the case that the length of the motion vector MV of the one decoded block is greater than or equal to the fourth preset threshold, wherein the first resolution > the third resolution > the fourth resolution > the fifth resolution > the sixth resolution.
4. A method according to claim 3, wherein the first preset threshold, the second preset threshold, the third preset threshold, and the fourth preset threshold are each positively correlated with a maximum resolution of a predetermined set of resolutions, wherein the set of resolutions comprises the first resolution, the third resolution, the fourth resolution, the fifth resolution, and the sixth resolution.
5. The method of claim 1, wherein determining a target resolution for decoding the block to be decoded based on a variance or a mean of lengths of motion vectors MV of the plurality of decoded blocks comprises:
Determining the target resolution as a first resolution in case that a variance or a mean of lengths of motion vectors MV of the plurality of decoded blocks is smaller than a fifth preset threshold;
and determining the target resolution as a second resolution in the case that the variance or mean value of the lengths of the motion vectors MV of the plurality of decoded blocks is greater than or equal to the fifth preset threshold, wherein the first resolution is greater than the second resolution, and the fifth preset threshold is the same as or different from the first preset threshold.
6. The method according to claim 5, wherein the determining the target resolution as the second resolution in the case that the variance of the motion vectors MV of the plurality of decoded blocks is greater than or equal to the fifth preset threshold comprises:
determining the target resolution as a third resolution in the case that the variance or mean of the lengths of the motion vectors MV of the plurality of decoded blocks is greater than or equal to the fifth preset threshold and less than a sixth preset threshold;
determining the target resolution as a fourth resolution in the case that the variance or mean of the lengths of the motion vectors MV of the plurality of decoded blocks is greater than or equal to the sixth preset threshold and less than a seventh preset threshold;
Determining that the target resolution is a fifth resolution in the case that the variance or mean of the lengths of the motion vectors MV of the plurality of decoded blocks is greater than or equal to the seventh preset threshold and less than an eighth preset threshold;
and determining the target resolution as a sixth resolution in the case that the variance or mean of the lengths of the motion vectors MV of the plurality of decoded blocks is greater than or equal to the eighth preset threshold, wherein the first resolution > the third resolution > the fourth resolution > the fifth resolution > the sixth resolution.
7. The method of claim 6, wherein the fifth preset threshold, the sixth preset threshold, the seventh preset threshold, and the eighth preset threshold are each positively correlated with a maximum resolution of a predetermined set of resolutions, wherein the set of resolutions comprises the first resolution, the third resolution, the fourth resolution, the fifth resolution, and the sixth resolution.
8. The method of claim 1, wherein, in the case where the reference block comprises a plurality of decoded blocks, the plurality of decoded blocks are consecutive ones or are non-consecutive ones.
9. A video encoding method, comprising:
obtaining a motion vector MV of a reference block of a block to be coded in a video frame to be coded, wherein the reference block is a coded block referred to by the block to be coded in the video frame to be coded;
in the case that the reference block is one encoded block, determining a target resolution for encoding the block to be encoded according to a length of a motion vector MV of the one encoded block; determining a target resolution for encoding the block to be encoded according to a variance or a mean value of lengths of motion vectors MV of a plurality of encoded blocks in the case that the reference block is the plurality of encoded blocks, wherein the target resolution is a first resolution in the case that the motion vector MV represents that the motion intensity of the reference block of the block to be encoded is greater than or equal to a predetermined threshold; in the case that the motion vector MV indicates that the motion intensity of the reference block of the block to be encoded is less than the predetermined threshold, the target resolution is a second resolution, wherein the first resolution is greater than the second resolution;
and encoding the block to be encoded according to the target resolution.
10. The method of claim 9, wherein determining a target resolution for encoding the block to be encoded based on a length of a motion vector MV of the one encoded block comprises:
determining the target resolution as a first resolution in case that the length of the motion vector MV of the one encoded block is smaller than a first preset threshold;
and determining the target resolution as a second resolution in the case that the length of the motion vector MV of the one encoded block is greater than or equal to the first preset threshold, wherein the first resolution is greater than the second resolution.
11. The method of claim 9, wherein determining a target resolution for encoding the block to be encoded based on a variance or a mean of lengths of motion vectors MVs of the plurality of encoded blocks comprises:
determining the target resolution as a first resolution in the case that the variance or mean of the lengths of the motion vectors MV of the plurality of encoded blocks is smaller than a fifth preset threshold;
and determining the target resolution as a second resolution in the case that the variance or mean of the lengths of the motion vectors MV of the plurality of encoded blocks is greater than or equal to the fifth preset threshold, wherein the first resolution is greater than the second resolution.
12. A video decoding apparatus, comprising:
the first acquisition module is used for acquiring a motion vector MV of a reference block of a block to be decoded in a video frame to be decoded, wherein the reference block is a decoded block referred to by the block to be decoded in the video frame to be decoded;
a first determination module, the first determination module comprising: a first determining sub-module, configured to determine, in a case where the reference block is one decoded block, a target resolution for decoding the block to be decoded according to a length of a motion vector MV of the one decoded block;
a second determining sub-module, configured to determine, when the reference block is a plurality of decoded blocks, a target resolution for decoding the block to be decoded according to a variance or a mean value of lengths of motion vectors MV of the plurality of decoded blocks, where the target resolution is a first resolution when the motion vectors MV indicate that a motion intensity of the reference block of the block to be decoded is greater than or equal to a predetermined threshold; in the case that the motion vector MV indicates that the motion intensity of the reference block of the block to be decoded is less than the predetermined threshold, the target resolution is a second resolution, wherein the first resolution is greater than the second resolution; and the decoding module is used for decoding the block to be decoded according to the target resolution.
13. The apparatus of claim 12, wherein the first determination submodule comprises:
a first determining unit, configured to determine the target resolution as a first resolution if a length of a motion vector MV of the one decoded block is less than a first preset threshold;
and a second determining unit configured to determine the target resolution as a second resolution in a case where a length of the motion vector MV of the one decoded block is greater than or equal to the first preset threshold, wherein the first resolution is greater than the second resolution.
14. The apparatus of claim 13, wherein the second determining unit is further configured to:
determining the target resolution as a third resolution in the case that the length of the motion vector MV of the one decoded block is greater than or equal to the first preset threshold and less than a second preset threshold;
determining the target resolution as a fourth resolution in case that the length of the motion vector MV of the one decoded block is greater than or equal to the second preset threshold and less than a third preset threshold;
determining the target resolution as a fifth resolution in the case that the length of the motion vector MV of the one decoded block is greater than or equal to the third preset threshold and less than a fourth preset threshold;
And determining the target resolution as a sixth resolution in the case that the length of the motion vector MV of the one decoded block is greater than or equal to the fourth preset threshold, wherein the first resolution > the third resolution > the fourth resolution > the fifth resolution > the sixth resolution.
15. The apparatus of claim 14, wherein the first preset threshold, the second preset threshold, the third preset threshold, and the fourth preset threshold are each positively correlated with a maximum resolution of a predetermined set of resolutions, wherein the set of resolutions comprises the first resolution, the third resolution, the fourth resolution, the fifth resolution, and the sixth resolution.
16. The apparatus of claim 12, wherein the second determination submodule comprises:
a third determining unit configured to determine the target resolution as a first resolution in a case where a variance or a mean of lengths of motion vectors MV of the plurality of decoded blocks is smaller than a fifth preset threshold;
a fourth determining unit, configured to determine the target resolution as a second resolution if a variance or a mean value of lengths of motion vectors MV of the plurality of decoded blocks is greater than or equal to the fifth preset threshold, where the first resolution is greater than the second resolution, and the fifth preset threshold is the same as or different from the first preset threshold.
17. The apparatus of claim 16, wherein the fourth determination unit is further configured to:
determining the target resolution as a third resolution in the case that the variance or mean of the lengths of the motion vectors MV of the plurality of decoded blocks is greater than or equal to the fifth preset threshold and less than a sixth preset threshold;
determining the target resolution as a fourth resolution in the case that the variance or mean of the lengths of the motion vectors MV of the plurality of decoded blocks is greater than or equal to the sixth preset threshold and less than a seventh preset threshold;
determining that the target resolution is a fifth resolution in the case that the variance or mean of the lengths of the motion vectors MV of the plurality of decoded blocks is greater than or equal to the seventh preset threshold and less than an eighth preset threshold;
and determining the target resolution as a sixth resolution in the case that the variance or mean of the lengths of the motion vectors MV of the plurality of decoded blocks is greater than or equal to the eighth preset threshold, wherein the first resolution > the third resolution > the fourth resolution > the fifth resolution > the sixth resolution.
18. The apparatus of claim 17, wherein the fifth preset threshold, the sixth preset threshold, the seventh preset threshold, and the eighth preset threshold are each positively correlated with a maximum resolution of a predetermined set of resolutions, wherein the set of resolutions comprises the first resolution, the third resolution, the fourth resolution, the fifth resolution, and the sixth resolution.
19. The apparatus of claim 12, wherein the plurality of decoded blocks are consecutive ones or are non-consecutive ones in the case where the reference block comprises a plurality of decoded blocks.
20. A video encoding apparatus, comprising:
the second acquisition module is used for acquiring a motion vector MV of a reference block of a block to be coded in a video frame to be coded, wherein the reference block is a coded block referred to by the block to be coded in the video frame to be coded;
a second determination module, the second determination module comprising: a third determining sub-module, configured to determine, in a case where the reference block is one encoded block, a target resolution for encoding the block to be encoded according to a length of a motion vector MV of the one encoded block; a fourth determining sub-module, configured to determine, when the reference block is a plurality of encoded blocks, a target resolution for encoding the block to be encoded according to a variance or a mean value of lengths of motion vectors MV of the plurality of encoded blocks, where the target resolution is a first resolution when the motion vectors MV indicate that a motion intensity of the reference block of the block to be encoded is greater than or equal to a predetermined threshold; in the case that the motion vector MV indicates that the motion intensity of the reference block of the block to be encoded is less than the predetermined threshold, the target resolution is a second resolution, wherein the first resolution is greater than the second resolution; and the encoding module is used for encoding the block to be encoded according to the target resolution.
21. The apparatus of claim 20, wherein the third determination submodule comprises:
a fifth determining unit, configured to determine the target resolution as a first resolution if the length of the motion vector MV of the one encoded block is less than a first preset threshold;
a sixth determining unit, configured to determine the target resolution as a second resolution when the length of the motion vector MV of the one encoded block is greater than or equal to the first preset threshold, where the first resolution is greater than the second resolution.
22. The apparatus of claim 20, wherein the fourth determination submodule comprises:
a seventh determining unit configured to determine the target resolution as the first resolution in a case where a variance or a mean of lengths of motion vectors MV of the plurality of encoded blocks is smaller than a fifth preset threshold;
an eighth determining unit, configured to determine the target resolution as a second resolution in a case where a variance or a mean value of lengths of motion vectors MV of the plurality of encoded blocks is greater than or equal to the fifth preset threshold, where the first resolution is greater than the second resolution.
23. A computer readable storage medium comprising a stored program, wherein the program when run performs the method of any one of the preceding claims 1 to 8 or 9 to 11.
24. 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 according to any of the claims 1-8 or 9-11 by means of the computer program.
CN201910927984.0A 2019-09-27 2019-09-27 Video encoding and decoding methods and devices, storage medium and electronic device Active CN110572654B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910927984.0A CN110572654B (en) 2019-09-27 2019-09-27 Video encoding and decoding methods and devices, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910927984.0A CN110572654B (en) 2019-09-27 2019-09-27 Video encoding and decoding methods and devices, storage medium and electronic device

Publications (2)

Publication Number Publication Date
CN110572654A CN110572654A (en) 2019-12-13
CN110572654B true CN110572654B (en) 2024-03-15

Family

ID=68782994

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910927984.0A Active CN110572654B (en) 2019-09-27 2019-09-27 Video encoding and decoding methods and devices, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN110572654B (en)

Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003153271A (en) * 2001-11-08 2003-05-23 Nec Corp Moving picture encoding sequence conversion apparatus and method, and its program
WO2011052990A2 (en) * 2009-10-28 2011-05-05 에스케이텔레콤 주식회사 Method and apparatus for encoding/decoding images based on adaptive resolution
JP2011176570A (en) * 2010-02-24 2011-09-08 Nippon Telegr & Teleph Corp <Ntt> Method and device for decoding multi-resolution video, and program
CN102461169A (en) * 2009-06-12 2012-05-16 微软公司 Motion based dynamic resolution multiple bit rate video encoding
US8780976B1 (en) * 2011-04-28 2014-07-15 Google Inc. Method and apparatus for encoding video using granular downsampling of frame resolution
US8780987B1 (en) * 2011-04-28 2014-07-15 Google Inc. Method and apparatus for encoding video by determining block resolution
EP3038370A1 (en) * 2014-12-22 2016-06-29 Alcatel Lucent Devices and method for video compression and reconstruction
CN105959700A (en) * 2016-05-31 2016-09-21 腾讯科技(深圳)有限公司 Video image coding method and device
CN107155107A (en) * 2017-03-21 2017-09-12 腾讯科技(深圳)有限公司 Method for video coding and device, video encoding/decoding method and device
CN107211150A (en) * 2015-01-16 2017-09-26 微软技术许可有限责任公司 Dynamic updates quality to higher chroma samples rate
CN107251557A (en) * 2015-01-16 2017-10-13 微软技术许可有限责任公司 The coding/decoding of chrominance resolution details
JP2017225199A (en) * 2017-09-28 2017-12-21 日本電信電話株式会社 Video encoding device and video encoding program
CN108833923A (en) * 2018-06-20 2018-11-16 腾讯科技(深圳)有限公司 Video coding, coding/decoding method, device, storage medium and computer equipment
CN109600615A (en) * 2018-11-12 2019-04-09 建湖云飞数据科技有限公司 A method of video is decoded based on motion information
CN110166770A (en) * 2018-07-18 2019-08-23 腾讯科技(深圳)有限公司 Method for video coding, device, computer equipment and storage medium

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
FR2822330B1 (en) * 2001-03-14 2003-05-02 Thomson Multimedia Sa BLOCK CODING METHOD, MPEG TYPE, IN WHICH A RESOLUTION IS ASSIGNED TO EACH BLOCK
US7936818B2 (en) * 2002-07-01 2011-05-03 Arris Group, Inc. Efficient compression and transport of video over a network
US20050175099A1 (en) * 2004-02-06 2005-08-11 Nokia Corporation Transcoder and associated system, method and computer program product for low-complexity reduced resolution transcoding
EP1730695A2 (en) * 2004-03-09 2006-12-13 Thomson Research Funding Corporation Reduced resolution update mode for advanced video coding
KR100734314B1 (en) * 2006-02-11 2007-07-02 삼성전자주식회사 Spatial resolution conversion method of image signal in image compression system based on motion compensation
US20090141808A1 (en) * 2007-11-30 2009-06-04 Yiufai Wong System and methods for improved video decoding
US9036707B2 (en) * 2012-05-07 2015-05-19 Cellco Partnership Method and apparatus for finding a motion vector
US20140301463A1 (en) * 2013-04-05 2014-10-09 Nokia Corporation Method and apparatus for video coding and decoding
US10356406B2 (en) * 2016-01-19 2019-07-16 Google Llc Real-time video encoder rate control using dynamic resolution switching
KR102520957B1 (en) * 2016-04-15 2023-04-12 삼성전자주식회사 Encoding apparatus, decoding apparatus and method thereof
US20190037223A1 (en) * 2017-07-25 2019-01-31 Mediatek Inc. Method and Apparatus of Multiple Pass Video Processing Systems
US10869041B2 (en) * 2019-03-29 2020-12-15 Intel Corporation Video cluster encoding for multiple resolutions and bitrates with performance and quality enhancements

Patent Citations (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003153271A (en) * 2001-11-08 2003-05-23 Nec Corp Moving picture encoding sequence conversion apparatus and method, and its program
CN102461169A (en) * 2009-06-12 2012-05-16 微软公司 Motion based dynamic resolution multiple bit rate video encoding
WO2011052990A2 (en) * 2009-10-28 2011-05-05 에스케이텔레콤 주식회사 Method and apparatus for encoding/decoding images based on adaptive resolution
JP2011176570A (en) * 2010-02-24 2011-09-08 Nippon Telegr & Teleph Corp <Ntt> Method and device for decoding multi-resolution video, and program
US8780976B1 (en) * 2011-04-28 2014-07-15 Google Inc. Method and apparatus for encoding video using granular downsampling of frame resolution
US8780987B1 (en) * 2011-04-28 2014-07-15 Google Inc. Method and apparatus for encoding video by determining block resolution
EP3038370A1 (en) * 2014-12-22 2016-06-29 Alcatel Lucent Devices and method for video compression and reconstruction
CN107251557A (en) * 2015-01-16 2017-10-13 微软技术许可有限责任公司 The coding/decoding of chrominance resolution details
CN107211150A (en) * 2015-01-16 2017-09-26 微软技术许可有限责任公司 Dynamic updates quality to higher chroma samples rate
CN105959700A (en) * 2016-05-31 2016-09-21 腾讯科技(深圳)有限公司 Video image coding method and device
CN107155107A (en) * 2017-03-21 2017-09-12 腾讯科技(深圳)有限公司 Method for video coding and device, video encoding/decoding method and device
CN108495130A (en) * 2017-03-21 2018-09-04 腾讯科技(深圳)有限公司 Video coding, coding/decoding method and device, terminal, server and storage medium
JP2017225199A (en) * 2017-09-28 2017-12-21 日本電信電話株式会社 Video encoding device and video encoding program
CN108833923A (en) * 2018-06-20 2018-11-16 腾讯科技(深圳)有限公司 Video coding, coding/decoding method, device, storage medium and computer equipment
CN110166770A (en) * 2018-07-18 2019-08-23 腾讯科技(深圳)有限公司 Method for video coding, device, computer equipment and storage medium
CN109600615A (en) * 2018-11-12 2019-04-09 建湖云飞数据科技有限公司 A method of video is decoded based on motion information

Also Published As

Publication number Publication date
CN110572654A (en) 2019-12-13

Similar Documents

Publication Publication Date Title
CN110636312B (en) Video encoding and decoding method and device and storage medium
CN110636294B (en) Video decoding method and device, and video encoding method and device
CN110545433B (en) Video encoding and decoding method and device and storage medium
CN110519607B (en) Video decoding method and device, and video encoding method and device
CN110572673B (en) Video encoding and decoding method and device, storage medium and electronic device
CN110662071B (en) Video decoding method and device, storage medium and electronic device
CN110650357A (en) Video decoding method and device
CN110677653B (en) Video encoding and decoding method and device and storage medium
CN110572672B (en) Video encoding and decoding method and device, storage medium and electronic device
CN110572677B (en) Video encoding and decoding method and device, storage medium and electronic device
CN110677676B (en) Video encoding method and apparatus, video decoding method and apparatus, and storage medium
CN110572654B (en) Video encoding and decoding methods and devices, storage medium and electronic device
CN110636293B (en) Video encoding and decoding methods and devices, storage medium and electronic device
CN110582022B (en) Video encoding and decoding method and device and storage medium
CN110677721B (en) Video encoding and decoding method and device and storage medium
CN110536134B (en) Video encoding method, video decoding method, video encoding apparatus, video decoding apparatus, storage medium, and electronic apparatus
CN110677690B (en) Video processing method and device and storage medium
CN114157868A (en) Video frame coding mode screening method and device and electronic equipment
CN114222127A (en) Video coding method, video decoding method and device
CN110677691B (en) Video encoding method, video decoding method, video encoding apparatus, video decoding apparatus, storage medium, and electronic apparatus
CN110545431B (en) Video decoding method and device, video encoding method and device
CN110572653A (en) Video encoding method, video decoding method, video encoding apparatus, video decoding apparatus, storage medium, and electronic apparatus
CN110636295B (en) Video encoding and decoding method and device, storage medium and electronic device
CN110572674B (en) Video encoding and decoding method and device, storage medium and electronic device
CN110662060B (en) Video encoding method and apparatus, video decoding method and apparatus, and storage medium

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

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