Frame rate switching image compression method and apparatus, computing device, and storage medium
By determining the execution order of receiving the target image and reconfiguring the compression soft core based on the frame rate during frame rate switching, the problem of I-frame loss during frame rate switching is solved, thus achieving the integrity and reliability of image compression.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-10
- Publication Date
- 2026-03-27
AI Technical Summary
In existing image compression methods with frame rate switching, the image compression software immediately sends the image data after frame rate switching sent by the video generation software to the soft core for compression, which may result in the loss of I-frames, and consequently, the inability to decode subsequent P-frames.
By acquiring the control command for frame frequency switching, the execution order of receiving the target image and reconfiguring the compression soft core is determined based on the frame rate of the second frame frequency and the first frame frequency. This ensures that the target image is received only after the compression soft core has been reconfigured, thus avoiding compression frame loss problems caused by timing mismatch.
It effectively solves the problem of frame loss due to timing mismatch during frame rate switching, ensuring the integrity of I-frames and thus ensuring the normal decoding of subsequent P-frames.
Smart Images

Figure CN115941951B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to the technical field of image compression, in particular to an image compression method and device for frame rate switching, a computing device and a storage medium. BACKGROUND
[0002] H.264 image compression is a commonly used digital video compression format, and the feature of H.264 image compression is that I frames and P frames are transmitted alternately, so that when the compressed image is decoded, a complete I frame (key frame) is required to continuously parse multiple P frames (forward prediction encoding frames). During frame rate switching of a video, both video generation software and image compression software have a certain delay, so the timing needs to be controlled, that is, the image compression software needs to have a soft core configuration that can compress the image data after frame rate switching before receiving the image data after frame rate switching, and the first frame received is compressed as an I frame, otherwise the I frame may be lost, which will cause the subsequent multiple P frames to be unable to be decoded.
[0003] However, in the existing image compression method for frame rate switching, the image compression software will immediately send the image data after frame rate switching to the soft core for compression after receiving the image data sent by the video generation software after frame rate switching. If the time of receiving the image data is earlier than the time of reconfiguring the soft core, the image data directly sent to the soft core cannot be compressed immediately, and there is a risk of losing the I frame.
[0004] Therefore, there is an urgent need for a new image compression method for frame rate switching. SUMMARY
[0005] In order to solve the problem that the existing image compression method for frame rate switching has a risk of losing the I frame, embodiments of the present application provide an image compression method and device for frame rate switching, a computing device and a storage medium.
[0006] In a first aspect, the embodiments of the present application provide an image compression method for frame rate switching, comprising:
[0007] After the image of the first frame rate is compressed, a control instruction for frame rate switching is obtained; wherein the control instruction contains the frame rate number of the second frame rate to be switched;
[0008] According to the frame rate number of the second frame rate and the first frame rate, the execution order of receiving a target image and reconfiguring a compression soft core is determined; the target image is image data sent by an external video generation software in real time after the first frame rate is switched to the second frame rate;
[0009] Based on the execution order, the target image is compressed by using the reconfigured compression soft core.
[0010] Preferably, the execution order of receiving the target image and reconfiguring the compression soft core is determined according to the frame frequency of the second frame frequency and the frame frequency of the first frame frequency, comprising:
[0011] According to the frame frequency of the second frame frequency and the frame frequency of the first frame frequency, the soft core reconfiguration time and the frame frequency switching time of the external video generation software corresponding to the switching from the first frame frequency to the second frame frequency are obtained from a pre-constructed delay database; the delay database comprises the frame frequency switching time and the soft core reconfiguration time of the video generation software corresponding to each switching frame frequency pair;
[0012] According to the frame frequency switching time and the soft core reconfiguration time, the execution order of receiving the target image and reconfiguring the compression soft core is determined.
[0013] Preferably, the execution order of receiving the target image and reconfiguring the compression soft core is determined according to the frame frequency switching time and the soft core reconfiguration time, comprising:
[0014] Judging whether the difference between the frame frequency switching time and the soft core reconfiguration time is greater than a preset difference value; wherein the preset difference value is a non-negative number;
[0015] If yes, it is determined that the execution order is parallel operation of reconfiguring the compression soft core and receiving the target image;
[0016] If no, it is determined that the execution order is to receive the target image of the second frame frequency sent by the external video generation software in real time after determining that the compression soft core reconfiguration is completed.
[0017] Preferably, if yes, the target image is compressed by the reconfigured compression soft core based on the execution order, comprising:
[0018] According to the frame frequency of the second frame frequency, the compression soft core is reconfigured at the same time, and the target image is received;
[0019] When the target image sent by the video generation software in real time is received, the target image is compressed by the reconfigured compression soft core.
[0020] Preferably, if no, the target image is compressed by the reconfigured compression soft core based on the execution order, comprising:
[0021] According to the frame frequency of the second frame frequency, the compression soft core is reconfigured;
[0022] Judging whether the compression soft core is reconfigured;
[0023] If yes, start receiving the target image; if no, continue waiting until the compressed soft core finishes reconfiguration, and then start receiving the target image;
[0024] When the target image sent by the video generation software in real time is received, the compressed soft core after reconfiguration is used to compress the target image.
[0025] Preferably, before the execution order of determining to receive the target image and reconfiguring the compressed soft core is determined, after the control instruction of frame frequency switching is acquired, the method further comprises:
[0026] Timing is started when the control instruction is acquired;
[0027] When the timing time exceeds the preset time, it is determined that the execution order is to receive the target image of the second frame frequency sent by the external video generation software in real time after determining that the compressed soft core reconfiguration is completed.
[0028] In a second aspect, the embodiment of the present application further provides an image compression device for frame frequency switching, comprising:
[0029] An acquisition unit is configured to acquire a control instruction of frame frequency switching after an image of a first frame frequency is compressed; wherein the control instruction contains a frame frequency number of a second frame frequency to be switched;
[0030] A determination unit is configured to determine an execution order of receiving a target image and reconfiguring a compressed soft core according to the frame frequency number of the second frame frequency and the first frame frequency; the target image is image data sent by external video generation software in real time after the first frame frequency is switched to the second frame frequency;
[0031] A compression unit is configured to use a compressed soft core after reconfiguration to compress the target image based on the execution order.
[0032] In a third aspect, the embodiment of the present application further provides a computing device, comprising a memory and a processor, the memory stores a computer program, and the processor executes the computer program to implement the method described in any embodiment of the present application.
[0033] In a fourth aspect, the embodiment of the present application further provides a computer readable storage medium, which stores a computer program, and when the computer program is executed in a computer, the computer executes the method described in any embodiment of the present application.
[0034] The embodiment of the present application provides a frame frequency switching image compression method, device, computing equipment and storage medium. After a first frame frequency image is compressed, a frame frequency switching control instruction is acquired. The control instruction contains a frame frequency number of a second frame frequency to be switched. Then, according to the frame frequency numbers of the second frame frequency and the first frame frequency, the execution order of a reconfigured compression soft core and a target image receiving order is determined. Finally, based on the execution order, the target image is compressed by using the reconfigured compression soft core, so as to ensure that the target image is received after the compression soft core is reconfigured, and the image data directly sent into the soft core can be compressed immediately, thereby effectively solving the compression frame loss problem caused by the time sequence mismatch during frame frequency switching. BRIEF DESCRIPTION OF DRAWINGS
[0035] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0036] Figure 1 It is a frame frequency switching image compression method flow chart provided by an embodiment of the present application;
[0037] Figure 2 It is a hardware architecture diagram of an electronic device provided by an embodiment of the present application;
[0038] Figure 3 It is a frame frequency switching image compression device structure diagram provided by an embodiment of the present application. DETAILED DESCRIPTION
[0039] In order to make the purpose, technical scheme and advantages of the embodiments of the present application more clear, the technical scheme in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the protection scope of the present application.
[0040] As described above, during the frame frequency switching of the video, the video generation software and the image compression software both have certain delay, in the existing frame frequency switching image compression method, the image compression software will immediately send the image data after the frame frequency switching sent by the video generation software to the soft core for compression. If the time of receiving the image data is earlier than the time of reconfiguring the soft core, at this time, the image data directly sent to the soft core cannot be compressed immediately, then this image data may be used as an I frame, but the image data is not compressed, then after the subsequent soft core is reconfigured, the compressed P frame corresponding to the image data cannot be decoded due to the non-compression of the I frame, in the H.264 compression algorithm, at most 16 P frames cannot be parsed.
[0041] In order to solve the above technical problems, the inventors can consider controlling the execution order of receiving the target image and reconfiguring the compression soft core, dividing two cases according to the frame frequency numbers of the second frame frequency and the first frame frequency, selecting the corresponding execution order for different cases, so as to ensure that the received target image is received after the compression soft core is reconfigured, so as to avoid the compression frame loss problem caused by the time sequence mismatch during the frame frequency switching.
[0042] The specific implementation of the above idea is described below.
[0043] Please refer to Figure 1 The embodiment of the present application provides a frame frequency switching image compression method, which comprises the following steps:
[0044] Step 100: obtaining a control instruction of frame frequency switching after the image of the first frame frequency is compressed; wherein the control instruction contains the frame frequency number of the second frame frequency to be switched;
[0045] Step 102: determining the execution order of receiving the target image and reconfiguring the compression soft core according to the frame frequency numbers of the second frame frequency and the first frame frequency; the target image is the image data sent by the external video generation software in real time after the first frame frequency is switched to the second frame frequency;
[0046] Step 104: based on the execution order, using the reconfigured compression soft core to compress the target image.
[0047] In the embodiment of the present application, after the image of the first frame frequency is compressed, a control instruction of frame frequency switching is acquired; the control instruction contains the frame frequency number of the second frame frequency to be switched; then, according to the frame frequency number of the second frame frequency and the first frame frequency, the execution order of reconfiguring the compression soft core and receiving the target image is determined; finally, based on the execution order, the target image is compressed by using the reconfigured compression soft core, so as to ensure that the target image is received after the compression soft core is reconfigured, and at this time, the image data directly sent into the soft core can be immediately compressed, thereby effectively solving the compression frame loss problem caused by the time sequence mismatch during the frame frequency switching.
[0048] The following describes Figure 1 The execution manner of each step is shown.
[0049] For step 100 and step 102:
[0050] In step 102, because the configuration of the detector and the image compression soft core in the image compression system is not necessarily at the same level, the execution order of receiving the target image and reconfiguring the compression soft core is determined only according to the frame frequency number of the second frame frequency and the first frame frequency, which may not be applicable to all image compression systems. Therefore, in order to improve the determination accuracy of the execution order, the soft core reconfiguration time and the frame frequency switching time of the external video generation software when the image compression system is switched from the first frame frequency to the second frame frequency can be determined according to the frame frequency number of the second frame frequency and the first frame frequency, and then the execution order is determined according to the soft core reconfiguration time and the frame frequency switching time of the video generation software.
[0051] In some embodiments, step 102 can include:
[0052] According to the frame frequency number of the second frame frequency and the first frame frequency, the soft core reconfiguration time and the frame frequency switching time of the external video generation software when the image compression system is switched from the first frame frequency to the second frame frequency are acquired from a pre-constructed delay database; the delay database includes the frame frequency switching time and the soft core reconfiguration time of the video generation software corresponding to each switching frame frequency pair.
[0053] According to the frame frequency switching time and the soft core reconfiguration time, the execution order of receiving the target image and reconfiguring the compression soft core is determined.
[0054] In the embodiment, the delay database needs to be constructed in advance for the set of image compression systems, and the delay database includes the frame frequency switching time and the soft core reconfiguration time of the video generation software corresponding to each frame frequency number switching.
[0055] The construction manner of the delay database is as follows:
[0056] determining all switching frame frequency pairs; wherein the frame frequency switching pair is the corresponding relationship of the first frame frequency number switching to the second frame frequency number;
[0057] For each switching frame frequency pair, the following is performed:
[0058] Test the soft core reconfiguration time and the frame frequency switching time of the external video generation software of the image compression system when switching from the first frame frequency number to the second frame frequency number in the switching frame frequency pair;
[0059] The average of multiple tests is taken as the corresponding soft core reconfiguration time and the frame frequency switching time of the external video generation software of the switching frame frequency pair.
[0060] For example, assuming that the first frame frequency number is A and the second frame frequency number is B in the first switching frame frequency pair, and A is greater than B, that is, switching from a low-resolution small field of view high frame frequency A to a high-resolution large field of view low frame frequency B, the frame frequency switching is measured multiple times by the detector in the image compression system, and the average frame frequency switching time of the video generation software is 42 ms; the time from when the image compression software receives the control instruction of frame frequency switching to when the compression soft core reconfiguration is completed after compressing the last frame of the first frame frequency number is measured multiple times, and the average of multiple measurements can determine that the soft core reconfiguration time is 25 ms.
[0061] Next, according to the first frame frequency number C and the second frame frequency number D in the second switching frame frequency pair, assuming that C is less than D, that is, switching from a high-resolution large field of view low frame frequency C to a low-resolution small field of view high frame frequency D, the frame frequency switching is measured multiple times by the detector in the image compression system, and the average frame frequency switching time of the video generation software is 32 ms; the time from when the image compression software receives the control instruction of frame frequency switching to when the compression soft core reconfiguration is completed after compressing the last frame of the first frame frequency number is measured multiple times, and the average of multiple measurements can determine that the soft core reconfiguration time is 30 ms. In this way, the corresponding soft core reconfiguration time and the frame frequency switching time of the video generation software of each switching frame frequency pair can be obtained, and then the corresponding delay database of the image compression system is constructed.
[0062] In the embodiment, according to the frame frequency numbers of the first frame frequency and the second frame frequency in step 100, the corresponding switching frame frequency pair can be matched from the delay database constructed according to the above manner, then the soft core reconfiguration time and the frame frequency switching time of the external video generation software corresponding to the matched switching frame frequency pair are called out, and then according to the frame frequency switching time and the soft core reconfiguration time, the execution order of receiving the target image and reconfiguring the compression soft core is determined. Therefore, the embodiment sets different delay databases for different image compression systems, matches the soft core reconfiguration time and the frame frequency switching time of the external video generation software according to the frame frequency numbers of the first frame frequency and the second frame frequency, and determines the execution order of receiving the target image and reconfiguring the compression soft core according to the comparison result of the soft core reconfiguration time and the frame frequency switching time of the video generation software, so that the execution order can be more accurately selected, the compression frame loss problem caused by the time sequence mismatch during the frame frequency switching can be solved, and the execution order with simpler and more memory-saving can be reasonably selected.
[0063] In some embodiments, the step of "determining the execution order of receiving the target image and reconfiguring the compression soft core according to the frame frequency switching time and the soft core reconfiguration time" can include:
[0064] determining whether the difference between the frame frequency switching time and the soft core reconfiguration time is greater than a preset difference value; wherein the preset difference value is a non-negative number;
[0065] if yes, determining that the execution order is parallel operation of reconfiguring the compression soft core and receiving the target image;
[0066] if no, determining that the execution order is receiving the target image of the second frame frequency sent by the external video generation software in real time after determining that the compression soft core reconfiguration is completed.
[0067] In the embodiment, when the frame frequency switching time is greater than the soft core reconfiguration time and greater than a certain value, the video generation software completes the switching of the second frame frequency only after the soft core reconfiguration is completed, and then the target image is sent to the soft core after the switching is completed, that is, even if the reconfiguring the compression soft core and receiving the target image are set as parallel operation, the target image will be transmitted after the compression soft core is reconfigured. When the frame frequency switching time is equal to the soft core reconfiguration time, or greater but the exceeding value is small, the parallel operation is set, and I frame loss is still easily caused.
[0068] Therefore, a preset difference value is determined, and when the frame frequency switching time is greater than the soft core reconfiguration time and exceeds the preset difference value, it is determined that the execution order is parallel operation of reconfiguring the compression soft core and receiving the target image. At this time, the parallel operation can also ensure that the target image is transmitted to the soft core after the compression soft core is reconfigured, so that the target image can be directly compressed using the reconfigured compression soft core, and I frame loss is not caused. When the frame frequency switching time is less than the soft core reconfiguration time, or the frame frequency switching time is greater than the soft core reconfiguration time but does not exceed the preset difference value, in order to ensure that the soft core receives the target image after the reconfiguration is completed, the target image of the second frame frequency transmitted by the external video generation software in real time needs to be received after the compression soft core is reconfigured, so as to avoid I frame loss.
[0069] In some embodiments, before determining the execution order of receiving the target image and reconfiguring the compression soft core, after obtaining the control instruction of the frame frequency switching, the method further comprises:
[0070] Timing is started when the control instruction is obtained;
[0071] When the timing time exceeds the preset time, it is determined that the execution order is to receive the target image of the second frame frequency transmitted by the external video generation software in real time after the reconfiguration of the compression soft core is completed.
[0072] In the embodiment, in order to avoid the compression error caused by the connection timeout of the delay database, timing is started when the control instruction is obtained, and when the timing time exceeds the preset time and the execution order is not determined, the execution order is directly determined as receiving the target image of the second frame frequency transmitted by the external video generation software in real time after the reconfiguration of the compression soft core is completed. That is, whether the frame frequency switching time of the video generation software is greater than the soft core reconfiguration time or less than the soft core reconfiguration time, the target image of the second frame frequency transmitted by the external video generation software in real time is received after the reconfiguration of the compression soft core is completed, which can effectively avoid the frame loss caused by the mismatch of the timing.
[0073] For step 104:
[0074] In some embodiments, if yes, step 104 can comprise:
[0075] According to the frame frequency number of the second frame frequency, the compression soft core is reconfigured, and the target image is received at the same time;
[0076] After receiving the target image transmitted by the video generation software in real time, the target image is compressed using the reconfigured compression soft core.
[0077] In the embodiment, when the difference between the frame frequency switching time and the soft core reconfiguration time is greater than the preset difference value, that is, the frame frequency switching time is greater than the soft core reconfiguration time and exceeds the preset difference value, it is determined that the execution sequence is parallel operation of reconfiguring the compression soft core and receiving the target image, at this time, the parallel operation can also ensure that the target image is transmitted to the soft core after the compression soft core is reconfigured, so that the compression soft core after reconfiguration can be directly used to compress the target image, and thus I frame loss is avoided. Moreover, a program for detecting whether the compression soft core is reconfigured is not needed, unnecessary execution programs can be reduced, and memory can be saved.
[0078] In some embodiments, if no, step 104 can include:
[0079] Reconfiguring the compression soft core according to the frame frequency number of the second frame frequency;
[0080] Determining whether the compression soft core is reconfigured;
[0081] If yes, start receiving the target image; if no, continue to wait until the compression soft core is reconfigured, and then start receiving the target image;
[0082] When the target image transmitted by the video generation software in real time is received, the target image is compressed by using the reconfigured compression soft core.
[0083] In the embodiment, when the difference between the frame frequency switching time and the soft core reconfiguration time is not greater than the preset difference value, that is, the frame frequency switching time is less than the soft core reconfiguration time, or the frame frequency switching time is greater than the soft core reconfiguration time but the exceeding time does not reach the preset difference value, in order to ensure that the soft core receives the target image after being reconfigured, the target image of the second frame frequency transmitted by the external video generation software in real time needs to be received after the compression soft core is reconfigured, so as to avoid I frame loss.
[0084] As shown in Figure 2 , Figure 3 , the embodiment of the present application provides an image compression device for frame frequency switching. The device embodiment can be realized by software, or realized by hardware or a combination of software and hardware. From the hardware layer, as shown in Figure 2 , it is a hardware architecture diagram of a computing device where the image compression device for frame frequency switching provided by the embodiment of the present application is located. In addition to the processor, the memory, the network interface, and the non-volatile memory shown in Figure 2 , the computing device where the device in the embodiment is usually also can include other hardware, such as a forwarding chip responsible for processing a message and the like. Taking the software implementation as an example, as shown in Figure 3As shown, as a logical device, it is formed by the CPU of the computing device where it is located to read the corresponding computer program in the non-volatile memory into the memory to run.
[0085] As shown, the embodiment provides an image compression device for frame frequency switching, which comprises: Figure 3
[0086] The acquisition unit 301 is configured to acquire a control instruction for frame frequency switching after compressing the image of the first frame frequency; the control instruction contains the frame frequency number of the second frame frequency to be switched;
[0087] The determination unit 302 is configured to determine the execution order of receiving the target image and reconfiguring the compression soft core according to the frame frequency number of the second frame frequency and the first frame frequency; the target image is the image data transmitted in real time by the external video generation software after the first frame frequency is switched to the second frame frequency;
[0088] The compression unit 303 is configured to perform image compression on the target image by using the reconfigured compression soft core based on the execution order.
[0089] In an embodiment of the present application, the determination unit 302 is configured to perform:
[0090] According to the frame frequency number of the second frame frequency and the first frame frequency, the soft core reconfiguration time corresponding to the switching from the first frame frequency to the second frame frequency and the frame frequency switching time of the external video generation software are acquired from a pre-constructed delay database; the delay database comprises the frame frequency switching time of the video generation software and the soft core reconfiguration time corresponding to each switching frame frequency pair;
[0091] According to the frame frequency switching time and the soft core reconfiguration time, the execution order of receiving the target image and reconfiguring the compression soft core is determined.
[0092] In an embodiment of the present application, when the determination unit 302 determines the execution order of receiving the target image and reconfiguring the compression soft core according to the frame frequency switching time and the soft core reconfiguration time, the determination unit 302 is configured to:
[0093] Judge whether the difference between the frame frequency switching time and the soft core reconfiguration time is greater than a preset difference value; the preset difference value is a non-negative number;
[0094] If yes, it is determined that the execution order is parallel operation of reconfiguring the compression soft core and receiving the target image;
[0095] If no, it is determined that the execution order is to receive the target image of the second frame frequency transmitted in real time by the external video generation software after determining that the compression soft core reconfiguration is completed.
[0096] In an embodiment of the present application, if yes, the compression unit 303 is configured to perform:
[0097] reconfiguring the compression soft core according to the frame frequency number of the second frame frequency, and starting to receive the target image;
[0098] When the target image sent by the video generation software in real time is received, the target image is compressed by using the reconfigured compression soft core.
[0099] In an embodiment of the present application, if the answer is no, the compression unit 303 is configured to perform:
[0100] reconfiguring the compression soft core according to the frame frequency number of the second frame frequency;
[0101] determining whether the compression soft core is reconfigured;
[0102] If the answer is yes, the target image is started to be received; if the answer is no, the waiting is continued until the compression soft core is reconfigured, and then the target image is started to be received.
[0103] When the target image sent by the video generation software in real time is received, the target image is compressed by using the reconfigured compression soft core.
[0104] In an embodiment of the present application, before determining the execution order of receiving the target image and reconfiguring the compression soft core, the determining unit 302 is further configured to perform:
[0105] starting to count when the control instruction is acquired;
[0106] When the counting time exceeds the preset time, it is determined that the execution order is to receive the target image of the second frame frequency sent by the external video generation software in real time after determining that the compression soft core is reconfigured.
[0107] It can be understood that the structure shown in the embodiment of the present application does not constitute a specific limitation on the image compression device for frame frequency switching. In other embodiments of the present application, the image compression device for frame frequency switching can include more or fewer components than the diagram, or combine certain components, or split certain components, or different component arrangements. The components shown in the diagram can be implemented in hardware, software, or a combination of software and hardware.
[0108] The information interaction, execution process and the like between the modules in the above device are based on the same concept as the method embodiments of the present application, and the specific content can be referred to the description in the method embodiments of the present application, which will not be described here.
[0109] The embodiment of the present application further provides a computing device including a memory and a processor, the memory stores a computer program, and the processor executes the computer program to realize the image compression method for frame frequency switching in any embodiment of the present application.
[0110] The present application also provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, causes the processor to perform the frame rate switching image compression method of any of the embodiments of the present application.
[0111] In particular, a system or apparatus equipped with a storage medium on which a software program code implementing the functions of any of the above embodiments is stored, and a computer (or CPU or MPU) of the system or apparatus is caused to read out and execute the program code stored in the storage medium.
[0112] In this case, the program code read from the storage medium itself implements the functions of any of the above embodiments, and thus the program code and the storage medium storing the program code constitute a part of the present application.
[0113] Embodiments of the storage medium for providing the program code include a floppy disk, a hard disk, a magneto-optical disk, an optical disk (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), a magnetic tape, a non-volatile memory card, and a ROM. Alternatively, the program code can be downloaded from a server computer via a communication network.
[0114] Further, it should be clear that not only the program code read by the computer, but also the operating system or the like operating on the computer based on the instructions of the program code can perform part or all of the actual operations to implement the functions of any of the above embodiments.
[0115] Further, it should be understood that the program code read from the storage medium is written into a memory provided in an expansion board inserted into the computer or a memory provided in an expansion module connected to the computer, and then part or all of the actual operations are performed by a CPU or the like mounted on the expansion board or the expansion module based on the instructions of the program code to implement the functions of any of the above embodiments.
[0116] It should be noted that, in the present document, relational terms such as first and second and the like can be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. 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 apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. An element proceeded by "comprises... a" does not, without more constraints, exclude the existence of additional identical elements in the process, method, article, or apparatus that comprises the element.
[0117] Those skilled in the art can understand that all or part of the steps of the above-mentioned method embodiments can be completed by program instruction related hardware, and the foregoing program can be stored in a computer readable storage medium, and the program performs the steps of the above-mentioned method embodiments when executed; and the foregoing storage medium includes various storage media that can store program codes, such as ROM, RAM, magnetic disk or optical disk.
[0118] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A frame rate switching image compression method, characterized in that, include: After compressing the image of the first frame rate, a control command for frame rate switching is obtained; wherein, the control command contains the frame rate number of the second frame rate to be switched to; The execution order of receiving the target image and reconfiguring the compression soft core is determined based on the frame rate of the second frame rate and the frame rate of the first frame rate; the target image is image data sent in real time by the external video generation software after switching from the first frame rate to the second frame rate; Based on the execution order, the target image is compressed using the reconfigured compression soft core; The step of determining the execution order of receiving the target image and reconfiguring the compression soft core based on the frame rate of the second frame rate and the first frame rate includes: Based on the frame rate of the second frame rate and the frame rate of the first frame rate, the soft core reconfiguration time corresponding to the switch from the first frame rate to the second frame rate and the frame rate switching time of the external video generation software are obtained from a pre-built delay database; the delay database includes the frame rate switching time and soft core reconfiguration time of the video generation software corresponding to each switched frame rate pair; Determine whether the difference between the frame rate switching time and the soft core reconfiguration time is greater than a preset difference; wherein the preset difference is a non-negative number; If so, the execution order is determined to be that reconfiguring the compression soft core and receiving the target image are parallel operations; If not, the execution order is determined to be that after the compression soft core is reconfigured, the target image of the second frame frequency sent in real time by the external video generation software is received.
2. The method according to claim 1, characterized in that, If so, the step of compressing the target image using the reconfigured compression soft core based on the execution order includes: Based on the frame rate of the second frame rate, the compression soft core is reconfigured while the target image is started to be received; Upon receiving the target image sent in real time by the video generation software, the target image is compressed using the reconfigured compression software core.
3. The method according to claim 1, characterized in that, If not, the step of compressing the target image using the reconfigured compression soft core based on the execution order includes: The compression soft core is reconfigured based on the frame rate of the second frame rate; Determine whether the compressed soft core has been reconfigured; If yes, then begin receiving the target image; if no, continue waiting until the compression soft core has been reconfigured before beginning to receive the target image. Upon receiving the target image sent in real time by the video generation software, the target image is compressed using the reconfigured compression software core.
4. The method according to any one of claims 1-3, characterized in that, Before determining the execution order of receiving the target image and reconfiguring the compression soft core, and after obtaining the control command for frame rate switching, the method further includes: The timing begins when the control command is received; If the timing exceeds the preset time, the execution order is determined to be to receive the target image of the second frame frequency sent in real time by the external video generation software after the compression soft core has been reconfigured.
5. A frame rate switching image compression apparatus for implementing the method as described in any one of claims 1-4, characterized in that, include: The acquisition unit is used to acquire a frame rate switching control command after compressing the image of the first frame rate; wherein the control command contains the frame rate number of the second frame rate to be switched; The determining unit is used to determine the execution order of receiving the target image and reconfiguring the compression soft core based on the frame rate of the second frame rate and the frame rate of the first frame rate; the target image is image data sent in real time by the external video generation software after switching from the first frame rate to the second frame rate; A compression unit is used to compress the target image using a reconfigured compression soft core based on the execution order.
6. A computing device comprising a memory and a processor, wherein the memory stores a computer program, and the processor, when executing the computer program, implements the method as described in any one of claims 1-4.
7. A computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to perform the method of any one of claims 1-4.
Citation Information
Patent Citations
Method and system for encoding and decoding video sequence
CN101207813A
Video compression method and device, and medium
CN111314640A