CN112312134B - Encoding method, encoding device, electronic equipment and readable storage medium - Google Patents

Encoding method, encoding device, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN112312134B
CN112312134B CN201910708331.3A CN201910708331A CN112312134B CN 112312134 B CN112312134 B CN 112312134B CN 201910708331 A CN201910708331 A CN 201910708331A CN 112312134 B CN112312134 B CN 112312134B
Authority
CN
China
Prior art keywords
rate control
control strategy
code rate
video
encoding
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910708331.3A
Other languages
Chinese (zh)
Other versions
CN112312134A (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.)
Hangzhou Hikvision Digital Technology Co Ltd
Original Assignee
Hangzhou Hikvision Digital Technology 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 Hangzhou Hikvision Digital Technology Co Ltd filed Critical Hangzhou Hikvision Digital Technology Co Ltd
Priority to CN201910708331.3A priority Critical patent/CN112312134B/en
Publication of CN112312134A publication Critical patent/CN112312134A/en
Application granted granted Critical
Publication of CN112312134B publication Critical patent/CN112312134B/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/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
    • H04N19/176Methods 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
    • 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/102Methods 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/124Quantisation
    • 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/146Data rate or code amount at the encoder output

Landscapes

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

Abstract

The application provides an encoding method, an encoding device, an electronic device and a readable storage medium, wherein the method comprises the following steps: determining a scene state of a video to be coded; determining a code rate control strategy matched with the scene state; and coding the video to be coded according to the code rate control strategy. The method can improve the flexibility of code rate control.

Description

Encoding method, encoding device, electronic equipment and readable storage medium
Technical Field
The present application relates to video monitoring technologies, and in particular, to an encoding method, an encoding device, an electronic device, and a readable storage medium.
Background
The variable-rate coding means that a certain range of QPs (Quantization parameters) such as 18 to 40 is provided for coding, and a maximum code rate such as 2Mbps is set. Initially, the code stream is encoded using a minimum QP (e.g., QP = 18) within a set range, and after the encoding is completed, a code rate is estimated according to the size of the current frame. If the code rate does not exceed the set maximum code rate, continuing to use the QP for coding; if the code rate exceeds the set maximum code rate, a larger QP is used to encode the next frame. If the code rate still exceeds the set maximum code rate when the maximum QP (for example, QP = 40) within the set range is encoded, the maximum QP within the set range is used for encoding.
Practice shows that the code rate control strategy in the variable code rate coding scheme is too single and has lower flexibility.
Disclosure of Invention
In view of the above, the present application provides an encoding method, an apparatus, an electronic device and a readable storage medium.
Specifically, the method is realized through the following technical scheme:
according to a first aspect of embodiments of the present application, there is provided an encoding method, including:
determining a scene state of a video to be coded;
determining a code rate control strategy matched with the scene state;
and coding the video to be coded according to the code rate control strategy.
According to a second aspect of embodiments of the present application, there is provided an encoding apparatus including:
the first determining unit is used for determining the scene state of the video to be coded;
a second determining unit, configured to determine a rate control policy that matches the scene state;
and the coding unit is used for coding the video to be coded according to the code rate control strategy.
According to a third aspect of the embodiments of the present application, an electronic device is provided, which includes a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus;
a memory for storing a computer program;
and the processor is used for realizing the coding method when executing the program stored in the memory.
According to a fourth aspect of embodiments of the present application, there is provided a computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, and when being executed by a processor, the computer program implements the above encoding method.
According to the coding method, the scene state of the video to be coded is determined, the rate control strategy matched with the scene state is determined, and then the video to be coded is coded according to the rate control strategy, so that the flexibility of rate control in a variable rate coding implementation scheme is improved.
Drawings
Fig. 1 is a flow chart illustrating an encoding method according to an exemplary embodiment of the present application;
fig. 2 is a schematic structural diagram of an encoding apparatus according to an exemplary embodiment of the present application;
fig. 3 is a schematic structural diagram of an encoding apparatus according to another exemplary embodiment of the present application;
fig. 4 is a schematic structural diagram of an encoding apparatus according to another exemplary embodiment of the present application;
fig. 5 is a schematic diagram of a hardware structure of an electronic device according to an exemplary embodiment of the present application.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the application, as detailed in the appended claims.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this application and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
In order to make the technical solutions provided in the embodiments of the present application better understood and make the above objects, features, and advantages of the embodiments of the present application more obvious and understandable by those skilled in the art, the technical solutions in the embodiments of the present application are further described in detail below with reference to the accompanying drawings.
Referring to fig. 1, a flowchart of an encoding method provided in an embodiment of the present application is shown, where the encoding method may be applied to a device with a Video encoding function, such as a Video surveillance front-end device (e.g., an IPC (Internet Protocol Camera)) or a Video surveillance back-end device (e.g., a DVR (Digital Video Recorder)), and as shown in fig. 1, the encoding method may include the following steps:
for convenience of description and understanding, the following description will be given taking the execution subject of step S100 to step S120 as an example of the encoding apparatus.
And S100, determining the scene state of the video to be coded.
And step S110, determining a code rate control strategy matched with the scene state.
In the embodiment of the application, in order to improve the flexibility of rate control in the implementation scheme of variable rate coding, different rate control strategies can be provided for videos in different scene states by combining the scene states of the video to be coded.
When the coding device adopts the variable bit rate coding technology to carry out video coding, the scene state of the video to be coded can be determined firstly.
For example, the scene state of the video to be encoded may include a still state or a motion state.
In one example, an encoding device may divide a video picture of a video to be encoded into a preset number of sub-blocks. For any sub-block in any video frame, the encoding device compares the sub-block with a sub-block at the same position in the previous video frame, and if the content (such as Y value (brightness value)) of the sub-block changes, the scene in the sub-block is determined to be in a motion state (the sub-block is in the motion state); otherwise, the scene in the sub-block is determined to be in a static state (the sub-block is a static sub-block).
For example, when the proportion of the sub-blocks in the video frame in the still state (the ratio of the sub-blocks in the video frame in the still state to the total number of the sub-blocks in the video frame) exceeds a preset proportion threshold and the duration reaches a preset time threshold, the scene state of the video is determined to be the still state.
It should be appreciated that the above implementation manner for determining the scene state of the video to be the static state or the motion state is only one specific example in the embodiment of the present application, and does not limit the scope of the present application, and in the embodiment of the present application, the scene state of the video may also be determined to be the static state or the motion state in other manners, for example, for an encoding device supporting motion detection, the scene state of the video may be determined in a manner of motion detection, or for an encoding device supporting intelligent detection, the scene state of the video may be determined based on intelligent detection information, and a specific implementation thereof is not described herein again.
In the embodiment of the application, when the coding device determines the scene state of the video to be coded, the code rate control strategy matched with the scene state can be determined based on the scene state.
Illustratively, when the scene state of the video to be coded is a static state or a motion state, the matched rate control strategies are different.
And step S120, coding the video to be coded according to the determined code rate control strategy.
In the embodiment of the application, when the coding device determines the rate control strategy matched with the scene state of the video to be coded, the video to be coded can be coded according to the rate control strategy.
It can be seen that, in the method flow shown in fig. 1, by introducing a scene state into the variable rate coding implementation scheme, a matched rate control strategy is determined according to the scene state of the video to be coded, instead of adopting a single rate control strategy, so that the flexibility of rate control is improved.
As a possible implementation manner, the determining a rate control policy matching a scene state may include:
if the scene state is a static state, determining a code rate control strategy matched with the scene state as a first code rate control strategy;
wherein the second quantization parameter QP is greater than the first QP;
the first QP is the QP used for coding the key frame determined according to the first rate control strategy, and the second QP is the QP used for coding the non-key frame determined according to the first rate control strategy; or the first QP bit is the code rate used for coding the macro block in the motion state in the video frame determined according to the first code rate control strategy, and the second QP bit is the QP used for coding the macro block in the static state in the video frame determined according to the first code rate control strategy.
For example, when the coding device performs rate control on the video to be coded, frame-level control or macroblock-level control may be used.
In one example, assuming that frame level control is adopted, since a non-key frame (hereinafter, referred to as a P frame as an example) usually retains most details of a key frame (hereinafter, referred to as an example as an I frame) when a scene state is a static state, the image quality of the P frame is appropriately reduced with little influence on the overall image quality on the premise of ensuring the image quality of the I frame, and therefore, when the scene state is the static state, the difference between a QP used when the I frame is encoded and a QP used when the P frame is encoded can be appropriately increased (the latter is larger).
For example, when the scene state of the video to be encoded is a static state, the encoding device may encode the I frame using a first QP, and encode the P frame using a second QP that is greater than the first QP, so that the overall code rate is reduced while ensuring the image quality.
In another example, assuming macroblock-level control, a frame of video is divided into macroblocks (e.g., 16 × 16 cells). Since the use of a large QP for the macroblock in the static state and a small QP for the macroblock in the moving state can reduce the overall code rate and have a small (even negligible) effect on the image quality when the scene state is the static state, the difference between the QP used when encoding the macroblock in the moving state and the QP used when encoding the macroblock in the static state (the latter is larger) can be appropriately increased.
For example, the static state or the motion state of the macro block may be determined by inter-frame contrast, or may be determined by motion detection, or may be determined by intelligent detection.
For example, for any macro block in a video frame, when the content of the macro block is the same as the content (such as Y value) of a macro block at the same position in the previous video frame, and the duration reaches a preset time threshold, it is determined that the macro block is in a static state; otherwise, the macro block is determined to be in a motion state.
For example, when the scene state of the video to be encoded is a static state, the encoding apparatus may encode the macro block in the motion state using a first QP, and encode the macro block in the static state using a second QP that is greater than the first QP, so that the overall code rate is reduced while ensuring the image quality.
As a possible implementation manner, if the scene state is a static state, the encoding the video to be encoded according to the rate control policy may include:
determining a first QP to use when encoding the key frame;
determining a second QP used for coding the non-key frame according to the first QP and a preset QP increment;
and coding the video to be coded according to the first QP and the second QP.
For example, the first QP used when the I frame is encoded may be determined according to a QP determination manner in an existing variable rate coding implementation scheme, or after the QP is determined according to the existing variable rate coding implementation scheme, a QP value smaller than the QP may be used as the first QP to ensure the image quality of the I frame.
When the first QP used for encoding the I frame is determined, the second QP used for encoding the P frame may be determined according to the first QP and the preset QP increment, for example, the sum of the first QP and the preset QP increment is determined as the second QP.
When the first QP and the second QP are determined, the encoding device may encode an I frame of the video to be encoded using the first QP and encode a P frame of the video to be encoded using the second QP.
Illustratively, the QP increment of the second QP relative to the first QP may be a fixed value (e.g. 3, i.e. the second QP = the first QP + 3), or different QP increments may be set for different scene states, so as to further increase the flexibility of rate control.
In one example, the determining the second QP used in encoding the non-key frame according to the first QP and the preset QP delta includes:
inquiring the corresponding relation between the preset static region proportion and the QP increment according to the proportion of the static region in the current video frame of the video to be coded so as to determine a target QP increment matched with the proportion of the static region in the current video frame;
determining the second QP from the first QP and the target QP delta.
For example, the correspondence between the ratio of the static area in the video frame and the QP delta may be preset.
For example, the static area ratios 30% to 40%, 40% to 50%, and 50% to 60% correspond to QP increment 1, QP increment 2, and QP increment 3, respectively.
In one example, the higher the quiescent area fraction, the larger the QP delta.
For example, when the encoding apparatus determines a scene state still state of the video to be encoded, the encoding apparatus may further determine a proportion of a region of the still state in each video frame of the video to be encoded.
For example, the proportion of pixels, in which pixels in two adjacent video frames do not change, in the total number of pixels in the video frames may be determined as the proportion of the still region in the video frames, or the video picture of the video to be encoded may be divided into a preset number of sub-blocks, and the proportion of the sub-blocks in the still state in the video frames in the total number of sub-blocks in the video frames may be determined as the proportion of the still region in the video frames.
The encoding apparatus may query a preset correspondence between the static region proportion and the QP increment according to the proportion of the static region in the current video frame to determine a QP increment (referred to herein as a target QP increment) that matches the proportion of the static region in the current video frame, and determine a second QP according to the first QP and the target QP increment, for example, determine the sum of the first QP and the target QP increment as the second QP.
As a possible implementation manner, the determining a rate control policy matching a scene state may further include:
if the scene state is the motion state, determining that the code rate control strategy matched with the scene state is a second code rate control strategy;
the difference value between the second QP and the first QP is larger than that between the fourth QP and the third QP;
the third QP is the QP used for coding the key frame in the second code rate control strategy, and the fourth QP is the QP used for coding the non-key frame in the second code rate control strategy; or, the third QP is a QP used for encoding the macroblock in the motion state in the video frame in the second code rate control strategy, and the fourth QP is a QP used for encoding the macroblock in the static state in the video frame in the second code rate control strategy.
For example, when the scene state of the video to be encoded is a motion state, there is a large change between each frame, and in order to ensure image quality, the difference between the QP used when encoding an I frame (i.e., the third QP) and the QP used when encoding a P frame (i.e., the fourth QP) may be reduced, or the difference between the QP used when encoding a macroblock in a still state (i.e., the third QP) and the QP used when encoding a motion state (i.e., the fourth QP) may be reduced.
In an example, when the scene state of the video to be encoded is a motion state, the third QP is equal to the fourth QP, and at this time, the encoding device may determine, according to an existing variable rate encoding implementation scheme, a QP used when encoding the video to be encoded, and encode the video to be encoded, where specific implementation thereof is not described herein again.
It should be appreciated that the scene state of the video to be encoded is not limited to the static state or the motion state, for example, the scene state of the video to be encoded may further include indoor, outdoor, light on, light off, rain or strong wind, and the encoding device may detect the scene state of the video to be encoded in combination with a deep learning algorithm, and adopt different bitrate control strategies according to different scene states, so as to more accurately adjust bitrate changes in different scenes, and specific implementation thereof is not described herein again.
In order to enable those skilled in the art to better understand the technical solutions provided by the embodiments of the present application, the technical solutions provided by the embodiments of the present application are described below with reference to specific examples.
In this embodiment, taking the example that the coding device performs the code rate control by using the frame-level control, the specific implementation flow is as follows:
1. the encoding device determines a scene state of a video to be encoded.
Illustratively, a picture of a video to be encoded may be equally divided into N small squares (e.g., 8 × 8 small squares) in advance.
The encoding equipment can compare the small squares at the same positions in the video frame and the previous video frame, and if the content of the small squares changes, the small squares are considered to be in a motion state; if the content of the small square is not changed, the small square is considered to be in a static state.
If the proportion of the static small squares in the video frame to the total number of the small squares in the video frame exceeds a preset proportion threshold (30%) and the duration time exceeds a preset time threshold (such as a second), determining that the scene state of the video to be coded is a static state; otherwise, determining the scene state of the video to be coded as a motion state.
2. And if the scene state is static, determining that the code rate control strategy matched with the scene state is a first code rate control strategy, and coding the video to be coded according to the first code rate control strategy.
For example, if the encoding device determines that the scene state of the video to be encoded is a static state, the rate control policy matched with the scene state is determined to be the first rate control policy.
At this time, the encoding apparatus may determine a QP for encoding the I frame (i.e., the first QP described above) in a QP determination manner in the existing variable rate coding implementation.
For P frames, the encoding device may determine the corresponding QP delta based on the proportion of static regions (e.g., static checkers) in the current video frame.
Assume that the correspondence between the preconfigured static area ratio and QP delta is shown in table 1:
TABLE 1
Quiescent zone ratio QP increments
30%~50% 3
50%~70% 4
Over 70 percent 5
Based on the correspondence shown in table 1, the encoding device may determine a QP delta that matches the still region scale of the current video frame, and determine a second QP from the QP delta and the first QP.
The encoding device may encode an I frame using a first QP and a P frame using a second QP.
3. And if the scene state is the motion state, determining that the code rate control strategy matched with the scene state is a second code rate control strategy, and coding the video to be coded according to the second code rate control strategy.
For example, if the encoding device determines that the scene state of the video to be encoded is a motion state, at this time, the encoding device may encode the video to be encoded by using the existing variable rate encoding implementation scheme.
For example, a maximum QP and a minimum QP in a motion state may be preset, and a maximum code rate may be set.
The encoding device can initially select the minimum QP to encode the video to be encoded, and the expected code rate under the QP is estimated according to the size of the encoded frame. If the code rate is larger than the maximum code rate, increasing the QP until the expected code rate estimated according to the size of the coding frame meets the limitation of the maximum code rate. And if the QP is increased to the maximum and the expected code rate is still larger than the maximum code rate, encoding the video to be encoded by using the maximum QP.
In the embodiment of the application, the scene state of the video to be coded is determined, the rate control strategy matched with the scene state is determined, and then the video to be coded is coded according to the rate control strategy, so that the flexibility of rate control in a variable rate coding implementation scheme is improved.
The methods provided herein are described above. The following describes the apparatus provided in the present application:
referring to fig. 2, a schematic structural diagram of an encoding apparatus provided in an embodiment of the present application is shown in fig. 2, where the encoding apparatus may include:
a first determining unit 210, configured to determine a scene state of a video to be encoded;
a second determining unit 220, configured to determine a rate control policy matching the scene state;
and an encoding unit 230, configured to encode the video to be encoded according to the rate control policy.
In an alternative embodiment, the scene state comprises a static state or a motion state;
the second determining unit 220 is specifically configured to determine, if the scene state is a static state, that the code rate control policy matched with the scene state is a first code rate control policy;
wherein the second quantization parameter QP is greater than the first QP;
the first QP is the QP determined according to the first rate control strategy and used for coding the key frame, and the second QP is the QP determined according to the first rate control strategy and used for coding the non-key frame; or, the first QP is a QP used for encoding a moving macroblock in a video frame determined according to the first rate control strategy, and the second QP is a QP used for encoding a static macroblock in a video frame determined according to the first rate control strategy.
In an alternative embodiment, as shown in fig. 3, the apparatus further comprises:
a third determining unit 240, configured to determine the first QP used when encoding a key frame if the scene state is a static state;
the third determining unit 240 is further configured to determine, according to the first QP and a preset QP delta, the second QP used when a non-key frame is encoded;
the encoding unit 230 is specifically configured to encode the video to be encoded according to the first QP and the second QP.
In an alternative embodiment, as shown in fig. 4, the apparatus further comprises:
and the query unit 250 is configured to query a preset correspondence between the static region proportion and the QP increment according to the proportion of the static region in the current video frame of the video to be encoded, so as to determine a target QP increment matched with the proportion of the static region in the current video frame.
The third determining unit 240 is specifically configured to determine the second QP according to the first QP and the target QP increment.
In an optional implementation manner, the second determining unit 220 is further configured to determine, if the scene state is a motion state, that the code rate control policy matched with the scene state is a second code rate control policy;
wherein, a fourth QP is greater than or equal to a third QP, and the difference between the second QP and the first QP is greater than the difference between the fourth QP and the third QP;
the third QP is a QP used for encoding a key frame in the second code rate control strategy, and the fourth QP is a QP used for encoding a non-key frame in the second code rate control strategy; or, the third QP is a QP used for encoding a moving macroblock in a video frame in the second code rate control strategy, and the fourth QP is a QP used for encoding a static macroblock in a video frame in the second code rate control strategy.
Please refer to fig. 5, which is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present disclosure. The electronic device may include a processor 501, a communication interface 502, a memory 503, and a communication bus 504. The processor 501, the communication interface 502 and the memory 503 are in communication with each other via a communication bus 504. Wherein, the memory 503 stores a computer program; the processor 501 may perform the above-described encoding method by executing a program stored on the memory 503.
The memory 503 referred to herein may be any electronic, magnetic, optical, or other physical storage device that can contain or store information such as executable instructions, data, and the like. For example, the memory 502 may be: a RAM (random Access Memory), a volatile Memory, a non-volatile Memory, a flash Memory, a storage drive (e.g., a hard drive), a solid state drive, any type of storage disk (e.g., an optical disk, a dvd, etc.), or similar storage medium, or a combination thereof.
Embodiments of the present application also provide a machine-readable storage medium, such as the memory 503 in fig. 5, storing a computer program, which can be executed by the processor 501 in the electronic device shown in fig. 5 to implement the encoding method described above.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising one of 8230; \8230;" 8230; "does not exclude the presence of additional like elements in a process, method, article, or apparatus that comprises the element.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the scope of protection of the present application.

Claims (8)

1. An encoding method, comprising:
determining a scene state of a video to be coded;
determining a code rate control strategy matched with the scene state; if the scene state is a static state, the code rate control strategy matched with the scene state is a first code rate control strategy; if the scene state is a motion state, the code rate control strategy matched with the scene state is a second code rate control strategy;
coding the video to be coded according to the code rate control strategy;
the second quantization parameter QP is larger than the first QP, the fourth QP is larger than or equal to the third QP, and the difference value between the second QP and the first QP is larger than the difference value between the fourth QP and the third QP;
the first QP is the QP determined according to the first rate control strategy and used for coding the key frame, and the second QP is the QP determined according to the first rate control strategy and used for coding the non-key frame; the third QP is the QP used for coding the key frame in the second code rate control strategy, and the fourth QP is the QP used for coding the non-key frame in the second code rate control strategy;
or the like, or, alternatively,
the first QP is a QP used for coding the macro block in the motion state in the video frame determined according to the first code rate control strategy, and the second QP is a QP used for coding the macro block in the static state in the video frame determined according to the first code rate control strategy; the third QP is a QP used for encoding a moving macroblock in a video frame in the second code rate control strategy, and the fourth QP is a QP used for encoding a static macroblock in a video frame in the second code rate control strategy.
2. The method of claim 1, wherein if the scene state is a static state, the encoding the video to be encoded according to the rate control policy comprises:
determining the first QP to use when encoding a key frame;
determining the second QP used when a non-key frame is coded according to the first QP and a preset QP increment;
and encoding the video to be encoded according to the first QP and the second QP.
3. The method of claim 2, wherein determining the second QP to use when encoding non-key frames from the first QP and a preset QP delta comprises:
inquiring the corresponding relation between the preset static region proportion and the QP increment according to the proportion of the static region in the current video frame of the video to be coded so as to determine a target QP increment matched with the proportion of the static region in the current video frame;
determining the second QP from the first QP and the target QP delta.
4. An encoding apparatus, comprising:
the first determining unit is used for determining the scene state of the video to be coded;
a second determining unit, configured to determine a rate control policy that matches the scene state; if the scene state is a static state, the code rate control strategy matched with the scene state is a first code rate control strategy; if the scene state is a motion state, the code rate control strategy matched with the scene state is a second code rate control strategy;
the coding unit is used for coding the video to be coded according to the code rate control strategy;
the second quantization parameter QP is larger than the first QP, the fourth QP is larger than or equal to the third QP, and the difference value between the second QP and the first QP is larger than the difference value between the fourth QP and the third QP;
the first QP is the QP determined according to the first rate control strategy and used for coding the key frame, and the second QP is the QP determined according to the first rate control strategy and used for coding the non-key frame; the third QP is the QP used for coding the key frame in the second code rate control strategy, and the fourth QP is the QP used for coding the non-key frame in the second code rate control strategy;
or the like, or, alternatively,
the first QP is a QP used for coding the macro block in the motion state in the video frame determined according to the first code rate control strategy, and the second QP is a QP used for coding the macro block in the static state in the video frame determined according to the first code rate control strategy; the third QP is a QP used for encoding a moving macroblock in a video frame in the second code rate control strategy, and the fourth QP is a QP used for encoding a static macroblock in the video frame in the second code rate control strategy.
5. The apparatus of claim 4, further comprising:
a third determining unit, configured to determine the first QP used when encoding a key frame if the scene state is a static state;
the third determining unit is further configured to determine, according to the first QP and a preset QP delta, the second QP used when a non-key frame is encoded;
the encoding unit is specifically configured to encode the video to be encoded according to the first QP and the second QP.
6. The apparatus of claim 5, further comprising:
the query unit is used for querying the preset corresponding relation between the static region proportion and the QP increment according to the proportion of the static region in the current video frame of the video to be coded so as to determine the target QP increment matched with the proportion of the static region in the current video frame;
the third determining unit is specifically configured to determine the second QP according to the first QP and the target QP increment.
7. An electronic device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing mutual communication by the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the method of any one of claims 1 to 3 when executing a program stored in the memory.
8. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the method of any one of claims 1 to 3.
CN201910708331.3A 2019-08-01 2019-08-01 Encoding method, encoding device, electronic equipment and readable storage medium Active CN112312134B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910708331.3A CN112312134B (en) 2019-08-01 2019-08-01 Encoding method, encoding device, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910708331.3A CN112312134B (en) 2019-08-01 2019-08-01 Encoding method, encoding device, electronic equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN112312134A CN112312134A (en) 2021-02-02
CN112312134B true CN112312134B (en) 2023-03-24

Family

ID=74486416

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910708331.3A Active CN112312134B (en) 2019-08-01 2019-08-01 Encoding method, encoding device, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN112312134B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114466221B (en) * 2022-01-14 2024-02-02 杭州华橙软件技术有限公司 Image processing method and device, storage medium and electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102172020A (en) * 2008-09-09 2011-08-31 爱移通全球有限公司 Method and apparatus for transmitting video
CN106170979A (en) * 2014-04-30 2016-11-30 英特尔公司 Constant Quality video encodes
US10003802B1 (en) * 2012-04-18 2018-06-19 Matrox Graphics Inc. Motion-based adaptive quantization
CN109905711A (en) * 2019-02-28 2019-06-18 深圳英飞拓智能技术有限公司 A kind of processing method of image, system and terminal device

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7653130B2 (en) * 2006-12-27 2010-01-26 General Instrument Corporation Method and apparatus for bit rate reduction in video telephony
CN102572381A (en) * 2010-12-29 2012-07-11 中国移动通信集团公司 Video monitoring scene judging method and monitoring image coding method and device thereof
CN102572380B (en) * 2010-12-29 2014-12-10 中国移动通信集团公司 Video monitoring coding method and device
US9438918B2 (en) * 2012-04-23 2016-09-06 Intel Corporation Frame level rate control using motion estimated distortions
CN103167290B (en) * 2013-04-01 2016-05-11 深圳市云宙多媒体技术有限公司 A kind of Video coding exercise intensity quantization method and device
US20150071343A1 (en) * 2013-09-12 2015-03-12 Magnum Semiconductor, Inc. Methods and apparatuses including an encoding system with temporally adaptive quantization
KR102212762B1 (en) * 2014-09-17 2021-02-05 삼성전자주식회사 Codec and devices including the same
CN105898306A (en) * 2015-12-11 2016-08-24 乐视云计算有限公司 Code rate control method and device for sport video
CN105516720B (en) * 2015-12-23 2019-01-29 天地伟业技术有限公司 A kind of self-adaptation control method of monitor camera code stream
US10178390B2 (en) * 2016-03-30 2019-01-08 Sony Interactive Entertainment Inc. Advanced picture quality oriented rate control for low-latency streaming applications
CN106604029B (en) * 2017-01-03 2019-07-12 华南理工大学 A kind of bit rate control method of the moving region detection based on HEVC
CN106993187B (en) * 2017-04-07 2019-09-06 珠海全志科技股份有限公司 A kind of coding method of variable frame rate and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102172020A (en) * 2008-09-09 2011-08-31 爱移通全球有限公司 Method and apparatus for transmitting video
US10003802B1 (en) * 2012-04-18 2018-06-19 Matrox Graphics Inc. Motion-based adaptive quantization
CN106170979A (en) * 2014-04-30 2016-11-30 英特尔公司 Constant Quality video encodes
CN109905711A (en) * 2019-02-28 2019-06-18 深圳英飞拓智能技术有限公司 A kind of processing method of image, system and terminal device

Also Published As

Publication number Publication date
CN112312134A (en) 2021-02-02

Similar Documents

Publication Publication Date Title
US9402034B2 (en) Adaptive auto exposure adjustment
CN109905711B (en) Image processing method and system and terminal equipment
CN102883157B (en) Method for video coding and video encoder
CN103650504A (en) Control of video encoding based on image capture parameters
CN106937116B (en) Low-complexity video coding method based on random training set adaptive learning
Kong et al. Object-detection-based video compression for wireless surveillance systems
CN110365983B (en) Macroblock-level code rate control method and device based on human eye vision system
CN102598665A (en) Control of video encoding based on image capture parameters
CN111246219B (en) Quick dividing method for depth of CU (Central Unit) in VVC (variable valve timing) frame
CN114466189B (en) Code rate control method, electronic equipment and storage medium
JP2012239085A (en) Image processor, and image processing method
CN111614909B (en) Automatic exposure control method, equipment and storage medium
EP3370419A1 (en) A video encoder and a method in a video encoder
CN104601992B (en) SKIP mode quick selecting methods based on Bayesian Smallest Risk decision
CN105872556B (en) Video encoding method and apparatus
CN112312134B (en) Encoding method, encoding device, electronic equipment and readable storage medium
CN109151470B (en) Coding resolution control method and terminal
CN107105240B (en) HEVC-SCC complexity control method and system
CN100542299C (en) The concealing method of video image error
CN108881905B (en) Probability-based intra-frame encoder optimization method
KR20060111528A (en) Detection of local visual space-time details in a video signal
CN103167290A (en) Method and device for quantizing video coding movement intensity
CN111372079B (en) VVC inter-frame CU deep rapid dividing method
JP2009135902A (en) Encoding device, control method of the encoding device, and computer program
US20150189301A1 (en) Encoding apparatus, encoding method, and image capture apparatus

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
GR01 Patent grant
GR01 Patent grant