Scheduling method, device, computer equipment and medium for multi-channel video encoding and decoding

By dynamically adjusting the startup status of the hardware core and adjusting the number of hardware cores according to the performance requirements of the video stream, the problem of power waste in traditional multi-channel video encoding and decoding scheduling is solved, and efficient utilization of hardware resources and power consumption savings are achieved.

CN118337998BActive Publication Date: 2024-10-29BEIJING XINBO ELECTRONIC TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202410773641.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-17
Publication Date
2024-10-29
Estimated Expiration
2044-06-17

AI Technical Summary

Technical Problem

Traditional multi-channel video encoding and decoding scheduling solutions have the problem of wasted power consumption because the hardware core is idle part of the time and the clock and power supply are always on, resulting in a waste of static power consumption.

Method used

By dynamically adjusting the startup status of the hardware core, calculate the required number of hardware cores based on the width, height and frame rate of the video stream, and adjust based on the historical startup status to turn on or off the power and clock of the hardware core to match actual performance. need.

Benefits of technology

It effectively saves power consumption and ensures that the hardware core turns on the power and clock only when encoding and decoding, and shuts down when there is no operation, minimizing waste of power consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118337998B_ABST
    Figure CN118337998B_ABST
Patent Text Reader

Abstract

The present application relates to a scheduling method, device, computer equipment and medium for multi-channel video encoding and decoding, wherein the method includes: obtaining a video code stream, and obtaining the image width, height and frame rate corresponding to the video code stream; obtaining the overall performance requirement of the current code stream according to the image width, height and frame rate; obtaining the maximum performance index of a single hardware core according to the resolution and frame rate corresponding to the maximum performance of a single hardware core; calculating the ratio between the overall performance requirement of the current code stream and the maximum performance index of a single hardware core, and rounding up the ratio to obtain the number of hardware cores in the current startup state required; if the number of hardware cores in the current startup state required is not equal to the number of hardware cores that have been started historically, then adjusting the number of hardware cores in the startup state in the multi-channel video encoding and decoding. In the whole process, based on the performance requirements in the multi-channel video encoding and decoding, the number of hardware cores in the startup state in the multi-channel video encoding and decoding is dynamically adjusted, saving power consumption.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to a scheduling method, apparatus, computer equipment, storage medium and computer program product for multi-channel video encoding and decoding. Background Art

[0002] With the development of image processing technology, video encoding and decoding are widely used in different image processing scenarios, bringing great convenience to people and enriching people's lives.

[0003] In the video standard encoder or decoder, hardware multi-core multi-channel encoding and decoding is a common product form. In traditional technology, all hardware core power and clock are turned on, each hardware core is scheduled according to certain rules, and the encoding and decoding performance of each hardware core is a fixed value.

[0004] During use, the actual required codec performance depends on factors such as the number of channels, resolution, and frame rate, which are determined by user operations and may change dynamically. Although this traditional method can achieve video codec, when the actual required performance is less than the sum of all hardware core performance, some hardware cores will be idle for part of the time. Since the clock and power are always on, this idle time period causes power consumption waste. It can be seen that the traditional scheduling scheme for multi-channel video codec has the defect of easily causing power consumption waste. Summary of the invention

[0005] Based on this, it is necessary to provide an energy-saving multi-channel video encoding and decoding scheduling method, device, computer equipment, storage medium and computer program product to address the above technical problems.

[0006] In a first aspect, the present application provides a scheduling method for multi-channel video encoding and decoding. The method comprises:

[0007] Obtain a video code stream, and obtain the image width, height, and frame rate corresponding to the video code stream;

[0008] According to the image width, height and frame rate, the overall performance requirement of the current code stream is obtained; according to the resolution and frame rate corresponding to the maximum performance of the single hardware core, the maximum performance index of the single hardware core is obtained;

[0009] Calculating the ratio between the overall performance requirement of the current code stream and the maximum performance index of a single hardware core, and rounding up the ratio to obtain the number of hardware cores currently required to be started;

[0010] If the number of hardware cores in the currently required startup state is not equal to the number of hardware cores that have been historically started, the number of hardware cores in the startup state in the multi-channel video encoding and decoding is adjusted.

[0011] In one embodiment, if the number of hardware cores in the currently required startup state is not equal to the number of hardware cores that have been historically started, adjusting the number of hardware cores in the startup state in the multi-channel video encoding and decoding includes:

[0012] If one stream is currently being processed and the number of hardware cores currently required to be started is not equal to the number of hardware cores that have been started in the past, then the number of hardware cores in the started state in the multi-channel video encoding and decoding is increased;

[0013] If one channel of code stream processing is currently closed, and the number of hardware cores currently required to be enabled is not equal to the number of hardware cores that have been enabled in history, the number of hardware cores enabled in the multi-channel video encoding and decoding is reduced.

