Multi-channel video coding and decoding control method and device
By generating and judging the configuration instruction group when the video codec core meets the parallel processing conditions, parallel processing of software and hardware is achieved, solving the problems of low hardware resource utilization and data congestion and frame loss, improving the efficiency and reliability of multi-channel video codec, and enhancing the user experience.
Patent Information
- Application Number
- CN202510984022.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-16
- Publication Date
- 2025-11-18
AI Technical Summary
In existing technologies, when video codec cores process multiple video channels, the hardware resource utilization is low, resulting in hardware idling and wasted performance, and there are problems of data congestion and frame loss between video channels.
When the video codec core is detected to meet the conditions for parallel processing, a configuration instruction group is generated, and it is determined whether the instruction execution conditions are met. The video codec core is then controlled to perform encoding and decoding operations, thereby achieving parallel processing of software and hardware and avoiding hardware idling.
It improves hardware resource utilization, enhances the encoding and decoding efficiency and reliability of multi-channel video, provides smoother and more reliable video functions, and improves user experience.
Smart Images

Figure CN120980246A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of video processing, in particular to a multi-channel video encoding and decoding control method and device. BACKGROUND
[0002] At present, the video-related electronic devices (such as tablet computers, television set-top boxes, monitoring cameras, etc.) on the market generally have the function of processing multiple video sources, and each video source may have different resolution and frame rate video output channels, for example, multiple videos can be played simultaneously on a tablet computer. For the VideoCore in the device chip, multiple video channels are multiple concurrent encoding and decoding tasks that need to be processed frame by frame, and the encoding and decoding tasks corresponding to each video channel are usually completed in the frame rate gap required by each video channel through time division multiplexing.
[0003] In the actual process of encoding and decoding video data, in addition to the hardware resources such as VideoCore, software driving calculation related parameters are also needed. If the VideoCore processes the video data of multiple video channels in a time division multiplexing manner, the hardware will be in an idle state and waste hardware performance due to the exclusive occupation of hardware resources by a single video channel for only software calculation; and other video channels may be blocked and overflow due to long-time occupation of hardware resources, resulting in frame loss.
[0004] Therefore, it is particularly important to propose a technical solution that can improve the utilization rate of hardware resources while improving the efficiency and reliability of multi-channel video encoding and decoding processing. SUMMARY
[0005] The present application provides a multi-channel video encoding and decoding control method and device, which can improve the utilization rate of hardware resources while improving the efficiency and reliability of multi-channel video encoding and decoding processing.
[0006] In order to solve the above technical problems, the first aspect of the present application discloses a multi-channel video encoding and decoding control method, which comprises: When it is detected that the VideoCore meets the pre-set parallel processing condition, at least one configuration instruction group for a plurality of image sources is generated; each of the image sources is configured with a plurality of video channels, and each of the video channels is used to output continuous multiple frames of images; determining whether each of the configuration instruction groups meets the pre-set instruction execution condition; For each of the configuration instruction groups, when it is judged that the configuration instruction group meets the instruction execution condition, the video codec core is controlled to perform a codec operation on a target image corresponding to the configuration instruction group to obtain an image codec result corresponding to the configuration instruction group; the codec operation includes an encoding operation and / or a decoding operation.
[0007] As an optional implementation, in the first aspect of the present application, the method further comprises: inputting the received first channel state information corresponding to the plurality of image sources to the driving unit; the first channel state information comprises channel state information corresponding to a plurality of video channels configured by each of the image sources, and the channel state information corresponding to each of the video channels is used to record related parameters of the latest output image of the video channel; the driving unit comprises a plurality of driving programs, and each of the video channels is matched with one of the driving programs; The method further comprises: For each of the video channels, a configuration instruction corresponding to at least one frame of the image output by the video channel is generated by the driving program corresponding to the video channel according to the channel state information corresponding to the video channel. For each of the image sources, all the configuration instructions corresponding to the image source are packaged into at least one configuration instruction group.
[0008] As an optional implementation, in the first aspect of the present application, for each of the image sources, the packaging of all the configuration instructions corresponding to the image source into at least one configuration instruction group comprises: all the configuration instructions corresponding to all the video channels configured by the image source are packaged into one configuration instruction group; or, for each of the video channels configured by the image source, the configuration instructions corresponding to a plurality of continuous frames of the image corresponding to the video channel are packaged into one configuration instruction group.
[0009] As an optional implementation, in the first aspect of the present application, the judging of whether each of the configuration instruction groups meets a pre-set instruction execution condition comprises: each of the configuration instruction groups is cached into an instruction group queue matched with the configuration instruction group; a target configuration instruction group currently in need of processing is determined according to a pre-set processing sequence condition; it is judged whether there is channel state information matched with the target configuration instruction group in the received second channel state information; generating a task starting instruction matched with the target configuration instruction group when it is judged that there is channel state information matched with the target configuration instruction group in the second channel state information; When the task starting instruction is detected, it is determined that the target configuration instruction group meets a pre-set instruction execution condition.
[0010] As an optional implementation, in the first aspect of the present application, the determination of the target configuration instruction group currently in need of processing according to the pre-set processing sequence condition comprises: detecting whether there is a priority configuration instruction group in all the configuration instruction groups recorded by the instruction group queues; the priority configuration instruction group is a configuration instruction group with a priority processing identifier; When it is detected that there is the priority configuration instruction group in all the configuration instruction groups recorded by the instruction group queues, the priority configuration instruction group is determined as the target configuration instruction group currently in need of processing; When it is detected that there is no priority configuration instruction group in all the configuration instruction groups recorded by the instruction group queues, the instruction group queue currently polled by a pre-set polling mechanism is determined as a target instruction group queue according to the polling mechanism, and a configuration instruction group with the first order in the target instruction group queue is determined as the target configuration instruction group.
[0011] As an optional implementation, in the first aspect of the present application, after the determination that the target configuration instruction group meets the pre-set instruction execution condition, the method further comprises: performing a de-queue operation on the target configuration instruction group from the target instruction group queue; inputting the target configuration instruction group and the task starting instruction into the video codec core; reading a target image matched with the target configuration instruction group in a storage unit into the video codec core according to the target configuration instruction group, and triggering an operation of controlling the video codec core to perform a coding operation on the target image corresponding to the target configuration instruction group to obtain an image coding result corresponding to the target configuration instruction group.
[0012] As an optional implementation, in the first aspect of the present application, the method further comprises: detecting whether there is an available instruction group queue in all the instruction group queues; the available instruction group queue is an instruction group queue including at least one idle buffer, and the idle buffer is used for writing a new configuration instruction group; When it is detected that there is at least one available instruction group queue in all the instruction group queues, it is determined that the video codec core meets a pre-set parallel processing condition; When it is detected that all the available instruction groups in the instruction group queue do not exist, it is determined that the video codec core does not meet the preset parallel processing condition.
[0013] The second aspect of the present application discloses a multi-channel video codec control device, which comprises: A generating module is configured to generate at least one configuration instruction group for a plurality of image sources when it is detected that the video codec core meets the preset parallel processing condition; each of the image sources is configured with a plurality of video channels, and each of the video channels is configured to output a plurality of continuous frames of images; A judging module is configured to judge whether each of the configuration instruction groups meets a preset instruction execution condition; A control module is configured to, for each of the configuration instruction groups, control the video codec core to perform a codec operation on a target image corresponding to the configuration instruction group to obtain an image codec result corresponding to the configuration instruction group when the judging module judges that the configuration instruction group meets the instruction execution condition; the codec operation comprises an encoding operation and / or a decoding operation.
[0014] As an optional implementation, in the second aspect of the present application, the device further comprises: A first input module is configured to input received first channel state information corresponding to a plurality of image sources to a driving unit; the first channel state information comprises channel state information corresponding to a plurality of video channels configured for each of the image sources, and the channel state information corresponding to each of the video channels is configured to record related parameters of a latest output image of the video channel; the driving unit comprises a plurality of driving programs, and each of the video channels is matched with one of the driving programs; The specific manner in which the generating module generates at least one configuration instruction group for a plurality of image sources comprises: For each of the video channels, a driving program corresponding to the video channel is configured to generate a configuration instruction corresponding to at least one frame of the image output by the video channel according to channel state information corresponding to the video channel; For each of the image sources, all the configuration instructions corresponding to the image source are packaged into at least one configuration instruction group.
[0015] As an optional implementation, in the second aspect of the present application, for each of the image sources, the specific manner in which the generating module packages all the configuration instructions corresponding to the image source into at least one configuration instruction group comprises: All the configuration instructions corresponding to all the video channels configured for the image source are packaged into one configuration instruction group; Or, For each video channel configured for the image source, a configuration instruction group is packed from configuration instructions corresponding to a plurality of continuous frames of images corresponding to the video channel.
[0016] As an optional implementation form, in the second aspect, the specific manner in which the judging module judges whether each configuration instruction group meets the pre-set instruction execution condition comprises: The configuration instruction group is cached in an instruction group queue matched with the configuration instruction group; According to a pre-set processing sequence condition, a target configuration instruction group currently in need of processing is determined; It is judged whether there is channel state information matched with the target configuration instruction group in the received second channel state information; When it is judged that there is channel state information matched with the target configuration instruction group in the second channel state information, a task starting instruction matched with the target configuration instruction group is generated; When the task starting instruction is detected, it is determined that the target configuration instruction group meets the pre-set instruction execution condition.
[0017] As an optional implementation form, in the second aspect, the specific manner in which the judging module determines a target configuration instruction group currently in need of processing according to a pre-set processing sequence condition comprises: It is detected whether there is a priority configuration instruction group in all configuration instruction groups recorded in the instruction group queues; the priority configuration instruction group is a configuration instruction group attached with a priority processing identifier; When it is detected that there is the priority configuration instruction group in all configuration instruction groups recorded in the instruction group queues, the priority configuration instruction group is determined as the target configuration instruction group currently in need of processing; When it is detected that there is no priority configuration instruction group in all configuration instruction groups recorded in the instruction group queues, according to a pre-set polling mechanism, an instruction group queue currently polled by the polling mechanism is determined as a target instruction group queue, and a configuration instruction group ranked first in the target instruction group queue is determined as a target configuration instruction group.
[0018] As an optional implementation form, in the second aspect, the apparatus further comprises: A queue adjusting module is configured to perform a de-queuing operation on the target configuration instruction group from the target instruction group queue after the judging module determines that the target configuration instruction group meets the pre-set instruction execution condition; A second input module is configured to input the target configuration instruction group and the task starting instruction to the video coding and decoding core; The reading module is configured to read a target image corresponding to the target configuration instruction group from the storage unit to the video codec core according to the target configuration instruction group, and trigger the control module to perform an operation of controlling the video codec core to perform a coding operation on the target image corresponding to the target configuration instruction group, so as to obtain an image coding result corresponding to the target configuration instruction group.
[0019] As an optional implementation, in the second aspect of the present application, the device further comprises: The detection module is configured to detect whether there is an available instruction group queue in all the instruction group queues; the available instruction group queue is an instruction group queue including at least one idle buffer, and the idle buffer is used for writing a new configuration instruction group; The determination module is configured to determine that the video codec core meets a preset parallel processing condition when it is detected that there is at least one available instruction group queue in all the instruction group queues; The determination module is further configured to determine that the video codec core does not meet the preset parallel processing condition when it is detected that there is no available instruction group queue in all the instruction group queues.
[0020] The third aspect of the present application discloses another multi-channel video codec control device, which comprises: A memory storing executable program codes; A processor coupled with the memory; The processor invokes the executable program codes stored in the memory to perform part or all steps of the multi-channel video codec control method disclosed in the first aspect of the present application.
[0021] The fourth aspect of the present application discloses a computer storage medium storing computer instructions, which are invoked to perform part or all steps of the multi-channel video codec control method disclosed in the first aspect of the present application.
[0022] Compared with the prior art, the present application has the following beneficial effects: In the present application, when it is detected that the video codec core meets the preset parallel processing condition, at least one configuration instruction group for a plurality of image sources is generated; each image source is configured with a plurality of video channels, and each video channel is used to output a plurality of continuous frames of images; it is judged whether each configuration instruction group meets the preset instruction execution condition; for each configuration instruction group, when it is judged that the configuration instruction group meets the instruction execution condition, the video codec core is controlled to perform a codec operation on the target image corresponding to the configuration instruction group to obtain the image codec result corresponding to the configuration instruction group; the codec operation includes an encoding operation and / or a decoding operation. It can be seen that, by implementing the present application, when it is detected that the video codec core meets the parallel processing condition, at least one configuration instruction group is generated, and it is judged whether each configuration instruction group meets the preset instruction execution condition; if it is judged that any configuration instruction group meets the instruction execution condition, the video codec core is controlled to perform a codec operation on the target image corresponding to the configuration instruction group to obtain the image codec result corresponding to the configuration instruction group; in the video codec process, when the hardware video codec core meets the parallel processing condition, the software can start new video frame parameter calculation in advance, so that parallel processing software calculation and hardware codec tasks are realized, and the performance is not wasted due to the idle state of the hardware during software calculation, thereby improving the hardware resource utilization rate, improving the codec efficiency and reliability of the multi-channel video, and improving the processing efficiency of the video data, thereby being beneficial to providing more smooth and reliable video functions for users and improving the use experience of the users. BRIEF DESCRIPTION OF DRAWINGS
[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative effort.
[0024] Figure 1 is a flowchart of a multi-channel video codec control method disclosed by an embodiment of the present application; Figure 2 is a flowchart of another multi-channel video codec control method disclosed by an embodiment of the present application; Figure 3 is an architecture diagram of a multi-channel video codec control system disclosed by an embodiment of the present application; Figure 4 is a structure diagram of a multi-channel video codec control device disclosed by an embodiment of the present application; Figure 5 is a structure diagram of another multi-channel video codec control device disclosed by an embodiment of the present application; Figure 6 is a structural schematic view of still another multi-channel video coding control device disclosed by embodiments of the present application. DETAILED DESCRIPTION
[0025] In order to make the personnel in the art better understand the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of protection of the present application.
[0026] The terms "first", "second", and the like in the specification and claims of the present application and the above-described drawings are used to distinguish different objects, and are not used to describe a particular order. In addition, the terms "comprise" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, device, product, or end including a series of steps or units is not limited to the listed steps or units, but can optionally include steps or units not listed, or can optionally include other steps or units inherent to the process, method, product, or end.
[0027] Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the present application. The phrase appears at various places in the specification does not necessarily refer to the same embodiment, nor is it necessary that all of the embodiments include the same or mutually exclusive features or characteristics. It is explicitly and implicitly understood by those skilled in the art that embodiments described herein can be combined with other embodiments.
[0028] The application discloses a multi-channel video coding control method and device, which can generate at least one configuration instruction group when detecting that a video coding core meets a parallel processing condition, further judge whether each configuration instruction group meets a pre-set instruction execution condition, control the video coding core to perform a coding operation on a target image corresponding to the configuration instruction group if any configuration instruction group meets the instruction execution condition, and obtain an image coding result corresponding to the configuration instruction group. In the video coding process, the software can start new video frame parameter calculation in advance when the hardware video coding core meets the parallel processing condition, so that parallel processing software calculation and hardware coding tasks are realized, the performance is not wasted due to the idle state of the hardware during software calculation, the coding efficiency and coding reliability of the multi-channel video are improved while the hardware resource utilization is improved, the processing efficiency of the video data is improved, and the user is provided with smoother and more reliable video functions, and the use experience of the user is improved. The following will be described in detail.
[0029] Embodiment one Please refer to Figure 1 , Figure 1 is a flowchart of a multi-channel video coding control method disclosed by the embodiment of the application. Wherein, Figure 1 The multi-channel video coding control method described can be applied to a multi-channel video coding control device, which can include one of a control terminal, a control equipment, a control system and a server, wherein the server can be a local server or a cloud server, and the embodiment of the application does not limit the method, which can also be applied to an electronic device that needs to code and decode video data. Optionally, the electronic device can be provided with a video coding core, and further optionally, the electronic device can support a video processing function, for example, the video processing function can include a video recording function and / or a video playing function, and the embodiment of the application does not limit the method. As shown in the figure, Figure 1 The multi-channel video coding control method can include the following operations: 101. When detecting that the video coding core meets a pre-set parallel processing condition, at least one configuration instruction group for a plurality of image sources is generated.
[0030] In the embodiment of the application, when the video coding core meets the pre-set parallel processing condition, it indicates that other software programs and / or hardware devices used in the method can perform tasks in parallel with the video coding core.
[0031] In the embodiment of the present application, each image source is configured with a plurality of video channels, and each video channel is used to output continuous multiple frames of images; further optionally, each image source can output continuous multiple frames of images through multiple video channels at the same time, and the resolution and / or frame rate corresponding to each video channel can be different, which is not limited in the embodiment of the present application.
[0032] In the embodiment of the present application, for example, each image source can be a data source collected by a camera unit (such as a camera) of an electronic device in real time, can be a data source generated by a screen capture, screen recording or the like of the electronic device, can be a video stream (such as a network video stream) received by the electronic device, and can be an image source / video source to be played by the electronic device, which is not limited in the embodiment of the present application.
[0033] 102. Determine whether each configuration instruction group meets a pre-set instruction execution condition.
[0034] In the embodiment of the present application, optionally, whether each configuration instruction group meets a pre-set instruction execution condition can be determined according to the determined order, and further, when it is determined that a certain configuration instruction group does not meet the pre-set instruction execution condition, whether the next configuration instruction group meets the instruction execution condition can be determined according to the above order, which is not limited in the embodiment of the present application; optionally, whether multiple configuration instruction groups meet the pre-set instruction execution condition can also be determined in parallel, which is not limited in the embodiment of the present application.
[0035] In the embodiment of the present application, optionally, the operation of step 102 can be performed by a control unit corresponding to a video codec core, or the operation of step 102 can be performed by software, which is not limited in the embodiment of the present application.
[0036] 103. For each configuration instruction group, when it is determined that the configuration instruction group meets the instruction execution condition, a video codec core is controlled to perform a coding operation on a target image corresponding to the configuration instruction group, to obtain an image coding result corresponding to the configuration instruction group.
[0037] In the embodiment of the present application, the video codec core belongs to a hardware resource; optionally, the video codec core can be a video codec application specific integrated circuit (ASIC) for hardware encoding / decoding of images; further optionally, the video codec can include an encoder and / or a decoder, which is not limited in the embodiment of the present application; further optionally, the video codec core can be an architecture integrated with an encoder and a decoder, or can be an architecture in which the encoder and the decoder are independently separated, which is not limited in the embodiment of the present application; wherein the encoder is used to compress images to output compressed data; and the decoder is used to decompress compressed data stream to output decompressed data.
[0038] Optionally, in the embodiment of the present application, a single video codec core can be provided, or multiple video codec cores can be provided, and the embodiment of the present application is not limited in this aspect.
[0039] In the embodiment of the present application, the coding operation can include an encoding operation and / or a decoding operation; the image coding result corresponding to each configuration instruction group can include coding output data and coding processing result; further, for each configuration instruction group, when the coding operation includes the encoding operation, the coding output data includes compressed data; when the coding operation includes the decoding operation, the coding output data includes decompressed data; and the coding processing result is used to record whether the coding operation for each frame of target image corresponding to the configuration instruction group is executed normally.
[0040] It can be seen that, by implementing the method described in the embodiment of the present application, at least one configuration instruction group can be generated when it is detected that the video codec core meets the parallel processing condition, and then it is determined whether each configuration instruction group meets the pre-set instruction execution condition; if it is determined that any configuration instruction group meets the instruction execution condition, the video codec core is controlled to perform the coding operation on the target image corresponding to the configuration instruction group, and the image coding result corresponding to the configuration instruction group is obtained; in the video coding process, when the hardware video codec core meets the parallel processing condition, the software can start new video frame parameter calculation in advance, so that the parallel processing of software calculation and hardware coding task is realized, and the waste of performance caused by the idle state of hardware during software calculation is avoided, thereby improving the hardware resource utilization rate, improving the coding efficiency and coding reliability of multi-channel video, and improving the processing efficiency of video data, thereby facilitating the provision of more smooth and reliable video functions to users and improving the user experience.
[0041] In an optional embodiment, the method can further include the following operations: The received first channel state information corresponding to the plurality of image sources is input to the driving unit; the first channel state information includes channel state information corresponding to a plurality of video channels configured by each image source, and the channel state information corresponding to each video channel is used to record the related parameters of the latest output image of the video channel; the driving unit includes a plurality of drivers, and each video channel is matched with one of the drivers.
[0042] Optionally, the number of drivers included in the driving unit can correspond to the number of video channels, or can be greater than the number of video channels, and the embodiment of the present application is not limited in this aspect.
[0043] It can be seen that the optional embodiment can improve the efficiency and accuracy of generating configuration instruction groups by driving programs in combination with channel state information by inputting first channel state information corresponding to a plurality of image sources to the driving unit.
[0044] In the optional embodiment, optionally, generating at least one configuration instruction group for a plurality of image sources can include the following operations: For each video channel, a driving program corresponding to the video channel generates configuration instructions corresponding to at least one frame of image output by the video channel according to channel state information corresponding to the video channel. For each image source, all configuration instructions corresponding to the image source are packaged into at least one configuration instruction group.
[0045] Optionally, the configuration instructions corresponding to each frame of image can include one or more combinations of the following: a circumscribed configurable function parameter corresponding to a video codec core, a channel identifier corresponding to the image, a data length of the image, an image storage address of the image, and execution priority information of the image, and the embodiments of the present application are not limited thereto; further optionally, the execution priority information can include a priority processing identifier, and the embodiments of the present application are not limited thereto; and the configuration instructions corresponding to each frame of image are attached with instruction identifiers corresponding to the configuration instructions.
[0046] It can be seen that the optional embodiment can generate configuration instructions of images output by each video channel based on channel state information of the video channel by a driving program corresponding to the video channel, which can improve the analysis efficiency and accuracy of images output by each video channel, thereby improving the generation efficiency and accuracy of configuration instructions; and packaging configuration instructions corresponding to each image source into at least one configuration instruction group is beneficial to batch processing of configuration instructions in subsequent steps, which improves the scheduling efficiency and processing efficiency of configuration instructions, thereby improving the execution efficiency of subsequent coding operations; and batch processing of configuration instructions can reduce the frequency of sending interrupt signals by video codec cores after completing coding operations, thereby reducing the frequency of processing interrupt signals by software driving programs, and further improving the efficiency of data processing by software driving programs.
[0047] In the optional embodiment, optionally, packaging all configuration instructions corresponding to each image source into at least one configuration instruction group can include the following operations: Packaging all configuration instructions corresponding to all video channels configured by the image source into one configuration instruction group; Or, For each video channel configured by the image source, packaging configuration instructions corresponding to a plurality of continuous frames of image corresponding to the video channel into one configuration instruction group.
[0048] Further optionally, for each image source, when the number of video channels configured by the image source is greater than or equal to a preset channel number threshold, all configuration instructions corresponding to all video channels configured by the image source are packaged into one configuration instruction group; For each video channel configured by the image source, when the frame rate corresponding to the video channel is higher than a preset frame rate threshold, the configuration instructions corresponding to the continuous multiple frames of images corresponding to the video channel are packaged into one configuration instruction group, and the embodiments of the present application are not limited.
[0049] In this way, the packaging manner of the configuration instruction group can be compatible with the multi-video channel scene and the high frame rate scene, the selection accuracy of the packaging manner of the configuration instruction group is improved, thereby further improving the adaptation degree of the packaging manner of the configuration instruction group to the configuration condition of the image source, and further facilitating the improvement of the packaging flexibility and the packaging accuracy of the configuration instruction group.
[0050] It can be seen that the optional embodiment can also package all configuration instructions corresponding to all video channels configured by the image source into one configuration instruction group, or package the configuration instructions corresponding to the continuous multiple frames of images corresponding to each video channel into one configuration instruction group, can package the configuration instructions of each image source based on different standards by providing different packaging manners, can package the video frames of different video channels of the same image source, and can also package the continuous multiple video frames of the same video channel, thereby improving the packaging flexibility and the packaging accuracy of the configuration instruction group, and further facilitating the improvement of the generation accuracy of the configuration instruction group.
[0051] In an optional embodiment, for each image source, the method can further include the following operations: When it is detected that any video channel meets a preset image output condition, updating the channel state information corresponding to the video channel; determining all updated channel state information as first channel state information and / or second channel state information; or buffering all updated channel state information to a channel state buffer queue; reading the first preset number of channel state information sorted first from the channel state buffer queue as the first channel state information and / or the second channel state information; outputting the first channel state information and / or the second channel state information.
[0052] Optionally, when it is detected that any video channel outputs the second preset number (such as 1 frame) of images, it can be determined that the video channel meets the preset image output condition, and the embodiments of the present application are not limited.
[0053] Optionally, the channel state information corresponding to each video channel can include a combination of one or more of a channel identifier of the video channel, a data length of an image currently output by the video channel, and an image storage address of the image currently output by the video channel, and the embodiments of the present application are not limited in this regard. Further optionally, the image output by the video channel can be stored in a storage unit, and further optionally, the storage unit can be a DDR (Double Data Rate) unit, and the embodiments of the present application are not limited in this regard.
[0054] Optionally, the first channel state information can be output to the driving unit and / or the second channel state information can be output to the video codec core, and the embodiments of the present application are not limited in this regard. Further optionally, the output first channel state information and the second channel state information can be different channel state information, and the embodiments of the present application are not limited in this regard.
[0055] It should be noted that the image source and the multi-channel video codec control method are not usually started at the same time, and are randomly started by each other. If the image source has output an image, before starting to process the first frame of image, the historical channel state information in the channel state cache queue can be read to match and set a reasonable frame number for the frame of image to be coded, to improve the recording reliability of the channel state information and reduce the possibility of frame loss, and to improve the reliability of the video coding process. In addition, when an abnormal situation occurs during the coding process, the frame number can also be modified according to the information stored in the channel state cache queue, and the normal processing can be restored, to improve the abnormal processing efficiency and reliability of the video coding operation.
[0056] It can be seen that the optional embodiments can update the channel state information corresponding to any video channel when it is detected that the video channel meets the image output condition, to improve the timeliness of updating the channel state of the video channel. In addition, the updated channel state information can be directly output, or the updated channel state information can be cached to the channel state cache queue, and the channel state information sorted first can be read from the queue and output, to improve the output flexibility and recording accuracy of the channel state information, thereby facilitating the generation efficiency of subsequent configuration instruction groups and improving the execution efficiency of the coding operation.
[0057] Embodiment Two Please refer to Figure 2 , Figure 2 is a flowchart of a multi-channel video codec control method according to an embodiment of the present application. In this embodiment, the multi-channel video codec control method comprises the following steps. Figure 2The described multi-channel video coding control method can be applied to a multi-channel video coding control device, which can include one of a control terminal, a control equipment, a control system and a server, wherein the server can be a local server or a cloud server, and the embodiments of the present application are not limited thereto; the method can also be applied to an electronic device that needs to code and decode video data, and optionally, the electronic device can be provided with a video coding core, and further optionally, the electronic device can support a video processing function, for example, the video processing function can include a video recording function and / or a video playing function, and the embodiments of the present application are not limited thereto. As shown in Figure 2 The multi-channel video coding control method can include the following operations: 201. When it is detected that the video coding core meets the pre-set parallel processing condition, at least one configuration instruction group for a plurality of image sources is generated.
[0058] In the embodiments of the present application, each image source is configured with a plurality of video channels, and each video channel is used to output continuous multiple frames of images.
[0059] 202. Each configuration instruction group is cached in an instruction group queue matched with the configuration instruction group.
[0060] In the embodiments of the present application, optionally, all configuration instruction groups corresponding to one image source can be cached in the same instruction group queue; further optionally, the number of image sources can correspond to the number of instruction group queues; wherein each instruction group queue can be provided with a plurality of buffers; optionally, the number of buffers provided by each instruction group queue can be determined based on the frame rate of the video channels configured by the image source; further optionally, when the frame rates of the video channels configured by a plurality of image sources are equal, the number of buffers provided by each instruction group queue is equal; when the frame rate of the video channels configured by an image source is much higher than the frame rate of the video channels configured by other image sources, the instruction group queue corresponding to the image source with the higher frame rate can be increased by a number of buffers matched with the frame rate, and the embodiments of the present application are not limited thereto.
[0061] 203. According to a pre-set processing order condition, a target configuration instruction group currently needed to be processed is determined.
[0062] In the embodiments of the present application, the processing order condition is used to determine the processing order of each instruction group queue.
[0063] 204. It is judged whether there is channel state information matched with the target configuration instruction group in the received second channel state information.
[0064] In the embodiment of the present application, when the step 204 judges that there is the channel state information matching the target configuration instruction group in the second channel state information, that is, the result of the step 204 is yes, the operation of the step 205 is executed; alternatively, when the step 204 judges that there is no channel state information matching the target configuration instruction group in the second channel state information, that is, the result of the step 204 is no, the operation of the step 203 is re-executed to detect the next target configuration instruction group according to the processing sequence condition, which is not limited in the embodiment of the present application.
[0065] 205, generating a task start instruction matching the target configuration instruction group.
[0066] In the embodiment of the present application, the task start instruction is used to instruct the video codec core to start to execute the codec operation for the target configuration instruction group.
[0067] 206, when the task start instruction is detected, it is determined that the target configuration instruction group meets the pre-set instruction execution condition.
[0068] In the embodiment of the present application, alternatively, the operation of the steps 202-206 can be executed by a control unit corresponding to the video codec core, or the operation of the steps 202-206 can be executed by software, which is not limited in the embodiment of the present application; further alternatively, the control unit corresponding to the video codec core can be a control module embedded in the front end of the video codec core, which is used to control and schedule the work task of the video codec core; further alternatively, a number of data entrances corresponding to the number of image sources can be set in the control unit, and the data entrance can be provided with one of the above instruction group queues to receive and cache the configuration instruction group corresponding to each image source. Further alternatively, if the operation of the steps 202-206 is executed by the control unit corresponding to the video codec core, all the configuration instruction groups generated in the step 201 and the second channel state information need to be input into the control unit before the step 202.
[0069] Further alternatively, the control unit can also generate a task stop instruction, which is used to instruct the video codec core to stop the current codec operation.
[0070] 207, for each configuration instruction group, when it is judged that the configuration instruction group meets the instruction execution condition, the video codec core is controlled to execute the codec operation for the target image corresponding to the configuration instruction group, so as to obtain the image codec result corresponding to the configuration instruction group.
[0071] In the embodiment of the present application, the codec operation includes the encoding operation and / or the decoding operation.
[0072] In the embodiment of the present application, for other detailed description of step 201 and step 207, please refer to the detailed description of step 101 and step 103 in embodiment one, and the embodiment of the present application will not be repeated here.
[0073] It can be seen that the method described in the embodiment of the present application can generate at least one configuration instruction group when it is detected that the video codec core meets the parallel processing condition, and then determine whether each configuration instruction group meets the pre-set instruction execution condition. If it is determined that any configuration instruction group meets the instruction execution condition, the video codec core is controlled to perform the coding operation on the target image corresponding to the configuration instruction group, and the image coding result corresponding to the configuration instruction group is obtained. In the video coding process, when the hardware video codec core meets the parallel processing condition, the software can start new video frame parameter calculation in advance, so as to realize parallel processing of software calculation and hardware coding task, avoid wasting performance when the hardware is in idle state during software calculation, and further improve the utilization rate of hardware resources, the coding efficiency and coding reliability of multi-channel video, and the processing efficiency of video data, thereby facilitating to provide more smooth and reliable video function to the user and improving the user experience. In addition, the configuration instruction group can be cached in the instruction group queue, and then the target configuration instruction group currently needing to be processed is determined according to the processing order condition. If there is channel state information matching the target configuration instruction group in the second channel state information, the task start instruction corresponding to the target configuration instruction group is generated, and it can be determined that the target configuration instruction group meets the instruction execution condition. The determination accuracy of the target configuration instruction group currently needing to be processed can be improved, and the determination accuracy of whether the configuration instruction group meets the instruction execution condition can be improved, thereby facilitating to improve the control accuracy of the video codec core performing the coding operation.
[0074] In an optional embodiment, determining the target configuration instruction group currently needing to be processed according to the pre-set processing order condition can include the following operations: According to the pre-set polling mechanism, the instruction group queue currently polled by the polling mechanism is determined as the target instruction group queue, and the configuration instruction group with the first order in the target instruction group queue is determined as the target configuration instruction group.
[0075] Optionally, the instruction group queue can be attached with the number corresponding to the instruction group queue, and the pre-set polling mechanism can be: based on the number corresponding to the instruction group queue, the instruction group queues are sequentially polled according to the number order.
[0076] It can be seen that the optional embodiment can poll the instruction group queues one by one based on the polling mechanism, determine the currently polled instruction group queue as the target instruction group queue, and determine the configuration instruction group with the first order as the target configuration instruction group, which can improve the scheduling efficiency and scheduling reliability of the configuration instruction group corresponding to the video channel, and is beneficial to reducing the possibility of uneven allocation of image coding and decoding hardware resources of the multi-video channel, thereby reducing the situation of frame loss caused by data processing blockage and overflow of the video channel, and further improving the processing efficiency and processing reliability of the multi-channel video data while ensuring the integrity of the video data.
[0077] In the optional embodiment, optionally, the method can further include the following operations: detecting whether there is a priority configuration instruction group in the configuration instruction groups recorded by all the instruction group queues; the priority configuration instruction group is a configuration instruction group with a priority processing identifier; when it is detected that there is a priority configuration instruction group in the configuration instruction groups recorded by all the instruction group queues, determining the priority configuration instruction group as the target configuration instruction group currently required to be processed; when it is detected that there is no priority configuration instruction group in the configuration instruction groups recorded by all the instruction group queues, triggering the execution of the above-mentioned operation of determining the instruction group queue currently polled by the polling mechanism as the target instruction group queue, and determining the configuration instruction group with the first order in the target instruction group queue as the target configuration instruction group according to the pre-set polling mechanism.
[0078] For example, if some image sources need to be processed preferentially (for example, to ensure the user's playback experience, the network video stream needs to be played at a specified frame rate), a priority processing identifier (such as a high execution priority flag) can be added in the configuration instruction group corresponding to the image source of the network video stream. When the control unit detects the priority processing identifier, and the configuration instruction group is determined as yes in step 204, the configuration instruction group is allowed to “cut in line”, skip the normal polling order, and instruct the video coding core to preferentially execute the coding operation corresponding to the configuration instruction group.
[0079] It can be seen that the optional embodiment can determine the priority configuration instruction group as the target configuration instruction group when it is detected that there is a priority configuration instruction group, so as to preferentially process the priority configuration instruction group. If there is no priority configuration instruction group, the polling mechanism can be directly used to determine the target configuration instruction group, which can realize the scheduling strategy combining polling checking and priority, can ensure the timeliness of the scheduling decision of the image data required to be processed preferentially, and reduce the possibility of uneven allocation of image coding and decoding hardware resources of the multi-video channel, thereby further improving the scheduling efficiency and scheduling flexibility of the configuration instruction group.
[0080] In another optional embodiment, after determining that the target configuration instruction group meets the pre-set instruction execution condition, the method can further include the following operations: performing a dequeue operation on the target configuration instruction group from the target instruction group queue; inputting the target configuration instruction group and the task start instruction into the video codec core; reading the target image matching the target configuration instruction group in the storage unit into the video codec core according to the target configuration instruction group, and triggering the execution control video codec core to perform the encoding and decoding operation on the target image corresponding to the target configuration instruction group to obtain the image encoding and decoding result corresponding to the target configuration instruction group.
[0081] wherein, after the target configuration instruction group is dequeued, there is a buffer free available in the target instruction group queue.
[0082] wherein, optionally, the target image stored in the image storage address recorded in each configuration instruction in the target configuration instruction group can be read from the storage unit (such as a DDR unit) and input into the video codec core.
[0083] It can be seen that the optional embodiment can input the target configuration instruction group and the task start instruction into the video codec core, and input the read target image matching the target configuration instruction group into the video codec core, thereby facilitating the improvement of image reading efficiency, and improving the execution accuracy and efficiency of the encoding and decoding operation of the video codec core.
[0084] In yet another optional embodiment, the method can further include the following operations: detecting whether there is a available instruction group queue in all instruction group queues; the available instruction group queue is an instruction group queue including at least one free buffer, and the free buffer is used for writing a new configuration instruction group; when it is detected that there is at least one available instruction group queue in all instruction group queues, determining that the video codec core meets the pre-set parallel processing condition; when it is detected that there is no available instruction group queue in all instruction group queues, determining that the video codec core does not meet the pre-set parallel processing condition.
[0085] wherein, when it is detected that there is an available instruction group queue in the case that the video codec core is in the encoding and decoding state, it can be indicated that the video codec core starts to process the encoding and decoding operation corresponding to the newly received configuration instruction group, so that the corresponding instruction group queue has a free buffer, which can instruct the driving unit to perform the operation of generating the configuration instruction group, so that the software driver and the hardware video codec core can perform the video frame parameter calculation and the encoding and decoding task in parallel, avoiding the waste of performance caused by the idle running of hardware during software calculation.
[0086] It can be seen that the optional embodiment can determine that the video codec core meets the parallel processing condition when it is detected that there is a queue of available instruction groups, so that the software driver can be enabled to perform the task of generating a new configuration instruction in parallel when the video codec core starts a new round of coding tasks, and the software driver and the hardware video codec core can be enabled to perform video frame parameter calculation and coding tasks in parallel, thereby avoiding performance waste due to hardware idling during software calculation, improving the utilization of software resources and hardware resources, and further improving the efficiency of multi-channel video coding.
[0087] In yet another optional embodiment, optionally, during the process of controlling the video codec core to perform the coding operation on the target image corresponding to the configuration instruction group, the method can further include the following operations: For each configuration instruction in the configuration instruction group, if it is detected that there is an exception in the process of the video codec core performing the coding operation on the target image corresponding to the configuration instruction, the video codec core is controlled to stop performing the coding operation corresponding to the configuration instruction and all configuration instructions after the configuration instruction in the configuration instruction group, and an abnormal coding processing result about the exception is generated; The coding processing result corresponding to the configuration instruction group includes the abnormal coding processing result.
[0088] Optionally, the exception can include one or more of insufficient memory allocation, insufficient working voltage of the video codec core, and excessively high working frequency of the video codec core, or other types of exceptions, which are not limited by the embodiments of the present application.
[0089] It can be seen that the optional embodiment can stop performing the coding task of the frame and all frames after the frame in the configuration instruction group if it is detected that there is an exception in the process of the video codec core performing the coding task, and generate corresponding exception information, which can improve the timeliness of exception detection and the timeliness of processing of the exception in the coding process, and is beneficial to improving the control accuracy of the coding process and the accuracy and reliability of the coding result.
[0090] In yet another optional embodiment, optionally, the method can further include the following operations: For each configuration instruction group, the coding processing result in the image coding result corresponding to the configuration instruction group is output to the driver corresponding to the video channel corresponding to the configuration instruction group.
[0091] Optionally, the coding processing result can include an interrupt signal of the video codec core, a processing result corresponding to each frame of image, and statistical information generated along with each frame of image.
[0092] The video codec core does not output the codec processing result corresponding to a frame of image immediately after normally ending the codec task of the frame of image, but outputs the codec processing result corresponding to each frame of image corresponding to a configuration instruction group to the corresponding driver after ending the codec tasks of all images corresponding to the configuration instruction group, thereby reducing the frequency of processing the interrupt signal of the hardware video codec core by the software driving unit, and thereby facilitating to improve the data processing efficiency and the computing task execution efficiency of the software driving unit.
[0093] Optionally, as another optional embodiment, the method can further include the following operations: For each video channel, if the driving program corresponding to the video channel receives new codec processing result, it is determined that the video codec core meets the pre-set parallel processing condition; further, the driving program can continue to generate the configuration instruction group corresponding to the video channel after cleaning up the interrupt corresponding to the codec processing result.
[0094] It can be seen that the optional embodiment can output the codec result to the corresponding driving program after all the codec tasks corresponding to the configuration instruction group are ended, can reduce the frequency of sending the interrupt signal by the video codec core after completing the codec operation, thereby reducing the frequency of processing the interrupt signal at the software driving unit, and thereby facilitating to improve the data processing efficiency and the computing task execution efficiency of the software driving unit.
[0095] In the embodiment of the application, the multi-channel video codec control method can be applied to a multi-channel video codec control system. Please refer to Figure 3 , Figure 3 is a schematic diagram of the architecture of a multi-channel video codec control system disclosed in the embodiment of the application. The system can include a hardware unit, a software unit, cached data and state information; as shown in Figure 3 , the hardware unit can include an image source (such as PictureSource shown in Figure 3 ), a video codec control unit (i.e. the control unit described above, such as VCU shown in Figure 3 ) and a video codec core (such as VideoCore shown in Figure 3 ), wherein the video codec core can be an encoder (Encoder) which reads in the image data to be compressed and outputs the compressed bitstream data (Bitstream); or a decoder (Decoder) which reads in the compressed bitstream data and outputs the original image (RawYuv); or both; the software unit can include a driving unit (such as Driver shown in Figure 3cache data can include image data outputted by the image source (e.g., PictureData shown in Figure 3 ), channel history information outputted by the image source (i.e., channel status information stored in the channel status cache queue mentioned above, e.g., ChannelHistoryInfo shown in Figure 3 ), configuration instruction groups outputted by the driving unit (e.g., GroupFrameCfg shown in Figure 3 ), image compression and / or decompression data outputted by the video codec core (e.g., OutputData shown in Figure 3 ), and status information can include channel status information outputted by the image source (e.g., ChannelStatus shown in Figure 3 ), and codec result information issued by the video codec core (i.e., the codec processing result mentioned above, e.g., ResultInfo shown in Figure 3 ).
[0096] For example, as shown in Figure 3 , when the multi-channel video codec control method is applied to the system mentioned above, the method can include the following operations: As shown in Figure 3 , there are currently k image sources, among which, the image source Source[1] outputs i video channels simultaneously, and currently outputs to the (m+1)th frame image; the image source Source[k] outputs j video channels simultaneously, and currently outputs to the (n+1)th frame image; and the image data outputted by each video channel is cached to the DDR unit, and at the same time, channel status information is generated and sent to the corresponding software driver (SwDriver) and the front-end control unit (VCU) of the video codec core; Further, there is a software driver corresponding to each video channel of each image source; as shown in Figure 3 , the driving program belonging to the jth video channel of the kth image source is numbered as S[k]Ch[j], which is responsible for calculating the parameters required for the codec task of the video channel, and outputs the configuration instruction (FrameCfg) numbered as S[k]Ch[j]; optionally, the configuration instruction can be cached to the DDR unit; Further, the configuration instructions of different channels of the same image source, or the configuration instructions of consecutive multiple frames of the same channel of the same image source, can be packaged into a configuration instruction group (GroupFrameCfg); as shown in Figure 4 , all the configuration instructions outputted by the j driving programs belonging to the kth image source are packaged into a configuration instruction group numbered as G[k]; Furthermore, the video codec control unit has multiple Group entries, each with a GroupQueue containing a number of buffers to receive configuration command groups from the software driver; such as Figure 4 As shown, there are currently k image sources, corresponding to k queues; Furthermore, the video codec control unit follows a polling mechanism. After the VCU starts, the polling order of the queue is from GQ[1] to GQ[k] one by one, so as to compare the configuration instruction group at the front of the queue with the latest channel status information. If it is determined that the channel meets the executable standard of the video codec core, the corresponding start instruction is sent to the video codec core. Furthermore, after receiving the start command from the VCU, the video codec core reads the image data DDR address of the channel recorded in the configuration instruction group corresponding to the channel to be executed, and starts to execute the encoding and decoding task. After the video codec core completes the encoding and decoding task of all frames in a configuration instruction group, it sends the task result information (ResultInfo, i.e. the above encoding and decoding processing result) to the corresponding software driver. Furthermore, after receiving the task result information, the software driver first clears the interrupt of the VideoDriver Group, then checks the corresponding instruction queue. If there is an idle buffer, it calculates the parameters of the new frame based on the task result information and generates new configuration instructions.
[0097] Example 3 Please see Figure 4 , Figure 4 This is a schematic diagram of the structure of a multi-channel video encoding and decoding control device disclosed in an embodiment of the present invention. Figure 5 The described multi-channel video encoding / decoding control device may include one of a control terminal, control equipment, control system, and server, wherein the server may be a local server or a cloud server, and this embodiment of the invention is not limited thereto. This device can be applied to electronic devices that need to encode and decode video data. Optionally, the electronic device may be equipped with a video encoding / decoding core. Further optionally, the electronic device may support video processing functions. For example, video processing functions may include video recording functions and / or video playback functions, and this embodiment of the invention is not limited thereto. Figure 5 As shown, the multi-channel video encoding / decoding control device may include: The generation module 301 is used to generate at least one set of configuration instructions for several image sources when the video codec core is detected to meet the pre-set parallel processing conditions; each image source is configured with several video channels, and each video channel is used to output multiple consecutive frames of images. The judging module 302 is configured to judge whether each configuration instruction group meets a pre-set instruction execution condition. The control module 303 is configured to, for each configuration instruction group, when the judging module 302 judges that the configuration instruction group meets the instruction execution condition, control the video codec core to perform a codec operation on a target image corresponding to the configuration instruction group to obtain an image codec result corresponding to the configuration instruction group; the codec operation includes an encoding operation and / or a decoding operation.
[0098] It can be seen that the device described in the embodiment of the application can generate at least one configuration instruction group when detecting that the video codec core meets the parallel processing condition, judge whether each configuration instruction group meets a pre-set instruction execution condition, control the video codec core to perform a codec operation on a target image corresponding to the configuration instruction group to obtain an image codec result corresponding to the configuration instruction group if it is judged that any configuration instruction group meets the instruction execution condition, and thus realize parallel processing of software calculation and hardware codec task when the hardware video codec core meets the parallel processing condition in the video codec process, avoid wasting performance due to the idle state of the hardware during software calculation, and thus improve the hardware resource utilization rate, the codec efficiency and reliability of multi-channel video, and the processing efficiency of video data, and thus facilitate the provision of more smooth and reliable video functions to users and improve the user experience.
[0099] In an optional embodiment, as shown in FIG. 4, the device can further include: Figure 5 The first input module 304 is configured to input the received first channel state information corresponding to the plurality of image sources to a driving unit; the first channel state information includes channel state information corresponding to a plurality of video channels configured by each image source, and the channel state information corresponding to each video channel is used to record the related parameters of the latest output image of the video channel; the driving unit includes a plurality of driving programs, and each video channel is matched with one of the driving programs; The specific manner in which the generating module 301 generates at least one configuration instruction group for the plurality of image sources includes: For each video channel, a driving program corresponding to the video channel generates a configuration instruction corresponding to at least one frame of image output by the video channel according to the channel state information corresponding to the video channel; For each image source, all configuration instructions corresponding to the image source are packaged into at least one configuration instruction group.
[0100] It can be seen that the apparatus described in the optional embodiment can input the first channel state information corresponding to a plurality of image sources to the driving unit, which can improve the efficiency and accuracy of generating configuration instruction groups by the driving program combined with the channel state information; and the driving program corresponding to each video channel can generate the configuration instruction of the image output by the video channel based on the channel state information of the video channel, which can improve the analysis efficiency and accuracy of the image output by each video channel, thereby improving the generation efficiency and accuracy of the configuration instruction; and the configuration instruction corresponding to each image source is packaged into at least one configuration instruction group, which is beneficial to batch processing of the configuration instruction in the subsequent step, improves the scheduling efficiency and processing efficiency of the configuration instruction, thereby improving the execution efficiency of the subsequent encoding and decoding operation; and batch processing of the configuration instruction can reduce the frequency of sending an interrupt signal by the video encoding and decoding core after completing the encoding and decoding operation, thereby reducing the frequency of processing the interrupt signal by the software driving program, and further improving the efficiency of data processing by the software driving program.
[0101] In the optional embodiment, the specific manner of the generating module 301 for packaging all the configuration instructions corresponding to each image source into at least one configuration instruction group can include: packaging all the configuration instructions corresponding to all the video channels configured by the image source into one configuration instruction group; or, for each video channel configured by the image source, packaging the configuration instructions corresponding to the continuous multiple frames of images corresponding to the video channel into one configuration instruction group.
[0102] It can be seen that the apparatus described in the optional embodiment can also package all the configuration instructions corresponding to all the video channels configured by the image source into one configuration instruction group, or package the configuration instructions corresponding to the continuous multiple frames of images corresponding to each video channel into one configuration instruction group, which can provide different packaging manners, package the configuration instructions of each image source based on different standards, package the video frames of different video channels of the same image source, or package the continuous multiple video frames of the same video channel, thereby improving the packaging flexibility and accuracy of the configuration instruction group, and further improving the generation accuracy of the configuration instruction group.
[0103] In another optional embodiment, the specific manner of the judging module 302 for judging whether each configuration instruction group meets the pre-set instruction execution condition can include: caching each configuration instruction group into an instruction group queue matched with the configuration instruction group; determining the target configuration instruction group currently required to be processed according to the pre-set processing sequence condition; determining whether the received second channel state information comprises channel state information matching the target configuration instruction group; generating a task start instruction corresponding to the target configuration instruction group when it is determined that the second channel state information comprises channel state information matching the target configuration instruction group; determining that the target configuration instruction group satisfies the pre-set instruction execution condition when the task start instruction is detected.
[0104] It can be seen that the apparatus described in the optional embodiment can determine the target configuration instruction group that needs to be processed currently by caching the configuration instruction group into the instruction group queue, and then determining the target configuration instruction group according to the processing order condition. If the second channel state information comprises channel state information matching the target configuration instruction group, the target configuration instruction group corresponding task start instruction is generated, and it can be determined that the target configuration instruction group satisfies the instruction execution condition. The apparatus can determine whether the configuration instruction group satisfies the instruction execution condition in combination with the channel state information, can improve the determination accuracy of the target configuration instruction group that needs to be processed currently, and can improve the judgment accuracy of whether the configuration instruction group satisfies the instruction execution condition, thereby facilitating the improvement of the control accuracy of the video coding core in performing the coding operation.
[0105] In the optional embodiment, optionally, the specific manner in which the determining module 302 determines the target configuration instruction group that needs to be processed currently according to the pre-set processing order condition can comprise: detecting whether there is a priority configuration instruction group in all the configuration instruction groups recorded by the instruction group queue; the priority configuration instruction group is a configuration instruction group with a priority processing identifier; determining the priority configuration instruction group as the target configuration instruction group that needs to be processed currently when it is detected that there is a priority configuration instruction group in all the configuration instruction groups recorded by the instruction group queue; determining the target instruction group queue as the instruction group queue currently polled by the pre-set polling mechanism, and determining the configuration instruction group with the first order in the target instruction group queue as the target configuration instruction group when it is detected that there is no priority configuration instruction group in all the configuration instruction groups recorded by the instruction group queue.
[0106] It can be seen that the apparatus described in the optional embodiment can also determine the priority configuration instruction group as the target configuration instruction group when it is detected that the priority configuration instruction group exists, so as to preferentially process the priority configuration instruction group. If the priority configuration instruction group does not exist, the polling mechanism can be directly used to determine the target configuration instruction group, so that the scheduling strategy combining polling checking and priority can be implemented, the scheduling efficiency and scheduling flexibility of the configuration instruction group can be improved, the possibility of uneven allocation of image coding and decoding hardware resources of the multi-video channel can be reduced while the timeliness of scheduling decision of image data that needs to be preferentially processed is ensured, and thus the scheduling efficiency and scheduling flexibility of the configuration instruction group are further improved.
[0107] In the optional embodiment, as shown in Figure 6 The apparatus can further include: The queue adjustment module 305 is configured to perform a dequeue operation on the target configuration instruction group from the target instruction group queue after the judgment module 302 determines that the target configuration instruction group meets the pre-set instruction execution condition. The second input module 306 is configured to input the target configuration instruction group and the task start instruction to the video coding and decoding core. The reading module 307 is configured to read the target image matching the target configuration instruction group in the storage unit to the video coding and decoding core according to the target configuration instruction group, and trigger the control module 303 to perform the operation of controlling the video coding and decoding core to perform the coding and decoding operation on the target image corresponding to the target configuration instruction group to obtain the image coding and decoding result corresponding to the target configuration instruction group.
[0108] It can be seen that the apparatus described in the optional embodiment can also input the target configuration instruction group and the task start instruction to the video coding and decoding core, and input the target image matching the target configuration instruction group to the video coding and decoding core, so as to improve the image reading efficiency, and improve the execution accuracy and efficiency of the coding and decoding operation of the video coding and decoding core.
[0109] In the optional embodiment, as shown in Figure 6 The apparatus can further include: The detection module 308 is configured to detect whether there is an available instruction group queue in all instruction group queues. The available instruction group queue is an instruction group queue including at least one idle buffer area, and the idle buffer area is used to write a new configuration instruction group. The determination module 309 is configured to determine that the video coding and decoding core meets the pre-set parallel processing condition when it is detected that there is at least one available instruction group queue in all instruction group queues. The determination module 309 is further configured to determine that the video coding and decoding core does not meet the pre-set parallel processing condition when it is detected that there is no available instruction group queue in all instruction group queues.
[0110] It can be seen that the apparatus described in the optional embodiment can also determine that the video codec core meets the parallel processing condition when it is detected that there is a queue of available instruction groups, so that the software driver can parallel process the task of generating new configuration instructions when the video codec core starts a new round of coding tasks, so that the software driver and the hardware video codec core can parallel execute the video frame parameter calculation and coding tasks, avoid wasting performance of the hardware when the software is calculating, improve the utilization of software resources and hardware resources, and further improve the efficiency of multi-channel video coding.
[0111] Embodiment four Please refer to Figure 6 , is another structure schematic diagram of a multi-channel video coding control apparatus disclosed by the embodiments of the present application. As shown in the figure, the multi-channel video coding control apparatus can include: a memory 401 storing executable program codes; a processor 402 coupled with the memory 401; The processor 402 invokes the executable program codes stored in the memory 401 to execute part or all of the steps of the multi-channel video coding control method described in the embodiment one or the embodiment two of the present application.
[0112] Embodiment five The embodiments of the present application disclose a computer storage medium storing computer instructions, which are invoked to execute part or all of the steps of the multi-channel video coding control method described in the embodiment one or the embodiment two of the present application.
[0113] Embodiment six The embodiments of the present application disclose a computer program product including a non-transitory computer readable storage medium storing a computer program, and the computer program is operable to make a computer execute part or all of the steps of the multi-channel video coding control method described in the embodiment one or the embodiment two.
[0114] The apparatus embodiments described above are only schematic, wherein the modules illustrated as separate components can or can not be physically separate, and the components illustrated as modules can or can not be physical modules, i.e., can be located in one place, or can be distributed on multiple network modules. Part or all of the modules can be selected according to actual needs to achieve the purpose of the present embodiment scheme. Those skilled in the art can understand and implement without creative labor.
[0115] Through the specific description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be realized by means of software and the necessary general hardware platform, and of course, can also be realized by hardware. Based on such understanding, the above technical solutions, essentially or in the sense of contribution to the prior art, can be embodied in the form of a software product. The computer software product can be stored in a computer readable storage medium, and the storage medium includes a read-only memory (ROM), a random access memory (RAM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), a one-time programmable read-only memory (OTPROM), an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disk storage, a magnetic disk storage, a magnetic tape storage, or any other computer readable medium that can be used to carry or store data.
[0116] Finally, it should be noted that: the multi-channel video encoding and decoding control method and device disclosed by the embodiments of the present application are only the preferred embodiments of the present application, and are used to illustrate the technical solutions of the present application, but not to 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: the technical solutions recorded in the foregoing embodiments can still be modified, or some technical features can be replaced by equivalents; and these modifications or replacements do not make the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A multi-channel video encoding and decoding control method, characterized in that, The method includes: When the video codec core is detected to meet the pre-set parallel processing conditions, at least one set of configuration instructions is generated for several image sources; each image source is configured with several video channels, and each video channel is used to output multiple consecutive frames of images; Determine whether each of the configuration instruction groups meets the preset instruction execution conditions; For each of the configuration instruction groups, when it is determined that the configuration instruction group meets the instruction execution conditions, the video codec core is controlled to perform encoding and decoding operations on the target image corresponding to the configuration instruction group, so as to obtain the image encoding and decoding result corresponding to the configuration instruction group; the encoding and decoding operations include encoding operations and / or decoding operations.
2. The multi-channel video encoding and decoding control method according to claim 1, characterized in that, The method further includes: The received first channel status information corresponding to several image sources is input to the driving unit; the first channel status information includes channel status information corresponding to several video channels configured for each image source, and the channel status information corresponding to each video channel is used to record the relevant parameters of the latest output image of that video channel; the driving unit includes multiple drivers, and each video channel is matched with one of the drivers; The generation of at least one set of configuration instructions for a plurality of image sources includes: For each video channel, the driver corresponding to that video channel generates a configuration instruction corresponding to at least one frame of the image output by that video channel, based on the channel status information corresponding to that video channel. For each image source, all configuration instructions corresponding to that image source are packaged into at least one configuration instruction group.
3. The multi-channel video encoding and decoding control method according to claim 2, characterized in that, For each image source, the step of packaging all the configuration instructions corresponding to that image source into at least one configuration instruction group includes: Package all configuration instructions corresponding to all video channels configured for the image source into a single configuration instruction group; or, For each video channel configured for the image source, the configuration instructions corresponding to multiple consecutive frames of the image corresponding to that video channel are packaged into a configuration instruction group.
4. The multi-channel video encoding and decoding control method according to any one of claims 1-3, characterized in that, The determination of whether each of the configuration instruction groups meets the preset instruction execution conditions includes: Each of the configuration instruction groups is cached in an instruction group queue that matches the configuration instruction group; Based on the pre-set processing order conditions, determine the target configuration instruction group that needs to be processed now; Determine whether there is channel status information in the received second channel status information that matches the target configuration instruction group; When it is determined that there is channel status information in the second channel status information that matches the target configuration instruction group, a task start instruction that matches the target configuration instruction group is generated. When the task start command is detected, it is determined that the target configuration command group meets the pre-set command execution conditions.
5. The multi-channel video encoding and decoding control method according to claim 4, characterized in that, The step of determining the target configuration instruction group that needs to be processed according to the pre-set processing order conditions includes: Detect whether there is a priority configuration instruction group among the configuration instruction groups recorded in all the instruction group queues; the priority configuration instruction group is a configuration instruction group with a priority processing identifier; When the priority configuration instruction group is detected in all the configuration instruction groups recorded in the instruction group queues, the priority configuration instruction group is determined as the target configuration instruction group that needs to be processed. When it is detected that the priority configuration instruction group is not found in the configuration instruction groups recorded in all the instruction group queues, the instruction group queue currently polled by the polling mechanism is determined as the target instruction group queue according to the pre-set polling mechanism, and the configuration instruction group that is sorted first in the target instruction group queue is determined as the target configuration instruction group.
6. The multi-channel video encoding and decoding control method according to claim 4, characterized in that, After determining that the target configuration instruction group meets the preset instruction execution conditions, the method further includes: Perform a dequeue operation on the target configuration instruction group from the target instruction group queue; The target configuration instruction set and the task start instruction are input into the video encoding / decoding core; According to the target configuration instruction group, the target image that matches the target configuration instruction group in the storage unit is read into the video codec core, and the operation of controlling the video codec core to perform encoding and decoding operations on the target image corresponding to the target configuration instruction group is triggered to obtain the image encoding and decoding result corresponding to the target configuration instruction group.
7. The multi-channel video encoding and decoding control method according to claim 4, characterized in that, The method further includes: Detect whether there is an available instruction group queue among all the instruction group queues; the available instruction group queue is an instruction group queue that includes at least one free buffer, the free buffer being used to write new configuration instruction groups; When at least one of the available instruction group queues is detected in all the instruction group queues, it is determined that the video codec core meets the preset parallel processing conditions. When it is detected that there is no available instruction group queue in any of the instruction group queues, it is determined that the video codec core does not meet the preset parallel processing conditions.
8. A multi-channel video encoding and decoding control device, characterized in that, The device includes: The generation module is used to generate at least one set of configuration instructions for several image sources when the video codec core is detected to meet the pre-set parallel processing conditions; each image source is configured with several video channels, and each video channel is used to output multiple consecutive frames of images; The judgment module is used to determine whether each of the configuration instruction groups meets the preset instruction execution conditions; The control module is configured to, for each configuration instruction group, when the judgment module determines that the configuration instruction group meets the instruction execution conditions, control the video codec core to perform encoding and decoding operations on the target image corresponding to the configuration instruction group, and obtain the image encoding and decoding result corresponding to the configuration instruction group; the encoding and decoding operations include encoding operations and / or decoding operations.
9. A multi-channel video encoding and decoding control device, characterized in that, The device includes: Memory containing executable program code; A processor coupled to the memory; The processor calls the executable program code stored in the memory to execute the multi-channel video encoding and decoding control method as described in any one of claims 1-7.
10. A computer storage medium, characterized in that, The computer storage medium stores computer instructions, which, when invoked, are used to execute the multi-channel video encoding and decoding control method as described in any one of claims 1-7.
Citation Information
Patent Citations
Multipath audio and video concurrent decoding acceleration card and decoding acceleration method for same
CN104683860A
Parallel hardware and software block processing pipelines
CN105684036A
High-frame-frequency video parallel encoding and recombining method
CN111263164A
Internet broadcasting system which can transmits multi-channel moving pictures
KR1020020059007A
Frame List Processing for Multiple Video Channels
US20120274856A1