CN110572653A - Video encoding method, video decoding method, video encoding apparatus, video decoding apparatus, storage medium, and electronic apparatus - Google Patents

Video encoding method, video decoding method, video encoding apparatus, video decoding apparatus, storage medium, and electronic apparatus Download PDF

Info

Publication number
CN110572653A
CN110572653A CN201910927070.4A CN201910927070A CN110572653A CN 110572653 A CN110572653 A CN 110572653A CN 201910927070 A CN201910927070 A CN 201910927070A CN 110572653 A CN110572653 A CN 110572653A
Authority
CN
China
Prior art keywords
resolution
block
target
preset threshold
coded
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.)
Pending
Application number
CN201910927070.4A
Other languages
Chinese (zh)
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 CN201910927070.4A priority Critical patent/CN110572653A/en
Publication of CN110572653A publication Critical patent/CN110572653A/en
Pending legal-status Critical Current

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

Landscapes

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

Abstract

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

Description

Video encoding method, video decoding method, video encoding apparatus, video decoding apparatus, storage medium, and electronic apparatus
Technical Field
The present invention relates to the field of computers, and in particular, to a video encoding method, a video decoding method, a video encoding device, a video decoding device, a storage medium, and an electronic device.
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, and the like. With the improvement of hardware performance and screen resolution, the demand of users for high-definition video is increasingly strong.
if different blocks in a frame of a video are encoded by adopting high resolution, under the condition that the transmission bandwidth is small, the peak signal-to-noise ratio PSNR1 corresponding to the different blocks in the frame of the video encoded by adopting high resolution is lower than the peak signal-to-noise ratio PSNR2 corresponding to the different blocks in the frame of the video encoded by adopting low resolution, that is, the peak signal-to-noise ratio PSNR1 corresponding to the different blocks in the frame of the video encoded by adopting high resolution is relatively small when the transmission bandwidth is small, and the distortion is relatively large.
Similarly, if the different blocks in one frame of the video are encoded with low resolution, the peak signal-to-noise ratio PSNR3 corresponding to the low resolution encoding of the different blocks in one frame of the video is lower than the peak signal-to-noise ratio PSNR4 corresponding to the high resolution encoding of 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 corresponding to the low resolution encoding of the different blocks in one frame of the video is relatively small and the distortion is relatively large when the transmission bandwidth is relatively large.
Under the condition of limited moving bandwidth, the existing method for encoding different blocks in a frame of a video by using the same resolution ratio may have the problem that certain scenes are relatively large in distortion, so that the video quality is poor.
In view of the above problems, no effective solution has been proposed.
Disclosure of Invention
embodiments of the present invention provide a video encoding method and apparatus, a video decoding method and apparatus, a storage medium, and an electronic apparatus, so as to at least solve the technical problem of poor video quality caused by relatively large coding distortion when different blocks in a frame of a video are coded with the same resolution in the existing video encoding process.
According to an aspect of the embodiments of the present invention, there is also provided a video encoding method, including:
Obtaining a residual Average value (MAD) of a reference block of a block to be coded in a video frame to be coded;
Determining a target resolution ratio for coding the block to be coded according to the residual mean MAD;
and coding the block to be coded according to the target resolution.
according to another aspect of the embodiments of the present invention, there is also provided a video decoding method, including:
acquiring a target zone bit corresponding to a target block to be decoded from a video frame to be decoded, wherein the target zone bit is used for representing a target resolution adopted by the target block to be decoded during encoding, and the target resolution is determined according to a residual mean value MAD of a reference block adopted by the target block during encoding;
Acquiring the target resolution represented by the target zone bit;
and decoding the target block to be decoded by adopting the target resolution.
according to another aspect of the embodiments of the present invention, there is also provided a video decoding apparatus, including:
A first obtaining module, configured to obtain a target flag bit corresponding to a target block to be decoded from a video frame to be decoded, where the target flag bit is used to indicate a target resolution adopted by the target block to be decoded when encoding, and the target resolution is determined according to a residual mean MAD of a reference block adopted by the target block when encoding;
The second acquisition module is used for acquiring the target resolution represented by the target zone bit;
and the decoding module is used for decoding the target block to be decoded by adopting the target resolution.
According to another aspect of the embodiments of the present invention, there is also provided a video encoding apparatus, including:
The third acquisition module is used for acquiring a residual mean value MAD of a reference block of a block to be coded in a video frame to be coded;
A determining module, configured to determine, according to the residual mean MAD, a target resolution for encoding the block to be encoded;
And the coding module is used for coding the block to be coded according to the target resolution.
according to yet another aspect of the embodiments of the present invention, there is also provided a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned video encoding method or the above-mentioned video decoding method when running.
according to 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 in 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 through the residual error mean value of the decoded block referred by the block to be coded, the block to be coded is coded according to the target resolution, and different resolutions are adopted for coding different blocks, so that the coding distortion is relatively small, the video quality is improved, and the technical problem of poor video quality caused by relatively large coding distortion of different blocks in one frame of a 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 embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
FIG. 1 is a diagram illustrating an exemplary embodiment of a video encoding method and a video decoding method;
FIG. 2 is a diagram illustrating an internal structure of the terminal of FIG. 1 according to one embodiment;
FIG. 3 is a diagram illustrating the internal structure 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 first schematic diagram of video encoding according to an embodiment of the present invention;
FIG. 6 is a second diagram 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 first schematic structural diagram of an alternative electronic device according to an embodiment of the invention;
fig. 12 is a schematic structural diagram of an alternative electronic device according to an embodiment of the invention.
Detailed Description
in order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
it should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
fig. 1 is a diagram illustrating an application environment in which a video encoding method and a video decoding method are executed according to an 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 via 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, and the terminal 110 may perform adaptive resolution encoding on a video frame to be encoded by using the video encoding method and then transmit the encoded video frame to the server 120, or may receive encoded data of the adaptive resolution from the server 120 and perform decoding by using the video decoding method to generate a decoded video frame. The server 120 may transcode the bitstream when it is stored, where the video encoding method is performed at the server, and if the server 120 needs to decode the bitstream, where the video decoding method is performed 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, which are connected through a system bus. The storage medium of the terminal 110 stores an operating system, and further includes a video encoding apparatus and/or a video decoding apparatus, which are used to implement a video encoding method and/or a video decoding method suitable for the terminal. The processor is used to provide computational and control capabilities that support the operation of the entire terminal 110. The graphic processing unit in the terminal 110 is configured to provide at least a rendering capability of a display interface, the memory provides an environment for the operation of the video encoding device and/or the video decoding device in the storage medium, and the network interface is configured to perform network communication with the server 120. The display screen is used for displaying an application interface and the like, such as decoding video, and the input device is used for receiving commands or data input by a user. For a terminal 110 with a touch screen, the display screen and input device may be a touch screen. The structure shown in fig. 2 is a block diagram of only a part of the structure related to the present application, and does not constitute a limitation of the terminal to which the present application is applied, and a specific terminal or server may include more or less components than those shown in the figure, or combine some components, or have a different arrangement of components.
In one embodiment, the internal structure of the server 120 in fig. 1 is shown in fig. 3, and the server 120 includes a processor, a storage medium, a memory, and a 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, wherein the database is used for storing data, and the video encoding device and/or the video decoding device are used for implementing a video encoding method and/or a video decoding method suitable for the server 120. The processor of the server 120 is used 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 configurations shown in fig. 2 and 3 are block diagrams of only a portion of the configurations associated with the present application and do not constitute a limitation on the terminal to which the present application is applied, and a particular terminal or server may include more or fewer components than shown, or combine certain components, or have a different arrangement of components.
an embodiment of the present invention provides a video encoding method, which is exemplified 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 the embodiment of the present invention, as shown in fig. 4, including the following steps:
Step S402, obtaining a residual mean value MAD of a reference block of a block to be coded in a video frame to be coded;
Wherein, the reference block is an encoded block referred to by the block to be encoded in the video frame to be encoded;
Specifically, the video frame to be encoded may be a video frame collected in real time for instant messaging, or may be a video frame corresponding to a stored video.
The MAD in the embodiment of the present invention refers to a mean value (or mean square error) of absolute values of differences between the encoded reconstructed pixel value and the original pixel value. For a reference block, acquiring a reconstructed pixel value after each pixel in the reference block is coded and an original pixel value of each pixel, determining the MAD of each pixel according to the absolute value of the difference value between the reconstructed pixel value and the original pixel value, and obtaining the MAD of the reference block by averaging or averaging the MADs of all the pixels of the reference block.
The reference block in the embodiment of the present invention may be an encoded block adjacent to the block to be encoded, or may be an encoded block that is not adjacent to the block to be encoded, the interval between the block to be encoded and the reference block is not greater than n pixels, the reference block is located in front of the encoding time sequence of the current block to be encoded, or located in front of the decoding time sequence of the current block to be decoded, that is, the encoded block or the decoded block in the preamble.
step S404, determining a target resolution ratio for coding the block to be coded according to the residual mean MAD;
After determining the residual mean MAD, the target resolution may be determined according to the MAD, specifically, for example, the MAD is compared with a first preset threshold, and whether to use the high resolution or the low resolution may be determined according to a comparison result. If the first preset threshold is set to be 6, if the comparison result is that the MAD is smaller than 6, the target resolution is high resolution, namely, the full resolution preset by the system is adopted, for example, the full resolution is 1024 × 1024, and the target resolution is 1024 × 1024; if the comparison result is that the MAD is greater than or equal to 6, the target resolution is low resolution, and the second resolution may be 2/3, 1/2, 1/3, 1/4, etc. of the width and height of the full resolution.
Step S406, encoding the block to be encoded according to the target resolution.
Through the steps S402 to S406, the encoding side determines the target resolution of the current block to be encoded according to the residual error mean value of the decoded block referred to by the block to be encoded, and encodes the block to be encoded according to the target resolution, thereby solving the technical problem of poor video quality caused by relatively large encoding distortion of different blocks in one frame of a video by using the same resolution in the existing video encoding process.
in this embodiment of the present invention, the reference block may be one encoded block or may be multiple encoded blocks, and step S404 may specifically include:
S4041, determining the target resolution according to the residual mean MAD of a coded block when the reference block is a coded block; 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 block, the MAD of the t-k block is calculated, and the target resolution can be determined according to the MAD of the t-k block.
s4042, when the reference block includes a plurality of encoded blocks, determining the target resolution according to the weighted sum of the residual mean MADs of the encoded blocks, specifically, calculating the MAD of each encoded block in the reference block, and determining the weighted sum of the MADs of all encoded blocks in the reference block, so as to determine the target resolution.
in an embodiment of the present invention, step S4041 may specifically include:
Determining the target resolution as a first resolution under the condition that the residual mean value MAD of the coded block is smaller than a first preset threshold;
In the case that the residual mean MAD 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, where the first preset threshold may be preset according to specific situations, for example, the first preset threshold may be set to any number of 5-7, and for example, the first preset threshold may be set to 6.
in the embodiment of the present invention, the first resolution is greater than the second resolution, and the first resolution may be a preset full resolution.
Further, the second resolution may be divided into a plurality of levels of resolution, for example, the second resolution includes: a third resolution, a fourth resolution, a fifth resolution, a sixth resolution, and the like, for example, the third resolution is 3/4 of the width of the first resolution, the fourth resolution is 2/3 of the width of the first resolution, the fifth resolution is 1/2 of the width of the first resolution, and the sixth resolution is 1/3 of the width of the first resolution, and correspondingly, in the case that the residual mean MAD of the one encoded block is greater than or equal to the first preset threshold, determining that the target resolution is the second resolution includes:
Determining the target resolution as a third resolution when the residual mean MAD of the one coded block is greater than or equal to the first preset threshold and smaller than a second preset threshold; the second preset threshold may be preset, for example, the second preset threshold may be set to 9, and when the MAD of one encoded block is greater than or equal to 6 and less than 9, 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 when the residual mean MAD of the one coded 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 MAD of one encoded block is greater than or equal to 9 and less than 12, 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 under the condition that the residual mean value MAD of the coded block is greater than or equal to the third preset threshold and smaller than a fourth preset threshold; the fourth preset threshold may be preset, for example, the second preset threshold may be set to 15, and when the MAD of one encoded block is greater than or equal to 12 and less than 15, the target resolution may be determined to be 1/2 of the width and height of the first resolution.
And determining the target resolution to be a sixth resolution in the case that the residual mean MAD of the one encoded block is greater than or equal to the fourth preset threshold, and determining the target resolution to be 1/3 of the width and height of the first resolution in the case that the MAD of the one encoded block is greater than or equal to 15.
in an embodiment of the present invention, the first preset threshold, the second preset threshold, and the third preset threshold, and the fourth preset threshold are positively correlated with a maximum resolution in a preset 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 second resolution, the third resolution, the fourth resolution, the fifth resolution, and the sixth resolution.
for a current block to be coded in a video, if the mean residual value MAD of a coded block is less than a first preset threshold value, the interframe motion of the current block is complex, and the current block is coded by adopting high resolution, namely, the first resolution. If the second preset threshold > the residual mean MAD > of one coded block is equal to the first preset threshold, it indicates that the intra texture of the current coded block is complex, and the current coded block is coded by using high-resolution width-height 3/4 samples, that is, the third resolution may be 3/4 of the width of the first resolution; if the third preset threshold > one residual mean value MAD of the coded block > is equal to the second preset threshold, it indicates that the intra texture of the current coded block is complex, and the current coded block is coded by using high-resolution 2/3 samples of width and height, that is, the fourth resolution may be 2/3 of the width and height of the first resolution; if the fourth preset threshold > the residual mean MAD > of one coded block is equal to the third preset threshold, it indicates that the intra texture of the current coded block is complex, and the current coded block is coded by using high-resolution width-height 1/2 samples, that is, the fifth resolution may be 1/2 of the first resolution; if the residual mean MAD > of one coded block is equal to the fourth preset threshold, it indicates that the intra texture of the current coded block is complex, and the current coded block is coded by using high-resolution 1/3 samples of width and height, that is, the sixth resolution may be 1/3 of the width and height of the first resolution, and so on.
in the embodiment of the present invention, the flag bit directly carries the target Resolution, 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, the flag bit may be an Adaptive Resolution flag bit, and the name may be Adaptive Resolution.
In the embodiment of the present invention, when the reference block is an encoded block, the block to be encoded is a t-th block in the video frame to be encoded, and the reference block is a t-k-th block in the video frame to be encoded, where t is greater than k, t and k are both natural numbers, and k are the same or not completely the same for different t. The number of bits of the flag bit is determined according to the size of k, if k is 3, 2 bits are needed to represent 3, and k is 6, 3 bits are needed to represent, in addition, 1 bit is needed to indicate whether it is one coded block, 0 represents 1 coded block, and 1 represents a plurality of coded blocks.
in the embodiment of the present invention, when t and k corresponding to different differences are not completely the same, in the process of encoding the block to be encoded according to the target resolution, a t-th flag bit is set for the t-th block, where the t-th flag bit is used to indicate k corresponding to t, and the t-th flag bit is set in encoded data obtained by encoding the block to be encoded, or data obtained by encoding the t-th flag bit is set in encoded data obtained by encoding the block to be encoded.
In an embodiment of the present invention, step S4042 may specifically include:
Determining the target resolution as a first resolution under the condition that the weighted sum of the residual mean MADs of the plurality of encoded blocks is less than a fifth preset threshold;
And determining the target resolution as the second resolution when the weighted sum of the residual mean MADs of the plurality of encoded blocks is greater than or equal to a fifth preset threshold, where 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, and for example, the first preset threshold may be set to 7.
Further, the second resolution may be divided into a plurality of levels of resolution, for example, the second resolution includes: a third resolution, a fourth resolution, a fifth resolution, a sixth resolution, and the like, for example, the third resolution is 3/4 of the width of the first resolution, the fourth resolution is 2/3 of the width of the first resolution, the fifth resolution is 1/2 of the width of the first resolution, and the sixth resolution is 1/3 of the width of the first resolution, and correspondingly, in the case that the weighted sum of the residual mean MADs of the plurality of encoded blocks is greater than or equal to the fifth preset threshold, determining that the target resolution is the second resolution includes:
Determining the target resolution as a third resolution when the weighted sum of the residual mean MADs of the plurality of encoded blocks is greater than or equal to the fifth preset threshold and less than a sixth preset threshold; wherein, the sixth preset threshold may be set in advance, for example, the sixth preset threshold may be set to 10, and when the weighted sum of MADs of the plurality of encoded blocks is greater than or equal to 7 and less than 10, 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 when the weighted sum of the residual mean MADs of the plurality of encoded blocks is greater than or equal to the sixth preset threshold and less than a seventh preset threshold; wherein, 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 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 when the weighted sum of the residual mean MADs of the plurality of encoded blocks is greater than or equal to the seventh preset threshold and less than an eighth preset threshold; wherein, the eighth preset threshold may be set in advance, for example, the eighth preset threshold may be set to 16, and when the weighted sum of MADs of the plurality of encoded blocks is greater than or equal to 13 and less than 16, the target resolution may be determined to be 1/2 of the width and height of the first resolution.
And determining the target resolution to be a sixth resolution in the case that the weighted sum of the residual mean MADs of the plurality of encoded blocks is greater than or equal to the eighth preset threshold, wherein when the weighted sum of the MADs 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 sixth resolution in width, and the first resolution > the third resolution > the fourth resolution > the fifth resolution > the sixth resolution.
for a current block to be coded in a video, if the weighted sum of residual mean MADs of a plurality of coded blocks is less than a fifth preset threshold, it indicates that inter-frame motion of the current block is complex, and the current block is coded with high resolution, that is, with the first resolution. If the sixth preset threshold > is the weighted sum of the residual mean MADs of the multiple coded blocks > is the fifth preset threshold, it indicates that the intra texture of the current coded block is complex, and the current coded block is coded by using high-resolution width-height 3/4 samples, that is, the third resolution may be 3/4 of the width of the first resolution; if the seventh preset threshold > is the weighted sum of the residual mean MADs of the multiple coded blocks > is the sixth preset threshold, it indicates that the intra texture of the current coded block is complex, and the current coded block is coded by using high-resolution 2/3 samples of width and height, that is, the fourth resolution may be 2/3 of the width and height of the first resolution; if the eighth preset threshold > is the weighted sum of the residual mean MADs of the multiple coded blocks > is the seventh preset threshold, it indicates that the intra texture of the current coded block is complex, and the current coded block is coded by using high-resolution width-height 1/2 samples, that is, the fifth resolution may be 1/2 of the width of the first resolution; if the weighted sum of the residual mean MADs of multiple coded blocks > is equal to the eighth preset threshold, it indicates that the intra texture of the current coded block is complex, and the current coded block is coded by using high-resolution 1/3 samples of width and height, that is, the sixth resolution may be 1/3 of the width and height of the first resolution, and so on.
In an embodiment of the present invention, the fifth preset threshold, the sixth preset threshold, and the seventh preset threshold are described above, and the eighth preset threshold is positively correlated with a maximum resolution in a preset 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 second resolution, the third resolution, the fourth resolution, the fifth resolution, and the sixth resolution.
in the embodiment of the present invention, in a case where the reference block includes a plurality of encoded blocks, the plurality of encoded blocks are consecutive encoded blocks, or discontinuous encoded blocks.
in this embodiment of the present invention, in a case that the reference block includes a plurality of coded blocks, the block to be coded is a t-th block in the video frame to be coded, wherein, in the process of coding the block to be coded according to the target resolution, a t-th flag bit is set for the t-th block, where the t-th flag bit is used to indicate the number of the plurality of coded blocks corresponding to t and/or the positions of the plurality of coded blocks in the video frame to be coded, and t is a natural number. If the coded block is 4 consecutive coded blocks, the t-th flag bit can be 4 bits, wherein 1 bit indicates whether the coded block is a plurality of coded blocks, 1 indicates a plurality of coded blocks, and 0 indicates a coded block; 1 bit indicates whether the coded blocks are continuous or not, 1 indicates that the coded blocks are continuous, and 0 indicates that the coded blocks are discontinuous; 2 bits indicate the number of coded blocks, 00 indicates 2 coded blocks, 01 indicates 3 coded blocks, 10 indicates 4 coded blocks, and 11 indicates 5 coded blocks; if k is 4 and is consecutive, the flag bit may be 1110. If there are multiple encoded blocks that are not contiguous, more bits are needed to represent them.
in the embodiment of the present invention, the target Resolution may be directly carried by a 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, 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 target resolution for decision may also be indicated by, but not limited to, the following flag bits (hereinafter, syntax elements):
a) obtaining a syntax element corresponding to each of the plurality of regions, wherein the syntax element is used for indicating a resolution adopted for decoding each region, and a plurality of resolutions adopted for decoding the plurality of regions include at least two different resolutions;
b) Acquiring a first syntax element corresponding to each of the plurality of regions, wherein the first syntax element is used for indicating a relationship between a first resolution and a second resolution, the first resolution is a resolution used for encoding each region, the second resolution is a resolution used for encoding a reference region corresponding to each region in a reference video frame of the video frame to be decoded, and the plurality of resolutions used for encoding the plurality of regions include at least two different resolutions; and determining a first resolution corresponding to each region according to the first syntax element and the second resolution.
Therefore, under the condition that the transmission bandwidth is small or the transmission bandwidth is large, the corresponding peak signal-to-noise ratio is relatively large, and the distortion is relatively small, so that the peak signal-to-noise ratio can be changed in a small range, and the peak signal-to-noise ratio is relatively large, and the technical effect of avoiding large fluctuation of the peak signal-to-noise ratio for encoding and decoding videos is realized.
In the video encoding process of the embodiment of the present invention, different blocks in a frame in a video are adaptively encoded by using corresponding resolutions, and the information (MAD) of the encoded block in the neighborhood is used to decide whether the resolution used by the current block is high resolution or low resolution, so that the decoding resolution of the current block cannot be determined at the decoding end according to the same decision rule, and a flag bit is required to be identified and encoded, transmitted and decoded. Different resolution ratios are adopted for coding in a frame in a video in a self-adaptive mode, the resolution ratio used by each coding block is determined through the MAD value of the adjacent coded block, and therefore the decoding end can know the resolution ratio used by different blocks in the video frame during coding and decoding is completed quickly.
the decision process of the coding resolution used by the coding block according to the embodiment of the present invention will be specifically described below.
For a current coding block t to be coded in a video, referring to the relation between MAD values of 1 or more coding blocks (continuous or discontinuous) which are adjacent to the current coding block t and have finished coding and a threshold value, and selecting a corresponding resolution for the t-th coding block to code.
In the first mode, when the t-th coding block in the video is coded, the MAD value of the t-k coding block which is coded is obtained. If the MAD value is larger than a preset threshold value 1 (corresponding to the first preset threshold value), the coding loss is large, and therefore the t-th coding block is selected to be coded at low resolution; if the MAD value is less than the predetermined threshold value 1, it indicates that the coding loss is small, and therefore, the high resolution is selected for the t-th coding block to be coded.
in the second mode, when the t-th encoding block in the video is encoded, the sum of MADs of a plurality of encoding blocks that have already been encoded is obtained. If the sum of the MADs is greater than the predetermined threshold 2 (corresponding to the fifth preset threshold), it indicates that the coding loss is large, so that the t-th coding block is selected to be coded at a low resolution; if the sum of the MADs is less than the predetermined threshold 2, it means that the coding loss is small, and thus the t-th coding block is selected to be coded with a high resolution.
The predetermined threshold may be determined based on the type of encoded block, the resolution, and other factors.
Fig. 5 is a schematic diagram of video encoding according to an embodiment of the present invention, as shown in fig. 5, in the video encoding process according to an embodiment of the present invention, for different blocks in a frame of a video, the coding resolution adopted by the different blocks is self-analyzed by using information of a current coding block, so that the purpose that the corresponding peak signal-to-noise ratio is relatively large and distortion is relatively small in both the case that the bandwidth of transmission is relatively small (e.g., smaller than the bandwidth threshold Th shown in fig. 5) and the case that the bandwidth of transmission is relatively large (e.g., larger than the bandwidth threshold Th shown in fig. 5) can be achieved.
In addition, because the coding resolution adopted by the decision is adaptive to different blocks in one frame of the video, the corresponding resolution does not need to be selected according to the intersections (fig. 6 is a schematic diagram two of video coding according to an embodiment of the present invention, as shown by the intersections in fig. 6) corresponding to different types of videos or different frames of the same video or different blocks in the same frame when the frames in the video are coded, and the coding complexity is reduced.
in the video coding process of the embodiment of the invention, the coding resolution adopted by the gradient information self-adaptive decision of the adjacent coded blocks is utilized for different blocks in one frame in the video, so that the peak signal-to-noise ratio is relatively high in the whole bandwidth, and the distortion is small. In addition, when different blocks in one frame of the video are coded, the corresponding resolution does not need to be selected according to the intersections corresponding to different types of videos or different frames of the same video or different blocks in the same frame, and the coding complexity is reduced.
An embodiment of the present invention provides a video decoding method, which is exemplified 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, including the following steps:
step S702, acquiring a target zone bit corresponding to a target block to be decoded from a video frame to be decoded, wherein the target zone bit is used for indicating a target resolution adopted by the target block to be decoded when the target block is encoded, and the target resolution is determined according to a residual mean value MAD of a reference block adopted by the target block when the target block is encoded;
Specifically, a flag bit corresponding to a preset position in a video frame to be decoded is obtained, a target resolution used by a coding block corresponding to a target block to be decoded currently in a coding process is obtained through the flag bit, and whether a current decoding mode is a full resolution mode or a down-sampling mode can be judged according to the target resolution, wherein the current decoding mode is the same as the current coding mode.
the target flag bit carries a target resolution, 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, the flag bit may be an adaptive resolution flag bit, and the name may be adaptiverresolution.
Step S704, obtaining the target resolution indicated by the target flag bit;
For example, if the decoding side determines that the target flag bit is 001, the decoding side determines that the resolution used for encoding the target block is the second resolution.
Step S706, decoding the target block to be decoded by using the target resolution.
specifically, after the second resolution is determined, decoding is performed at the second resolution.
Through the steps S702 to S706, the decoding side obtains the target resolution through the flag bit, and decodes the block to be decoded according to the target resolution, thereby solving the technical problem that in the existing video encoding process, different blocks in one frame of a video are encoded by using the same resolution, and the decoding process is performed by using the same resolution, so that the distortion in the video transmission process is relatively large, and the video quality is poor.
in the embodiment of the invention, at least one pair of blocks to be decoded to be reconstructed is determined from a current video frame, wherein each pair of blocks to be decoded in the at least one block to be decoded comprises a first block to be decoded with a first resolution and a second block to be decoded with a second resolution, and the first block to be decoded and the second block to be decoded are adjacent blocks to be decoded;
Adjusting the first resolution of the first block to be decoded to a target resolution, and adjusting the second resolution of the second block to be decoded to the target resolution;
determining a first edge pixel point set from the first block to be decoded and determining a second edge pixel point set from the 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;
And 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.
and a first difference value between the pixel value of the ith pixel point in the first edge pixel point set after filtering and the pixel value of the jth pixel point corresponding to the ith pixel point in the second edge pixel point set after filtering is smaller than a 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 less than or equal to the total number of the pixel points in the first edge pixel point set, and j is a positive integer and is less 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 a case where the target resolution is equal to the first resolution;
2) Adjusting the first resolution to the second resolution in a 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.
by adjusting the resolution of the block to be decoded and performing edge filtering on the edge pixel point set determined in the block to be decoded, obvious seams can be avoided in the video in the reconstruction process, so that the content in the video can be accurately restored, and the technical problem of video distortion caused by inconsistent resolution is solved.
In an embodiment of the present invention, the step S704 may specifically include: the target resolution represented by the target flag is obtained from a predetermined resolution set. For example, if the decoding side determines that the target flag is 001 by acquiring the target flag, the decoding side may acquire the second resolution from the resolution set by determining that the resolution used for encoding the target block is the second resolution.
In this embodiment of the present invention, the target resolution is a resolution determined according to a residual mean MAD of a reference block of a block to be coded corresponding to the target block to be decoded, where the reference block is a coded block referred to by the block to be coded in the video frame to be coded.
In an embodiment of the present invention, the step S704 specifically includes: and when the encoding end informs the decoding end of the target resolution used for encoding through the flag bit, the decoding end can acquire the target resolution from resolution combination according to the indication of the flag bit.
in this embodiment of the present invention, the step S706 specifically includes: and decoding the target block to be decoded into a block with the target 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 target flag bit corresponding to a target block to be decoded from a video frame to be decoded, where the target flag bit is used to indicate a target resolution adopted by the target block to be decoded when encoding, and the target resolution is determined according to a residual mean MAD of a reference block adopted by the target block when encoding;
A second obtaining module 84, configured to obtain the target resolution indicated by the target flag;
and a decoding module 86, configured to decode the target block to be decoded by using the target resolution.
Optionally, the target flag bit is an adaptive resolution flag bit.
optionally, the second obtaining module 84 is further configured to
The target resolution represented by the target flag is obtained from a predetermined resolution set.
optionally, the target resolution is a resolution determined according to a residual mean MAD of a reference block of a block to be coded corresponding to the target block to be decoded, where the reference block is a coded block referred to by the block to be coded in the video frame to be coded.
Optionally, the decoding module 86 is further configured to
and decoding the target block to be decoded into a block with the target resolution.
An embodiment of the present invention further provides a video encoding apparatus, and fig. 9 is a block diagram of a video encoding apparatus according to an embodiment of the present invention, as shown in fig. 9, including:
a third obtaining module 92, configured to obtain a residual mean MAD of a reference block of a block to be coded in a video frame to be coded;
a determining module 94, configured to determine, according to the residual mean MAD, a target resolution for encoding the block to be encoded;
and an encoding module 96, configured to encode the block to be encoded according to the target resolution.
optionally, the third obtaining module 92 is further configured to
acquiring a reconstructed pixel value of each pixel after each pixel in the reference block is coded and an original pixel value of each pixel;
determining a residual mean value MAD of each pixel according to an absolute value of a difference value of the reconstructed pixel value and the original pixel value;
determining a mean or a mean square error of the residual mean MAD of all the pixels of the reference block as the residual mean MAD of the reference block.
Optionally, the apparatus further comprises:
And the carrying module is used for carrying the target resolution through a target zone bit in the process of coding the block to be coded according to the target resolution.
Optionally, the target flag bit is an adaptive resolution flag bit adaptive resolution.
In another alternative embodiment, fig. 10 is a block diagram of a video encoding apparatus according to a preferred embodiment of the present invention, and as shown in fig. 10, the determining module 94 includes:
A first determining sub-module 102, configured to determine the target resolution according to a residual mean MAD of a coded block if the reference block is the coded block;
a second determining submodule 104, configured to determine the target resolution according to a weighted sum of residual means MAD of a plurality of coded blocks, if the reference block includes the plurality of coded blocks.
Optionally, the first determining word module 102 includes:
a first determining unit, configured to determine the target resolution as a first resolution when a residual mean MAD of the one encoded block is smaller than a first preset threshold;
A second determining unit, configured to determine the target resolution as a second resolution if the mean residual MAD 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 second determination unit is further used for
Determining the target resolution as a third resolution when the residual mean MAD of the one coded block is greater than or equal to the first preset threshold and smaller than a second preset threshold;
Determining the target resolution as a fourth resolution when the residual mean MAD of the one coded 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 under the condition that the residual mean value MAD of the coded block is greater than or equal to the third preset threshold and smaller than a fourth preset threshold;
Determining the target resolution to be a sixth resolution in a case that the mean residual value MAD of the one encoded 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.
Optionally, the first preset threshold, the second preset threshold, the third preset threshold, and the fourth preset threshold are positively correlated with a maximum resolution in a predetermined resolution set, where the resolution set includes the first resolution, the second resolution, the third resolution, the fourth resolution, the fifth resolution, and the sixth resolution.
Optionally, the second determining submodule 104 includes:
a third determining unit, configured to determine the target resolution as the first resolution when a weighted sum of residual mean MADs of the plurality of encoded blocks is smaller than a fifth preset threshold;
A fourth determining unit, configured to determine the target resolution as a second resolution if a weighted sum of residual mean MADs 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.
optionally, the fourth determination unit is further configured to
Determining the target resolution as a third resolution when the weighted sum of the residual mean MADs of the plurality of encoded 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 when the weighted sum of the residual mean MADs 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 when the weighted sum of the residual mean MADs 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 to be a sixth resolution in the case that the weighted sum of the residual mean MADs 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, the seventh preset threshold, and the eighth preset threshold are positively correlated with a maximum resolution in a predetermined resolution set, where the resolution set includes the first resolution, the second resolution, the third resolution, the fourth resolution, the fifth resolution, and the sixth resolution.
Optionally, in a case that the reference block includes a plurality of encoded blocks, the plurality of encoded blocks are consecutive encoded blocks, or discontinuous encoded blocks.
an electronic device for implementing the video decoding method is further provided in an embodiment of the present invention, and as shown in fig. 11, the electronic device includes a memory 1102 and a processor 1104, where the memory 1102 stores therein a computer program, and the processor 1104 is configured to execute the steps in any one of the method embodiments through the computer program.
Optionally, in this embodiment, the electronic apparatus may be located in at least one network device of a plurality of network devices of a computer network.
Optionally, in this embodiment, the processor may be configured to execute the following steps by a computer program:
s11, acquiring a target flag corresponding to a target block to be decoded from a video frame to be decoded, where the target flag is used to indicate a target resolution adopted by the target block to be decoded when encoding, and the target resolution is determined according to a residual mean MAD of a reference block adopted by the target block when encoding;
S12, acquiring the target resolution represented by the target flag bit;
And S13, decoding the target block to be decoded by adopting the target resolution.
Alternatively, it can be understood by those skilled in the art that the structure shown in fig. 11 is only an illustration, and the electronic device may also be a terminal device such as a smart phone (e.g., an android Mobile phone, an iOS Mobile phone, etc.), a tablet computer, a palm computer, a Mobile Internet device (M id), a PAD, and the like. Fig. 11 is a diagram illustrating a 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 acquiring a media resource in the embodiments of the present invention, and the processor 1104 executes various functional applications and data processing by running the software programs and modules stored in the memory 1102, that is, implements the above-mentioned method for acquiring a media resource. The 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, the memory 1102 can further include memory located remotely from the processor 1104 and such remote memory can be coupled 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 be specifically, but not limited to, used for 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 second obtaining module 84, and the decoding module 86 of the video decoding apparatus. In addition, the video decoding apparatus may further include, but is not limited to, other module units in the first video decoding apparatus, which is not described in this example again.
Optionally, the transmitting device 1106 is used for receiving or transmitting data via a network. Examples of the network may include a wired network and a wireless network. In one example, the transmission device 1106 includes a Network adapter (NIC) that can be connected to a router 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, which is used for communicating with the internet in a wireless manner.
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 yet another aspect of the embodiments of the present invention, there is also provided an electronic device for implementing the video coding method, as shown in fig. 10, the electronic device includes a memory 1102 and a processor 1104, the memory 1102 stores therein a computer program, and the processor 1104 is configured to execute the steps in any one of the method embodiments through the computer program.
Optionally, in this embodiment, the electronic apparatus may be located in at least one network device of a plurality of network devices of a computer network.
Optionally, in this embodiment, the processor may be configured to execute the following steps by a computer program:
s21, obtaining a residual mean MAD of a reference block of a block to be coded in a video frame to be coded;
s22, determining the target resolution for coding the block to be coded according to the residual mean MAD;
And S23, encoding the block to be encoded according to the target resolution.
alternatively, it can be understood by those skilled in the art that the structure shown in fig. 12 is only an illustration, and the electronic device may also be a terminal device such as a smart phone (e.g., an android Mobile phone, an iOS Mobile phone, etc.), a tablet computer, a palm computer, a Mobile Internet device (M id), a PAD, etc. Fig. 12 is a diagram illustrating a 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 acquiring a media resource in the embodiments of the present invention, and the processor 1104 executes various functional applications and data processing by running the software programs and modules stored in the memory 1102, that is, implements the above-mentioned method for acquiring a media resource. The 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, the memory 1102 can further include memory located remotely from the processor 1104 and such remote memory can be coupled 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 be specifically, but not limited to, used for 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 third obtaining module 92, the determining module 94, and the encoding module 96 of the video encoding apparatus. In addition, the video encoding apparatus may further include, but is not limited to, other module units in the first video encoding apparatus, which is not described in this example again.
optionally, the transmitting device 1106 is used for receiving or transmitting data via a network. Examples of the network may include a wired network and a wireless network. In one example, the transmission device 1106 includes a Network adapter (NIC) that can be connected to a router 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, which is used for communicating with the internet in a wireless manner.
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 an embodiment of the present invention, there is also provided a computer-readable storage medium, in which a computer program is stored, wherein the computer program is arranged to perform the steps in any of the above-mentioned method embodiments when executed.
Alternatively, in the present embodiment, the storage medium may be configured to store a computer program for executing the steps of:
s11, acquiring a target flag corresponding to a target block to be decoded from a video frame to be decoded, where the target flag is used to indicate a target resolution adopted by the target block to be decoded when encoding, and the target resolution is determined according to a residual mean MAD of a reference block adopted by the target block when encoding;
s12, acquiring the target resolution represented by the target flag bit;
And S13, decoding the target block to be decoded by adopting the target resolution.
alternatively, in this embodiment, a person skilled in the art may understand that all or part of the steps in the methods of the foregoing embodiments may be implemented by a program instructing hardware associated with the terminal device, where the program may be stored in a computer-readable storage medium, and the storage medium may include: flash disks, Read-Only memories (ROMs), Random Access Memories (RAMs), magnetic or optical disks, and the like.
according to a further aspect of an embodiment of the present invention, there is also provided a computer-readable storage medium, in which a computer program is stored, wherein the computer program is arranged to perform the steps in any of the above-mentioned method embodiments when executed.
Alternatively, in the present embodiment, the storage medium may be configured to store a computer program for executing the steps of:
s21, obtaining a residual mean MAD of a reference block of a block to be coded in a video frame to be coded;
S22, determining the target resolution for coding the block to be coded according to the residual mean MAD;
And S23, encoding the block to be encoded according to the target resolution.
alternatively, in this embodiment, a person skilled in the art may understand that all or part of the steps in the methods of the foregoing embodiments may be implemented by a program instructing hardware associated with the terminal device, where the program may be stored in a computer-readable storage medium, and the storage medium may include: flash disks, Read-Only memories (ROMs), Random Access Memories (RAMs), magnetic or optical disks, and the like.
the above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
The integrated unit in the above embodiments, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in the above computer-readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing one or more computer devices (which may be personal computers, servers, network devices, etc.) to execute all or part of the steps of the method according to the embodiments of the present invention.
In the above embodiments of the present invention, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
in the several embodiments provided in the present application, it should be understood that the disclosed client may be implemented in other manners. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one type of division of logical functions, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
in addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (15)