[0014] In one embodiment, if one stream is currently opened for processing, and the number of hardware cores currently required to be in the startup state is not equal to the number of hardware cores that have been historically started, increasing the number of hardware cores in the startup state in the multi-channel video encoding and decoding includes:

[0015] If one stream is currently opened for processing, and the number of hardware cores currently required to be started is not equal to the number of hardware cores that have been started in the past, then determine whether the hardware core supports multi-core parallel encoding and decoding of a single stream;

[0016] If it is not supported, the number of hardware cores in the startup state in the multi-channel video encoding and decoding will be increased by 1;

[0017] If supported, the difference between the number of hardware cores currently required to be enabled and the number of hardware cores historically enabled is calculated, and the number of hardware cores enabled in the multi-channel video encoding and decoding is increased based on the difference.

[0018] In one of the embodiments, the above-mentioned scheduling method for multi-channel video encoding and decoding further includes:

[0019] Turn on the power of a corresponding number of hardware cores based on the number of hardware cores that need to be added to the startup state;

[0020] Add the core number corresponding to the newly started hardware core to the preset software queue.

[0021] In one embodiment, if one channel of code stream processing is currently closed and the number of hardware cores currently required to be enabled is not equal to the number of hardware cores that have been enabled in history, reducing the number of hardware cores enabled in the multi-channel video encoding and decoding includes:

[0022] If one stream is currently closed, and the number of hardware cores currently required to be started is not equal to the number of hardware cores that have been started in the past, then determine whether the hardware core supports multi-core parallel encoding and decoding of a single stream;

[0023] If it is not supported, the number of hardware cores in the startup state in the multi-channel video encoding and decoding will be reduced by 1;

[0024] If supported, the difference between the number of hardware cores currently required to be enabled and the number of hardware cores historically enabled is calculated, and the number of hardware cores enabled in the multi-channel video encoding and decoding is reduced based on the difference.

[0025] In one of the embodiments, the above-mentioned scheduling method for multi-channel video encoding and decoding further includes:

[0026] The power and clock of the corresponding number of hardware cores are turned off based on the number of hardware cores in the enabled state that need to be reduced.

[0027] In a second aspect, the present application also provides a scheduling device for multi-channel video encoding and decoding. The device includes:

[0028] A parsing module, used to obtain a video code stream, and obtain an image width, height and frame rate corresponding to the video code stream;

[0029] The performance analysis module is used to obtain the overall performance requirements of the current code stream according to the image width, height and frame rate; and obtain the maximum performance index of the single hardware core according to the resolution and frame rate corresponding to the maximum performance of the single hardware core;

[0030] A core number calculation module, used to calculate the ratio between the overall performance requirement of the current code stream and the maximum performance index of a single hardware core, and round up the ratio to obtain the number of hardware cores currently required for startup;

[0031] The scheduling module is used to adjust the number of hardware cores in the startup state in the multi-channel video encoding and decoding if the number of hardware cores in the startup state currently required is not equal to the number of hardware cores that have been started in the history.

[0032] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:

[0033] Obtain a video code stream, and obtain the image width, height, and frame rate corresponding to the video code stream;

[0034] According to the image width, height and frame rate, the overall performance requirement of the current code stream is obtained; according to the resolution and frame rate corresponding to the maximum performance of the single hardware core, the maximum performance index of the single hardware core is obtained;

[0035] Calculating the ratio between the overall performance requirement of the current code stream and the maximum performance index of a single hardware core, and rounding up the ratio to obtain the number of hardware cores currently required to be started;

[0036] If the number of hardware cores in the currently required startup state is not equal to the number of hardware cores that have been historically started, the number of hardware cores in the startup state in the multi-channel video encoding and decoding is adjusted.

[0037] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:

[0038] Obtain a video code stream, and obtain the image width, height, and frame rate corresponding to the video code stream;

[0039] According to the image width, height and frame rate, the overall performance requirement of the current code stream is obtained; according to the resolution and frame rate corresponding to the maximum performance of the single hardware core, the maximum performance index of the single hardware core is obtained;

[0040] Calculating the ratio between the overall performance requirement of the current code stream and the maximum performance index of a single hardware core, and rounding up the ratio to obtain the number of hardware cores currently required to be started;

[0041] If the number of hardware cores in the currently required startup state is not equal to the number of hardware cores that have been historically started, the number of hardware cores in the startup state in the multi-channel video encoding and decoding is adjusted.

[0042] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:

[0043] Obtain a video code stream, and obtain the image width, height, and frame rate corresponding to the video code stream;

[0044] According to the image width, height and frame rate, the overall performance requirement of the current code stream is obtained; according to the resolution and frame rate corresponding to the maximum performance of the single hardware core, the maximum performance index of the single hardware core is obtained;

[0045] Calculating the ratio between the overall performance requirement of the current code stream and the maximum performance index of a single hardware core, and rounding up the ratio to obtain the number of hardware cores currently required to be started;

[0046] If the number of hardware cores in the currently required startup state is not equal to the number of hardware cores that have been historically started, the number of hardware cores in the startup state in the multi-channel video encoding and decoding is adjusted.

[0047] The above-mentioned scheduling method, device, computer equipment, storage medium and computer program product for multi-channel video encoding and decoding obtains the video code stream and the image width, height and frame rate corresponding to the video code stream; obtains the overall performance requirement of the current code stream according to the image width, height and frame rate; obtains the maximum performance index of a single hardware core according to the resolution and frame rate corresponding to the maximum performance of a single hardware core; calculates the ratio between the overall performance requirement of the current code stream and the maximum performance index of a single hardware core, and rounds up the ratio to obtain the number of hardware cores in the current startup state required; if the number of hardware cores in the current startup state required is not equal to the number of hardware cores that have been started historically, adjust the number of hardware cores in the startup state in the multi-channel video encoding and decoding. In the whole process, the number of hardware cores in the startup state in the multi-channel video encoding and decoding is dynamically adjusted based on the performance requirements in the multi-channel video encoding and decoding, saving power consumption. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] FIG1 is a schematic flow chart of a method for scheduling multi-channel video encoding and decoding in one embodiment;

[0049] FIG2 is a schematic flow chart of a method for scheduling multi-channel video encoding and decoding in another embodiment;

[0050] FIG3 is a flow chart of a scheduling method for multi-channel video encoding and decoding in a scenario where one code stream is opened;

[0051] FIG4 is a flow chart of a method for scheduling multi-channel video encoding and decoding in a scenario where one code stream is closed;

[0052] FIG5 is a structural block diagram of a scheduling device for multi-channel video encoding and decoding in one embodiment;

[0053] FIG. 6 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0054] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0055] In one embodiment, as shown in FIG1 , a scheduling method for multi-channel video encoding and decoding is provided, comprising the following steps:

[0056] S200: Obtain a video code stream, and obtain an image width, height, and frame rate corresponding to the video code stream.

[0057] The video bitstream can be imported from an external device or acquired in real time. Here, the methods for obtaining the image width, height, and frame rate corresponding to the video bitstream are different for encoding and decoding tasks. Specifically, if it is decoding, the image width, height, and frame rate are first parsed from the bitstream header; if it is encoding, the width, height, and frame rate are obtained from the encoding parameters.

[0058] S400: Obtain the overall performance requirement of the current code stream according to the image width, height and frame rate; obtain the maximum performance index of the single hardware core according to the resolution and frame rate corresponding to the maximum performance of the single hardware core.

[0059] According to the image width, height and frame rate obtained in S200, the overall performance requirement of the current code stream is analyzed. Specifically, the current code stream refers to all code streams including the code stream currently being processed, and its overall performance s is the sum of the image width * image height * frame rate corresponding to all code streams. In the initial state, s=0, and the overall performance requirement s at any moment is n =s n-1 + image width * image height * frame rate, that is, the overall performance requirement at the current moment is the overall performance requirement at the previous moment plus the performance requirement corresponding to the current code stream. There are multiple hardware cores in the entire multi-channel video encoding and decoding, and the maximum performance index of each single hardware core is analyzed and obtained. Specifically, similarly, the maximum performance index of a single hardware core c = image width * image height * frame rate. Usually the performance of all cores is the same. The total performance requirement of all current code streams is recorded as s, and the initial state s=0. Assume that there are N codec cores, numbered 0, 1, 2, ... N-1 in sequence. The initial state of all cores is marked as closed, and the corresponding power and clock are turned off. Create a software queue to store the open core number, and store up to N data. A queue is a data structure that can add or remove data. The data that is added to the queue first will be removed first.

[0060] S600: Calculate the ratio between the overall performance requirement of the current code stream and the maximum performance index of a single hardware core, and round up the ratio to obtain the number of hardware cores currently required to be started.

[0061] The overall performance requirement of the current bitstream is divided by the maximum performance index of the single hardware core to obtain a ratio, and the ratio is rounded up to obtain the number of hardware cores in the current startup state. Specifically, the number of hardware cores in the current startup state refers to the number of hardware cores that need to be in the startup state to meet the overall performance requirement of the current bitstream, which includes the number of hardware cores that have been in the startup state in the past and the number of hardware cores in the startup state that need to be adjusted this time. Specifically, for the scenario of opening one bitstream, the overall performance requirement increases at this time, and the number of hardware cores in the startup state needs to be increased, that is, new hardware cores need to be started; for the scenario of closing one bitstream, the overall performance requirement decreases at this time. In order to save power consumption, the number of hardware cores in the startup state needs to be reduced at this time, that is, a certain number of hardware cores that are currently in the startup state need to be closed. Rounding up can be achieved by the function ceiling(), that is, here we get ceiling(s / c) the number of hardware cores in the current startup state required.

[0062] S800: If the number of hardware cores currently required to be enabled is not equal to the number of hardware cores that have been enabled in the past, the number of hardware cores enabled in the multi-channel video encoding and decoding is adjusted.

[0063] The number of hardware cores that have been started in the history refers to the number of hardware cores that have been started in the history records. If the number of hardware cores that are currently required to be started is not equal to the number of hardware cores that have been started in the history, it means that the number of hardware cores that are currently in the start-up state needs to be adjusted. Specifically, for the scenario of opening one bitstream, the number of hardware cores that are currently required to be started may be greater than the number of hardware cores that have been started in the history. In this case, the number of hardware cores that are in the start-up state needs to be increased, that is, the corresponding number of hardware cores that are in the shut-down state needs to be started; for the scenario of closing one bitstream, the number of hardware cores that are currently required to be started may be less than the number of hardware cores that have been started in the history. In this case, the corresponding number of hardware cores that are already in the start-up state needs to be shut down, and the corresponding power supply and alarm clock need to be turned off to reduce power consumption.

[0064] The above-mentioned scheduling method for multi-channel video encoding and decoding obtains the video code stream and the image width, height and frame rate corresponding to the video code stream; obtains the overall performance requirement of the current code stream according to the image width, height and frame rate; obtains the maximum performance index of a single hardware core according to the resolution and frame rate corresponding to the maximum performance of a single hardware core; calculates the ratio between the overall performance requirement of the current code stream and the maximum performance index of a single hardware core, and rounds up the ratio to obtain the number of hardware cores currently required for the startup state; if the number of hardware cores currently required for the startup state is not equal to the number of hardware cores that have been started historically, adjust the number of hardware cores in the startup state in the multi-channel video encoding and decoding. In the whole process, the number of hardware cores in the startup state in the multi-channel video encoding and decoding is dynamically adjusted based on the performance requirements in the multi-channel video encoding and decoding, thereby saving power consumption.

[0065] As shown in FIG. 2 , in one embodiment, S800 includes:

[0066] S820: If one stream is currently being processed and the number of hardware cores currently required to be started is not equal to the number of hardware cores that have been started in the past, then the number of hardware cores in the started state in the multi-channel video encoding and decoding is increased;

[0067] S840: If one channel of code stream processing is currently closed and the number of hardware cores currently required to be enabled is not equal to the number of hardware cores that have been enabled in the past, then the number of hardware cores enabled in the multi-channel video encoding and decoding is reduced.

[0068] As described above, the number of hardware cores in the startup state is adjusted in response to turning on one bit stream processing and turning off one bit stream processing to save power consumption.

[0069] Furthermore, if one stream is currently opened for processing, and the number of hardware cores in the current startup state required is not equal to the number of hardware cores that have been started historically, then increasing the number of hardware cores in the startup state in multi-channel video encoding and decoding includes: if one stream is currently opened for processing, and the number of hardware cores in the current startup state required is not equal to the number of hardware cores that have been started historically, then determining whether the hardware core supports multi-core parallel encoding and decoding of a single stream; if not, adding 1 to the number of hardware cores in the startup state in multi-channel video encoding and decoding; if supported, calculating the difference between the number of hardware cores in the current startup state required and the number of hardware cores that have been started historically, and increasing the number of hardware cores in the startup state in multi-channel video encoding and decoding based on the difference.

[0070] In actual applications, as shown in Figure 3, for the scenario of opening one bitstream, obtain the image width, height and frame rate corresponding to the video bitstream, and calculate s1=s+width*height*frame rate, that is, the overall performance requirement s1 required for all current bitstreams is equal to the overall performance requirement s required for all bitstreams at the previous moment plus the newly added performance requirement of the current bitstream - width*height*frame rate; determine whether the ceiling (s1 / c) of the number of hardware cores in the current required startup state is not equal to ceiling (s / c). If so, further determine whether the hardware core supports multi-core parallel encoding and decoding of a single bitstream. If not, directly add 1 to the number of hardware cores in the startup state in multi-channel video encoding and decoding, that is, find one The hardware core in the off state is found, and the hardware core is marked as on, the power of the hardware core is turned on, and the hardware core number is added to the queue; if supported, the difference between the number of hardware cores in the current required startup state and the number of hardware cores that have been started in the history is calculated, that is, ceiling(s1 / c)-ceiling(s / c) is calculated, and the hardware cores in the off state corresponding to the difference are found, and the hardware cores found are marked as on, the power of these hardware cores is turned on, and the hardware core number is added to the queue; the overall performance requirement s1 required for all current code streams is assigned to the overall performance requirement s required for all code streams at the previous moment, and a new round of adjustment is started at the next moment. It should be pointed out that in actual applications, it can be determined whether multi-core parallel encoding and decoding of a single-channel code stream is supported first, and then it can be determined whether the ceiling(s1 / c) of the number of hardware cores in the current required startup state is not equal to ceiling(s / c); it can also be determined whether the ceiling(s1 / c) of the number of hardware cores in the current required startup state is not equal to ceiling(s / c), and then it can be determined (confirmed) whether multi-core parallel encoding and decoding of a single-channel code stream is supported.

[0071] In one embodiment, if one channel of code stream processing is currently closed and the number of hardware cores currently required to be enabled is not equal to the number of hardware cores that have been enabled in history, reducing the number of hardware cores enabled in the multi-channel video encoding and decoding includes:

[0072] If one stream processing is currently closed and the number of hardware cores currently required to be started is not equal to the number of hardware cores that have been started historically, determine whether the hardware core supports multi-core parallel encoding and decoding of a single stream; if not, reduce the number of hardware cores in the startup state in multi-channel video encoding and decoding by 1; if supported, calculate the difference between the number of hardware cores currently required to be started and the number of hardware cores that have been started historically, and reduce the number of hardware cores in the startup state in multi-channel video encoding and decoding based on the difference.

[0073] In actual applications, as shown in FIG4 , for the scenario of closing one bitstream, the image width, height and frame rate corresponding to the video bitstream are obtained, and s1=s+width*height*frame rate is calculated, that is, the overall performance requirement s1 required for all current bitstreams is equal to the overall performance requirement s required for all bitstreams at the previous moment plus the newly added performance requirement of the current bitstream - width*height*frame rate; it is determined whether the number of hardware cores in the current startup state ceiling(s1 / c) is not equal to ceiling(s / c). If so, it is further determined whether the hardware core supports multi-core parallel encoding and decoding of a single bitstream. If not, the number of hardware cores in the startup state in the multi-channel video encoding and decoding is directly reduced by 1, that is, a hardware core in the startup state is taken out from the software queue, and the hardware core is marked as closed, the power supply and clock of the hardware core are turned off, and the hardware core number is no longer added to the software queue; if supported, the difference between the number of hardware cores in the current startup state required and the number of hardware cores that have been started in history is calculated, that is, the ceiling(s1 / c)- ceiling(s / c), take out the hardware cores in the startup state corresponding to the difference from the software queue, mark these hardware cores as shutdown, turn off the power and clock of these hardware cores, and no longer add these hardware core numbers to the software queue; assign the overall performance requirement s1 required for all current bitstreams to the overall performance requirement s required for all bitstreams at the previous moment, wait for the next moment, and start a new round of adjustment.

[0074] In general, the basic idea of ​​the scheduling method for multi-channel video encoding and decoding of this application is to determine the required number of cores based on the actual performance requirements and hardware core performance, and turn on or off the power supply to save static power consumption. Static power consumption refers to the power consumption when the circuit is powered but not working. Turn the clock on and off before and after each frame decoding to save dynamic power consumption. Dynamic power consumption refers to the power consumption when the circuit is working. After such scheduling, all cores turn on the power and clock only during encoding and decoding. When there is no operation, the power or clock is turned off, ensuring that the power and clock are turned on according to actual needs, minimizing power waste and achieving optimized scheduling.

[0075] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0076] Based on the same inventive concept, the embodiment of the present application also provides a multi-channel video codec scheduling device for implementing the multi-channel video codec scheduling method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the one or more multi-channel video codec scheduling device embodiments provided below can refer to the limitations of the multi-channel video codec scheduling method above, and will not be repeated here.

[0077] In one embodiment, as shown in FIG5 , a scheduling device for multi-channel video encoding and decoding is provided, comprising:

[0078] The parsing module 200 is used to obtain the video code stream, and obtain the image width, height and frame rate corresponding to the video code stream;

[0079] The performance analysis module 400 is used to obtain the overall performance requirements of the current code stream according to the image width, height and frame rate; and obtain the maximum performance index of the single hardware core according to the resolution and frame rate corresponding to the maximum performance of the single hardware core;

[0080] The core number calculation module 600 is used to calculate the ratio between the overall performance requirement of the current bitstream and the maximum performance index of a single hardware core, and round the ratio upward to obtain the number of hardware cores currently required for startup;

[0081] The scheduling module 800 is used to adjust the number of hardware cores in the startup state in the multi-channel video encoding and decoding if the number of hardware cores in the startup state currently required is not equal to the number of hardware cores that have been started in the history.

[0082] In one of the embodiments, the scheduling module 800 is also used to increase the number of hardware cores in the startup state in multiple video codecs if one bitstream processing is currently turned on and the number of hardware cores in the startup state currently required is not equal to the number of hardware cores that have been started historically; if one bitstream processing is currently turned off and the number of hardware cores in the startup state currently required is not equal to the number of hardware cores that have been started historically, then reduce the number of hardware cores in the startup state in multiple video codecs.

[0083] In one of the embodiments, the scheduling module 800 is also used to determine whether the hardware core supports multi-core parallel encoding and decoding of a single code stream if one code stream processing is currently opened and the number of hardware cores in the current startup state required is not equal to the number of hardware cores that have been started historically; if not supported, the number of hardware cores in the startup state in the multi-channel video encoding and decoding is increased by 1; if supported, the difference between the number of hardware cores in the current startup state required and the number of hardware cores that have been started historically is calculated, and the number of hardware cores in the startup state in the multi-channel video encoding and decoding is increased based on the difference.

[0084] In one embodiment, the scheduling module 800 is further used to turn on the power of a corresponding number of hardware cores based on the number of hardware cores that need to be added to the startup state; and add the core numbers corresponding to the newly started hardware cores to the preset software queue.

[0085] In one of the embodiments, the scheduling module 800 is also used to determine whether the hardware core supports multi-core parallel encoding and decoding of a single stream if one stream processing is currently closed and the number of hardware cores in the current startup state is not equal to the number of hardware cores that have been started historically; if not supported, the number of hardware cores in the startup state in the multi-channel video encoding and decoding is reduced by 1; if supported, the difference between the number of hardware cores in the current startup state required and the number of hardware cores that have been started historically is calculated, and the number of hardware cores in the startup state in the multi-channel video encoding and decoding is reduced based on the difference.

[0086] In one embodiment, the scheduling module 800 is further configured to shut down the power and clock of a corresponding number of hardware cores based on the number of hardware cores in the startup state that need to be reduced.

[0087] Each module in the above-mentioned multi-channel video encoding and decoding scheduling device can be implemented in whole or in part by software, hardware and their combination. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the corresponding operations of each of the above modules.

[0088] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be shown in FIG6. The computer device includes a processor, a memory, a communication interface, a display screen, and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a scheduling method for multi-channel video encoding and decoding is implemented. The display screen of the computer device may be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device may be a touch layer covered on the display screen, or a key, a trackball or a touchpad provided on the housing of the computer device, or an external keyboard, touchpad or mouse, etc.

[0089] Those skilled in the art will understand that the structure shown in FIG. 6 is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0090] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:

[0091] Get the video stream, and get the image width, height and frame rate corresponding to the video stream;

[0092] According to the image width, height and frame rate, the overall performance requirements of the current code stream are obtained; according to the resolution and frame rate corresponding to the maximum performance of a single hardware core, the maximum performance index of a single hardware core is obtained;

[0093] Calculate the ratio between the overall performance requirement of the current bitstream and the maximum performance index of a single hardware core, and round up the ratio to get the number of hardware cores currently required to start.

[0094] If the number of hardware cores in the currently required startup state is not equal to the number of hardware cores that have been historically started, the number of hardware cores in the startup state in the multi-channel video encoding and decoding is adjusted.

[0095] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0096] If one stream processing is currently turned on and the number of hardware cores currently required to be started is not equal to the number of hardware cores that have been started in the past, the number of hardware cores in the started state in multi-channel video encoding and decoding will be increased; if one stream processing is currently turned off and the number of hardware cores currently required to be started is not equal to the number of hardware cores that have been started in the past, the number of hardware cores in the started state in multi-channel video encoding and decoding will be reduced.

[0097] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0098] If one stream is currently opened for processing, and the number of hardware cores currently required to be started is not equal to the number of hardware cores that have been started in the past, determine whether the hardware core supports multi-core parallel encoding and decoding of a single stream; if not, add 1 to the number of hardware cores started in the multi-channel video encoding and decoding; if supported, calculate the difference between the number of hardware cores currently required to be started and the number of hardware cores that have been started in the past, and increase the number of hardware cores started in the multi-channel video encoding and decoding based on the difference.

[0099] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0100] Based on the number of hardware cores that need to be added to the startup state, the power supplies of the corresponding number of hardware cores are turned on; and the core numbers corresponding to the newly started hardware cores are added to the preset software queue.

[0101] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0102] If one stream processing is currently closed and the number of hardware cores currently required to be started is not equal to the number of hardware cores that have been started historically, determine whether the hardware core supports multi-core parallel encoding and decoding of a single stream; if not, reduce the number of hardware cores in the startup state in multi-channel video encoding and decoding by 1; if supported, calculate the difference between the number of hardware cores currently required to be started and the number of hardware cores that have been started historically, and reduce the number of hardware cores in the startup state in multi-channel video encoding and decoding based on the difference.

[0103] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0104] The power and clock of the corresponding number of hardware cores are turned off based on the number of hardware cores in the enabled state that need to be reduced.

[0105] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0106] Get the video code stream, and get the image width, height and frame rate corresponding to the video code stream;

[0107] According to the image width, height and frame rate, obtain the overall performance requirements of the current code stream; according to the resolution and frame rate corresponding to the maximum performance of a single hardware core, obtain the maximum performance index of a single hardware core;

[0108] Calculate the ratio between the overall performance requirement of the current bitstream and the maximum performance index of a single hardware core, and round up the ratio to get the number of hardware cores currently required to start.

[0109] If the number of hardware cores in the currently required startup state is not equal to the number of hardware cores that have been historically started, the number of hardware cores in the startup state in the multi-channel video encoding and decoding is adjusted.

[0110] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0111] If one stream processing is currently turned on and the number of hardware cores currently required to be started is not equal to the number of hardware cores that have been started in the past, the number of hardware cores in the started state in multi-channel video encoding and decoding will be increased; if one stream processing is currently turned off and the number of hardware cores currently required to be started is not equal to the number of hardware cores that have been started in the past, the number of hardware cores in the started state in multi-channel video encoding and decoding will be reduced.

[0112] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0113] If one stream is currently opened for processing, and the number of hardware cores currently required to be started is not equal to the number of hardware cores that have been started in the past, determine whether the hardware core supports multi-core parallel encoding and decoding of a single stream; if not, add 1 to the number of hardware cores started in the multi-channel video encoding and decoding; if supported, calculate the difference between the number of hardware cores currently required to be started and the number of hardware cores that have been started in the past, and increase the number of hardware cores started in the multi-channel video encoding and decoding based on the difference.

[0114] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0115] Based on the number of hardware cores that need to be added to the startup state, the power supplies of the corresponding number of hardware cores are turned on; and the core numbers corresponding to the newly started hardware cores are added to the preset software queue.

[0116] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0117] If one stream processing is currently closed and the number of hardware cores currently required to be started is not equal to the number of hardware cores that have been started historically, determine whether the hardware core supports multi-core parallel encoding and decoding of a single stream; if not, reduce the number of hardware cores in the startup state in multi-channel video encoding and decoding by 1; if supported, calculate the difference between the number of hardware cores currently required to be started and the number of hardware cores that have been started historically, and reduce the number of hardware cores in the startup state in multi-channel video encoding and decoding based on the difference.

[0118] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0119] The power and clock of the corresponding number of hardware cores are turned off based on the number of hardware cores in the enabled state that need to be reduced.

[0120] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:

[0121] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0122] If one stream processing is currently turned on and the number of hardware cores currently required to be started is not equal to the number of hardware cores that have been started in the past, the number of hardware cores in the started state in multi-channel video encoding and decoding will be increased; if one stream processing is currently turned off and the number of hardware cores currently required to be started is not equal to the number of hardware cores that have been started in the past, the number of hardware cores in the started state in multi-channel video encoding and decoding will be reduced.

[0123] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0124] If one stream is currently opened for processing, and the number of hardware cores currently required to be started is not equal to the number of hardware cores that have been started in the past, determine whether the hardware core supports multi-core parallel encoding and decoding of a single stream; if not, add 1 to the number of hardware cores started in the multi-channel video encoding and decoding; if supported, calculate the difference between the number of hardware cores currently required to be started and the number of hardware cores that have been started in the past, and increase the number of hardware cores started in the multi-channel video encoding and decoding based on the difference.

[0125] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0126] Based on the number of hardware cores that need to be added to the startup state, the power supplies of the corresponding number of hardware cores are turned on; and the core numbers corresponding to the newly started hardware cores are added to the preset software queue.

[0127] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0128] If one stream processing is currently closed and the number of hardware cores currently required to be started is not equal to the number of hardware cores that have been started historically, determine whether the hardware core supports multi-core parallel encoding and decoding of a single stream; if not, reduce the number of hardware cores in the startup state in multi-channel video encoding and decoding by 1; if supported, calculate the difference between the number of hardware cores currently required to be started and the number of hardware cores that have been started historically, and reduce the number of hardware cores in the startup state in multi-channel video encoding and decoding based on the difference.

[0129] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0130] The power and clock of the corresponding number of hardware cores are turned off based on the number of hardware cores in the enabled state that need to be reduced.

[0131] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0132] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0133] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A scheduling method for multi-channel video encoding and decoding, characterized in that: The method comprises: Obtain a video code stream, and obtain the image width, height, and frame rate corresponding to the video code stream; According to the image width, height and frame rate, the overall performance requirement of the current code stream is obtained; according to the resolution and frame rate corresponding to the maximum performance of the single hardware core, the maximum performance index of the single hardware core is obtained; Calculating the ratio between the overall performance requirement of the current code stream and the maximum performance index of a single hardware core, and rounding up the ratio to obtain the number of hardware cores currently required to be started; If the number of hardware cores currently required to be started is not equal to the number of hardware cores that have been started in the past, the number of hardware cores in the started state in the multi-channel video encoding and decoding is adjusted; If the number of hardware cores in the current startup state required is not equal to the number of hardware cores that have been started in the history, then adjusting the number of hardware cores in the startup state in the multi-channel video codec includes: if one channel of code stream processing is currently turned on, and the number of hardware cores in the current startup state required is not equal to the number of hardware cores that have been started in the history, then increasing the number of hardware cores in the startup state in the multi-channel video codec; if one channel of code stream processing is currently turned off, and the number of hardware cores in the current startup state required is not equal to the number of hardware cores that have been started in the history, then reducing the number of hardware cores in the startup state in the multi-channel video codec; If one stream is currently opened for processing, and the number of hardware cores in the current startup state required is not equal to the number of hardware cores that have been started historically, then increasing the number of hardware cores in the startup state in multi-channel video encoding and decoding includes: if one stream is currently opened for processing, and the number of hardware cores in the current startup state required is not equal to the number of hardware cores that have been started historically, then determining whether the hardware core supports multi-core parallel encoding and decoding of a single stream; if not, adding 1 to the number of hardware cores in the startup state in multi-channel video encoding and decoding; if supported, calculating the difference between the number of hardware cores in the current startup state required and the number of hardware cores that have been started historically, and increasing the number of hardware cores in the startup state in multi-channel video encoding and decoding based on the difference.

2. The method according to claim 1, characterized in that: Also includes: Turn on the power of a corresponding number of hardware cores based on the number of hardware cores that need to be added to the startup state; Add the core number corresponding to the newly started hardware core to the preset software queue.

3. The method according to claim 1, characterized in that If one channel of code stream processing is currently closed, and the number of hardware cores currently required to be enabled is not equal to the number of hardware cores that have been enabled in history, reducing the number of hardware cores enabled in the multi-channel video encoding and decoding includes: If one stream is currently closed, and the number of hardware cores currently required to be started is not equal to the number of hardware cores that have been started in the past, then determine whether the hardware core supports multi-core parallel encoding and decoding of a single stream; If it is not supported, the number of hardware cores in the startup state in the multi-channel video encoding and decoding will be reduced by 1; If supported, the difference between the number of hardware cores currently required to be enabled and the number of hardware cores historically enabled is calculated, and the number of hardware cores enabled in the multi-channel video encoding and decoding is reduced based on the difference.

4. The method according to claim 3, characterized in that Also includes: The power and clock of the corresponding number of hardware cores are turned off based on the number of hardware cores in the enabled state that need to be reduced.

5. A scheduling device for multi-channel video encoding and decoding, characterized in that: The device comprises: A parsing module, used to obtain a video code stream, and obtain an image width, height and frame rate corresponding to the video code stream; The performance analysis module is used to obtain the overall performance requirements of the current code stream according to the image width, height and frame rate; and obtain the maximum performance index of the single hardware core according to the resolution and frame rate corresponding to the maximum performance of the single hardware core; A core number calculation module, used to calculate the ratio between the overall performance requirement of the current code stream and the maximum performance index of a single hardware core, and round up the ratio to obtain the number of hardware cores currently required for startup; The scheduling module is used to adjust the number of hardware cores in the startup state in the multi-channel video encoding and decoding if the number of hardware cores in the current startup state is not equal to the number of hardware cores that have been started in the history; The scheduling module is also used to determine whether the hardware core supports multi-core parallel encoding and decoding of a single code stream if one code stream processing is currently turned on and the number of hardware cores in the current startup state is not equal to the number of hardware cores that have been started in the past; if not, the number of hardware cores in the startup state in the multi-channel video encoding and decoding is increased by 1; if supported, the difference between the number of hardware cores in the current startup state required and the number of hardware cores that have been started in the past is calculated, and the number of hardware cores in the startup state in the multi-channel video encoding and decoding is increased based on the difference; if one code stream processing is currently closed and the number of hardware cores in the current startup state required is not equal to the number of hardware cores that have been started in the past, the number of hardware cores in the startup state in the multi-channel video encoding and decoding is reduced.

6. The device according to claim 5, characterized in that The scheduling module is also used to start the power supplies of a corresponding number of hardware cores based on the number of hardware cores that need to be added to the startup state; and add the core numbers corresponding to the newly started hardware cores to the preset software queue.

7. The device according to claim 5, characterized in that The scheduling module is also used to determine whether the hardware core supports multi-core parallel encoding and decoding of a single code stream if one code stream processing is currently closed and the number of hardware cores in the current startup state is not equal to the number of hardware cores that have been started historically; if not, the number of hardware cores in the startup state in the multi-channel video encoding and decoding is reduced by 1; if supported, the difference between the number of hardware cores in the current startup state required and the number of hardware cores that have been started historically is calculated, and the number of hardware cores in the startup state in the multi-channel video encoding and decoding is reduced based on the difference.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 4 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.

Citation Information

Patent Citations

  • Mixed-level multi-core parallel video decoding system

    CN106921863A

  • Multicore processor scheduling method and device and mobile terminal

    CN107239348A

  • Geometry processing method and device, equipment and storage medium

    CN117853309A

  • Video resolution adaptive adjustment method, apparatus and device, and storage medium

    WO2023174216A1