CN117119201B - Compressed video transmission method, device, equipment and storage medium - Google Patents

Compressed video transmission method, device, equipment and storage medium Download PDF

Info

Publication number
CN117119201B
CN117119201B CN202311339932.4A CN202311339932A CN117119201B CN 117119201 B CN117119201 B CN 117119201B CN 202311339932 A CN202311339932 A CN 202311339932A CN 117119201 B CN117119201 B CN 117119201B
Authority
CN
China
Prior art keywords
video frame
compressed
current video
current
frame
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202311339932.4A
Other languages
Chinese (zh)
Other versions
CN117119201A (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.)
Suzhou Metabrain Intelligent Technology Co Ltd
Original Assignee
Suzhou Metabrain Intelligent 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 Suzhou Metabrain Intelligent Technology Co Ltd filed Critical Suzhou Metabrain Intelligent Technology Co Ltd
Priority to CN202311339932.4A priority Critical patent/CN117119201B/en
Publication of CN117119201A publication Critical patent/CN117119201A/en
Application granted granted Critical
Publication of CN117119201B publication Critical patent/CN117119201B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/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
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The application relates to the field of compressed video transmission, and discloses a compressed video transmission method, a compressed video transmission device, electronic equipment and a storage medium. The method is applied to the SoC chip and comprises the following steps: under the condition that the current video frame to be written into the DDR cache is detected, estimating whether the residual space of the DDR cache is enough to cache the compressed current video frame; judging whether to execute frame loss operation on the current video frame according to the estimated result; and according to the judging result, performing frame loss operation or writing operation on the current video frame. By adopting the method, the writing of invalid data into the DDR cache can be avoided, and the frame loss rate can be reduced.

Description

