CN110933436A - Image encoding method, image encoding device, computer device, and storage medium - Google Patents

Image encoding method, image encoding device, computer device, and storage medium Download PDF

Info

Publication number
CN110933436A
CN110933436A CN201911301556.3A CN201911301556A CN110933436A CN 110933436 A CN110933436 A CN 110933436A CN 201911301556 A CN201911301556 A CN 201911301556A CN 110933436 A CN110933436 A CN 110933436A
Authority
CN
China
Prior art keywords
input sources
image
coding
code stream
height
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
CN201911301556.3A
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.)
Spreadtrum Communications Shanghai Co Ltd
Original Assignee
Spreadtrum Communications Shanghai 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 Spreadtrum Communications Shanghai Co Ltd filed Critical Spreadtrum Communications Shanghai Co Ltd
Priority to CN201911301556.3A priority Critical patent/CN110933436A/en
Publication of CN110933436A publication Critical patent/CN110933436A/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/436Methods 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 using parallelised computational arrangements
    • 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

Abstract

The present disclosure relates to the field of image processing technologies, and in particular, to an image encoding method and apparatus, a computer device, and a storage medium. The method comprises the following steps: dividing image data to be encoded into a plurality of input sources; carrying out parallel independent coding on the plurality of input sources to obtain code streams corresponding to the plurality of input sources respectively; and splicing the code streams corresponding to the plurality of input sources to obtain a target image code stream. The embodiment of the disclosure greatly reduces the time length of image coding and improves the image coding rate by performing parallel independent coding on a plurality of input sources.

Description

Image encoding method, image encoding device, computer device, and storage medium
Technical Field
The present disclosure relates to the field of image processing technologies, and in particular, to an image encoding method and apparatus, a computer device, and a storage medium.
Background
The image encoding process mainly includes Discrete Cosine Transform (DCT) transformation, quantization, encoding, and other processes.
In the related art, in order to increase the image encoding speed, in terms of algorithm, the DCT transform may be replaced by a fast DCT transform (e.g., a butterfly transform), while a table lookup method is employed to reduce the computational complexity.
However, in terms of algorithm, the computational complexity of image coding cannot be further reduced, and the amount of computation required for coding and the amount of input data generally have a positive correlation, that is, the larger the resolution of the input image is, the larger the corresponding coding time is, and the lower the coding efficiency is. At present, a reasonable and effective image coding method is not provided.
Disclosure of Invention
In view of the above, the present disclosure provides an image encoding method, an image encoding apparatus, a computer device, and a storage medium. The technical scheme is as follows:
in an aspect of the disclosed embodiments, there is provided an image encoding method, including:
dividing image data to be encoded into a plurality of input sources;
carrying out parallel independent coding on the plurality of input sources to obtain code streams corresponding to the plurality of input sources respectively;
and splicing the code streams corresponding to the plurality of input sources to obtain a target image code stream.
In a possible implementation manner, the method, for a computer device including a plurality of image coding device nodes, for performing parallel independent coding on a plurality of input sources to obtain code streams corresponding to the plurality of input sources, includes:
and for the plurality of input sources, performing parallel independent coding by adopting the plurality of image coding equipment nodes to obtain code streams corresponding to the plurality of input sources.
In another possible implementation manner, the performing, for the multiple input sources, parallel independent coding by using the multiple image coding device nodes to obtain code streams corresponding to the multiple input sources includes:
for each input source in the plurality of input sources, allocating any one image coding device node of the plurality of image coding device nodes, the current device state of which is an idle state, as an image coding device node corresponding to the input source;
and simultaneously, independently coding the image coding equipment nodes corresponding to the plurality of input sources respectively to obtain code streams corresponding to the plurality of input sources respectively.
In another possible implementation manner, the dividing the image data to be encoded into a plurality of input sources includes:
dividing the image data to be coded according to a Minimum Coded Unit (MCU) alignment mode to obtain a plurality of input sources;
wherein the plurality of input sources comprises n-1 input sources with a first height and one input source with a second height, the first height is the same as or different from the second height, and n is a positive integer greater than 1.
In another possible implementation manner, the first height is an integer multiple of a height of an MCU, the height of the MCU is determined according to a format of the image data to be encoded, the second height is a difference between the height of the image data to be encoded and a sum of heights, and the sum of heights is a sum of n-1 first heights.
In another possible implementation manner, the splicing the code streams corresponding to the multiple input sources to obtain a target image code stream includes:
splicing the code streams corresponding to the plurality of input sources to obtain spliced image code streams;
and modifying a data head in the spliced image code stream according to the width and height information of the image data to be coded to obtain the target image code stream.
In another possible implementation manner, the code stream corresponding to each of the plurality of input sources includes an image start marker, code stream information, and an image end marker, where the code stream information includes a data header and encoding information;
the splicing processing is performed on the code streams corresponding to the plurality of input sources respectively to obtain spliced image code streams, and the splicing processing includes:
acquiring an image start marker and code stream information in a first code stream corresponding to a first input source, wherein the first input source is a first input source in the plurality of input sources;
acquiring coding information in second code streams corresponding to a plurality of second input sources, wherein the plurality of second input sources are other input sources except the first input source;
and splicing the image start marker and the code stream information in the first code stream and the coding information in the plurality of second code streams to obtain the spliced image code stream.
In another aspect of the disclosed embodiments, there is provided an image encoding apparatus, the apparatus including:
a segmentation module for segmenting image data to be encoded into a plurality of input sources;
the encoding module is used for carrying out parallel independent encoding on the plurality of input sources to obtain code streams corresponding to the plurality of input sources;
and the splicing module is used for splicing the code streams corresponding to the plurality of input sources to obtain a target image code stream.
In a possible implementation manner, the encoding module is configured to perform parallel independent encoding on the plurality of input sources by using the plurality of image encoding device nodes to obtain code streams corresponding to the plurality of input sources, where the encoding module is used in a computer device including a plurality of image encoding device nodes.
In another possible implementation manner, the encoding module is further configured to, for each of the plurality of input sources, allocate any one of the plurality of image encoding device nodes whose current device state is an idle state as an image encoding device node corresponding to the input source; and simultaneously, independently coding the image coding equipment nodes corresponding to the plurality of input sources respectively to obtain code streams corresponding to the plurality of input sources respectively.
In another possible implementation manner, the segmentation module is further configured to segment the image data to be encoded according to an MCU alignment manner to obtain the plurality of input sources;
wherein the plurality of input sources comprises n-1 input sources with a first height and one input source with a second height, the first height is the same as or different from the second height, and n is a positive integer greater than 1.
In another possible implementation manner, the first height is an integer multiple of a height of an MCU, the height of the MCU is determined according to a format of the image data to be encoded, the second height is a difference between the height of the image data to be encoded and a sum of heights, and the sum of heights is a sum of n-1 first heights.
In another possible implementation manner, the splicing module is further configured to splice the code streams corresponding to the multiple input sources, so as to obtain a spliced image code stream; and modifying a data head in the spliced image code stream according to the width and height information of the image data to be coded to obtain the target image code stream.
In another possible implementation manner, the code stream corresponding to each of the plurality of input sources includes an image start marker, code stream information, and an image end marker, where the code stream information includes a data header and encoding information;
the splicing module is further configured to:
acquiring an image start marker and code stream information in a first code stream corresponding to a first input source, wherein the first input source is a first input source in the plurality of input sources;
acquiring coding information in second code streams corresponding to a plurality of second input sources, wherein the plurality of second input sources are other input sources except the first input source;
and splicing the image start marker and the code stream information in the first code stream and the coding information in the plurality of second code streams to obtain the spliced image code stream.
In another aspect of the disclosed embodiments, a computer device is provided, which includes:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to:
dividing image data to be encoded into a plurality of input sources;
carrying out parallel independent coding on the plurality of input sources to obtain code streams corresponding to the plurality of input sources respectively;
and splicing the code streams corresponding to the plurality of input sources to obtain a target image code stream.
In another aspect of the embodiments of the present disclosure, a non-transitory computer-readable storage medium is provided, on which computer program instructions are stored, wherein the computer program instructions, when executed by a processor, implement the above-mentioned method.
The disclosed embodiments divide image data to be encoded into a plurality of input sources; carrying out parallel independent coding on a plurality of input sources to obtain code streams corresponding to the plurality of input sources respectively; splicing the code streams corresponding to the multiple input sources to obtain a target image code stream; because the code streams corresponding to the plurality of input sources are obtained by parallel independent coding, the time length of image coding is greatly reduced, and the image coding rate is improved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate exemplary embodiments, features, and aspects of the disclosure and, together with the description, serve to explain the principles of the disclosure.
FIG. 1 shows a schematic diagram of a computer device 10 to which embodiments of the present disclosure relate;
FIG. 2 illustrates a flowchart of an image encoding method provided by an exemplary embodiment of the present disclosure;
fig. 3 illustrates a flowchart of an image encoding method provided by another exemplary embodiment of the present disclosure;
fig. 4 is a schematic diagram illustrating a target image related to an image encoding method according to an exemplary embodiment of the present disclosure;
fig. 5 is a schematic diagram illustrating a parallel encoding process involved in an image encoding method according to an exemplary embodiment of the present disclosure;
FIG. 6 is a schematic diagram illustrating a principle that an image encoding method according to an exemplary embodiment of the present disclosure involves a code stream splicing process;
fig. 7 is a schematic structural diagram illustrating an image encoding apparatus according to an exemplary embodiment of the present disclosure.
Detailed Description
Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. In the drawings, like reference numbers can indicate functionally identical or similar elements. While the various aspects of the embodiments are presented in drawings, the drawings are not necessarily drawn to scale unless specifically indicated.
The word "exemplary" is used exclusively herein to mean "serving as an example, embodiment, or illustration. Any embodiment described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments.
Furthermore, in the following detailed description, numerous specific details are set forth in order to provide a better understanding of the present disclosure. It will be understood by those skilled in the art that the present disclosure may be practiced without some of these specific details. In some instances, methods, means, elements and circuits that are well known to those skilled in the art have not been described in detail so as not to obscure the present disclosure.
There is no reasonable and effective image coding method for reducing coding efficiency. Accordingly, the present disclosure provides an image encoding method, apparatus, terminal and storage medium to solve the above-mentioned problems in the related art. In the technical scheme provided by the disclosure, the image data to be coded is divided into a plurality of input sources; carrying out parallel independent coding on a plurality of input sources to obtain code streams corresponding to the plurality of input sources respectively; splicing the code streams corresponding to the multiple input sources to obtain a target image code stream; because the code streams corresponding to the plurality of input sources are obtained by parallel independent coding, the time length of image coding is greatly reduced, and the image coding rate is improved.
Before explaining the embodiments of the present disclosure, an application scenario of the embodiments of the present disclosure is explained. Referring to fig. 1, a schematic diagram of a computer device 10 according to an embodiment of the present disclosure is shown.
The computer device 10 includes a plurality of image encoding device nodes 12. The computer device 10 may also include a plurality of output buffers 14 and buffers 16.
As shown in FIG. 1, the computer device 10 includes N image encoding device nodes 12 (including a JPG)0、JPG1、JPG2……JPGN-2、JPGN-1) N output buffers 14 (including B)0、B1、B2……BN-2、BN-1) 1 buffer 16. Wherein N is a positive integer greater than 1.
The image coding device node 12 is a hardware device, for example, the image coding device node 12 is a Joint Photographic Experts Group (JPEG) device node.
The multiple image coding device nodes 12 are configured to perform parallel independent coding on multiple input sources to obtain code streams corresponding to the multiple input sources. That is, each image encoding device node 12 in the plurality of image encoding device nodes 12 is configured to independently encode one input source to obtain a code stream corresponding to the input source.
Note that the plurality of image coding apparatus nodes 12 do not affect each other.
The output buffer 14 is used for storing the compressed code stream. The buffer 16 is used for storing the spliced output code stream.
Optionally, there is a one-to-one correspondence between the image coding device node 12 and the output cache 14. The output buffer 14 is used for storing the code stream compressed by the corresponding image coding device node 12.
Illustratively, an image encoding device node 12 is configured to independently encode an input source to obtain a code stream corresponding to the input source, and an output cache 14 corresponding to the image encoding device node 12 is configured to store the code stream corresponding to the input source. After the code streams corresponding to the multiple input sources are spliced to obtain the target image code stream, the buffer 16 is used for storing the spliced target image code stream.
The computer device 10 is a device having an image encoding function. The computer device 10 may be a mobile phone, a tablet computer, an e-book reader, an MP3(Moving Picture Experts Group Audio Layer III) player, an MP4(Moving Picture Experts Group Audio Layer iv) player, a laptop, a desktop computer, or the like. This embodiment is not limited thereto.
In the following, some exemplary embodiments are used to describe the image encoding method provided by the present disclosure.
Referring to fig. 2, a flowchart of an image encoding method according to an exemplary embodiment of the disclosure is shown. The disclosed embodiment is exemplified in the case where the image encoding method is applied to the computer apparatus 10 shown in fig. 1. The image encoding method includes:
step 201, image data to be encoded is divided into a plurality of input sources.
The computer device acquires image data to be encoded, and divides the image data to be encoded into a plurality of input sources.
The combination of the plurality of divided input sources is image data to be encoded. The sum of the heights corresponding to the plurality of input sources is equal to the height of the image data to be encoded.
Step 202, performing parallel independent coding on the plurality of input sources to obtain code streams corresponding to the plurality of input sources.
And the computer equipment carries out parallel independent coding on the plurality of input sources to obtain code streams corresponding to the plurality of input sources respectively. The computer equipment carries out multichannel parallel independent coding on a plurality of input sources to obtain code streams corresponding to the plurality of input sources respectively.
Optionally, the parallel independent encoding is used to instruct each of the plurality of input sources to be independently encoded in a parallel processing manner. That is, the computer device independently encodes each input source of the multiple input sources in a parallel processing manner to obtain a code stream corresponding to the input source.
Optionally, the parallel independent coding is used to instruct that the multiple input sources are independently coded at the same time to obtain respective corresponding code streams. That is, the computer device independently encodes a plurality of input sources at the same time to obtain respective corresponding code streams.
And 203, splicing the code streams corresponding to the multiple input sources to obtain a target image code stream.
Optionally, the computer device splices the code streams corresponding to the multiple input sources to obtain a target image code stream corresponding to the image data to be encoded.
In summary, the embodiments of the present disclosure divide image data to be encoded into a plurality of input sources; carrying out parallel independent coding on a plurality of input sources to obtain code streams corresponding to the plurality of input sources respectively; splicing the code streams corresponding to the multiple input sources to obtain a target image code stream; because the code streams corresponding to the plurality of input sources are obtained by parallel independent coding, the time length of image coding is greatly reduced, and the image coding rate is improved.
Referring to fig. 3, a flowchart of an image encoding method according to another exemplary embodiment of the present disclosure is shown. The disclosed embodiment is exemplified in the case where the image encoding method is applied to the computer apparatus 10 shown in fig. 1. The image encoding method includes:
step 301, segmenting image data to be encoded according to an MCU alignment mode to obtain a plurality of input sources.
The computer equipment acquires image data to be coded corresponding to a target image, and divides the image data to be coded according to the MCU alignment mode to obtain a plurality of input sources. The plurality of input sources comprise n-1 input sources with a first height and one input source with a second height, the first height is the same as or different from the second height, and n is a positive integer larger than 1.
Optionally, the first height is an integer multiple of the height of the MCU, the second height is a difference between the height of the image data to be encoded and a sum of the heights, and the sum of the heights is a sum of n-1 first heights.
Wherein the height of the MCU is determined according to the format of the image data to be encoded. Optionally, the computer device obtains a format of image data to be encoded; and acquiring the height of the MCU corresponding to the format of the image data according to a preset corresponding relation, wherein the preset corresponding relation comprises the corresponding relation between the format of the image data and the height of the MCU.
Illustratively, when the format of the image data to be coded is a first data format, the height of the corresponding MCU is a first designated height; and when the format of the image data to be coded is a second data format, the height of the corresponding MCU is a second specified height, and the second specified height is different from the first specified height.
For example, the preset correspondence includes: when the format of the image data to be coded is the yuv420 format, the height of the corresponding MCU is 16; when the format of the image data to be encoded is the yuv422 format, the height of the corresponding MCU is 8. The present embodiment does not limit the setting manner of the preset correspondence relationship.
And the computer equipment calculates the heights corresponding to the multiple input sources according to the height of the image data to be coded, the height of the MCU and the total number of nodes of the image coding equipment, and divides the image data to be coded into the multiple input sources according to the heights corresponding to the multiple input sources.
Optionally, the calculating, by the computer device, heights corresponding to the plurality of input sources respectively includes: and the computer equipment calculates the total line number of the MCU included in the image data to be coded according to the height of the image data to be coded and the height of the MCU. And the computer equipment calculates the number of the image coding equipment nodes required to be used according to the total line number of the MCU and the total number of the image coding equipment nodes. And the computer equipment calculates to obtain the heights corresponding to the input sources according to the total line number of the MCU and the number of the image coding equipment nodes required to be used.
In one possible implementation, the computer device is based on the height of the image data to be encodedAnd the height of the MCU, and the total row number row of the MCU included in the image data to be coded is calculated and obtained through the following formulamcu
Figure BDA0002321916450000101
Where H is the height of the image data to be encoded, HmcuThe height of the MCU is determined according to the format of the image data to be encoded.
In a possible implementation manner, the computer device obtains the number n of the image coding device nodes to be used by calculating according to the following formula, based on the total number of rows of the MCUs and the total number of the image coding device nodes:
Figure BDA0002321916450000102
wherein rowmcuThe total number of MCU included in the image data to be coded, N is the total number of image coding device nodes in the computer device.
That is, the computer device determines whether the total row number of the MCUs is smaller than the total number of the image coding device nodes, and if the total row number of the MCUs is smaller than the total number of the image coding device nodes, it is determined that the number of the image coding device nodes to be used is equal to the total row number of the MCUs; and if the total row number of the MCUs is larger than or equal to the total number of the image coding device nodes, determining that the number of the image coding device nodes needing to be used is equal to the total number of the image coding device nodes.
In a possible implementation manner, the computer device calculates, according to the total number of rows of the MCU and the number of nodes of the image coding device that need to be used, the heights corresponding to the plurality of input sources by using the following formula:
Figure BDA0002321916450000103
wherein rowmcuThe total number of MCU lines included for the image data to be encoded, and n is the image encoding apparatus to be usedNumber of nodes, HmcuIs the height of the MCU, H is the height of the image data to be encoded, HiIs the height corresponding to the i +1 th input source, h0And i is the height corresponding to the 1 st input source, i is an integer, and the value range of i is 0 to n-1.
Optionally, the computer device obtains the first height h according to the calculation0And a second height hn-1Dividing image data to be coded to obtain a plurality of input sources, wherein the plurality of input sources comprise n-1 image data with a first height h0And an input source having a second height hn-1The input source of (1).
And 302, for a plurality of input sources, performing parallel independent coding by adopting a plurality of image coding equipment nodes to obtain code streams corresponding to the plurality of input sources.
Optionally, for each input source of the multiple input sources, the computer device allocates any image coding device node, of the multiple image coding device nodes, whose current device state is an idle state, as an image coding device node corresponding to the input source; and simultaneously, independently coding the image coding equipment nodes corresponding to the plurality of input sources respectively to obtain code streams corresponding to the plurality of input sources respectively.
The computer equipment inputs each input source in a plurality of input sources into a corresponding image coding equipment node in a parallel processing mode, independently codes the input source through the image coding equipment stage, and outputs to obtain a code stream corresponding to the input source.
The image coding device node corresponding to the input source is any one of the image coding device nodes with the current device state being an idle state.
Optionally, the device state of the image encoding device node includes one of an operating state and an idle state. The working state is used for indicating that the image coding device node is processing data and indicating that the image coding device node is unavailable; the idle state is used to indicate that the image coding device node is not working and no data needs to be processed, indicating that the image coding device node is available.
Optionally, for each input source of the multiple input sources, the computer device randomly determines an image coding device node whose current device state is an idle state, and independently codes the input source by using the determined image coding device node to obtain a corresponding code stream.
And 303, splicing the code streams corresponding to the multiple input sources to obtain a target image code stream.
Optionally, the code streams corresponding to the multiple input sources of the computer device are spliced to obtain the target image code stream, including: splicing the code streams corresponding to the multiple input sources to obtain spliced image code streams; and modifying a data head in the spliced image code stream according to the width and height information of the image data to be coded to obtain a target image code stream.
Optionally, the code stream corresponding to each of the plurality of input sources includes a Start of image marker (SOI), code stream information, and an End of image marker (EOI), where the code stream information includes a data header and encoding information.
Optionally, the code stream information is also called Frame information (english: Frame). The frame information includes frame header information (english: Frameheader) and at least one scan information (english: scan), and the frame header information is a data header. Each scan information includes header information (english: scan header) and encoding information. The coding information includes coding information of all MCUs in the scanning information. Illustratively, the encoded information is an Entropy-encoded segment (ECS).
In a frame message, at least one table specification (table-specification) and/or other flag segment information may be further included in front of the header information of the frame message.
The computer equipment splices the code streams corresponding to the multiple input sources respectively to obtain spliced image code streams, and the method comprises the following steps: acquiring an image start marker and code stream information in a first code stream corresponding to a first input source, wherein the first input source is a first input source in a plurality of input sources; acquiring coding information in second code streams corresponding to a plurality of second input sources, wherein the plurality of second input sources are other input sources except for the first input source in the plurality of input sources; and splicing the image start marker in the first code stream, the code stream information and the coding information in the second code streams to obtain a spliced image code stream.
Optionally, the computer device splices the image start marker and the code stream information in the first code stream and the coding information in the plurality of second code streams to obtain a spliced image code stream, including: and the computer equipment reserves the image start marker and the code stream information in the first code stream, and splices the entropy coding section in the first code stream and the entropy coding sections in the plurality of second code streams to obtain the spliced image code stream.
Optionally, a reset flag bit is included between two consecutive pieces of coding information in the spliced image code stream, and the reset flag bit is used to indicate whether coding is restarted. Illustratively, when the reset flag bit is a first value, which indicates that the encoding is restarted, the two consecutive encoded messages are independent and have no reference relationship with each other. When the reset flag bit is a second value, the reset flag bit is used for indicating that the coding is not restarted, and the two continuous coding information are not independent and have a reference relation with each other. For example, the first value is 1 and the second value is 0.
In one illustrative example, based on a target image 41 as shown in FIG. 4, a computer device obtains image data corresponding to the target image 41. As shown in fig. 5, the computer device divides the image data corresponding to the target image 41 into n input sources 51 according to the MCU alignment method, and for the n input sources 51, n image coding device nodes (including JPG) are used0、JPG1……JPGl-2、JPGl-1……JPGn-2、JPGn-1) Parallel independent coding is carried out to obtain code streams (including bs) corresponding to n input sources0、bs1……bsl-2、bsl-1……bsn-2、bsn-1). Wherein l and n are both positive integers. As shown in fig. 6, the computer device acquires the stream bs corresponding to each of the n input sources 510To bsn-1Then, the first input source corresponds to the second input sourceOne code stream bs0The data structure of (1) includes: the image start marker "SOI", the Frame information "Frame", and the image end marker "EOI". When splicing, reserving the first code stream bs0The SOI and the Frame of (1), wherein the Frame includes Frame header information "Frame header" and scan information "scan". In a Frame, the Frame header may also be preceded by at least one Table specification or other tagged segment information "Table/misc. Wherein, the first code stream bs0The scan of (2) comprises scan head information ' scan header ' and entropy coding section ' ECS0”,ECS0Comprises k MCUs (including MCU)0、MCU1……MCUk-1) Wherein k is a positive integer. The computer equipment extracts entropy coding sections (including ECS) in second code streams corresponding to the second input sources respectively1、ECS2……ECSn-1). The first code stream bs0And multiple ECS (entropy coding section) in the second code stream1、ECS2……ECSn-1And splicing, wherein a reset flag bit RST is included between two continuous entropy coding sections, the RST is set to be 1, the RST is used for indicating that coding is restarted, and two continuous coding information are independent, namely, no reference relation exists, so that the spliced image code stream is obtained. And the computer equipment modifies the numerical value of the Frame header in the spliced image code stream according to the width and height information of the image data of the target image 41 to obtain a target image code stream 61.
To sum up, the embodiment of the present disclosure further provides a computer device including a plurality of image coding device nodes, so that after the computer device divides image data into a plurality of input sources, for the plurality of input sources, the plurality of image coding device nodes can be adopted to perform parallel independent coding, so as to obtain code streams corresponding to the plurality of input sources, thereby implementing multi-channel parallel coding, and further improving flexibility and coding rate of image coding.
The following are embodiments of the apparatus of the embodiments of the present disclosure, and for portions of the embodiments of the apparatus not described in detail, reference may be made to technical details disclosed in the above-mentioned method embodiments.
Referring to fig. 7, a schematic structural diagram of an image encoding apparatus according to an exemplary embodiment of the disclosure is shown. The image encoding apparatus may be implemented as all or a part of a computer device by software, hardware, or a combination of both. The image encoding device includes: a segmentation module 710, an encoding module 720, and a concatenation module 730.
A segmentation module 710 for segmenting image data to be encoded into a plurality of input sources;
the encoding module 720 is configured to perform parallel independent encoding on the multiple input sources to obtain code streams corresponding to the multiple input sources;
and the splicing module 730 is configured to splice the code streams corresponding to the multiple input sources to obtain a target image code stream.
In a possible implementation manner, the encoding module 720 is configured to perform parallel independent encoding on a plurality of input sources by using a plurality of image encoding device nodes to obtain code streams corresponding to the plurality of input sources, where the encoding module is used in a computer device including a plurality of image encoding device nodes.
In another possible implementation manner, the encoding module 720 is further configured to, for each input source of the multiple input sources, allocate any one image encoding device node of the multiple image encoding device nodes whose current device state is an idle state as an image encoding device node corresponding to the input source; and simultaneously, independently coding the image coding equipment nodes corresponding to the plurality of input sources respectively to obtain code streams corresponding to the plurality of input sources respectively.
In another possible implementation manner, the segmentation module 710 is further configured to segment the image data to be encoded according to an MCU alignment manner to obtain a plurality of input sources;
the plurality of input sources comprise n-1 input sources with a first height and one input source with a second height, the first height is the same as or different from the second height, and n is a positive integer larger than 1.
In another possible implementation manner, the first height is an integer multiple of the height of the MCU, the height of the MCU is determined according to the format of the image data to be encoded, the second height is the difference between the height of the image data to be encoded and the sum of the heights, and the sum of the heights is the sum of n-1 first heights.
In another possible implementation manner, the splicing module 730 is further configured to splice code streams corresponding to multiple input sources, to obtain spliced image code streams; and modifying a data head in the spliced image code stream according to the width and height information of the image data to be coded to obtain a target image code stream.
In another possible implementation manner, the code stream corresponding to each of the plurality of input sources includes an image start marker, code stream information, and an image end marker, and the code stream information includes a data header and encoding information;
the splicing module 730 is further configured to:
acquiring an image start marker and code stream information in a first code stream corresponding to a first input source, wherein the first input source is a first input source in a plurality of input sources;
acquiring coding information in second code streams corresponding to a plurality of second input sources, wherein the plurality of second input sources are other input sources except for the first input source in the plurality of input sources;
and splicing the image start marker in the first code stream, the code stream information and the coding information in the second code streams to obtain a spliced image code stream.
It should be noted that, when the apparatus provided in the foregoing embodiment implements the functions thereof, only the division of the above functional modules is illustrated, and in practical applications, the above functions may be distributed by different functional modules according to actual needs, that is, the content structure of the device is divided into different functional modules, so as to complete all or part of the functions described above.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
An embodiment of the present disclosure further provides a computer device, where the computer device includes: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to perform the steps performed by the computer device in the above-described method embodiments.
The disclosed embodiments also provide a non-transitory computer-readable storage medium, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the computer program instructions implement the steps executed by the computer device in the above method embodiments.
The present disclosure may be systems, methods, and/or computer program products. The computer program product may include a computer-readable storage medium having computer-readable program instructions embodied thereon for causing a processor to implement various aspects of the present disclosure.
The computer readable storage medium may be a tangible device that can hold and store the instructions for use by the instruction execution device. The computer readable storage medium may be, for example, but not limited to, an electronic memory device, a magnetic memory device, an optical memory device, an electromagnetic memory device, a semiconductor memory device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a Static Random Access Memory (SRAM), a portable compact disc read-only memory (CD-ROM), a Digital Versatile Disc (DVD), a memory stick, a floppy disk, a mechanical coding device, such as punch cards or in-groove projection structures having instructions stored thereon, and any suitable combination of the foregoing. Computer-readable storage media as used herein is not to be construed as transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission medium (e.g., optical pulses through a fiber optic cable), or electrical signals transmitted through electrical wires.
The computer-readable program instructions described herein may be downloaded from a computer-readable storage medium to a respective computing/processing device, or to an external computer or external storage device via a network, such as the internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers and/or edge servers. The network adapter card or network interface in each computing/processing device receives computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in the respective computing/processing device.
The computer program instructions for carrying out operations of the present disclosure may be assembler instructions, Instruction Set Architecture (ISA) instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider). In some embodiments, the electronic circuitry that can execute the computer-readable program instructions implements aspects of the present disclosure by utilizing the state information of the computer-readable program instructions to personalize the electronic circuitry, such as a programmable logic circuit, a Field Programmable Gate Array (FPGA), or a Programmable Logic Array (PLA).
Various aspects of the present disclosure are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the disclosure. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions.
These computer-readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer-readable program instructions may also be stored in a computer-readable storage medium that can direct a computer, programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer-readable medium storing the instructions comprises an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer, other programmable apparatus or other devices implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
Having described embodiments of the present disclosure, the foregoing description is intended to be exemplary, not exhaustive, and not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terms used herein were chosen in order to best explain the principles of the embodiments, the practical application, or technical improvements to the techniques in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein.

Claims (10)

1. An image encoding method, characterized in that the method comprises:
dividing image data to be encoded into a plurality of input sources;
carrying out parallel independent coding on the plurality of input sources to obtain code streams corresponding to the plurality of input sources respectively;
and splicing the code streams corresponding to the plurality of input sources to obtain a target image code stream.
2. The method according to claim 1, wherein the method, when applied to a computer device including a plurality of image coding device nodes, for performing parallel independent coding on the plurality of input sources to obtain code streams corresponding to the plurality of input sources, comprises:
and for the plurality of input sources, performing parallel independent coding by adopting the plurality of image coding equipment nodes to obtain code streams corresponding to the plurality of input sources.
3. The method according to claim 2, wherein the performing parallel independent coding on the plurality of input sources by using the plurality of image coding device nodes to obtain code streams corresponding to the plurality of input sources comprises:
for each input source in the plurality of input sources, allocating any one image coding device node of the plurality of image coding device nodes, the current device state of which is an idle state, as an image coding device node corresponding to the input source;
and simultaneously, independently coding the image coding equipment nodes corresponding to the plurality of input sources respectively to obtain code streams corresponding to the plurality of input sources respectively.
4. The method of claim 1, wherein the segmenting the image data to be encoded into a plurality of input sources comprises:
dividing the image data to be coded according to a minimum coding unit MCU alignment mode to obtain a plurality of input sources;
wherein the plurality of input sources comprises n-1 input sources with a first height and one input source with a second height, the first height is the same as or different from the second height, and n is a positive integer greater than 1.
5. The method according to claim 4, wherein the first height is an integer multiple of a height of an MCU, the height of the MCU being determined according to a format of the image data to be encoded, the second height is a difference between the height of the image data to be encoded and a sum of heights, the sum of heights being a sum of n-1 of the first heights.
6. The method according to claim 1, wherein the splicing the code streams corresponding to the plurality of input sources to obtain a target image code stream comprises:
splicing the code streams corresponding to the plurality of input sources to obtain spliced image code streams;
and modifying a data head in the spliced image code stream according to the width and height information of the image data to be coded to obtain the target image code stream.
7. The method according to claim 6, wherein the code stream corresponding to each of the plurality of input sources includes a picture start marker, code stream information and a picture end marker, and the code stream information includes a data header and encoding information;
the splicing processing is performed on the code streams corresponding to the plurality of input sources respectively to obtain spliced image code streams, and the splicing processing includes:
acquiring an image start marker and code stream information in a first code stream corresponding to a first input source, wherein the first input source is a first input source in the plurality of input sources;
acquiring coding information in second code streams corresponding to a plurality of second input sources, wherein the plurality of second input sources are other input sources except the first input source;
and splicing the image start marker and the code stream information in the first code stream and the coding information in the plurality of second code streams to obtain the spliced image code stream.
8. An image encoding apparatus, characterized in that the apparatus comprises:
a segmentation module for segmenting image data to be encoded into a plurality of input sources;
the encoding module is used for carrying out parallel independent encoding on the plurality of input sources to obtain code streams corresponding to the plurality of input sources;
and the splicing module is used for splicing the code streams corresponding to the plurality of input sources to obtain a target image code stream.
9. A computer device, characterized in that the computer device comprises:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to:
dividing image data to be encoded into a plurality of input sources;
carrying out parallel independent coding on the plurality of input sources to obtain code streams corresponding to the plurality of input sources respectively;
and splicing the code streams corresponding to the plurality of input sources to obtain a target image code stream.
10. A non-transitory computer readable storage medium having computer program instructions stored thereon, wherein the computer program instructions, when executed by a processor, implement the method of any of claims 1 to 7.
CN201911301556.3A 2019-12-17 2019-12-17 Image encoding method, image encoding device, computer device, and storage medium Pending CN110933436A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911301556.3A CN110933436A (en) 2019-12-17 2019-12-17 Image encoding method, image encoding device, computer device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911301556.3A CN110933436A (en) 2019-12-17 2019-12-17 Image encoding method, image encoding device, computer device, and storage medium

Publications (1)

Publication Number Publication Date
CN110933436A true CN110933436A (en) 2020-03-27

Family

ID=69864010

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911301556.3A Pending CN110933436A (en) 2019-12-17 2019-12-17 Image encoding method, image encoding device, computer device, and storage medium

Country Status (1)

Country Link
CN (1) CN110933436A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112087636A (en) * 2020-08-07 2020-12-15 北京博雅慧视智能技术研究院有限公司 Image coding processing method and device, storage medium and terminal
CN113658283A (en) * 2021-08-18 2021-11-16 北京达佳互联信息技术有限公司 Image processing method, image processing device, electronic equipment and storage medium
WO2024021772A1 (en) * 2022-07-29 2024-02-01 腾讯科技(深圳)有限公司 Live streaming media data processing method, system and apparatus, and computer device

Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1318950A (en) * 2000-03-30 2001-10-24 索尼公司 Picture coding device and method, camera, video recorder and graphic transmission device
CN101282478A (en) * 2008-04-24 2008-10-08 上海华平信息技术股份有限公司 Method and system for implementing parallel encoding of high-definition video
CN101404770A (en) * 2008-11-13 2009-04-08 杭州华三通信技术有限公司 Video encoding method and system
CN102752600A (en) * 2012-07-13 2012-10-24 航天恒星科技有限公司 Realizing method for reducing time delay of image transmission system
CN103778631A (en) * 2014-01-16 2014-05-07 西安理工大学 Picture segmentation method based on JPEG document flow
CN104125461A (en) * 2013-04-27 2014-10-29 深圳市振华微电子有限公司 Large-size image compression processing system and method
CN104244000A (en) * 2014-09-19 2014-12-24 浙江宇视科技有限公司 JPEG picture rapid splicing method and device
CN105472371A (en) * 2016-01-13 2016-04-06 腾讯科技(深圳)有限公司 Video code stream processing method and device
JP2017195477A (en) * 2016-04-19 2017-10-26 キヤノン株式会社 Image processing device and image processing method
KR20180107671A (en) * 2017-03-22 2018-10-02 한국전자통신연구원 Synchronizing method for a plurality of video encoders
CN108769698A (en) * 2012-09-26 2018-11-06 威勒斯媒体国际有限公司 Picture decoding method, image encoding method, picture decoding apparatus, picture coding device and arrangement for encoding
CN108833932A (en) * 2018-07-19 2018-11-16 湖南君瀚信息技术有限公司 A kind of method and system for realizing the ultralow delay encoding and decoding of HD video and transmission
CN109862357A (en) * 2019-01-09 2019-06-07 深圳威尔视觉传媒有限公司 Cloud game image encoding method, device, equipment and the storage medium of low latency
CN110121072A (en) * 2018-02-06 2019-08-13 Arm有限公司 Data array is encoded

Patent Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1318950A (en) * 2000-03-30 2001-10-24 索尼公司 Picture coding device and method, camera, video recorder and graphic transmission device
CN101282478A (en) * 2008-04-24 2008-10-08 上海华平信息技术股份有限公司 Method and system for implementing parallel encoding of high-definition video
CN101404770A (en) * 2008-11-13 2009-04-08 杭州华三通信技术有限公司 Video encoding method and system
CN102752600A (en) * 2012-07-13 2012-10-24 航天恒星科技有限公司 Realizing method for reducing time delay of image transmission system
CN108769698A (en) * 2012-09-26 2018-11-06 威勒斯媒体国际有限公司 Picture decoding method, image encoding method, picture decoding apparatus, picture coding device and arrangement for encoding
CN104125461A (en) * 2013-04-27 2014-10-29 深圳市振华微电子有限公司 Large-size image compression processing system and method
CN103778631A (en) * 2014-01-16 2014-05-07 西安理工大学 Picture segmentation method based on JPEG document flow
CN104244000A (en) * 2014-09-19 2014-12-24 浙江宇视科技有限公司 JPEG picture rapid splicing method and device
CN105472371A (en) * 2016-01-13 2016-04-06 腾讯科技(深圳)有限公司 Video code stream processing method and device
JP2017195477A (en) * 2016-04-19 2017-10-26 キヤノン株式会社 Image processing device and image processing method
KR20180107671A (en) * 2017-03-22 2018-10-02 한국전자통신연구원 Synchronizing method for a plurality of video encoders
CN110121072A (en) * 2018-02-06 2019-08-13 Arm有限公司 Data array is encoded
CN108833932A (en) * 2018-07-19 2018-11-16 湖南君瀚信息技术有限公司 A kind of method and system for realizing the ultralow delay encoding and decoding of HD video and transmission
CN109862357A (en) * 2019-01-09 2019-06-07 深圳威尔视觉传媒有限公司 Cloud game image encoding method, device, equipment and the storage medium of low latency

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112087636A (en) * 2020-08-07 2020-12-15 北京博雅慧视智能技术研究院有限公司 Image coding processing method and device, storage medium and terminal
CN112087636B (en) * 2020-08-07 2022-01-11 北京博雅慧视智能技术研究院有限公司 Image coding processing method and device, storage medium and terminal
CN113658283A (en) * 2021-08-18 2021-11-16 北京达佳互联信息技术有限公司 Image processing method, image processing device, electronic equipment and storage medium
CN113658283B (en) * 2021-08-18 2023-11-28 北京达佳互联信息技术有限公司 Image processing method, device, electronic equipment and storage medium
WO2024021772A1 (en) * 2022-07-29 2024-02-01 腾讯科技(深圳)有限公司 Live streaming media data processing method, system and apparatus, and computer device

Similar Documents

Publication Publication Date Title
TWI666926B (en) Block partitioning using tree structures
US11475604B2 (en) Method and apparatus for adaptive point cloud attribute coding
CN110933436A (en) Image encoding method, image encoding device, computer device, and storage medium
US20170180746A1 (en) Video transcoding method and electronic apparatus
EP3509305A1 (en) Intra-prediction video coding method and device
CN113014936B (en) Video frame insertion method, device, equipment and storage medium
CN111263243B (en) Video coding method and device, computer readable medium and electronic equipment
Masmoudi et al. A new arithmetic coding model for a block-based lossless image compression based on exploiting inter-block correlation
JP2018522467A (en) Image encoding method, image decoding method, encoding device, and decoding device
CN114339248A (en) Video transcoding and video display method and device and electronic equipment
JP5779116B2 (en) Image coding method, image coding apparatus, and image coding program
US11245914B2 (en) Method and system for hybrid video coding
JPWO2012160626A1 (en) Image compression apparatus, image restoration apparatus, and program
CN110287977B (en) Content clustering method and device
US11729349B2 (en) Method, electronic device, and computer program product for video processing
KR20200094363A (en) Method and system for improving compression ratio through pixel conversion of image file
KR102467816B1 (en) Extension of the mpeg/sc3dmc standard to polygon meshes
US10148965B2 (en) Moving image coding apparatus and moving image coding method
CN110809158B (en) Image loop filtering processing method and device
CN107277650B (en) Video file cutting method and device
CN112437312B (en) Video decoding method, encoding method, device, equipment and storage medium
US10585626B2 (en) Management of non-universal and universal encoders
CN115190295B (en) Video frame processing method, device, equipment and storage medium
CN113824960B (en) Video encoding method, video encoding device, computer readable medium and electronic equipment
CN113744744B (en) Audio coding method, device, electronic equipment and storage medium

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20200327

RJ01 Rejection of invention patent application after publication