Video coding method and device
Technical Field
The present invention relates to the field of video processing technologies, and in particular, to a video encoding method and apparatus.
Background
With the rapid development of computing technology and network technology, video technologies including digital television broadcasting, video communication, video monitoring and the like are widely applied. The large amount of information in video signals, especially high-definition video which is increasingly popular, puts a great pressure on transmission and storage. To solve this problem, video encoding and decoding techniques are required to remove redundant information of digital image signal sequences by means of an encoding algorithm. But various noises are introduced in the process of taking digital images, and the video coding efficiency is influenced. To remove these noises, modern video applications, including surveillance systems, Introduce Signal Processors (ISPs), i.e. Image single processors. The well designed ISP module is beneficial to filtering noise interference, improving the efficiency of the video encoder codec and enhancing the subjective quality of the encoded video. The signal processor ISP and the video encoder codec focus on different targets, and a general video application system tends to split the two modules and design their functions independently. However, since the signal processor ISP and the video encoder codec are closely connected modules in a system, the design takes the mutual influence between the signal processor ISP and the video encoder codec into consideration as a whole, rather than performing separate functional design, and thus better performance can be obtained as a whole.
Disclosure of Invention
Embodiments of the present invention provide a video encoding method and apparatus.
In a first aspect, an embodiment of the present invention provides a video encoding method, including:
the encoder acquires first video information from the video code stream and feeds the first video information back to the signal processor;
the signal processor performs video signal processing according to the first video information fed back by the encoder.
Further, the video encoding method further includes:
the signal processor provides second video information to the encoder according to the result of the video signal processing;
the encoder performs video encoding based on the second video information provided by the signal processor.
In a second aspect, an embodiment of the present invention further provides a video encoding apparatus, including an encoder and a signal processor, where:
the encoder comprises a first video information feedback unit, a signal processor and a second video information feedback unit, wherein the first video information feedback unit is used for acquiring first video information from a video code stream and feeding the first video information back to the signal processor;
the signal processor comprises a video signal processing unit which is used for carrying out video signal processing according to the first video information fed back by the first video information feedback unit.
Further, the signal processor further includes a second video information providing unit for providing second video information to an encoder according to a result of the video signal processing by the video signal processing unit;
the encoder further comprises a video encoding unit for video encoding according to the second video information provided by the second video information providing unit.
The invention proposes to jointly design the signal processor ISP and the video encoder codec in a video application or system, namely, mutual feedback is formed between the ISP and the codec, and the overall performance is improved by the feedback information provided by one party to the other party.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments of the present invention will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the contents of the embodiments of the present invention and the drawings without creative efforts.
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 block diagram of a video encoding apparatus according to a third embodiment of the present invention;
fig. 4 is a block diagram of a video encoding apparatus according to a fourth embodiment of the present invention.
Detailed Description
In order to make the technical problems solved, technical solutions adopted and technical effects achieved by the present invention clearer, the technical solutions of the embodiments of the present invention will be described in further detail below with reference to the accompanying drawings, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all 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.
The technical scheme of the invention is further explained by the specific implementation mode in combination with the attached drawings.
Example one
Fig. 1 is a flowchart of a video encoding method according to a first embodiment of the present invention. Referring to fig. 1, the video encoding method according to this embodiment includes the following steps:
s101, an encoder acquires first video information from a video code stream and feeds the first video information back to a signal processor;
the video code stream contains abundant video information, wherein the motion information is the most common video information in the video processing process. The present embodiment is described by taking motion information as an example, but the present invention is only exemplary and not limited thereto, and those skilled in the art can understand that which video information is to be extracted from a video bitstream can be selected according to the purpose or requirement of jointly designing an encoder and a signal processor.
Motion information, such as motion vector magnitude, can reflect changes in the position of certain objects or regions in the video over time. The encoder acquires motion information from a video code stream as the first video information, and then feeds back the acquired first video information to the signal processor.
S102, the signal processor carries out video signal processing according to the first video information fed back by the encoder.
The signal processor receives said first video information, e.g. motion information, from the encoder, and may then perform video signal processing operations based on said information fed back from the encoder. For example, the signal processor may identify moving objects in the current video as well as a static background from the motion information received from the encoder. Therefore, the signal processor fully utilizes the information fed back from the encoder to perfect the processing function of the signal processor, the joint function design of the signal processor and the encoder is realized, compared with the prior art in which the signal processor and the encoder are independently designed, the potential mutual influence between the signal processor and the encoder is considered, the function of the signal processor is perfected by utilizing the potential influence, and the overall performance of the system is correspondingly improved.
Example two
Fig. 2 is a flowchart of a video encoding method according to this embodiment, and as shown in fig. 2, the video encoding method according to this embodiment includes the following steps:
s201, an encoder acquires first video information from a video code stream and feeds the first video information back to a signal processor;
s202, the signal processor carries out video signal processing according to the first video information fed back by the encoder;
steps S201 and S202 are the same as S101 and S102 in the first embodiment, respectively, and refer to the description of the first embodiment specifically.
S203, the signal processor provides second video information to the encoder according to the video signal processing result;
as can be seen from the foregoing description, in step S202, the signal processor identifies a moving object and a static background from the current video according to the first video information, such as the motion information, fed back by the encoder. Further, because there is a difference in the reason that noise is generated in the moving object and the static background portion, in order to improve the overall signal-to-noise ratio, the signal processor may perform noise reduction by using different methods for the identified moving object and static background portion, respectively. Thus, targeted noise reduction processing is performed according to respective noise characteristics of the moving object and the static background region, so that the targeted noise reduction method can obtain a better signal-to-noise ratio compared with the case that the moving object and the static background region are used as a large overall region to be subjected to unified noise reduction processing. After the above-described processing, the noise-reduced video signal is supplied as second video information to the encoder.
And S204, the encoder performs video coding according to the second video information provided by the signal processor.
Since the noise reduction processing has been performed on the moving object region and the static background region in step S203, respectively, the encoder can achieve higher compression ratio and encoding efficiency by performing video encoding on the noise-reduced video signal. Alternatively, the steps S203 and S204 can also be implemented in the following manner:
s203, the signal processor provides second video information to the encoder according to the video signal processing result;
moving objects and static backgrounds have been identified from the current video in the previous step, and will typically have different quality level requirements for both due to the difference between moving and static areas, which may have a significant impact on subsequent encoding. For example, in a typical application scene of video surveillance, during license plate recognition, a captured original image usually includes not only a license plate region but also other objects around the license plate, and for the purpose of license plate recognition, the fidelity of the encoded license plate region is required to be higher than that of other regions, that is, the requirement on the quality level of the license plate region is higher than that of other regions. Accordingly, the quantization step size of the video coding in the region corresponding to the license plate is generally smaller than that of other regions, and the code rate allocation is generally higher than that of other regions. In order to make the subsequent video encoding operation more specific, a plurality of different quality levels can be respectively adopted by the signal processor for the moving object or each part of the moving object and the static background for identification, and then the quality level identification information is provided to the subsequent encoder as the second video information.
And S204, the encoder performs video coding according to the second video information provided by the signal processor.
When the encoder receives the second video information provided by the signal processor, namely the identification information of different quality levels marked aiming at the moving object or each part of the moving object and the static background, the encoder can allocate targeted and different quantization step sizes and code rates to the moving object or each part of the moving object and the static background according to the different quality levels, and then carry out video coding according to the allocated quantization step sizes and code rates. By the method, the size of video coding can be reduced as much as possible on the premise of considering the quality levels of the motion area and the static area, the efficiency of video coding is improved, and the requirement of video application is met. After completion of step S204, it may continue to return to step S201 to continue the next processing loop until all encoding is completed.
EXAMPLE III
Fig. 3 is a block diagram of a video encoding apparatus according to this embodiment, and as shown in fig. 3, the video encoding apparatus according to this embodiment includes: the encoder comprises a signal processor 301 and an encoder 302, wherein the encoder comprises a first video information feedback unit 3021, which is used for acquiring first video information from a video code stream and feeding the first video information back to the signal processor 301; the signal processor includes a video signal processing unit 3011, configured to perform video signal processing according to the first video information fed back by the first video information feedback unit 3021.
Preferably, the first video information obtained by the first video information feedback unit 3021 from the video code stream is motion information; the video signal processing unit 3011 performs video signal processing according to the first video information fed back by the first video information feedback unit 3021, and includes: and identifying a moving object and a static background in the video according to the motion information.
The video encoding apparatus provided in this embodiment can execute the video encoding method provided in the first embodiment of the present invention, and has functional modules and advantageous effects corresponding to those of the method.
Example four
Fig. 4 is a block diagram of a video encoding apparatus according to this embodiment, and as shown in fig. 4, the video encoding apparatus according to this embodiment includes: the encoder comprises a first video information feedback unit 4021, and is configured to acquire first video information from a video code stream and feed the first video information back to the signal processor 401; the signal processor comprises a video signal processing unit 4011, configured to perform video signal processing according to the first video information fed back by the first video information feedback unit 4021; further, the signal processor further includes a second video information providing unit 4012 for providing second video information to an encoder according to a result of the video signal processing by the video signal processing unit 4011; the encoder further comprises a video encoding unit 4022, configured to perform video encoding according to the second video information provided by the second video information providing unit 4012.
Preferably, the first video information obtained by the first video information feedback unit 4021 from the video code stream is motion information; the video signal processing unit 4011 performs video signal processing according to the first video information fed back by the first video information feedback unit 4021, and includes: and identifying a moving object and a static background in the video according to the motion information.
Preferably, the second video information providing unit 4012 provides second video information to an encoder according to a result of the video signal processing by the video signal processing unit 4011, including: the second video information providing unit 4012 performs noise reduction on the moving object and the static background by using different methods, and provides the video signal subjected to noise reduction as second video information to the encoder; the video encoding unit 4022 performs video encoding according to the second video information provided by the second video information providing unit 4012, and includes: the video encoding unit 4022 performs video encoding based on the noise-reduced video signal.
Alternatively, the second video information providing unit 4012 provides second video information to an encoder according to a result of the video signal processing by the video signal processing unit 4011, including: the second video information providing unit 4012 identifies moving objects or portions of moving objects and static backgrounds by using different quality levels, respectively, and provides the quality level identification information as second video information to an encoder; the video encoding unit 4022 performs video encoding according to the second video information provided by the second video information providing unit 4012, and includes: the video encoding unit 4022 allocates a quantization step size and a code rate according to the quality level identification information, and performs video encoding according to the quantization step size and the code rate.
The video encoding apparatus provided in this embodiment can execute the video encoding method provided in the third embodiment of the present invention, and has functional modules and advantageous effects corresponding to those of the method.
All or part of the technical solutions provided by the above embodiments may be implemented by software programming or dedicated hardware devices, where the software program is stored in a readable storage medium, for example: hard, optical, or floppy disks in computers; the dedicated hardware device may be an ASIC, FPGA, SoC, or IP Core with corresponding circuitry.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. 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, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.