Compressed video transmission method, device, equipment and storage medium
Technical Field
The present invention relates to the field of compressed video transmission, and in particular, to a method, apparatus, device and storage medium for transmitting compressed video.
Background
The SoC (System on Chip) Chip integrating the video compression function performs a frame dropping operation during the process of writing the compressed video into an external DDR (Double Data Rate Synchronous Dynamic Random Access Memory, double rate synchronous dynamic random access memory) buffer space. The following two frame dropping methods are generally adopted:
Mode 1: compressed data of a video frame is continuously written into the DDR buffer space, and if the compressed data can be completely written into the DDR buffer space, an upper layer driver can read all information of the frame. If buffer space overflows during the writing of the current frame into the DDR, namely, the data of the current frame is not completely written into the DDR but the buffer space of the DDR is full, the rest data of the current frame cannot be written into the DDR. In the case that the current frame cannot be completely written into the DDR, the partial frame data already written into the DDR belongs to invalid data and needs to be discarded, because the upper layer driver cannot acquire the complete current frame data at this time.
Mode 2: when the DDR cache space remains relatively large, the writing is stopped, namely, a threshold value with a relatively large value is set, and when the remaining space reaches the threshold value, the writing of a new frame is stopped. The method can avoid the writing of invalid data, but the waste of DDR cache space is caused due to the overlarge residual space, and the frame loss rate is higher.
The mode 1 can generate a large amount of invalid data, and waste the system bus bandwidth of the DDR cache space; the residual space threshold set in the scheme 2 is larger, so that waste of DDR (double data rate) buffer space is caused, and the problem of higher frame loss rate is caused. Therefore, how to avoid generating invalid data and to reduce the frame loss rate is a problem to be solved.
Disclosure of Invention
In view of this, the present application aims to propose a transmission method, apparatus, device and storage medium for compressed video, so as to reduce the frame loss rate and avoid the problem of generating invalid data.
In order to achieve the above purpose, the technical scheme of the application is as follows:
an embodiment of the present application provides a transmission method of compressed video, applied to an SoC chip, including:
under the condition that the current video frame to be written into the DDR cache is detected, estimating whether the residual space of the DDR cache is enough to cache the compressed current video frame;
judging whether to execute frame loss operation on the current video frame according to the estimated result;
and according to the judging result, performing frame loss operation or writing operation on the current video frame.
Optionally, predicting whether the remaining space of the DDR cache is sufficient to cache the compressed current video frame includes:
estimating the data volume of the compressed current video frame;
acquiring the current residual space of the DDR cache;
and under the condition that the current residual space is larger than the compressed data quantity of the current video frame, judging that the frame loss operation is not carried out on the current video frame.
Optionally, predicting whether the remaining space of the DDR cache is sufficient to cache the compressed current video frame includes:
Estimating the writing rate of the current video frame;
estimating the data volume of the compressed current video frame;
estimating the reading rate of the compressed video frames in the DDR cache, wherein the compressed video frames are stored in the DDR cache after the video frames are compressed by the substrate control chip;
acquiring the current residual space of the DDR cache;
and estimating whether the current residual space is enough to cache the compressed current video frame according to the writing rate, the compressed data quantity, the reading rate and the current residual space.
Optionally, predicting whether the current residual space is sufficient to buffer the compressed current video frame according to the writing rate, the compressed data amount, the reading rate and the current residual space includes:
under the condition that the current residual space is smaller than the compressed data volume of the current video frame and the reading rate is larger than the writing rate, judging that the frame loss operation is not executed on the current video frame;
and under the condition that the current residual space is smaller than the compressed data amount of the current video frame and the reading rate is smaller than the writing rate, calculating an estimated value according to the writing rate, the compressed data amount, the reading rate and the current residual space, and judging whether to execute frame loss operation on the current video frame or not based on the estimated value.
Optionally, calculating the predicted value according to the writing rate, the compressed data amount, the reading rate and the current remaining space includes:
estimating the data volume of the compressed current video frame;
estimating the writing time length of the compressed current video frame according to the data volume and the writing rate of the compressed current video frame;
and calculating an estimated value according to the writing time length, the current residual space, the writing rate and the reading rate.
Optionally, calculating the predicted value further includes:
acquiring dynamic parameters corresponding to the writing time length, the writing speed and the reading speed respectively;
and calculating an estimated value based on the current residual space, the writing time length, the writing speed, the reading speed and the acquired dynamic parameters.
Optionally, determining whether to perform a frame loss operation on the current video frame based on the pre-estimated value includes:
under the condition that the predicted value is larger than 0, judging to execute frame loss operation on the current video frame;
in the case where the predicted value is less than 0, it is determined that the frame dropping operation is not performed on the current video frame.
Optionally, estimating the writing rate of the current video frame includes:
acquiring the average writing rate of the video frames written into the DDR cache in the first time period; the first time period is an adjacent time period before the current time;
The average write rate is determined as the write rate of the current video frame.
Optionally, obtaining the average write rate of the video frames written to the DDR cache in the first time period includes:
reading the data quantity of the video frames written into the DDR cache in the first time period;
and determining the average writing rate of the first time period according to the data quantity and the duration of the first time period.
Optionally, estimating the compressed data amount of the current video frame includes:
according to the resolution ratio of the current video frame, acquiring the average data size of the target compressed video frame which is completely written into the DDR cache in the second time period; the resolution of the target compressed video frame is the same as the resolution of the current video frame;
and determining the average data volume of the target compressed video frame as the compressed data volume of the current video frame.
Optionally, estimating the compressed data amount of the current video frame includes:
acquiring the data quantity of all the compressed video frames which are completely written into the DDR cache in a second time period;
dividing the data volume of all the compressed video frames according to the resolution when the resolution of the compressed video frames which are completely written into the DDR buffer memory in the second time period is more than one;
calculating the average data quantity of the compressed video frames corresponding to each resolution;
Constructing a mapping table, and storing all resolutions and corresponding average data amounts into the mapping table;
and acquiring the corresponding average data volume from the mapping table according to the resolution of the current video frame, and determining the average data volume as the compressed data volume of the current video frame.
Optionally, estimating the read rate of the compressed video frames in the DDR cache includes:
acquiring the read data quantity of the compressed video frames in the read DDR cache in a third time period;
determining an average reading rate in a third time period according to the reading data quantity and the duration of the third time period;
the average read rate is determined as the read rate of the compressed video frames in the DDR buffer.
Optionally, the transmission method of the compressed video further includes:
in the case where the number of programs running on the SoC chip increases, the duration of the first period of time is shortened.
Optionally, the transmission method of the compressed video further includes:
verifying whether the judging result is accurate;
and adjusting the dynamic parameters according to the verification result.
Optionally, verifying whether the determination result is accurate includes:
executing a writing operation on the current video frame and verifying whether the current video frame can be completely written into the DDR buffer under the condition that the judgment result is that the frame losing operation is executed on the current video frame; if the current video frame can be completely written into the DDR buffer, the judgment result is inaccurate; if the current video frame cannot be completely written into the DDR buffer, the judgment result is accurate;
Executing a writing operation on the current video frame and verifying whether the current video frame is completely written into the DDR buffer under the condition that the judgment result is that the frame loss operation is not executed on the current video frame; if the current video frame can be completely written into the DDR buffer, the judgment result is accurate; if the current video frame cannot be completely written into the DDR buffer, the judgment result is inaccurate.
Optionally, adjusting the dynamic parameter according to the verification result includes:
when the verification result is accurate and the judgment result is that the frame loss operation is executed on the current video frame, the value of the dynamic parameter is adjusted, so that the calculation result of the estimated value approaches to the direction smaller than 0;
maintaining the current value of the dynamic parameter under the condition that the verification result is accurate and the judgment result is that the frame loss operation is not executed on the current video frame;
when the verification result is inaccurate and the judgment result is that the frame loss operation is executed on the current video frame, the value of the dynamic parameter is adjusted, so that the calculation result of the estimated value approaches to the direction smaller than 0;
and under the condition that the verification result is inaccurate and the judgment result is that the frame loss operation is not executed on the current video frame, adjusting the value of the dynamic parameter to enable the calculation result of the estimated value to approach to the direction larger than 0.
Optionally, the transmission method of the compressed video further includes:
according to the verification result in the fourth time period, the dynamic parameters are adjusted; the fourth time period is a time period after the current time;
the value of the dynamic parameter after the adjustment is determined as a fixed parameter for calculating the predicted value after the fourth period.
According to a second aspect of embodiments of the present application, there is provided a transmission device of compressed video, for implementing the transmission method of compressed video provided in the first aspect of embodiments of the present application, where the device includes:
the comprehensive scheduling analysis module is used for estimating whether the residual space of the DDR cache is enough to cache the compressed current video frame or not under the condition that the current video frame to be written into the DDR cache is detected; judging whether to execute frame loss operation on the current video frame according to the estimated result;
and the writing module is used for executing frame loss operation or writing operation on the current video frame according to the judging result.
According to a third aspect of embodiments of the present application, there is provided a non-transitory readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps in a transmission method of compressed video as in the first aspect of embodiments of the present application.
According to a fourth aspect of embodiments of the present application, there is provided an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps in a method for transmitting compressed video as in the first aspect of embodiments of the present application when the computer program is executed by the processor.
By adopting the transmission method of the compressed video, before video frame data is written into the DDR, whether the current DDR buffer is enough to buffer the compressed current video frame is estimated, so that whether the frame loss operation is executed on the current video frame is judged. If the judgment result is that the frame is lost, the current video frame is directly discarded without compressing and writing the current video frame, and if the judgment result is that the frame is not lost, the writing operation is executed, and the current video frame is compressed and then written into the DDR buffer. According to the method provided by the application, whether the video frame is subjected to frame loss operation can be determined before the video frame is written in, so that invalid data is avoided, meanwhile, whether the DDR residual space is sufficient is estimated for the current video frame, a mode of setting a fixed threshold is not adopted, the problem of cache space waste is avoided, the utilization rate of DDR cache is improved, and the frame loss rate is reduced.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments of the present application will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flowchart of a transmission method of compressed video according to an embodiment of the present application;
fig. 2 is a schematic diagram of a transmission device for compressed video according to an embodiment of the present application;
FIG. 3 is a schematic diagram of a conventional BMC chip compressed video transmission workflow;
FIG. 4 is a schematic diagram illustrating the operation of a BMC chip according to an embodiment of the present application;
fig. 5 is a schematic operation diagram of a compressed video output control module according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
It should be appreciated that reference throughout this specification to "one embodiment" or "an embodiment" means that a particular feature, structure or characteristic described in connection with the embodiment is included in at least one embodiment of the present application. Thus, the appearances of the phrases "in one embodiment" or "in an embodiment" in various places throughout this specification are not necessarily all referring to the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
In various embodiments of the present application, it should be understood that the sequence numbers of the following processes do not mean the order of execution, and the order of execution of the processes should be determined by the functions and internal logic thereof, and should not constitute any limitation on the implementation process of the embodiments of the present application.
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary examples are not representative of all implementations consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present application as detailed in the accompanying claims.
It should be noted that, in the case of no conflict, the embodiments and features in the embodiments may be combined with each other.
In this embodiment, the configuration of the present application will be described by taking a BMC (Baseboard Management Controller, baseboard management control) chip as an example. The BMC chip is an SoC chip and is generally applied to the field of servers, and the BMC chip can transmit local video data to a far end through a network for far-end display and monitoring.
Fig. 3 is a schematic diagram of a conventional BMC chip compressed video transmission workflow. The BMC chip comprises a VGA module, a color space conversion module, a video compression IP module, a compressed video output control module and an EMAC network module. As shown in fig. 3, the procedure of video compression transmission in the conventional scheme is as follows:
(1) The host (host) transmits the video data to the VGA module of the BMC chip through a PCIe bus;
(2) The VGA module processes the video data to generate video frame data in an original RGB format;
(3) The original video frame data in RGB format is converted in color space by a color space conversion module. The color space conversion module converts the RGB format into the YUV format, and the conversion process uses the following matrix conversion formula:
Y =(0.257×R)+ (0.504×G)+(0.098×B) +16;
U=0.148×R-0.291×G + 0.439×B +128;
V=0.439×R-0.368×G-0.071×B+128。
(4) And sending the video frame data in the YUV format generated by conversion into a video compression IP module for compression. There are various formats for video compression, such as h.264, JPEG, AVS, etc.
(5) And writing the compressed video frame data into an external DDR cache space. Before the original image information output by the local display card is transmitted to the far end through the network, video compression is needed, so that the video data volume is reduced, and the occupation of network bandwidth is reduced. The function of the compressed video output control module in fig. 3 is to control the process of writing compressed data into DDR. There are 2 ways of writing in the related art, and they are specifically as follows.
Mode 1: and as long as the DDR cache space is not fully written, the compressed video output control module controls the compressed data to be always written into the DDR cache space.
If the current frame can be completely written into the corresponding DDR buffer control, the writing information (the head address and the tail address in the DDR) of the frame is transmitted to an upper layer driver, and the driver reads the buffer data; if the current frame is not completely written in the writing process, the DDR buffer is full, the compressed video output control module records the head address of the current frame, and takes the head address as the head address written in by the next video frame, namely, the next frame data is used for covering the current frame data. This approach has the problem that when the remaining space is insufficient to write a complete video frame, the DDR cache is written with a large amount of invalid data, and the system bus bandwidth resources are wasted.
Mode 2: setting a threshold value for the remaining space of the DDR buffer, and judging the size of the remaining space of the DDR buffer before writing video frames into the DDR buffer. When the residual space is larger than the set threshold value, writing the current video frame into the DDR cache; and stopping writing data into the DDR buffer when the residual space is smaller than the set threshold value, and performing frame loss processing on the following frames from the current video frame. This approach requires ensuring that the current frame can be written to the DDR completely in advance, and since the video frame cannot determine the amount of data after compression before it is compressed, the threshold value needs to be set large in order to ensure that the current frame can be written to the DDR cache. For example, the maximum resolution in the application scene is 1920×1200, and the threshold needs to be set to 1920×1200×3=6.59 MB (calculated as minimum compression ratio=1). Therefore, this way can cause great waste of DDR buffer space, and the frame loss rate of compressed video is also higher, which can affect the user experience of the remote terminal.
The present application will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Fig. 1 is a flowchart of a transmission method of compressed video according to an embodiment of the present application. As shown in fig. 1, the method includes:
S1: under the condition that the current video frame to be written into the DDR cache is detected, estimating whether the residual space of the DDR cache is enough to cache the compressed current video frame;
s2: judging whether to execute frame loss operation on the current video frame according to the estimated result;
s3: and according to the judging result, performing frame loss operation or writing operation on the current video frame.
In this embodiment, the remaining space of the DDR cache is estimated before the current video frame is compressed. Because there are data writing and reading in the DDR cache at the same time, the data writing can make the residual space of the DDR cache smaller, and the data in the DDR cache can be removed from the flash memory after being read, so that the residual space of the DDR cache is enlarged, and therefore, the residual space of the DDR cache is dynamically changed. In this embodiment, before writing each frame data into the DDR cache, the remaining space of the current DDR cache is estimated for the video frame at the current moment, and whether the current frame can be completely written into the DDR cache is determined.
For the situation that the judgment result is that the frame loss is executed, the current video frame is directly discarded without compressing the current video frame; and for the situation that the judgment result is that the frame loss (namely writing) operation is not executed, the current video frame passes through the video compression IP module, and the compressed video frame data is written into the DDR cache.
In this embodiment, whether to perform the frame loss operation on the current video frame is determined by estimating in advance whether the remaining space of the DDR cache is sufficient to cache the compressed current video frame, so that writing of invalid data into the DDR cache is avoided, and the remaining space of the DDR cache is fully utilized, thereby reducing the frame loss rate.
As an embodiment of the present application, estimating whether the remaining space of the DDR buffer is sufficient to buffer the compressed current video frame includes:
estimating the data volume of the compressed current video frame;
acquiring the current residual space of the DDR cache;
and under the condition that the current residual space is larger than the compressed data quantity of the current video frame, judging that the frame loss operation is not carried out on the current video frame.
Fig. 4 is a schematic diagram illustrating the operation of a BMC chip according to an embodiment of the present application. As shown in fig. 4, in this embodiment, the output of the color space conversion module in the BMC chip is connected to the compressed video output control module in addition to the video compression IP module. The compressed video output control module acquires information of a current video frame, predicts the data volume of the compressed video frame according to the information of the current video frame, and reads the size of the residual space in the current DDR cache.
In this embodiment, the compressed video output control module obtains the information of the video frame currently to be written into the DDR cache and the current remaining space information of the DDR cache, and determines whether the frame loss operation is required for the current frame. Firstly, estimating the compressed data amount of a current video frame, then comparing the estimated compressed data amount with the current residual space of the DDR cache, and when the estimated compressed data amount of the current frame is larger than the compressed data amount of the current video frame, completely writing the current video frame into the DDR cache.
As an embodiment of the present application, estimating whether the remaining space of the DDR buffer is sufficient to buffer the compressed current video frame includes:
estimating the writing rate of the current video frame;
estimating the data volume of the compressed current video frame;
estimating the reading rate of the compressed video frames in the DDR cache, wherein the compressed video frames are stored in the DDR cache after the video frames are compressed by the substrate control chip;
acquiring the current residual space of the DDR cache;
and estimating whether the current residual space is enough to cache the compressed current video frame according to the writing rate, the compressed data quantity, the reading rate and the current residual space.
In one embodiment, as shown in fig. 4, the compressed video output control module obtains information of a current video frame, predicts the compressed data amount of the video frame according to the information of the current video frame, and simultaneously, the compressed video output control module predicts whether the size of the residual space of the DDR cache is enough to write the compressed data of the complete current video frame in the process of writing the compressed current video frame into the DDR cache according to the read size of the residual space in the current DDR cache.
Specifically, whether the remaining space in the DDR cache is sufficient to completely write the current video frame is affected by the write rate of the current video frame, the amount of data compressed by the current video frame, and the read rate of the read data in the DDR cache. In this embodiment, the above influencing factors are estimated by the compressed video output control module. And predicting whether the current residual space is enough to cache the compressed current video frame according to the predicted writing rate, the predicted compressed data amount, the predicted reading rate and the residual space of the current DDR cache.
As an embodiment of the present application, predicting whether the current residual space is sufficient to buffer the compressed current video frame according to the writing rate, the compressed data amount, the reading rate and the current residual space includes:
Under the condition that the current residual space is smaller than the compressed data volume of the current video frame and the reading rate is larger than the writing rate, judging that the frame loss operation is not executed on the current video frame;
and under the condition that the current residual space is smaller than the compressed data amount of the current video frame and the reading rate is smaller than the writing rate, calculating an estimated value according to the writing rate, the compressed data amount, the reading rate and the current residual space, and judging whether to execute frame loss operation on the current video frame or not based on the estimated value.
In one embodiment, the rate at which data is read from the DDR buffer and the rate at which compressed current video frames are written to the DDR buffer need to be considered when the remaining space of the DDR buffer is less than the compressed data amount of the current video frames. When the read rate is greater than the write rate, the remaining space in the DDR buffer will gradually increase over time, i.e., the current video frame can be completely written, so no frame dropping operation is performed on the current video frame.
When the remaining space of the DDR cache is smaller than the data size after the current video compression and the read rate is smaller than the write rate, the remaining space of the DDR cache gradually decreases with time. In this case, it is necessary to consider whether or not the current remaining space in the DDR cache is sufficient to offset the difference between the amount of write data and the amount of read data. In this embodiment, an estimated value is calculated according to the writing rate, the compressed data amount, the reading rate and the current remaining space, and specific judgment is performed through the estimated value.
As an embodiment of the present application, calculating an estimated value according to a writing rate, a compressed data amount, a reading rate, and a current remaining space includes:
estimating the data volume of the compressed current video frame;
estimating the writing time length of the compressed current video frame according to the data volume and the writing rate of the compressed current video frame;
and calculating an estimated value according to the writing time length, the current residual space, the writing rate and the reading rate.
As one embodiment of the present application, determining whether to perform a frame loss operation on a current video frame based on the predicted value includes:
under the condition that the predicted value is larger than 0, judging to execute frame loss operation on the current video frame;
in the case where the predicted value is less than 0, it is determined that the frame dropping operation is not performed on the current video frame.
In one embodiment, when the remaining space of the DDR cache is less than the current video compressed data amount and the read rate is less than the write rate, the predicted value is calculated by the following expression:
estimated value = estimated write time length-remaining space +.f (write rate-read rate).
In this embodiment, based on the estimated writing time of the current video frame, the estimated remaining space of the current DDR buffer, the rate of writing the current video frame into the DDR buffer, and the rate of reading the data in the current DDR buffer, an estimated value is calculated, and whether to perform a frame loss operation on the current video frame is determined according to the calculation result of the estimated value.
As can be seen from the above expression, when the predicted value is greater than 0, it indicates that the current video frame has not been written, and the remaining space of the DDR cache is already consumed, that is, the current video frame cannot be completely written into the DDR cache, so that it is determined that the frame loss operation is performed on the current video frame; when the predicted value is smaller than 0, the residual space of the DDR buffer is not consumed when the writing of the current video frame is finished, namely, the current video frame can be completely written into the DDR buffer, so that the current video frame is judged not to be subjected to frame loss, and the current video frame is normally written into the DDR.
In this embodiment, comprehensive analysis is performed according to the writing and removing conditions of data in the DDR cache, the remaining space of the DDR cache is utilized to the maximum, an accurate estimated result is obtained by calculating an estimated value, and the frame loss rate in the transmission process is reduced.
As an embodiment of the present application, calculating the predicted value further includes:
acquiring dynamic parameters corresponding to the writing time length, the writing speed and the reading speed respectively;
and calculating an estimated value based on the current residual space, the writing time length, the writing speed, the reading speed and the acquired dynamic parameters.
In one embodiment, when calculating the predicted value, respective dynamic parameters are set for the estimated writing duration, writing rate, and reading rate, and the predicted value is calculated according to the following expression:
Pre-estimation = parameter 1 x write duration-residual space ≡ (parameter 2 x write rate-parameter 3 x read rate).
Since the basic data (for example, the estimated writing time length) affecting the calculation result of the estimated value is the estimated result, in order to further improve the accuracy of the calculation result of the estimated value, a corresponding parameter is set for each estimated basic data (for example, the estimated writing time length). In this embodiment, the parameters corresponding to each estimated basic data are dynamic parameters. Specifically, the default values of the parameter 1, the parameter 2 and the parameter 3 are 1, the default values are adopted for calculation when the predicted value is calculated for the first time, and in the subsequent calculation, dynamic iterative optimization is carried out according to the judgment result and the verification result, so that the dynamic parameters are finely adjusted.
In this embodiment, by adding dynamic parameters to the basic data for calculating the predicted value, the dynamic parameters (parameter 1, parameter 2 and parameter 3) are fine-tuned conveniently according to the judgment (whether to lose a frame) result and the actual execution result, so as to improve the accuracy of the calculated result of the predicted value and further improve the accuracy of the judgment result.
As one embodiment of the present application, predicting the writing rate of the current video frame includes:
Acquiring the average writing rate of the video frames written into the DDR cache in the first time period; the first time period is an adjacent time period before the current time;
the average write rate is determined as the write rate of the current video frame.
In the above embodiment, the writing rate of the current video frame is estimated, and the average writing rate in a period of time before the current time is obtained may be used. In order to ensure that the estimated writing rate is as accurate as possible, a period of time adjacent to the current moment is selected, and based on the writing condition of the video frames in the period of time, the average writing rate in the period of time is determined. In this embodiment, the duration of the first period is generally set in the range of 1-5 seconds.
As one embodiment of the present application, obtaining an average write rate of video frames written to a DDR cache for a first period of time includes:
reading the data quantity of the video frames written into the DDR cache in the first time period;
and determining the average writing rate of the first time period according to the data quantity and the duration of the first time period.
In the above embodiment, the average write rate in the first period of time is determined by reading the amount of data of the compressed video frames that have been written to the DDR cache in the first period of time. Specifically, the average write rate may be calculated based on the total data amount of video frames that have been written to the DDR cache during the first time period and the duration of the first time period.
As an embodiment of the present application, estimating the data amount of the compressed current video frame includes:
according to the resolution ratio of the current video frame, acquiring the average data size of the target compressed video frame which is completely written into the DDR cache in the second time period; the resolution of the target compressed video frame is the same as the resolution of the current video frame;
and determining the average data volume of the target compressed video frame as the compressed data volume of the current video frame.
In one embodiment, the video frames completely written into the DDR cache within a period of time (second period of time) before the current time are searched, and the compressed data amount corresponding to the video frames with the same resolution as the current video frame is obtained. For example, the resolution of the current video frame is 1920×1080, then the video frame which has been completely written into the DDR buffer within a period of time before the current time and has the resolution of 1920×1080 is acquired, the compressed data volume corresponding to the video frame is acquired, and the average data volume after the video frames are compressed is calculated:
average data amount = sum of compressed data amounts of all video frames corresponding to the current resolution/(number of frames).
And taking the calculated average data quantity as the estimated compressed data quantity of the current video frame. In this embodiment, the second period is not necessarily a period adjacent to the current time, but when the second period is set, it is necessary to ensure that there is at least one video frame with the same resolution as the current video frame that is completely written into the DDR cache in the second period.
In one embodiment, a threshold number of video frames may be further set, and when the second time period is determined, it is ensured that the number of video frames completely written into the DDR cache in the second time period reaches the threshold number, so that accuracy of an estimated result of the compressed data amount is improved. For example, if the number threshold is set to 60, when determining the second period, it is necessary to ensure that the number of video frames transmitted in the second period, which is the same as the resolution of the current frame, is at least 60.
As an embodiment of the present application, estimating the data amount of the compressed current video frame includes:
acquiring the data quantity of all the compressed video frames which are completely written into the DDR cache in a second time period;
dividing the data volume of all the compressed video frames according to the resolution when the resolution of the compressed video frames which are completely written into the DDR buffer memory in the second time period is more than one;
calculating the average data quantity of the compressed video frames corresponding to each resolution;
constructing a mapping table, and storing all resolutions and corresponding average data amounts into the mapping table;
and acquiring the corresponding average data volume from the mapping table according to the resolution of the current video frame, and determining the average data volume as the compressed data volume of the current video frame.
In one embodiment, during writing of video data into the DDR cache, a video switch condition may occur, in which case the resolution of the video frame to be written may change. In order to conveniently and quickly determine the data volume of the compressed current video frame, statistics can be carried out on all video frames which are completely written into DDR in a second time period, the video frames are divided according to resolutions, the average data volume corresponding to each resolution is calculated, and a mapping table is generated based on the calculated average data volume and the corresponding resolution. When the resolution of the current video frame to be written changes, the corresponding average data size can be directly obtained from the mapping table according to the resolution of the current video frame and used as the predicted value of the compressed data size of the current video frame.
In this embodiment, the resolution and the corresponding compressed tie data amount are pre-built, so that when the compressed data amount of the current video frame is estimated, recalculation is not needed, thereby improving the estimated efficiency and reducing the occupation of computing resources.
As one embodiment of the present application, predicting a read rate of a compressed video frame in a DDR cache includes:
Acquiring the read data quantity of the compressed video frames in the read DDR cache in a third time period;
determining an average reading rate in a third time period according to the reading data quantity and the duration of the third time period;
the average read rate is determined as the read rate of the compressed video frames in the DDR buffer.
In one embodiment, the amount of data in the DDR cache that is read a period of time prior to the current time is obtained, and the data read rate for that period of time is calculated. In this embodiment, in order to more accurately estimate the reading rate, the third time period needs to be set as close to the current time as possible, and in general, the third time period is directly set to a period adjacent to the current time as the third time period, and the duration of the third time period is generally set in the range of 1-5 seconds.
And calculating the average reading rate according to the data quantity read in the third time period and the duration of the third time period, wherein the average reading rate is used as the estimated reading rate in the DDR cache in the process of writing the current frame into the DDR cache.
As an embodiment of the present application, the transmission method of compressed video further includes:
in the case where the number of programs running on the SoC chip increases, the duration of the first period of time is shortened.
In one embodiment, the data write rate for a period of time prior to the current time may fluctuate significantly, subject to an increase in the number of programs running on the BMC chip. In this case, the duration of the first period of data needs to be appropriately shortened to obtain the estimated result closer to the current time. For example, when the number of programs running on the BMC chip is small, a relatively long duration (for example, set to 4 seconds) of the first time period may be set, and when the number of programs running on the BMC chip is large, the writing rate in the previous 4 seconds of the current time is toggled relatively large, so that the duration of the first time period is appropriately shortened (for example, shortened to 2 seconds), so as to obtain a predicted result closer to the current time, further obtain a more accurate predicted value calculation result, and improve the accuracy of a judgment result of whether the current video frame needs to execute the frame loss operation.
Similarly, the duration of the third time period set in the process of predicting the read rate is also suitable for the adjustment mode, and when the number of programs running on the BMC chip is increased, the duration of the third time period of the data can be properly shortened in order to avoid overlarge deviation of the predicted result caused by stirring of the write rate.
As an embodiment of the present application, the transmission method of compressed video further includes:
verifying whether the judging result is accurate;
and adjusting the dynamic parameters according to the verification result.
In one embodiment, after a determination result of whether to perform frame loss on the current video frame is obtained by calculating the predicted value, the determination result is verified. And adjusting dynamic parameters used for calculating the predicted value according to the actual result and the judging result.
As one embodiment of the present application, verifying whether the determination result is accurate includes:
executing a writing operation on the current video frame and verifying whether the current video frame can be completely written into the DDR buffer under the condition that the judgment result is that the frame losing operation is executed on the current video frame; if the current video frame can be completely written into the DDR buffer, the judgment result is inaccurate; if the current video frame cannot be completely written into the DDR buffer, the judgment result is accurate;
executing a writing operation on the current video frame and verifying whether the current video frame is completely written into the DDR buffer under the condition that the judgment result is that the frame loss operation is not executed on the current video frame; if the current video frame can be completely written into the DDR buffer, the judgment result is accurate; if the current video frame cannot be completely written into the DDR buffer, the judgment result is inaccurate.
As an embodiment of the present application, adjusting the dynamic parameter according to the verification result includes:
when the verification result is accurate and the judgment result is that the frame loss operation is executed on the current video frame, the value of the dynamic parameter is adjusted, so that the calculation result of the estimated value approaches to the direction smaller than 0;
maintaining the current value of the dynamic parameter under the condition that the verification result is accurate and the judgment result is that the frame loss operation is not executed on the current video frame;
when the verification result is inaccurate and the judgment result is that the frame loss operation is executed on the current video frame, the value of the dynamic parameter is adjusted, so that the calculation result of the estimated value approaches to the direction smaller than 0;
and under the condition that the verification result is inaccurate and the judgment result is that the frame loss operation is not executed on the current video frame, adjusting the value of the dynamic parameter to enable the calculation result of the estimated value to approach to the direction larger than 0.
In this embodiment, the dynamic parameters (parameter 1, parameter 2, and parameter 3) are fine-tuned according to the verification result and the judgment result.
Specifically, if the judgment result is that the frame is lost and the verification result is that the frame is lost, the dynamic parameters are adjusted towards the direction of not losing the frame: lowering parameter 1, lowering parameter 2, and raising parameter 3;
If the judgment result is that the frame is not lost, the verification result is that the frame is not lost, and the current dynamic parameters are kept unchanged;
if the judgment result is that the frame is lost, and the verification result is that the frame is not lost, the dynamic parameters are adjusted towards the direction of the frame not lost: lowering parameter 1, lowering parameter 2, and raising parameter 3;
if the judgment result is that the frame is not lost, and the verification result is that the frame is lost, the dynamic parameters are adjusted towards the frame loss direction: raise parameter 1, raise parameter 2, lower parameter 3.
It is noted that the values do not easily fluctuate too much each time the dynamic parameters are adjusted. For example, the values of parameter 1, parameter 2 and parameter 3 may be fine-tuned in a proportion of 5% -10% each time. In this embodiment, the accuracy of the calculation result of the estimated value is improved by fine-tuning the dynamic parameter used for calculating the estimated value according to the verification result, so that the judgment of whether the current video frame needs to be lost is more accurate.
As an embodiment of the present application, the transmission method of compressed video further includes:
according to the verification result in the fourth time period, the dynamic parameters are adjusted; the fourth time period is a time period after the current time;
the value of the dynamic parameter after the adjustment is determined as a fixed parameter for calculating the predicted value after the fourth period.
In one embodiment, the dynamic parameters are optimized for a specified period of time. In particular, the dynamic parameters are iteratively fine-tuned in a fourth time period, and the parameter values optimized to a certain degree are fixed. The optimized iteration number depends on the set duration of the fourth time period, and in this embodiment, the duration of the fourth time period may be set according to actual needs, which is not limited in this application.
In this embodiment, the dynamic parameters optimized to a certain extent are converted into fixed parameters, and the fixed parameter values are adopted in the subsequent calculation process of the predicted value, so that the occupation of calculation resources is reduced while the accurate judgment result is ensured to be obtained.
Based on the same inventive concept, an embodiment of the present application provides a transmission apparatus for compressed video. Referring to fig. 2, fig. 2 is a schematic diagram of a transmission device 200 for compressed video according to an embodiment of the present application. As shown in fig. 2, the apparatus includes:
the comprehensive scheduling analysis module is used for estimating whether the residual space of the DDR cache is enough to cache the compressed current video frame or not under the condition that the current video frame to be written into the DDR cache is detected; judging whether to execute frame loss operation on the current video frame according to the estimated result;
And the writing module is used for executing frame loss operation or writing operation on the current video frame according to the judging result.
Fig. 5 is a schematic operation diagram of a compressed video output control module according to an embodiment of the present application. As shown in fig. 5, the compressed video output module includes: the system comprises a DDR writing rate statistics module 301, a frame information statistics module 302, a current frame writing time estimation module 303, a DDR residual space acquisition module 304, a DDR reading rate estimation module 305, a comprehensive dispatching analysis module 306 and a judgment result detection module 307.
In this embodiment, the functions of each sub-module in the compressed video output control module are as follows:
(1) The function implemented by the DDR write rate statistics module 301 is to count the average rate DDR_wr_speed_estime of the BMC chip writing compressed video to the DDR buffer space during the T0 period. Wherein, T0 may be a default value of a register, or may be configured by a user, and the time may be adjusted in real time, and the principle is that: when more software programs are run in the operating system running on the BMC, and the state of the operating system is unstable, the T0 time can be set shorter; when there are few software programs running in the operating system running on the BMC, the T0 time may be set longer when the operating system is relatively stable.
(2) The frame information statistics module 302, the function of the sub-module, counts the resolution of the frame that has completed the complete writing to the DDR and the corresponding data amount written to the DDR, and further obtains the relationship between the resolution and the compression multiple, and it should be noted that, before the current frame finishes writing to the DDR, the specific data amount of the current frame cannot be known, because the frame data is compressed, and the compression ratio is different for each frame, some may be 10 times compression, and some may be 20 times compression or higher. So that the specific compression of the frame data is not known until the complete transmission is completed.
The frame information statistics module 302 also generates a mapping table to count the average value comp_data_size_average of the corresponding resolution and the size of the data volume after actual compression in the period T1, where T1 is a default value, or may be configured and adjusted in real time by a user, and the setting principle is the same as T0.
When the current frame data arrives, searching and obtaining an average value cur_frame_size_estimate corresponding to the current frame in a mapping table according to the resolution of the current frame (the resolution information can be obtained before the current frame is compressed), so as to estimate the data quantity to be transmitted by the current frame.
(3) The function of the current frame writing time estimating module 303 is to estimate the duration of writing the DDR of the current frame according to the average rate ddr_wr_speed_estimate obtained by the DDR writing rate counting module 301 and the estimated value cur_frame_size_estimate of the data size to be transmitted of the current frame obtained by the frame information counting module 302:
cur_frame_wr_time_estimate=cur_frame_size_estimate/DDR_wr_speed_ estimate。
the DDR residual space acquisition module 304 functions to perform prediction and calculation based on the residual space of the DDR cache. The module records information such as a read address of a bus for driving reading and a tail address of last frame data in the DDR, and estimates the residual space_use of the DDR cache before writing the current frame into the DDR.
(5) The function of the DDR read rate estimation module 305 is to estimate the average rate DDR_rd_speed_estimate of the drive read compressed video data during the T2 period. Wherein, T2 can be set by default or by a user, and the method and principle of setting are the same as T0.
(6) The comprehensive scheduling analysis module 306 performs comprehensive analysis on the estimated results of the current frame writing time estimating module 303, the DDR residual space acquiring module 304 and the DDR reading rate estimating module 305 to obtain the judgment of writing into the DDR buffer or losing the frame of the current frame. When the DDR residual Space space_use is smaller than the pre-estimated value of the compressed data amount of the current frame, but ddr_rd_speed_estimate < ddr_wr_speed_estimate, the pre-estimated value Result is calculated according to dynamic parameters PARAM0, PARAM1, PARAM 2.
If Result >0, then the decision results: the current frame needs to be lost, and DDR is not written in;
if Result <0, then the decision results: the current frame is written into DDR, and frame loss is not needed.
(7) The function of the determination result detection module 307 is to track and analyze the determination result of the integrated scheduling analysis module 306, so as to verify whether the determination result of the integrated scheduling analysis module 306 is accurate.
If the judgment result of the comprehensive dispatching analysis module is that the current frame is to be dropped, the module is to write the current frame, and whether the frame is really to be dropped or not is detected in the actual writing process, and if the DDR can be normally written, the result of the comprehensive dispatching analysis module is inaccurate; if DDR cannot be written normally, the result of the comprehensive scheduling analysis module is accurate.
If the judgment result of the comprehensive dispatching analysis module is that the current frame is not lost, the module normally writes the current frame, and if DDR can be normally written, the result of the comprehensive dispatching analysis module is accurate; if DDR cannot be written normally, the result of the integrated dispatch analysis module is inaccurate.
And fine-tuning dynamic parameters PARAM0, PARAM1 and PARAM2 according to the verification result. Parameter adjustment is completed in the appointed actual T3 section, and the dynamic parameters are adjusted to the optimal values, namely, the judgment accuracy of the comprehensive dispatching analysis module 306 is the highest. The value of T3 may be a default value or may be configured by a user.
It is noted that after the parameter adjustment in the T3 period is completed, the operation of writing into the DDR or discarding the current frame is directly performed according to the determination result of the integrated scheduling analysis module 306, and the parameter adjustment is not performed, that is, a relatively better parameter value has been found, and the video frame determined as needing frame loss is not written into the DDR, thereby avoiding occupation of DDR bandwidth resources.
As an embodiment of the present application, the apparatus further comprises:
the frame information statistics module is used for estimating the data quantity of the compressed current video frame;
the DDR residual space acquisition module is used for acquiring the current residual space of the DDR cache;
and the comprehensive scheduling analysis module is used for judging that the frame loss operation is not executed on the current video frame under the condition that the current residual space is larger than the compressed data quantity of the current video frame.
As an embodiment of the present application, the apparatus further comprises:
the DDR writing rate statistics module is used for estimating the writing rate of the current video frame;
the frame information statistics module is used for estimating the data quantity of the compressed current video frame;
the DDR reading rate estimating module is used for estimating the reading rate of compressed video frames in the DDR cache, wherein the compressed video frames are stored in the DDR cache after being compressed by the substrate control chip;
The DDR residual space acquisition module is used for acquiring the current residual space of the DDR cache;
and the comprehensive scheduling analysis module is used for estimating whether the current residual space is enough to cache the compressed current video frame according to the writing rate, the compressed data volume, the reading rate and the current residual space.
As an embodiment of the present application, the integrated scheduling analysis module is specifically configured to perform the following steps:
under the condition that the current residual space is smaller than the compressed data volume of the current video frame and the reading rate is larger than the writing rate, judging that the frame loss operation is not executed on the current video frame;
and under the condition that the current residual space is smaller than the compressed data amount of the current video frame and the reading rate is smaller than the writing rate, calculating an estimated value according to the writing rate, the compressed data amount, the reading rate and the current residual space, and judging whether to execute frame loss operation on the current video frame or not based on the estimated value.
As an implementation mode of the application, the comprehensive scheduling analysis module is further used for estimating the writing time length of the compressed current video frame according to the data volume and the writing rate of the compressed current video frame; and calculating an estimated value according to the writing time length, the current residual space, the writing rate and the reading rate.
As an implementation mode of the application, the comprehensive scheduling analysis module is further used for obtaining dynamic parameters corresponding to the writing duration, the writing rate and the reading rate; and calculating an estimated value based on the current residual space, the writing time length, the writing speed, the reading speed and the acquired dynamic parameters.
As an implementation mode of the application, the comprehensive scheduling analysis module is further configured to determine to perform a frame loss operation on a current video frame when the predicted value is greater than 0; in the case where the predicted value is less than 0, it is determined that the frame dropping operation is not performed on the current video frame.
As an implementation mode of the application, the DDR write rate statistics module is configured to obtain an average write rate of video frames written into the DDR cache in a first period of time; the first time period is an adjacent time period before the current time; the average write rate is determined as the write rate of the current video frame.
As one embodiment of the present application, the DDR write rate statistics module is configured to read a data amount of a video frame written into the DDR cache in a first period of time; and determining the average writing rate of the first time period according to the data quantity and the duration of the first time period.
As an implementation mode of the application, the frame information statistics module is used for acquiring the average data size of the target compressed video frame which is completely written into the DDR cache in the second time period according to the resolution of the current video frame; the resolution of the target compressed video frame is the same as the resolution of the current video frame; and determining the average data volume of the target compressed video frame as the compressed data volume of the current video frame.
As an implementation mode of the application, the frame information statistics module is used for acquiring the data quantity of all the compressed video frames which are completely written into the DDR cache in the second time period; dividing the data volume of all the compressed video frames according to the resolution when the resolution of the compressed video frames which are completely written into the DDR buffer memory in the second time period is more than one; calculating the average data quantity of the compressed video frames corresponding to each resolution; constructing a mapping table, and storing all resolutions and corresponding average data amounts into the mapping table; and acquiring the corresponding average data volume from the mapping table according to the resolution of the current video frame, and determining the average data volume as the compressed data volume of the current video frame.
As an implementation mode of the application, the DDR read rate estimation module is configured to obtain a read data amount of the compressed video frame in the DDR cache that has been read in a third time period; determining an average reading rate in a third time period according to the reading data quantity and the duration of the third time period; the average read rate is determined as the read rate of the compressed video frames in the DDR buffer.
As an embodiment of the present application, the apparatus further comprises:
the judging result detection module is used for verifying whether the judging result is accurate or not;
And the comprehensive scheduling analysis module is also used for adjusting the dynamic parameters according to the verification result.
As an embodiment of the present application, the determination result detection module is specifically configured to perform the following steps:
executing a writing operation on the current video frame and verifying whether the current video frame can be completely written into the DDR buffer under the condition that the judgment result is that the frame losing operation is executed on the current video frame; if the current video frame can be completely written into the DDR buffer, the judgment result is inaccurate; if the current video frame cannot be completely written into the DDR buffer, the judgment result is accurate;
executing a writing operation on the current video frame and verifying whether the current video frame is completely written into the DDR buffer under the condition that the judgment result is that the frame loss operation is not executed on the current video frame; if the current video frame can be completely written into the DDR buffer, the judgment result is accurate; if the current video frame cannot be completely written into the DDR buffer, the judgment result is inaccurate.
As an embodiment of the present application, the integrated scheduling analysis module is configured to perform the following steps:
when the verification result is accurate and the judgment result is that the frame loss operation is executed on the current video frame, the value of the dynamic parameter is adjusted, so that the calculation result of the estimated value approaches to the direction smaller than 0;
Maintaining the current value of the dynamic parameter under the condition that the verification result is accurate and the judgment result is that the frame loss operation is not executed on the current video frame;
when the verification result is inaccurate and the judgment result is that the frame loss operation is executed on the current video frame, the value of the dynamic parameter is adjusted, so that the calculation result of the estimated value approaches to the direction smaller than 0;
and under the condition that the verification result is inaccurate and the judgment result is that the frame loss operation is not executed on the current video frame, adjusting the value of the dynamic parameter to enable the calculation result of the estimated value to approach to the direction larger than 0.
As an implementation mode of the application, the comprehensive scheduling analysis module is further configured to adjust the dynamic parameter according to the verification result in the fourth time period; the fourth time period is a time period after the current time; the value of the dynamic parameter after the adjustment is determined as a fixed parameter for calculating the predicted value after the fourth period.
Based on the same inventive concept, an embodiment of the present application provides a non-volatile readable storage medium having stored thereon a computer program which, when executed by a processor, implements steps in a transmission method of compressed video as provided in any of the above embodiments of the present application.
Based on the same inventive concept, an embodiment of the present application provides an electronic device. The electronic device includes:
the system comprises a memory, a processor and a computer program stored in the memory and capable of running on the processor, wherein the processor executes the steps in the method for transmitting compressed video provided in any of the embodiments of the present application.
The specific manner in which the various modules perform the operations in the apparatus of the above embodiments have been described in detail in connection with the embodiments of the method, and will not be described in detail herein.
The foregoing description of the preferred embodiments of the present invention is not intended to limit the invention to the precise form disclosed, and any modifications, equivalents, and variations which fall within the spirit and principles of the present invention are intended to be included within the scope of the present invention.
For the purposes of simplicity of explanation, the methodologies are shown as a series of acts, but one of ordinary skill in the art will recognize that the subject application is not limited by the order of acts described, as some acts may, in accordance with the subject application, occur in other orders or concurrently. Further, those skilled in the art will also appreciate that the embodiments described in the specification are all preferred embodiments and that the acts and components referred to are not necessarily required for the present application.
It will be apparent to those skilled in the art that embodiments of the present application may be provided as a method, apparatus, or computer program product. Accordingly, the present embodiments may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present application may take the form of a computer program product on one or more computer-usable non-volatile readable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
Embodiments of the present application are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present embodiments have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. It is therefore intended that the following claims be interpreted as including the preferred embodiments and all such alterations and modifications as fall within the scope of the embodiments of the present application.
Finally, it is further noted that relational terms such as first and second, and the like are 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. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal 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 terminal. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or terminal device comprising the element.
The foregoing has described in detail the transmission method, apparatus, device and storage medium of compressed video provided by the present application, and specific examples have been applied herein to illustrate the principles and embodiments of the present application, and the above examples are only used to help understand the method and core idea of the present application; meanwhile, as those skilled in the art will vary in the specific embodiments and application scope according to the ideas of the present application, the contents of the present specification should not be construed as limiting the present application in summary.

