CN111953990A - Encoding method and device - Google Patents

Encoding method and device Download PDF

Info

Publication number
CN111953990A
CN111953990A CN202010645197.XA CN202010645197A CN111953990A CN 111953990 A CN111953990 A CN 111953990A CN 202010645197 A CN202010645197 A CN 202010645197A CN 111953990 A CN111953990 A CN 111953990A
Authority
CN
China
Prior art keywords
target
queue
preparation queue
transmitted
image data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010645197.XA
Other languages
Chinese (zh)
Inventor
段瑞楠
范志刚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xian Wanxiang Electronics Technology Co Ltd
Original Assignee
Xian Wanxiang Electronics Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xian Wanxiang Electronics Technology Co Ltd filed Critical Xian Wanxiang Electronics Technology Co Ltd
Priority to CN202010645197.XA priority Critical patent/CN111953990A/en
Publication of CN111953990A publication Critical patent/CN111953990A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/42Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation
    • H04N19/423Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation characterised by memory arrangements

Abstract

The present disclosure provides a coding method and a device, relating to the technical field of coding, wherein the method comprises receiving an acquisition completion event; the acquisition completion event carries identification information of a preparation queue; determining a corresponding preparation queue according to the identification information of the preparation queue; the preparation queue comprises at least one target free buffer area; determining a target free buffer area to be coded from the preparation queue; acquiring the image data to be transmitted from the target idle cache region to be coded; and coding the image data to be transmitted to generate a target coding code stream. The method and the device realize the sharing of the target idle buffer area to be coded by the acquisition end and the coding end, do not need to carry the image data to be transmitted, and cannot cause coding delay due to the carrying of the image to be transmitted, thereby improving the efficiency of image transmission.

Description

Encoding method and device
Technical Field
The present disclosure relates to the field of image coding technologies, and in particular, to a coding method and apparatus.
Background
Computer images include both natural images and computer-generated images. The natural images refer to scenes which exist in nature, and the movie and television contents seen in life of people are natural images. The computer synthetic image is an artificial image obtained by computer graphics technology and calculation through a display card on a computer. When transmitting an image, it is usually necessary to encode and decode the image.
In the related art, the encoding process is generally: the acquisition chip stores the acquired image data in a cache region, the address of the cache region is sent to the main control module, the main control module copies the image data stored in the cache region to a cache of the encoding end, and the encoding end reads the image data from the cache of the encoding end for encoding.
However, in the encoding process, there is a data transfer from the buffer of the acquisition chip to the buffer of the encoding end, and the data transfer consumes resources of the main control module, so that a coding delay may be introduced in the data transfer, thereby reducing the efficiency of image transmission.
Disclosure of Invention
The embodiment of the disclosure provides an encoding method and an encoding device, which can solve the problem of reduced image transmission efficiency in the prior art. The technical scheme is as follows:
according to a first aspect of the embodiments of the present disclosure, there is provided an encoding method applied to an encoding end, the method including:
receiving an acquisition completion event; the acquisition completion event carries identification information of a target idle cache region and identification information of a prepared queue;
determining a corresponding preparation queue according to the identification information of the preparation queue; the preparation queue comprises at least one target free buffer area;
determining a target free buffer area to be coded from the preparation queue;
acquiring the image data to be transmitted from the target idle cache region to be coded;
and coding the image data to be transmitted to generate a target coding code stream.
The embodiment of the disclosure provides an encoding method, which includes when an acquisition completion event sent by an acquisition end is received, determining a corresponding preparation queue according to identification information of the preparation queue carried in the acquisition completion event, determining a target idle cache region to be encoded from the preparation queue, encoding image data to be transmitted in the target idle cache region to be encoded, and generating a target encoding code stream to complete encoding. Therefore, the acquisition end only needs to send the identification information of the preparation queue to the coding end, the coding end can directly acquire the image data to be transmitted in the target idle buffer area to be coded and code the image data to be transmitted, the acquisition end and the coding end share the target idle buffer area to be coded, the image data to be transmitted does not need to be carried, coding delay caused by carrying the image to be transmitted is avoided, and the image transmission efficiency is improved.
In one embodiment, when at least two target free buffers are included in the preparation queue, the determining the target free buffer to be encoded from the preparation queue includes:
picking all the target free buffer areas from the preparation queue;
determining a target free buffer zone with the latest joining time of the preparation queue from all the target free buffers;
and determining the target idle buffer zone with the latest time of adding the preparation queue as the target idle buffer zone to be coded.
In this embodiment, the target idle buffer area with the latest time added into the preparation queue is determined as the target idle buffer area to be encoded, so that the encoding end can encode only the image data to be transmitted stored in the target idle buffer area with the latest time in the preparation queue, so as to ensure the real-time performance of encoding.
In one embodiment, further comprising:
and adding target free buffer areas except the target free buffer area to be coded in the preparation queue into a free queue.
In this embodiment, the target idle buffer area stored in the preliminary queue at an earlier time is added to the idle queue again, so that the acquisition end adds the newly acquired image data to be transmitted to the idle queue.
In one embodiment, after the generating the target encoded code stream, the method further includes:
and adding the target idle buffer area to be coded into an idle queue.
In this embodiment, the target idle buffer to be encoded is transferred from the preparation queue to the idle queue, so that the acquisition end can continue to store the acquired subsequent image data to be transmitted into the target idle buffer to be encoded, thereby implementing reuse of the buffer and saving resources.
According to a second aspect of the embodiments of the present disclosure, there is provided an encoding method applied to an acquisition end, the method including:
collecting image data to be transmitted;
determining a target idle buffer area from the idle queue; the free queue comprises at least one free buffer area;
writing the image data to be transmitted into the target idle buffer area;
adding the target free buffer area to a preparation queue;
sending an acquisition completion event to the encoding end; and the acquisition completion event carries identification information of the preparation queue, so that the encoding end determines the corresponding preparation queue according to the identification information of the preparation queue, determines a target idle cache region to be encoded from the preparation queue, encodes image data to be transmitted in the target idle cache region to be encoded, and generates a target encoding code stream.
The embodiment of the disclosure provides an encoding method, which includes when an acquisition completion event sent by an acquisition end is received, determining a corresponding preparation queue according to identification information of the preparation queue carried in the acquisition completion event, determining a target idle cache region to be encoded from the preparation queue, encoding image data to be transmitted in the target idle cache region to be encoded, and generating a target encoding code stream to complete encoding. Therefore, the acquisition end only needs to send the identification information of the preparation queue to the coding end, the coding end can directly acquire the image data to be transmitted in the target idle buffer area to be coded and code the image data to be transmitted, the acquisition end and the coding end share the target idle buffer area to be coded, the image data to be transmitted does not need to be carried, coding delay caused by carrying the image to be transmitted is avoided, and the image transmission efficiency is improved.
According to a third aspect of the embodiments of the present disclosure, there is provided an encoding apparatus applied to an encoding end, the apparatus including:
the first receiving module is used for receiving an acquisition completion event; the acquisition completion event carries identification information of a preparation queue;
the first determining module is used for determining a corresponding preparation queue according to the identification information of the preparation queue; the preparation queue comprises at least one target free buffer area;
the second determining module is used for determining a target free buffer area to be coded from the preparation queue;
the third determining module is used for acquiring the image data to be transmitted from the target idle cache region to be coded;
and the generating module is used for coding the image data to be transmitted and generating a target coding code stream.
In one embodiment, when the preparation queue includes at least two target free buffer areas, the second determining module includes an obtaining sub-module, a first determining sub-module, and a second determining sub-module;
the obtaining submodule is used for picking all the target free buffer areas from the preparation queue;
the first determining submodule is used for determining a target free buffer area with the latest time for joining the preparation queue from all the target free buffers;
and the second determining submodule is used for determining the target idle buffer zone with the latest time of adding the prepared queue as the target idle buffer zone to be coded.
In one embodiment, further comprising:
and the first adding module is used for adding the target free buffer areas except the target free buffer area to be coded in the preparation queue into the free queue.
In one embodiment, further comprising:
and the second adding module is used for adding the target idle buffer area to be coded into an idle queue.
According to a fourth aspect of the embodiments of the present disclosure, there is provided an encoding apparatus applied to an acquisition end, the apparatus including:
the acquisition module is used for acquiring image data to be transmitted;
the fourth determining module is used for determining a target free buffer area from the free queue; the free queue comprises at least one free buffer area;
the writing module is used for writing the image data to be transmitted into the target idle cache region;
the adding module is used for adding the target free buffer area to a preparation queue;
the sending module is used for sending an acquisition completion event to the encoding end; and the acquisition completion event carries identification information of the preparation queue, so that the encoding end determines the corresponding preparation queue according to the identification information of the preparation queue, determines a target idle cache region to be encoded from the preparation queue, encodes image data to be transmitted in the target idle cache region to be encoded, and generates a target encoding code stream.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
Fig. 1 is a flowchart of an encoding method provided by an embodiment of the present disclosure;
fig. 2 is a flowchart of an encoding method provided by an embodiment of the present disclosure;
fig. 3 is a flowchart of an encoding method provided by an embodiment of the present disclosure;
FIG. 4 is an interaction diagram of an encoding method provided by an embodiment of the present disclosure;
FIG. 5 is an interaction diagram of an encoding method provided by an embodiment of the present disclosure;
fig. 6a is a structural diagram of an encoding apparatus provided in an embodiment of the present disclosure;
fig. 6b is a structural diagram of an encoding apparatus provided in an embodiment of the present disclosure;
fig. 6c is a structural diagram of an encoding apparatus provided in an embodiment of the present disclosure;
fig. 6d is a structural diagram of an encoding apparatus provided in an embodiment of the present disclosure;
fig. 7 is a structural diagram of an encoding apparatus according to an embodiment of the present disclosure.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
The embodiment of the present disclosure provides an encoding method, applied to an encoding end, as shown in fig. 1, the method includes the following steps:
step 101, receiving an acquisition completion event.
And the acquisition completion event carries identification information of the preparation queue.
Illustratively, the encoding end includes a control unit and an encoding unit, and the control unit receives an acquisition completion event sent by the acquisition end, and analyzes the received acquisition completion event to obtain identification information of the preparation queue.
It should be noted that the control unit enters a sleep state when waiting for the image data to be transmitted acquired by the acquisition end, and wakes up the control unit sleeping due to waiting for the image data to be transmitted when the acquisition end acquires a frame of image data to be transmitted. The control unit is awakened from the sleep state upon receiving the acquisition completion event.
And 102, determining a corresponding preparation queue according to the identification information of the preparation queue.
The preparation queue comprises at least one target free buffer area, the target free buffer areas are queued according to the sequence of entering the preparation queue, and it can be understood that if the target free buffer areas enter from the front end of the preparation queue, the time for the target free buffer area at the front end of the preparation queue to enter the queue is earlier, and the time for the target free buffer area at the rear end of the preparation queue to enter the queue is later.
Illustratively, the control unit searches a corresponding preparation queue in the buffer according to the identification information of the preparation queue, where the preparation queue includes at least one target free buffer, and the target free buffer stores image data to be transmitted.
And 103, determining a target free buffer area to be coded from the preparation queue.
For example, if only one target free buffer is included in the preparation queue, the target free buffer is determined as the target free buffer to be encoded.
If the preparation queue comprises at least two target free buffer areas, extracting all the target free buffer areas from the preparation queue; determining a target free buffer zone with the latest joining time of the preparation queue from all the target free buffers; and determining the target idle buffer zone with the latest time of adding the preparation queue as the target idle buffer zone to be coded.
For example, since the time for which the encoding unit encodes one frame of image data depends on the degree of change of the image picture, the time for which the encoding unit encodes each frame of image data may not be equally long. The time taken for the acquisition end to acquire one frame of image data is fixed, so that a plurality of target free buffer areas may exist in the preparation queue at the same time. Therefore, after receiving the acquisition completion event, the control unit can take out all the target idle buffer areas in the preparation queue, screen the target idle buffer areas, and determine the target idle buffer area stored in the preparation queue at the latest time as the target idle buffer area to be coded.
Further, adding target free buffer areas except the target free buffer area to be coded in the preparation queue into an idle queue.
For example, the control unit further adds a target idle buffer area in the preparation queue, that is, an earlier target idle buffer area stored in the preparation queue, to the idle queue again, and discards the image data to be transmitted in the earlier target idle buffer area, so that the acquisition end adds the newly acquired image data to be transmitted to the idle queue; only the target idle buffer zone stored at the latest time in the preparation queue, namely the latest target idle buffer zone, is reserved, so that the encoding unit only encodes the image data to be transmitted in the latest target idle buffer zone to ensure the real-time performance of encoding.
And 104, acquiring the image data to be transmitted from the target idle buffer area to be coded.
Illustratively, when determining a target idle cache area to be encoded, a control unit determines identification information of the target idle cache area to be encoded according to identification information of each target idle cache area carried in an acquisition completion event, and invokes an encoding end interface to package the identification information of the target idle cache area to be encoded in an encoding request and send the encoding request to an encoding unit, so as to inform the encoding unit of the target idle cache area where image data to be transmitted is located; and the coding unit analyzes the coding request to obtain the identification information of the target idle cache region to be coded, and searches the target idle cache region to be coded corresponding to the identification information of the target idle cache region to be coded according to the corresponding relation between the identification information and the idle cache region, so as to read the image data to be transmitted stored in the target idle cache region to be coded. It can be understood that the latest image data to be transmitted is stored in the target free buffer to be encoded.
And 105, coding the image data to be transmitted to generate a target coding code stream.
Illustratively, the encoding unit encodes the image data to be transmitted, generates a target encoding code stream, and transmits the generated target encoding code stream to the transmission layer, and the target encoding code stream flows through the transmission layer to reach the decoding end, thereby realizing the encoding of the image to be transmitted.
Further, as shown in fig. 2, after the step 105 is executed, the following step 106 is further included:
and 106, adding the target free buffer area to be coded into a free queue.
Illustratively, when a coding unit sends a generated target coding code stream to a decoding end, a coding completion event is sent to a control unit, when the control unit receives the coding completion event sent by the coding unit, the coding unit determines that the coding unit completes coding of image data to be transmitted in a target idle cache region to be coded, at this time, the target idle cache region to be coded is transferred to an idle queue from a preparation queue, so that an acquisition end can continuously store acquired subsequent image data to be transmitted into the target idle cache region to be coded, the reuse of the cache region is realized, and resources are saved; meanwhile, the storage space of the preparation queue is released, so that a target idle buffer area to be coded, which is subsequently stored with image data to be transmitted, can be conveniently added into the preparation queue again.
The embodiment of the disclosure provides an encoding method, which includes when an acquisition completion event sent by an acquisition end is received, determining a corresponding preparation queue according to identification information of the preparation queue carried in the acquisition completion event, determining a target idle cache region to be encoded from the preparation queue, encoding image data to be transmitted in the target idle cache region to be encoded, and generating a target encoding code stream to complete encoding. Therefore, the acquisition end only needs to send the identification information of the preparation queue to the coding end, the coding end can directly acquire the image data to be transmitted in the target idle buffer area to be coded and code the image data to be transmitted, the acquisition end and the coding end share the target idle buffer area to be coded, the image data to be transmitted does not need to be carried, coding delay caused by carrying the image to be transmitted is avoided, and the image transmission efficiency is improved.
The embodiment of the present disclosure provides an encoding method applied to an acquisition end, as shown in fig. 3, the method includes the following steps:
step 301, collecting image data to be transmitted.
In an example, the acquisition end acquires an image data frame, that is, image data to be transmitted.
It should be noted that image data to be transmitted is YUV data, YUV is a color space, and color coding based on YUV is a common coding method for streaming media, where Y represents brightness of each pixel unit, and brightness may also be represented as Luminance or Luma, or may also be understood as a gray value; while U and V represent the chromaticity of each pixel unit, the chromaticity may also be represented as Chroma or Chroma.
Step 302, determining a target free buffer area from the free queue.
Wherein the free queue comprises at least one free buffer.
In an example, when the acquisition end acquires image data to be transmitted, one idle buffer area is selected from preset idle buffer areas of an idle queue, and the idle buffer area is determined as a target idle buffer area.
It should be noted that the idle queue is preset, and the idle queue may be based on DMA-BUF and may be shared by the acquisition end and the encoding end. DMA-BUF is a general mechanism for sharing DMA buffers between different peripheral hardware. Typical usage scenario producer-consumer problem. One device acts as a producer of DMA buffers (e.g., acquisition chip, decoder side) and fills in data to the buffers. Another device is used as a consumer of the DMA buffer, and uses data (such as an encoding end and a display end) in the buffer, and image data to be transmitted is transmitted through DMA (Direct Memory Access); the number of the idle buffer areas set in the idle queue may be determined according to respective event processing speeds of the acquisition chip, the decoding end, the encoding end, and the like, for example, the idle queue includes 10 DRM (Direct Render Management) buffer areas, which may specifically refer to the prior art and is not described herein again. In addition, the size of each free buffer area can be calculated according to the resolution size negotiated by the decoding end and the encoding end and the image boundary continuation required by the decoding end.
It should be noted that, in the present disclosure, a buffer using mechanism of the encoding end is redesigned, so that the encoding end uses an external DMA-BUF function, that is, the encoding end is disguised as a hardware peripheral, so that the encoding end and the acquisition end share the DMA-BUF. Specifically, the encoding end needs to be able to support the DMA-BUF of the acquisition end, that is, when the acquisition end stores the image data into the target idle buffer area through the DMA, the encoding end can directly use the DMA-BUF of the acquisition end to read the image data.
Step 303, writing the image data to be transmitted into the target idle buffer area.
In an example, when determining a target free buffer area, an acquisition end performs a DMA operation on acquired image data to be transmitted, where the DMA operation refers to that the acquisition end sends the image data to be transmitted into the target free buffer area through the DMA, and the DMA is a data transmission method. Data transfer between the peripheral and the encoding side is usually accomplished by DMA. That is, the acquired image data to be transmitted is stored in the target idle buffer area, so as to realize the buffer storage of the image data to be transmitted.
And step 304, adding the target free buffer area to a preparation queue.
In an example, when the acquisition end stores the image data to be transmitted into the target idle buffer area, the target idle buffer area is added into the preparation queue, so that the target idle buffer area in which the image data to be transmitted is stored is separated from the idle buffer area in which the image data to be transmitted is not stored, so that the acquisition end does not conflict with the encoding end in reading the image data to be transmitted when the image data to be transmitted is written in, and the reading and writing efficiency of the buffer memory can be improved.
Step 305, sending an acquisition completion event to an encoding end; and the acquisition completion event carries identification information of the preparation queue, so that the encoding end determines the corresponding preparation queue according to the identification information of the preparation queue, determines a target idle cache region to be encoded from the preparation queue, encodes image data to be transmitted in the target idle cache region to be encoded, and generates a target encoding code stream.
In an example, after adding a target idle buffer area into a preparation queue, an acquisition end sends an acquisition completion event carrying identification information of the target idle buffer area and identification information of the preparation queue to a control unit, so that the control unit carries identification information corresponding to the target idle buffer area to be encoded, which is determined from the preparation queue, in an encoding request and sends the encoding request to an encoding unit, so that the encoding unit determines the target idle buffer area to be encoded according to the encoding request, encodes image data to be transmitted in the target idle buffer area to be encoded, and generates a target encoding code stream to complete encoding of the image data to be transmitted.
The embodiment of the disclosure provides an encoding method, which includes when an acquisition completion event sent by an acquisition end is received, determining a corresponding preparation queue according to identification information of the preparation queue carried in the acquisition completion event, determining a target idle cache region to be encoded from the preparation queue, encoding image data to be transmitted in the target idle cache region to be encoded, and generating a target encoding code stream to complete encoding. Therefore, the acquisition end only needs to send the identification information of the preparation queue to the coding end, the coding end can directly acquire the image data to be transmitted in the target idle buffer area to be coded and code the image data to be transmitted, the acquisition end and the coding end share the target idle buffer area to be coded, the image data to be transmitted does not need to be carried, coding delay caused by carrying the image to be transmitted is avoided, and the image transmission efficiency is improved; in addition, the acquisition end also separates a target idle buffer area in which the image data to be transmitted is stored from an idle buffer area in which the image data to be transmitted is not stored, so that the acquisition end does not conflict with the encoding end for reading the image data to be transmitted when the image data to be transmitted is written in, and the reading and writing efficiency of the buffer memory can be improved. In the related technology, the acquisition chip writes the acquired image data into the DMA-BUF of the acquisition chip, the main control module reads the image data from the DMA-BUF of the acquisition chip, and the DMA-BUF cannot be read while being written, so that the problem of read-write conflict in the DMA-BUF exists, and the read-write efficiency of the DMA-BUF in the related technology is low.
The embodiment of the present disclosure provides an encoding method, which is applied to an acquisition end and an encoding end, as shown in fig. 4, the method includes the following steps:
step 401, the acquisition end acquires image data to be transmitted.
Step 402, the acquisition end determines a target free buffer area from the free queue.
Wherein the free queue comprises at least one free buffer.
And 403, writing the image data to be transmitted into the target idle buffer area by the acquisition end.
And step 404, the acquisition end adds the target free buffer area to a preparation queue.
Step 405, the acquisition end sends an acquisition completion event to the encoding end.
And the acquisition completion event carries identification information of the preparation queue.
And step 406, the encoding end determines a corresponding preparation queue according to the identification information of the preparation queue.
Wherein the preparation queue comprises at least one target free buffer.
Step 407, the encoding end determines a target free buffer area to be encoded from the preparation queue.
And step 408, the encoding end acquires the image data to be transmitted from the target idle buffer area to be encoded.
And 409, coding the image data to be transmitted by the coding end to generate a target coding code stream.
The embodiment of the disclosure provides an encoding method, which includes when an acquisition completion event sent by an acquisition end is received, determining a corresponding preparation queue according to identification information of the preparation queue carried in the acquisition completion event, determining a target idle cache region to be encoded from the preparation queue, encoding image data to be transmitted in the target idle cache region to be encoded, and generating a target encoding code stream to complete encoding. Therefore, the acquisition end only needs to send the identification information of the preparation queue to the coding end, the coding end can directly acquire the image data to be transmitted in the target idle buffer area to be coded and code the image data to be transmitted, the acquisition end and the coding end share the target idle buffer area to be coded, the image data to be transmitted does not need to be carried, coding delay caused by carrying the image to be transmitted is avoided, and the image transmission efficiency is improved.
The embodiment of the present disclosure provides an encoding method, which is applied to an acquisition end and an encoding end, as shown in fig. 5, the method includes the following steps:
and step 501, the acquisition end acquires image data to be transmitted.
Step 502, the acquisition end determines a target free buffer area from the free queue.
Wherein the free queue comprises at least one free buffer.
Step 503, the acquisition end writes the image data to be transmitted into the target idle buffer area.
And step 504, the acquisition end adds the target free buffer area to a preparation queue.
And 505, the acquisition end sends an acquisition completion event to the encoding end.
And the acquisition completion event carries identification information of the preparation queue.
Step 506, the encoding end determines a corresponding preparation queue according to the identification information of the preparation queue.
Wherein the preparation queue comprises at least one target free buffer.
And 507, when the preparation queue comprises at least two target free buffer areas, the encoding end extracts all the target free buffer areas from the preparation queue.
Step 508, the encoding end determines a target free buffer area with the latest time for joining the preparation queue from all the target free buffers.
In step 509, the encoding end determines the target idle buffer area with the latest time of adding into the preparation queue as the target idle buffer area to be encoded.
Step 510, the encoding end adds the target free buffer areas except the target free buffer area to be encoded in the preparation queue into the free queue.
And 511, the encoding end acquires the image data to be transmitted from the target idle buffer area to be encoded.
And step 512, the coding end codes the image data to be transmitted to generate a target coding code stream.
Step 513, the encoding end adds the target idle buffer area to be encoded into an idle queue.
The embodiment of the disclosure provides an encoding method, which includes when an acquisition completion event sent by an acquisition end is received, determining a corresponding preparation queue according to identification information of the preparation queue carried in the acquisition completion event, determining a target idle cache region to be encoded from the preparation queue, encoding image data to be transmitted in the target idle cache region to be encoded, and generating a target encoding code stream to complete encoding. Therefore, the acquisition end only needs to send the identification information of the preparation queue to the coding end, the coding end can directly acquire the image data to be transmitted in the target idle buffer area to be coded and code the image data to be transmitted, the acquisition end and the coding end share the target idle buffer area to be coded, the image data to be transmitted does not need to be carried, coding delay caused by carrying the image to be transmitted is avoided, and the image transmission efficiency is improved; in addition, the acquisition end also separates a target idle buffer area in which the image data to be transmitted is stored from an idle buffer area in which the image data to be transmitted is not stored, so that the acquisition end does not conflict with the encoding end for reading the image data to be transmitted when the image data to be transmitted is written in, and the reading and writing efficiency of the buffer memory can be improved.
Based on the encoding methods described in the above embodiments, the following are embodiments of the apparatus of the present disclosure, which may be used to perform embodiments of the method of the present disclosure.
The embodiment of the present disclosure provides an encoding apparatus, which is applied to an encoding end, as shown in fig. 6a, the encoding end 60 includes: a first receiving module 601, a first determining module 602, a second determining module 603, a third determining module 604 and a generating module 605.
The first receiving module 601 is configured to receive an acquisition completion event; and the acquisition completion event carries identification information of the preparation queue.
A first determining module 602, configured to determine a corresponding preparation queue according to the identification information of the preparation queue; the preparation queue comprises at least one target free buffer area.
A second determining module 603, configured to determine a target free buffer to be encoded from the preparation queue.
A third determining module 604, configured to obtain the image data to be transmitted from the target idle buffer to be encoded.
A generating module 605, configured to encode the image data to be transmitted, and generate a target encoding code stream.
In one embodiment, as shown in fig. 6b, when at least two target free buffers are included in the preparation queue, the second determining module 603 includes an obtaining sub-module 6031, a first determining sub-module 6032, and a second determining sub-module 6033.
The obtaining sub-module 6031 is configured to extract all the target free buffers from the preparation queue.
The first determining sub-module 6032 is configured to determine, from all the target free buffers, a target free buffer that is the latest in time to join the preparation queue.
The second determining submodule 6033 is configured to determine the target idle buffer that is added to the preparation queue at the latest time as the target idle buffer to be encoded.
In one embodiment, as shown in FIG. 6c, the apparatus 60 further comprises a first join module 606.
The first adding module 606 is configured to add a target free buffer area in the preparation queue, except for the target free buffer area to be encoded, to an idle queue.
In one embodiment, as shown in fig. 6d, the apparatus 60 further comprises a second joining module 607.
The second adding module 607 is configured to add the target free buffer to be encoded into a free queue.
The embodiment of the disclosure provides an encoding device, which determines a corresponding preparation queue according to identification information of the preparation queue carried in an acquisition completion event when the acquisition completion event sent by an acquisition end is received, determines a target idle cache region to be encoded from the preparation queue, encodes image data to be transmitted in the target idle cache region to be encoded, and generates a target encoding code stream to complete encoding. Therefore, the acquisition end only needs to send the identification information of the preparation queue to the coding end, the coding end can directly acquire the image data to be transmitted in the target idle buffer area to be coded and code the image data to be transmitted, the acquisition end and the coding end share the target idle buffer area to be coded, the image data to be transmitted does not need to be carried, coding delay caused by carrying the image to be transmitted is avoided, and the image transmission efficiency is improved.
The embodiment of the present disclosure provides an encoding apparatus, which is applied to an acquisition end, as shown in fig. 7, the acquisition end 70 includes an acquisition module 701, a fourth determination module 702, a writing module 703, an adding module 704, and a sending module 705.
The acquisition module 701 is configured to acquire image data to be transmitted.
A fourth determining module 702, configured to determine a target free buffer from the free queue; the free queue includes at least one free buffer.
A writing module 703, configured to write the image data to be transmitted into the target idle buffer.
An adding module 704, configured to add the target free buffer to a preparation queue.
A sending module 705, configured to send an acquisition completion event to the encoding end; and the acquisition completion event carries identification information of the preparation queue, so that the encoding end determines the corresponding preparation queue according to the identification information of the preparation queue, determines a target idle cache region to be encoded from the preparation queue, encodes image data to be transmitted in the target idle cache region to be encoded, and generates a target encoding code stream.
The embodiment of the disclosure provides an encoding device, which determines a corresponding preparation queue according to identification information of the preparation queue carried in an acquisition completion event when the acquisition completion event sent by an acquisition end is received, determines a target idle cache region to be encoded from the preparation queue, encodes image data to be transmitted in the target idle cache region to be encoded, and generates a target encoding code stream to complete encoding. Therefore, the acquisition end only needs to send the identification information of the preparation queue to the coding end, the coding end can directly acquire the image data to be transmitted in the target idle buffer area to be coded and code the image data to be transmitted, the acquisition end and the coding end share the target idle buffer area to be coded, the image data to be transmitted does not need to be carried, coding delay caused by carrying the image to be transmitted is avoided, and the image transmission efficiency is improved.
Based on the encoding method described in the embodiment corresponding to fig. 1, an embodiment of the present disclosure further provides a computer-readable storage medium, for example, the non-transitory computer-readable storage medium may be a Read Only Memory (ROM), a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like. The storage medium stores computer instructions for executing the encoding method described in the embodiment corresponding to fig. 1, which is not described herein again.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.

Claims (10)

1. An encoding method applied to an encoding end, the method comprising:
receiving an acquisition completion event; the acquisition completion event carries identification information of a preparation queue;
determining a corresponding preparation queue according to the identification information of the preparation queue; the preparation queue comprises at least one target free buffer area;
determining a target free buffer area to be coded from the preparation queue;
acquiring the image data to be transmitted from the target idle cache region to be coded;
and coding the image data to be transmitted to generate a target coding code stream.
2. The method of claim 1, wherein when at least two of the target free buffers are included in the preparation queue, the determining a target free buffer to be encoded from the preparation queue comprises:
picking all the target free buffer areas from the preparation queue;
determining a target free buffer zone with the latest joining time of the preparation queue from all the target free buffers;
and determining the target idle buffer zone with the latest time of adding the preparation queue as the target idle buffer zone to be coded.
3. The method of claim 1, further comprising:
and adding target free buffer areas except the target free buffer area to be coded in the preparation queue into a free queue.
4. The method of claim 1, further comprising, after the generating the target encoded codestream:
and adding the target idle buffer area to be coded into an idle queue.
5. An encoding method applied to an acquisition end, the method comprising:
collecting image data to be transmitted;
determining a target idle buffer area from the idle queue; the free queue comprises at least one free buffer area;
writing the image data to be transmitted into the target idle buffer area;
adding the target free buffer area to a preparation queue;
sending an acquisition completion event to the encoding end; and the acquisition completion event carries identification information of the preparation queue, so that the encoding end determines the corresponding preparation queue according to the identification information of the preparation queue, determines a target idle cache region to be encoded from the preparation queue, encodes image data to be transmitted in the target idle cache region to be encoded, and generates a target encoding code stream.
6. An encoding apparatus applied to an encoding side, the apparatus comprising:
the first receiving module is used for receiving an acquisition completion event; the acquisition completion event carries identification information of a preparation queue;
the first determining module is used for determining a corresponding preparation queue according to the identification information of the preparation queue; the preparation queue comprises at least one target free buffer area;
the second determining module is used for determining a target free buffer area to be coded from the preparation queue;
the third determining module is used for acquiring the image data to be transmitted from the target idle cache region to be coded;
and the generating module is used for coding the image data to be transmitted and generating a target coding code stream.
7. The apparatus according to claim 6, wherein when the preparation queue includes at least two target free buffers, the second determining module includes an obtaining sub-module, a first determining sub-module, and a second determining sub-module;
the obtaining submodule is used for picking all the target free buffer areas from the preparation queue;
the first determining submodule is used for determining a target free buffer area with the latest time for joining the preparation queue from all the target free buffers;
and the second determining submodule is used for determining the target idle buffer zone with the latest time of adding the prepared queue as the target idle buffer zone to be coded.
8. The apparatus of claim 6, further comprising:
and the first adding module is used for adding the target free buffer areas except the target free buffer area to be coded in the preparation queue into the free queue.
9. The apparatus of claim 6, further comprising:
and the second adding module is used for adding the target idle buffer area to be coded into an idle queue.
10. An encoding device, applied to an acquisition end, the device comprising:
the acquisition module is used for acquiring image data to be transmitted;
the fourth determining module is used for determining a target free buffer area from the free queue; the free queue comprises at least one free buffer area;
the writing module is used for writing the image data to be transmitted into the target idle cache region;
the adding module is used for adding the target free buffer area to a preparation queue;
the sending module is used for sending an acquisition completion event to the encoding end; and the acquisition completion event carries identification information of the preparation queue, so that the encoding end determines the corresponding preparation queue according to the identification information of the preparation queue, determines a target idle cache region to be encoded from the preparation queue, encodes image data to be transmitted in the target idle cache region to be encoded, and generates a target encoding code stream.
CN202010645197.XA 2020-07-07 2020-07-07 Encoding method and device Pending CN111953990A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010645197.XA CN111953990A (en) 2020-07-07 2020-07-07 Encoding method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010645197.XA CN111953990A (en) 2020-07-07 2020-07-07 Encoding method and device

Publications (1)

Publication Number Publication Date
CN111953990A true CN111953990A (en) 2020-11-17

Family

ID=73341752

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010645197.XA Pending CN111953990A (en) 2020-07-07 2020-07-07 Encoding method and device

Country Status (1)

Country Link
CN (1) CN111953990A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112822494A (en) * 2020-12-30 2021-05-18 稿定(厦门)科技有限公司 Double-buffer coding system and control method thereof
CN115633181A (en) * 2022-12-06 2023-01-20 山东云海国创云计算装备产业创新中心有限公司 Picture processing method, system, device, image compression device and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102045258A (en) * 2010-12-22 2011-05-04 北京星网锐捷网络技术有限公司 Data caching management method and device
CN106507114A (en) * 2016-11-25 2017-03-15 天津津芯微电子科技有限公司 It is based on FPGA method for compressing image, device and Transmission system
CN108391131A (en) * 2018-04-16 2018-08-10 西安万像电子科技有限公司 Image frame coding method and device
CN110264452A (en) * 2019-06-18 2019-09-20 江苏通佑视觉科技有限公司 A kind of workpiece inspection method, device, equipment and storage medium
CN110312156A (en) * 2018-03-27 2019-10-08 腾讯科技(深圳)有限公司 A kind of video cache method, apparatus and readable storage medium storing program for executing
CN111316645A (en) * 2019-04-23 2020-06-19 深圳市大疆创新科技有限公司 Encoder, encoding system and encoding method

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102045258A (en) * 2010-12-22 2011-05-04 北京星网锐捷网络技术有限公司 Data caching management method and device
CN106507114A (en) * 2016-11-25 2017-03-15 天津津芯微电子科技有限公司 It is based on FPGA method for compressing image, device and Transmission system
CN110312156A (en) * 2018-03-27 2019-10-08 腾讯科技(深圳)有限公司 A kind of video cache method, apparatus and readable storage medium storing program for executing
CN108391131A (en) * 2018-04-16 2018-08-10 西安万像电子科技有限公司 Image frame coding method and device
CN111316645A (en) * 2019-04-23 2020-06-19 深圳市大疆创新科技有限公司 Encoder, encoding system and encoding method
CN110264452A (en) * 2019-06-18 2019-09-20 江苏通佑视觉科技有限公司 A kind of workpiece inspection method, device, equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112822494A (en) * 2020-12-30 2021-05-18 稿定(厦门)科技有限公司 Double-buffer coding system and control method thereof
CN115633181A (en) * 2022-12-06 2023-01-20 山东云海国创云计算装备产业创新中心有限公司 Picture processing method, system, device, image compression device and storage medium

Similar Documents

Publication Publication Date Title
US8855414B1 (en) Apparatus and method for encoding an image generated in part by graphical commands
US7899260B2 (en) Method and apparatus for generating thumbnail of digital image
CN109862409B (en) Video decoding method, video playing method, device, system, terminal and storage medium
WO2010004711A1 (en) Image processing apparatus and image pickup apparatus using the image processing apparatus
US20210281911A1 (en) Video enhancement control method, device, electronic device, and storage medium
CN111953990A (en) Encoding method and device
WO2023226915A1 (en) Video transmission method and system, device, and storage medium
JP2009129448A (en) Data processing apparatus, data processing method, and data processing system
CN110187858B (en) Image display method and system
US7751687B2 (en) Data processing apparatus, data processing method, data processing system, program, and storage medium
CN111953992A (en) Decoding method and device
CN108668170B (en) Image information processing method and device, and storage medium
WO2021093882A1 (en) Video meeting method, meeting terminal, server, and storage medium
CN104244000A (en) JPEG picture rapid splicing method and device
CN113613024A (en) Video preprocessing method and device
CN113691815A (en) Video data processing method, device and computer readable storage medium
US6829390B2 (en) Method and apparatus for transmitting image updates employing high compression encoding
US7340101B2 (en) Device and method for compressing and decompressing data for graphics display
JP2003125401A (en) Video data reproducing method
TWI835236B (en) Image processing method and image processing device
TWI835238B (en) Image processing method and image processing device
US20240048734A1 (en) Image processing method and image processing device for enhancing image processing efficiency
WO2022111697A1 (en) Picture loading method, and electronic device, chip and readable storage medium
WO2022110129A1 (en) Video processing method and apparatus, electronic device and storage medium
US20240048740A1 (en) Image processing method and image processing device for enhancing image processing efficiency

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination