CN111556315A - Data transmission method and device - Google Patents

Data transmission method and device Download PDF

Info

Publication number
CN111556315A
CN111556315A CN202010266849.9A CN202010266849A CN111556315A CN 111556315 A CN111556315 A CN 111556315A CN 202010266849 A CN202010266849 A CN 202010266849A CN 111556315 A CN111556315 A CN 111556315A
Authority
CN
China
Prior art keywords
layer
target
code stream
frame image
layers
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
CN202010266849.9A
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 CN202010266849.9A priority Critical patent/CN111556315A/en
Publication of CN111556315A publication Critical patent/CN111556315A/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/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N1/00Scanning, transmission or reproduction of documents or the like, e.g. facsimile transmission; Details thereof
    • H04N1/00095Systems or arrangements for the transmission of the picture signal
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N1/00Scanning, transmission or reproduction of documents or the like, e.g. facsimile transmission; Details thereof
    • H04N1/41Bandwidth or redundancy reduction
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/124Quantisation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/30Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using hierarchical techniques, e.g. scalability
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/60Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
    • H04N19/625Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding using discrete cosine transform [DCT]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/90Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using coding techniques not provided for in groups H04N19/10-H04N19/85, e.g. fractals
    • H04N19/91Entropy coding, e.g. variable length coding [VLC] or arithmetic coding

Abstract

The disclosure provides a data transmission method and a data transmission device, relates to the technical field of electronic information, and can solve the problem of low data processing efficiency when a target frame image is transmitted in a progressive mode. The specific technical scheme is as follows: the method comprises the steps of obtaining a target frame image, obtaining a macro block code stream prediction table corresponding to the target frame image and the number M of transmitted layers of a previous frame according to the target frame image, obtaining a prediction code stream corresponding to each target layer in the target frame image through the macro block code stream prediction table and the number M of transmitted layers of the previous frame, and determining the number of target layers which can be transmitted by the current bandwidth by comparing the prediction code stream with the current bandwidth. The present disclosure is for image coding.

Description

Data transmission method and device
Technical Field
The present disclosure relates to the field of electronic information technologies, and in particular, to a data transmission method and apparatus.
Background
In order to improve the efficiency of image transmission, the prior art adopts a progressive transmission mode, which is as follows: and calculating the conversion layer data of the current frame which can be transmitted by the current bandwidth in a circulating iteration mode, and further determining how to transmit all layers of the current frame to a receiving end in batches. Wherein, the conversion layer data is the most of the data of the graph layer which can be transmitted by the current bandwidth. It is understood that the translation layer includes from the starting layer to the target layer, for example, the current bandwidth can be transmitted from layer 1 to layer 5 at most, then layers 1-5 are denoted as the translation layer, layer 1 is the starting layer, and layer 5 is the target layer.
However, in the method, the conversion layer is determined in a loop iteration mode, so that the code stream of the conversion layer approaches to the bandwidth. The processing flow can find that the conversion layer finally suitable for the current bandwidth can be determined only through multiple times of superposition and comparison, and the repeated calculation greatly wastes calculation resources, reduces the processing efficiency and cannot meet the real-time transmission of multi-frame videos.
Disclosure of Invention
The embodiment of the disclosure provides a data transmission method and device, which can solve the problem of low data processing efficiency when a target frame image is transmitted in a progressive mode. The technical scheme is as follows:
according to a first aspect of the embodiments of the present disclosure, there is provided a data transmission method, including:
acquiring a target frame image, wherein the target frame image comprises N layers;
acquiring a preset layer number M and a macro block code stream prediction table corresponding to the target frame image according to the target frame image, wherein the preset layer number M refers to the layer number of a last frame image corresponding to the target frame image, which is transmitted, and the macro block code stream prediction table refers to the code stream required by transmitting each layer of image in the preset image;
when the target frame image comprises a changed macro block, acquiring a predicted transmission resource corresponding to the preset layer number M according to the macro block code stream prediction table, wherein the changed macro block is determined according to a comparison result between the target frame image and the previous frame image, and the preset transmission resource refers to a transmission resource required for transmitting a first layer to an Mth layer in the target frame image;
determining the number of target layers corresponding to the target frame image according to the comparison result of the predicted transmission resource and the target transmission resource;
and transmitting the layers corresponding to the target layer number in the target frame image.
In one embodiment, the obtaining a macroblock code stream prediction table corresponding to the target frame image in the method includes:
acquiring a preset image, and dividing the preset image into N layers, wherein the preset image comprises M macro blocks;
acquiring a transmission code stream required by each layer of image in the N layers of images;
and acquiring a macro block code stream prediction table of the preset image according to the transmission code stream and the M macro blocks required by each layer of image in the N layers of images.
In one embodiment, the method for obtaining the predicted transmission resource comprises the following steps:
acquiring the number of the changed macro blocks and corresponding prediction code streams of first to M layers of images in the transformed macro blocks in the macro block code stream prediction table;
and acquiring the predicted transmission resource according to the number of the changed macro blocks and the predicted code stream.
In one embodiment, the method further comprises:
acquiring a target code stream required from the initial layer to the M layer according to the target transmission bandwidth;
obtaining the predicted code stream required from the initial layer to the M layer according to the macroblock code stream prediction table;
comparing the predicted code stream with the target code stream and generating a comparison result;
and when the comparison result shows that the difference value between the predicted code stream and the target code stream is greater than a preset value, updating the macro block code stream prediction table according to the target code stream.
In one embodiment, the determining the number of target layers corresponding to the target frame image in the method includes:
obtaining a comparison result of the predicted transmission resource and the target transmission resource;
when the comparison result is smaller than a preset value, determining that the number of target layers is M;
when the comparison result is greater than a preset value, acquiring residual transmission resources, wherein the residual transmission resources refer to residual transmission resources after the target transmission resources transmit the layers corresponding to the M layers;
and transmitting the residual layers in the target frame image layer by layer according to the residual transmission resources until the residual transmission resources do not meet the preset requirement, acquiring the transmitted layers at the moment, determining the transmitted layers as target layers, and updating the preset layer number M.
In one embodiment, the method further comprises:
when the target frame image does not include the changed macro block, acquiring the layer number of the transmitted layer corresponding to each macro block in the previous frame image corresponding to the target frame image;
and sequentially transmitting each layer of image layer which is not transmitted in the previous frame of image layer by layer according to the layer number value, acquiring the residual transmission resource after each layer of image layer is transmitted, and transmitting the next layer of image layer through the residual transmission resource when the residual transmission resource meets the preset condition until the residual transmission resource does not meet the preset condition or the previous frame of image is transmitted completely.
The data transmission method provided by the embodiment of the disclosure acquires a target frame image, acquires a macroblock code stream prediction table corresponding to the target frame image and a number of transmitted layers M of a previous frame according to the target frame image, acquires a prediction code stream corresponding to each target layer in the target frame image according to the macroblock code stream prediction table and the number of transmitted layers M of the previous frame, and rapidly determines a target layer number which can be transmitted by a current bandwidth, namely, a maximum layer number, by comparing the prediction code stream with the current bandwidth. The method and the device perform progressive coding in a table look-up mode, replace the original repeated superposition operation, improve the processing efficiency and save the computing resources.
According to a second aspect of the embodiments of the present disclosure, there is provided a data transmission apparatus including: a receiver, a processor and a transmitter,
the processor is respectively connected with the receiver and the transmitter;
the receiver is used for acquiring a target frame image, and the target frame image comprises N layers;
the processor is configured to obtain a preset number M of layers corresponding to the target frame image and a macroblock code stream prediction table according to the target frame image, where the preset number M refers to the number of layers that have been transmitted in a previous frame image corresponding to the target frame image, and the macroblock code stream prediction table refers to a code stream required for transmitting each layer of image in the preset image;
when the target frame image comprises a changed macro block, acquiring a predicted transmission resource corresponding to the preset layer number M according to the macro block code stream prediction table, wherein the changed macro block is determined according to a comparison result between the target frame image and the previous frame image, and the preset transmission resource refers to a transmission resource required for transmitting a first layer to an Mth layer in the target frame image;
determining the number of target layers corresponding to the target frame image according to the comparison result of the predicted transmission resource and the target transmission resource;
the transmitter is configured to transmit layers corresponding to the number of target layers in the target frame image.
In one embodiment, the processor in the apparatus is further configured to,
acquiring a target code stream required from the initial layer to the M layer according to the target transmission bandwidth;
obtaining the predicted code stream required from the initial layer to the M layer according to the macroblock code stream prediction table;
comparing the predicted code stream with the target code stream and generating a comparison result;
and when the comparison result shows that the difference value between the predicted code stream and the target code stream is greater than a preset value, updating the macro block code stream prediction table according to the target code stream.
In one embodiment, the processor in the apparatus is further configured to,
obtaining a comparison result of the predicted transmission resource and the target transmission resource;
when the comparison result is smaller than a preset value, determining that the number of target layers is M;
when the comparison result is greater than a preset value, acquiring residual transmission resources, wherein the residual transmission resources refer to residual transmission resources after the target transmission resources transmit the layers corresponding to the M layers;
and transmitting the residual layers in the target frame image layer by layer according to the residual transmission resources until the residual transmission resources do not meet the preset requirement, acquiring the transmitted layers at the moment, determining the transmitted layers as target layers, and updating the preset layer number M.
In one embodiment, the processor in the apparatus is further configured to,
when the target frame image does not include the changed macro block, acquiring the layer number of the transmitted layer corresponding to each macro block in the previous frame image corresponding to the target frame image;
and sequentially transmitting each layer of image layer which is not transmitted in the previous frame of image layer by layer according to the layer number value, acquiring the residual transmission resource after each layer of image layer is transmitted, and transmitting the next layer of image layer through the residual transmission resource when the residual transmission resource meets the preset condition until the residual transmission resource does not meet the preset condition or the previous frame of image is transmitted completely.
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 a data transmission method provided by an embodiment of the present disclosure;
fig. 2 is a schematic diagram of a macroblock code stream prediction table of a data transmission method according to an embodiment of the present disclosure;
fig. 3a is a schematic diagram 1 illustrating an update of a macroblock code stream prediction table in a data transmission method according to an embodiment of the present disclosure;
fig. 3b is a schematic diagram of updating a macroblock code stream prediction table in a data transmission method according to an embodiment of the present disclosure;
fig. 4 is a structural diagram of a data transmission device 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.
An embodiment of the present disclosure provides a data transmission method, as shown in fig. 1, the data transmission method includes the following steps:
101. and acquiring a target frame image, wherein the target frame image comprises N layers.
The target frame is a frame of image in the target video, and the target frame comprises a plurality of macro blocks.
In an alternative embodiment, the method provided by the present disclosure further comprises: performing layering processing on the target frame image to generate N layers, including:
performing discrete cosine transform processing on the target frame image, and determining a direct current component and an alternating current component in the target frame image;
and carrying out layering processing on the target frame image according to the direct current component and the alternating current component to generate N layers.
102. And acquiring a preset layer number M and a macro block code stream prediction table corresponding to the target frame image according to the target frame image.
The preset layer number M refers to the layer number of the last frame image transmitted corresponding to the target frame image.
When the target frame is a first frame image, the preset layer number M is determined according to a macroblock code stream prediction table and a target transmission resource, and the specific process comprises the following steps:
the method comprises the steps of firstly, quantizing and rearranging a target frame image, and dividing the target frame image into N layers of images.
Specifically, the quantization rearrangement processing is based on a JPEG encoding method, the quantization processing is to reduce the amount of data to be encoded after DCT transformation, and the rearrangement processing is to enhance the data correlation between front and rear macroblocks in Huffman encoding after quantization.
And step two, acquiring a preset initial macro block code stream prediction table.
And step three, obtaining a predicted total code stream of the 1 st layer to the m th layer of the current frame and a required predicted transmission bandwidth according to the number of the macro blocks to be coded in the target frame image and the predicted code stream corresponding to the 1 st layer to the m th layer in the prediction table (if the total number of N layers is 17, 1< (m) > (17)).
Step four, finding a prediction target layer M corresponding to the prediction total code stream closest to the current bandwidth threshold value in the searched prediction total code streams according to the prediction transmission bandwidth and the current bandwidth; for example, the predicted transmission bandwidth required to transmit the first layer to the second layer is 10 KB; the predicted transmission bandwidth required to transmit the first layer to the third layer is 20 KB; the predicted transmission bandwidth required to transmit the first to fourth layers is 30 KB; the current transmission bandwidth is 25KB, and the prediction target layer M is determined to be 3 in comparison with the prediction transmission bandwidth.
Step five, coding the 1 st-m layers in the current frame to obtain an actual code stream;
and judging whether the difference value between the predicted total code stream and the actual code stream is greater than a preset difference value, wherein the preset difference value can be set to be 10kb, if so, performing self-adaptive updating on the initial macro block code stream prediction table, and if not, transmitting the target layer.
The macroblock code stream prediction table in the method provided by the present disclosure refers to a code stream required for transmitting each layer of image in the preset image, and the specific process of obtaining the macroblock code stream prediction table according to the preset image includes:
acquiring a preset image, and dividing the preset image into N layers, wherein the preset image comprises M macro blocks;
acquiring a transmission code stream required by each layer of image in the N layers of images;
and acquiring a macro block code stream prediction table of the preset image according to the transmission code stream and the M macro blocks required by each layer of image in the N layers of images.
In order to make the values of the prediction table of the macroblock code stream more accurate, the preset image may include multiple types of pictures, including landscape pictures, text pictures, desktop pictures, pure color pictures, and the like.
Taking the example of collecting 26 pictures in total from the pictures a to Z, the method encodes the data of each conversion layer of the pictures of different types, counts the code streams of each conversion layer, and generates a prediction table of the macro block code stream.
Firstly, processing an image A:
after the image A is divided into 17 layers of images, each layer is taken as an initial layer and Huffman coding is carried out from a low layer to a high layer, and code streams of the images from the initial layer to the highest layer are counted.
For example, calculating the code stream of the 1 st layer, the code streams of the 1 st to 2 nd layers, the code streams of the 1 st to 3 rd layers, and the code streams of the 1 st to 17 th layers; then calculating the code stream of the 2 nd layer, the code streams of the 2 nd to 3 rd layers until the code streams of the 2 nd to 17 th layers; until the code stream of the 17 th layer is calculated.
Step two, carrying out statistics on code streams required by each layer of image in the image A obtained in the step one to obtain the sum of the code streams, and comparing the sum with the total number of the macro blocks of the image A to obtain the average code stream of each layer in the macro block of the image A;
and step three, respectively calculating the average code stream of each conversion layer of the macro blocks from the graph B to the graph Z according to the step one and the step two.
And step four, adding the average code streams of all the conversion layers in the calculated pictures A to Z, and comparing the total number of the pictures to obtain an initial macro block code stream prediction table.
For example, in the image a, the average code stream of the macro blocks of the layers 1 to 3 of the conversion layer is 100, and the average code stream of the macro blocks of the layers 1 to 10 of the conversion layer is 550; in the image B, the average code stream of the macro blocks of the layers 1 to 3 of the conversion layer is 150, and the average code stream of the macro blocks of the layers 1 to 10 of the conversion layer is 500; in the image C, the average code stream of the macro blocks of the layers 1 to 3 of the conversion layer is 50, and the average code stream of the macro blocks of the layers 1 to 10 of the conversion layer is 600; then, in the obtained macroblock code stream prediction table, the code stream of the 1 st to 3 rd layers of the conversion layers is (100+150+50)/3, which is 100, and the code stream of the 1 st to 10 th layers of the conversion layers is (550+500+600)/3, which is 550.
As shown in fig. 2, the abscissa in the graph represents the target layer, and the corresponding ordinate represents the predicted codestream corresponding to the target layer, for example, the outermost black line is the first layer, and when the initial layer is the 1 st layer and the target layer is the 12 th layer, the codestream transmitted from the 1 st layer to the 12 th layer is 77.
103. And when the target frame image comprises the changed macro block, acquiring the predicted transmission resources corresponding to the preset layer number M from the first layer according to the macro block code stream prediction table.
The changed macro block is determined according to the comparison result between the target frame image and the previous frame image, and the predicted transmission resources are as follows:
acquiring the number of the changed macro blocks and corresponding prediction code streams of first to M layers of images in the transformed macro blocks in the macro block code stream prediction table;
and acquiring the predicted transmission resource according to the number of the changed macro blocks and the predicted code stream.
When the method of the present disclosure transmits the unchanged macro block in the target frame image, the method further includes:
when the target frame image does not include the changed macro block, acquiring the layer number of the transmitted layer corresponding to each macro block in the previous frame image corresponding to the target frame image;
and sequentially transmitting each layer of image layer which is not transmitted in the previous frame of image layer by layer according to the layer number value, acquiring the residual transmission resource after each layer of image layer is transmitted, and transmitting the next layer of image layer through the residual transmission resource when the residual transmission resource meets the preset condition until the residual transmission resource does not meet the preset condition or the previous frame of image is transmitted completely.
The transmission effect and the display effect of the previous frame of image can be improved by judging the layer number of each macro block in the previous frame of whole image corresponding to the transmitted layer number and transmitting the previous frame of image according to the layer number, specifically, the macro block with small transmission layer number has low pixel and poor display effect, if the layer number of each macro block in the whole frame of image corresponding to the transmitted layer number is different, the image display effect is that a part is clear and a part is fuzzy, therefore, the macro block of the fuzzy part needs to be transmitted again, thereby finally achieving the purpose that the layer number of each macro block in the whole frame of image corresponding to the transmitted layer number is consistent, namely the definition of the whole image is consistent, and the display effect is optimal.
The method provided by the disclosure can transmit the layer which is not transmitted by the previous frame image through the target frame image, thereby realizing the technical effect of progressive transmission. Namely, the scheme makes full use of the redundancy characteristic of human eyes, and under the premise of not influencing viewing experience, the original I frame or the changed frame is processed in a layered mode, the corresponding maximum layer number is coded and transmitted according to the current transmission bandwidth environment, and the rest layer numbers are distributed in the spare time period of the following frame bandwidth, so that the progressive effect that when a scene is transmitted and a picture or an I frame is changed, the picture is blurred to be clear is achieved, instantaneous code streams are evenly distributed to multiple frames, and the network congestion caused by overlarge code streams is reduced.
The precision of the prediction transmission resource required in the present disclosure can be obtained by the macro block code stream prediction table, so that in order to improve the precision of the macro block prediction code stream table, the present disclosure further includes a self-adaptive updating macro block code stream prediction table, and the specific process includes:
acquiring a target code stream required from the initial layer to the M layers according to a target transmission bandwidth, wherein the initial layer is specifically the initial layer of a changed macro block from the first layer, and the initial layer of a non-changed macro block is determined according to a layer transmitted by a previous frame of image;
obtaining the predicted code stream required from the initial layer to the M layer according to the macroblock code stream prediction table;
comparing the predicted code stream with the target code stream and generating a comparison result;
when the comparison result shows that the difference between the predicted code stream and the target code stream is greater than the preset value, the macroblock code stream prediction table is updated according to the target code stream, as shown in fig. 3, which illustrates a specific example:
1) and calculating a code stream from a starting layer to a target layer data in the current macro block, wherein the starting layer is 1, and the target layer is 6, and the actual code stream after the 1 st to 6 th layers of coding is calculated.
2) And inquiring an original macro block code stream prediction table to obtain a prediction code stream corresponding to the 6 th layer of the target layer in the table.
3) Comparing the calculated actual code stream with the inquired predicted code stream, and judging whether an error value between the actual code stream and the predicted code stream is greater than an error threshold, wherein the error threshold can be set to be 10 kb;
as shown in fig. 3a, the point X in the graph is the actual code stream, and the error value is obtained by comparing the actual code stream with the predicted code stream.
4) If the error value is larger than the error threshold value, determining that the original macro block code stream prediction table is not suitable for the current macro block;
then, the updated prediction table of the macroblock code stream can be obtained according to the curve variation trend in the prediction table of the original macroblock code stream, the initial coordinate value of the curve, and the calculated actual code stream.
That is, the starting point of the original curve in the original macroblock code stream prediction table is still used as the starting point, all the original curves in the original macroblock code stream prediction table are shifted down by the magnitude of the error value according to the vertical coordinate corresponding to the target layer as the sixth layer, as shown in fig. 3b, and the updated macroblock code stream prediction table can be obtained.
5) And predicting the code stream of the conversion layer of the current frame again by using the updated macro block code stream prediction table, and transmitting all layers of the current frame to a receiving end in batches.
Because the coding code streams of different types of images have certain difference, the method provided by the disclosure can judge whether the difference between a preset original macro block code stream prediction table and the actual image data to be transmitted is reasonable, namely whether the difference value of the two is within a preset range, if so, the preset original macro block code stream prediction table is continuously used for determining the maximum conversion layer data corresponding to the current bandwidth, if not, the curve in the preset original macro block code stream prediction table is adjusted according to the difference, and then the updated macro block code stream prediction table is used for determining the maximum conversion layer data corresponding to the current bandwidth, so that the self-adaptive updating is realized, and the accuracy is improved.
104. Determining the number of target layers corresponding to the target frame image according to the comparison result of the predicted transmission resource and the target transmission resource;
and transmitting the layers corresponding to the target layer number in the target frame image.
The method for determining the number of target layers corresponding to the target frame image includes:
obtaining a comparison result of the predicted transmission resource and the target transmission resource;
when the comparison result is smaller than a preset value, determining that the number of target layers is M;
when the comparison result is greater than a preset value, acquiring residual transmission resources, wherein the residual transmission resources refer to residual transmission resources after the target transmission resources transmit the layers corresponding to the M layers;
and transmitting the residual layers in the target frame image layer by layer according to the residual transmission resources until the residual transmission resources do not meet the preset requirement, acquiring the transmitted layers at the moment, determining the transmitted layers as target layers, and updating the preset layer number M.
Specific examples are listed here for explanation:
firstly, dividing the current frame into M macro blocks, determining the predicted code stream of the 1 st layer as 12 by inquiring a macro block code stream prediction table, judging whether M12 is larger than the current bandwidth or not,
if not, continuously inquiring the macroblock code stream prediction table, determining the prediction code stream of the 1 st to 2 nd layers as 24, judging whether M24 is larger than the current bandwidth or not,
if not, continuously inquiring the macroblock code stream prediction table, determining the prediction code stream of the 1 st to 3 rd layers as 33, judging whether M33 is larger than the current bandwidth or not,
if so, it may be determined that the maximum conversion layer that can be transmitted by the current bandwidth is the layer 1 to layer 2, and then the layer 1 to layer 2 data of the frame may be encoded and transmitted.
Then, by inquiring the macroblock code stream prediction table, determining that the predicted code stream of the 3 rd layer is 11, judging whether M11 is larger than the current bandwidth, if not, continuously inquiring the macroblock code stream prediction table, determining that the predicted code streams of the 3 rd to 4 th layers are 20, judging whether M20 is larger than the current bandwidth, if not, continuously inquiring the macroblock code stream prediction table, determining that the predicted code streams of the 3 rd to 5 th layers are 28, judging whether M28 is larger than the current bandwidth, if so, determining that the maximum conversion layer which can be transmitted by the current bandwidth is the 3 rd to 4 th layers, and further, encoding and transmitting the data of the 3 rd to 4 th layers of the frame.
And thus, all layers of the current frame are transmitted.
The data transmission method provided by the embodiment of the disclosure acquires a target frame image, acquires a macroblock code stream prediction table corresponding to the target frame image and a number of transmitted layers M of a previous frame according to the target frame image, acquires a prediction code stream corresponding to each target layer in the target frame image according to the macroblock code stream prediction table and the number of transmitted layers M of the previous frame, and rapidly determines a target layer number which can be transmitted by a current bandwidth, namely, a maximum layer number, by comparing the prediction code stream with the current bandwidth. The method and the device perform progressive coding in a table look-up mode, replace the original repeated superposition operation, improve the processing efficiency and save the computing resources.
More importantly, the macro block code stream prediction table used in the coding process can be updated and adjusted in real time according to the target frame image and the target transmission resource, and the coding processing precision is improved.
Example two
Based on the data transmission method described in the embodiment corresponding to fig. 1, the following is an embodiment of the apparatus of the present disclosure, which may be used to execute the embodiment of the method of the present disclosure.
An embodiment of the present disclosure provides a data transmission apparatus, as shown in fig. 4, the data transmission apparatus 40 includes: a receiver 401, a processor 402 and a transmitter 403,
the processor 402 is connected to the receiver 401 and the transmitter 403, respectively;
the receiver 401 is configured to obtain a target frame image, where the target frame image includes N layers;
the processor 402 is configured to obtain a preset number M of layers corresponding to the target frame image and a macroblock code stream prediction table according to the target frame image, where the preset number M refers to the number of layers that have been transmitted in a previous frame image corresponding to the target frame image, and the macroblock code stream prediction table refers to a code stream required for transmitting each layer of image in the preset image;
when the target frame image comprises a changed macro block, acquiring a predicted transmission resource corresponding to the preset layer number M according to the macro block code stream prediction table, wherein the changed macro block is determined according to a comparison result between the target frame image and the previous frame image, and the preset transmission resource refers to a transmission resource required for transmitting a first layer to an Mth layer in the target frame image;
determining the number of target layers corresponding to the target frame image according to the comparison result of the predicted transmission resource and the target transmission resource;
the transmitter 403 is configured to transmit the image layers corresponding to the number of target layers in the target frame image.
In one embodiment, the processor 402 in the apparatus 40 is further configured to,
acquiring a target code stream required from the initial layer to the M layer according to the target transmission bandwidth;
obtaining the predicted code stream required from the initial layer to the M layer according to the macroblock code stream prediction table;
comparing the predicted code stream with the target code stream and generating a comparison result;
and when the comparison result shows that the difference value between the predicted code stream and the target code stream is greater than a preset value, updating the macro block code stream prediction table according to the target code stream.
In one embodiment, the processor 402 in the apparatus 40 is further configured to,
obtaining a comparison result of the predicted transmission resource and the target transmission resource;
when the comparison result is smaller than a preset value, determining that the number of target layers is M;
when the comparison result is greater than a preset value, acquiring residual transmission resources, wherein the residual transmission resources refer to residual transmission resources after the target transmission resources transmit the layers corresponding to the M layers;
and transmitting the residual layers in the target frame image layer by layer according to the residual transmission resources until the residual transmission resources do not meet the preset requirement, acquiring the transmitted layers at the moment, determining the transmitted layers as target layers, and updating the preset layer number M.
In one embodiment, the processor 402 in the apparatus 40 is further configured to,
when the target frame image does not include the changed macro block, acquiring the layer number of the transmitted layer corresponding to each macro block in the previous frame image corresponding to the target frame image;
and sequentially transmitting each layer of image layer which is not transmitted in the previous frame of image layer by layer according to the layer number value, acquiring the residual transmission resource after each layer of image layer is transmitted, and transmitting the next layer of image layer through the residual transmission resource when the residual transmission resource meets the preset condition until the residual transmission resource does not meet the preset condition or the previous frame of image is transmitted completely.
The data transmission device provided by the embodiment of the disclosure acquires a target frame image, acquires a macroblock code stream prediction table corresponding to the target frame image and a number of transmitted layers M of a previous frame according to the target frame image, acquires a prediction code stream corresponding to each target layer in the target frame image according to the macroblock code stream prediction table and the number of transmitted layers M of the previous frame, and rapidly determines a target number of layers which can be transmitted by a current bandwidth, namely, a maximum number of layers by comparing the prediction code stream with the current bandwidth. The method and the device perform progressive coding in a table look-up mode, replace the original repeated superposition operation, improve the processing efficiency and save the computing resources.
More importantly, the macro block code stream prediction table used in the coding process can be updated and adjusted in real time according to the target frame image and the target transmission resource, and the coding processing precision is improved.
Based on the data transmission method described in the embodiment corresponding to fig. 1 and fig. 2, 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 data transmission method described in the embodiment corresponding to fig. 1 and fig. 2, which is not described herein again.
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. A method of data transmission, the method comprising:
acquiring a target frame image, wherein the target frame image comprises N layers;
acquiring a preset layer number M and a macro block code stream prediction table corresponding to the target frame image according to the target frame image, wherein the preset layer number M refers to the layer number of a last frame image corresponding to the target frame image, which is transmitted, and the macro block code stream prediction table refers to a code stream required by transmission of each layer of image in the preset image;
when the target frame image comprises a changed macro block, acquiring a predicted transmission resource corresponding to the preset layer number M according to the macro block code stream prediction table, wherein the changed macro block is determined according to a comparison result between the target frame image and the previous frame image, and the preset transmission resource is a transmission resource required for transmitting a first layer to an Mth layer in the target frame image;
determining the number of target layers corresponding to the target frame image according to the comparison result of the predicted transmission resource and the target transmission resource;
and transmitting the layers corresponding to the target layer number in the target frame image.
2. The method according to claim 1, wherein obtaining a macroblock code stream prediction table corresponding to the target frame image comprises:
acquiring a preset image, and dividing the preset image into N layers, wherein the preset image comprises M macro blocks;
acquiring a transmission code stream required by each layer of image in the N layers of images;
and acquiring a macro block code stream prediction table of the preset image according to the transmission code stream and the M macro blocks required by each layer of image in the N layers of images.
3. The method of claim 1, wherein the obtaining the predicted transmission resource comprises:
acquiring the number of the changed macro blocks and corresponding prediction code streams of first to M layers of images in the transformed macro blocks in the macro block code stream prediction table;
and acquiring the predicted transmission resources according to the number of the changed macro blocks and the predicted code stream.
4. The method of claim 3, further comprising:
acquiring a target code stream required from an initial layer to the M layer according to a target transmission bandwidth;
acquiring the predicted code stream required from the initial layer to the M layer according to the macroblock code stream prediction table;
comparing the predicted code stream with the target code stream and generating a comparison result;
and when the comparison result shows that the difference value between the predicted code stream and the target code stream is greater than a preset value, updating the macro block code stream prediction table according to the target code stream.
5. The method according to claim 1, wherein the determining a number of target layers corresponding to the target frame image comprises:
obtaining a comparison result of the predicted transmission resource and the target transmission resource;
when the comparison result is smaller than a preset value, determining that the number of target layers is M;
when the comparison result is larger than a preset value, acquiring residual transmission resources, wherein the residual transmission resources refer to residual transmission resources after the target transmission resources transmit the layers corresponding to the M layers;
and transmitting the residual layers in the target frame image layer by layer according to the residual transmission resources until the residual transmission resources do not meet the preset requirement, acquiring the transmitted layers at the moment, determining the transmitted layers as target layers, and updating the preset layer number M.
6. The method of claim 1, further comprising:
when the target frame image does not include the changed macro block, acquiring the layer number of the transmitted layer corresponding to each macro block in the previous frame image corresponding to the target frame image;
and sequentially transmitting each layer of image layer which is not transmitted in the previous frame of image layer by layer according to the layer number value, acquiring residual transmission resources after each layer of image layer is transmitted, and transmitting the next layer of image layer through the residual transmission resources when the residual transmission resources meet preset conditions until the residual transmission resources do not meet the preset conditions or the previous frame of image is transmitted completely.
7. A data transmission apparatus, comprising: a receiver, a processor and a transmitter,
the processor is respectively connected with the receiver and the transmitter;
the receiver is used for acquiring a target frame image, and the target frame image comprises N layers;
the processor is configured to obtain a preset number M of layers corresponding to the target frame image and a macroblock code stream prediction table according to the target frame image, where the preset number M refers to the number of layers that a previous frame image corresponding to the target frame image has been transmitted, and the macroblock code stream prediction table refers to a code stream required for transmitting each layer of image in the preset image;
when the target frame image comprises a changed macro block, acquiring a predicted transmission resource corresponding to the preset layer number M according to the macro block code stream prediction table, wherein the changed macro block is determined according to a comparison result between the target frame image and the previous frame image, and the preset transmission resource is a transmission resource required for transmitting a first layer to an Mth layer in the target frame image;
determining the number of target layers corresponding to the target frame image according to the comparison result of the predicted transmission resource and the target transmission resource;
and the transmitter is used for transmitting the layers corresponding to the target layer number in the target frame image.
8. The apparatus of claim 7, wherein the processor is further configured to,
acquiring a target code stream required from an initial layer to the M layer according to a target transmission bandwidth;
acquiring the predicted code stream required from the initial layer to the M layer according to the macroblock code stream prediction table;
comparing the predicted code stream with the target code stream and generating a comparison result;
and when the comparison result shows that the difference value between the predicted code stream and the target code stream is greater than a preset value, updating the macro block code stream prediction table according to the target code stream.
9. The apparatus of claim 7, wherein the processor is further configured to,
obtaining a comparison result of the predicted transmission resource and the target transmission resource;
when the comparison result is smaller than a preset value, determining that the number of target layers is M;
when the comparison result is larger than a preset value, acquiring residual transmission resources, wherein the residual transmission resources refer to residual transmission resources after the target transmission resources transmit the layers corresponding to the M layers;
and transmitting the residual layers in the target frame image layer by layer according to the residual transmission resources until the residual transmission resources do not meet the preset requirement, acquiring the transmitted layers at the moment, determining the transmitted layers as target layers, and updating the preset layer number M.
10. The apparatus of claim 7, wherein the processor is further configured to,
when the target frame image does not include the changed macro block, acquiring the layer number of the transmitted layer corresponding to each macro block in the previous frame image corresponding to the target frame image;
and sequentially transmitting each layer of image layer which is not transmitted in the previous frame of image layer by layer according to the layer number value, acquiring residual transmission resources after each layer of image layer is transmitted, and transmitting the next layer of image layer through the residual transmission resources when the residual transmission resources meet preset conditions until the residual transmission resources do not meet the preset conditions or the previous frame of image is transmitted completely.
CN202010266849.9A 2020-04-07 2020-04-07 Data transmission method and device Pending CN111556315A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010266849.9A CN111556315A (en) 2020-04-07 2020-04-07 Data transmission method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010266849.9A CN111556315A (en) 2020-04-07 2020-04-07 Data transmission method and device

Publications (1)

Publication Number Publication Date
CN111556315A true CN111556315A (en) 2020-08-18

Family

ID=72002283

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010266849.9A Pending CN111556315A (en) 2020-04-07 2020-04-07 Data transmission method and device

Country Status (1)

Country Link
CN (1) CN111556315A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112087625A (en) * 2020-08-27 2020-12-15 西安万像电子科技有限公司 Image processing method, image processing apparatus, server, and storage medium
CN112312136A (en) * 2020-09-25 2021-02-02 西安万像电子科技有限公司 Code stream control method and device
CN112422962A (en) * 2020-10-30 2021-02-26 西安万像电子科技有限公司 Method and device for controlling video coding layer
CN112422964A (en) * 2020-10-30 2021-02-26 西安万像电子科技有限公司 Progressive coding method and device
CN112698829A (en) * 2021-01-13 2021-04-23 腾讯科技(深圳)有限公司 Abnormal resource positioning method and device, storage medium and electronic equipment
CN112312136B (en) * 2020-09-25 2024-05-17 西安万像电子科技有限公司 Code stream control method and device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001177841A (en) * 1993-03-15 2001-06-29 Sony Corp Image signal transmission method and device, and image signal decoding method and device
JP2002218470A (en) * 2001-01-22 2002-08-02 Victor Co Of Japan Ltd Method for converting image encoded data rate and device for converting image encoding rate
US8345768B1 (en) * 2005-07-28 2013-01-01 Teradici Corporation Progressive block encoding using region analysis
US20130077672A1 (en) * 2010-06-11 2013-03-28 Kazushi Sato Image processing apparatus and method
US8411978B1 (en) * 2006-01-17 2013-04-02 Teradici Corporation Group encoding of wavelet precision
CN110149515A (en) * 2019-04-01 2019-08-20 西安万像电子科技有限公司 Data transmission method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001177841A (en) * 1993-03-15 2001-06-29 Sony Corp Image signal transmission method and device, and image signal decoding method and device
JP2002218470A (en) * 2001-01-22 2002-08-02 Victor Co Of Japan Ltd Method for converting image encoded data rate and device for converting image encoding rate
US8345768B1 (en) * 2005-07-28 2013-01-01 Teradici Corporation Progressive block encoding using region analysis
US8411978B1 (en) * 2006-01-17 2013-04-02 Teradici Corporation Group encoding of wavelet precision
US20130077672A1 (en) * 2010-06-11 2013-03-28 Kazushi Sato Image processing apparatus and method
CN110149515A (en) * 2019-04-01 2019-08-20 西安万像电子科技有限公司 Data transmission method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
孙晓艳等: "基于宏块的渐进、精细可伸缩的视频编码", 《软件学报》, 23 November 2002 (2002-11-23) *

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112087625A (en) * 2020-08-27 2020-12-15 西安万像电子科技有限公司 Image processing method, image processing apparatus, server, and storage medium
CN112312136A (en) * 2020-09-25 2021-02-02 西安万像电子科技有限公司 Code stream control method and device
CN112312136B (en) * 2020-09-25 2024-05-17 西安万像电子科技有限公司 Code stream control method and device
CN112422962A (en) * 2020-10-30 2021-02-26 西安万像电子科技有限公司 Method and device for controlling video coding layer
CN112422964A (en) * 2020-10-30 2021-02-26 西安万像电子科技有限公司 Progressive coding method and device
CN112422964B (en) * 2020-10-30 2024-05-17 西安万像电子科技有限公司 Progressive coding method and device
CN112698829A (en) * 2021-01-13 2021-04-23 腾讯科技(深圳)有限公司 Abnormal resource positioning method and device, storage medium and electronic equipment
CN112698829B (en) * 2021-01-13 2023-10-24 腾讯科技(深圳)有限公司 Abnormal resource positioning method and device, storage medium and electronic equipment

Similar Documents

Publication Publication Date Title
US9716891B2 (en) Quantization method and apparatus in encoding/decoding
CA2295689C (en) Apparatus and method for object based rate control in a coding system
CN111556315A (en) Data transmission method and device
CN110401833B (en) Image transmission method and device
US9014268B2 (en) Video encoder and its decoder
EP2563019B1 (en) Method and device for compressing and encoding image data
CN111131828B (en) Image compression method and device, electronic equipment and storage medium
US10609421B2 (en) Context derivation for coefficient coding
AU2011308759A1 (en) Motion compensation using decoder-defined vector quantized interpolation filters
CN111556318A (en) Data transmission method and device
CN107343202B (en) Feedback-free distributed video coding and decoding method based on additional code rate
CN110149515B (en) Data transmission method and device
CN110740316A (en) Data coding method and device
US8879622B2 (en) Interactive system and method for transmitting key images selected from a video stream over a low bandwidth network
US20050141616A1 (en) Video encoding and decoding methods and apparatuses using mesh-based motion compensation
US20150222905A1 (en) Method and apparatus for estimating content complexity for video quality assessment
CN115278250A (en) Low-bandwidth video transmission method and conference system
CN111447445B (en) Data transmission method and device
EP1484925A2 (en) Method and device for compressing image data
CN112351282A (en) Image data transmission method and device, nonvolatile storage medium and processor
CN112422964B (en) Progressive coding method and device
JP3032213B2 (en) Image encoding device and image decoding device
CN112312136B (en) Code stream control method and device
CN112040246B (en) Low-delay low-complexity fixed code rate control method
CN111901605B (en) Video processing method and 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