CN117061773A - Pre-analysis processing method, system, equipment and storage medium for video coding - Google Patents

Pre-analysis processing method, system, equipment and storage medium for video coding Download PDF

Info

Publication number
CN117061773A
CN117061773A CN202311077105.2A CN202311077105A CN117061773A CN 117061773 A CN117061773 A CN 117061773A CN 202311077105 A CN202311077105 A CN 202311077105A CN 117061773 A CN117061773 A CN 117061773A
Authority
CN
China
Prior art keywords
length
coding
encoding
frame
buffer area
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311077105.2A
Other languages
Chinese (zh)
Inventor
洪旭东
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Baiguoyuan Information Technology Co Ltd
Original Assignee
Guangzhou Baiguoyuan Information 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 Guangzhou Baiguoyuan Information Technology Co Ltd filed Critical Guangzhou Baiguoyuan Information Technology Co Ltd
Priority to CN202311077105.2A priority Critical patent/CN117061773A/en
Publication of CN117061773A publication Critical patent/CN117061773A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/85Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using pre-processing or post-processing specially adapted for video compression
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/42Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation
    • H04N19/423Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation characterised by memory arrangements

Landscapes

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

Abstract

The embodiment of the application discloses a pre-analysis processing method, a system, equipment and a storage medium for video coding. According to the technical scheme provided by the embodiment of the application, the buffer area is used for buffering the frame to be encoded by detecting the buffer area associated with the pre-analysis module; starting a pre-analysis module to pre-analyze the frame to be encoded under the condition that the buffer length of the buffer area reaches the basic length, and encoding the frame to be encoded corresponding to the buffer area through an encoding thread under the condition that the buffer length of the buffer area exceeds the basic length by a set length; closing the pre-analysis module under the condition that the cache length of the cache area does not reach the basic length; the base length is set according to the designated video coding delay, and the set length is determined according to the time consumption of the coding thread to code the frame to be coded. By adopting the technical means, the large delay caused by overlarge buffer memory of the pre-analysis module can be avoided, the coding efficiency is improved, the video transmission instantaneity is ensured, and the use experience of a user is improved.

Description

Pre-analysis processing method, system, equipment and storage medium for video coding
Technical Field
The embodiment of the application relates to the technical field of video coding, in particular to a pre-analysis processing method, a system, equipment and a storage medium for video coding.
Background
At present, in live broadcast, video conversation and other scenes, the application of a real-time audio and video transmission technology is involved. In a mainstream HEVC encoder (High Efficiency Video Coding, high-efficiency video coding/H265), an pre-analysis module is generally set to pre-analyze a frame to be encoded, and pre-analysis information is obtained through intra-frame prediction and inter-frame motion search to assist in formal encoding of the frame to be encoded, so as to improve video encoding efficiency.
However, when the pre-analysis module performs pre-analysis on frames to be encoded, a plurality of frames to be encoded are cached, larger delay is introduced due to overlarge caching, and the user experience is relatively poor for scenes with higher video real-time requirements.
Disclosure of Invention
The embodiment of the application provides a pre-analysis processing method, a system, equipment and a storage medium for video coding, which can avoid a large delay introduced by a pre-analysis module while ensuring coding efficiency and solve the technical problem of video delay caused by overlarge cache of the pre-analysis module.
In a first aspect, an embodiment of the present application provides a pre-analysis processing method for video coding, including:
detecting a buffer area associated with the pre-analysis module, wherein the buffer area is used for buffering frames to be encoded;
starting a pre-analysis module to pre-analyze the frame to be encoded under the condition that the buffer length of the buffer area reaches the basic length, and encoding the frame to be encoded corresponding to the buffer area through an encoding thread under the condition that the buffer length of the buffer area exceeds the basic length by a set length; closing the pre-analysis module under the condition that the cache length of the cache area does not reach the basic length; the base length is set according to the designated video coding delay, the video coding delay is introduced by the buffer area, and the set length is determined according to the time consumption of the coding thread to code the frame to be coded.
In a second aspect, an embodiment of the present application provides a pre-analysis processing system for video coding, including:
the detection module is configured to detect a buffer area associated with the pre-analysis module, wherein the buffer area is used for buffering frames to be encoded;
the processing module is used for starting the pre-analysis module to pre-analyze the frame to be encoded when the buffer length of the buffer area reaches the basic length, and encoding the frame to be encoded corresponding to the buffer area through the encoding thread when the buffer length of the buffer area exceeds the set length of the basic length; closing the pre-analysis module under the condition that the cache length of the cache area does not reach the basic length; the base length is set according to the designated video coding delay, the video coding delay is introduced by the buffer area, and the set length is determined according to the time consumption of the coding thread to code the frame to be coded.
In a third aspect, an embodiment of the present application provides a pre-analysis processing apparatus for video encoding, including:
a memory and one or more processors;
the memory is configured to store one or more programs;
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the pre-analysis processing method of video coding as described in the first aspect.
In a fourth aspect, embodiments of the present application provide a computer readable storage medium storing computer executable instructions that, when executed by a computer processor, are configured to perform the method of pre-analysis processing of video encoding as described in the first aspect.
In a fifth aspect, embodiments of the present application provide a computer program product comprising instructions which, when run on a computer or processor, cause the computer or processor to perform the pre-analysis processing method of video encoding as described in the first aspect.
The embodiment of the application detects the buffer area associated with the pre-analysis module, wherein the buffer area is used for buffering the frame to be encoded; starting a pre-analysis module to pre-analyze the frame to be encoded under the condition that the buffer length of the buffer area reaches the basic length, and encoding the frame to be encoded corresponding to the buffer area through an encoding thread under the condition that the buffer length of the buffer area exceeds the basic length by a set length; closing the pre-analysis module under the condition that the cache length of the cache area does not reach the basic length; the base length is set according to the designated video coding delay, the video coding delay is introduced by the buffer area, and the set length is determined according to the time consumption of the coding thread to code the frame to be coded. By adopting the technical means, the base length of the buffer area is set according to the video coding delay, the set length is determined according to the coding time consumption, and the starting time of the pre-analysis module and the coding time of the coding thread are judged by combining the base length and the set length, so that the large delay caused by overlarge buffer of the pre-analysis module is avoided, the coding efficiency is improved, the video transmission instantaneity is ensured, and the use experience of a user is improved.
Drawings
Fig. 1 is a flowchart of a pre-analysis processing method for video coding according to an embodiment of the present application;
FIG. 2 is a flow chart of a scene mode based pre-analysis decision in an embodiment of the application;
FIG. 3 is a flow chart of coding decisions in an embodiment of the application;
FIG. 4 is a schematic diagram of a pre-analysis processing system for video coding according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a pre-analysis processing device for video coding according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the following detailed description of specific embodiments of the present application is given with reference to the accompanying drawings. It is to be understood that the specific embodiments described herein are merely illustrative of the application and are not limiting thereof. It should be further noted that, for convenience of description, only some, but not all of the matters related to the present application are shown in the accompanying drawings. Before discussing exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart depicts operations (or steps) as a sequential process, many of the operations can be performed in parallel, concurrently, or at the same time. Furthermore, the order of the operations may be rearranged. The process may be terminated when its operations are completed, but may have additional steps not included in the figures. The processes may correspond to methods, functions, procedures, subroutines, and the like.
The pre-analysis processing method for video coding aims at solving the problems that the pre-analysis module is excessively large in cache and large in delay is introduced by setting the basic length of a cache area according to video coding delay and determining the set length according to coding time consumption and judging the starting time of the pre-analysis module and the coding time of a coding thread by combining the basic length and the set length, so that the real-time performance of video coding is improved while the coding efficiency is ensured.
For related video coding schemes, the mainstream encoder includes an H264 (highly compressed digital video coding) encoder. Compared with an H264 coder, the HEVC coder supports a more flexible block division mode, intra-frame prediction supports reference pixel filtering, a more efficient motion vector prediction technology is supported, and SAO (Sample Adaptive Offset) is introduced to promote coding tools such as post-processing image quality. Typically, HEVC encoders have greater compression efficiency, supporting more flexible coding configurations. The common coding complexity of HEVC encoders is higher than that of the H264 encoder. A common HEVC encoder generally includes a pre-analysis module in implementation, where the pre-analysis module caches a number of video frames to be encoded that are sent in, and performs intra-frame prediction, inter-frame motion search, and so on. The pre-analysis module may introduce coding delay, but instead, significantly improves coding efficiency. In general, objective coding quality can be improved at the same code rate. However, the pre-analysis module is usually independent of the encoding thread, so that in order to ensure that the encoding thread can acquire the encoding frames in time, the pre-analysis module typically additionally caches a plurality of video frames to be encoded, and introduces additional delay. This partial delay does not bring about improvement of image quality. The direct use of soft-coded HEVC encoders may suffer from insufficient coding performance on low-end machines, resulting in lower coding resolution and coding frame rate, affecting the viewing experience of the viewer. Based on the above, the pre-analysis processing method for video coding is provided in the embodiment of the application, so as to solve the technical problem of video delay caused by overlarge cache of the pre-analysis module.
Examples:
fig. 1 shows a flowchart of a video coding pre-analysis processing method according to an embodiment of the present application, where the video coding pre-analysis processing method according to the embodiment of the present application may be implemented by a video coding pre-analysis processing device, where the video coding pre-analysis processing device may be implemented by software and/or hardware, and the video coding pre-analysis processing device may be configured by two or more physical entities or may be configured by one physical entity. In general, the pre-analysis processing device for video coding may be a coding device such as a coding server, a host, a computer, a mobile phone, a tablet, etc.
The following description will take the main body of the pre-analysis processing apparatus for video encoding as an example. Referring to fig. 1, the pre-analysis processing method for video coding specifically includes:
s110, detecting a buffer area associated with the pre-analysis module, wherein the buffer area is used for buffering frames to be encoded;
s120, starting an pre-analysis module to pre-analyze frames to be encoded under the condition that the buffer length of the buffer area reaches the basic length, and encoding the frames to be encoded corresponding to the buffer area through an encoding thread under the condition that the buffer length of the buffer area exceeds the set length of the basic length; closing the pre-analysis module under the condition that the cache length of the cache area does not reach the basic length; the base length is set according to the designated video coding delay, the video coding delay is introduced by the buffer area, and the set length is determined according to the time consumption of the coding thread to code the frame to be coded.
When the embodiment of the application performs the pre-analysis processing of video coding, the pre-analysis module of the HEVC encoder is considered to ensure that the coding thread can acquire the coding frames in time, the CPU is fully utilized, and a plurality of video frames to be coded are additionally cached. This introduces additional delay, and the video delay that is reflected to the viewer increases, resulting in poor user interactivity. There is therefore a need for a pre-analysis module that flexibly uses encoders, balancing encoding delay and CPU usage. Therefore, the scheme sets the basic length of the buffer area according to the video coding delay which can be accepted to be introduced into the buffer area, and uses the basic length to trigger the starting of the pre-analysis module so as to avoid the situation that too many video frames are buffered in the buffer area of the pre-analysis module to cause too much delay to be introduced, thereby improving the real-time performance of video coding transmission. In addition, the set length is set according to the time consumption of the encoding thread for encoding the frame to be encoded, so that the encoding thread does not need to wait for the pre-analysis result of the pre-analysis module to be too long, and the pre-analysis result is timely used for performing formal encoding on the video. Therefore, the video coding efficiency can be ensured, and the CPU resources are fully utilized to carry out video coding. Meanwhile, excessive delay introduced in a buffer area of the pre-analysis module is avoided, and video coding instantaneity is improved. For scenes with stronger interaction (such as wheat connection) of video call and live broadcast, the requirement of video instantaneity under the corresponding scene can be met, and the use experience of a user is improved.
Specifically, when the pre-analysis module performs pre-analysis processing on video frames to be encoded, in order to fully utilize CPU resources, a plurality of video frames to be encoded are cached in a cache area of the pre-analysis module, instead of only caching one video frame at a time for performing the pre-analysis processing. In order to reduce the coding delay, the buffer area of the pre-analysis module needs to be flexibly adapted.
According to the actual test, the basic length of the buffer area of the pre-analysis module is 4. When the buffer area reaches 4, the pre-analysis processing of the frame to be encoded in the buffer area is triggered, so that the delay and the encoding efficiency can be kept in a good state.
In the buffer area, if the number of B frames is 2, the default buffer frame number of the pre-analysis module reaches 4+2+2 (the other 2 frames are one MINI GOP). The wake-up condition of the pre-analysis module is that the buffer length reaches the basic length, namely, the buffer length of the pre-analysis module reaches 4, the pre-analysis module can be awakened to perform pre-analysis calculation, so that every time the pre-analysis module needs to take out 2+1 frames (the continuous B frame 2 is added with a backward reference frame P), the buffer length of the pre-analysis module is still larger than the basic length 4, and therefore, each frame to be encoded actually wakes up the pre-analysis module to work, so that although the main thread can be better ensured to take the frame to be encoded after pre-analysis is finished every time, the buffer length is still too long, and partial delay is additionally introduced. In addition, if the extra buffer frames are turned off when the timing of triggering the start of the pre-analysis module is determined, only the pre-analysis module is kept as 4 frames. Only when the main thread acquires the frame to be encoded, the pre-analysis module is woken up to work, and at the moment, the main thread waits for the calculation result of the pre-analysis module to perform video encoding, so that the encoding time consumption of the actually encoded single frame is increased.
Therefore, the embodiment of the application introduces the concept of sync buffer (i.e. set length) to the pre-analysis module, and when the buffer length of the pre-analysis module reaches 4+sync buffer, the encoding thread extracts the frame to be encoded after pre-analysis from the buffer area, so as to improve the encoding efficiency and reduce the encoding waiting time.
Wherein, the length is set to be the length of 1 frame to be encoded. In practical application, the sync buffer=1, and then the pre-analysis module encodes a frame of the thread in advance to perform pre-analysis calculation. The coding thread can reduce waiting time when acquiring the frame to be coded, and can reduce coding delay and improve viewing experience of a viewer terminal.
Optionally, considering that the sensitivity degree to video delay is different in different scene modes, the base length can be adaptively adjusted for the case that the video delay is more sensitive, which indicates that the buffer area is excessively long. For scenes with high real-time requirements, even the pre-analysis module can be closed to directly encode video. Therefore, video delay introduced by the buffer area of the pre-analysis module does not need to be considered, and video instantaneity is improved.
Wherein, referring to fig. 2, before detecting the buffer area of the pre-analysis module, the method further comprises:
s1001, detecting a scene mode of current video coding;
s1002, closing the pre-analysis module under the condition that the scene mode of the current video coding is a first setting mode;
s1003, expanding a base length when the current video encoding scene mode is the second setting mode.
By setting different scene modes, real-time scene modes are detected when video coding is performed, so that a decision of the pre-analysis module is made according to the scene modes. The scene modes include a first setting mode, which is a scene with strong interactivity, and a second setting mode, in which the coding delay is the most consideration factor, so that the coding efficiency needs to be sacrificed appropriately. At the moment, the pre-analysis module can be closed, B frame introduction is closed, introduction delay is avoided, and coding instantaneity is guaranteed. The second setting mode is a scene with weak interactivity, and under the scene with weak interactivity, the buffer length of the buffer area of the pre-analysis module can be properly increased, and a proper amount of B frames are introduced to improve the coding efficiency. At this time, the adjustment of the coding efficiency can be achieved by adjusting the setting of the base length. According to actual demands, a plurality of different scene modes can be added adaptively. The scene mode can be determined according to the real-time video interaction type, for example, the video is set as the first setting mode, and the real-time example of the application does not make fixed limitation on the specific scene mode setting and detection, and is not repeated here.
Optionally, the encoding thread encodes the frame to be encoded corresponding to the buffer area, and the method further includes:
detecting the real-time encoding time consumption of the encoding thread, adjusting the encoding resolution according to the real-time encoding time consumption, closing the current encoder and using the default encoder to encode the video under the condition that the encoding resolution is lower than the set resolution threshold.
The soft coding H264 coder is used as a bottom-pocket coding scheme of the soft coding HEVC coder in the real-time example. In the process of video coding by the coding thread, detecting the time consumption of real-time coding, if the time consumption of the coding is higher than a set threshold, judging that the current coding performance is insufficient, and reducing the coding resolution. And setting a resolution threshold for triggering resolution switching, and when the insufficient coding performance is detected and the coding resolution is lower than the resolution threshold, considering that good support cannot be provided for the soft-coded HEVC encoder under the current condition, disabling the soft-coded HEVC encoder and using the soft-coded H264 encoder for video coding.
On the other hand, the encoding of the buffer area corresponding to the frame to be encoded by the encoding thread further comprises:
and marking the to-be-encoded frames with the output size exceeding the set size threshold, closing the current encoder under the condition that the to-be-encoded frames with the corresponding frame types are marked continuously set times, and performing video encoding by using a default encoder.
It should be noted that, in the case of excessive fluctuation of the encoding rate, it is indicated that the current soft-coding HEVC encoder is not suitable for video encoding. The encoder needs to be switched in order to stabilize the coding rate and improve the coding quality. Based on the above, the embodiment of the application respectively sets the size threshold of I, P, B frames by detecting the size of the output size of the encoded frame of the soft-coded HEVC encoder. And if the code output size of the corresponding frame type exceeds a set threshold value, marking once. If the coding output sizes of the coding frames which appear the set times continuously are all larger than the set threshold value, the fluctuation of the coding rate is judged to be too large, or the risk of overflowing of the coding rate exists. At this time, the soft-coded HEVC encoder is also disabled, and the soft-coded H264 encoder is used for video coding.
In one embodiment, in order to further improve the coding quality, the embodiment of the present application also performs adaptive setting of coding parameters and frame rates. After the encoding of the buffer area corresponding to the frame to be encoded is performed by the encoding thread, the method further includes: detecting the real-time coding frame rate of a coding thread, closing the pre-analysis module when the coding frame rate is lower than a set frame rate threshold, and setting the frame rate threshold to be the coding frame rate corresponding to the condition that video coding reaches a delay threshold.
The coding delay becomes large in consideration of the start-up of the code pre-analysis module. And when the number of encoded delay frames is fixed, the lower the frame rate, the larger the actual delay time (ms). It is not suitable to turn on code pre-analysis at low frame rates. Based on this, embodiments of the present application may also set a frame rate threshold in conjunction with video coding delay that may be actually introduced. Setting the corresponding video frame rate at the maximum delay acceptable for video coding (i.e. at the delay threshold) as a frame rate threshold, and disabling the coding pre-analysis module when the actual coding frame rate is detected to be less than the threshold. It can be appreciated that when the actual coding frame rate is less than the threshold, it indicates that the current soft-coded HEVC encoder cannot provide a better coding effect. At this time, a bottom-of-the-pocket coding scheme, i.e. a soft-coded H264 coder, may be used for video coding to maintain a good coding quality.
On the other hand, referring to fig. 3, the encoding of the buffer area corresponding to the frame to be encoded by the encoding thread further includes:
s1201, determining a decision result of a skip mode of a coding unit in a frame to be coded, and determining an optimal coding mode based on the decision;
s1202, performing recursively divided skip decision based on the optimal coding mode.
Since the CTU mode decision module in the HEVC encoder is an important component of the complexity of the encoder in normal cases, in the mode decision, the SKIP mode (SKIP mode) is firstly determined, then the intra-frame and inter-frame mode decisions are sequentially performed, the optimal mode under the current CU (coding unit) size is determined, and finally the recursive partitioning of the CU is performed. The optimal coding mode is obtained after the current depth CU and recursive partitioning. However, in the actual encoding process, if all intra-frames, inter-frame modes, and all recursive divisions are traversed, the encoding complexity is greatly improved. Therefore, the HEVC encoder of the application will firstly make SKIP mode decision under the current depth CU, and judge whether the residual intra-frame and inter-frame mode codes can be skipped according to the decision result of the SKIP mode (COST COST under the SKIP mode). After the optimal mode of the current depth is obtained, judging whether a recursive mode decision needs to be skipped according to the optimal mode. Meanwhile, according to the adaptive adjustment strategy of the coding feedback, on the basis of ensuring that the subjective and objective image quality is not greatly changed, the coding complexity is greatly reduced, and the practicability of video coding is improved.
The method comprises the steps that a buffer area associated with the pre-analysis module is detected, and the buffer area is used for buffering frames to be encoded; starting a pre-analysis module to pre-analyze the frame to be encoded under the condition that the buffer length of the buffer area reaches the basic length, and encoding the frame to be encoded corresponding to the buffer area through an encoding thread under the condition that the buffer length of the buffer area exceeds the basic length by a set length; closing the pre-analysis module under the condition that the cache length of the cache area does not reach the basic length; the base length is set according to the designated video coding delay, the video coding delay is introduced by the buffer area, and the set length is determined according to the time consumption of the coding thread to code the frame to be coded. By adopting the technical means, the base length of the buffer area is set according to the video coding delay, the set length is determined according to the coding time consumption, and the starting time of the pre-analysis module and the coding time of the coding thread are judged by combining the base length and the set length, so that the large delay caused by overlarge buffer of the pre-analysis module is avoided, the coding efficiency is improved, the video transmission instantaneity is ensured, and the use experience of a user is improved.
On the basis of the above embodiment, fig. 4 is a schematic structural diagram of a pre-analysis processing system for video coding according to the present application. Referring to fig. 4, the pre-analysis processing system for video coding provided in this embodiment specifically includes: a detection module 21 and a processing module 22.
Wherein, the detecting module 21 is configured to detect a buffer area associated with the pre-analyzing module, and the buffer area is used for buffering the frame to be encoded;
the processing module 22 is configured to start the pre-analysis module to perform pre-analysis on the frame to be encoded when the buffer length of the buffer area reaches the base length, and perform encoding of the frame to be encoded corresponding to the buffer area through the encoding thread when the buffer length of the buffer area exceeds the base length by a set length; closing the pre-analysis module under the condition that the cache length of the cache area does not reach the basic length; the base length is set according to the designated video coding delay, the video coding delay is introduced by the buffer area, and the set length is determined according to the time consumption of the coding thread to code the frame to be coded.
Wherein, the length is set to be 1 frame to be encoded.
Specifically, after the encoding of the buffer area corresponding to the frame to be encoded is performed by the encoding thread, the method further includes:
detecting the real-time coding frame rate of a coding thread, closing the pre-analysis module when the coding frame rate is lower than a set frame rate threshold, and setting the frame rate threshold to be the coding frame rate corresponding to the condition that video coding reaches a delay threshold.
Specifically, the encoding thread encodes the frame to be encoded corresponding to the buffer area, and the method further includes:
determining a decision result of a skip mode of a coding unit in a frame to be coded, and determining an optimal coding mode based on the decision result;
and performing a skipping decision of recursively dividing based on the optimal coding mode.
Furthermore, before detecting the buffer area of the pre-analysis module, the method further comprises:
detecting a scene mode of current video coding;
closing the pre-analysis module under the condition that the scene mode of the current video coding is a first setting mode;
in the case where the scene mode of the current video coding is the second setting mode, the base length is enlarged.
Specifically, the encoding thread encodes the frame to be encoded corresponding to the buffer area, and the method further includes:
detecting the real-time encoding time consumption of the encoding thread, adjusting the encoding resolution according to the real-time encoding time consumption, closing the current encoder and using the default encoder to encode the video under the condition that the encoding resolution is lower than the set resolution threshold.
Encoding the frame to be encoded corresponding to the buffer area through the encoding thread, and further comprises:
and marking the to-be-encoded frames with the output size exceeding the set size threshold, closing the current encoder under the condition that the to-be-encoded frames with the corresponding frame types are marked continuously set times, and performing video encoding by using a default encoder.
The method comprises the steps that a buffer area associated with the pre-analysis module is detected, and the buffer area is used for buffering frames to be encoded; starting a pre-analysis module to pre-analyze the frame to be encoded under the condition that the buffer length of the buffer area reaches the basic length, and encoding the frame to be encoded corresponding to the buffer area through an encoding thread under the condition that the buffer length of the buffer area exceeds the basic length by a set length; closing the pre-analysis module under the condition that the cache length of the cache area does not reach the basic length; the base length is set according to the designated video coding delay, the video coding delay is introduced by the buffer area, and the set length is determined according to the time consumption of the coding thread to code the frame to be coded. By adopting the technical means, the base length of the buffer area is set according to the video coding delay, the set length is determined according to the coding time consumption, and the starting time of the pre-analysis module and the coding time of the coding thread are judged by combining the base length and the set length, so that the large delay caused by overlarge buffer of the pre-analysis module is avoided, the coding efficiency is improved, the video transmission instantaneity is ensured, and the use experience of a user is improved.
The pre-analysis processing system for video coding provided by the embodiment of the application can be configured to execute the pre-analysis processing method for video coding provided by the embodiment of the application, and has corresponding functions and beneficial effects.
On the basis of the above practical example, an embodiment of the present application further provides a pre-analysis processing apparatus for video encoding, and referring to fig. 5, the pre-analysis processing apparatus for video encoding includes: processor 31, memory 32, communication module 33, input device 34 and output device 35. The memory is used as a computer readable storage medium and can be configured to store a software program, a computer executable program and a module, and the program instructions/modules correspond to the pre-analysis processing method of video coding according to any embodiment of the present application (for example, a detection module and a processing module in a pre-analysis processing system of video coding). The communication module is configured to perform data transmission. The processor executes various functional applications of the device and data processing by running software programs, instructions and modules stored in the memory, i.e. implements the pre-analysis processing method for video coding described above. The input means may be configured to receive input numeric or character information and to generate key signal inputs related to user settings and function control of the device. The output means may comprise a display device such as a display screen. The pre-analysis processing device for video coding provided in the above embodiment can be configured to execute the pre-analysis processing method for video coding provided in the above embodiment, and has corresponding functions and beneficial effects.
On the basis of the above embodiments, the present application further provides a computer-readable storage medium storing computer-executable instructions that, when executed by a computer processor, are configured to perform a video-encoded pre-analysis processing method, where the storage medium may be any of various types of memory devices or storage devices. Of course, the computer-readable storage medium provided in the embodiments of the present application is not limited to the pre-analysis processing method of video encoding described above, and may also perform the related operations in the pre-analysis processing method of video encoding provided in any embodiment of the present application.
On the basis of the above embodiments, the embodiments of the present application further provide a computer program product, where the technical solution of the present application is essentially or partly contributing to the prior art or all or part of the technical solution may be embodied in the form of a software product, and the computer program product is stored in a storage medium, and includes several instructions for causing a computer device, a mobile terminal or a processor therein to execute all or part of the steps of the pre-analysis processing method for video coding according to the embodiments of the present application.

Claims (11)

1. A method for pre-analysis processing of video coding, comprising:
detecting a buffer area associated with the pre-analysis module, wherein the buffer area is used for buffering frames to be encoded;
starting the pre-analysis module to pre-analyze the frame to be encoded when the buffer length of the buffer area reaches a basic length, and encoding the frame to be encoded corresponding to the buffer area through an encoding thread when the buffer length of the buffer area exceeds the basic length by a set length; closing the pre-analysis module under the condition that the cache length of the cache area does not reach the basic length; the base length is set according to the designated video coding delay, the video coding delay is introduced by the buffer area, and the set length is determined according to the time consumption of the coding thread to code the frame to be coded.
2. The method according to claim 1, further comprising, after encoding the frame to be encoded corresponding to the buffer area by an encoding thread:
and detecting the real-time coding frame rate of the coding thread, and closing the pre-analysis module when the coding frame rate is lower than a set frame rate threshold, wherein the set frame rate threshold is the coding frame rate corresponding to the condition that video coding reaches a delay threshold.
3. The method according to claim 1, wherein the encoding of the frame to be encoded corresponding to the buffer area by the encoding thread further comprises:
determining a decision result of a skip mode of a coding unit in a frame to be coded, and determining an optimal coding mode based on the decision result;
and performing a skip decision of recursively dividing based on the optimal coding mode.
4. A method of pre-analysis processing of video coding according to any of claims 1-3, further comprising, prior to detecting the buffer area of the pre-analysis module:
detecting a scene mode of current video coding;
closing the pre-analysis module under the condition that the scene mode of the current video coding is a first setting mode;
and expanding the base length in the case that the scene mode of the current video coding is the second setting mode.
5. The method according to claim 1, wherein the encoding of the frame to be encoded corresponding to the buffer area by the encoding thread further comprises:
detecting the real-time encoding time consumption of the encoding thread, adjusting the encoding resolution according to the real-time encoding time consumption, closing the current encoder and using a default encoder to encode video under the condition that the encoding resolution is lower than a set resolution threshold.
6. The method according to claim 1, wherein the encoding of the frame to be encoded corresponding to the buffer area by the encoding thread further comprises:
and marking the to-be-encoded frames with the output size exceeding the set size threshold, closing the current encoder under the condition that the to-be-encoded frames with the corresponding frame types are marked continuously set times, and performing video encoding by using a default encoder.
7. The method according to claim 1, wherein the set length is 1 frame to be encoded.
8. A pre-analysis processing system for video coding, comprising:
the detection module is configured to detect a buffer area associated with the pre-analysis module, wherein the buffer area is used for buffering frames to be encoded;
the processing module is used for starting the pre-analysis module to pre-analyze the frame to be encoded when the buffer length of the buffer area reaches a basic length, and performing encoding of the frame to be encoded corresponding to the buffer area through an encoding thread when the buffer length of the buffer area exceeds the basic length set length; closing the pre-analysis module under the condition that the cache length of the cache area does not reach the basic length; the base length is set according to the designated video coding delay, the video coding delay is introduced by the buffer area, and the set length is determined according to the time consumption of the coding thread to code the frame to be coded.
9. A pre-analysis processing apparatus for video coding, comprising:
a memory and one or more processors;
the memory is configured to store one or more programs;
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the pre-analysis processing method of video coding as claimed in any one of claims 1 to 7.
10. A computer readable storage medium storing computer executable instructions which, when executed by a computer processor, are configured to perform the pre-analysis processing method of video encoding according to any of claims 1-7.
11. A computer program product comprising instructions which, when executed on a computer or processor, cause the computer or processor to perform the method of pre-analysis processing of video encoding according to any of claims 1 to 7.
CN202311077105.2A 2023-08-24 2023-08-24 Pre-analysis processing method, system, equipment and storage medium for video coding Pending CN117061773A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311077105.2A CN117061773A (en) 2023-08-24 2023-08-24 Pre-analysis processing method, system, equipment and storage medium for video coding

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311077105.2A CN117061773A (en) 2023-08-24 2023-08-24 Pre-analysis processing method, system, equipment and storage medium for video coding

Publications (1)

Publication Number Publication Date
CN117061773A true CN117061773A (en) 2023-11-14

Family

ID=88655148

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311077105.2A Pending CN117061773A (en) 2023-08-24 2023-08-24 Pre-analysis processing method, system, equipment and storage medium for video coding

Country Status (1)

Country Link
CN (1) CN117061773A (en)

Similar Documents

Publication Publication Date Title
US8644381B2 (en) Apparatus for reference picture resampling generation and method thereof and video decoding system using the same
JP4847521B2 (en) Block noise removal filtering technology for video encoding according to multiple video standards
US10123050B2 (en) Filtering video data using a plurality of filters
US9414086B2 (en) Partial frame utilization in video codecs
CN108737825B (en) Video data encoding method, apparatus, computer device and storage medium
US10205953B2 (en) Object detection informed encoding
KR101158345B1 (en) Method and system for performing deblocking filtering
US20100027663A1 (en) Intellegent frame skipping in video coding based on similarity metric in compressed domain
US20090304086A1 (en) Method and system for video coder and decoder joint optimization
US9635374B2 (en) Systems and methods for coding video data using switchable encoders and decoders
JP2009540680A (en) Parallel batch decoding of video blocks
US20130195183A1 (en) Video coding efficiency with camera metadata
US20240031576A1 (en) Method and apparatus for video predictive coding
US20050169537A1 (en) System and method for image background removal in mobile multi-media communications
US9565404B2 (en) Encoding techniques for banding reduction
JP2004015501A (en) Apparatus and method for encoding moving picture
CN109803146B (en) Method, apparatus, medium, and device for secondary compression of video
US20090323810A1 (en) Video encoding apparatuses and methods with decoupled data dependency
US20050089232A1 (en) Method of video compression that accommodates scene changes
US10360695B1 (en) Method and an apparatus for enabling ultra-low latency compression of a stream of pictures
CN117061773A (en) Pre-analysis processing method, system, equipment and storage medium for video coding
CN115514960A (en) Video coding method and device, electronic equipment and storage medium
CN113973202A (en) Video encoding method, device, equipment and storage medium
US20070171980A1 (en) Method and Related Apparatus For Decoding Video Streams
US20130329798A1 (en) Inferred key frames for fast initiation of video coding sessions

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