A video encoding method and an encoding method for LED display data

By setting an independent encoding channel for each target input interface and adopting a polling strategy, the problems of low resource utilization and difficulty in parallel encoding in the prior art are solved, and efficient parallel encoding processing of multiplexed image data streams are realized.

CN119364004BActive Publication Date: 2025-04-01HANGZHOU HIKVISION DIGITAL TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411936927.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-25
Publication Date
2025-04-01
Estimated Expiration
2044-12-25

AI Technical Summary

Technical Problem

In the existing video encoding technology, the serial encoding method results in a low resource utilization rate of the encoder and it is difficult to process multiple image data streams in parallel.

Method used

By setting an independent encoding channel for each target input interface and using a polling strategy for encoding processing, parallel encoding of multiple image data streams is realized.

Benefits of technology

The resource utilization rate of the encoder is improved, parallel encoding processing of multiple image data streams is realized, and hardware resources are saved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119364004B_ABST
    Figure CN119364004B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a video encoding method and an encoding method for LED display data, which relates to the field of video encoding technology; wherein, a video encoding method includes: determining each target input interface and encoding scheduling strategy, writing the received image block into the cache area corresponding to the first encoding channel, reading the macroblocks to be encoded from the cache areas corresponding to each encoding channel in turn according to the first strategy, and writing the read macroblocks into multiple sub-areas of the shared area, determining the encoding channel to be polled when inputting data to the encoding module according to the first strategy as the channel to be processed, reading the current macroblock to be processed from the sub-area corresponding to the channel to be processed, and inputting the read macroblocks into the encoding module for encoding processing based on each processing unit. It can be seen that this scheme can improve the resource utilization of the encoder.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of video encoding, and in particular to a video encoding method and an encoding method for LED display data. Background Art

[0002] In the video splicing display scenario, the spliced ​​image data can be displayed using an LED (light-emitting diode) display screen / LCD (Liquid Crystal Display). In this scenario, a high-performance encoder can usually be selected to encode multiple image data streams; the encoding process may include prediction, transformation / quantization, decision / reconstruction, entropy coding, and packaging processing stages.

[0003] In the related art, multiple channels of image data are usually encoded in a serial manner according to the encoding process introduced above. For example, after encoding an image block in one image data stream, the image block in another image data stream is encoded, and so on. However, the serial method will result in low resource utilization of the encoder. Summary of the invention

[0004] The purpose of the embodiments of the present application is to provide a video encoding method and an encoding method for LED display data to improve the resource utilization of the encoder. The specific technical solutions are as follows:

[0005] In a first aspect, an embodiment of the present application provides a video encoding method, which is applied to a control module of an encoder, wherein the encoder is further provided with an encoding module and a plurality of input interfaces, wherein the encoding module includes a plurality of processing units for performing data encoding, and different processing units are used to perform encoding tasks at different encoding stages during the encoding process; the method comprises:

[0006] Determine each target input interface and encoding scheduling strategy; wherein each target input interface is an input interface among the multiple input interfaces for receiving each channel of image data stream to be encoded and sent by the target transmission end; each target input interface uniquely corresponds to an encoding channel belonging to a virtual channel; the encoding scheduling strategy includes a first strategy for characterizing a polling order required for polling processing of each encoding channel, and a second strategy for characterizing an allocation method of encoding channels required to be allocated to image blocks in each channel of image data stream;

[0007] In response to receiving an image block in any image data stream transmitted by the target transmission end according to the transmission mode corresponding to the second strategy, writing the received image block into a cache area corresponding to a first encoding channel; wherein the transmission mode is used to indicate that each image block in each image data stream is transmitted to a target input interface required to be used by the encoder, the first encoding channel is an encoding channel among the encoding channels corresponding to the target input interface receiving the image block, and each encoding channel corresponds to its own cache area;

[0008] And, according to the first strategy, the macroblocks to be encoded are read from the cache area corresponding to each encoding channel in sequence, and the read macroblocks are written into the sub-areas corresponding to the second encoding channel in the multiple sub-areas of the shared area, wherein each sub-area corresponds to a encoding channel, and the second encoding channel is the encoding channel corresponding to the cache area to which the read macroblocks belong in each encoding channel;

[0009] In response to the encoding module satisfying the data input condition, according to the first strategy, determining the encoding channel to be polled when inputting data to the encoding module as the channel to be processed; reading the macroblock currently to be processed from the sub-area corresponding to the channel to be processed, and inputting the read macroblock to the encoding module for encoding processing based on each processing unit;

[0010] The data input condition is that the first processing unit in the encoding module has no tasks to be processed.

[0011] In a second aspect, an embodiment of the present application provides a method for encoding LED display data, which is applied to a control module of an encoder, wherein the encoder is further provided with an encoding module and a plurality of input interfaces, wherein the encoding module includes a plurality of processing units for data encoding, and different processing units are used to perform encoding tasks at different encoding stages during the encoding process; the method comprises:

[0012] Determine each target input interface and encoding scheduling strategy; wherein each target input interface is an input interface among the multiple input interfaces for receiving each channel of image data stream to be encoded and sent by the target transmission end; each target input interface uniquely corresponds to an encoding channel belonging to a virtual channel; the encoding scheduling strategy includes a first strategy for characterizing the polling order required for polling processing of each encoding channel, and a second strategy for characterizing the allocation method of encoding channels required to be allocated to image blocks in each channel of image data stream; each channel of image data stream to be encoded and processed is each channel of image data stream for splicing and displaying on a light-emitting diode (LED) display screen;

[0013] In response to receiving an image block in any image data stream transmitted by the target transmission end according to the transmission mode corresponding to the second strategy, writing the received image block into a cache area corresponding to a first encoding channel; wherein the transmission mode is used to indicate that each image block in each image data stream is transmitted to a target input interface required to be used by the encoder, the first encoding channel is an encoding channel among the encoding channels corresponding to the target input interface receiving the image block, and each encoding channel corresponds to its own cache area;

[0014] And, according to the first strategy, the macroblocks to be encoded are read from the cache area corresponding to each encoding channel in sequence, and the read macroblocks are written into the sub-areas corresponding to the second encoding channel in the multiple sub-areas of the shared area, wherein each sub-area corresponds to a encoding channel, and the second encoding channel is the encoding channel corresponding to the cache area to which the read macroblocks belong in each encoding channel;

[0015] In response to the encoding module satisfying the data input condition, according to the first strategy, determining the encoding channel to be polled when inputting data to the encoding module as the channel to be processed; reading the macroblock currently to be processed from the sub-area corresponding to the channel to be processed, and inputting the read macroblock to the encoding module for encoding processing based on each processing unit;

[0016] The data input condition is that the first processing unit in the encoding module has no tasks to be processed.

[0017] In a third aspect, an embodiment of the present application provides a video encoding device, which is applied to a control module of an encoder, wherein the encoder is further provided with an encoding module and a plurality of input interfaces, wherein the encoding module includes a plurality of processing units for performing data encoding, and different processing units are used to perform encoding tasks at different encoding stages during the encoding process; the device includes:

[0018] The first determination module is used to determine each target input interface and the encoding scheduling strategy; wherein each target input interface is an input interface among the multiple input interfaces for receiving each channel of image data stream to be encoded and sent by the target transmission end; each target input interface uniquely corresponds to a coding channel belonging to a virtual channel; the encoding scheduling strategy includes a first strategy for characterizing the polling order required for polling processing of each coding channel, and a second strategy for characterizing the allocation method of the coding channels required to be allocated to the image blocks in each channel of image data stream;

[0019] A first writing module is configured to write the received image block in a cache area corresponding to a first coding channel in response to receiving an image block in any image data stream transmitted by the target transmission end according to a transmission mode corresponding to the second strategy; wherein the transmission mode is used to indicate that each image block in each image data stream is transmitted to a target input interface required to be used by the encoder, the first coding channel is a coding channel among the coding channels corresponding to the target input interface receiving the image block, and each coding channel corresponds to its own cache area;

[0020] A first reading module is used to read the macroblocks to be encoded from the cache area corresponding to each coding channel in sequence according to the first strategy, and write the read macroblocks into the sub-areas corresponding to the second coding channel in the multiple sub-areas of the shared area, wherein each sub-area corresponds to a coding channel, and the second coding channel is the coding channel corresponding to the cache area to which the read macroblocks belong in each coding channel;

[0021] A second determination module is configured to, in response to the encoding module satisfying the data input condition, determine, according to the first strategy, an encoding channel to be polled when inputting data to the encoding module as a channel to be processed; read a macroblock currently to be processed from a sub-region corresponding to the channel to be processed, and input the read macroblock to the encoding module for encoding processing based on each processing unit;

[0022] The data input condition is that the first processing unit in the encoding module has no tasks to be processed.

[0023] In a fourth aspect, an embodiment of the present application provides an encoding device for LED display data, which is applied to a control module of an encoder, wherein the encoder is further provided with an encoding module and a plurality of input interfaces, wherein the encoding module includes a plurality of processing units for data encoding, and different processing units are used to perform encoding tasks at different encoding stages during the encoding process; the device includes:

[0024] The third determination module is used to determine each target input interface and the encoding scheduling strategy; wherein each target input interface is an input interface among the multiple input interfaces for receiving each channel of image data stream to be encoded and sent by the target transmission end; each target input interface uniquely corresponds to a coding channel belonging to a virtual channel; the encoding scheduling strategy includes a first strategy for characterizing the polling order required for polling processing of each coding channel, and a second strategy for characterizing the allocation method of the coding channel required to be allocated to the image block in each channel of image data stream; each channel of image data stream to be encoded and processed is each channel of image data stream for splicing and displaying on a light-emitting diode LED display screen;

[0025] A second writing module is configured to write the received image block in a cache area corresponding to a first coding channel in response to receiving an image block in any image data stream transmitted by the target transmission end according to a transmission mode corresponding to the second strategy; wherein the transmission mode is used to indicate that each image block in each image data stream is transmitted to a target input interface required to be used by the encoder, the first coding channel is a coding channel among the coding channels corresponding to the target input interface receiving the image block, and each coding channel corresponds to its own cache area;

[0026] A second reading module is used to read the macroblocks to be encoded from the cache area corresponding to each coding channel in sequence according to the first strategy, and write the read macroblocks into the sub-areas corresponding to the second coding channel in the multiple sub-areas of the shared area, wherein each sub-area corresponds to a coding channel, and the second coding channel is the coding channel corresponding to the cache area to which the read macroblocks belong in each coding channel;

[0027] a fourth determination module, configured to, in response to the encoding module satisfying the data input condition, determine, according to the first strategy, an encoding channel to be polled when inputting data to the encoding module as a channel to be processed; read a macroblock currently to be processed from a sub-region corresponding to the channel to be processed, and input the read macroblock to the encoding module for encoding processing based on each processing unit;

[0028] The data input condition is that the first processing unit in the encoding module has no tasks to be processed.

[0029] In a fifth aspect, an embodiment of the present application provides an electronic device, including:

[0030] Memory, used to store computer programs;

[0031] The processor is used to implement any of the above-mentioned video encoding methods and / or the encoding method for LED display data when executing the program stored in the memory.

[0032] In a sixth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements any of the above-mentioned video encoding methods and / or encoding methods for LED display data.

[0033] Beneficial effects of the embodiments of the present application:

[0034] Considering that when encoding an image, there is coding dependency between the macroblocks of the same image block. For example, for the same image block, the prediction stage of the macroblock to be encoded later needs to rely on the intermediate results of the decision-making and reconstruction stages of the macroblock to be encoded earlier, that is, it is necessary to wait for the macroblock to be encoded earlier to complete the decision-making and reconstruction stages before the macroblock to be encoded later can start the prediction stage. Therefore, there is undoubtedly a time-consuming waiting period, which leads to an idle period in the processing unit of the encoding module. Since the macroblocks between the image blocks of different image data streams have no coding dependency, in the solution provided by the present application, respective coding channels are set for each target input interface, and the image data streams of each channel are distributed to the multiple coding channels through the second strategy; and through the first strategy, the cache area corresponding to each coding channel, and the sub-area in the shared area corresponding to each coding channel, the macroblocks of different coding channels can be polled for encoding in turn, that is, the macroblocks of image blocks of different channels are polled for encoding. Since the macroblocks of different coding channels come from image blocks of different image data streams, the various processing units of the coding module can perform macroblock processing in parallel, and there is no waiting time in the processing of macroblocks of each coding channel. At the same time, for any coding channel, after a macroblock of the coding channel is encoded, the next macroblock of the macroblock of the coding channel will be polled only after polling of each coding channel is completed, and the intermediate result of the macroblock is usually already generated, so the encoding process of the next macroblock can directly use the intermediate result of the macroblock. It can be seen that this scheme, by using the respective encoding channels of each target input interface, the first strategy, the second strategy, the cache area corresponding to each encoding channel, the sub-area corresponding to each encoding channel, and the input trigger of the encoding module satisfying the data input condition, can realize polling from the perspective of the macroblocks of the image blocks of each image data stream, and in response to the fact that there is no task to be processed in the first processing unit, the macroblock input is made to the encoding module to continuously input the macroblock to the encoding module, so that each processing unit does not need to wait for the intermediate results of the macroblocks on which the processed macroblock depends when processing the macroblock, and each processing unit of the encoding module can process the macroblock in parallel. Therefore, parallel encoding processing can be realized through this scheme, which saves the hardware resources of the encoder (that is, there is no need to set up multiple encoders) and improves the resource utilization of the encoder.

[0035] In addition, the size of the image blocks in each image data stream to be encoded and sent by the target transmission end is not limited. The present application can perform parallel encoding on image blocks of different sizes or different types; and during use, the number of target input interfaces can also be dynamically adjusted, thereby achieving adjustment of the number of encoding channels corresponding to the target input interfaces.

[0036] In addition, the encoding scheduling strategy in the embodiment of the present application includes a first strategy for characterizing the polling order required for polling processing of each encoding channel, and a second strategy for characterizing the allocation method of the encoding channels required to be allocated to the image blocks in each image data stream. Based on the specific application scenario, the first strategy and the second strategy can be adjusted to achieve flexible response to various video encoding scenarios.

[0037] Of course, implementing any product or method of the present application does not necessarily require achieving all of the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other embodiments can also be obtained based on these drawings.

[0039] FIG. 1 (a) is a schematic diagram of a preview effect in a video stitching scenario in the related art;

[0040] FIG1( b ) is a schematic diagram of the principle of video encoding in the related art;

[0041] Figure 2 A schematic diagram of a video encoding method provided in an embodiment of the present application;

[0042] FIG3 (a) is a schematic diagram of a coding principle for a coding module provided in an embodiment of the present application;

[0043] FIG3 (b) is another schematic diagram of the encoding principle for the encoding module provided in an embodiment of the present application;

[0044] Figure 4 A schematic diagram of a process for determining a target input interface and an encoding scheduling strategy provided in an embodiment of the present application;

[0045] FIG5 (a) is a schematic diagram of an effect of the second strategy provided in an embodiment of the present application;

[0046] FIG5( b ) is another schematic diagram of the effect of the second strategy provided in an embodiment of the present application;

[0047] FIG5 (c) is a schematic diagram of another effect of the second strategy provided in an embodiment of the present application;

[0048] FIG6 (a) is a schematic diagram of a working principle of a shared area and a control module provided in an embodiment of the present application;

[0049] FIG6 (b) is a schematic diagram of an internal structure of a shared area provided in an embodiment of the present application;

[0050] FIG6 (c) is a schematic diagram of an internal structure of an intermediate temporary storage buffer area provided in an embodiment of the present application;

[0051] FIG. 7 (a) is a schematic diagram of a working principle of a video encoding provided in an embodiment of the present application;

[0052] FIG7 (b) is a schematic diagram of a working principle of a code control unit provided in an embodiment of the present application;

[0053] FIG7 (c) is a schematic diagram of a working principle of an entropy coding unit provided in an embodiment of the present application;

[0054] FIG7 (d) is a schematic diagram of a working principle of a packaging unit provided in an embodiment of the present application;

[0055] Figure 8 A schematic diagram of a flow chart of a method for encoding LED display data provided in an embodiment of the present application;

[0056] Fig. 9 A schematic diagram of the structure of a video encoding device provided in an embodiment of the present application;

[0057] Fig.10 A schematic diagram of the structure of an encoding device for LED display data provided in an embodiment of the present application;

[0058] Fig.11 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0059] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field based on the present application belong to the scope of protection of the present application.

[0060] First, some professional terms in the embodiments of the present application are briefly introduced:

[0061] Transformation / quantization: Transformation quantization mainly includes two parts: transformation and quantization. The purpose of transformation / quantization is to reduce the amount of data and thus improve compression efficiency. Among them, transformation can be considered as converting the image time domain signal into a frequency domain signal, while quantization can be considered as further compressing the data by reducing the dynamic range of the data.

[0062] Decision / Reconstruction: Through decision-making, the most appropriate coding mode can be selected to achieve the desired coding effect. For example, in the scenario of video coding, from multiple prediction modes, it is decided that image data 1 is more in line with the inter-frame coding mode. Based on the inter-frame coding mode, it is possible to improve coding efficiency and reduce redundancy without causing any loss in coding performance; reconstruction focuses more on the improvement or optimization of the determined coding mode.

[0063] Entropy coding: A lossless data compression technique that is achieved by replacing each letter in a text with bits of different lengths.

[0064] Encapsulation: It can be considered as the process of packaging video data to facilitate data storage and transmission.

[0065] Macroblock: Also known as Macroblock, it is a basic concept in video coding technology. It divides the picture into blocks of different sizes to facilitate block compression.

[0066] Secondly, in order to better understand the present application, before introducing the method provided in the embodiment of the present application, the video encoding technology of the prior art is introduced in conjunction with the accompanying drawings, as shown in FIG. 1 (a) and FIG. 1 (b):

[0067] Figure 1 (a) is a schematic diagram of the preview effect in the video splicing scene. In the preview interface, there are 5 coding blocks, namely coding block 1, coding block 2, coding block 3, coding block 4 and coding block 5. Each coding block can be understood as an image block. In the related art, it is usually necessary to use multiple encoders, or use a single high-performance encoder for time-division multiplexing serial encoding.

[0068] FIG1(b) is a schematic diagram of the principle of video coding in the related art. At time T0, the encoder can perform mode prediction on the macroblock of channel 1 and obtain multiple prediction modes. This process can be called: channel 1 prediction, wherein the prediction mode is a mode for frame coding, such as: intra-frame coding mode, inter-frame coding mode, etc.; at time T1, based on multiple prediction modes, the macroblock is transformed / quantized, and the transformed / quantized macroblocks corresponding to the multiple prediction modes can be obtained. This process can be called: transformation / quantization; at time T2, the corresponding frame coding mode is determined from the multiple prediction modes, and the transformed / quantized macroblocks corresponding to the determined frame coding mode are reconstructed to obtain the reconstructed macroblocks. The reconstructed macroblock, this process can be called: decision / reconstruction; at time T3, the encoder can predict the mode of the next macroblock transmitted by channel 1 (in this process, since there is correlation between macroblocks, the frame coding mode decided at time T2 can be referred to for prediction), this process can be called: channel 1 prediction, and the encoder can also perform entropy coding based on the reconstructed macroblock, this process can be called: entropy coding; at time T4, the encoder can transform / quantize the next macroblock based on the multiple frame coding modes predicted for the next macroblock, this process can also be called: transform / quantization, and the encoder can also encapsulate the macroblock based on the result of entropy coding to obtain the code stream encapsulation result. In addition, the time from time T0 to time T2 can be considered as macroblock coding delay.

[0069] However, in the related art, macroblocks are serially encoded in a time-division multiplexing manner. Each processing unit works only 1 / 3 of the time. There is a macroblock encoding delay in the encoding process. Therefore, the processing units cannot be pipelined, that is, they cannot be encoded in parallel in the form of a pipeline. The serial encoding method will result in low resource utilization of the encoder.

[0070] In addition, there is also parallel encoding in related technologies, such as WPP (wavefront parallel processing), but this method can only encode different macroblocks or tiles of the same image, and cannot encode multiple videos of different sizes.

[0071] Based on the problems existing in the related art, the present application provides a video encoding method and an encoding method for LED display data to improve the resource utilization of the encoder.

[0072] Next, a video encoding method provided in an embodiment of the present application is introduced below.

[0073] Among them, a video encoding method provided in an embodiment of the present application can be applied to the control module of the encoder. The control module can be considered as a module that controls the encoder to perform encoding. The control module can also be called a multi-channel control module. In specific applications, the control module can be a hardware module, specifically an independent circuit loaded with multi-channel scheduling logic. Of course, the control module can also be a software module, and the embodiment of the present application does not make specific limitations on this.

[0074] In addition, an input interface is also provided in the encoder, and the input interface can be considered as a physical interface actually provided on the encoder. The encoder also includes various processing units, and each processing unit can be considered as a physical module. The introduction of each processing unit will be introduced in subsequent embodiments, and will not be elaborated here.

[0075] It should be emphasized that any video coding technology in the relevant technology can realize the prediction, transformation / quantization, decision / reconstruction, entropy coding and packaging processes introduced above.

[0076] The terms "unit" and "module" in the embodiments of the present application may be hardware parts, software programs, or software programs and the necessary carriers for the operation of the software programs. With the evolution of technology, the steps required to execute these "units" or "modules" or the functions they undertake (for example, the steps described later after a certain unit or module is "used for") may be executed using hardware, software, or a combination of hardware and software. As long as the hardware, software, or a combination of hardware and software can execute the steps required to be executed by the "unit", they can be considered as "units" or "modules" in the embodiments of the present application.

[0077] The following is a brief introduction to the application scenarios of the video encoding method provided in the embodiment of the present application:

[0078] The embodiments of the present application can be applied to scenarios of video splicing and display, and an LED display screen / LCD display screen can be used to display the spliced ​​image data. Specifically, it can be a scenario of splicing image data collected by multiple cameras. Of course, it can also be a scenario of displaying multiple advertisements on an LED display screen. The embodiments of the present application do not specifically limit the application scenarios.

[0079] Among them, a video encoding method is applied to a control module of an encoder, the encoder is also provided with an encoding module and multiple input interfaces, the encoding module includes multiple processing units for data encoding, and different processing units are used to perform encoding tasks at different encoding stages during the encoding process; the method includes:

[0080] Determine each target input interface and encoding scheduling strategy; wherein each target input interface is an input interface among the multiple input interfaces for receiving each channel of image data stream to be encoded and sent by the target transmission end; each target input interface uniquely corresponds to an encoding channel belonging to a virtual channel; the encoding scheduling strategy includes a first strategy for characterizing a polling order required for polling processing of each encoding channel, and a second strategy for characterizing an allocation method of encoding channels required to be allocated to image blocks in each channel of image data stream;

[0081] In response to receiving an image block in any image data stream transmitted by the target transmission end according to the transmission mode corresponding to the second strategy, writing the received image block into a cache area corresponding to a first encoding channel; wherein the transmission mode is used to indicate that each image block in each image data stream is transmitted to a target input interface required to be used by the encoder, the first encoding channel is an encoding channel among the encoding channels corresponding to the target input interface receiving the image block, and each encoding channel corresponds to its own cache area;

[0082] And, according to the first strategy, the macroblocks to be encoded are read from the cache area corresponding to each encoding channel in sequence, and the read macroblocks are written into the sub-areas corresponding to the second encoding channel in the multiple sub-areas of the shared area, wherein each sub-area corresponds to a encoding channel, and the second encoding channel is the encoding channel corresponding to the cache area to which the read macroblocks belong in each encoding channel;

[0083] In response to the encoding module satisfying the data input condition, according to the first strategy, determining the encoding channel to be polled when inputting data to the encoding module as the channel to be processed; reading the macroblock currently to be processed from the sub-area corresponding to the channel to be processed, and inputting the read macroblock to the encoding module for encoding processing based on each processing unit;

[0084] The data input condition is that the first processing unit in the encoding module has no tasks to be processed.

[0085] Considering that when encoding an image, there is coding dependency between the macroblocks of the same image block. For example, for the same image block, the prediction stage of the macroblock to be encoded later needs to rely on the intermediate results of the decision-making and reconstruction stages of the macroblock to be encoded earlier, that is, it is necessary to wait for the macroblock to be encoded earlier to complete the decision-making and reconstruction stages before the macroblock to be encoded later can start the prediction stage. Therefore, there is undoubtedly a time-consuming waiting period, which leads to an idle period in the processing unit of the encoding module. Since the macroblocks between the image blocks of different image data streams have no coding dependency, in the solution provided by the present application, respective coding channels are set for each target input interface, and the image data streams of each channel are distributed to the multiple coding channels through the second strategy; and through the first strategy, the cache area corresponding to each coding channel, and the sub-area in the shared area corresponding to each coding channel, the macroblocks of different coding channels can be polled for encoding in turn, that is, the macroblocks of image blocks of different channels are polled for encoding. Since the macroblocks of different coding channels come from image blocks of different image data streams, the various processing units of the coding module can perform macroblock processing in parallel, and there is no waiting time in the processing of macroblocks of each coding channel. At the same time, for any coding channel, after a macroblock of the coding channel is encoded, the next macroblock of the macroblock of the coding channel will be polled only after polling of each coding channel is completed, and the intermediate result of the macroblock is usually already generated, so the encoding process of the next macroblock can directly use the intermediate result of the macroblock. It can be seen that this scheme, by using the respective encoding channels of each target input interface, the first strategy, the second strategy, the cache area corresponding to each encoding channel, the sub-area corresponding to each encoding channel, and the input trigger of the encoding module satisfying the data input condition, can realize polling from the perspective of the macroblocks of the image blocks of each image data stream, and in response to the fact that there is no task to be processed in the first processing unit, the macroblock input is made to the encoding module to continuously input the macroblock to the encoding module, so that each processing unit does not need to wait for the intermediate results of the macroblocks on which the processed macroblock depends when processing the macroblock, and each processing unit of the encoding module can process the macroblock in parallel. Therefore, parallel encoding processing can be realized through this scheme, which saves the hardware resources of the encoder (that is, there is no need to set up multiple encoders) and improves the resource utilization of the encoder.

[0086] In addition, the size of the image blocks in each image data stream to be encoded and sent by the target transmission end is not limited. The present application can perform parallel encoding on image blocks of different sizes or different types; and during use, the number of target input interfaces can also be dynamically adjusted, thereby achieving adjustment of the number of encoding channels corresponding to the target input interfaces.

[0087] In addition, the encoding scheduling strategy in the embodiment of the present application includes a first strategy for characterizing the polling order required for polling processing of each encoding channel, and a second strategy for characterizing the allocation method of the encoding channels required to be allocated to the image blocks in each image data stream. Based on the specific application scenario, the first strategy and the second strategy can be adjusted to achieve flexible response to various video encoding scenarios.

[0088] A video encoding method provided by an embodiment of the present application is described below in conjunction with the accompanying drawings.

[0089] like Figure 2 As shown, a video encoding method provided in an embodiment of the present application is applied to a control module of an encoder, wherein the encoder is further provided with an encoding module and a plurality of input interfaces, wherein the encoding module includes a plurality of processing units for performing data encoding, and different processing units are used to perform encoding tasks at different encoding stages during the encoding process; the method comprises:

[0090] S201, determining each target input interface and encoding scheduling strategy;

[0091] Wherein, each target input interface is an input interface among the multiple input interfaces, which is used to receive each channel of image data streams to be encoded and processed sent by the target transmission end; each target input interface uniquely corresponds to a coding channel belonging to a virtual channel; the coding scheduling strategy includes a first strategy for characterizing the polling order required for polling processing of each coding channel, and a second strategy for characterizing the allocation method of the coding channels required to be allocated to the image blocks in each channel of image data stream;

[0092] Among them, the target transmission end can be considered as the sending end that sends each image data stream to be encoded and processed to the encoder. If the video source sends each image data stream to be encoded and processed to the encoder, the video source can be used as the target transmission end. The embodiment of the present application does not make specific limitations on this; and, the image block in each image data stream can be considered as an image frame. Based on the above Figure 1 (a), any coding block in the coding blocks 1-5 can also be called an image block.

[0093] It can be understood that some or all of the multiple input interfaces set by the encoder can receive various image data streams to be encoded and processed sent by the target transmission end. In the present application, the input interface used to receive various image data streams to be encoded and processed sent by the target transmission end is used as the target input interface, that is, each target input interface is an input interface that can receive the image data stream to be encoded and processed sent by the target transmission end; and each target input interface corresponds to a unique encoding channel, which belongs to a virtual channel, and each encoding channel has a channel number, for example: encoding channel 1, encoding channel 2, etc.; in addition, the encoding channel can also be called a channel, and the embodiment of the present application does not make specific limitations on this.

[0094] In addition, the coding scheduling strategy may include two strategies, namely, the first strategy and the second strategy, wherein the first strategy is a strategy for the polling order required for polling processing of each coding channel. After each round of polling for each coding channel is completed, it can be considered that the macroblocks of each coding channel are encoded in turn. Since the macroblocks of different coding channels come from image blocks of different image data streams, it can also be considered that the macroblocks of image blocks of different paths are polled for encoding. Exemplarily, there are three target input interfaces, namely target input interface 1, target input interface 2 and target input interface 3. Target input interface 1 corresponds to coding channel 1, target input interface 2 corresponds to coding channel 2, and target input interface 3 corresponds to coding channel 3. The first strategy represents that the polling order is coding channel 1, coding channel 2, and coding channel 3. Then, each coding channel can be polled in the order represented by the first strategy. First, poll coding channel 1. Then, the macroblocks of the image blocks in the image data stream received by the target input interface 1 corresponding to coding channel 1 can be processed. Then, poll coding channel 2. The macroblocks of the image blocks in the image data stream received by the target input interface 2 corresponding to coding channel 2 can be processed. Finally, poll coding channel 3. The macroblocks of the image blocks in the image data stream received by the target input interface 3 corresponding to coding channel 3 can be processed, thereby completing a round of polling for the coding channels and then polling coding channel 1 again. In addition, the use of the first strategy is not only used for polling each encoding channel. When writing the macroblock to be encoded into the shared area, it can also be based on the first strategy. This part of the content will be introduced in subsequent embodiments and will not be elaborated here.

[0095] And, the second strategy represents the strategy of allocating the coding channels required to be allocated to the image blocks in each image data stream. It can also be considered as a strategy of allocating corresponding coding channels to the image blocks in each image data stream. It can also be considered as a strategy of distributing each image data stream to multiple coding channels. There can be many specific allocation methods. For the sake of clear layout, the allocation method in the second strategy will be introduced in subsequent embodiments and will not be elaborated here.

[0096] For the sake of clarity, the specific method of determining each target input interface and the encoding scheduling strategy will be introduced in subsequent embodiments and will not be elaborated here.

[0097] In addition, there are multiple encoding channels, and the control module of the encoder can also control the switching of encoding channels during the video encoding process, that is, switching and selecting the encoding channel to be used according to the dynamic selection of the target input interface. For example, there are 32 encoding channels, and the control module can switch between the 32 encoding channels in real time.

[0098] S202, in response to receiving an image block in any image data stream transmitted by the target transmission end according to the transmission mode corresponding to the second strategy, writing the received image block into a cache area corresponding to the first encoding channel;

[0099] The transmission mode is used to indicate that, for each image block in each image data stream, the target input interface to be used by the encoder is transmitted, the first encoding channel is an encoding channel among the encoding channels corresponding to the target input interface receiving the image block, and each encoding channel has its own corresponding cache area;

[0100] It can be understood that when the target transmission end transmits an image block in any image data stream, it can transmit the image block to the target input interface required by the encoder according to the transmission mode corresponding to the second strategy. When the control module receives the image block through the target input interface, it can write the image block into the cache area corresponding to the encoding channel corresponding to the target input interface that receives the image block, that is, write it into the cache area corresponding to the first encoding channel; wherein, the cache area corresponding to each encoding channel can also be called a scheduling cache, or a scheduling area, and the cache area corresponding to each encoding channel may not have a large data storage capacity, and can only store one image block in one image data stream, and the embodiment of the present application does not specifically limit this. And, illustratively, in one implementation, the transmission mode corresponding to the second strategy can also be considered to be inputting the image block from the target input interface corresponding to the encoding channel after determining the allocated encoding channel.

[0101] Exemplarily, in response to receiving an image block 1 in an image data stream transmitted by a video source, the received image block 1 can be written into a cache area corresponding to the encoding channel 1 corresponding to the target input interface 1 that receives the image block 1. Then, the first encoding channel can be considered as encoding channel 1.

[0102] S203, according to the first strategy, read the macroblocks to be encoded from the cache areas corresponding to the respective encoding channels in sequence, and write the read macroblocks into the sub-areas corresponding to the second encoding channel among the multiple sub-areas of the shared area;

[0103] Each sub-region corresponds to a coding channel, and the second coding channel is a coding channel among the coding channels corresponding to the cache region to which the read macroblock belongs;

[0104] It can be understood that the macroblocks to be encoded can be read from the cache areas corresponding to each coding channel in sequence according to the order represented by the first strategy. This process can also be considered as polling processing for each coding channel, and the read macroblocks are written to the sub-areas corresponding to the coding channels corresponding to the cache areas to which the read macroblocks belong in the multiple sub-areas of the shared area, that is, the sub-areas corresponding to the second coding channel in the multiple sub-areas of the shared area; wherein the shared area is pre-divided into multiple sub-areas, each sub-area corresponds to a coding channel, and the read macroblocks are only written to the sub-areas corresponding to the coding channels corresponding to the cache areas to which the macroblocks belong.

[0105] It should be emphasized that the channel number of the second encoding channel can be the same as the channel number of the first encoding channel. For example, the received image block 1 is written to the cache area corresponding to the encoding channel 1, and then the macroblock 1 of the image block 1 can be read from the cache area corresponding to the encoding channel 1, and the macroblock 1 can be written to the sub-area corresponding to the encoding channel 1 in the shared area.

[0106] In addition, when writing to the shared area, the data written is not an image block but a macroblock. It can also be considered that the data written to the shared area is macroblock-level data, which can also be called row-level data. Compared with directly encoding the entire image block, the rate of encoding macroblocks is higher, and, when performing subsequent parallel encoding, the delay will also be lower, and the lowest delay can reach row-level.

[0107] It should be emphasized that step S202 and step S203 are not necessarily executed continuously, and there may be a time difference between the two steps. The embodiment of the present application does not specifically limit this. By way of example, image block 1 can be written into the cache area corresponding to encoding channel 1, but the macroblock to be encoded in image block 1 is not necessarily read immediately from the cache area corresponding to encoding channel 1. The macroblock to be encoded can be read from the cache area corresponding to encoding channel 1 only when the first strategy indicates that encoding channel 1 is polled.

[0108] S204, in response to the encoding module satisfying the data input condition, according to the first strategy, determining the encoding channel to be polled when inputting data to the encoding module as the channel to be processed; reading the current macroblock to be processed from the sub-region corresponding to the channel to be processed, and inputting the read macroblock to the encoding module for encoding processing based on each processing unit;

[0109] The data input condition is that the first processing unit in the encoding module has no tasks to be processed.

[0110] It can be understood that when there is no task to be processed in the first processing unit in the encoding module, that is, when the first processing unit in the encoding module is in an idle state, it can be considered that the data input condition is met. Of course, the data input condition can also be to trigger the next-level processing unit of the first processing unit to perform task processing on the processed data of the current macroblock to be encoded obtained by the first processing unit. At this time, the first processing unit can also be considered to be in an idle state. The embodiment of the present application does not specifically limit the data input condition.

[0111] And, after the data input conditions are met, the coding channels can be polled in the order represented by the first strategy to determine the coding channel to be polled as the channel to be processed. At this time, the sub-region corresponding to the channel to be processed stores the data required to be input to the coding module; accordingly, the macroblock currently to be processed can be read from the sub-region corresponding to the channel to be processed, and the read macroblock can be input to the coding module, so that each processing unit in the coding module performs coding processing. Exemplarily, the first strategy indicates that the coding channel currently to be polled is coding channel 1. At this time, the macroblock 1 currently to be processed can be read from the sub-region corresponding to coding channel 1, and the read macroblock 1 can be input to the coding module for coding processing.

[0112] Among them, the various processing units in the encoding module are specifically: a prediction unit, a transform / quantization unit, a decision / reconstruction unit, an entropy coding unit and an encapsulation unit. Usually, the first processing unit included in the encoding module is the prediction unit. Of course, the various processing units in the encoding module do not only include the units introduced above, but may also include processing units such as code control units. The embodiment of the present application does not make specific limitations on this; and the order in which encoding processing is performed on each processing unit is not specifically limited by the embodiment of the present application.

[0113] In order to better understand the encoding process performed by each processing unit of the encoding module, the following is an introduction with reference to the accompanying drawings, as shown in FIG3 (a) and FIG3 (b):

[0114] The channels in FIG. 3( a ) and FIG. 3( b ) are the coding channels introduced above.

[0115] In the scene corresponding to Figure 3 (a), there are three target input ports. Figure 3 (a) is introducing the encoding process of three encoding channels. In Figure 3 (a), the macroblock encoding delay is 3T, which can be considered as the number of encoding channels × T. T can also be called a "time slice", which can specifically include T0, T1, etc.

[0116] At time T0, the prediction unit may perform mode prediction for the macroblock of channel 1, and may obtain multiple prediction modes. This process may be referred to as: channel 1 prediction, and the prediction unit may transmit the multiple prediction modes for channel 1 to the transform / quantization unit of the next level;

[0117] At time T1, the prediction unit can perform mode prediction for the macroblock of channel 2, and can obtain multiple prediction modes. This process can be called: channel 2 prediction, and the prediction unit can transmit the multiple prediction modes for channel 2 to the transform / quantization unit of the next level. At the same time, at time T1, the transform / quantization unit can transform / quantize the macroblock of channel 1 based on the multiple prediction modes of channel 1, and can obtain the transformed / quantized macroblocks corresponding to the multiple prediction modes of channel 1. This process can be called: channel 1 transform / quantization, and the transform / quantization unit can transmit the transformed / quantized macroblocks corresponding to the multiple prediction modes of channel 1 to the decision / reconstruction unit of the next level;

[0118] At time T2, the prediction unit can perform mode prediction on the macroblock transmitted by channel 3, and multiple prediction modes can be obtained. This process can be called: channel 3 prediction, and the prediction unit can transmit the multiple prediction modes for channel 3 to the transform / quantization unit of the next level. At the same time, at time T2, the transform / quantization unit can transform / quantize the macroblock of channel 2 based on the multiple prediction modes of channel 2, and the transformed / quantized macroblocks corresponding to the multiple prediction modes of channel 2 can be obtained. This process can be called: channel 2 transform / quantization, and the transform / quantization unit can transform / quantize the macroblock of channel 2 based on the multiple prediction modes of channel 2. The transformed / quantized macroblocks corresponding to the multiple prediction modes are transmitted to the decision / reconstruction unit of the next level. At the same time, at time T2, the decision / reconstruction unit can decide the frame coding mode corresponding to the macroblock of channel 1 based on the multiple prediction modes, and reconstruct the transformed / quantized macroblocks corresponding to the decided frame coding mode to obtain the reconstructed macroblocks. This process can be called: channel 1 decision / reconstruction. The decision / reconstruction unit can send the frame coding mode corresponding to the macroblock of channel 1 decided to the prediction unit, and send the reconstructed macroblock of channel 1 to the entropy coding unit of the next level.

[0119] At time T3, the prediction unit can refer to the frame coding mode corresponding to the macroblock of channel 1 sent by the decision / reconstruction unit, and perform mode prediction for the next macroblock transmitted by channel 1, and multiple prediction modes can be obtained. This process can be called: channel 1 prediction, and the prediction unit can transmit the multiple prediction modes for channel 1 to the transform / quantization unit of the next level. At the same time, at time T3, the transform / quantization unit can transform / quantize the macroblock of channel 3 based on the multiple prediction modes of channel 3, and can obtain the transformed / quantized macroblocks corresponding to the multiple prediction modes of channel 3. This process can be called: channel 3 transform / quantization, and the transform / quantization unit can transmit the transformed / quantized macroblocks corresponding to the multiple prediction modes of channel 3 to the next level. A first-level decision / reconstruction unit, at the same time, at time T3, the decision / reconstruction unit can decide the frame coding mode corresponding to the macroblock of channel 2 based on multiple prediction modes, and reconstruct the transformed / quantized macroblock corresponding to the decided frame coding mode to obtain the reconstructed macroblock. This process can be called: channel 2 decision / reconstruction. The decision / reconstruction unit can send the frame coding mode corresponding to the decided macroblock of channel 2 to the prediction unit, and send the reconstructed macroblock of channel 2 to the next-level entropy coding unit. At the same time, at time T3, the entropy coding unit can perform entropy coding based on the reconstructed macroblock of channel 1. This process can be called: channel 1 entropy coding. At the same time, the entropy coding unit can also send the entropy coding result to the next-level encapsulation unit;

[0120] At time T4, the prediction unit can refer to the frame coding mode corresponding to the macroblock of channel 2 sent by the decision / reconstruction unit, and perform mode prediction for the next macroblock transmitted by channel 2, and multiple prediction modes can be obtained. This process can be called: channel 2 prediction, and the prediction unit can transmit multiple prediction modes for channel 1 to the next level of transform / quantization unit. At the same time, at time T4, the transform / quantization unit can transform / quantize the next macroblock of channel 1 based on the multiple prediction modes of channel 1, and the next macroblock after transformation / quantization corresponding to the multiple prediction modes of channel 1 can be obtained. This process can be called : Channel 1 transformation / quantization, at the same time, at time T4, the decision / reconstruction unit can decide the frame coding mode corresponding to the macroblock of channel 3 based on multiple prediction modes, and reconstruct the transformed / quantized macroblock corresponding to the decided frame coding mode to obtain the reconstructed macroblock. This process can be called: channel 3 decision / reconstruction. The entropy coding unit can perform entropy coding based on the reconstructed macroblock of channel 2. This process can be called: channel 2 entropy coding. The encapsulation unit can encapsulate the entropy coding result based on the entropy coding result to obtain the code stream encapsulation result of the macroblock of channel 1. This process can be called: channel 1 encapsulation.

[0121] It should be emphasized that the macroblock targeted by the channel 1 prediction at time T0 described above is the first macroblock of coding channel 1, so there is no need to refer to other macroblocks and prediction can be performed directly. Also, the encoding performance of each coding channel described above will decrease, but the resource utilization of the entire encoder can be close to 100%.

[0122] It can be seen that the encoder in the embodiment of the present application can encode the macroblocks of channel 1, channel 2 and channel 3 in parallel, and the encoding modes corresponding to the macroblocks of channel 1, channel 2 and channel 3 may be different. Therefore, the embodiment of the present application can encode macroblocks of different encoding modes of different channels in parallel.

[0123] Of course, there is a subsequent continuous polling of channel 1, channel 2 and channel 3 until the image blocks in each image data stream are encoded, which will not be elaborated here.

[0124] In the scene corresponding to FIG3 (b), there are 5 target input ports. FIG3 (b) is introducing the encoding process of 5 encoding channels, which are: encoding channels 1-5. The macroblock encoding delay in the encoding process introduced in FIG3 (b) is 5T, which can be considered as the number of encoding channels × T. The difference between FIG3 (b) and FIG3 (a) is only the number of target input ports and the macroblock encoding delay. FIG3 (b) introduces the encoding process at T0-T5 time, but it is completely consistent with the encoding process introduced in FIG3 (a), so no further elaboration is made here.

[0125] Considering that when encoding an image, there is coding dependency between the macroblocks of the same image block. For example, for the same image block, the prediction stage of the macroblock to be encoded later needs to rely on the intermediate results of the decision-making and reconstruction stages of the macroblock to be encoded earlier, that is, it is necessary to wait for the macroblock to be encoded earlier to complete the decision-making and reconstruction stages before the macroblock to be encoded later can start the prediction stage. Therefore, there is undoubtedly a time-consuming waiting period, which leads to an idle period in the processing unit of the encoding module. Since the macroblocks between the image blocks of different image data streams have no coding dependency, in the solution provided by the present application, respective coding channels are set for each target input interface, and the image data streams of each channel are distributed to the multiple coding channels through the second strategy; and through the first strategy, the cache area corresponding to each coding channel, and the sub-area in the shared area corresponding to each coding channel, the macroblocks of different coding channels can be polled for encoding in turn, that is, the macroblocks of image blocks of different channels are polled for encoding. Since the macroblocks of different coding channels come from image blocks of different image data streams, the various processing units of the coding module can perform macroblock processing in parallel, and there is no waiting time in the processing of macroblocks of each coding channel. At the same time, for any coding channel, after a macroblock of the coding channel is encoded, the next macroblock of the macroblock of the coding channel will be polled only after polling of each coding channel is completed, and the intermediate result of the macroblock is usually already generated, so the encoding process of the next macroblock can directly use the intermediate result of the macroblock. It can be seen that this scheme, by using the respective encoding channels of each target input interface, the first strategy, the second strategy, the cache area corresponding to each encoding channel, the sub-area corresponding to each encoding channel, and the input trigger of the encoding module satisfying the data input condition, can realize polling from the perspective of the macroblocks of the image blocks of each image data stream, and in response to the fact that there is no task to be processed in the first processing unit, the macroblock input is made to the encoding module to continuously input the macroblock to the encoding module, so that each processing unit does not need to wait for the intermediate results of the macroblocks on which the processed macroblock depends when processing the macroblock, and each processing unit of the encoding module can process the macroblock in parallel. Therefore, parallel encoding processing can be realized through this scheme, which saves the hardware resources of the encoder (that is, there is no need to set up multiple encoders) and improves the resource utilization of the encoder.

[0126] Furthermore, the size of the image blocks in each image data stream to be encoded and sent by the target transmission end is not limited. The present application can perform parallel encoding for image blocks of different sizes or different types; and during use, the number of target input interfaces can also be dynamically adjusted, thereby adjusting the number of encoding channels corresponding to the target input interfaces. In addition, the encoding scheduling strategy in the embodiment of the present application includes a first strategy for characterizing the polling order required for polling processing of each encoding channel, and a second strategy for characterizing the allocation method of the encoding channels required to be allocated to the image blocks in each image data stream. Based on the specific application scenario, the first strategy and the second strategy can be adjusted to achieve flexible response to various video encoding scenarios.

[0127] Optionally, in another embodiment, the method further comprises step A1:

[0128] Step A1, during the encoding processing of the encoding module, specifying and controlling the encoding module;

[0129] Wherein, the designated control includes:

[0130] For any processing unit of the encoding module, when the processing unit completes the task of processing the received processing data for the current macroblock to be encoded, in response to satisfying the transfer condition, the next-level processing unit of the processing unit is triggered to perform task processing on the processing data of the current macroblock to be encoded obtained by the processing unit; wherein the transfer condition includes that the next-level processing unit has no tasks to be processed.

[0131] It is understandable that when any processing unit completes the task processing of the processing data of the currently received macroblock to be encoded, and the next-level processing unit has not performed task processing, at this time, the processing unit can transfer the processing data for the macroblock to be encoded to the next-level processing unit, so that the next-level processing unit performs task processing; wherein, the processing data of the current macroblock to be encoded can be the macroblock itself, or it can be the processing result of the previous processing unit, and the embodiment of the present application does not specifically limit this. It should be emphasized that the control module can monitor the task processing status of each processing unit in real time, and when the transfer condition is met, the next-level processing unit of the processing unit can be directly triggered to perform task processing on the processing data of the current macroblock to be encoded processed by the processing unit. Exemplarily, when the prediction unit completes the prediction of macroblock 1, and there is no task to be processed in the next-level transform / quantization unit, the transform / quantization unit can be directly triggered to perform task processing on multiple prediction modes for macroblock 1 predicted by the prediction unit.

[0132] It can be seen that the present application can trigger the next-level processing unit of the processing unit to perform task processing on the processing data of the current macroblock to be encoded obtained by the processing unit only when the processing unit task is processed and there is no task to be processed in the next-level processing unit. In this way, it can be ensured that when each processing unit performs task processing, there will be no encoding anomalies and no backlog of tasks in the processing unit, thereby ensuring the stability of video encoding.

[0133] In another implementation, the transfer condition further includes condition B1:

[0134] Condition B1, relative to the time of receiving the processed data of the current macroblock to be encoded, the predetermined alignment duration has been reached;

[0135] Among them, the predetermined alignment duration is the longest duration determined in advance from multiple alternative durations, and the multiple alternative durations are the durations required for each processing unit to complete the received processing data when the multiple processing units receive the processing data to be processed.

[0136] It can be understood that the transfer condition can also include that the predetermined alignment duration has been reached relative to the time when the processing data of the current macroblock to be encoded is received, wherein the predetermined alignment duration is: when multiple processing units simultaneously receive the processing data to be processed, the longest duration among the durations required for multiple processing units to perform task processing on the received processing data can be selected; then, if there is no task to be processed in the next-level processing unit, and the predetermined alignment duration has been reached relative to the time when the processing data of the current macroblock to be encoded is received, the next-level processing unit of the processing unit can be triggered to perform task processing on the processing data of the current macroblock to be encoded processed by the processing unit, thereby ensuring that multiple processing units have completed the task execution on the received processing data. Exemplarily, the alternative duration corresponding to the prediction unit is 100ms, the alternative duration corresponding to the transform / quantization unit is 200ms, and the alternative duration corresponding to the decision / reconstruction unit is 150ms, then 200ms can be selected as the predetermined alignment duration.

[0137] In addition, in different encoding scenarios, the size of the macroblock processed by the encoder may be different; for macroblocks of different sizes, each alternative duration may be affected, that is, the duration value of each alternative duration may be affected by the size of the macroblock. Therefore, in specific applications, for image encoding, after setting the size of the macroblock, it is possible to determine each alternative duration, thereby obtaining the duration values ​​of the multiple alternative durations for the size of the currently set macroblock, and then determine the predetermined alignment duration from the determined alternative duration. There may be multiple ways to determine each alternative duration. For example, each target macroblock of the set macroblock size may be selected, and each processing unit of the encoder may be used for encoding. The processing duration of each processing unit of the encoder for each target macroblock is obtained through the log data of the encoder, thereby analyzing the alternative durations of each processing unit; of course, any implementation method that can obtain each alternative duration can be applied to the present application.

[0138] It can be seen that the transfer condition also includes that the predetermined alignment time has been reached relative to the time when the processing data of the current macroblock to be encoded is received. Then, when this condition is met, the next-level processing unit of the processing unit is triggered to perform task processing on the processing data of the current macroblock to be encoded obtained by the processing unit. This ensures that after multiple processing units have completed task processing on the received processing data, the processed data after task processing by the processing unit is sent to the next-level unit, thereby reducing the problem of encoding abnormalities and preventing the processing unit from having a backlog of tasks, thereby ensuring the stability of video encoding.

[0139] Alternatively, in another embodiment, Figure 4 As shown, the determining of each target input interface and encoding scheduling strategy includes:

[0140] S401, obtaining encoding requirements of each channel of image data streams of a target transmission end as target encoding requirements;

[0141] The coding requirement includes any one of a requirement for low latency, a requirement for balanced transmission, and a requirement for maximum resource utilization;

[0142] It is understandable that before performing video encoding, the user can set the encoding requirements for each image data stream of the target transmission end in the control module as the target encoding requirements; wherein the encoding requirements may include any one of the requirements for low latency, the requirements for balanced transmission, and the requirements for maximum resource utilization. Of course, the encoding requirements introduced above are only for illustrative purposes, and there are other encoding requirements, for example: the encoding requirements for full utilization of the input port, which are not specifically limited in the embodiments of the present application.

[0143] S402: Based on the target encoding requirement, determine each target input interface from the multiple input interfaces, and determine an encoding scheduling strategy.

[0144] It can be understood that based on the target encoding requirements, the target input interface and the encoding scheduling strategy can be determined. Specifically, according to the three encoding requirements introduced above, the content of determining the target input interface and the encoding scheduling strategy is introduced below.

[0145] Exemplarily, in one implementation, determining each target input interface from a plurality of input interfaces based on the target encoding requirement, and determining an encoding scheduling strategy, includes steps C1-C2:

[0146] Step C1, when the target encoding requirement includes a requirement for low latency, selecting a first number of target input interfaces from the multiple input interfaces; wherein the first number is the same as the total number of image data streams;

[0147] It can be understood that, in step C1, in order to meet the demand for low latency, target input interfaces that are the same as the total number of image data streams can be selected from multiple input interfaces; illustratively, if there are 3 image data streams, then 3 input interfaces can be selected from multiple input interfaces as target input interfaces.

[0148] Step C2, determining a first policy whose policy content is a first content and a second policy whose policy content is a second content, and obtaining a coding scheduling policy; wherein the first content is a polling order for polling the coding channels corresponding to the first number of target input interfaces;

[0149] The second content is that for each image data stream, the image blocks of the image data stream are fixedly allocated to an encoding channel, and the image blocks of different image data streams are allocated to different encoding channels.

[0150] It can be understood that the first content is the polling order for polling the coding channels corresponding to the first number of target input interfaces, that is, the polling order for polling the coding channels corresponding to each target input interface. For example, for existing coding channels 1, 2, and 3, the first content may be the polling order for polling the three coding channels. In one implementation, sequential polling or reverse polling may also be performed according to the channel number of the coding channel, which is not specifically limited in the embodiments of the present application.

[0151] And, the second content is to fixedly assign image blocks of one image data stream to one encoding channel, and assign image blocks of different image data streams to different encoding channels, that is, image blocks of one image data stream are only assigned to one encoding channel and will not change; illustratively, image block 1 is assigned to encoding channel 1, and image blocks 1 in subsequent image data streams are also only assigned to encoding channel 1.

[0152] It can be understood that the image blocks of each image data stream are fixedly assigned to an encoding channel, and an encoding channel uniquely corresponds to a target input interface, so that the image blocks of each image data stream can be transmitted to the encoder through a unique and fixed target input interface, so that the image blocks of each channel can be distributed in different encoding channels, and at the same time, the macroblocks of each image block can be distributed in different encoding channels. During each polling process, the image blocks of each channel can be polled once, and at the same time, the macroblocks of each image block can be polled once for encoding, so that for each channel, the delay of the data of this channel entering the encoding module is small. It can be seen that using the second content as the encoding scheduling strategy can minimize the encoding delay and achieve row-level delay, but there is redundancy in the encoding performance.

[0153] In order to better understand this part, the following will be introduced in conjunction with the accompanying drawings, as shown in Figure 5 (a):

[0154] Figure 5 (a) can be considered as a 5-channel image-level encoding, FRAME1 is frame 1, FRAME2 is frame 2, and FRAME3 is frame 3. Each frame is composed of 5 image blocks, that is, image blocks 1-5. Only block 1 encoding is allocated in channel 1, and block 1 encoding can also be considered as encoding for image block 1. Only block 4 encoding is allocated in channel 2, only block 5 encoding is allocated in channel 3, only block 2 encoding is allocated in channel 4, and only block 3 encoding is allocated in channel 5.

[0155] It can be seen that the embodiment of the present application can select a first number of target input interfaces from multiple input interfaces and determine a coding scheduling strategy to meet the demand for low latency, wherein the coding scheduling strategy includes a polling order for polling the coding channels corresponding to the first number of target input interfaces, and fixedly assigning image blocks of one image data stream to one coding channel, and one coding channel uniquely corresponds to one target input interface, so that the image blocks of each image data stream can be transmitted to the encoder through a unique and fixed target input interface; then, in each polling process, the macroblocks of each image block can be polled once for encoding, so that for each channel, the delay of the data of this channel entering the coding module is small, thereby making the coding delay low, which can meet the low latency requirement, so that the video encoding method of the present application can flexibly respond to various encoding requirements.

[0156] Exemplarily, in another implementation, determining each target input interface from a plurality of input interfaces based on the target encoding requirement, and determining an encoding scheduling strategy include steps D1-D2:

[0157] Step D1, when the target encoding requirement includes a requirement for balanced transmission, selecting a second number of target input interfaces from the multiple input interfaces; wherein the second number is less than the total number of image data streams;

[0158] It can be understood that, in step D1, a second number of target input interfaces can be selected from multiple input interfaces to meet the demand for balanced transmission; it should be emphasized that the second number needs to be less than the total number of image data streams, but the second number cannot be less than the number of stages from the prediction stage to the decision / reconstruction stage in the encoding process. If the second number is less than the number of stages from the prediction stage to the decision / reconstruction stage in the encoding process, the following situation may occur: prediction is performed for the next macroblock of channel 1, but the current macroblock to be encoded of channel 1 has not reached the decision / reconstruction stage, so the frame coding mode decided for the next macroblock of channel 1 cannot be provided, and stable parallel coding cannot be guaranteed; illustratively, the number of stages from the prediction stage to the decision / reconstruction stage in the encoding process is 3, and the total number of image data streams is 5, then the second number can be 4.

[0159] Step D2, determining a first policy whose policy content is a third content and a second policy whose policy content is a fourth content, to obtain a coding scheduling policy; wherein the third content is a polling order for polling the coding channels corresponding to the second number of target input interfaces;

[0160] The fourth content is: for each encoding channel corresponding to the target input interface, according to a predetermined allocation method, the image blocks of one image data stream or the image blocks of multiple image data streams are fixedly allocated to the encoding channel, wherein the predetermined allocation method is that the image blocks of each image data stream are fixedly allocated to an encoding channel, and the amount of data received by the input interface corresponding to each encoding channel complies with the principle of load balancing.

[0161] It can be understood that the third content is the polling order for polling the coding channels corresponding to the second number of target input interfaces, that is, the polling order for polling the coding channels corresponding to each target input interface. For example, there are coding channels 1, 2 and 3. The second content may be the polling order for polling the three coding channels.

[0162] And, the fourth content is that for each encoding channel corresponding to the target input interface, the image blocks of one image data stream or the image blocks of multiple image data streams are fixedly allocated to the encoding channel, and one encoding channel is allowed to be allocated with image blocks of multiple image data streams, and the amount of data received by the input interface corresponding to each encoding channel complies with the principle of load balancing. Then, the amount of data of the image blocks of the image data streams received by each target input interface is roughly the same, and the image blocks of each image data stream allocated to each encoding channel will not change.

[0163] In order to better understand this part, the following will be introduced in conjunction with the accompanying drawings, as shown in Figure 5 (b):

[0164] Figure 5 (b) can be considered as a three-channel image-level encoding, FRAME1 is frame 1, FRAME2 is frame 2, and FRAME3 is frame 3. Each frame is composed of 5 image blocks, that is, image blocks 1-5. Only block 1 encoding is allocated to channel 1, and block 1 encoding can also be considered as encoding for image block 1. Block 4 encoding and block 2 encoding are allocated to channel 2, and block 5 encoding and block 3 encoding are allocated to channel 3. The data volume of image blocks in the three channels can meet the load balancing principle.

[0165] It should be noted that in some scenarios, there are differences in the amount of data of image blocks in different image data streams (the amount of data of different image blocks belonging to a frame of stitched image varies greatly). Then, if each image data stream is transmitted to the encoder through a unique corresponding target input interface, this may cause the transmission time of image blocks from different paths belonging to the same frame of stitched image to enter the target input interface to vary greatly, and the amount of data received by each target input interface is unbalanced, which ultimately leads to poor synchronization of different data blocks of the same frame of stitched image transmitted to the encoder and waste of resources of certain target input interfaces. In order to cope with this situation, the present application provides a demand for balanced transmission, which can be understood as the target transmission end transmitting data to different target input interfaces of the encoder in a balanced manner, so that the amount of data received by each target input interface is balanced, alleviating the above-mentioned problem of poor synchronization of different data blocks of the same frame of stitched image transmitted to the encoder and waste of resources of certain target input interfaces. It can be seen that the embodiment of the present application can select a second number of target input interfaces from multiple input interfaces and determine a coding scheduling strategy in response to the demand for balanced transmission, wherein the coding scheduling strategy includes a polling order for polling the coding channels corresponding to the second number of target input interfaces, and a fixed allocation of image blocks of one image data stream or image blocks of multiple image data streams to one coding channel, and can balance the amount of data received by each target input interface, thereby meeting the coding demand for balanced transmission, alleviating the above-mentioned problems of poor synchronization of different data blocks of the same frame of spliced ​​images transmitted to the encoder and wasting resources of certain target input interfaces, and at the same time, enabling the video encoding method of the present application to flexibly respond to various encoding needs.

[0166] Exemplarily, in another implementation, determining each target input interface from a plurality of input interfaces based on the target encoding requirement, and determining an encoding scheduling strategy include steps E1-E2:

[0167] Step E1, when the target encoding requirement includes a requirement for the highest resource utilization, selecting a third number of target input interfaces from the multiple input interfaces; wherein the third number is less than the total number of image data streams;

[0168] It is understandable that, in step E1, in order to meet the demand for the highest resource utilization, a third number of target input interfaces can be selected from multiple input interfaces; it should be emphasized that the third number needs to be less than the total number of image data streams, but the third number cannot be less than the number of stages from the prediction stage to the decision / reconstruction stage in the encoding process. If the third number is less than the number of stages from the prediction stage to the decision / reconstruction stage in the encoding process, the following situation may occur: prediction is performed for the next macroblock of channel 1, but the current macroblock to be encoded of channel 1 has not reached the decision / reconstruction stage, so the frame coding mode decided for the next macroblock of channel 1 cannot be provided, and stable parallel coding cannot be guaranteed; illustratively, the number of stages from the prediction stage to the decision / reconstruction stage in the encoding process is 3, and the total number of image data streams is 5, then the third number can be 3.

[0169] Step E2, determining a first policy including a fifth content and a second policy including a sixth content, to obtain a coding scheduling policy; wherein the fifth content is a polling order for polling the coding channels corresponding to the third number of target input interfaces;

[0170] The sixth content is: for each image block of each image data stream, the image block of the image data stream is allocated to an encoding channel that meets the idle condition; wherein, the idle condition is: the macroblocks of the image block stored in the corresponding cache area have been read.

[0171] It can be understood that the fifth content is the polling order for polling the coding channels corresponding to the third number of target input interfaces, that is, the polling order for polling the coding channels corresponding to each target input interface. For example, there are coding channels 1, 2 and 3. The fifth content may be the polling order for polling the three coding channels.

[0172] And, the sixth content is for each image block of each image data stream, the image block of the image data stream is allocated to the coding channel that meets the idle condition. When the image block is allocated according to the second strategy of the sixth content, there is no need to perform fixed allocation. The macroblocks of the image blocks stored in the cache area corresponding to a coding channel are read out, and it can be considered that the coding channel meets the idle condition, and the image block of the image data stream can be allocated to the coding channel, so the allocation method is disordered. In addition, if a coding channel meets the idle condition, an idle flag can also be set for the coding channel, so that the control module recognizes that the coding channel is set with an idle flag, and the image block can be directly allocated to the coding channel. The specific form of the idle flag is not limited in the embodiment of the present application. Exemplarily, the macroblocks of the image blocks stored in the cache area corresponding to coding channel 1 are read out, and it can be considered that coding channel 1 meets the idle condition. At this time, image block 1 can be allocated to coding channel 1.

[0173] In addition, whenever the macroblocks of the image blocks stored in the cache area corresponding to a coding channel are read, the image blocks can be allocated to the coding channel, and new image blocks can be added to the coding channel in time, so that when the coding channel is polled, the image blocks in the coding channel can be written into the sub-area corresponding to the coding channel in time, so that there are always macroblocks that need to be processed in each sub-area, and then, the macroblocks can be continuously input to the encoder so that the various processing units of the encoder can be fully utilized. Therefore, this allocation method can greatly improve resource utilization.

[0174] In order to better understand this part, the following will be introduced in conjunction with the accompanying drawings, as shown in Figure 5 (c):

[0175] Figure 5 (c) can be considered as 3-channel image-level coding, where only block 1 coding, block 5 coding, block 3 coding, block 5 coding and block 3 coding are allocated to channel 1, block 4 coding, block 2 coding, block 4 coding, block 2 coding and block 1 coding are allocated to channel 2, and block 5 coding, block 3 coding, block 1 coding, block 4 coding and block 2 coding are allocated to channel 3. In addition, the coding delay of this coding method is not constant, which will increase the display delay on the decoding side.

[0176] It can be seen that the embodiment of the present application can select a third number of target input interfaces from multiple input interfaces and determine a coding scheduling strategy in response to the demand for the highest resource utilization, wherein the coding scheduling strategy includes a polling order for polling the coding channels corresponding to the third number of target input interfaces, and for each image block of each image data stream, allocating the image block of the image data stream to a coding channel that meets the idle condition, thereby meeting the coding demand for the highest resource utilization, and allowing the video encoding method of the present application to flexibly respond to a variety of encoding requirements.

[0177] Optionally, in another embodiment, before writing the read macroblock into the sub-region corresponding to the second encoding channel in the multiple sub-regions of the shared region, the method further includes step F1:

[0178] Step F1, obtaining the address pointed to by the write pointer and recorded in the first address storage area corresponding to the second encoding channel to obtain a first address; wherein the initial address pointed to by the write pointer is the starting storage address of the sub-area corresponding to the second encoding channel;

[0179] Accordingly, the step of writing the read macroblock into a sub-region corresponding to the second coding channel in the multiple sub-regions of the shared region includes step G1:

[0180] Step G1, based on the first address, determine the address to which data is to be written, start from the determined address to which data is to be written, write the read macroblock into the sub-area corresponding to the second encoding channel among the multiple sub-areas of the shared area, and determine the current address pointed to by the write pointer of the sub-area corresponding to the second encoding channel, and update the address pointed to by the write pointer recorded in the first address storage area corresponding to the second encoding channel to the current address pointed to by the write pointer.

[0181] It can be understood that for step F1, the address pointed to by the write pointer can be obtained from the first address storage area corresponding to the second encoding channel to obtain the first address, wherein the first address storage area can store the address pointed to by the write pointer of the sub-area corresponding to the second encoding channel, and the address pointed to by the write pointer of each sub-area corresponding to the encoding channel can be stored in the intermediate temporary cache area, and the embodiment of the present application does not specifically limit this. And the first address is the address pointed to by the current write pointer of the sub-area corresponding to the second encoding channel.

[0182] It can be understood that, for step G1, based on the first address, the address to which data is to be written can be determined, that is, the address in the sub-area corresponding to the second encoding channel where data can be written. Then, starting from the address to which data is to be written, the macroblock read from the cache area can be written to the sub-area corresponding to the second encoding channel in the multiple sub-areas of the shared area; and after the writing is completed, the address recorded in the first address storage area corresponding to the second encoding channel and pointed to by the write pointer can be updated to the current address pointed to by the write pointer of the sub-area corresponding to the second encoding channel, so as to facilitate the next macroblock writing to the sub-area corresponding to the second encoding channel.

[0183] In order to better understand this part of the content, the following will be introduced in conjunction with the accompanying drawings, as shown in Figure 6 (a), Figure 6 (b) and Figure 6 (c):

[0184] FIG6 (a) is used to introduce the working principle between the cache area, the shared area and the first address storage area. The image blocks of each image data stream in the input interface 1-N can be stored in the cache area. Only one cache area is drawn in the figure, but in fact each input interface corresponds to a cache area. The control module can obtain the address recorded in the first address storage area corresponding to the second coding channel and pointed to by the write pointer, obtain the first address, and based on the first address, write the read macroblock to the sub-area corresponding to the second coding channel in the multiple sub-areas of the shared area starting from the address to be written, and update the address pointed to by the write pointer recorded in the first address storage area. Among them, the control module is also called a write scheduling module, and the embodiment of the present application does not make specific limitations on this.

[0185] FIG6 (b) shows the internal structure of the shared area. Cache 1 may be a sub-area corresponding to channel 1, and cache 1 has a read pointer 1 and a write pointer 1. Cache 2 may be a sub-area corresponding to channel 2, and cache 2 has a read pointer 2 and a write pointer 2. Cache 3 may be a sub-area corresponding to channel 3, and cache 3 has a read pointer 3 and a write pointer 3. The content of the read pointer will be introduced in subsequent embodiments, and will not be described in detail here.

[0186] FIG6 (c) shows the internal structure of the intermediate temporary buffer area. The intermediate buffer of each channel can be stored in the intermediate temporary buffer area, for example: intermediate buffer of channel 0, intermediate buffer of channel 1, intermediate buffer of channel 2 and intermediate buffer of channel 3; that is, the address pointed to by the write pointer of each encoding channel.

[0187] It can be seen that the embodiment of the present application can determine the address to which data is to be written based on the first address, and starting from the determined address to which data is to be written, write the read macroblock into the sub-area corresponding to the second encoding channel in the multiple sub-areas of the shared area, and update the address pointed to by the write pointer recorded in the first address storage area, thereby realizing fast writing of macroblocks and improving the resource utilization of the encoder.

[0188] Optionally, in another embodiment, before reading the macroblock currently to be processed from the sub-region corresponding to the channel to be processed, the method further includes step H1:

[0189] Step H1, obtaining the address pointed to by the read pointer and recorded in the second address storage area corresponding to the channel to be processed, to obtain a second address; wherein the initial address pointed to by the read pointer is the starting storage address of the sub-area corresponding to the channel to be processed;

[0190] Accordingly, the step of reading the macroblock currently to be processed from the sub-region corresponding to the channel to be processed includes step J1:

[0191] Step J1, based on the second address, determine the address of the data to be read, start from the determined address, read the macroblock from the sub-area corresponding to the channel to be processed, obtain the macroblock currently to be processed, and determine the current address of the read pointer when the reading is completed, and update the address pointed to by the read pointer recorded in the second address storage area corresponding to the channel to be processed to the current address of the read pointer.

[0192] It can be understood that for step H1, the address pointed to by the read pointer can be obtained from the second address storage area corresponding to the channel to be processed to obtain the second address, wherein the second address storage area can store the address pointed to by the read pointer of the sub-area corresponding to the channel to be processed, and the address pointed to by the read pointer of the sub-area corresponding to each encoding channel can be stored in the intermediate temporary cache area, and the embodiment of the present application does not specifically limit this. And the second address is the address pointed to by the current read pointer of the sub-area corresponding to the channel to be processed.

[0193] It can be understood that, for step J1, based on the second address, the address for data reading to be performed can be determined, that is, the address at which data can be read in the sub-area corresponding to the channel to be processed. Then, starting from the address for data reading to be performed, macroblocks can be read from the sub-area corresponding to the channel to be processed in the shared area to obtain the macroblock currently to be processed; and, after completing the macroblock reading, the address pointed to by the read pointer recorded in the second address storage area corresponding to the channel to be processed can be updated to the current address pointed to by the read pointer of the sub-area corresponding to the channel to be processed, so as to facilitate the next macroblock reading for the sub-area corresponding to the channel to be processed.

[0194] It can be seen that the embodiment of the present application can determine the address of the data to be read based on the second address, start from the determined address, read the macroblock from the sub-area corresponding to the channel to be processed, obtain the macroblock currently to be processed, and determine the current address of the read pointer when the reading is completed, and update the address pointed to by the read pointer recorded in the second address storage area corresponding to the channel to be processed, thereby realizing fast reading of the macroblock and improving the resource utilization of the encoder.

[0195] In order to better understand the video encoding method introduced in the embodiment of the present application, the following is an introduction with reference to the accompanying drawings, as shown in FIG7 (a):

[0196] The encoder is provided with input interfaces 1-N (N is configurable), and in response to receiving an image block in any image data stream transmitted by the input interface, the received image block is written into a cache area, macroblocks to be encoded are read from each cache area in turn, and the read macroblocks are written into a shared area, and data can be input to the encoding module later, the control module can monitor the shared area and each processing unit in the encoding module in real time, the prediction unit in the encoding module can predict the macroblock to be processed currently, and multiple prediction modes can be obtained, and the multiple prediction modes are input into the transform / quantization unit, and the code control unit can provide parameters to be used for the transform / quantization unit, wherein the parameters to be used can include macroblock encoding The transform / quantization unit can transform / quantize the current macroblock to be processed for multiple prediction modes based on the parameters to be used provided by the code control unit to obtain the transformed / quantized macroblocks of multiple prediction modes. The decision / reconstruction unit can decide the corresponding frame coding mode based on multiple prediction modes, and reconstruct the transformed / quantized macroblocks corresponding to the frame coding mode to obtain the reconstructed macroblocks. The entropy coding unit performs entropy coding based on the reconstructed macroblocks. In the process of entropy coding, it is necessary to base on the intermediate result of the previous entropy coding, so it is necessary to share the intermediate cache. The entropy coding unit can output the entropy coding result. The encapsulation unit performs encapsulation based on the entropy coding result to obtain the code stream encapsulation result and realize the code stream output.

[0197] It should be emphasized that the encoding module also needs to implement encoding processing based on hardware such as FPGA (Field Programmable Gate Array) and CPLD (Complex Programmable Logic Devic).

[0198] In addition, the code control unit, entropy coding unit and encapsulation unit also need to be based on their respective intermediate cache areas when performing task processing. In order to better understand this part of the content, the following is an introduction with reference to the accompanying drawings:

[0199] As shown in FIG7 (b), for the code control unit, the control module performs multi-channel scheduling for the code control unit. When a coding channel is scheduled, the code control unit can receive information input for the coding channel, specifically the amount of macroblock data and macroblock complexity information. The code control unit can read the code control configuration of the coding channel and the code control result used by the transform / quantization unit when the coding channel was last polled from the intermediate parameter temporary storage area, perform code control calculations, obtain the current code control result, and re-cache the current code control result in the intermediate parameter temporary storage area, and execute the code control result output.

[0200] As shown in FIG7 (c), for the entropy coding unit, the control module can perform multi-channel scheduling for the entropy coding unit. When a coding channel is scheduled, the entropy coding unit can receive the reconstructed macroblock input for the coding channel, which can also be considered as the quantization result input. The entropy coding unit can read the codeword output result when the coding channel was last polled from the intermediate codeword temporary storage area, and perform entropy coding based on the codeword output result and the reconstructed macroblock to obtain the current entropy coding result, and then re-cache the current entropy coding result in the intermediate codeword temporary storage area, and execute the entropy coding result output.

[0201] As shown in FIG7 (d), for the encapsulation unit, the control module can perform multi-channel scheduling for the encapsulation unit. When a coding channel is scheduled, the encapsulation unit can receive the entropy coding result input for the coding channel. The encapsulation unit can read the code stream output result when the coding channel was last polled from the intermediate code stream temporary storage area, and encapsulate based on the code stream output result and the entropy coding result to obtain the current code stream output result, and re-cache the current code stream output result in the intermediate code stream temporary storage area, and execute the code stream output.

[0202] The video encoding method provided in the embodiment of the present application can write the received image block into the cache area corresponding to the first encoding channel after the target input interface receives the image block in any image data stream, and subsequently read the macroblock to be encoded from the cache area corresponding to each encoding channel, and write the read macroblock into the sub-area corresponding to the second encoding channel in multiple sub-areas of the shared area, and when the current macroblock to be processed is input to the encoding module, the encoding channel can be polled to determine the encoding channel to be polled, and the current macroblock to be processed is read from the sub-area corresponding to the encoding channel, and the read macroblock is input to the encoding module to realize encoding processing; compared with the prior art, the embodiment of the present application pre-sets a unique corresponding encoding channel belonging to the virtual channel for each input interface of the encoder, and by polling each encoding channel, continuous data input to a single encoding module can be realized, and there is no need to set multiple encoding modules in the encoder. Parallel encoding processing can be realized only through a single encoding module, saving the hardware resources of the encoder and improving the resource utilization of the encoder.

[0203] Optionally, the embodiment of the present application further provides a coding method for LED display data, which is applied to a control module of an encoder, wherein the encoder is further provided with a coding module and a plurality of input interfaces, wherein the coding module includes a plurality of processing units for data coding, and different processing units are used to perform coding tasks at different coding stages during the coding process; Figure 8 As shown, the method includes:

[0204] S801, determining each target input interface and encoding scheduling strategy; wherein each target input interface is an input interface among the multiple input interfaces for receiving each channel of image data stream to be encoded and sent by the target transmission end; each channel of image data stream to be encoded and processed is each channel of image data stream for splicing and displaying on a light emitting diode (LED) display screen;

[0205] Each target input interface uniquely corresponds to a coding channel belonging to a virtual channel; the coding scheduling strategy includes a first strategy for characterizing a polling order required for polling processing of each coding channel, and a second strategy for characterizing an allocation method of coding channels required to be allocated to image blocks in each image data stream;

[0206] S802, in response to receiving an image block in any image data stream transmitted by the target transmission end according to the transmission mode corresponding to the second strategy, writing the received image block into a cache area corresponding to the first encoding channel;

[0207] The transmission mode is used to indicate that, for each image block in each image data stream, the target input interface to be used by the encoder is transmitted, the first encoding channel is an encoding channel among the encoding channels corresponding to the target input interface receiving the image block, and each encoding channel has its own corresponding cache area;

[0208] S803, according to the first strategy, read the macroblocks to be encoded from the cache areas corresponding to the respective encoding channels in sequence, and write the read macroblocks into the sub-areas corresponding to the second encoding channel in the multiple sub-areas of the shared area,

[0209] Each sub-region corresponds to a coding channel, and the second coding channel is a coding channel among the coding channels corresponding to the cache region to which the read macroblock belongs;

[0210] S804, in response to the encoding module satisfying the data input condition, according to the first strategy, determining the encoding channel to be polled when inputting data to the encoding module as the channel to be processed; reading the current macroblock to be processed from the sub-region corresponding to the channel to be processed, and inputting the read macroblock to the encoding module for encoding processing based on each processing unit;

[0211] The data input condition is that the first processing unit in the encoding module has no tasks to be processed.

[0212] It can be understood that the specific implementation of the above steps can refer to the above embodiments, and will not be elaborated here.

[0213] Considering that when encoding an image, there is coding dependency between the macroblocks of the same image block. For example, for the same image block, the prediction stage of the macroblock to be encoded later needs to rely on the intermediate results of the decision-making and reconstruction stages of the macroblock to be encoded earlier, that is, it is necessary to wait for the macroblock to be encoded earlier to complete the decision-making and reconstruction stages before the macroblock to be encoded later can start the prediction stage. Therefore, there is undoubtedly a time-consuming waiting period, which leads to an idle period in the processing unit of the encoding module. Since the macroblocks between the image blocks of different image data streams have no coding dependency, in the solution provided by the present application, respective coding channels are set for each target input interface, and the image data streams of each channel are distributed to the multiple coding channels through the second strategy; and through the first strategy, the cache area corresponding to each coding channel, and the sub-area in the shared area corresponding to each coding channel, the macroblocks of different coding channels can be polled for encoding in turn, that is, the macroblocks of image blocks of different channels are polled for encoding. Since the macroblocks of different coding channels come from image blocks of different image data streams, the various processing units of the coding module can perform macroblock processing in parallel, and there is no waiting time in the processing of macroblocks of each coding channel. At the same time, for any coding channel, after a macroblock of the coding channel is encoded, the next macroblock of the macroblock of the coding channel will be polled only after polling of each coding channel is completed, and the intermediate result of the macroblock is usually already generated, so the encoding process of the next macroblock can directly use the intermediate result of the macroblock. It can be seen that this scheme, by using the respective encoding channels of each target input interface, the first strategy, the second strategy, the cache area corresponding to each encoding channel, the sub-area corresponding to each encoding channel, and the input trigger of the encoding module satisfying the data input condition, can realize polling from the perspective of the macroblocks of the image blocks of each image data stream, and in response to the fact that there is no task to be processed in the first processing unit, the macroblock input is made to the encoding module to continuously input the macroblock to the encoding module, so that each processing unit does not need to wait for the intermediate results of the macroblocks on which the processed macroblock depends when processing the macroblock, and each processing unit of the encoding module can process the macroblock in parallel. Therefore, parallel encoding processing can be realized through this scheme, which saves the hardware resources of the encoder (that is, there is no need to set up multiple encoders) and improves the resource utilization of the encoder.

[0214] In addition, the size of the image blocks in each image data stream to be encoded and sent by the target transmission end is not limited. The present application can perform parallel encoding on image blocks of different sizes or different types; and during use, the number of target input interfaces can also be dynamically adjusted, thereby achieving adjustment of the number of encoding channels corresponding to the target input interfaces.

[0215] In addition, the encoding scheduling strategy in the embodiment of the present application includes a first strategy for characterizing the polling order required for polling processing of each encoding channel, and a second strategy for characterizing the allocation method of the encoding channels required to be allocated to the image blocks in each image data stream. Based on the specific application scenario, the first strategy and the second strategy can be adjusted to achieve flexible response to various video encoding scenarios.

[0216] Based on the above method embodiment, Fig. 9 As shown, an embodiment of the present application provides a video encoding device, which is applied to a control module of an encoder, wherein the encoder is further provided with an encoding module and a plurality of input interfaces, wherein the encoding module includes a plurality of processing units for performing data encoding, and different processing units are used to perform encoding tasks at different encoding stages during the encoding process; the device includes:

[0217] The first determination module 910 is used to determine each target input interface and the encoding scheduling strategy; wherein each target input interface is an input interface among the multiple input interfaces for receiving each channel of image data stream to be encoded and sent by the target transmission end; each target input interface uniquely corresponds to a coding channel belonging to a virtual channel; the encoding scheduling strategy includes a first strategy for characterizing the polling order required for polling processing of each coding channel, and a second strategy for characterizing the allocation method of the coding channels required to be allocated to the image blocks in each channel of image data stream;

[0218] A first writing module 920 is configured to write the received image block in a cache area corresponding to a first coding channel in response to receiving an image block in any image data stream transmitted by the target transmission end according to a transmission mode corresponding to the second strategy; wherein the transmission mode is used to indicate that each image block in each image data stream is transmitted to a target input interface required to be used by the encoder, the first coding channel is a coding channel among the coding channels corresponding to the target input interface receiving the image block, and each coding channel corresponds to its own cache area;

[0219] The first reading module 930 is used to read the macroblocks to be encoded from the cache area corresponding to each coding channel in sequence according to the first strategy, and write the read macroblocks into the sub-areas corresponding to the second coding channel in the multiple sub-areas of the shared area, wherein each sub-area corresponds to a coding channel, and the second coding channel is the coding channel corresponding to the cache area to which the read macroblocks belong in each coding channel;

[0220] The second determination module 940 is used for, in response to the encoding module satisfying the data input condition, determining, according to the first strategy, the encoding channel to be polled when inputting data to the encoding module as the channel to be processed; reading the macroblock currently to be processed from the sub-region corresponding to the channel to be processed, and inputting the read macroblock to the encoding module for encoding processing based on each processing unit;

[0221] The data input condition is that the first processing unit in the encoding module has no tasks to be processed.

[0222] Optionally, the device further comprises:

[0223] A designated control module, used to perform designated control on the encoding module during the encoding processing of the encoding module;

[0224] Wherein, the designated control includes:

[0225] For any processing unit of the encoding module, when the processing unit completes the task of processing the received processing data for the current macroblock to be encoded, in response to satisfying the transfer condition, the next-level processing unit of the processing unit is triggered to perform task processing on the processing data of the current macroblock to be encoded obtained by the processing unit; wherein the transfer condition includes that the next-level processing unit has no tasks to be processed.

[0226] Optionally, the transfer condition also includes:

[0227] The predetermined alignment duration has been reached relative to the time when the processed data of the current macroblock to be encoded is received;

[0228] Among them, the predetermined alignment duration is the longest duration determined in advance from multiple alternative durations, and the multiple alternative durations are the durations required for each processing unit to complete the received processing data when the multiple processing units receive the processing data to be processed.

[0229] Optionally, the first determining module includes:

[0230] An acquisition submodule, used to acquire the encoding requirements of each channel of image data streams for the target transmission end as target encoding requirements; wherein the encoding requirements include any one of requirements for low latency, requirements for balanced transmission, and requirements for maximum resource utilization;

[0231] The determination submodule is used to determine each target input interface from the multiple input interfaces based on the target encoding requirement, and determine an encoding scheduling strategy.

[0232] Optionally, the determining submodule is specifically used for:

[0233] When the target encoding requirement includes a requirement for low latency, selecting a first number of target input interfaces from the multiple input interfaces; wherein the first number is the same as the total number of image data streams;

[0234] Determine a first policy whose policy content is a first content and a second policy whose policy content is a second content, and obtain a coding scheduling policy; wherein the first content is a polling order for polling the coding channels corresponding to the first number of target input interfaces;

[0235] The second content is that for each image data stream, the image blocks of the image data stream are fixedly allocated to an encoding channel, and the image blocks of different image data streams are allocated to different encoding channels.

[0236] Optionally, the determining submodule is specifically used for:

[0237] When the target encoding requirement includes a requirement for balanced transmission, selecting a second number of target input interfaces from the multiple input interfaces; wherein the second number is less than the total number of image data streams;

[0238] Determine a first policy whose policy content is a third content and a second policy whose policy content is a fourth content, and obtain a coding scheduling policy; wherein the third content is a polling order for polling the coding channels corresponding to the second number of target input interfaces;

[0239] The fourth content is: for each encoding channel corresponding to the target input interface, according to a predetermined allocation method, the image blocks of one image data stream or the image blocks of multiple image data streams are fixedly allocated to the encoding channel, wherein the predetermined allocation method is that the image blocks of each image data stream are fixedly allocated to an encoding channel, and the amount of data received by the input interface corresponding to each encoding channel complies with the principle of load balancing.

[0240] Optionally, the determining submodule is specifically used for:

[0241] When the target encoding requirement includes a requirement for the highest resource utilization, a third number of target input interfaces is selected from the multiple input interfaces; wherein the third number is less than the total number of image data streams;

[0242] Determine a first policy whose policy content is a fifth content and a second policy whose policy content is a sixth content, and obtain a coding scheduling policy; wherein the fifth content is a polling order for polling the coding channels corresponding to the third number of target input interfaces;

[0243] The sixth content is: for each image block of each image data stream, the image block of the image data stream is allocated to an encoding channel that meets the idle condition; wherein, the idle condition is: the macroblocks of the image block stored in the corresponding cache area have been read.

[0244] Optionally, the device further comprises:

[0245] A first acquisition module is used to acquire the address pointed to by the write pointer recorded in the first address storage area corresponding to the second encoding channel before writing the read macroblock into the sub-area corresponding to the second encoding channel in the multiple sub-areas of the shared area, so as to obtain a first address; wherein the initial address pointed to by the write pointer is the starting storage address of the sub-area corresponding to the second encoding channel;

[0246] The step of writing the read macroblock into a sub-region corresponding to the second encoding channel in the plurality of sub-regions of the shared region includes:

[0247] Based on the first address, an address to which data is to be written is determined, and starting from the determined address to which data is to be written, the read macroblock is written into a sub-area corresponding to the second encoding channel among multiple sub-areas of the shared area, and the current address pointed to by the write pointer of the sub-area corresponding to the second encoding channel is determined, and the address pointed to by the write pointer recorded in the first address storage area corresponding to the second encoding channel is updated to the current address pointed to by the write pointer.

[0248] Optionally, the device further comprises:

[0249] A second acquisition module is used to obtain the address pointed to by the read pointer recorded in the second address storage area corresponding to the channel to be processed before reading the current macroblock to be processed from the sub-area corresponding to the channel to be processed, so as to obtain a second address; wherein the initial address pointed to by the read pointer is the starting storage address of the sub-area corresponding to the channel to be processed;

[0250] The step of reading the macroblock currently to be processed from the sub-region corresponding to the channel to be processed includes:

[0251] Based on the second address, the address of the data to be read is determined, and starting from the determined address, the macroblock is read from the sub-area corresponding to the channel to be processed to obtain the macroblock currently to be processed, and the current address of the read pointer when the reading is completed is determined, and the address pointed to by the read pointer recorded in the second address storage area corresponding to the channel to be processed is updated as the current address of the read pointer.

[0252] Based on the above method embodiment, Fig.10As shown, the embodiment of the present application provides an encoding device for LED display data, which is applied to the control module of the encoder. The encoder is also provided with an encoding module and multiple input interfaces. The encoding module includes multiple processing units for data encoding. Different processing units are used to perform encoding tasks at different encoding stages during the encoding process; Fig.10 As shown, the device comprises:

[0253] The third determination module 1010 is used to determine each target input interface and the encoding scheduling strategy; wherein each target input interface is an input interface among the multiple input interfaces for receiving each channel of image data stream to be encoded and sent by the target transmission end; each target input interface uniquely corresponds to a coding channel belonging to a virtual channel; the encoding scheduling strategy includes a first strategy for characterizing the polling order required for polling processing of each coding channel, and a second strategy for characterizing the allocation method of the coding channels required to be allocated to the image blocks in each channel of image data stream; each channel of image data stream to be encoded and processed is each channel of image data stream for splicing and displaying on a light-emitting diode LED display screen;

[0254] The second writing module 1020 is used for writing the received image block in any image data stream into a cache area corresponding to the first coding channel in response to receiving the image block in any image data stream transmitted by the target transmission end according to the transmission mode corresponding to the second strategy; wherein the transmission mode is used to indicate that each image block in each image data stream is transmitted to the target input interface required to be used by the encoder, the first coding channel is the coding channel corresponding to the target input interface receiving the image block among the coding channels, and each coding channel corresponds to its own cache area;

[0255] The second reading module 1030 is used to read the macroblocks to be encoded from the cache area corresponding to each coding channel in sequence according to the first strategy, and write the read macroblocks into the sub-areas corresponding to the second coding channel in the multiple sub-areas of the shared area, wherein each sub-area corresponds to a coding channel, and the second coding channel is the coding channel corresponding to the cache area to which the read macroblocks belong in each coding channel;

[0256] The fourth determination module 1040 is used for, in response to the encoding module satisfying the data input condition, determining, according to the first strategy, the encoding channel to be polled when inputting data to the encoding module as the channel to be processed; reading the current macroblock to be processed from the sub-region corresponding to the channel to be processed, and inputting the read macroblock to the encoding module for encoding processing based on each processing unit;

[0257] The data input condition is that there is no task to be processed in the first processing unit of the encoding module. In the technical solution of the present application, the operations of obtaining, storing, using, processing, transmitting, providing and disclosing user personal information are all performed with the authorization of the user. The embodiment of the present application also provides an electronic device, such as Fig.11 As shown, including:

[0258] Memory 1101, used for storing computer programs;

[0259] The processor 1102 is used to implement any of the above-mentioned video encoding methods and / or the encoding method for LED display data when executing the program stored in the memory 1101.

[0260] In addition, the electronic device may further include a communication bus and / or a communication interface, and the processor 1102, the communication interface, and the memory 1101 communicate with each other via the communication bus.

[0261] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0262] The communication interface is used for communication between the above electronic device and other devices.

[0263] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0264] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0265] In another embodiment provided in the present application, a computer-readable storage medium is also provided, in which a computer program is stored. When the computer program is executed by a processor, it implements any of the above-mentioned video encoding methods and / or encoding methods for LED display data.

[0266] In another embodiment provided in the present application, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute any of the video encoding methods in the above embodiments, and / or encoding methods for LED display data.

[0267] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a solid-state hard disk (SSD), etc.

[0268] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0269] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0270] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the protection scope of the present application.

Claims

1. A video encoding method, characterized in that: A control module applied to an encoder, wherein the encoder is further provided with an encoding module and a plurality of input interfaces, wherein the encoding module includes a plurality of processing units for performing data encoding, and different processing units are used to perform encoding tasks at different encoding stages during the encoding process; the method comprises: Determine each target input interface and encoding scheduling strategy; wherein each target input interface is an input interface among the multiple input interfaces for receiving each channel of image data stream to be encoded and sent by the target transmission end; each target input interface uniquely corresponds to an encoding channel belonging to a virtual channel; the encoding scheduling strategy includes a first strategy for characterizing a polling order required for polling processing of each encoding channel, and a second strategy for characterizing an allocation method of encoding channels required to be allocated to image blocks in each channel of image data stream; In response to receiving an image block in any image data stream transmitted by the target transmission end according to the transmission mode corresponding to the second strategy, writing the received image block into a cache area corresponding to a first encoding channel; wherein the transmission mode is used to indicate that each image block in each image data stream is transmitted to a target input interface required to be used by the encoder, the first encoding channel is an encoding channel among the encoding channels corresponding to the target input interface receiving the image block, and each encoding channel corresponds to its own cache area; And, according to the first strategy, the macroblocks to be encoded are read from the cache area corresponding to each encoding channel in sequence, and the read macroblocks are written into the sub-areas corresponding to the second encoding channel in the multiple sub-areas of the shared area, wherein each sub-area corresponds to a encoding channel, and the second encoding channel is the encoding channel corresponding to the cache area to which the read macroblocks belong in each encoding channel; In response to the encoding module satisfying the data input condition, according to the first strategy, determining the encoding channel to be polled when inputting data to the encoding module as the channel to be processed; reading the macroblock currently to be processed from the sub-area corresponding to the channel to be processed, and inputting the read macroblock to the encoding module for encoding processing based on each processing unit; The data input condition is that the first processing unit in the encoding module has no tasks to be processed.

2. The method according to claim 1, characterized in that The method further comprises: During the encoding process of the encoding module, specifying and controlling the encoding module; Wherein, the designated control includes: For any processing unit of the encoding module, when the processing unit completes the task of processing the received processing data for the current macroblock to be encoded, in response to satisfying the transfer condition, the next-level processing unit of the processing unit is triggered to perform task processing on the processing data of the current macroblock to be encoded obtained by the processing unit; wherein the transfer condition includes that the next-level processing unit has no tasks to be processed.

3. The method according to claim 2, characterized in that The transfer conditions also include: The predetermined alignment duration has been reached relative to the time when the processed data of the current macroblock to be encoded is received; Among them, the predetermined alignment duration is the longest duration determined in advance from multiple alternative durations, and the multiple alternative durations are the durations required for each processing unit to complete the received processing data when the multiple processing units receive the processing data to be processed.

4. The method according to any one of claims 1 to 3, characterized in that: The determining of each target input interface and encoding scheduling strategy includes: Obtaining encoding requirements for each channel of image data streams of a target transmission end as target encoding requirements; wherein the encoding requirements include any one of requirements for low latency, requirements for balanced transmission, and requirements for maximum resource utilization; Based on the target encoding requirement, each target input interface is determined from the multiple input interfaces, and an encoding scheduling strategy is determined.

5. The method according to claim 4, characterized in that The determining each target input interface from a plurality of input interfaces based on the target encoding requirement, and determining an encoding scheduling strategy, comprises: When the target encoding requirement includes a requirement for low latency, selecting a first number of target input interfaces from the multiple input interfaces; wherein the first number is the same as the total number of image data streams; Determine a first policy whose policy content is a first content and a second policy whose policy content is a second content, and obtain a coding scheduling policy; wherein the first content is a polling order for polling the coding channels corresponding to the first number of target input interfaces; The second content is that for each image data stream, the image blocks of the image data stream are fixedly allocated to an encoding channel, and the image blocks of different image data streams are allocated to different encoding channels.

6. The method according to claim 4, characterized in that The determining each target input interface from a plurality of input interfaces based on the target encoding requirement, and determining an encoding scheduling strategy, comprises: When the target encoding requirement includes a requirement for balanced transmission, selecting a second number of target input interfaces from the multiple input interfaces; wherein the second number is less than the total number of image data streams; Determine a first policy whose policy content is a third content and a second policy whose policy content is a fourth content, and obtain a coding scheduling policy; wherein the third content is a polling order for polling the coding channels corresponding to the second number of target input interfaces; The fourth content is: for each encoding channel corresponding to the target input interface, according to a predetermined allocation method, the image blocks of one image data stream or the image blocks of multiple image data streams are fixedly allocated to the encoding channel, wherein the predetermined allocation method is that the image blocks of each image data stream are fixedly allocated to an encoding channel, and the amount of data received by the input interface corresponding to each encoding channel complies with the principle of load balancing.

7. The method according to claim 4, characterized in that The determining each target input interface from a plurality of input interfaces based on the target encoding requirement, and determining an encoding scheduling strategy, comprises: When the target encoding requirement includes a requirement for the highest resource utilization, a third number of target input interfaces is selected from the multiple input interfaces; wherein the third number is less than the total number of image data streams; Determine a first policy whose policy content is a fifth content and a second policy whose policy content is a sixth content, and obtain a coding scheduling policy; wherein the fifth content is a polling order for polling the coding channels corresponding to the third number of target input interfaces; The sixth content is: for each image block of each image data stream, the image block of the image data stream is allocated to an encoding channel that meets the idle condition; wherein, the idle condition is: the macroblocks of the image block stored in the corresponding cache area have been read.

8. The method according to any one of claims 1 to 3, characterized in that: Before writing the read macroblock into the sub-region corresponding to the second encoding channel in the multiple sub-regions of the shared region, the method further includes: Obtaining the address pointed to by the write pointer and recorded in the first address storage area corresponding to the second encoding channel to obtain a first address; wherein the initial address pointed to by the write pointer is the starting storage address of the sub-area corresponding to the second encoding channel; The step of writing the read macroblock into a sub-region corresponding to the second encoding channel in the plurality of sub-regions of the shared region includes: Based on the first address, an address to which data is to be written is determined, and starting from the determined address to which data is to be written, the read macroblock is written into a sub-area corresponding to the second encoding channel among multiple sub-areas of the shared area, and the current address pointed to by the write pointer of the sub-area corresponding to the second encoding channel is determined, and the address pointed to by the write pointer recorded in the first address storage area corresponding to the second encoding channel is updated to the current address pointed to by the write pointer.

9. The method according to any one of claims 1 to 3, characterized in that: Before reading the current macroblock to be processed from the sub-region corresponding to the channel to be processed, the method further includes: Obtaining the address pointed to by the read pointer and recorded in the second address storage area corresponding to the channel to be processed, to obtain a second address; wherein the initial address pointed to by the read pointer is the starting storage address of the sub-area corresponding to the channel to be processed; The step of reading the macroblock currently to be processed from the sub-region corresponding to the channel to be processed includes: Based on the second address, the address of the data to be read is determined, and starting from the determined address, the macroblock is read from the sub-area corresponding to the channel to be processed to obtain the macroblock currently to be processed, and the current address of the read pointer when the reading is completed is determined, and the address pointed to by the read pointer recorded in the second address storage area corresponding to the channel to be processed is updated as the current address of the read pointer.

10. A method for encoding LED display data, characterized in that: A control module applied to an encoder, wherein the encoder is further provided with an encoding module and a plurality of input interfaces, wherein the encoding module includes a plurality of processing units for performing data encoding, and different processing units are used to perform encoding tasks at different encoding stages during the encoding process; the method comprises: Determine each target input interface and encoding scheduling strategy; wherein each target input interface is an input interface among the multiple input interfaces for receiving each channel of image data stream to be encoded and sent by the target transmission end; each target input interface uniquely corresponds to an encoding channel belonging to a virtual channel; the encoding scheduling strategy includes a first strategy for characterizing the polling order required for polling processing of each encoding channel, and a second strategy for characterizing the allocation method of encoding channels required to be allocated to image blocks in each channel of image data stream; each channel of image data stream to be encoded and processed is each channel of image data stream for splicing and displaying on a light-emitting diode (LED) display screen; In response to receiving an image block in any image data stream transmitted by the target transmission end according to the transmission mode corresponding to the second strategy, writing the received image block into a cache area corresponding to a first encoding channel; wherein the transmission mode is used to indicate that each image block in each image data stream is transmitted to a target input interface required to be used by the encoder, the first encoding channel is an encoding channel among the encoding channels corresponding to the target input interface receiving the image block, and each encoding channel corresponds to its own cache area; And, according to the first strategy, the macroblocks to be encoded are read from the cache area corresponding to each encoding channel in sequence, and the read macroblocks are written into the sub-areas corresponding to the second encoding channel in the multiple sub-areas of the shared area, wherein each sub-area corresponds to a encoding channel, and the second encoding channel is the encoding channel corresponding to the cache area to which the read macroblocks belong in each encoding channel; In response to the encoding module satisfying the data input condition, according to the first strategy, determining the encoding channel to be polled when inputting data to the encoding module as the channel to be processed; reading the macroblock currently to be processed from the sub-area corresponding to the channel to be processed, and inputting the read macroblock to the encoding module for encoding processing based on each processing unit; The data input condition is that the first processing unit in the encoding module has no tasks to be processed.

11. A video encoding device, characterized in that: A control module applied to an encoder, wherein the encoder is further provided with an encoding module and a plurality of input interfaces, wherein the encoding module includes a plurality of processing units for performing data encoding, and different processing units are used to perform encoding tasks at different encoding stages during the encoding process; the device comprises: A first determination module is used to determine each target input interface and a coding scheduling strategy; wherein each target input interface is an input interface among the multiple input interfaces for receiving each channel of image data stream to be coded and sent by the target transmission end; each target input interface uniquely corresponds to a coding channel belonging to a virtual channel; the coding scheduling strategy includes a first strategy for characterizing a polling order required for polling processing of each coding channel, and a second strategy for characterizing an allocation method of coding channels required to be allocated to image blocks in each channel of image data stream; A first writing module is configured to write the received image block in a cache area corresponding to a first coding channel in response to receiving an image block in any image data stream transmitted by the target transmission end according to a transmission mode corresponding to the second strategy; wherein the transmission mode is used to indicate that each image block in each image data stream is transmitted to a target input interface required to be used by the encoder, the first coding channel is a coding channel among the coding channels corresponding to the target input interface receiving the image block, and each coding channel corresponds to its own cache area; A first reading module is used to read the macroblocks to be encoded from the cache area corresponding to each coding channel in sequence according to the first strategy, and write the read macroblocks into the sub-areas corresponding to the second coding channel in the multiple sub-areas of the shared area, wherein each sub-area corresponds to a coding channel, and the second coding channel is the coding channel corresponding to the cache area to which the read macroblocks belong in each coding channel; A second determination module is configured to, in response to the encoding module satisfying the data input condition, determine, according to the first strategy, an encoding channel to be polled when inputting data to the encoding module as a channel to be processed; read a macroblock currently to be processed from a sub-region corresponding to the channel to be processed, and input the read macroblock to the encoding module for encoding processing based on each processing unit; The data input condition is that the first processing unit in the encoding module has no tasks to be processed.

12. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, for implementing any of the methods described in claims 1-10 when executing a program stored in a memory.

13. A computer program product, characterized in that The invention comprises a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • Video data transmission method and video data transmission system

    CN103269433A

  • Image coding method and device and LED sending card

    CN118741134A