Claims (19)

1. The transmission method of the compressed video is characterized by being applied to an SoC chip and comprising the following steps:
under the condition that the current video frame to be written into the DDR cache is detected, estimating whether the residual space of the DDR cache is enough to cache the compressed current video frame or not; the size of the residual space dynamically changes according to data writing and data reading in the DDR cache;
judging whether to execute frame loss operation on the current video frame according to the estimated result;
according to the judgment result, performing frame loss operation on the current video frame, or writing the compressed current video frame into the DDR cache;
the estimating whether the residual space of the DDR buffer is enough to buffer the compressed current video frame comprises the following steps:
estimating the writing rate of the compressed current video frame;
estimating the data volume of the compressed current video frame;
estimating the reading rate of the compressed video frames in the DDR cache, wherein the compressed video frames are stored in the DDR cache after the video frames are compressed by a substrate control chip;
acquiring the current residual space of the DDR cache;
estimating whether the current residual space is sufficient to buffer the compressed current video frame according to the writing rate, the compressed data amount, the reading rate and the current residual space, including: and under the condition that the current residual space is smaller than the compressed data volume of the current video frame and the reading rate is larger than the writing rate, judging that the frame loss operation is not executed on the current video frame.
2. The method for transmitting compressed video according to claim 1, wherein estimating whether the remaining space of the DDR buffer is sufficient to buffer the compressed current video frame comprises:
estimating the data volume of the compressed current video frame;
acquiring the current residual space of the DDR cache;
and under the condition that the current residual space is larger than the compressed data quantity of the current video frame, judging that the frame loss operation is not executed on the current video frame.
3. The method according to claim 1, wherein estimating whether the current residual space is sufficient to buffer the compressed current video frame based on the writing rate, the compressed data amount, the reading rate, and the current residual space, further comprises:
and under the condition that the current residual space is smaller than the compressed data amount of the current video frame and the reading rate is smaller than the writing rate, calculating a predicted value according to the writing rate, the compressed data amount, the reading rate and the current residual space, and judging whether to execute frame loss operation on the current video frame based on the predicted value.
4. The transmission method of compressed video according to claim 3, wherein calculating an estimated value based on the writing rate, the compressed data amount, the reading rate, and the current remaining space comprises:
estimating the data volume of the compressed current video frame;
estimating the writing time length of the compressed current video frame according to the data volume of the compressed current video frame and the writing rate;
and calculating the pre-estimated value according to the writing time length, the current residual space, the writing rate and the reading rate.
5. The transmission method of compressed video according to claim 4, wherein calculating the predicted value further comprises:
acquiring dynamic parameters corresponding to the writing time length, the writing speed and the reading speed respectively;
and calculating the estimated value based on the current residual space, the writing time length, the writing speed, the reading speed and the acquired dynamic parameters.
6. The transmission method of compressed video according to claim 3, wherein determining whether to perform a frame loss operation on the current video frame based on the predetermined value comprises:
Under the condition that the predicted value is larger than 0, judging that the frame loss operation is carried out on the current video frame;
and under the condition that the preset value is smaller than 0, judging that the frame loss operation is not carried out on the current video frame.
7. The method of claim 1, wherein predicting the write rate of the current video frame comprises:
acquiring the average writing rate of the video frames written into the DDR cache in a first time period; the first time period is an adjacent time period before the current time;
and determining the average writing rate as the writing rate of the current video frame.
8. The method for transmitting compressed video according to claim 7, wherein obtaining the average write rate of the video frames written to the DDR cache in the first period of time comprises:
reading the data quantity of the video frames written into the DDR cache in the first time period;
and determining the average writing rate of the first time period according to the data quantity and the duration of the first time period.
9. The method for transmitting compressed video according to claim 2, wherein estimating the amount of data compressed by the current video frame comprises:
According to the resolution ratio of the current video frame, acquiring the average data volume of the target compressed video frame which is completely written into the DDR cache in a second time period; the resolution of the target compressed video frame is the same as the resolution of the current video frame;
and determining the average data volume of the target compressed video frame as the compressed data volume of the current video frame.
10. The method for transmitting compressed video according to claim 2, wherein estimating the amount of data compressed by the current video frame comprises:
acquiring the data quantity of all the compressed video frames which are completely written into the DDR cache in a second time period;
dividing the data volume of all the compressed video frames according to the resolution when the resolution of the compressed video frames which are completely written into the DDR buffer in the second time period is more than one;
calculating the average data quantity of the compressed video frames corresponding to each resolution;
constructing a mapping table, and storing all resolutions and corresponding average data amounts into the mapping table;
and acquiring a corresponding average data volume from the mapping table according to the resolution of the current video frame, and determining the average data volume as the compressed data volume of the current video frame.
11. The transmission method of compressed video according to claim 1, wherein estimating the read rate of the frames of compressed video in the DDR cache includes:
acquiring the read data quantity of the compressed video frames in the DDR buffer after the read data quantity is read in a third time period;
determining an average reading rate in the third time period according to the reading data quantity and the duration of the third time period;
and determining the average reading rate as the reading rate of compressed video frames in the DDR buffer.
12. The transmission method of compressed video according to claim 7, further comprising:
and shortening the duration of the first time period under the condition that the number of programs running on the SoC chip is increased.
13. The transmission method of compressed video according to claim 5, further comprising:
verifying whether the judging result is accurate;
and adjusting the dynamic parameters according to the verification result.
14. The transmission method of compressed video according to claim 13, wherein verifying whether the determination result is accurate comprises:
executing a writing operation on the current video frame and verifying whether the current video frame can be completely written into the DDR buffer or not under the condition that the judgment result is that the frame loss operation is executed on the current video frame; if the current video frame can be completely written into the DDR cache, the judgment result is inaccurate; if the current video frame cannot be completely written into the DDR cache, the judgment result is accurate;
Executing a writing operation on the current video frame and verifying whether the current video frame is completely written into the DDR buffer or not under the condition that the judgment result is that the frame loss operation is not executed on the current video frame; if the current video frame can be completely written into the DDR cache, the judgment result is accurate; if the current video frame cannot be completely written into the DDR cache, the judgment result is inaccurate.
15. The method for transmitting compressed video according to claim 14, wherein adjusting the dynamic parameter according to the verification result comprises:
when the verification result is accurate and the judgment result is that the frame loss operation is executed on the current video frame, adjusting the value of the dynamic parameter to enable the calculation result of the estimated value to approach to the direction smaller than 0;
maintaining the value of the current dynamic parameter under the condition that the verification result is accurate and the judgment result is that the frame loss operation is not executed on the current video frame;
when the verification result is inaccurate and the judgment result is that the frame loss operation is performed on the current video frame, adjusting the value of the dynamic parameter to enable the calculation result of the pre-estimated value to approach to the direction smaller than 0;
And under the condition that the verification result is inaccurate and the judgment result is that the frame loss operation is not executed on the current video frame, adjusting the value of the dynamic parameter to enable the calculation result of the pre-estimated value to approach to the direction larger than 0.
16. The transmission method of compressed video according to claim 13, further comprising:
according to the verification result in the fourth time period, the dynamic parameters are adjusted; the fourth time period is a time period after the current time;
and determining the adjusted value of the dynamic parameter as a fixed parameter used for calculating the predicted value after the fourth time period.
17. A transmission device for compressed video, for implementing the method according to any one of claims 1 to 16, comprising:
the comprehensive scheduling analysis module is used for estimating whether the residual space of the DDR cache is enough to cache the compressed current video frame or not under the condition that the current video frame to be written into the DDR cache is detected; the size of the residual space dynamically changes according to data writing and data reading in the DDR cache;
judging whether to execute frame loss operation on the current video frame according to the estimated result;
And the writing module is used for executing frame loss operation on the current video frame according to the judging result, or writing the compressed current video frame into the DDR cache.
18. A non-transitory readable storage medium having stored thereon a computer program, which, when executed by a processor, implements the steps of the method according to any of claims 1-16.
19. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any of claims 1-16 when executing the computer program.
CN202311339932.4A 2023-10-17 2023-10-17 Compressed video transmission method, device, equipment and storage medium Active CN117119201B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311339932.4A CN117119201B (en) 2023-10-17 2023-10-17 Compressed video transmission method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311339932.4A CN117119201B (en) 2023-10-17 2023-10-17 Compressed video transmission method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN117119201A CN117119201A (en) 2023-11-24
CN117119201B true CN117119201B (en) 2024-02-20

Family

ID=88813106

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311339932.4A Active CN117119201B (en) 2023-10-17 2023-10-17 Compressed video transmission method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117119201B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103391415A (en) * 2012-05-11 2013-11-13 安凯(广州)微电子技术有限公司 Video data frame loss processing method and system
CN111683251A (en) * 2020-05-28 2020-09-18 浪潮(北京)电子信息产业有限公司 Video data storage method and device and computer readable storage medium
CN115580727A (en) * 2022-11-16 2023-01-06 苏州浪潮智能科技有限公司 Frame loss processing method and device for video compression, server and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103391415A (en) * 2012-05-11 2013-11-13 安凯(广州)微电子技术有限公司 Video data frame loss processing method and system
CN111683251A (en) * 2020-05-28 2020-09-18 浪潮(北京)电子信息产业有限公司 Video data storage method and device and computer readable storage medium
CN115580727A (en) * 2022-11-16 2023-01-06 苏州浪潮智能科技有限公司 Frame loss processing method and device for video compression, server and storage medium

Also Published As

Publication number Publication date
CN117119201A (en) 2023-11-24

Similar Documents

Publication Publication Date Title
CN110308782B (en) Power consumption prediction and control method and device and computer readable storage medium
US8521986B2 (en) Allocating storage memory based on future file size or use estimates
CN108076317B (en) Video data storage method and system, video access method and node
US10509588B2 (en) System and method for controlling memory frequency using feed-forward compression statistics
CN103795649B (en) Network delay jitter smoothing method
CN111142788B (en) Data migration method and device and computer readable storage medium
CN116684659B (en) Video output control module, method, equipment and server of BMC chip
US20210120230A1 (en) Image encoding control method and apparatus, storage medium, and unmanned aerial vehicle
US11010094B2 (en) Task management method and host for electronic storage device
CN110297743B (en) Load testing method and device and storage medium
CN111405370B (en) Video playback method and device
US8856422B2 (en) Memory card controller, memory card adaptor and memory card drive
CN113141321A (en) Data transmission method based on edge calculation and electronic equipment
CN117119201B (en) Compressed video transmission method, device, equipment and storage medium
US20210096985A1 (en) Memory controller and storage device including the same
US11036437B2 (en) Memory controller for storage device, storage device, control method of storage device, and recording medium
CN116149557B (en) Manufacturing-oriented slow disk detection strategy system and method
US20160085683A1 (en) Data receiving device and data receiving method
CN104301648B (en) A kind of method for avoiding loss of data when SD card preservation video
WO2023035113A1 (en) Control method and apparatus for storage apparatus
US9965183B2 (en) Method for processing data in storage device and storage device
CN111510715B (en) Video processing method, system, computer device and storage medium
WO2021092784A1 (en) Data writing, consistency checking and reading method and apparatus
CN102185874B (en) Method and device for processing commands based on iSCSI (internet small computer system interface)
CN113238974A (en) Bus bandwidth efficiency statistical method, device, equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant