CN116248890A - Video coding method, device, computer equipment and storage medium - Google Patents
Video coding method, device, computer equipment and storage medium Download PDFInfo
- Publication number
- CN116248890A CN116248890A CN202111493884.5A CN202111493884A CN116248890A CN 116248890 A CN116248890 A CN 116248890A CN 202111493884 A CN202111493884 A CN 202111493884A CN 116248890 A CN116248890 A CN 116248890A
- Authority
- CN
- China
- Prior art keywords
- key frame
- frame image
- group
- forward reference
- 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.)
- Pending
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/169—Methods 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/17—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
- H04N19/176—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/102—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
- H04N19/103—Selection of coding mode or of prediction mode
- H04N19/105—Selection of the reference unit for prediction within a chosen coding or prediction mode, e.g. adaptive choice of position and number of pixels used for prediction
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/102—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
- H04N19/119—Adaptive subdivision aspects, e.g. subdivision of a picture into rectangular or non-rectangular coding blocks
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/50—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
- H04N19/503—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/50—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
- H04N19/593—Methods 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 coding method, a video coding device, computer equipment and a storage medium. Acquiring a key frame image, and determining a key frame group matched with the key frame image and a key frame refreshing group; the key frame refreshing group comprises a target number of forward reference frame images; dividing the key frame image into a target number of key frame macro blocks, and encoding each forward reference frame image in the key frame refreshing group according to each key frame macro block; and generating an encoded frame image according to each key frame macro block, and encoding other forward reference frame images except each forward reference frame image in the key frame refreshing group in the key frame group according to the encoded frame image. By using the technical scheme of the invention, the frame data code stream is smoother while the video coding quality is ensured.
Description
Technical Field
The embodiment of the invention relates to the technical field of data transmission and intelligent monitoring, in particular to a video coding method, a video coding device, computer equipment and a storage medium.
Background
With the development of intelligent monitoring technology, people pursue higher-quality visual experience, and the definition of images shot by shooting equipment is comprehensively improved.
In the video coding of the traditional IPPP structure, due to the existence of the I frame or IDR (Instantaneous Decoding Refresh) frame, if the amount of the I frame data is too large, the network load is increased during the transmission of the video data, the packet loss rate is increased, and the video effect presented after decoding at the decoding end is affected. The packet loss rate is reduced by reducing the data amount of the I frame, which results in the degradation of the definition of the I frame image, increases the coding error between the I frame and the P frame far away from the I frame, and causes the whole video data stream to periodically appear clear to fuzzy mutation, namely obvious respiratory effect.
Disclosure of Invention
The embodiment of the invention provides a video coding method, a video coding device, computer equipment and a storage medium, which are used for realizing that a frame data code stream is smoother while guaranteeing video coding quality.
In a first aspect, an embodiment of the present invention provides a video encoding method, including:
acquiring a key frame image, and determining a key frame group matched with the key frame image and a key frame refreshing group; the key frame refreshing group comprises a target number of forward reference frame images;
dividing the key frame image into a target number of key frame macro blocks, and encoding each forward reference frame image in the key frame refreshing group according to each key frame macro block;
and generating an encoded frame image according to each key frame macro block, and encoding other forward reference frame images except each forward reference frame image in the key frame refreshing group in the key frame group according to the encoded frame image.
In a second aspect, an embodiment of the present invention further provides a video encoding apparatus, including:
the key frame image acquisition module is used for acquiring a key frame image and determining a key frame group matched with the key frame image and a key frame refreshing group; the key frame refreshing group comprises a target number of forward reference frame images;
the key frame macro block coding module is used for dividing the key frame image into a target number of key frame macro blocks, and coding each forward reference frame image in the key frame refreshing group according to each key frame macro block;
and the encoding frame image encoding module is used for generating encoding frame images according to each key frame macro block, and encoding other forward reference frame images except each forward reference frame image in the key frame refreshing group in the key frame group according to the encoding frame images.
In a third aspect, an embodiment of the present invention further provides a computer device, including a memory, a processor, and a computer program stored on the memory and capable of running on the processor, where the processor implements the video encoding method according to any one of the embodiments of the present invention when executing the program.
In a fourth aspect, embodiments of the present invention also provide a storage medium containing computer-executable instructions, which when executed by a computer processor, are for performing a video encoding method according to any of the embodiments of the present invention.
The embodiment of the invention divides the key frame images into a target number of key frame macro blocks by determining the key frame groups and the key frame refreshing groups, codes the target number of forward reference frame images in the key frame refreshing groups by each key frame macro block, generates coded frame images according to each key frame macro block, and codes other forward reference frame images except the forward reference frame images in the key frame refreshing groups in the key frame groups according to the coded frame images. The method solves the problems that in the traditional video coding technology, if the I frame data quantity is too large, the packet loss rate is increased, the I frame data quantity is reduced, obvious respiratory effect is easy to occur, and the effect that the frame data code stream is smoother while the video coding quality is ensured is achieved.
Drawings
Fig. 1 is a flowchart of a video encoding method according to a first embodiment of the present invention;
fig. 2 is a flowchart of a video encoding method according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of a video encoding apparatus according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of a computer device in a fourth embodiment of the present invention.
Detailed Description
The invention is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting thereof. It should be further noted that, for convenience of description, only some, but not all of the structures related to the present invention are shown in the drawings.
Example 1
Fig. 1 is a flowchart of a video encoding method according to a first embodiment of the present invention, where the method is applicable to a case where a video encoding party encodes video data to be transmitted, and the method may be performed by a video encoding device, which may be implemented by software and/or hardware and is generally integrated in a video encoding apparatus.
As shown in fig. 1, the technical solution of the embodiment of the present invention specifically includes the following steps:
s110, acquiring a key frame image, and determining a key frame group matched with the key frame image and a key frame refreshing group.
The key frame refreshing group comprises a target number of forward reference frame images.
A key frame picture, i.e. an I-frame picture, i.e. an Intra-coded picture. In conventional video coding, an I-frame picture is the first frame of a group of key frames GOP (Group of Pictures ), which functions to compression encode the group of key frames.
In the embodiment of the invention, taking the frame structure of IPPP as an example, the video coding method is improved. Therefore, the key frame group in this embodiment includes a plurality of forward reference frame images, i.e., P-frame images, predictive-coded Picture (forward Predictive-coded image frame).
The key frame refreshing group is composed of a target number of P frame images sequentially selected from front to back in the key frame group, and if the key frame group contains 200P frame images and the target number is 5, 5P frame images are sequentially selected from front to back in the key frame group to serve as the key frame refreshing group.
Alternatively, an upper limit value and a lower limit value of the target number may be preset, and the value of the target number may be determined according to the data amount of the key frame image.
S120, dividing the key frame image into a target number of key frame macro blocks, and encoding each forward reference frame image in the key frame refreshing group according to each key frame macro block.
The number of key frame macroblocks, i.e., I-macroblocks, needs to be consistent with the number of P-frame pictures in the key frame refresh set in order to encode the P-frame pictures by the I-macroblocks. Similarly, an upper limit value and a lower limit value of the size of the I macroblock may be preset, and the size of the I macroblock may be determined according to the data amount of the I frame image, and the sizes of the I macroblocks may be the same or different.
Correspondingly, the key frame image can be equally divided into a target number of key frame macro blocks, or the key frame image can be divided into a target number of key frame macro blocks according to the motion area and the non-motion area, and the dividing mode of the key frame macro blocks is not limited in the embodiment.
When each divided key frame macro block is allocated to each forward reference frame image in the key frame refreshing group, the key frame macro blocks can be allocated according to the division sequence of each key frame macro block, or can be randomly allocated, and when the key frame macro block is divided according to the motion area and the non-motion area, the key frame macro blocks can be allocated according to whether the key frame macro block comprises the motion area or not, and the embodiment is not limited in this way.
The embodiment of the invention divides the I frame image originally inserted into the key frame group, distributes the divided I macro block to the P frame image in the key frame refreshing group for encoding, can avoid the problem of network packet loss or poor video quality caused by oversized or undersized I frame image, reduces code rate fluctuation and ensures smoother video code stream.
S130, generating coding frame images according to the key frame macro blocks, and coding other forward reference frame images except for the forward reference frame images in the key frame refreshing group in the key frame group according to the coding frame images.
And filling each I macro block for encoding the key frame refreshing group into an encoded frame image, and carrying out inter-frame reference encoding on the next forward reference frame image except each forward reference frame image in the key frame refreshing group through the generated encoded frame image.
In the embodiment of the invention, in order to ensure the accuracy in decoding, the filling sequence of each I macro block in the coded frame image is required to be consistent with the sequence of each I macro block allocated to the P frame image in the key frame refreshing group for coding.
The subsequent forward reference frame image adopts the existing coding method until all the forward reference frame images of the key frame group are coded. Illustratively, the MCP (Motion Compensation Prediction, motion compensated prediction) algorithm may be used to encode the subsequent forward reference frame image, but the present embodiment is not limited to a specific encoding manner.
According to the technical scheme of the embodiment, a key frame image is divided into a target number of key frame macro blocks by determining a key frame group and a key frame refreshing group, the target number of forward reference frame images in the key frame refreshing group are encoded by each key frame macro block, an encoded frame image is generated according to each key frame macro block, and other forward reference frame images except the forward reference frame images in the key frame refreshing group in the key frame group are encoded according to the encoded frame image. The method solves the problems that in the traditional video coding technology, if the I frame data quantity is too large, the packet loss rate is increased, the I frame data quantity is reduced, obvious respiratory effect is easy to occur, and the effect that the frame data code stream is smoother while the video coding quality is ensured is achieved.
Example two
Fig. 2 is a flowchart of a video coding method according to a second embodiment of the present invention, where the steps of dividing a key frame macroblock, coding each forward reference frame image in a key frame refresh group, generating a coded frame image according to each key frame macroblock, coding other forward reference frame images in the key frame group are further specified, generating custom information, and inserting a start key frame image stream are added on the basis of the above embodiments.
Correspondingly, as shown in fig. 2, the technical scheme of the embodiment of the invention specifically includes the following steps:
s210, acquiring a key frame image, and determining a key frame group matched with the key frame image and a key frame refreshing group.
In the embodiment of the invention, the length of the key frame refreshing group, namely the number of forward reference frame images in the key frame refreshing group, is determined according to the data quantity of the key frame images. The length of the key frame refresh group can be written in custom information, i.e., SEI (Supplemental Enhancement Information ) information, providing a way to add additional information to the video bitstream. The custom information is carried by the video code stream and sent to the video decoder for decoding by the video decoder.
S220, determining a motion area in the key frame image, and dividing the key frame image into a preset number of key frame macro blocks according to the motion area and a preset macro block size interval.
The moving region is a region containing a moving object, and the macroblock size interval is used to determine upper and lower limits of the macroblock size. Alternatively, the motion region in the key frame image may be detected according to the target detection algorithm, but the present embodiment does not limit the manner of determining the motion region in the key frame image. After the moving region and the non-moving region are divided in the key frame image, the key frame macro block may be divided according to the macro block size section.
For example, if the preset number is 4, moving object detection is performed on the key frame image to obtain two moving areas a and B, and then the other areas except for the areas a and B in the key frame image are divided into two parts, so as to obtain non-moving areas C and D. If both A, B, C and D are within the macroblock size interval, A, B, C and D are determined directly as four key frame macroblocks. If the size of the motion area a is smaller than the lower limit value of the macroblock size, the sizes of the motion area B and the non-motion areas C and D are both within the macroblock size interval, then the partial areas connected with the motion area a can be divided into the motion area a in the areas of C and/or D, so that the sizes of the divided motion area a, the non-motion areas C and D can be within the macroblock size interval. The present embodiment does not limit the manner of dividing the key frame image into the key frame macro blocks according to the motion area, the macro block size section and the preset number.
S230, sorting the key frame macro blocks according to whether the key frame macro blocks contain motion areas and the positions of the key frame macro blocks.
In the embodiment of the invention, after the key frame macro block is divided into the macro block containing the motion area and the macro block not containing the motion area, the key frame macro blocks can be further sequenced through the attention model. The essence of the attention model is to locate the information of interest, suppressing the garbage. Specifically, the embodiment of the invention can take the central position of the key frame image as the region of interest through a Gaussian model to diffuse to the periphery. Thus, the order of the key frames can be divided into a central motion region, a peripheral motion region, a central non-motion region, and a peripheral non-motion region.
In the embodiment of the invention, the motion area and the position of each key frame macro block are divided and sequenced in sequence, and the aim is to code each forward reference frame image in sequence according to the sequence of each key frame macro block, thereby reducing the coding error and smoothing the coded code stream.
S240, sequentially distributing each key frame macro block to each forward reference frame image in the key frame refreshing group for encoding according to the sequence of each key frame macro block.
Since the number of the key frame macro blocks is consistent with the number of the forward reference frame images in the key frame refreshing group, after the key frame macro blocks are ordered, the key frame macro blocks can be sequentially distributed to the forward reference frame images in the key frame refreshing group for encoding according to the sequence of the key frame macro blocks.
S250, splicing the key frame macro blocks according to the sequence of the key frame macro blocks to generate an encoded frame image.
In the embodiment of the invention, after the encoding of each forward reference frame image is completed in sequence, each key frame macro block is spliced into an encoded frame image according to the sequence of each key frame macro block.
Optionally, a buffer memory of the coded frame image may be generated, and each time the coded frame image is coded according to the key frame macro block, the key frame macro block is filled into the coded frame image until the coding of each forward reference frame image in the key frame refreshing group is completed, and the coded frame image is completely filled. The present embodiment does not limit the generation manner of the encoded frame image.
And S260, according to the coded frame image, coding a first forward reference frame image except each forward reference frame image in the key frame refreshing group in the key frame group.
And for other forward reference frame images except the key frame refreshing group in the key frame group, encoding the first forward reference frame image according to the generated encoding frame image.
S270, encoding each forward reference frame image after the first forward reference frame image in a forward prediction mode.
And encoding other forward reference frame images after the first forward reference frame image by adopting the existing forward prediction method until all the forward reference frame images in the key frame group are encoded.
S280, generating custom information according to the sequence of each key frame macro block in the coded frame image.
In the embodiment of the invention, after all forward reference frame images are coded, semantic coding is carried out on the sequence of each key frame macro block, and then the semantic coding is written into the custom information.
Alternatively, the sequence of the key frame macro blocks in the encoded frame image may be added to the custom information after the key frame macro blocks are encoded according to the key frame macro blocks and the encoded frame image every time, which is not limited in this embodiment.
And S290, transmitting the custom information and the encoded video to a decoding party so that the decoding party decodes the encoded video according to the custom information.
Accordingly, S290 may further include:
s291, determining a first key frame group in the video.
In the embodiment of the invention, each frame image of the video is divided into a first forward reference frame image and a plurality of key frame groups, and for each key frame group, the S210-S270 mode is adopted for coding, and the key frame coding is carried out on the first forward reference frame image, namely, the IDR coding mode is adopted for the first forward reference frame in each frame image of the video, thereby realizing the streaming of the video.
And S292, performing key frame coding on the first forward reference frame image before the first key frame group so as to realize the streaming of the video.
The streaming mode in the embodiment of the invention can ensure that the video streaming is normal without delay.
And S293, transmitting the custom information to a decoder along with the video stream.
Optionally, when the video decoding side receives the video code stream, if the key frame group has the packet loss condition, the error concealment algorithm can be used for recovering the reconstructed encoded frame, so that the decoding is normally performed, and the packet loss resistance of the video decoding side is improved.
The principle of the error concealment algorithm is that when a certain forward reference frame image in a video code stream is lost, a macro block of a forward reference frame image of the forward reference frame image can be directly copied, and a coding frame is reconstructed to realize error concealment.
According to the technical scheme of the embodiment, key frame images are divided into a target number of key frame macro blocks according to a motion area through determining a key frame group and a key frame refreshing group, each key frame macro block is sequenced according to whether each key frame macro block contains the motion area or not and the positions of each key frame macro block, each key frame macro block is sequentially distributed to the target number of forward reference frame images in the key frame refreshing group according to the sequence to encode, the sequence of each key frame macro block is spliced to generate encoded frame images, the first forward reference frame images except the forward reference frame images in the key frame refreshing group in the key frame group are encoded according to the encoded frame images, and then other forward reference frame images are encoded in a forward encoding mode. The method solves the problems that in the traditional video coding technology, if the I frame data quantity is too large, the packet loss rate is increased, the I frame data quantity is reduced, obvious respiratory effect is easy to occur, and the effect that the frame data code stream is smoother while the video coding quality is ensured is achieved.
Example III
Fig. 3 is a schematic structural diagram of a video encoding apparatus according to a third embodiment of the present invention, where the apparatus is disposed in a video encoding device, and the apparatus includes: a key frame image acquisition module 310, a key frame macroblock encoding module 320, and an encoded frame image encoding module 330. Wherein:
a key frame image acquisition module 310, configured to acquire a key frame image, and determine a key frame group and a key frame refresh group that are matched with the key frame image; the key frame refreshing group comprises a target number of forward reference frame images;
a key frame macro block coding module 320, configured to divide the key frame image into a target number of key frame macro blocks, and code each forward reference frame image in the key frame refresh group according to each key frame macro block;
the encoded frame image encoding module 330 is configured to generate an encoded frame image according to each key frame macroblock, and encode, according to the encoded frame image, other forward reference frame images in the key frame group except for each forward reference frame image in the key frame refresh group.
According to the technical scheme of the embodiment, a key frame image is divided into a target number of key frame macro blocks by determining a key frame group and a key frame refreshing group, the target number of forward reference frame images in the key frame refreshing group are encoded by each key frame macro block, an encoded frame image is generated according to each key frame macro block, and other forward reference frame images except the forward reference frame images in the key frame refreshing group in the key frame group are encoded according to the encoded frame image. The method solves the problems that in the traditional video coding technology, if the I frame data quantity is too large, the packet loss rate is increased, the I frame data quantity is reduced, obvious respiratory effect is easy to occur, and the effect that the frame data code stream is smoother while the video coding quality is ensured is achieved.
On the basis of the above embodiment, the key frame macroblock encoding module 320 includes:
the key frame image dividing unit is used for determining a motion area in the key frame image and dividing the key frame image into a preset number of key frame macro blocks according to the motion area and a preset macro block size interval.
On the basis of the above embodiment, the key frame macroblock encoding module 320 includes:
the key frame macro block ordering unit is used for ordering each key frame macro block according to whether each key frame macro block contains a motion area and the position of each key frame macro block;
and the key frame macro block coding unit is used for sequentially distributing each key frame macro block to each forward reference frame image in the key frame refreshing group for coding according to the sequence of each key frame macro block.
On the basis of the above embodiment, the encoding frame image encoding module 330 includes:
and the key frame macro block splicing unit is used for splicing the key frame macro blocks according to the sequence of the key frame macro blocks to generate an encoded frame image.
On the basis of the above embodiment, the encoding frame image encoding module 330 includes:
a first encoding unit, configured to encode, according to the encoded frame image, a first forward reference frame image in the key frame group except for each forward reference frame image in the key frame refresh group;
and the second coding unit is used for coding each forward reference frame image after the first forward reference frame image in a forward prediction mode.
On the basis of the above embodiment, the apparatus further includes:
the custom information generation module is used for generating custom information according to the sequence of each key frame macro block in the coded frame image;
and the data transmitting module is used for transmitting the custom information and the encoded video to a decoding party so that the decoding party decodes the encoded video according to the custom information.
Based on the above embodiment, the data sending module is specifically configured to:
determining a first key frame group in the video;
performing key frame coding on a first forward reference frame image before a first key frame group so as to realize the streaming of the video;
and sending the custom information to a decoder along with the video stream.
The video coding device provided by the embodiment of the invention can execute the video coding method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
Example IV
Fig. 4 is a schematic structural diagram of a computer device according to a fourth embodiment of the present invention, and as shown in fig. 4, the computer device includes a processor 70, a memory 71, an input device 72 and an output device 73; the number of processors 70 in the computer device may be one or more, one processor 70 being taken as an example in fig. 4; the processor 70, memory 71, input means 72 and output means 73 in the computer device may be connected by a bus or other means, in fig. 4 by way of example.
The memory 71 is a computer readable storage medium, and may be used to store software programs, computer executable programs, and modules, such as modules corresponding to the video encoding method in the embodiment of the present invention (for example, the key frame image acquisition module 310, the key frame macroblock encoding module 320, and the encoded frame image encoding module 330 in the video encoding apparatus). The processor 70 executes various functional applications of the computer device and data processing, i.e., implements the video encoding method described above, by running software programs, instructions and modules stored in the memory 71. The method comprises the following steps:
acquiring a key frame image, and determining a key frame group matched with the key frame image and a key frame refreshing group; the key frame refreshing group comprises a target number of forward reference frame images;
dividing the key frame image into a target number of key frame macro blocks, and encoding each forward reference frame image in the key frame refreshing group according to each key frame macro block;
and generating an encoded frame image according to each key frame macro block, and encoding other forward reference frame images except each forward reference frame image in the key frame refreshing group in the key frame group according to the encoded frame image.
The memory 71 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, at least one application program required for functions; the storage data area may store data created according to the use of the terminal, etc. In addition, memory 71 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid-state storage device. In some examples, memory 71 may further include memory remotely located relative to processor 70, which may be connected to the computer device 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 input device 72 may be used to receive entered numeric or character information and to generate key signal inputs related to user settings and function control of the computer device. The output means 73 may comprise a display device such as a display screen.
Example five
A fifth embodiment of the present invention also provides a storage medium containing computer-executable instructions, which when executed by a computer processor, are for performing a video encoding method, the method comprising:
acquiring a key frame image, and determining a key frame group matched with the key frame image and a key frame refreshing group; the key frame refreshing group comprises a target number of forward reference frame images;
dividing the key frame image into a target number of key frame macro blocks, and encoding each forward reference frame image in the key frame refreshing group according to each key frame macro block;
and generating an encoded frame image according to each key frame macro block, and encoding other forward reference frame images except each forward reference frame image in the key frame refreshing group in the key frame group according to the encoded frame image.
Of course, the storage medium containing the computer executable instructions provided in the embodiments of the present invention is not limited to the method operations described above, and may also perform the related operations in the video encoding method provided in any embodiment of the present invention.
From the above description of embodiments, it will be clear to a person skilled in the art that the present invention may be implemented by means of software and necessary general purpose hardware, but of course also by means of hardware, although in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a FLASH Memory (FLASH), a hard disk or an optical disk of a computer, etc., and include several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the embodiments of the present invention.
It should be noted that, in the embodiment of the video encoding apparatus, each unit and module included are only divided according to the functional logic, but not limited to the above-mentioned division, so long as the corresponding functions can be implemented; in addition, the specific names of the functional units are also only for distinguishing from each other, and are not used to limit the protection scope of the present invention.
Note that the above is only a preferred embodiment of the present invention and the technical principle applied. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, while the invention has been described in connection with the above embodiments, the invention is not limited to the embodiments, but may be embodied in many other equivalent forms without departing from the spirit or scope of the invention, which is set forth in the following claims.
Claims (10)
1. A video encoding method, comprising:
acquiring a key frame image, and determining a key frame group matched with the key frame image and a key frame refreshing group; the key frame refreshing group comprises a target number of forward reference frame images;
dividing the key frame image into a target number of key frame macro blocks, and encoding each forward reference frame image in the key frame refreshing group according to each key frame macro block;
and generating an encoded frame image according to each key frame macro block, and encoding other forward reference frame images except each forward reference frame image in the key frame refreshing group in the key frame group according to the encoded frame image.
2. The method of claim 1, wherein dividing the key frame image into a target number of key frame macro-blocks comprises:
and determining a motion area in the key frame image, and dividing the key frame image into a preset number of key frame macro blocks according to the motion area and a preset macro block size interval.
3. The method of claim 2, wherein encoding each forward reference frame image in the keyframe refresh set from each keyframe macroblock comprises:
sequencing each key frame macro block according to whether each key frame macro block contains a motion area and the position of each key frame macro block;
and sequentially distributing each key frame macro block to each forward reference frame image in the key frame refreshing group for encoding according to the sequence of each key frame macro block.
4. A method according to claim 3, wherein generating an encoded frame image from each key frame macroblock comprises:
and splicing the key frame macro blocks according to the sequence of the key frame macro blocks to generate an encoded frame image.
5. The method of claim 1, wherein encoding, from the encoded frame image, other forward reference frame images in the key frame group than each forward reference frame image in the key frame refresh group, comprises:
encoding a first forward reference frame image in the key frame group except for each forward reference frame image in the key frame refreshing group according to the encoded frame image;
and encoding each forward reference frame image after the first forward reference frame image in a forward prediction mode.
6. The method according to any one of claims 1-5, further comprising, after encoding the other forward reference frame pictures in the key frame group than the forward reference frame pictures in the key frame refresh group:
generating custom information according to the sequence of each key frame macro block in the coded frame image;
and transmitting the custom information and the encoded video to a decoding party so that the decoding party decodes the encoded video according to the custom information.
7. The method of claim 6, wherein transmitting the custom information and the encoded video to a decoder comprises:
determining a first key frame group in the video;
performing key frame coding on a first forward reference frame image before a first key frame group so as to realize the streaming of the video;
and sending the custom information to a decoder along with the video stream.
8. A video encoding apparatus, comprising:
the key frame image acquisition module is used for acquiring a key frame image and determining a key frame group matched with the key frame image and a key frame refreshing group; the key frame refreshing group comprises a target number of forward reference frame images;
the key frame macro block coding module is used for dividing the key frame image into a target number of key frame macro blocks, and coding each forward reference frame image in the key frame refreshing group according to each key frame macro block;
and the encoding frame image encoding module is used for generating encoding frame images according to each key frame macro block, and encoding other forward reference frame images except each forward reference frame image in the key frame refreshing group in the key frame group according to the encoding frame images.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the video encoding method of any of claims 1-7 when the program is executed by the processor.
10. A storage medium containing computer executable instructions which, when executed by a computer processor, are for performing the video encoding method of any of claims 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111493884.5A CN116248890A (en) | 2021-12-08 | 2021-12-08 | Video coding method, device, computer equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111493884.5A CN116248890A (en) | 2021-12-08 | 2021-12-08 | Video coding method, device, computer equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116248890A true CN116248890A (en) | 2023-06-09 |
Family
ID=86624756
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111493884.5A Pending CN116248890A (en) | 2021-12-08 | 2021-12-08 | Video coding method, device, computer equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116248890A (en) |
-
2021
- 2021-12-08 CN CN202111493884.5A patent/CN116248890A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112040233B (en) | Video encoding method, video decoding method, video encoding device, video decoding device, electronic device, and storage medium | |
US12052427B2 (en) | Video data processing method and apparatus, and storage medium | |
WO2016131223A1 (en) | Frame loss method for video frame and video sending apparatus | |
WO2021114846A1 (en) | Video noise cancellation processing method and apparatus, and storage medium | |
KR20200003715A (en) | Method and system for encoding video with overlay | |
CN110392284B (en) | Video encoding method, video data processing method, video encoding apparatus, video data processing apparatus, computer device, and storage medium | |
CN112333448B (en) | Video encoding method and apparatus, video decoding method and apparatus, electronic device, and storage medium | |
KR20140085492A (en) | Signaling of state information for a decoded picture buffer and reference picture lists | |
US8660191B2 (en) | Software video decoder display buffer underflow prediction and recovery | |
CN109688407B (en) | Reference block selection method and device for coding unit, electronic equipment and storage medium | |
CN112351285B (en) | Video encoding method, video decoding method, video encoding device, video decoding device, electronic equipment and storage medium | |
CN109963176B (en) | Video code stream processing method and device, network equipment and readable storage medium | |
JP2007507128A (en) | Video picture encoding and decoding with delayed reference picture refresh | |
CN115134629A (en) | Video transmission method, system, device and storage medium | |
CN117714700A (en) | Video coding method, device, equipment, readable storage medium and product | |
CN112040234B (en) | Video encoding method, video decoding method, video encoding device, video decoding device, electronic equipment and storage medium | |
CN110784717B (en) | Encoding method, encoding device, electronic equipment and storage medium | |
CN104168482B (en) | A kind of video coding-decoding method and device | |
WO2023024832A1 (en) | Data processing method and apparatus, computer device and storage medium | |
CN115297343B (en) | Video data sending method and device and electronic equipment | |
CN116248890A (en) | Video coding method, device, computer equipment and storage medium | |
CN113366842A (en) | System and method for content layer based video compression | |
CN115834906A (en) | Video encoding and decoding method and device, electronic equipment and medium | |
CN112738508A (en) | Video coding method, video determining method, video processing method, server and VR terminal | |
CN111212288A (en) | Video data encoding and decoding method and device, computer equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |