CN110636293A - 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
CN110636293A
CN110636293A CN201910927967.7A CN201910927967A CN110636293A CN 110636293 A CN110636293 A CN 110636293A CN 201910927967 A CN201910927967 A CN 201910927967A CN 110636293 A CN110636293 A CN 110636293A
Authority
CN
China
Prior art keywords
resolution
block
target
coding
frame
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910927967.7A
Other languages
Chinese (zh)
Other versions
CN110636293B (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 CN201910927967.7A priority Critical patent/CN110636293B/en
Publication of CN110636293A publication Critical patent/CN110636293A/en
Application granted granted Critical
Publication of CN110636293B publication Critical patent/CN110636293B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/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/157Assigned coding mode, i.e. the coding mode being predefined or preselected to be further used for selection of another element or parameter
    • H04N19/159Prediction type, e.g. intra-frame, inter-frame or bidirectional frame prediction
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/59Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving spatial sub-sampling or interpolation, e.g. alteration of picture size or resolution

Abstract

The invention discloses a video 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 coding cost information of a block to be coded in a current video frame, wherein the coding cost information comprises cost information obtained by carrying out intra-frame predictive coding on the block to be coded and cost information obtained by carrying out inter-frame predictive coding on the block to be coded; determining a target resolution for coding the to-be-coded block according to the coding cost information; and encoding the block to be encoded by adopting 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 decoding method, including:
acquiring a target zone bit corresponding to a target block to be decoded from a current video frame, wherein the target zone bit is used for representing a target resolution adopted by the target block to be decoded 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 encoding method, including:
acquiring coding cost information of a block to be coded in a current video frame, wherein the coding cost information comprises cost information obtained by carrying out intra-frame predictive coding on the block to be coded and cost information obtained by carrying out inter-frame predictive coding on the block to be coded;
determining a target resolution for coding the to-be-coded block according to the coding cost information;
and encoding the block to be encoded 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:
the first obtaining module is used for obtaining a target zone bit corresponding to a target block to be decoded from a current video frame, wherein the target zone bit is used for representing a target resolution adopted by the target block to be decoded during 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:
a third obtaining module, configured to obtain coding cost information of a block to be coded in a current video frame, where the coding cost information includes cost information obtained by performing intra-frame predictive coding on the block to be coded and cost information obtained by performing inter-frame predictive coding on the block to be coded;
a determining module, configured to determine, according to the coding cost information, a target resolution for coding the block to be coded;
and the coding module is used for coding the block to be coded by adopting 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 executes 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 coding cost information, 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 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 by adopting the same resolution 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 coding cost information of a block to be coded in a current video frame, wherein the coding cost information comprises cost information obtained by carrying out intra-frame predictive coding on the block to be coded and cost information obtained by carrying out inter-frame predictive coding on the block to be coded;
specifically, the current video frame, i.e., 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.
In an optional embodiment, the foregoing S402 may be specifically implemented by the following manner:
carrying out intra-frame prediction coding on the to-be-coded Block to obtain an intra-frame coding cost value Block _ Ipost, and carrying out unidirectional inter-frame prediction coding on the to-be-coded Block to obtain a unidirectional inter-frame coding cost value Block _ Ppost, wherein the coding cost information comprises the intra-frame coding cost value Block _ Ipost and the unidirectional inter-frame coding cost value Block _ Ppost; or
The method comprises the steps of carrying out intra-frame prediction coding on a to-be-coded Block to obtain an intra-frame coding cost value Block _ Ipost, carrying out unidirectional inter-frame prediction coding on the to-be-coded Block to obtain an unidirectional inter-frame coding cost value Block _ Ppost, and carrying out bidirectional inter-frame prediction coding on the to-be-coded Block to obtain a bidirectional inter-frame coding cost value Block _ Bpost, wherein the coding cost information comprises the intra-frame coding cost value Block _ Ipost, the unidirectional inter-frame coding cost value Block _ Ppost and the bidirectional inter-frame coding cost value Block _ Bpost.
Specifically, the intra-frame or inter-frame prediction precoding cost analysis of the block to be coded includes the following specific processes:
down-sampling a block to be coded: the original resolution is not downsampled, or downsampled at 2:1 of the original resolution, or downsampled at other ratios.
And carrying out intra-frame or inter-frame prediction coding on the down-sampled block to be coded, and recording the intra-frame coding cost or inter-frame coding cost of the block to be coded. The coding cost is equal to the sum of absolute values of prediction residuals of all pixels of the coding block; another coding cost calculation formula is: and D + λ R, where cost is coding cost, D represents the distortion degree of the image coding block corresponding to the coding unit, D can be represented by the sum of absolute values of differences between the reconstructed image and the original image coded by all pixels of the current block, λ is a lagrangian coefficient, and R represents the number of bits occupied by the image coding block corresponding to the coding unit.
And calculating the intra-frame coding cost value or the inter-frame coding cost value of the current coding block, and respectively recording the intra-frame coding cost value or the inter-frame coding cost value as Ipost and Ppost.
Step S404, determining a target resolution for coding the block to be coded according to the coding cost information;
step S406, encoding the block to be encoded with the target resolution.
In the process of step S406, the target resolution may be carried by the flag bit, that is, the flag bit is set in the encoded data obtained by encoding, so that the decoding end may obtain the target resolution adopted in encoding according to the flag bit, thereby implementing decoding.
Through the steps S402 to S406, the encoding side decides the target resolution of the current block to be encoded according to the encoding cost information, 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 an optional embodiment, the step S404 may specifically include:
determining the target resolution as a first resolution under the condition that the coding cost information indicates that the intra-frame texture of the block to be coded is complex; specifically, in the pre-analysis of the Block to be coded, when the intra-frame coding cost Block _ Icost is larger than the inter-frame coding cost Block _ Pcost which is a times, the complexity of the intra-frame texture can be determined; if the corresponding first ratio is smaller than a first preset threshold or the second ratio is smaller than a fifth preset threshold, it indicates that the intra-frame texture of the current coding block is complex, and the current coding block is coded by adopting low resolution;
and when the coding cost information indicates that the inter-frame motion of the Block to be coded is complex, determining that the target resolution is a second resolution, specifically, when the intra-frame coding cost Block _ Icost is less than or equal to a multiple of the inter-frame coding cost Block _ Pcost, determining that the inter-frame motion is complex, and if the corresponding first ratio is greater than or equal to a first preset value or the second ratio is greater than or equal to a fifth preset threshold, indicating that the inter-frame motion of the current coding Block is complex, and coding the current coding Block by adopting the high resolution.
In the embodiment of the present invention, the first resolution is smaller than the second resolution, and the second resolution may be a preset full resolution.
In another optional embodiment, the step S404 may further include:
s4041, determining the target resolution according to the intra-frame coding cost value Block _ Ipost of the to-be-coded Block and the unidirectional inter-frame coding cost value Block _ Ppost of the to-be-coded Block, wherein the coding cost information includes the intra-frame coding cost value obtained by performing intra-frame predictive coding on the to-be-coded Block and the unidirectional inter-frame coding cost value obtained by performing unidirectional inter-frame predictive coding on the to-be-coded Block; or
S4042, determining the target resolution according to the intra-frame coding cost value Block _ Icost of the to-be-coded Block, the unidirectional inter-frame coding cost value Block _ Pcost of the to-be-coded Block, and the bidirectional inter-frame coding cost value Block _ Bcost of the to-be-coded Block, where the coding cost information includes the intra-frame coding cost value obtained by performing intra-frame predictive coding on the to-be-coded Block, the unidirectional inter-frame coding cost value obtained by performing unidirectional inter-frame predictive coding on the to-be-coded Block, and the bidirectional inter-frame coding cost value obtained by performing bidirectional inter-frame predictive coding on the to-be-coded Block.
In an optional embodiment, the step S4041 may specifically include:
determining a first ratio of the intra-frame coding cost value to the unidirectional inter-frame coding cost value;
determining the target resolution as a first resolution under the condition that the first ratio is smaller than a first preset threshold;
and determining the target resolution as a second resolution under the condition that the first ratio is greater than or equal to the first preset threshold, wherein the first resolution is less than the second resolution.
Further, the first resolution may be divided into a plurality of levels of resolution, for example, the first resolution includes: the third resolution, the fourth resolution, the fifth resolution, the sixth resolution, and the like, and correspondingly, in a case that the first ratio is smaller than a first preset threshold, determining that the target resolution is the first resolution may include:
determining the target resolution as a third resolution when a second preset threshold is greater than or equal to the first ratio and less than the first preset threshold;
determining the target resolution as a fourth resolution when a third preset threshold is greater than or equal to the first ratio and less than the second preset threshold;
determining the target resolution as a fifth resolution under the condition that a fourth preset threshold is greater than or equal to the first ratio and smaller than the third preset threshold;
determining the target resolution as a sixth resolution if the first ratio is smaller than the fourth preset threshold, wherein the third resolution < the fourth resolution < the fifth resolution < the sixth resolution < the first resolution, and the first resolution includes: 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 first ratio is smaller than a first preset threshold, it indicates that the intra-frame motion of the current block is complex, and the current block is coded by adopting a low resolution, that is, the current block is coded by adopting the first resolution. If the second preset threshold value is < the first ratio value < the first preset threshold value, it indicates that the intra texture of the current coding block is complex, and the current coding block is coded by using 1/3 samples with high resolution, that is, the third resolution may be 1/3 samples with high resolution; if the third preset threshold is < the first ratio < the second preset threshold, it indicates that the intra texture of the current coding block is complex, and the current coding block is coded by using 1/2 samples with high resolution, that is, the fourth resolution may be 1/2 samples with high resolution; if the fourth preset threshold is < the first ratio < the third preset threshold, it indicates that the intra texture of the current coding block is complex, and the current coding block is coded by using 2/3 samples with high resolution, that is, the fifth resolution may be 2/3 samples with high resolution; the first ratio < the fourth preset threshold value indicates that the intra texture of the current coding block is more complex, and the current coding block is coded by using 3/4 samples with high resolution, i.e. the above sixth resolution may be 3/4 samples with high resolution, and so on.
In an embodiment of the present invention, the first preset threshold, the second preset threshold, the third preset threshold, and the fourth preset threshold are positively correlated to the number of pixels of the block to be coded, and the first preset threshold, the second preset threshold, the third preset threshold, and the fourth preset threshold may be preset.
In an optional embodiment, the step S4042 may further include:
determining a second ratio of the intra-frame coding cost value to an inter-frame coding cost value, wherein the inter-frame coding cost value is the sum of the unidirectional inter-frame coding cost value and the bidirectional inter-frame coding cost value;
determining the target resolution as a first resolution under the condition that the second ratio is smaller than a fifth preset threshold;
and determining the target resolution as a second resolution when the second ratio is greater than or equal to the fifth preset threshold, wherein the first resolution is smaller than the second resolution.
Further, the first resolution may be divided into a plurality of levels of resolution, for example, the first resolution includes: the third resolution, the fourth resolution, the fifth resolution, the sixth resolution, and the like, and correspondingly, if the second ratio is smaller than the second preset threshold, it is determined that the target resolution is the first resolution, and the method specifically may include:
determining the target resolution as a third resolution when a sixth preset threshold is greater than or equal to the second ratio and less than the fifth preset threshold;
determining the target resolution as a fourth resolution when the seventh preset threshold is greater than or equal to the second ratio and less than the sixth preset threshold;
when the eighth preset threshold is greater than or equal to the second ratio and less than the seventh preset threshold, determining the target resolution as a fifth resolution;
determining that the target resolution is a sixth resolution under the condition that the second ratio is smaller than the eighth preset threshold, wherein the third resolution < the fourth resolution < the fifth resolution < the sixth resolution < the first resolution, and the first resolution includes: the third resolution, the fourth resolution, the fifth resolution, and the sixth resolution.
For a current block to be coded in the video, if the second ratio is smaller than a first preset threshold, it indicates that the intra-frame motion of the current block is complex, and the current block is coded with low resolution, that is, with the first resolution. If the sixth preset threshold is < the second ratio < the fifth preset threshold, it indicates that the intra texture of the current coding block is complex, and the current coding block is coded by using 1/3 samples with high resolution, that is, the third resolution may be 1/3 samples with high resolution; if the seventh preset threshold is < the second ratio < the sixth preset threshold, it indicates that the intra texture of the current coding block is complex, and the current coding block is coded by using 1/2 samples with high resolution, that is, the fourth resolution may be 1/2 samples with high resolution; if the eighth preset threshold is < the second ratio < the seventh preset threshold, it indicates that the intra texture of the current coding block is complex, and the current coding block is coded by using 2/3 samples with high resolution, that is, the fifth resolution may be 2/3 samples with high resolution; the second ratio < eighth preset threshold indicates that the intra texture of the current coding block is more complex, and the current coding block is coded with 3/4 samples with high resolution, i.e. the above sixth resolution may be 3/4 samples with width and height of the second resolution, and so on.
In an embodiment of the present invention, the fifth preset threshold, the sixth preset threshold, the seventh preset threshold, and the eighth preset threshold are positively correlated to the number of pixels of the block to be coded, and the fifth preset threshold, the sixth preset threshold, the seventh preset threshold, and the eighth preset threshold may be preset.
In the video coding process of the embodiment of the invention, different resolution ratios are adaptively adopted for coding different blocks in one frame in a video, and the resolution ratio used by each coding block is determined by the coding cost value information of the current coding block, so that a decoding end can know the resolution ratio used by different blocks in the video frame during coding, and decoding is rapidly completed.
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.
The decision process of the coding resolution used by the coding block of the present invention will be described in detail below.
In a first mode, for a current coding Block to be coded in a video, the Block _ Icost and the Block _ Pcost corresponding to the current coding Block are obtained, and the value r (corresponding to the first ratio) of Block _ Icost/Block _ Pcost is determined. If r > is the threshold value, the intra-frame texture of the current coding block is complex, and the current coding block is coded by adopting low resolution; if r < threshold, it means that the inter-frame motion of the current coding block is more complex, and the current coding block is coded with high resolution.
In a second mode, for a current coding Block to be coded in a video, corresponding Block _ Icost, Block _ Pcost and Block _ Bcost are obtained, and a value R of Block _ Icost/(Block _ Pcost + Block _ Bcost) is determined (corresponding to the second ratio). If R > is the threshold value, the intra-frame texture of the current coding block is complex, and the current coding block is coded by adopting low resolution; if R < threshold, it means that the inter-frame motion of the current coding block is more complex, and the current coding block is coded by adopting high resolution.
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 information self-adaptive decision of the current coding block is utilized for different blocks in a frame in a video, so that the peak signal-to-noise ratio is relatively high under 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 current video frame, wherein the target zone bit is used for indicating a target resolution adopted by the target block to be decoded during encoding;
each block to be decoded in the current frequency frame corresponds to a flag bit for representing the resolution adopted in the encoding process;
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.
Step S704, obtaining the target resolution indicated by the target flag bit;
step S706, decoding the target block to be decoded by using the target 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 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 target resolution is a resolution determined according to coding cost information of a to-be-coded block corresponding to the to-be-decoded target block, where the coding cost information includes cost information obtained by performing intra-frame predictive coding on the to-be-coded block and cost information obtained by performing inter-frame predictive coding on the to-be-coded block.
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 corresponding to a target block to be decoded from a current video frame, where the target flag is used to indicate a target resolution adopted by the target block to be decoded 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 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 coding cost information of a to-be-coded block corresponding to the to-be-decoded target block, where the coding cost information includes cost information obtained by performing intra-frame predictive coding on the to-be-coded block and cost information obtained by performing inter-frame predictive coding on the to-be-coded block.
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 coding cost information of a block to be coded in a current video frame, where the coding cost information includes cost information obtained by performing intra-frame predictive coding on the block to be coded and cost information obtained by performing inter-frame predictive coding on the block to be coded;
a determining module 94, configured to determine, according to the coding cost information, a target resolution for coding the block to be coded;
and an encoding module 96, configured to encode the block to be encoded with the target resolution.
In an alternative embodiment, the determination module 94 is further configured to
Determining the target resolution as a first resolution under the condition that the coding cost information indicates that the intra-frame texture of the block to be coded is complex;
and determining the target resolution as a second resolution under the condition that the coding cost information indicates that the interframe motion of the block to be coded is complex, wherein the first resolution is smaller than the second 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 submodule 102, configured to determine the target resolution according to an intra-frame coding cost value Block _ Icost of the to-be-coded Block and a unidirectional inter-frame coding cost value Block _ Pcost of the to-be-coded Block, where the coding cost information includes the intra-frame coding cost value Block _ Icost obtained by performing intra-frame prediction coding on the to-be-coded Block and the unidirectional inter-frame coding cost value Block _ Pcost obtained by performing unidirectional inter-frame prediction coding on the to-be-coded Block; or
A second determining submodule 104, configured to determine the target resolution according to the intra-frame coding cost value Block _ Icost of the to-be-coded Block, the unidirectional inter-frame coding cost value Block _ Pcost of the to-be-coded Block, and the bidirectional inter-frame coding cost value Block _ Bcost of the to-be-coded Block, where the coding cost information includes the intra-frame coding cost value Block _ Icost obtained by performing intra-frame prediction coding on the to-be-coded Block, the unidirectional inter-frame coding cost value Block _ Pcost obtained by performing unidirectional inter-frame prediction coding on the to-be-coded Block, and the bidirectional inter-frame coding cost value Block _ Bcost obtained by performing bidirectional inter-frame prediction coding on the to-be-coded Block.
Optionally, the first determining sub-module 102 includes:
a first determining unit, configured to determine a first ratio of the intra-frame coding cost value Block _ Icost to the unidirectional inter-frame coding cost value Block _ Pcost;
a second determining unit, configured to determine that the target resolution is a first resolution when the first ratio is smaller than a first preset threshold;
a third determining unit, configured to determine that the target resolution is a second resolution when the first ratio is greater than or equal to the first preset threshold, where the first resolution is smaller than the second resolution.
Optionally, the third determining unit is further used for
Determining the target resolution as a third resolution when a second preset threshold is greater than or equal to the first ratio and less than the first preset threshold;
determining the target resolution as a fourth resolution when a third preset threshold is greater than or equal to the first ratio and less than the second preset threshold;
determining the target resolution as a fifth resolution under the condition that a fourth preset threshold is greater than or equal to the first ratio and smaller than the third preset threshold;
determining the target resolution as a sixth resolution if the first ratio is smaller than the fourth preset threshold, wherein the third resolution < the fourth resolution < the fifth resolution < the sixth resolution < the first resolution, and the first resolution includes: the third resolution, the fourth resolution, the fifth resolution, and 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 the number of pixels of the block to be encoded.
Optionally, the second determining submodule 104 includes:
a fourth determining unit, configured to determine a second ratio of the intra-frame coding cost value Block _ Icost to an inter-frame coding cost value, where the inter-frame coding cost value is a sum of the unidirectional inter-frame coding cost value Block _ Pcost and the bidirectional inter-frame coding cost value Block _ Bcost;
a fifth determining unit, configured to determine that the target resolution is the first resolution when the second ratio is smaller than a fifth preset threshold;
a sixth determining unit, configured to determine that the target resolution is a second resolution when the second ratio is greater than or equal to the fifth preset threshold, where the first resolution is smaller than the second resolution.
Optionally, the sixth determining unit is further configured to
Determining the target resolution as a third resolution when a sixth preset threshold is greater than or equal to the second ratio and less than the fifth preset threshold;
determining the target resolution as a fourth resolution when the seventh preset threshold is greater than or equal to the second ratio and less than the sixth preset threshold;
when the eighth preset threshold is greater than or equal to the second ratio and less than the seventh preset threshold, determining the target resolution as a fifth resolution;
determining that the target resolution is a sixth resolution under the condition that the second ratio is smaller than the eighth preset threshold, wherein the third resolution < the fourth resolution < the fifth resolution < the sixth resolution < the first resolution, and the first resolution includes: the third resolution, the fourth resolution, the fifth resolution, and 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 the number of pixels of the block to be encoded.
Optionally, the third obtaining module 92 includes:
the first prediction coding sub-module is used for carrying out intra-frame prediction coding on the to-be-coded Block to obtain an intra-frame coding cost value Block _ Ipost, and carrying out unidirectional inter-frame prediction coding on the to-be-coded Block to obtain a unidirectional inter-frame coding cost value Block _ Ppost, wherein the coding cost information comprises the intra-frame coding cost value Block _ Ipost and the unidirectional inter-frame coding cost value Block _ Ppost; or
And the second prediction coding submodule is used for carrying out intra-frame prediction coding on the to-be-coded Block to obtain an intra-frame coding cost value Block _ Ipost, carrying out unidirectional inter-frame prediction coding on the to-be-coded Block to obtain a unidirectional inter-frame coding cost value Block _ Ppost, and carrying out bidirectional inter-frame prediction coding on the to-be-coded Block to obtain a bidirectional inter-frame coding cost value Block _ Bpost, wherein the coding cost information comprises the intra-frame coding cost value Block _ Ipost, the unidirectional inter-frame coding cost value Block _ Ppost and the bidirectional inter-frame coding cost value Block _ Bpost.
Optionally, the apparatus further comprises: and the setting module is used for setting a flag bit in the coded data obtained by coding the block to be coded by adopting the target resolution, wherein the flag bit is used for carrying the target resolution.
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 zone bit corresponding to a target block to be decoded from the current video frame, wherein the target zone bit is used for indicating the target resolution adopted by the target block to be decoded during 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 video decoding method and apparatus in the embodiments of the present invention, and the processor 1104 executes various functional applications and data processing by operating the software programs and modules stored in the memory 1102, that is, implements the video decoding method described above. 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, acquiring coding cost information of a block to be coded in a current video frame, wherein the coding cost information comprises cost information obtained by carrying out intra-frame predictive coding on the block to be coded and cost information obtained by carrying out inter-frame predictive coding on the block to be coded;
s22, determining the target resolution for coding the block to be coded according to the coding cost information;
and S23, encoding the block to be encoded by adopting 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 video encoding method and apparatus in the embodiments of the present invention, and the processor 1104 executes various functional applications and data processing by operating the software programs and modules stored in the memory 1102, so as to implement the video encoding method described above. 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 zone bit corresponding to a target block to be decoded from the current frequency frame, wherein the target zone bit is used for indicating the target resolution adopted by the target block to be decoded during 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, acquiring coding cost information of a block to be coded in a current video frame, wherein the coding cost information comprises cost information obtained by carrying out intra-frame predictive coding on the block to be coded and cost information obtained by carrying out inter-frame predictive coding on the block to be coded;
s22, determining the target resolution for coding the block to be coded according to the coding cost information;
and S23, encoding the block to be encoded 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.
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 (19)

1. A video decoding method, comprising:
acquiring a target zone bit corresponding to a target block to be decoded from a current video frame, wherein the target zone bit is used for representing a target resolution adopted by the target block to be decoded 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.
2. The method of claim 1, wherein the obtaining the target resolution represented by the target flag comprises:
and acquiring the target resolution represented by the target zone bit from a preset resolution set.
3. The method according to claim 1, wherein the target resolution is a resolution determined according to coding cost information of a block to be coded corresponding to the target block to be decoded, and wherein the coding cost information includes cost information obtained by intra-frame predictive coding of the block to be coded and cost information obtained by inter-frame predictive coding of the block to be coded.
4. The method of claim 1, wherein the decoding the target block to be decoded at the target resolution comprises:
and decoding the target block to be decoded into a block with the target resolution.
5. A video encoding method, comprising:
acquiring coding cost information of a block to be coded in a current video frame, wherein the coding cost information comprises cost information obtained by carrying out intra-frame predictive coding on the block to be coded and cost information obtained by carrying out inter-frame predictive coding on the block to be coded;
determining a target resolution for coding the to-be-coded block according to the coding cost information;
and encoding the to-be-encoded block by adopting the target resolution.
6. The method of claim 5, wherein the determining a target resolution for encoding the block to be encoded according to the encoding cost information comprises:
determining the target resolution as a first resolution under the condition that the coding cost information indicates that the intra-frame texture of the block to be coded is complex;
and determining the target resolution as a second resolution under the condition that the coding cost information indicates that the inter-frame motion of the block to be coded is complex, wherein the first resolution is smaller than the second resolution.
7. The method of claim 5, wherein the determining a target resolution for encoding the block to be encoded according to the encoding cost information comprises:
determining the target resolution according to the intra-frame coding cost value Block _ Ipost of the to-be-coded Block and the unidirectional inter-frame coding cost value Block _ Ppost of the to-be-coded Block, wherein the coding cost information comprises the intra-frame coding cost value Block _ Ipost obtained by performing intra-frame prediction coding on the to-be-coded Block and the unidirectional inter-frame coding cost value Block _ Ppost obtained by performing unidirectional inter-frame prediction coding on the to-be-coded Block; or
And determining the target resolution according to the intra-frame coding cost value Block _ Ipost of the to-be-coded Block, the unidirectional inter-frame coding cost value Block _ Ppost of the to-be-coded Block and the bidirectional inter-frame coding cost value Block _ Bpost of the to-be-coded Block, wherein the coding cost information comprises the intra-frame coding cost value Block _ Ipost obtained by performing intra-frame predictive coding on the to-be-coded Block, the unidirectional inter-frame coding cost value Block _ Ppost obtained by performing unidirectional inter-frame predictive coding on the to-be-coded Block and the bidirectional inter-frame coding cost value Block _ Bpost obtained by performing bidirectional inter-frame predictive coding on the to-be-coded Block.
8. The method of claim 7, wherein determining the target resolution according to the intra-coding cost value of the block to be encoded and the uni-directional inter-coding cost value of the block to be encoded comprises:
determining a first ratio of the intra-coding cost value Block _ Ipost to the unidirectional inter-coding cost value Block _ Ppost;
determining the target resolution as a first resolution under the condition that the first ratio is smaller than a first preset threshold;
and determining the target resolution as a second resolution when the first ratio is greater than or equal to the first preset threshold, wherein the first resolution is less than the second resolution.
9. The method according to claim 8, wherein the determining that the target resolution is the first resolution in the case that the first ratio is smaller than a first preset threshold value comprises:
determining the target resolution as a third resolution when a second preset threshold is greater than or equal to the first ratio and smaller than the first preset threshold;
determining the target resolution as a fourth resolution when a third preset threshold is greater than or equal to the first ratio and less than the second preset threshold;
determining the target resolution as a fifth resolution when a fourth preset threshold is greater than or equal to the first ratio and less than the third preset threshold;
determining that the target resolution is a sixth resolution if the first ratio is less than the fourth preset threshold, wherein the third resolution < the fourth resolution < the fifth resolution < the sixth resolution < the first resolution, the first resolution comprising: the third resolution, the fourth resolution, the fifth resolution, and the sixth resolution.
10. The method of claim 9, wherein the first preset threshold, the second preset threshold, the third preset threshold and the fourth preset threshold are positively correlated to the number of pixels of the block to be encoded.
11. The method of claim 7, wherein the determining the target resolution according to the intra-coding cost value Block _ Icost of the Block to be encoded, the unidirectional inter-coding cost value Block _ Pcost of the Block to be encoded, and the bidirectional inter-coding cost value Block _ Bcost of the Block to be encoded comprises:
determining a second ratio of the intra-coding cost value Block _ Icost to an inter-coding cost value, wherein the inter-coding cost value is a sum of the unidirectional inter-coding cost value Block _ Pcost and the bidirectional inter-coding cost value Block _ Bcost;
determining the target resolution as a first resolution under the condition that the second ratio is smaller than a fifth preset threshold;
and determining the target resolution as a second resolution when the second ratio is greater than or equal to the fifth preset threshold, wherein the first resolution is less than the second resolution.
12. The method according to claim 11, wherein the determining that the target resolution is the first resolution in the case that the second ratio is smaller than a fifth preset threshold comprises:
determining the target resolution as a third resolution when a sixth preset threshold is greater than or equal to the second ratio and less than the fifth preset threshold;
determining the target resolution as a fourth resolution when a seventh preset threshold is greater than or equal to the second ratio and less than the sixth preset threshold;
determining the target resolution as a fifth resolution when an eighth preset threshold is greater than or equal to the second ratio and less than the seventh preset threshold;
determining that the target resolution is a sixth resolution if the second ratio is less than the eighth preset threshold, wherein the third resolution < the fourth resolution < the fifth resolution < the sixth resolution < the first resolution, and the first resolution includes: the third resolution, the fourth resolution, the fifth resolution, and the sixth resolution.
13. The method according to claim 12, wherein the fifth preset threshold, the sixth preset threshold, the seventh preset threshold, and the eighth preset threshold are positively correlated with the number of pixels of the block to be encoded.
14. The method according to any of claims 5 to 13, wherein the obtaining of the coding cost information of the block to be coded in the current coded video frame comprises:
carrying out intra-frame prediction coding on the to-be-coded Block to obtain an intra-frame coding cost value Block _ Ipost, and carrying out unidirectional inter-frame prediction coding on the to-be-coded Block to obtain a unidirectional inter-frame coding cost value Block _ Ppost, wherein the coding cost information comprises the intra-frame coding cost value Block _ Ipost and the unidirectional inter-frame coding cost value Block _ Ppost; or
The method comprises the steps of carrying out intra-frame prediction coding on a to-be-coded Block to obtain an intra-frame coding cost value Block _ Ipost, carrying out unidirectional inter-frame prediction coding on the to-be-coded Block to obtain an unidirectional inter-frame coding cost value Block _ Ppost, and carrying out bidirectional inter-frame prediction coding on the to-be-coded Block to obtain a bidirectional inter-frame coding cost value Block _ Bpost, wherein the coding cost information comprises the intra-frame coding cost value Block _ Ipost, the unidirectional inter-frame coding cost value Block _ Ppost and the bidirectional inter-frame coding cost value Block _ Bpost.
15. The method of claim 5, further comprising:
and setting a flag bit in the coded data obtained by coding the block to be coded by adopting the target resolution, wherein the flag bit is used for carrying the target resolution.
16. A video decoding apparatus, comprising:
the first obtaining module is used for obtaining a target zone bit corresponding to a target block to be decoded from a current decoding video frame, wherein the target zone bit is used for representing a target resolution adopted by the target block to be decoded during 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.
17. A video encoding apparatus, comprising:
a third obtaining module, configured to obtain coding cost information of a block to be coded in a current coded video frame, where the coding cost information includes cost information obtained by performing intra-frame predictive coding on the block to be coded and cost information obtained by performing inter-frame predictive coding on the block to be coded;
a determining module, configured to determine, according to the coding cost information, a target resolution for coding the block to be coded;
and the coding module is used for coding the block to be coded by adopting the target resolution.
18. A computer-readable storage medium comprising a stored program, wherein the program when executed performs the method of any of claims 1 to 4 or 5 to 15.
19. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to execute the method of any of claims 1 to 4 or 5 to 15 by means of the computer program.
CN201910927967.7A 2019-09-27 2019-09-27 Video encoding and decoding methods and devices, storage medium and electronic device Active CN110636293B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910927967.7A CN110636293B (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
CN201910927967.7A CN110636293B (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
CN110636293A true CN110636293A (en) 2019-12-31
CN110636293B CN110636293B (en) 2024-03-15

Family

ID=68973443

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910927967.7A Active CN110636293B (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) CN110636293B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113938690A (en) * 2021-12-03 2022-01-14 北京达佳互联信息技术有限公司 Video coding method and device, electronic equipment and storage medium

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6370192B1 (en) * 1997-11-20 2002-04-09 Hitachi America, Ltd. Methods and apparatus for decoding different portions of a video image at different resolutions
WO2011145836A2 (en) * 2010-05-17 2011-11-24 에스케이텔레콤 주식회사 Image coding/decoding device using coding block in which intra block and inter block are mixed, and method thereof
KR20120079561A (en) * 2011-01-05 2012-07-13 에스케이 텔레콤주식회사 Apparatus and method for intra prediction encoding/decoding based on selective multi-path predictions
CN102595108A (en) * 2011-01-05 2012-07-18 中兴通讯股份有限公司 Method and device for coding syntactic element
US20130089145A1 (en) * 2011-10-11 2013-04-11 Qualcomm Incorporated Most probable transform for intra prediction coding
US20170127074A1 (en) * 2015-10-29 2017-05-04 Microsoft Technology Licensing, Llc Video bit stream decoding
US20170180745A1 (en) * 2015-12-18 2017-06-22 Le Holdings (Beijing) Co., Ltd. Prediction method and Electronic Apparatus of encoding mode of variable resolution
CN107155107A (en) * 2017-03-21 2017-09-12 腾讯科技(深圳)有限公司 Method for video coding and device, video encoding/decoding method and device
CN108391127A (en) * 2018-04-27 2018-08-10 腾讯科技(深圳)有限公司 Method for video coding, device, storage medium and equipment
CN109495746A (en) * 2018-11-07 2019-03-19 建湖云飞数据科技有限公司 A kind of method for video coding based on motion vector adjustment
KR20190033403A (en) * 2017-09-21 2019-03-29 에스케이텔레콤 주식회사 Video Encoding and Decoding using Resolution Enhancement Scheme
CN109889829A (en) * 2019-01-23 2019-06-14 北方工业大学 The point self-adapted compensation of the quick sample product of 360 degree of videos
CN110049321A (en) * 2018-01-16 2019-07-23 腾讯科技(深圳)有限公司 Method for video coding, device, equipment and storage medium

Patent Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6370192B1 (en) * 1997-11-20 2002-04-09 Hitachi America, Ltd. Methods and apparatus for decoding different portions of a video image at different resolutions
WO2011145836A2 (en) * 2010-05-17 2011-11-24 에스케이텔레콤 주식회사 Image coding/decoding device using coding block in which intra block and inter block are mixed, and method thereof
KR20120079561A (en) * 2011-01-05 2012-07-13 에스케이 텔레콤주식회사 Apparatus and method for intra prediction encoding/decoding based on selective multi-path predictions
CN102595108A (en) * 2011-01-05 2012-07-18 中兴通讯股份有限公司 Method and device for coding syntactic element
US20130089145A1 (en) * 2011-10-11 2013-04-11 Qualcomm Incorporated Most probable transform for intra prediction coding
US20170127074A1 (en) * 2015-10-29 2017-05-04 Microsoft Technology Licensing, Llc Video bit stream decoding
US20170180745A1 (en) * 2015-12-18 2017-06-22 Le Holdings (Beijing) Co., Ltd. Prediction method and Electronic Apparatus of encoding mode of variable resolution
CN107155107A (en) * 2017-03-21 2017-09-12 腾讯科技(深圳)有限公司 Method for video coding and device, video encoding/decoding method and device
WO2018171447A1 (en) * 2017-03-21 2018-09-27 腾讯科技(深圳)有限公司 Video encoding method, video decoding method, computer device and storage medium
KR20190033403A (en) * 2017-09-21 2019-03-29 에스케이텔레콤 주식회사 Video Encoding and Decoding using Resolution Enhancement Scheme
CN110049321A (en) * 2018-01-16 2019-07-23 腾讯科技(深圳)有限公司 Method for video coding, device, equipment and storage medium
WO2019140952A1 (en) * 2018-01-16 2019-07-25 腾讯科技(深圳)有限公司 Video encoding method, device, apparatus and storage medium
CN108391127A (en) * 2018-04-27 2018-08-10 腾讯科技(深圳)有限公司 Method for video coding, device, storage medium and equipment
CN109495746A (en) * 2018-11-07 2019-03-19 建湖云飞数据科技有限公司 A kind of method for video coding based on motion vector adjustment
CN109889829A (en) * 2019-01-23 2019-06-14 北方工业大学 The point self-adapted compensation of the quick sample product of 360 degree of videos

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
STEPHAN WENGER等: "AHG8: Summary of Resolution Adaptivity related proposals", 《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-O1040V2》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113938690A (en) * 2021-12-03 2022-01-14 北京达佳互联信息技术有限公司 Video coding method and device, electronic equipment and storage medium
CN113938690B (en) * 2021-12-03 2023-10-31 北京达佳互联信息技术有限公司 Video encoding method, video encoding device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN110636293B (en) 2024-03-15

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
WO2021057697A1 (en) Video encoding and decoding methods and apparatuses, storage medium, and electronic device
CN110519607B (en) Video decoding method and device, and video encoding method and device
CN110650357B (en) Video decoding method and device
CN110545433B (en) Video encoding and decoding method and device and storage medium
CN110662071B (en) Video decoding method and device, storage medium and electronic device
WO2021057479A1 (en) Video coding method, video decoding method, and related devices
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
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
CN114157868B (en) Video frame coding mode screening method and device and electronic equipment
CN110677721B (en) Video encoding and decoding method and device and storage medium
CN114222127A (en) Video coding method, video decoding method and device
CN110677692B (en) Video decoding method and device and video encoding method and device
CN110536134B (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
CN110572653A (en) Video encoding method, video decoding method, video encoding apparatus, video decoding apparatus, storage medium, and electronic apparatus
CN110545431A (en) video decoding method and device and video encoding method and device
CN110677690A (en) Video processing method and device and storage medium
CN110572674B (en) Video encoding and decoding method and device, storage medium and electronic device
CN110636295B (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: 40018638

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