1. a video decoding method, comprising:
acquiring a target zone bit corresponding to a target block to be decoded from a video frame to be decoded, wherein the target zone bit is used for representing a target resolution adopted by the target block to be decoded when the target block is coded, and the target resolution is determined according to a residual mean value MAD of a reference block adopted by the target block when the target block is coded;
Acquiring the target resolution represented by the target zone bit;
and decoding the target block to be decoded by adopting the target resolution.
2. the method of claim 1, wherein the target flag is an adaptive resolution flag.
3. A video encoding method, comprising:
Acquiring a residual mean value MAD of a reference block of a block to be coded in a video frame to be coded;
Determining a target resolution ratio for coding the block to be coded according to the residual mean MAD;
And coding the block to be coded according to the target resolution.
4. The method of claim 3, wherein in the process of encoding the block to be encoded according to the target resolution, the method further comprises:
and carrying the target resolution through a self-adaptive resolution flag bit.
5. the method of claim 3, wherein obtaining a mean residual value MAD of a reference block of a block to be coded in a video frame to be coded comprises:
acquiring a reconstructed pixel value of each pixel after each pixel in the reference block is coded and an original pixel value of each pixel;
Determining a residual mean value MAD of each pixel according to an absolute value of a difference value of the reconstructed pixel value and the original pixel value;
determining a mean or a mean square error of the residual mean MAD of all the pixels of the reference block as the residual mean MAD of the reference block.
6. The method of claim 3, wherein determining the target resolution for encoding the block to be encoded according to the residual mean MAD comprises:
determining the target resolution according to a residual mean MAD of the coded block under the condition that the reference block is the coded block;
determining the target resolution according to a weighted sum of residual means MAD of a plurality of encoded blocks in case the reference block comprises the plurality of encoded blocks.
7. the method of claim 6, wherein determining the target resolution according to the residual mean MAD of the one encoded block comprises:
Determining the target resolution as a first resolution under the condition that the residual mean value MAD of the one coded block is smaller than a first preset threshold;
Determining the target resolution as a second resolution in the case that the mean residual value MAD 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.
8. The method of claim 7, wherein the determining the target resolution as the second resolution in the case that the mean residual MAD of the one encoded block is greater than or equal to the first preset threshold comprises:
Determining the target resolution as a third resolution when the residual mean MAD of the one coded block is greater than or equal to the first preset threshold and smaller than a second preset threshold;
determining the target resolution as a fourth resolution when the residual mean MAD of the one coded 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 under the condition that the residual mean value MAD of the coded block is greater than or equal to the third preset threshold and smaller than a fourth preset threshold;
Determining the target resolution to be a sixth resolution in a case that the residual mean MAD of the one encoded 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.
9. The method according to claim 8, wherein 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, respectively, wherein the resolution set includes the first resolution, the second resolution, the third resolution, the fourth resolution, the fifth resolution and the sixth resolution.
10. The method of claim 6, wherein determining the target resolution from a weighted sum of residual means MAD of the plurality of encoded blocks comprises:
Determining the target resolution as a first resolution under the condition that the weighted sum of residual mean MADs of the plurality of encoded blocks is less than a fifth preset threshold;
Determining the target resolution to be a second resolution in the case that the weighted sum of the residual mean MADs 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.
11. the method according to claim 10, wherein the determining the target resolution as the second resolution in case that the weighted sum of the mean residual values MAD of the plurality of encoded blocks is greater than or equal to the fifth preset threshold comprises:
determining the target resolution as a third resolution when the weighted sum of the residual mean MADs of the plurality of encoded blocks is greater than or equal to a fifth preset threshold and less than a sixth preset threshold;
Determining the target resolution as a fourth resolution when the weighted sum of the residual mean MADs 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 when the weighted sum of the residual mean MADs of the plurality of encoded blocks is greater than or equal to the seventh preset threshold and less than an eighth preset threshold;
determining the target resolution to be a sixth resolution in a case that a weighted sum of residual mean MADs 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.
12. A video decoding apparatus, comprising:
A first obtaining module, configured to obtain a target flag bit corresponding to a target block to be decoded from a video frame to be decoded, where the target flag bit is used to indicate a target resolution adopted by the target block to be decoded when encoding, and the target resolution is determined according to a residual mean MAD of a reference block adopted by the target block when encoding;
a second obtaining module, configured to obtain the target resolution indicated by the target flag;
And the decoding module is used for decoding the target block to be decoded by adopting the target resolution.
13. a video encoding apparatus, comprising:
the third acquisition module is used for acquiring a residual mean value MAD of a reference block of a block to be coded in a video frame to be coded;
a determining module, configured to determine, according to the residual mean MAD, a target resolution for encoding the block to be encoded;
And the coding module is used for coding the block to be coded according to the target resolution.
14. A computer-readable storage medium comprising a stored program, wherein the program when executed performs the method of any of claims 1 to 2 or 3 to 11.
15. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to execute the method of any of claims 1-2 or 3-11 by means of the computer program.
CN201910927070.4A 2019-09-27 2019-09-27 Video encoding method, video decoding method, video encoding apparatus, video decoding apparatus, storage medium, and electronic apparatus Pending CN110572653A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910927070.4A CN110572653A (en) 2019-09-27 2019-09-27 Video encoding method, video decoding method, video encoding apparatus, video decoding apparatus, storage medium, and electronic apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910927070.4A CN110572653A (en) 2019-09-27 2019-09-27 Video encoding method, video decoding method, video encoding apparatus, video decoding apparatus, storage medium, and electronic apparatus

Publications (1)

Publication Number Publication Date
CN110572653A true CN110572653A (en) 2019-12-13

Family

ID=68782967

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910927070.4A Pending CN110572653A (en) 2019-09-27 2019-09-27 Video encoding method, video decoding method, video encoding apparatus, video decoding apparatus, storage medium, and electronic apparatus

Country Status (1)

Country Link
CN (1) CN110572653A (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20140048804A (en) * 2012-10-09 2014-04-24 광운대학교 산학협력단 Method and apparatus of controlling bit-rate for coding/decoding 3d video
US8780987B1 (en) * 2011-04-28 2014-07-15 Google Inc. Method and apparatus for encoding video by determining block resolution
US20140269927A1 (en) * 2013-03-15 2014-09-18 Sonic Ip, Inc. Systems, methods, and media for transcoding video data using metadata
CN105959700A (en) * 2016-05-31 2016-09-21 腾讯科技(深圳)有限公司 Video image coding method and device
CN107257464A (en) * 2016-12-29 2017-10-17 四川大学 HD video encoder bit rate control algolithm based on Sobel operators and linear regression
CN108848380A (en) * 2018-06-20 2018-11-20 腾讯科技(深圳)有限公司 Video coding and decoding method, apparatus, computer equipment and storage medium
KR20190033403A (en) * 2017-09-21 2019-03-29 에스케이텔레콤 주식회사 Video Encoding and Decoding using Resolution Enhancement Scheme
CN109600615A (en) * 2018-11-12 2019-04-09 建湖云飞数据科技有限公司 A method of video is decoded based on motion information

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8780987B1 (en) * 2011-04-28 2014-07-15 Google Inc. Method and apparatus for encoding video by determining block resolution
KR20140048804A (en) * 2012-10-09 2014-04-24 광운대학교 산학협력단 Method and apparatus of controlling bit-rate for coding/decoding 3d video
US20140269927A1 (en) * 2013-03-15 2014-09-18 Sonic Ip, Inc. Systems, methods, and media for transcoding video data using metadata
CN105959700A (en) * 2016-05-31 2016-09-21 腾讯科技(深圳)有限公司 Video image coding method and device
CN107257464A (en) * 2016-12-29 2017-10-17 四川大学 HD video encoder bit rate control algolithm based on Sobel operators and linear regression
KR20190033403A (en) * 2017-09-21 2019-03-29 에스케이텔레콤 주식회사 Video Encoding and Decoding using Resolution Enhancement Scheme
CN108848380A (en) * 2018-06-20 2018-11-20 腾讯科技(深圳)有限公司 Video coding and decoding method, apparatus, computer equipment and storage medium
CN109600615A (en) * 2018-11-12 2019-04-09 建湖云飞数据科技有限公司 A method of video is decoded based on motion information

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
PEISONG CHEN: "AHG 8: Adaptive Resolution Change", JOINT VIDEO EXPERTS TEAM (JVET) OF ITU-T SG 16 WP 3 AND ISO/IEC JTC 1/SC 29/WG 11 15TH MEETING: GOTHENBURG, SE, 3–12 JULY 2019,JVET-O0303-V2, pages 2 - 3 *

Similar Documents

Publication Publication Date Title
CN110636312B (en) Video encoding and decoding method and device and storage medium
CN110636294A (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
CN110650357B (en) Video decoding method and device
CN110572673A (en) Video encoding and decoding method and device, storage medium and electronic device
WO2021057479A1 (en) Video coding method, video decoding method, and related devices
CN110662071B (en) Video decoding method and device, storage medium and electronic device
CN110677676B (en) Video encoding method and apparatus, video decoding method and apparatus, 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
CN110636293A (en) Video encoding method, video decoding method, video encoding apparatus, video decoding apparatus, storage medium, and electronic apparatus
CN110582022B (en) Video encoding and decoding method and device and storage medium
CN114157868B (en) Video frame coding mode screening method and device and electronic equipment
CN110536134B (en) Video encoding method, video decoding method, video encoding apparatus, video decoding apparatus, storage medium, and electronic apparatus
CN110677721B (en) Video encoding and decoding method and device and storage medium
CN110572653A (en) Video encoding method, video decoding method, video encoding apparatus, video decoding apparatus, storage medium, and electronic apparatus
CN110677691B (en) Video encoding method, video decoding method, video encoding apparatus, video decoding apparatus, storage medium, and electronic apparatus
CN110572654B (en) Video encoding and decoding methods and devices, storage medium and electronic device
CN110677692B (en) Video decoding method and device and video encoding method and device
CN110677690B (en) Video processing method and device and storage medium
CN114222127A (en) Video coding method, video decoding method and device
CN110545431B (en) Video decoding method and device, video encoding method and device
CN112887726B (en) Image processing method and apparatus, storage medium, and electronic device
CN110572674A (en) Video encoding and decoding method and device, storage medium and electronic device

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

Country of ref document: HK

SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination