Coding node management method, apparatus, device, and readable storage medium
By managing busy and idle queues and scheduling nodes, parallel processing of the front-end module and the encoding module is achieved, which solves the problem that the video encoder is limited by the worst-performing module, improves encoding efficiency and avoids performance waste.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HUNAN GOKE MICROELECTRONICS CO LTD
- Filing Date
- 2023-12-29
- Publication Date
- 2026-05-19
AI Technical Summary
In existing technologies, video encoders are limited by the capabilities of the worst-performing module in the business path, making it difficult to utilize the maximum encoding capabilities of the hardware, resulting in wasted performance.
By controlling the busy/idle queue management between the front-end module and the encoding module, parallel process processing is achieved, and the preprocessing and encoding of source data are performed synchronously. By utilizing the busy/idle queue and node scheduling, system resources are fully utilized.
It improves encoding efficiency, avoids performance waste, and maximizes the capabilities of the encoder hardware.
Smart Images

Figure CN117979032B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image coding, and more particularly to a coding node management method, apparatus, device, and readable storage medium. Background Technology
[0002] With the widespread adoption of the H.26X encoding protocol, customer requirements in IPC scenarios have become more specific: lower bitrates, higher quality, higher frame rates, and higher resolutions. Therefore, they expect video encoders to operate at their maximum hardware capacity to avoid performance waste. However, most current solutions on the market use a serial approach for encoding, limiting video encoding to the worst-performing modules in the process flow and hindering the encoder hardware from reaching its full potential, resulting in wasted performance. Summary of the Invention
[0003] To address the aforementioned technical problems, embodiments of this application provide a coding node management method, apparatus, electronic device, and computer-readable storage medium.
[0004] Firstly, this application provides a method for managing encoding nodes, the method comprising:
[0005] The control front-end module retrieves the first target node from the first idle queue, so that the first target node is attached to the first busy queue after being associated with the first source data that has been preprocessed by the front-end module.
[0006] During the process of controlling the front-end module to retrieve the first target node from the first idle queue, the control encoding module retrieves the second target node from the first busy queue, so that the control encoding module encodes the second source data associated with the second target node to obtain the bitstream data.
[0007] Optionally, the control front-end module retrieves the first target node from the first idle queue, so that the first target node is attached to the first busy queue after being associated with the first source data currently preprocessed by the front-end module, including:
[0008] The control front-end module retrieves the first target node from the first idle queue, so that the first target node is attached to the first busy queue after storing the first pointer. The first pointer is used to indicate the physical storage address of the first source data that the front-end module has currently preprocessed.
[0009] The control of the encoding module to encode the second source data associated with the second target node includes:
[0010] The encoding module is controlled to parse the second pointer mounted on the second target node, so that the encoding module encodes the second source data stored in the physical storage address indicated by the second pointer.
[0011] Optionally, after controlling the encoding module to parse the second pointer mounted on the second target node so that the encoding module encodes the second source data stored in the physical storage address indicated by the second pointer, the method further includes:
[0012] Delete the second pointer attached to the second target node, and reattach the second target node after deleting the second pointer to the first idle queue.
[0013] Optionally, before the encoding module encodes the second source data associated with the second target node, the method further includes:
[0014] Obtain the reference information returned by the encoding module after determining whether the second source data meets the preset encoding requirements;
[0015] When the reference information indicates that the second source data does not meet the preset encoding requirements, the encoding module is controlled to feed back the second source data and the preset encoding requirements to the scaling module, so that the scaling module returns thumbnail data to the encoding module after scaling the second source data according to the preset encoding requirements, thereby enabling the encoding module to encode the thumbnail data;
[0016] When the reference information indicates that the second source data meets the preset encoding requirements, the following steps are performed: control the encoding module to encode the second source data associated with the second target node.
[0017] Optionally, controlling the encoding module to feed back the second source data and the preset encoding requirements to the scaling module, so that the scaling module returns thumbnail data to the encoding module after scaling the second source data according to the preset encoding requirements, includes:
[0018] The encoding module is controlled to retrieve a third target node from the thumbnail idle queue, so that the third target node is associated with the second source data and then attached to the thumbnail busy queue, until the scaling module retrieves the third target node from the thumbnail busy queue, so as to scale the second source data associated with the third target node according to the preset encoding requirements, thereby so that the encoding module receives the scaled image data.
[0019] Optionally, after controlling the encoding module to encode the second source data associated with the second target node to obtain the bitstream data, the method further includes:
[0020] The fourth target node is retrieved from the second idle queue, and then associated with the bit stream packet corresponding to the bit stream information and attached to the second busy queue.
[0021] Until the fourth target node in the second busy queue is detected to be attached to the object queue, if the bitstream packet associated with the fourth target node is occupied, the association of the fourth target node is deleted and it is attached to the second idle queue.
[0022] Optionally, before retrieving the fourth target node from the second free queue, the method further includes:
[0023] The control module determines whether there is an empty node in the second free queue. If there is no empty node in the second free queue, it requests to add an empty node in the second free queue and uses the newly added empty node as the fourth target node.
[0024] Secondly, this application provides an encoding node management device, the device comprising:
[0025] The front-end module is used to retrieve the first target node from the first idle queue, so that the first target node is attached to the first busy queue after associating with the first source data that has been preprocessed by the front-end module.
[0026] The encoding module is used to retrieve a second target node from the first busy queue during the process of the front-end module retrieving the first target node from the first idle queue, and to encode the second source data associated with the second target node to obtain the bitstream data.
[0027] Thirdly, embodiments of this application provide an electronic device, including a memory and a processor, wherein the memory is used to store a computer program, and the computer program executes the encoding node management method provided in the first aspect when the processor is running.
[0028] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when run on a processor, executes the encoding node management method provided in the first aspect.
[0029] The above-described embodiments of this application provide a method, apparatus, device, and readable storage medium for managing encoding nodes. By controlling a front-end module to retrieve a first target node from a first idle queue, the first target node is attached to a first busy queue after being associated with first source data currently preprocessed by the front-end module. During the process of controlling the front-end module to retrieve the first target node from the first idle queue, the encoding module retrieves a second target node from the first busy queue, enabling the encoding module to encode the second source data associated with the second target node, thereby obtaining bitstream data. This allows the encoding module to simultaneously encode preprocessed source data (e.g., data previously preprocessed by the front-end module) while the front-end module preprocesses the source data. By leveraging busy / idle queues and node scheduling, the business process is updated to a parallel process, fully utilizing system resources, improving encoding efficiency, and maximizing the encoder hardware's capabilities while avoiding performance waste. Attached Figure Description
[0030] To more clearly illustrate the technical solutions of this application, the accompanying drawings used in the embodiments will be briefly described below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation on the scope of protection of this application. In the various drawings, similar components are numbered similarly.
[0031] Figure 1 A flowchart of the coding node management method provided in an embodiment of this application is shown;
[0032] Figure 2 A schematic diagram of the structure of the coding node management device provided in an embodiment of this application is shown. Detailed Implementation
[0033] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments.
[0034] The components of the embodiments of this application described and illustrated in the accompanying drawings can be arranged and designed in a variety of different configurations. Therefore, the following detailed description of the embodiments of this application provided in the drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0035] In the following, the terms “comprising,” “having,” and their cognates, which may be used in various embodiments of this application, are intended only to indicate a particular feature, number, step, operation, element, component, or combination thereof, and should not be construed as excluding, firstly, the presence of one or more other features, numbers, steps, operations, elements, components, or combinations thereof, or adding the possibility of one or more features, numbers, steps, operations, elements, components, or combinations thereof.
[0036] Furthermore, the terms "first," "second," and "third" are used only to distinguish descriptions and should not be interpreted as indicating or implying relative importance.
[0037] Unless otherwise specified, all terms used herein (including technical and scientific terms) shall have the same meaning as commonly understood by one of ordinary skill in the art to which the various embodiments of this application pertain. Terms (such as those defined in commonly used dictionaries) shall be interpreted as having the same meaning as in their contextual meaning in the relevant technical field and shall not be construed as having an idealized or overly formal meaning, unless clearly defined in the various embodiments of this application.
[0038] Example 1
[0039] This application provides a method for managing coding nodes.
[0040] See Figure 1 The methods for managing coding nodes include:
[0041] S101: Control the front-end module to retrieve the first target node from the first idle queue, so that the first target node is attached to the first busy queue after associating with the first source data that the front-end module has currently preprocessed;
[0042] S102: During the process of controlling the front-end module to retrieve the first target node from the first idle queue, the encoding module is controlled to retrieve the second target node from the first busy queue, so that the encoding module is controlled to encode the second source data associated with the second target node to obtain the bitstream data.
[0043] This embodiment controls the front-end module to retrieve a first target node from a first idle queue, so that the first target node is attached to a first busy queue after being associated with the first source data currently preprocessed by the front-end module. While controlling the front-end module to retrieve the first target node from the first idle queue, the encoding module is controlled to retrieve a second target node from the first busy queue, so that the encoding module encodes the second source data associated with the second target node to obtain the bitstream data. This allows the encoding module to simultaneously encode preprocessed source data (e.g., data previously preprocessed by the front-end module) while the front-end module is preprocessing the source data. By leveraging busy / idle queues and node scheduling, the business process is updated to a parallel process, fully utilizing system resources, improving encoding efficiency, and maximizing the encoder hardware's capabilities while avoiding performance waste.
[0044] The above-mentioned encoding node management method can be executed by the scheduling module of the image processing device or the embedded system. The scheduling module acts as a scheduling function. It can be a controller in the image processing device, a control unit dedicated to image processing, or something else.
[0045] The scheduling module can control the preceding module to retrieve the first target node from the first idle queue, at which point the target node is in an idle state. After the scheduling module or the preceding module associates the first target node with the first source data that the preceding module has currently preprocessed, the first target node will be attached to the first busy queue, meaning that at this point the first target node is associated with information or data and is in a busy state.
[0046] The first source data preprocessed by the aforementioned front-end module is the data that needs to be preprocessed before encoding, such as YUV source data.
[0047] The aforementioned front-end modules can perform preprocessing. In some examples, the front-end modules may include an image acquisition module and a preprocessing module. Taking YUV source data as an example, the image acquisition module is responsible for acquiring the raw YUV source data, while the preprocessing module performs some preliminary processing on the YUV source data, such as image enhancement or noise reduction. Then, the processed first source data is stored in a preset storage space, and each first source data has a corresponding physical storage address in the storage space.
[0048] After retrieving the first target node, the idle first target node can be associated with the first source data, so that the corresponding first source data can be found based on the first target node, thereby completing the configuration or node management of the first target node.
[0049] In some examples, when the first target node is associated with the first source data that has been preprocessed by the preceding module, the first source data can be stored directly in the first target node, or the first source data can be stored in the physical storage address mentioned above, and a first pointer corresponding to the physical storage address can be stored in the first target node. That is, the first pointer can indicate the physical storage address of the first source data that has been preprocessed by the preceding module.
[0050] It should also be noted that the pre-processing module typically does not consider information such as the size and resolution of the input source data. However, in the entire image processing device or embedded system, the pre-processing module can correspond one-to-one with the encoding module, and each pre-processing module and encoding module form an independent channel.
[0051] Alternatively, there can be only one front-end module, while the encoding modules distinguish between different resolutions or encoding requirements. In this case, the front-end module and different encoding modules also form their own channels. The front-end module can transmit the preprocessed source data to each encoding module through its own channel, and each encoding module processes it according to its own encoding requirements.
[0052] In this scheme, the execution processes of S101 and S102 are executed in parallel. That is, while the front-end module is retrieving the first target node from the first idle queue, the encoding module will also perform the encoding operation synchronously. At this time, the encoding module will be controlled by the scheduling module, and can retrieve the second target node from the first busy queue and complete the encoding of the second source data associated with the second target node.
[0053] It is understandable that the first busy queue contains several target nodes. Since the source data in the encoding process is arranged in chronological order, when each node is attached to the queue, its queue order corresponds to the chronological order of the source data. Therefore, the second source data must be the preprocessed data that precedes the first source data.
[0054] When using the first idle queue and the first busy queue for scheduling and management, a certain number of nodes can be requested from the storage module in advance, for example, 6-8 nodes. These nodes will then rotate between the first idle queue and the first busy queue.
[0055] Based on the nature of the reference queue, the first target node will be sequentially attached to the tail of the first busy queue, while the encoding module will retrieve the node from the head of the first busy queue, which is the second target node. Optionally, if the encoder hardware performance is superior, the first busy queue may also include only two nodes, in which case the second source data is the source data preprocessed by the previous module.
[0056] This solution enables the encoding module to encode pre-processed source data (e.g., data pre-processed by the previous module) while the front-end module pre-processes the source data. By leveraging busy / idle queues and node scheduling, the business process is updated to a parallel process, making full use of system resources and improving encoding efficiency. This allows the encoder hardware to reach its maximum capacity and avoids performance waste.
[0057] In some implementations, considering that directly storing source data in nodes can easily affect the smooth operation of the system or device, pointing information can be set. This pointing information can be a pointer, or in other examples, other information that can point to the preprocessed source data.
[0058] Taking the pointer information as an example, the process in S101 above, which controls the front-end module to retrieve the first target node from the first idle queue so that the first target node is attached to the first busy queue after being associated with the first source data currently preprocessed by the front-end module, may include:
[0059] The control front-end module retrieves the first target node from the first idle queue, so that the first target node is attached to the first busy queue after storing the first pointer. The first pointer is used to indicate the physical storage address of the first source data that the front-end module has currently preprocessed.
[0060] Similarly, pointers can also be used in the process of retrieving the second target node and obtaining the second source data for encoding in the encoding module.
[0061] That is, controlling the encoding module to encode the second source data associated with the second target node in S102 above may include:
[0062] The encoding module is controlled to parse the second pointer mounted on the second target node, so that the encoding module encodes the second source data stored in the physical storage address indicated by the second pointer.
[0063] In this embodiment, once the first target node is selected, the front-end module will store the corresponding pointer on the node, and the pointer will point to the first source data at a specific physical storage address in the storage space. After the pointer is stored on the first target node, it means that the first source data has been preprocessed by the front-end module. The scheduling module or the front-end module will remove the node from the first idle queue and attach it to the first busy queue. The frame of source data corresponding to the pointer on the node can be used by the encoding module.
[0064] The encoding module can read the pointer information stored on the first few nodes from the first busy queue. According to the pointer type and format, the encoding module parses the pointer information. Once the pointer is parsed, the encoding module can obtain the actual physical address of the second source data associated with the pointer. The encoding module accesses the second source data according to the obtained physical address and encodes it. The specific encoding method depends on the encoding module, such as H.264, H.265, H.266 or JPEG.
[0065] In this embodiment, the first or second pointer can identify the starting address and size of the frame source data. By using the pointer, the encoding module can quickly locate and access specific image frame source data in the storage space, without having to search or traverse the entire storage space each time to find the required image data, which is quick and convenient.
[0066] In this embodiment, the encoding module parses the second target node located at the head of the first busy queue. At this time, the second source data has already completed preprocessing. Simultaneously, the front-end module, in conjunction with the first target node, also associates the currently preprocessed first source data with the first target node and moves the first target node to the tail of the queue. This reduces the latency caused by waiting for the front-end module to process the source data and also improves encoding efficiency, as the front-end module and the encoding module can work simultaneously. Furthermore, the rotation of target nodes corresponds to the occupation and release of memory space. Therefore, this scheme, while allowing the encoding module and the front-end module to process in parallel, also achieves time-sharing reuse of memory space through node management using busy and idle queues, maximizing memory utilization.
[0067] In some implementations, after S102, the second pointer attached to the second target node can be deleted, and the second target node after deleting the second pointer can be reattached to the first idle queue.
[0068] In this embodiment, after a single encoding is completed, the encoding module deletes the second pointer on the second target node, releases the memory space of the second target node, removes the second target node from the first busy queue and remounts it to the first free queue, so that the second target node becomes a usable resource again, making it convenient to mount the pointers corresponding to subsequent source data.
[0069] In some implementations, before controlling the encoding module to encode the second source data associated with the second target node, the method further includes:
[0070] Obtain the reference information returned by the encoding module after determining whether the second source data meets the preset encoding requirements.
[0071] When the reference information indicates that the second source data does not meet the preset encoding requirements, the encoding module is controlled to feed back the second source data and the preset encoding requirements to the scaling module, so that the scaling module returns thumbnail data to the encoding module after scaling the second source data according to the preset encoding requirements, thereby enabling the encoding module to encode the thumbnail data.
[0072] When the reference information indicates that the second source data meets the preset encoding requirements, the following steps are performed: control the encoding module to encode the second source data associated with the second target node.
[0073] In this embodiment, the above-mentioned device or system further includes a scaling module, which can adapt to situations where the input and output of the encoding module do not meet the preset encoding requirements, thereby providing scaling services before encoding.
[0074] It should be noted that the storage space of the target node is created based on the width and height of the encoding channel, which ensures that the source data can be stored. However, as mentioned above, the front-end module does not identify the encoding requirements or resolution of the source data. Therefore, the source data input to the encoding module may not meet its preset encoding requirements. Thus, it is necessary to control and check the source data before encoding, and only encode the second source data pointed to by the second target node if it meets the preset encoding requirements.
[0075] If the second source data does not meet the preset encoding requirements, the second target node can be discarded, or it can be added to the first idle queue. After the encoding module feeds back the second source data corresponding to the second target node and the preset encoding requirements to the scaling module, it can continue encoding processing after the scaling module completes the scaling process.
[0076] This implementation scheme can adapt to different encoding requirements, provides a solution for source data that does not meet the encoding requirements of the encoding module after preprocessing, ensures that the encoded bitstream data meets the requirements, and improves the quality of the output bitstream information.
[0077] Optionally, when the scaling module performs scaling processing on the second source data, a busy / idle queue can also be used for management. In this case, the aforementioned control of the encoding module to feed back the second source data and the preset encoding requirements to the scaling module, so that the scaling module returns thumbnail data to the encoding module after scaling the second source data according to the preset encoding requirements, includes:
[0078] The encoding module is controlled to retrieve a third target node from the thumbnail idle queue, so that the third target node is associated with the second source data and then attached to the thumbnail busy queue, until the scaling module retrieves the third target node from the thumbnail busy queue, so as to scale the second source data associated with the third target node according to the preset encoding requirements, thereby so that the encoding module receives the scaled image data.
[0079] Understandably, after the scaling module completes the scaling of the second source data associated with the third target node according to the preset encoding requirements, the association of the third target node can be discarded. The third target node is now in an idle state and can be mounted to the thumbnail idle queue.
[0080] The aforementioned thumbnail idle queue and thumbnail busy queue can be applied to encoding methods such as JPEG. In this embodiment, the encoding module can request a preset storage space from the storage module and send the physical storage address of the second source data and the physical address of the preset storage space to the scaling module; after the scaling module performs a scaling operation on the first source data to obtain scaled image data, it can store the scaled image data in the preset storage space, thereby realizing the feedback of scaled image data to the encoding module.
[0081] In some implementations, in addition to using the thumbnail idle queue and thumbnail busy queue to strengthen the management of the scaling module and node scheduling, the first busy queue and the first idle queue mentioned above can also be referenced to improve the smoothness of node operation by using pointers.
[0082] For example, the encoding module can generate a third pointer based on the physical address of the thumbnail in a preset storage space, and attach the third pointer to the third target node of the thumbnail busy queue. At this time, the second pointer on the second target node can also be deleted.
[0083] The above mentions encoding methods such as JPEG and H.26X. For H.26X, a first idle queue and a first busy queue can be set. For JPEG encoding, queue settings can be differentiated based on different resolutions and scaling modules. For example, the queues can include up to eight queues for management: PicBusyQueue (image busy queue, equivalent to the first busy queue), PicFreeQueue (image idle queue, equivalent to the first idle queue), MPF0PicFreeQueue (MPF0 idle queue), MPF0PicBusyQueue (MPF0 busy queue), MPF1PicFreeQueue (MPF1 idle queue), MPF1PicBusyQueue (MPF1 busy queue), ThumbNailPicFreeQueue (thumbnail idle queue), and ThumbNailPicBusyQueue (thumbnail busy queue). During the management and scheduling of these eight queues, a maximum of two MPF images and one thumbnail can be displayed.
[0084] In addition to scheduling encoding nodes before and during encoding, post-encoding node management and scheduling can also be performed on the bitstream information and its occupancy after encoding. This allows for the timely release of encoder resources and storage space corresponding to nodes, thereby improving overall encoding efficiency.
[0085] Encoding can be performed through an encoding module to obtain the bitstream data. Then, a fourth target node is retrieved from the second idle queue so that the fourth target node is associated with the bitstream packet corresponding to the bitstream information and is attached to the second busy queue. If the bitstream packet associated with the fourth target node is occupied, the association of the fourth target node is deleted and it is attached to the second idle queue when the bitstream packet associated with the fourth target node is detected to be attached to the object queue in the second busy queue.
[0086] Based on the encoded bitstream information, this embodiment sets up a second idle queue, a second busy queue, and an object queue, which can also be called a user queue.
[0087] The second idle queue is similar to the first idle queue. After the encoding module completes encoding, the scheduling module or format conversion module can retrieve the fourth target node, which is in an idle state, from the second idle queue. The format management module can then package the bitstream information according to the requirements of the encoding protocol and other specifications. After the packaging operation is completed, the resulting bitstream packet can be associated with the retrieved fourth target node. After the association is completed, the fourth target node is then added to the second busy queue.
[0088] This means that all target nodes attached to the second busy queue have completed encoding and format conversion, and each target node in the second busy queue is associated with a corresponding bitstream packet. When certain objects, such as users, need to process the bitstream packet, such as taking the bitstream packet, the node corresponding to the bitstream packet will be transferred to the object queue until the object has completed processing and / or occupied the bitstream packet. At this time, the node can be released, and the node in the object queue can return to an idle state and be attached to the second idle queue.
[0089] It should be noted that the management of encoded bitstream data can be designed in the form of frames or packets, with multiple packets under a single frame. A frame node can include a complete frame of data, while a packet node can be, for example, a NAL packet in H.26X encoding.
[0090] When managing nodes after encoding, node management can be performed on a frame-by-frame basis or on a packet-by-packet basis.
[0091] The aforementioned format conversion module can also be the encoding module itself. By encapsulating the bitstream data, it can be converted into a data format suitable for network transmission, such as RTP, RTCP, and HLS, thereby improving data security and reliability and preventing data loss or corruption during transmission.
[0092] The above-mentioned bitstream packaging method can be selected according to actual needs and transmission protocols. For example, in the H.264 video coding standard, bitstream packaging can be performed using the RFC3984 protocol.
[0093] During the post-encoding node management process, all nodes are dynamically requested and can be directly executed by the encoding module. Therefore, before retrieving the fourth target node from the second free queue, it is possible to check whether there are any available empty nodes in the free queue. If not, an empty node can be requested from the storage module. That is, the encoding module can be controlled to determine whether there are any empty nodes in the second free queue. If there are no empty nodes in the second free queue, an empty node is requested to be added to the second free queue, and the newly added empty node is used as the fourth target node.
[0094] The empty node after the application is attached to the idle queue as the fourth target node, and will continue to rotate among the three queues involved in the encoded node until the encoder or encoding module is destroyed and the resources are released.
[0095] By using this node management and setting up three queues, the three processes of encoder encoding, bitstream packaging to obtain bitstream packets, and user saving or processing bitstream data can be carried out asynchronously, which can improve the overall efficiency of the encoder.
[0096] This dynamic node allocation and release mechanism effectively manages encoder resources, avoiding waste and excessive allocation. Furthermore, by rotating nodes between different queues, the encoder can operate efficiently.
[0097] Example 2
[0098] Furthermore, embodiments of this application provide an encoding node management device, such as... Figure 2 As shown, the encoding node management device 300 includes:
[0099] The front-end module 301 is used to retrieve the first target node from the first idle queue, so that the first target node is attached to the first busy queue after associating with the first source data that has been preprocessed by the front-end module 301.
[0100] The encoding module 302 is used to retrieve a second target node from the first busy queue during the process of the front-end module 301 retrieving the first target node from the first idle queue, and to encode the second source data associated with the second target node to obtain the bitstream data.
[0101] Optionally, the front-end module 301 is further configured to retrieve the first target node from the first idle queue, so that the first target node is attached to the first busy queue after storing the first pointer, wherein the first pointer is used to indicate the physical storage address of the first source data that the front-end module has currently preprocessed;
[0102] The encoding module 302 is also used to parse the second pointer mounted on the second target node in order to encode the second source data stored in the physical storage address indicated by the second pointer.
[0103] Optionally, it also includes a scheduling module; the scheduling module or the encoding module 302 deletes the second pointer attached to the second target node and reattaches the second target node after deleting the second pointer to the first idle queue.
[0104] Optionally, the encoding module 302 is further configured to determine whether the second source data meets the preset encoding requirements; wherein, when the reference information indicates that the second source data does not meet the preset encoding requirements, the second source data and the preset encoding requirements are fed back to the scaling module, so that the scaling module returns thumbnail data after scaling the second source data according to the preset encoding requirements, thereby encoding the thumbnail data; when the reference information indicates that the second source data meets the preset encoding requirements, the second source data associated with the second target node is encoded.
[0105] Optionally, the encoding module 302 is further configured to retrieve a third target node from the thumbnail idle queue, so that the third target node is associated with the second source data and then attached to the thumbnail busy queue, until the scaling module retrieves the third target node from the thumbnail busy queue, so as to scale the second source data associated with the third target node according to the preset encoding requirements, thereby receiving the scaled image data.
[0106] Optionally, the scheduling module or encoding module 302 described above is further configured to retrieve the fourth target node from the second idle queue, so that the fourth target node is associated with the bitstream packet corresponding to the bitstream information and then mounted to the second busy queue; until the fourth target node in the second busy queue is detected to be mounted to the object queue, if the bitstream packet associated with the fourth target node is occupied, the association of the fourth target node is deleted and it is mounted to the second idle queue.
[0107] Optionally, the encoding module 302 is further configured to determine whether there is an empty node in the second free queue. If there is no empty node in the second free queue, an application is made to add an empty node in the second free queue, and the newly added empty node is used as the fourth target node.
[0108] Example 3
[0109] Furthermore, this application provides an electronic device, including a memory and a processor. The memory stores a computer program, which executes the encoding node management method provided in Embodiment 1 when running on the processor.
[0110] The electronic device provided in this embodiment can implement the coding node management method provided in Embodiment 1 or refer to... Figure 2 The device body performs the process described in Embodiment 1 above, and will not be repeated here to avoid repetition.
[0111] Example 4
[0112] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the encoding node management method provided in Embodiment 1.
[0113] In this embodiment, the computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc.
[0114] The computer-readable storage medium provided in this embodiment can implement the coding node management method provided in Embodiment 1, or refer to Figure 2 The device body performs the process described in Embodiment 1 above, and will not be repeated here to avoid repetition.
[0115] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal that includes that element.
[0116] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0117] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
Claims
1. A method for managing coding nodes, characterized in that, The method includes: The control front-end module retrieves the first target node from the first idle queue, so that the first target node is attached to the first busy queue after being associated with the first source data that has been preprocessed by the front-end module. During the process of controlling the front-end module to retrieve the first target node from the first idle queue, the control encoding module retrieves the second target node from the first busy queue, so that the control encoding module encodes the second source data associated with the second target node to obtain the bitstream data; Wherein, the second source data is source data that has been preprocessed before the first source data, and the second target node is attached to the first busy queue before the first target node. While the first target node is being processed by the front-end module, the encoding module is processing the second target node. When each node is attached to the queue, its queue order corresponds to the time sequence of the source data. Before the encoding module encodes the second source data associated with the second target node, the method further includes: Obtain the reference information returned by the encoding module after determining whether the second source data meets the preset encoding requirements; When the reference information indicates that the second source data does not meet the preset encoding requirements, the encoding module is controlled to retrieve the third target node from the thumbnail idle queue, so that the third target node is associated with the second source data and then attached to the thumbnail busy queue, until the scaling module retrieves the third target node from the thumbnail busy queue, so as to scale the second source data associated with the third target node according to the preset encoding requirements, thereby so that the encoding module receives the scaled thumbnail data; The method further includes, after controlling the encoding module to encode the second source data associated with the second target node to obtain the bitstream data, the method further includes: The fourth target node is retrieved from the second idle queue, and then associated with the corresponding bit stream packet of the bit stream data and mounted to the second busy queue. The process continues until the fourth target node in the second busy queue is detected to be attached to the object queue, which is the queue used by the user when processing the bitstream data.
2. The coding node management method according to claim 1, characterized in that, The control front-end module retrieves a first target node from the first idle queue, so that the first target node is attached to the first busy queue after being associated with the first source data currently preprocessed by the front-end module, including: The control front-end module retrieves the first target node from the first idle queue, so that the first target node is attached to the first busy queue after storing the first pointer. The first pointer is used to indicate the physical storage address of the first source data that the front-end module has currently preprocessed. The control of the encoding module to encode the second source data associated with the second target node includes: The encoding module is controlled to parse the second pointer mounted on the second target node, so that the encoding module encodes the second source data stored in the physical storage address indicated by the second pointer.
3. The coding node management method according to claim 2, characterized in that, After the encoding module parses the second pointer mounted on the second target node, so that the encoding module encodes the second source data stored in the physical storage address indicated by the second pointer, the method further includes: Delete the second pointer attached to the second target node, and reattach the second target node after deleting the second pointer to the first idle queue.
4. The coding node management method according to claim 1, characterized in that, Before the encoding module encodes the second source data associated with the second target node, the method further includes: Obtain the reference information returned by the encoding module after determining whether the second source data meets the preset encoding requirements; When the reference information indicates that the second source data meets the preset encoding requirements, the following steps are performed: control the encoding module to encode the second source data associated with the second target node.
5. The coding node management method according to claim 1, characterized in that, After the encoding module is controlled to encode the second source data associated with the second target node to obtain the bitstream data, the method further includes: If the fourth target node in the second busy queue is detected to be attached to the object queue, and if the bitstream packet associated with the fourth target node is occupied, the association of the fourth target node is deleted and it is attached to the second idle queue.
6. The coding node management method according to claim 1, characterized in that, Before retrieving the fourth target node from the second free queue, the process also includes: The control module determines whether there is an empty node in the second free queue. If there is no empty node in the second free queue, it requests to add an empty node in the second free queue and uses the newly added empty node as the fourth target node. The empty node refers to a node that has been attached to the free queue.
7. A coding node management device, characterized in that, The device includes: The front-end module is used to retrieve the first target node from the first idle queue, so that the first target node is attached to the first busy queue after associating with the first source data that has been preprocessed by the front-end module. The encoding module is used to retrieve a second target node from the first busy queue during the process of the front-end module retrieving the first target node from the first idle queue, and to encode the second source data associated with the second target node to obtain bitstream data; Wherein, the second source data is source data that has been preprocessed before the first source data, the second target node is attached to the first busy queue before the first target node, and the encoding module processes the second target node while the front-end module processes the first target node; Wherein, the second source data is source data that has been preprocessed before the first source data, and the second target node is attached to the first busy queue before the first target node. While the first target node is being processed by the front-end module, the encoding module is processing the second target node. When each node is attached to the queue, its queue order corresponds to the time sequence of the source data. Before the encoding module encodes the second source data associated with the second target node, the method further includes: Obtain the reference information returned by the encoding module after determining whether the second source data meets the preset encoding requirements; When the reference information indicates that the second source data does not meet the preset encoding requirements, the encoding module is controlled to retrieve the third target node from the thumbnail idle queue, so that the third target node is associated with the second source data and then attached to the thumbnail busy queue, until the scaling module retrieves the third target node from the thumbnail busy queue, so as to scale the second source data associated with the third target node according to the preset encoding requirements, thereby so that the encoding module receives the scaled thumbnail data; The method further includes, after controlling the encoding module to encode the second source data associated with the second target node to obtain the bitstream data, the method further includes: The fourth target node is retrieved from the second idle queue, and then associated with the corresponding bit stream packet of the bit stream data and mounted to the second busy queue. The process continues until the fourth target node in the second busy queue is detected to be attached to the object queue, which is the queue used by the user when processing the bitstream data.
8. An electronic device, characterized in that, It includes a memory and a processor, the memory storing a computer program that executes the coding node management method according to any one of claims 1 to 6 when the processor is running.
9. A computer-readable storage medium, characterized in that, It stores a computer program that, when run on a processor, executes the coding node management method according to any one of claims 1 to 6.